jazz
2023-12-08 bf4dca5344dee1a84b75d9993f4dfc59de3f3ee9
update_202312081934_项目-治疗室屏幕web-反馈调整
5个文件已修改
203 ■■■■ 已修改文件
index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/room/detail.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/room/list.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
index.html
@@ -3,7 +3,7 @@
  <head>
    <meta charset="utf-8">
    <title>芙艾医疗</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0, viewprot-fit:cover, minimal-ui">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0, viewprot-fit=cover, minimal-ui">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <!-- 应用以全屏模式运行 -->
src/App.vue
@@ -2,7 +2,12 @@
    <div id="app">
        <transition name="fade" mode="out-in">
            <!-- 页面,isRouterAlive 刷新用 -->
            <router-view v-if="isRouterAlive"/>
            <!-- <router-view v-if="isRouterAlive"/> -->
            <div>
                <keep-alive>
                    <router-view v-if="isRouterAlive" />
                </keep-alive>
            </div>
        </transition>
        <!-- Toast 提示 -->
@@ -27,7 +32,7 @@
import Login from '@/utils/jun_login.js'
import wxsign from '@/utils/wxsign.js'
import Config from './config'
import eruda from 'eruda'
// import eruda from 'eruda'
export default {
    name: 'App',
@@ -80,11 +85,11 @@
        console.log('app amounted')
        // 避免刷新导致code重复使用
        let code = this.getQueryString('code') // 微信回调code
        let cover = this.getQueryString('cover') // 是否封面入口
        let local_code = this.getLocalStorage('code') // 本地缓存code
        let isRule = this.getQueryString('rule')==1 // 规则
        let isCoupon = this.getQueryString('coupon')==1 // 优惠券
        // let code = this.getQueryString('code') // 微信回调code
        // let cover = this.getQueryString('cover') // 是否封面入口
        // let local_code = this.getLocalStorage('code') // 本地缓存code
        // let isRule = this.getQueryString('rule')==1 // 规则
        // let isCoupon = this.getQueryString('coupon')==1 // 优惠券
        // 以下情况需要重定向到长链
        // 1. 链接带有code,但code已经用过
@@ -94,20 +99,20 @@
        // 4. 非优惠券单页
        // console.dir(Config.createCodeUrl())
        if(Config.isWxLoginType){
            if (code && local_code == code || (!isCoupon && !isRule && !cover && !code && !Config.ismock && !Config.istest)) {
                // 该微信code已使用,重新跳转长链
                Login.toLongUrl()
                return
            } else {
                this.removeLocalStorage('code')
            }
        }
        // if(Config.isWxLoginType){
        //     if (code && local_code == code || (!isCoupon && !isRule && !cover && !code && !Config.ismock && !Config.istest)) {
        //         // 该微信code已使用,重新跳转长链
        //         Login.toLongUrl()
        //         return
        //     } else {
        //         this.removeLocalStorage('code')
        //     }
        // }
        // 刷新固定首页
        if (location.hash && location.hash!='#/') {
            this.$router.replace({name: 'root'})
        }
        // if (location.hash && location.hash!='#/') {
        //     this.$router.replace({name: 'root'})
        // }
        // 暴露到全局,jun_httpEvent.js 调用
        window.appLoading = this.loading.bind(this)
@@ -115,7 +120,7 @@
        window.appToast = this.toast.bind(this)
        // this.$refs.audio.play()
        if(Config.isWxLoginType) this.wxinit()
        // if(Config.isWxLoginType) this.wxinit()
    },
    methods: {
        // 微信初始化
src/pages/room/detail.vue
@@ -11,6 +11,7 @@
        </div>
      </div>
      <div class="right flex-1 flex flex-jcfe flex-ver">
        <el-button type="primary" icon="el-icon-refresh" class="reset_btn flex flex-center" size="small" style="width: 100px;" @click="getData">刷新</el-button>
        <div class="reset_btn flex flex-center" @click="resetStatus">重置房间状态</div>
        <div class="page_date">
          <div class="page_week">{{ timeObj.week }}</div>
@@ -69,17 +70,17 @@
        <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
        <div v-if="roomInfo" class="room_main_tip">-{{ statusTx[roomInfo.status] }}-</div>
        <div v-if="roomInfo && roomInfo.status >= 1" class="room_left_btn_box flex flex-ver">
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow" @click="setStatus('客人休息', 2)">客人休息</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green" @click="setStatus('空闲', 0)">结束打扫</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('客人休息', 2)">客人休息</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('空闲', 0)">结束打扫</div>
        </div>
      </div>
      <div class="right">
        <div class="right_block flex flex-col">
          <div class="guest_title flex flex-center">等待诊疗</div>
          <div class="guest_block flex-1">
            <div class="guest_list">
            <div v-if="assignTreatList && assignTreatList.length" class="guest_list">
              <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)">
                <div class="guest_list__td">
                  <div class="tx flex flex-ver">
@@ -94,18 +95,22 @@
                  <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span>
                </div>
                <div class="guest_list__td flex flex-center">
                  <div class="icon">
                  <div class="tx">切换</div>
                  <!-- <div class="icon">
                    <img class="img" src="static/imgs/choose.png">
                  </div>
                  </div> -->
                </div>
              </div>
            </div>
            <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list">
              <div class="guest_list__row flex flex-center rowtip">暂无数据</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 客人和有安排 -->
    <div v-if="occupyInfoView && (assignTreatList && assignTreatList.length)" class="page_container flex flex-1">
    <div v-if="occupyInfoView" class="page_container flex flex-1">
      <div class="main flex-1">
        <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
        <div class="room_content">
@@ -128,10 +133,10 @@
        </div>
        <div v-if="roomInfo" class="room_left_btn_box flex flex-ver" style="margin-top: 105px;">
          <div v-if="roomInfo.status == 0" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('使用中', 1)">开始治疗</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow" @click="setStatus('客人休息', 2)">客人休息</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green" @click="setStatus('空闲', 0)">结束打扫</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('客人休息', 2)">客人休息</div>
          <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
          <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('空闲', 0)">结束打扫</div>
        </div>
      </div>
      <div class="right flex flex-col">
@@ -165,7 +170,7 @@
        <div class="guest_box flex flex-col">
          <div class="guest_title flex flex-center">等待诊疗</div>
          <div class="guest_block flex-1">
            <div class="guest_list">
            <div v-if="assignTreatList && assignTreatList.length" class="guest_list">
              <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)">
                <div class="guest_list__td">
                  <div class="tx flex flex-ver">
@@ -180,11 +185,15 @@
                  <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span>
                </div>
                <div class="guest_list__td flex flex-center">
                  <div class="icon">
                  <div class="tx">切换</div>
                  <!-- <div class="icon">
                    <img class="img" src="static/imgs/choose.png">
                  </div>
                  </div> -->
                </div>
              </div>
            </div>
            <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list">
              <div class="guest_list__row flex flex-center rowtip">暂无数据</div>
            </div>
          </div>
        </div>
@@ -229,6 +238,7 @@
  },
  computed: {
    occupyInfoView() {
      // console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg)
      // 有占用
      if (this.occupyInfo) {
        return this.occupyInfo
@@ -245,15 +255,20 @@
      }
    }
  },
  mounted() {
  activated() {
    console.log('roomDetail mounted')
    this.id = this.$route.query.id || ''
    this.init()
  },
  mounted() {},
  destroyed() {
  },
  methods: {
    init() {
      // 进入页面先初始化常量标识
      isUseDefault = false
      isUseDefaultChg = 0
      // 计时
      this.countGetTime(this, 'timeObj', 'detail')
      // 轮询getData,8秒一次
@@ -319,7 +334,14 @@
      // 关闭轮询
      this.stopPollingAjaxFn('detail')
      // 返回
      this.$router.go(-1)
      // console.log('111111111', this.$route.meta.isPush)
      if (this.$route && this.$route.meta && this.$route.meta.isPush) {
        this.$router.go(-1)
      } else {
        this.$router.push({
          path: `/`
        })
      }
    },
    // 未有安排直接状态变更
    statusChg(e) {
@@ -440,6 +462,8 @@
  text-align: center;
  font-family: Microsoft Yahei;
  cursor: pointer;
  border: 0;
  margin-left: 20px;
}
.page_container .main {
  /* height: 100%; */
@@ -629,6 +653,12 @@
.page_container .right .guest_list__row:nth-child(2n) {
  background-color: #fff;
}
.page_container .right .guest_list__row.rowtip {
  background-color: #fff;
  line-height: 30px;
  color: rgba(0,0,0,.5);
  font-size: 22px;
}
.page_container .right .guest_list__td {}
.page_container .right .guest_list__td .tx {
  line-height: 30px;
src/pages/room/list.vue
@@ -60,6 +60,7 @@
  computed: {
  },
  activated() {},
  mounted() {
    console.log('roomList mounted')
    this.init()
@@ -126,6 +127,15 @@
    },
    // 跳转详情
    selectRoom(item = {}) {
      // console.log(this.$router.options.routes)
      // this.$router.options.routes
      if (this.$router && this.$router.options && this.$router.options.routes) {
        this.$router.options.routes.forEach((o) => {
          if (o.name === 'roomDetail') {
            o.meta && (o.meta.isPush = true)
          }
        })
      }
      this.$router.push({
        path: `./room/detail?id=${item.id || ''}`
      })
src/router/index.js
@@ -18,29 +18,83 @@
      // component: () => import('@/pages/login/index')
      component: () => import('@/pages/room/list')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/pages/login/index')
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/pages/index')
    },
    // {
    //   path: '/login',
    //   name: 'login',
    //   component: () => import('@/pages/login/index')
    // },
    // {
    //   path: '/index',
    //   name: 'index',
    //   component: () => import('@/pages/index')
    // },
    {
      path: '/room/list',
      name: 'roomList',
      component: () => import('@/pages/room/list')
      // meta: { title: '治疗室列表', keepAlive: true }
      component: () => import('@/pages/room/list'),
      meta: { title: '治疗室列表', keepAlive: true }
    },
    {
      path: '/room/detail',
      name: 'roomDetail',
      component: () => import('@/pages/room/detail')
      // meta: { title: '治疗室详情', keepAlive: false }
      component: () => import('@/pages/room/detail'),
      meta: { title: '治疗室详情', isPush: false }
    }
  ]
})
// 路由跳转之前
// 是否已经跳转过房间详情
var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail')
if (!isJumpeRoomDetail) {
  localStorage.setItem('isJumpeRoomDetail', '0') // 是否已经跳转过房间详情
}
// 跳转房间详情
function jumpRoomDetail() {
  var roomId = localStorage.getItem('roomId')
  var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail')
  // 还没跳转且有localroomId的
  // console.log('7777777777777777777777777777', isJumpeRoomDetail, roomId)
  if (isJumpeRoomDetail === '0' && roomId) {
    localStorage.setItem('isJumpeRoomDetail', '1')
    return { path: `./room/detail?id=${roomId}` }
  } else {
    localStorage.setItem('isJumpeRoomDetail', '1')
    return true
  }
}
// 路由跳转之前
router.beforeEach(function(to, from, next) {
  // var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail')
  // console.log('999999999999999999999999999999999', to, from, isJumpeRoomDetail)
  var nextPage = true // 默认true
  // 直接进入首页(列表页)
  if ((to.name === 'root' || to.name === 'roomList') && !from.name) {
    nextPage = jumpRoomDetail()
  }
  // 直接进入详情页
  if (to.name === 'roomDetail' && !from.name) {
    localStorage.setItem('isJumpeRoomDetail', '1')
    if (to.query.id) {
      localStorage.setItem('roomId', to.query.id)
    }
  }
  // 列表页进入详情页
  if (to.name === 'roomDetail' && (from.name === 'root' || from.name === 'roomList')) {
    localStorage.setItem('isJumpeRoomDetail', '0')
    if (to.query.id) {
      localStorage.setItem('roomId', to.query.id)
    }
  }
  // 详情页返回列表
  if ((to.name === 'root' || to.name === 'roomList') && from.name === 'roomDetail') {
    localStorage.setItem('isJumpeRoomDetail', '1')
  }
  next(nextPage)
})
export default router