From 6283f47d248818ef9fa64e4d65f27a343b54bdd2 Mon Sep 17 00:00:00 2001
From: jazz <jazzxhunter@163.com>
Date: 星期三, 27 十二月 2023 18:37:27 +0800
Subject: [PATCH] Merge branch 'xio_dev'

---
 static/imgs/eye.png                                   |    0 
 src/components/xio_room_off_narcosis_notice/index.vue |  124 +++++++++++++
 static/imgs/down.png                                  |    0 
 src/pages/room/list.vue                               |   97 ++++++++--
 src/components/xio_room_list_shop_chg/index.vue       |  152 ++++++++++++++++
 src/pages/room/detail.vue                             |  124 ++++++++++++-
 6 files changed, 463 insertions(+), 34 deletions(-)

diff --git a/src/components/xio_room_list_shop_chg/index.vue b/src/components/xio_room_list_shop_chg/index.vue
new file mode 100644
index 0000000..d86457e
--- /dev/null
+++ b/src/components/xio_room_list_shop_chg/index.vue
@@ -0,0 +1,152 @@
+<template>
+  <div v-if="isShow" class="mask" @click="hideDialog">
+    <div class="xio_room_list_shop_chg_dialog" @click.stop="noop">
+      <div class="title">璇烽�夋嫨闂ㄥ簵</div>
+      <div class="list flex flex-ver flex-wrap">
+        <div v-for="(item,index) in shopList" :key="index" class="list_item flex flex-center" :class="[item.act?'act':'']" @click="chooseHandle(item)">{{ item.name }}</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Req from '../../utils/jun_httpInstall' // http 璇锋眰
+export default {
+  name: 'XioRoomStatusChg',
+  props: {
+    isActive: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      shopList: [],
+      shopId: '',
+      isShow: false
+    }
+  },
+  methods: {
+    noop() {
+      return
+    },
+    // 纭
+    // confirm() {
+    //   this.isShow = false
+    //   this.$emit('confirm', { })
+    // },
+    // 閫夋嫨闂ㄥ簵
+    chooseHandle(item) {
+      this.shopId = item.id
+      if (this.shopList && this.shopList.length) {
+        this.shopList.forEach((o) => {
+          o.act = false
+          if (o.id === this.shopId) {
+            o.act = true
+          }
+        })
+      }
+      this.isShow = false
+      this.$emit('confirm', item)
+    },
+    async showShopDialog(shopId) {
+      this.shopId = shopId || ''
+      this.showDialog()
+      await this.getShopList()
+    },
+    // 鑾峰彇闂ㄥ簵鍒楄〃
+    getShopList() {
+      var params = {}
+      return new Promise((resolve, reject) => {
+        Req.http.post({
+          url: 'guide/treat/screen/shop/list',
+          data: params,
+          udData: { noLoading: true },
+          header: { 'Content-Type': 'application/json' },
+          mockData: {
+            code: 100,
+            msg: '',
+            data: [{
+              name: 'xx',
+              id: 'xx'
+            }]
+          }
+        }).then((res) => {
+          if (res.data && res.data.length) {
+            res.data.forEach((o) => {
+              o.act = false
+              if (o.id === this.shopId) {
+                o.act = true
+              }
+            })
+          }
+          this.shopList = res.data || []
+          resolve(res)
+        })
+      })
+    },
+    // 鏄剧ず寮圭獥
+    showDialog() {
+      this.isShow = true
+    },
+    // 鍏抽棴寮圭獥
+    hideDialog() {
+      if (!this.shopId) {
+        return
+      }
+      this.isShow = false
+      // this.$emit('confirm', { })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.xio_room_list_shop_chg_dialog {
+  width: 1141px;
+  height: 689px;
+  /* border-radius: 10px; */
+  background-color: rgba(255,255,255,1);
+  border: 1px solid rgba(187,187,187,1);
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  -webkit-transform: translate(-50%, -50%);
+  z-index: 1;
+}
+.xio_room_list_shop_chg_dialog .title {
+  line-height: 63px;
+  color: rgba(16,16,16,1);
+  font-size: 45px;
+  text-align: center;
+  font-family: PingFangSC-medium;
+  font-weight: bold;
+  padding-top: 31px;
+}
+.xio_room_list_shop_chg_dialog .list {
+  margin-top: 50px;
+  height: 480px;
+  overflow: auto;
+}
+.xio_room_list_shop_chg_dialog .list_item {
+  cursor: pointer;
+  min-width: 300px;
+  height: 100px;
+  box-sizing: border-box;
+  padding: 0 20px;
+  margin-left: 55px;
+  margin-bottom: 50px;
+  line-height: 73px;
+  border-radius: 4px;
+  background-color: rgba(229,238,253,1);
+  color: rgba(0,10,123,1);
+  font-size: 50px;
+  text-align: center;
+  font-family: Microsoft Yahei;
+}
+.xio_room_list_shop_chg_dialog .list_item.act {
+  background-color: #5980FF;
+  color: #fff;
+}
+</style>
diff --git a/src/components/xio_room_off_narcosis_notice/index.vue b/src/components/xio_room_off_narcosis_notice/index.vue
new file mode 100644
index 0000000..f233407
--- /dev/null
+++ b/src/components/xio_room_off_narcosis_notice/index.vue
@@ -0,0 +1,124 @@
+<template>
+  <div v-if="isShow" class="mask" @click="hideDialog">
+    <div class="xio_room_status_chg_dialog" @click.stop="noop">
+      <div class="title">MIC閫氱煡鍗搁夯锛�</div>
+      <div class="btn_box flex flex-center">
+        <div class="btn_box_item flex flex-center" @click="confirm">
+          <div class="flex flex-ver">
+            <div class="tx">鎴戝凡鐭ユ檽</div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'XioRoomStatusChg',
+  props: {
+    isActive: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      isShow: false
+    }
+  },
+  methods: {
+    noop() {
+      return
+    },
+    // 纭
+    confirm() {
+      this.isShow = false
+      this.$emit('confirm', { })
+    },
+    // 鏄剧ず寮圭獥
+    showDialog() {
+      this.isShow = true
+    },
+    // 鍏抽棴寮圭獥
+    hideDialog() {
+      this.isShow = false
+      this.$emit('confirm', { })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.xio_room_status_chg_dialog {
+  width: 1105px;
+  min-height: 602px;
+  /* border-radius: 10px; */
+  background-color: rgba(255,255,255,1);
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  -webkit-transform: translate(-50%, -50%);
+  z-index: 1;
+}
+.xio_room_status_chg_dialog .title {
+  line-height: 112px;
+  color: rgba(16,16,16,1);
+  font-size: 80px;
+  text-align: center;
+  font-family: PingFangSC-medium;
+  font-weight: bold;
+  padding-top: 159px;
+}
+.xio_room_status_chg_dialog .btn_box {
+  margin-top: 131px;
+}
+.xio_room_status_chg_dialog .btn_box .line {
+  width: 100%;
+}
+.xio_room_status_chg_dialog .btn_box_item {
+  width: 300px;
+  height: 100px;
+  line-height: 52px;
+  border-radius: 4px;
+  background-color: rgba(34,123,235,1);
+  color: rgba(255,255,255,1);
+  font-size: 36px;
+  text-align: center;
+  font-family: Microsoft Yahei;
+  box-shadow: 0px 2px 6px 0px rgba(206,206,206,0.86);
+}
+/* .xio_room_status_chg_dialog .btn_box_item.white {
+  background-color: rgba(255,255,255,1);
+}
+.xio_room_status_chg_dialog .btn_box_item.blue {
+  background-color: rgba(46,77,124,1);
+}
+.xio_room_status_chg_dialog .btn_box_item.yellow {
+  background-color: rgba(255,199,115,1);
+}
+.xio_room_status_chg_dialog .btn_box_item.gray {
+  background-color: rgba(206,206,206,1);
+} */
+.xio_room_status_chg_dialog .btn_box_item .icon {
+  width: 60px;
+  height: 60px;
+  display: block;
+  margin-right: 17px;
+}
+.xio_room_status_chg_dialog .btn_box_item .icon .img {
+  width: 100%;
+  height: 100%;
+}
+/* .xio_room_status_chg_dialog .btn_box_item .tx {
+  line-height: 37px;
+  color: rgba(51,51,51,1);
+  font-size: 26px;
+  text-align: center;
+  font-family: PingFangSC-medium;
+}
+.xio_room_status_chg_dialog .btn_box_item .tx.white {
+  color: #ffffff;
+} */
+</style>
diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue
index 87d634c..776f69f 100644
--- a/src/pages/room/detail.vue
+++ b/src/pages/room/detail.vue
@@ -115,18 +115,33 @@
         <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
         <div class="room_content">
           <div class="tip">璇婄枟瀹夋帓</div>
-          <!-- <div class="name">{{ occupyInfoView.userName }}</div> -->
-          <div class="name">
-            <el-popover
-              placement="top"
-              width="400"
-              popper-class="top_tx"
-              trigger="click"
-              :popper-options="{ removeOnDestroy: true }"
-            >
-              <div>{{ occupyInfoView.userName }}</div>
-              <div slot="reference" class="tx ell">{{ occupyInfoView.userName }}</div>
-            </el-popover>
+          <!-- <div class="name">{{ occupyInfoView.userName }}</div> appellationName -->
+          <div v-show="isShowAppellationName" class="flex flex-center">
+            <div class="flex flex-ver">
+              <div class="name">{{ occupyInfoView.appellationName }}</div>
+              <div class="name_icon" @click="tapAppellationHandle">
+                <img class="img" src="static/imgs/eye.png">
+              </div>
+            </div>
+          </div>
+          <div v-show="!isShowAppellationName" class="flex flex-center">
+            <div class="flex flex-ver">
+              <div class="name">
+                <el-popover
+                  placement="top"
+                  width="400"
+                  popper-class="top_tx"
+                  trigger="click"
+                  :popper-options="{ removeOnDestroy: true }"
+                >
+                  <div>{{ occupyInfoView.userName }}</div>
+                  <div slot="reference" class="tx ell">{{ occupyInfoView.userName }}</div>
+                </el-popover>
+              </div>
+              <div class="name_icon" @click="tapAppellationHandle">
+                <img class="img" src="static/imgs/eye.png">
+              </div>
+            </div>
           </div>
           <div v-if="occupyInfoView.ciq" class="ciq">({{ occupyInfoView.ciq }})</div>
           <div v-if="occupyInfoView.startTime" class="time">瀹夋帓娌荤枟鏃堕棿锛歿{ occupyInfoView.startTime }} 寮�濮�</div>
@@ -205,6 +220,8 @@
     <XioCustomerSelect ref="XioCustomerSelect" @cancel="selectCustomerCancel" @submit="selectCustomerSubmit" />
     <!-- 鏇存敼鎴块棿鐘舵�佺獥 -->
     <XioRoomStatusChg ref="XioRoomStatusChg" @changeStatus="changeStatus" />
+    <!-- MIC閫氱煡鍗搁夯 -->
+    <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" />
   </div>
 </template>
 
@@ -218,15 +235,20 @@
 import XioCustomerSelect from '@/components/xio_customer_select'
 // 鏇存敼鎴块棿鐘舵�佺獥
 import XioRoomStatusChg from '@/components/xio_room_status_chg'
+// 閫氱煡鍗搁夯
+import XioRoomOffNarcosisNotice from '@/components/xio_room_off_narcosis_notice'
 import Req from '../../utils/jun_httpInstall' // http 璇锋眰
 // import xioFn from './utils/xio_fn.js'
 var isUseDefault = false // 鏄惁宸蹭娇鐢ㄩ粯璁ゅ浜�
 var isUseDefaultChg = 0// 宸蹭娇鐢ㄩ粯璁ゅ浜哄悗鎴块棿鏄惁鏈夋敼鍙樼姸鎬�
+var offNarcosisIds = [] // 鏄惁宸查�氱煡鍗搁夯id鏁扮粍
+var isOffNarcosisShow = false // 鏄惁鏄剧ず宸查�氱煡鍗搁夯寮圭獥
 export default {
   name: 'RoomDetail',
   components: {
     XioCustomerSelect,
-    XioRoomStatusChg
+    XioRoomStatusChg,
+    XioRoomOffNarcosisNotice
   },
   inject: ['noop'],
   data() {
@@ -237,7 +259,8 @@
       assignTreatList: [],
       statusTx: ['绌洪棽', '浣跨敤涓�', '瀹汉浼戞伅', '鎵撴壂涓�', '鏁烽夯涓�'],
       timeObj: {}, // week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑
-      curTreatId: ''
+      curTreatId: '',
+      isShowAppellationName: true // 鏄惁鏄剧ず绉拌皳
     }
   },
   computed: {
@@ -281,6 +304,18 @@
     console.log('roomDetail mounted')
     // 璁板綍褰撳墠鐨勬不鐤桰D
     var curTreatId = localStorage.getItem('curTreatId')
+    var localOffNarcosisIds = localStorage.getItem('offNarcosisIds')
+    var localIsOffNarcosisShow = localStorage.getItem('isOffNarcosisShow')
+    // 鑾峰彇鏄惁宸查�氱煡鍗搁夯鏁扮粍
+    if (localOffNarcosisIds) {
+      offNarcosisIds = JSON.parse(localOffNarcosisIds)
+    } else {
+      offNarcosisIds = []
+      this.setLocalStorageOffNarcosisIds()
+    }
+    if (localIsOffNarcosisShow) {
+      isOffNarcosisShow = localIsOffNarcosisShow
+    }
     this.curTreatId = curTreatId || ''
     this.id = this.$route.query.id || ''
     this.init()
@@ -299,6 +334,35 @@
       // 杞getData锛�8绉掍竴娆�
       this.pollingAjaxFn(this, 'getData', 'detail', 8000)
       // this.getData()
+    },
+    // 璁剧疆宸查�氱煡鍗搁夯id鏁扮粍
+    setLocalStorageOffNarcosisIds() {
+      localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds))
+    },
+    // 鍗搁夯閫氱煡纭
+    offNarcosisNoticeConfirm() {
+      if (this.occupyInfoView) {
+        if (offNarcosisIds && offNarcosisIds.length) {
+          var flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId })
+          if (!flag) {
+            offNarcosisIds.push(this.occupyInfoView.userId)
+          }
+        } else if (offNarcosisIds) {
+          offNarcosisIds.push(this.occupyInfoView.userId)
+        }
+        this.setLocalStorageOffNarcosisIds()
+      }
+      isOffNarcosisShow = true
+      localStorage.setItem('isOffNarcosisShow', true)
+    },
+    // 鏄剧ず閫氱煡鍗搁夯寮圭獥
+    showOffNarcosisNotice() {
+      // 鎵撳紑寮圭獥
+      this.$refs['XioRoomOffNarcosisNotice'].showDialog()
+    },
+    // 鐐瑰嚮鏄剧ず闅愯棌绉拌皳
+    tapAppellationHandle() {
+      this.isShowAppellationName = !this.isShowAppellationName
     },
     // 鑾峰彇褰撳墠娌荤枟淇℃伅
     gatCurTreatInfo() {
@@ -343,7 +407,12 @@
             res.data.assignTreatList.forEach((o) => {
               var st = (o.startTime).split(' ')[1].split(':')
               o.startTime = `${st[0]}:${st[1]}`
+              o.appellationName = o.userName[0] + `${o.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][o.gender] : '濂冲+'}`
             })
+          }
+          // 宸插崰鐢ㄧ敤鎴锋暟鎹鐞�
+          if (res.data.occupyInfo && res.data.occupyInfo.userName) {
+            res.data.occupyInfo.appellationName = res.data.occupyInfo.userName[0] + `${res.data.occupyInfo.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][res.data.occupyInfo.gender] : '濂冲+'}`
           }
           // 宸叉湁鍗犵敤鐨勶紝鏇存敼宸蹭娇鐢ㄩ粯璁ゅ浜虹殑鐘舵��
           res.data.occupyInfo && (isUseDefaultChg = 1)
@@ -358,6 +427,20 @@
           }
         }
         // console.log('999999999999999999999999999', res)
+        var offNarcosisTimer = null
+        offNarcosisTimer = setTimeout(() => {
+          console.log('================================>', this.occupyInfoView, 'offNarcosisIds:', offNarcosisIds, 'isOffNarcosisShow:', isOffNarcosisShow)
+          if (this.occupyInfoView && this.occupyInfoView.hempStatus === 2 && this.occupyInfoView.userId) {
+            var flag
+            offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId }))
+            // flag = isOffNarcosisShow
+            if (!flag) {
+              this.showOffNarcosisNotice()
+            }
+          }
+          clearTimeout(offNarcosisTimer)
+          offNarcosisTimer = null
+        }, 500)
       })
     },
     // 杩斿洖
@@ -440,6 +523,7 @@
           // 閲嶇疆榛樿宸蹭娇鐢ㄥ浜虹殑鍙傛暟
           isUseDefault = false
           isUseDefaultChg = 0
+          this.isShowAppellationName = true
         }
         // console.log('8888888888888888888888888888888888', res)
         cb && cb()
@@ -669,6 +753,18 @@
 .page_container .main .room_content .name .tx {
   max-width: 666px;
   margin: auto;
+  text-align: center;
+}
+.page_container .main .room_content .name_icon {
+  width: 40px;
+  height: 40px;
+  display: block;
+  margin-top: 13px;
+  padding: 20px;
+}
+.page_container .main .room_content .name_icon .img {
+  width: 100%;
+  height: 100%;
 }
 .page_container .main .room_content .ciq {
   line-height: 42px;
diff --git a/src/pages/room/list.vue b/src/pages/room/list.vue
index 2e1d4ed..04ff80f 100644
--- a/src/pages/room/list.vue
+++ b/src/pages/room/list.vue
@@ -10,12 +10,21 @@
           <img class="img" src="static/imgs/logo_2.png">
         </div>
       </div>
-      <div class="right flex-1 flex flex-jcfe flex-ver">
-        <div class="page_choose_shop">
+      <div class="flex-1 flex flex-center">
+        <div class="select_shop_block flex flex-ver" @click="showChooseShop">
+          <div v-if="!shopId" class="tx">璇烽�夋嫨闂ㄥ簵</div>
+          <div v-if="shopId" class="tx">{{ shopName }}</div>
+          <div class="icon_block">
+            <img class="icon" src="static/imgs/down.png">
+          </div>
+        </div>
+      </div>
+      <div class="right flex flex-jcfe flex-ver">
+        <!-- <div class="page_choose_shop">
           <el-select v-model="shopId" placeholder="璇烽�夋嫨" style="width:400px;" clearable @change="getRoomList">
             <el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
-        </div>
+        </div> -->
         <div class="page_date">
           <div class="page_week">{{ timeObj.week }}</div>
           <div class="page_day">{{ timeObj.date }}</div>
@@ -39,6 +48,8 @@
         </div>
       </div>
     </div>
+
+    <XioRoomListShopChg ref="XioRoomListShopChg" @confirm="confirmShop" />
   </div>
 </template>
 
@@ -46,14 +57,19 @@
 // import Login from '../utils/jun_login.js'
 import Req from '../../utils/jun_httpInstall' // http 璇锋眰
 // import xioFn from './utils/xio_fn.js'
+// 閫氱煡鍗搁夯
+import XioRoomListShopChg from '@/components/xio_room_list_shop_chg'
 export default {
   name: 'RoomList',
-  components: {},
+  components: {
+    XioRoomListShopChg
+  },
   inject: ['noop'],
   data() {
     return {
       shopList: [],
       shopId: '',
+      shopName: '',
       list: [],
       timeObj: {}// week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑
     }
@@ -70,11 +86,23 @@
 
   },
   methods: {
-    init() {
+    async init() {
       // 璁℃椂
       this.countGetTime(this, 'timeObj', 'list')
-      this.getShopList()
+      // await this.getShopList()
+      // this.getRoomList()
+      this.showChooseShop()
+    },
+    // 纭畾閫夋嫨闂ㄥ簵
+    confirmShop(item) {
+      this.shopId = item.id
+      this.shopName = item.name
       this.getRoomList()
+    },
+    // 鏄剧ず閫夋嫨闂ㄥ簵鍒楄〃寮圭獥
+    showChooseShop() {
+      // 鎵撳紑寮圭獥
+      this.$refs['XioRoomListShopChg'].showShopDialog(this.shopId)
     },
     // 鍒锋柊娴忚鍣ㄩ〉闈�
     resetPage() {
@@ -84,20 +112,23 @@
     // 鑾峰彇闂ㄥ簵鍒楄〃
     getShopList() {
       var params = {}
-      Req.http.post({
-        url: 'guide/treat/screen/shop/list',
-        data: params,
-        header: { 'Content-Type': 'application/json' },
-        mockData: {
-          code: 100,
-          msg: '',
-          data: [{
-            name: 'xx',
-            id: 'xx'
-          }]
-        }
-      }).then((res) => {
-        this.shopList = res.data || []
+      return new Promise((resolve, reject) => {
+        Req.http.post({
+          url: 'guide/treat/screen/shop/list',
+          data: params,
+          header: { 'Content-Type': 'application/json' },
+          mockData: {
+            code: 100,
+            msg: '',
+            data: [{
+              name: 'xx',
+              id: 'xx'
+            }]
+          }
+        }).then((res) => {
+          this.shopList = res.data || []
+          resolve(res)
+        })
       })
     },
     // 鑾峰彇鍒楄〃
@@ -162,6 +193,12 @@
 }
 </style>
 <style scoped>
+.page_header .left {
+  min-width: 300px;
+}
+.page_date {
+  margin-left: 0;
+}
 /* .page_container {
   overflow: hidden;
 } */
@@ -187,6 +224,7 @@
   margin-bottom: 20px;
 }
 .list_block .list .list__item {
+  cursor: pointer;
   padding: 40px 30px;
   border-radius: 100px;
   background-color: rgba(229,238,253,1);
@@ -211,4 +249,23 @@
   text-align: center;
   font-family: Roboto;
 }
+.select_shop_block {
+  cursor: pointer;
+}
+.select_shop_block .tx {
+  line-height: 50px;
+  color: rgba(255,255,255,1);
+  font-size: 36px;
+  text-align: center;
+  font-family: PingFangSC-regular;
+}
+.select_shop_block .icon_block {
+  width: 30px;
+  height: 30px;
+  display: block;
+}
+.select_shop_block .icon_block .icon {
+  width: 100%;
+  height: 100%;
+}
 </style>
diff --git a/static/imgs/down.png b/static/imgs/down.png
new file mode 100644
index 0000000..22900d9
--- /dev/null
+++ b/static/imgs/down.png
Binary files differ
diff --git a/static/imgs/eye.png b/static/imgs/eye.png
new file mode 100644
index 0000000..1829cd2
--- /dev/null
+++ b/static/imgs/eye.png
Binary files differ

--
Gitblit v1.8.0