From 40660a1c55412cb86157504dddfdaef05b0dadbd Mon Sep 17 00:00:00 2001
From: jazz <jazzxhunter@163.com>
Date: 星期一, 25 十二月 2023 18:12:26 +0800
Subject: [PATCH] update_202312251812_卸麻通知和称谓显示v2

---
 src/pages/room/detail.vue |   82 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue
index 87d634c..d3645b1 100644
--- a/src/pages/room/detail.vue
+++ b/src/pages/room/detail.vue
@@ -115,8 +115,16 @@
         <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">
+          <!-- <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="name">
             <el-popover
               placement="top"
               width="400"
@@ -205,6 +213,8 @@
     <XioCustomerSelect ref="XioCustomerSelect" @cancel="selectCustomerCancel" @submit="selectCustomerSubmit" />
     <!-- 鏇存敼鎴块棿鐘舵�佺獥 -->
     <XioRoomStatusChg ref="XioRoomStatusChg" @changeStatus="changeStatus" />
+    <!-- MIC閫氱煡鍗搁夯 -->
+    <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" />
   </div>
 </template>
 
@@ -218,15 +228,19 @@
 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鏁扮粍
 export default {
   name: 'RoomDetail',
   components: {
     XioCustomerSelect,
-    XioRoomStatusChg
+    XioRoomStatusChg,
+    XioRoomOffNarcosisNotice
   },
   inject: ['noop'],
   data() {
@@ -237,7 +251,8 @@
       assignTreatList: [],
       statusTx: ['绌洪棽', '浣跨敤涓�', '瀹汉浼戞伅', '鎵撴壂涓�', '鏁烽夯涓�'],
       timeObj: {}, // week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑
-      curTreatId: ''
+      curTreatId: '',
+      isShowAppellationName: true // 鏄惁鏄剧ず绉拌皳
     }
   },
   computed: {
@@ -281,6 +296,14 @@
     console.log('roomDetail mounted')
     // 璁板綍褰撳墠鐨勬不鐤桰D
     var curTreatId = localStorage.getItem('curTreatId')
+    var localOffNarcosisIds = localStorage.getItem('offNarcosisIds')
+    // 鑾峰彇鏄惁宸查�氱煡鍗搁夯鏁扮粍
+    if (localOffNarcosisIds) {
+      offNarcosisIds = JSON.parse(localOffNarcosisIds)
+    } else {
+      offNarcosisIds = []
+      this.setLocalStorageOffNarcosisIds()
+    }
     this.curTreatId = curTreatId || ''
     this.id = this.$route.query.id || ''
     this.init()
@@ -299,6 +322,26 @@
       // 杞getData锛�8绉掍竴娆�
       this.pollingAjaxFn(this, 'getData', 'detail', 8000)
       // this.getData()
+    },
+    // 璁剧疆宸查�氱煡鍗搁夯id鏁扮粍
+    setLocalStorageOffNarcosisIds() {
+      localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds))
+    },
+    // 鍗搁夯閫氱煡纭
+    offNarcosisNoticeConfirm() {
+      if (this.occupyInfoView) {
+        offNarcosisIds.push(this.occupyInfoView.visitOrderId)
+        this.setLocalStorageOffNarcosisIds()
+      }
+    },
+    // 鏄剧ず閫氱煡鍗搁夯寮圭獥
+    showOffNarcosisNotice() {
+      // 鎵撳紑寮圭獥
+      this.$refs['XioRoomOffNarcosisNotice'].showDialog()
+    },
+    // 鐐瑰嚮鏄剧ず闅愯棌绉拌皳
+    tapAppellationHandle() {
+      this.isShowAppellationName = !this.isShowAppellationName
     },
     // 鑾峰彇褰撳墠娌荤枟淇℃伅
     gatCurTreatInfo() {
@@ -343,7 +386,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 +406,19 @@
           }
         }
         // console.log('999999999999999999999999999', res)
+        var offNarcosisTimer = null
+        offNarcosisTimer = setTimeout(() => {
+          console.log('================================>', this.occupyInfoView)
+          if (this.occupyInfoView && this.occupyInfoView.hempStatus === 2 && this.occupyInfoView.visitOrderId) {
+            var flag
+            offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.visitOrderId }))
+            if (!flag) {
+              this.showOffNarcosisNotice()
+            }
+          }
+          clearTimeout(offNarcosisTimer)
+          offNarcosisTimer = null
+        }, 500)
       })
     },
     // 杩斿洖
@@ -440,6 +501,7 @@
           // 閲嶇疆榛樿宸蹭娇鐢ㄥ浜虹殑鍙傛暟
           isUseDefault = false
           isUseDefaultChg = 0
+          this.isShowAppellationName = true
         }
         // console.log('8888888888888888888888888888888888', res)
         cb && cb()
@@ -669,6 +731,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;

--
Gitblit v1.8.0