long
2024-02-01 c6d3157eb616116c84d35e221ed9c57ef8da0ad6
src/pages/room/detail.vue
@@ -24,9 +24,11 @@
    <div class="page_header_placeholer" />
    <!-- 未有安排 -->
    <div v-if="(!occupyInfoViewArr || !occupyInfoViewArr.length) && (!assignTreatListView || !assignTreatListView.length)" class="page_container flex flex-1">
      <div class="main flex-1">
      <div class="main flex-1 flex flex-col">
        <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
        <div v-if="roomInfo" class="room_main_tip" style="margin-top: 93px;line-height: 186px;font-size: 140px;">-{{ statusTx[roomInfo.status] }}-</div>
        <div class="flex-1" />
        <div v-if="roomInfo" class="room_main_tip" style="line-height: 186px;font-size: 140px;margin-top: 0">-{{ statusTx[roomInfo.status] }}-</div>
        <div class="flex-1" />
        <div class="btn_box flex flex-center">
          <div class="flex flex-ver">
            <div class="btn_box__item flex flex-center white" data-tx="空闲" data-status="0" @click="statusChg">
@@ -95,7 +97,7 @@
      </div>
      <div class="right flex flex-col">
        <div v-for="(item,index) in occupyInfoViewArr" :key="index" class="flex-1 right_room_info">
          <XioRoomInfoBlock ref="XioRoomInfoBlock" :occupy-info-view="item" />
          <XioRoomInfoBlock ref="XioRoomInfoBlock" :occupy-info-view="item" :occupy-info-view-arr="occupyInfoViewArr" />
        </div>
        <div v-if="occupyInfoViewArr.length<=1" class="flex flex-col" style="border-radius: 10px;">
          <XioRoomGuestBox ref="XioRoomGuestBox" :assign-treat-list-view-com="assignTreatListView" @selectCustomer="selectCustomer" />
@@ -154,8 +156,14 @@
      timeObj: {}, // week:星期,date:年月日,timeMin:时分,time:时分秒,timeStamp:时间戳
      curTreatId: '',
      curTreatIds: '', // 已选中的治疗记录id数组
      offNarcosisIds: [] // 是否已通知卸麻的用户id数组
      offNarcosisIds: [], // 是否已通知卸麻的用户id数组
      // isShowAppellationName: true // 是否显示称谓
      // 60秒切换状态锁 ↓↓↓↓↓↓↓↓↓↓
      setStatusLock: false, // 更新状态锁
      setStatusLockDuration: 60000, // 更新状态锁时间
      setStatusLockTimer: null
      // 60秒切换状态锁 ↑↑↑↑↑↑↑↑↑↑
    }
  },
  computed: {
@@ -191,7 +199,7 @@
        } else {
          // 还没使用默认客人值或者已使用默认客人值还没改变状态(适配轮询)
          if ((!isUseDefault || (isUseDefault && isUseDefaultChg === 0)) && this.assignTreatList && this.assignTreatList.length) {
            isUseDefault = true
            // isUseDefault = true
            return this.assignTreatList[0]
          // 已使用过默认客人值
          } else {
@@ -342,6 +350,13 @@
            })
          }
        })
        // 基本不会出现这种情况,但是以防万一,若本地缓存id存在,但对不上列表则缓存第一条数据id
        if (!arr.length) {
          arr.push(this.assignTreatList[0])
          this.curTreatIds = []
          this.curTreatIds.push(this.assignTreatList[0].id)
          this.setLocalCurTreatIds()
        }
      }
      return arr
    },
@@ -382,6 +397,7 @@
                userName: '黄嘉荣',
                gender: 1,
                hempStatus: 2,
                treatRoomStatus: 0,
                ciq: '123',
                adviserName: 'a君',
                aDoctorName: 'b君',
@@ -395,6 +411,7 @@
                userName: '李德华',
                gender: 1,
                hempStatus: 2,
                treatRoomStatus: 0,
                ciq: '456',
                adviserName: 'd君',
                aDoctorName: 'e君',
@@ -408,6 +425,7 @@
                userName: '猛学友',
                gender: 2,
                hempStatus: 2,
                treatRoomStatus: 0,
                ciq: '789',
                adviserName: 'g君',
                aDoctorName: 'h君',
@@ -518,6 +536,14 @@
    },
    // 改变房间状态异步方法
    changeStatusFn(item = {}, status, cb) {
      // 未解锁 20240201 long
      if (this.setStatusLock) {
        return this.$messageWarn('操作频繁,请稍后再试')
      }
      this.setStatusLock = true
      clearInterval(this.setStatusLockTimer)
      this.setStatusLockTimer = null
      var params = {}
      // 房间id
      if (this.id) {
@@ -561,18 +587,18 @@
        // 当前选择客户的数组删除客户
        this.occupyInfoViewArrDataHandle('cancel', item)
        params.treatRoomList = []
        if (arr && arr.length) {
          arr.forEach((o) => {
            params.treatRoomList.push({
              treatRecordId: o.id,
              status: o.treatRoomStatus
            })
          })
        }
      } else {
        // 更改的状态
        params.status = status * 1
      }
      params.treatRoomList = []
      if (arr && arr.length) {
        arr.forEach((o) => {
          params.treatRoomList.push({
            treatRecordId: o.id,
            status: o.treatRoomStatus
          })
        })
      }
      Req.http.post({
@@ -591,7 +617,7 @@
          isUseDefaultChg = 1
        }
        // 只要更改为空闲就重置参数
        if (status === 0) {
        if (params.status === 0) {
          console.log('房间更改为空闲')
          // 重置默认已使用客人的参数
          isUseDefault = false
@@ -600,6 +626,15 @@
        }
        // console.log('8888888888888888888888888888888888', res)
        cb && cb()
        // 30s后解锁 20240201 long
        this.setStatusLockTimer = setInterval(() => {
          this.setStatusLock = false
        }, this.setStatusLockDuration)
      }, () => {
        setTimeout(() => {
          this.setStatusLock = false
        }, 1000)
      })
    },
    // 重置状态
@@ -734,6 +769,9 @@
}
.page_header_placeholer {
  height: 100px;
  width: 100%;
  display: block;
  flex-shrink: 0;
}
.page_header {
  position: fixed;
@@ -811,7 +849,8 @@
  color: rgba(154,154,154,1);
}
.page_container .main .btn_box {
  margin-top: 130px;
  /* margin-top: 130px; */
  margin-bottom: 40px;
}
.page_container .main .btn_box__item {
  width: 250px;