jazz
2023-12-26 2471a9b321c22b7ad9aac423957fc8232980b5cd
提交 | 用户 | age
3ac5f2 1 <!--room-detail.vue-->
J 2 <template>
878885 3   <div class="page flex flex-col">
6da3c1 4     <div class="page_header flex flex-ver">
J 5       <div class="left flex flex-ver" @click="back">
878885 6         <div class="page_logo_1">
J 7           <img class="img" src="static/imgs/logo_1.png">
8         </div>
9         <div class="page_logo_2">
10           <img class="img" src="static/imgs/logo_2.png">
11         </div>
3ac5f2 12       </div>
J 13       <div class="right flex-1 flex flex-jcfe flex-ver">
1d1095 14         <el-button type="primary" icon="el-icon-refresh" class="reset_btn flex flex-center" size="small" style="width: 100px;" @click="resetPage">刷新</el-button>
aeb317 15         <div class="reset_btn flex flex-center" @click="resetStatus">重置房间状态</div>
3ac5f2 16         <div class="page_date">
bb2b08 17           <div class="page_week">{{ timeObj.week }}</div>
J 18           <div class="page_day">{{ timeObj.date }}</div>
3ac5f2 19         </div>
bb2b08 20         <div class="page_time">{{ timeObj.timeMin }}</div>
J 21         <!-- <div class="page_time">{{ timeObj.time }}</div> -->
3ac5f2 22       </div>
J 23     </div>
bb2b08 24     <!-- 未有安排 -->
34cb2b 25     <div v-if="!occupyInfoView && (!assignTreatListView || !assignTreatListView.length)" class="page_container flex flex-1">
bb2b08 26       <div class="main flex-1">
6da3c1 27         <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
J 28         <div v-if="roomInfo" class="room_main_tip" style="margin-top: 93px;line-height: 186px;font-size: 140px;">-{{ statusTx[roomInfo.status] }}-</div>
bb2b08 29         <div class="btn_box flex flex-center">
J 30           <div class="flex flex-ver">
6da3c1 31             <div class="btn_box__item flex flex-center white" data-tx="空闲" data-status="0" @click="statusChg">
bb2b08 32               <div class="flex flex-ver">
878885 33                 <div class="icon">
J 34                   <img class="img" src="static/imgs/free.png">
35                 </div>
bb2b08 36                 <div class="tx">空闲</div>
J 37               </div>
38             </div>
6da3c1 39             <div class="btn_box__item flex flex-center blue" data-tx="使用中" data-status="1" @click="statusChg">
bb2b08 40               <div class="flex flex-ver">
878885 41                 <div class="icon">
J 42                   <img class="img" src="static/imgs/using.png">
43                 </div>
bb2b08 44                 <div class="tx white">使用中</div>
J 45               </div>
46             </div>
6da3c1 47             <div class="btn_box__item flex flex-center yellow" data-tx="客人休息" data-status="2" @click="statusChg">
bb2b08 48               <div class="flex flex-ver">
878885 49                 <div class="icon">
J 50                   <img class="img" src="static/imgs/rest.png">
51                 </div>
bb2b08 52                 <div class="tx">客人休息</div>
J 53               </div>
54             </div>
6da3c1 55             <div class="btn_box__item flex flex-center gray" data-tx="通知打扫" data-status="3" @click="statusChg">
bb2b08 56               <div class="flex flex-ver">
878885 57                 <div class="icon">
J 58                   <img class="img" src="static/imgs/clear.png">
59                 </div>
bb2b08 60                 <div class="tx">通知打扫</div>
J 61               </div>
62             </div>
63           </div>
64         </div>
65       </div>
66     </div>
6da3c1 67     <!-- 没有客人和有安排 -->
34cb2b 68     <div v-if="!occupyInfoView && (assignTreatListView && assignTreatListView.length)" class="page_container flex flex-1">
bb2b08 69       <div class="main flex-1">
6da3c1 70         <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
J 71         <div v-if="roomInfo" class="room_main_tip">-{{ statusTx[roomInfo.status] }}-</div>
1d1095 72         <div v-show="roomInfo && roomInfo.status >= 1" class="room_left_btn_box flex flex-ver">
J 73           <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('客人休息', 2)">客人休息</div>
74           <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
75           <div v-show="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
76           <div v-show="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('空闲', 0)">结束打扫</div>
bb2b08 77         </div>
J 78       </div>
79       <div class="right">
80         <div class="right_block flex flex-col">
81           <div class="guest_title flex flex-center">等待诊疗</div>
34cb2b 82           <div class="guest_block flex-1" style="border-radius: 0 0 10px 10px;">
J 83             <div v-if="assignTreatListView && assignTreatListView.length" class="guest_list">
84               <div v-for="(item, index) in assignTreatListView" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)">
cf3e3e 85                 <div class="guest_list__td">
J 86                   <div class="tx flex flex-ver">
87                     <div class="flex-1 flex-1-w1 ell">{{ item.userName }}</div>
bb2b08 88                   </div>
cf3e3e 89                   <div class="tx" style="font-size: 14px;line-height: 20px;">{{ item.ciq || '' }}</div>
bb2b08 90                 </div>
J 91                 <div class="guest_list__td flex flex-center">
6da3c1 92                   <span class="tx">{{ item.startTime?item.startTime+'开始':'' }}</span>
bb2b08 93                 </div>
J 94                 <div class="guest_list__td flex flex-center">
cf3e3e 95                   <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span>
bb2b08 96                 </div>
J 97                 <div class="guest_list__td flex flex-center">
34cb2b 98                   <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">切换</div>
bf4dca 99                   <!-- <div class="icon">
878885 100                     <img class="img" src="static/imgs/choose.png">
bf4dca 101                   </div> -->
bb2b08 102                 </div>
J 103               </div>
bf4dca 104             </div>
34cb2b 105             <div v-if="!assignTreatListView || !assignTreatListView.length" class="guest_list">
bf4dca 106               <div class="guest_list__row flex flex-center rowtip">暂无数据</div>
bb2b08 107             </div>
J 108           </div>
109         </div>
110       </div>
111     </div>
6da3c1 112     <!-- 客人和有安排 -->
bf4dca 113     <div v-if="occupyInfoView" class="page_container flex flex-1">
bb2b08 114       <div class="main flex-1">
6da3c1 115         <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div>
bb2b08 116         <div class="room_content">
J 117           <div class="tip">诊疗安排</div>
1fa546 118           <!-- <div class="name">{{ occupyInfoView.userName }}</div> appellationName -->
J 119           <div v-show="isShowAppellationName" class="flex flex-center">
120             <div class="flex flex-ver">
121               <div class="name">{{ occupyInfoView.appellationName }}</div>
122               <div class="name_icon" @click="tapAppellationHandle">
123                 <img class="img" src="static/imgs/eye.png">
124               </div>
125             </div>
126           </div>
2471a9 127           <div v-show="!isShowAppellationName" class="flex flex-center">
J 128             <div class="flex flex-ver">
129               <div class="name">
130                 <el-popover
131                   placement="top"
132                   width="400"
133                   popper-class="top_tx"
134                   trigger="click"
135                   :popper-options="{ removeOnDestroy: true }"
136                 >
137                   <div>{{ occupyInfoView.userName }}</div>
138                   <div slot="reference" class="tx ell">{{ occupyInfoView.userName }}</div>
139                 </el-popover>
140               </div>
141               <div class="name_icon" @click="tapAppellationHandle">
142                 <img class="img" src="static/imgs/eye.png">
143               </div>
144             </div>
cf3e3e 145           </div>
6da3c1 146           <div v-if="occupyInfoView.ciq" class="ciq">({{ occupyInfoView.ciq }})</div>
J 147           <div v-if="occupyInfoView.startTime" class="time">安排治疗时间:{{ occupyInfoView.startTime }} 开始</div>
bb2b08 148         </div>
1d1095 149         <div v-show="roomInfo" class="room_left_btn_box flex flex-ver" style="margin-top: 105px;">
J 150           <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center b-green btn_ani" @click="setStatus('敷麻中', 4)">开始敷麻</div>
151           <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center green btn_ani" @click="setStatus('使用中', 1)">开始治疗</div>
152           <div v-show="roomInfo.status == 4" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('使用中', 1)">开始治疗</div>
153           <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('客人休息', 2)">客人休息</div>
154           <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
155           <div v-show="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('打扫中', 3)">通知打扫</div>
156           <div v-show="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('空闲', 0)">结束打扫</div>
bb2b08 157         </div>
J 158       </div>
159       <div class="right flex flex-col">
160         <div class="room_info flex-1">
161           <div class="staff_box flex flex-ver flex-sb">
162             <div class="staff_box_item flex-1 flex flex-center">
163               <div>
164                 <div class="staff_box_item__title">分诊顾问</div>
6da3c1 165                 <div class="staff_box_item__name">{{ occupyInfoView.adviserName || '' }}</div>
bb2b08 166               </div>
J 167             </div>
168             <div class="staff_box_item flex-1 flex flex-center">
169               <div>
170                 <div class="staff_box_item__title">执行医生</div>
6da3c1 171                 <div class="staff_box_item__name">{{ occupyInfoView.aDoctorName || '' }}</div>
bb2b08 172               </div>
J 173             </div>
174             <div class="staff_box_item flex-1 flex flex-center">
175               <div>
176                 <div class="staff_box_item__title">执行护士</div>
6da3c1 177                 <div class="staff_box_item__name">{{ occupyInfoView.aNurseName || '' }}</div>
bb2b08 178               </div>
J 179             </div>
180           </div>
181           <div class="room_info_project">
182             <div class="room_info_project_block">
6da3c1 183               <div class="tx">{{ occupyInfoView.projectName || '' }}</div>
bb2b08 184             </div>
J 185           </div>
186         </div>
34cb2b 187         <div class="guest_box flex flex-col" style="border-radius: 10px;">
bb2b08 188           <div class="guest_title flex flex-center">等待诊疗</div>
J 189           <div class="guest_block flex-1">
34cb2b 190             <div v-if="assignTreatListView && assignTreatListView.length" class="guest_list">
J 191               <div v-for="(item, index) in assignTreatListView" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)">
cf3e3e 192                 <div class="guest_list__td">
J 193                   <div class="tx flex flex-ver">
194                     <div class="flex-1 flex-1-w1 ell">{{ item.userName }}</div>
bb2b08 195                   </div>
cf3e3e 196                   <div class="tx" style="font-size: 14px;line-height: 20px;">{{ item.ciq || '' }}</div>
bb2b08 197                 </div>
J 198                 <div class="guest_list__td flex flex-center">
6da3c1 199                   <span class="tx">{{ item.startTime?item.startTime+'开始':'' }}</span>
bb2b08 200                 </div>
J 201                 <div class="guest_list__td flex flex-center">
cf3e3e 202                   <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span>
bb2b08 203                 </div>
J 204                 <div class="guest_list__td flex flex-center">
34cb2b 205                   <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">切换</div>
bf4dca 206                   <!-- <div class="icon">
878885 207                     <img class="img" src="static/imgs/choose.png">
bf4dca 208                   </div> -->
bb2b08 209                 </div>
J 210               </div>
bf4dca 211             </div>
34cb2b 212             <div v-if="!assignTreatListView || !assignTreatListView.length" class="guest_list">
bf4dca 213               <div class="guest_list__row flex flex-center rowtip">暂无数据</div>
bb2b08 214             </div>
J 215           </div>
216         </div>
217       </div>
218     </div>
aeb317 219     <!-- 选择客人弹窗 -->
J 220     <XioCustomerSelect ref="XioCustomerSelect" @cancel="selectCustomerCancel" @submit="selectCustomerSubmit" />
221     <!-- 更改房间状态窗 -->
222     <XioRoomStatusChg ref="XioRoomStatusChg" @changeStatus="changeStatus" />
1fa546 223     <!-- MIC通知卸麻 -->
J 224     <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" />
3ac5f2 225   </div>
J 226 </template>
227
228 <script>
6da3c1 229 // 空闲 0
J 230 // 使用中 1
231 // 客人休息 2
232 // 待打扫/通知打扫 3
3ac5f2 233 // import Login from '../utils/jun_login.js'
aeb317 234 // 选择客人弹窗
bb2b08 235 import XioCustomerSelect from '@/components/xio_customer_select'
aeb317 236 // 更改房间状态窗
J 237 import XioRoomStatusChg from '@/components/xio_room_status_chg'
1fa546 238 // 通知卸麻
J 239 import XioRoomOffNarcosisNotice from '@/components/xio_room_off_narcosis_notice'
6da3c1 240 import Req from '../../utils/jun_httpInstall' // http 请求
1d1095 241 // import xioFn from './utils/xio_fn.js'
6da3c1 242 var isUseDefault = false // 是否已使用默认客人
878885 243 var isUseDefaultChg = 0// 已使用默认客人后房间是否有改变状态
df74f0 244 var offNarcosisIds = [] // 是否已通知卸麻id数组
2471a9 245 var isOffNarcosisShow = false // 是否显示已通知卸麻弹窗
3ac5f2 246 export default {
J 247   name: 'RoomDetail',
bb2b08 248   components: {
aeb317 249     XioCustomerSelect,
1fa546 250     XioRoomStatusChg,
J 251     XioRoomOffNarcosisNotice
bb2b08 252   },
3ac5f2 253   inject: ['noop'],
J 254   data() {
255     return {
6da3c1 256       id: this.$route.query.id || '',
J 257       roomInfo: {},
258       occupyInfo: '', // 当前占用人的信息
259       assignTreatList: [],
1d1095 260       statusTx: ['空闲', '使用中', '客人休息', '打扫中', '敷麻中'],
34cb2b 261       timeObj: {}, // week:星期,date:年月日,timeMin:时分,time:时分秒,timeStamp:时间戳
1fa546 262       curTreatId: '',
J 263       isShowAppellationName: true // 是否显示称谓
3ac5f2 264     }
J 265   },
266   computed: {
6da3c1 267     occupyInfoView() {
34cb2b 268       console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg)
J 269       // 有当前选中的,根据需求修改增加选中不更改状态,由空闲开始
270       if (this.curTreatId) {
271         return this.gatCurTreatInfo()
6da3c1 272       } else {
34cb2b 273         // 有占用
J 274         if (this.occupyInfo) {
275           return this.occupyInfo
276         // 没有占用
6da3c1 277         } else {
34cb2b 278           // 还没使用默认客人值或者已使用默认客人值还没改变状态(适配轮询)
J 279           if ((!isUseDefault || (isUseDefault && isUseDefaultChg === 0)) && this.assignTreatList && this.assignTreatList.length) {
280             isUseDefault = true
281             return this.assignTreatList[0]
282           // 已使用过默认客人值
283           } else {
284             return ''
285           }
6da3c1 286         }
34cb2b 287       }
J 288     },
289     assignTreatListView() {
290       if (this.assignTreatList && this.assignTreatList.length) {
291         this.assignTreatList.forEach((o) => {
292           o.act = false
293           if (this.occupyInfoView && this.occupyInfoView.id === o.id) {
294             o.act = true
295           }
296         })
297         return this.assignTreatList
298       } else {
299         return []
6da3c1 300       }
J 301     }
3ac5f2 302   },
bf4dca 303   activated() {
3ac5f2 304     console.log('roomDetail mounted')
34cb2b 305     // 记录当前的治疗ID
J 306     var curTreatId = localStorage.getItem('curTreatId')
df74f0 307     var localOffNarcosisIds = localStorage.getItem('offNarcosisIds')
2471a9 308     var localIsOffNarcosisShow = localStorage.getItem('isOffNarcosisShow')
df74f0 309     // 获取是否已通知卸麻数组
J 310     if (localOffNarcosisIds) {
311       offNarcosisIds = JSON.parse(localOffNarcosisIds)
312     } else {
313       offNarcosisIds = []
314       this.setLocalStorageOffNarcosisIds()
2471a9 315     }
J 316     if (localIsOffNarcosisShow) {
317       isOffNarcosisShow = localIsOffNarcosisShow
1fa546 318     }
34cb2b 319     this.curTreatId = curTreatId || ''
bf4dca 320     this.id = this.$route.query.id || ''
3ac5f2 321     this.init()
J 322   },
bf4dca 323   mounted() {},
3ac5f2 324   destroyed() {
J 325
326   },
327   methods: {
328     init() {
bf4dca 329       // 进入页面先初始化常量标识
J 330       isUseDefault = false
331       isUseDefaultChg = 0
6da3c1 332       // 计时
bb2b08 333       this.countGetTime(this, 'timeObj', 'detail')
6da3c1 334       // 轮询getData,8秒一次
878885 335       this.pollingAjaxFn(this, 'getData', 'detail', 8000)
J 336       // this.getData()
1fa546 337     },
df74f0 338     // 设置已通知卸麻id数组
J 339     setLocalStorageOffNarcosisIds() {
340       localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds))
341     },
1fa546 342     // 卸麻通知确认
J 343     offNarcosisNoticeConfirm() {
df74f0 344       if (this.occupyInfoView) {
2471a9 345         if (offNarcosisIds && offNarcosisIds.length) {
J 346           var flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.visitOrderId })
347           if (!flag) {
348             offNarcosisIds.push(this.occupyInfoView.visitOrderId)
349           }
350         } else if (offNarcosisIds) {
351           offNarcosisIds.push(this.occupyInfoView.visitOrderId)
352         }
df74f0 353         this.setLocalStorageOffNarcosisIds()
J 354       }
2471a9 355       isOffNarcosisShow = true
J 356       localStorage.setItem('isOffNarcosisShow', true)
1fa546 357     },
J 358     // 显示通知卸麻弹窗
359     showOffNarcosisNotice() {
360       // 打开弹窗
361       this.$refs['XioRoomOffNarcosisNotice'].showDialog()
362     },
363     // 点击显示隐藏称谓
364     tapAppellationHandle() {
365       this.isShowAppellationName = !this.isShowAppellationName
34cb2b 366     },
J 367     // 获取当前治疗信息
368     gatCurTreatInfo() {
369       if (this.assignTreatList && this.assignTreatList.length) {
1d1095 370         return this.assignTreatList.find((o) => { return o.id === this.curTreatId })
34cb2b 371       }
1d1095 372     },
J 373     // 刷新浏览器页面
374     resetPage() {
375       window.location.reload()
6da3c1 376     },
J 377     // 获取房间详情
378     getData() {
379       var params = {}
380       // 房间id
381       if (this.id) {
382         params.shopRoomId = this.id
383       }
384       Req.http.post({
878885 385         url: 'guide/treat/screen/room/info',
6da3c1 386         data: params,
J 387         udData: { noLoading: true },
388         header: { 'Content-Type': 'application/json' },
389         mockData: {
390           code: 100,
391           msg: '',
878885 392           data: {
J 393             roomInfo: {
394               roomNo: 'xx',
1d1095 395               status: 0 // 0空闲 1使用 2休息 3打扫 4 敷麻中
878885 396             },
J 397             assignTreatList: [{
398               startTime: '2023-12-08 00:00:00'
399             }],
400             occupyInfo: null
401           }
6da3c1 402         }
J 403       }).then((res) => {
404         if (res && res.data) {
cf3e3e 405           // 治疗时间处理
J 406           if (res.data.assignTreatList && res.data.assignTreatList.length) {
407             res.data.assignTreatList.forEach((o) => {
408               var st = (o.startTime).split(' ')[1].split(':')
409               o.startTime = `${st[0]}:${st[1]}`
1fa546 410               o.appellationName = o.userName[0] + `${o.gender ? ['女士', '先生', '女士'][o.gender] : '女士'}`
cf3e3e 411             })
J 412           }
40660a 413           // 已占用用户数据处理
J 414           if (res.data.occupyInfo && res.data.occupyInfo.userName) {
415             res.data.occupyInfo.appellationName = res.data.occupyInfo.userName[0] + `${res.data.occupyInfo.gender ? ['女士', '先生', '女士'][res.data.occupyInfo.gender] : '女士'}`
416           }
878885 417           // 已有占用的,更改已使用默认客人的状态
J 418           res.data.occupyInfo && (isUseDefaultChg = 1)
419           res.data.occupyInfo && (isUseDefault = 1)
cf3e3e 420           // 占用信息治疗时间处理
J 421           if (res.data.occupyInfo && res.data.occupyInfo.startTime) {
422             var ost = (res.data.occupyInfo.startTime).split(' ')[1].split(':')
423             res.data.occupyInfo.startTime = `${ost[0]}:${ost[1]}`
424           }
6da3c1 425           for (const key in res.data) {
J 426             this[key] = res.data[key]
427           }
428         }
429         // console.log('999999999999999999999999999', res)
df74f0 430         var offNarcosisTimer = null
J 431         offNarcosisTimer = setTimeout(() => {
2471a9 432           console.log('================================>', this.occupyInfoView, 'offNarcosisIds:', offNarcosisIds, 'isOffNarcosisShow:', isOffNarcosisShow)
40660a 433           if (this.occupyInfoView && this.occupyInfoView.hempStatus === 2 && this.occupyInfoView.visitOrderId) {
df74f0 434             var flag
2471a9 435             // offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.visitOrderId }))
J 436             flag = isOffNarcosisShow
df74f0 437             if (!flag) {
J 438               this.showOffNarcosisNotice()
439             }
440           }
441           clearTimeout(offNarcosisTimer)
442           offNarcosisTimer = null
443         }, 500)
6da3c1 444       })
aeb317 445     },
J 446     // 返回
447     back() {
34cb2b 448       // 重置默认已使用客人的参数
cf3e3e 449       isUseDefault = false
878885 450       isUseDefaultChg = 0
6da3c1 451       // 关闭计时
aeb317 452       this.stopCountGetTime('detail')
6da3c1 453       // 关闭轮询
aeb317 454       this.stopPollingAjaxFn('detail')
6da3c1 455       // 返回
bf4dca 456       // console.log('111111111', this.$route.meta.isPush)
J 457       if (this.$route && this.$route.meta && this.$route.meta.isPush) {
458         this.$router.go(-1)
459       } else {
460         this.$router.push({
461           path: `/`
462         })
463       }
6da3c1 464     },
cf3e3e 465     // 未有安排直接状态变更
6da3c1 466     statusChg(e) {
J 467       var { tx, status } = e.currentTarget.dataset
468       var { occupyInfoView, roomInfo } = this
469       console.log(tx, status)
470       // if (roomInfo && status * 1 == roomInfo.status) {
471       //   return
472       // }
473       this.changeStatusFn(occupyInfoView, status, () => {
474         this.getData()
475       })
476     },
477     // 按流程设置房间状态
478     setStatus(tx, status) {
479       var { occupyInfoView, roomInfo } = this
480       console.log(tx, status)
481       this.changeStatusFn(occupyInfoView, status, () => {
482         // 刷新详情
483         this.getData()
484       })
485     },
cf3e3e 486     // 改变房间状态异步方法
6da3c1 487     changeStatusFn(item = {}, status, cb) {
J 488       var params = {}
cf3e3e 489       // 更改的状态
J 490       params.status = status * 1
6da3c1 491       // 房间id
J 492       if (this.id) {
493         params.shopRoomId = this.id
494       }
495       // 治疗记录id
496       if (item && item.id) {
cf3e3e 497         params.treatRecordId = item.id
6da3c1 498       }
J 499       Req.http.post({
878885 500         url: 'guide/treat/screen/room/status/update',
6da3c1 501         data: params,
J 502         header: { 'Content-Type': 'application/json' },
503         mockData: {
504           code: 100,
505           msg: '',
506           data: {}
507         }
508       }).then((res) => {
878885 509         // 在已有默认客人的情况下,改变状态更改标识(适配轮询)
J 510         if (isUseDefault) {
34cb2b 511           console.log('在已有默认客人的情况下,改变状态更改标识')
878885 512           isUseDefaultChg = 1
34cb2b 513         }
J 514         // 当前选中的用户房间更改了状态,已经成为占用时,清除选中医疗记录id
515         if (item && item.id && item.id === this.curTreatId) {
516           console.log('当前选中的用户房间更改了状态,已经成为占用时,清除选中医疗记录id')
517           localStorage.removeItem('curTreatId')
518           this.curTreatId = ''
519         }
d73f98 520         // 只要更改为空闲就重置参数
J 521         if (status === 0) {
522           console.log('更改为空闲')
34cb2b 523           // 重置默认已使用客人的参数
J 524           isUseDefault = false
525           isUseDefaultChg = 0
1fa546 526           this.isShowAppellationName = true
878885 527         }
6da3c1 528         // console.log('8888888888888888888888888888888888', res)
J 529         cb && cb()
530       })
aeb317 531     },
J 532     // 重置状态
533     resetStatus() {
534       // 打开弹窗
535       this.$refs['XioRoomStatusChg'].showDialog()
536     },
cf3e3e 537     // 更改房间状态(重置状态的更改方法)
aeb317 538     changeStatus(opt) {
6da3c1 539       var { occupyInfoView, roomInfo } = this
J 540       console.log(opt.statusTx, opt.status)
541       // if (roomInfo && opt.status * 1 == roomInfo.status) {
542       //   return
543       // }
34cb2b 544       // 清除选中医疗记录id
J 545       localStorage.removeItem('curTreatId')
546       this.curTreatId = ''
547       this.changeStatusFn({}, opt.status, () => {
6da3c1 548         // 刷新详情
J 549         this.getData()
550         // 关闭弹窗
551         this.$refs['XioRoomStatusChg'].hideDialog()
552       })
aeb317 553     },
J 554     // 选择客户
555     selectCustomer(item = {}) {
34cb2b 556       if (item.act) {
J 557         return
558       }
aeb317 559       // 打开弹窗
J 560       this.$refs['XioCustomerSelect'].showDialog()
6da3c1 561       // 组件客户数据处理
aeb317 562       this.$refs['XioCustomerSelect'].dataInit(item)
J 563     },
564     // 选择客户取消
565     selectCustomerCancel(opt) {
566       console.log('cancel', opt)
567       this.$refs['XioCustomerSelect'].hideDialog()
568     },
569     // 选择客户确定
570     selectCustomerSubmit(opt) {
571       console.log('submit', opt)
34cb2b 572       // 确定选择的用户,记录id
J 573       localStorage.setItem('curTreatId', opt.id)
574       this.curTreatId = opt.id
575       // 重置房间状态
576       if (this.roomInfo && this.roomInfo.status) {
577         this.changeStatusFn({}, 0, () => {
578           // 刷新详情
579           this.getData()
580         })
581       }
582       // 关闭弹窗
583       this.$refs['XioCustomerSelect'].hideDialog()
3ac5f2 584     }
J 585   }
586 }
587 </script>
cf3e3e 588
J 589 <style>
590 .el-popper.top_tx {
591   text-align: center;
592   font-size: 25px;
593 }
594 </style>
3ac5f2 595
J 596 <style scoped>
878885 597 .page{
J 598   overflow: auto;
599 }
bb2b08 600 .page_header .reset_btn {
J 601   width: 200px;
602   height: 60px;
603   line-height: 35px;
604   border-radius: 5px;
605   background-color: rgba(47,174,206,1);
606   color: rgba(255,255,255,1);
607   font-size: 24px;
608   text-align: center;
609   font-family: Microsoft Yahei;
6da3c1 610   cursor: pointer;
bf4dca 611   border: 0;
J 612   margin-left: 20px;
bb2b08 613 }
J 614 .page_container .main {
878885 615   /* height: 100%; */
bb2b08 616   border-radius: 10px;
J 617   background-color: rgba(255,255,255,1);
618   color: rgba(16,16,16,1);
619   font-size: 14px;
620   /* text-align: center; */
621   font-family: Roboto;
622 }
623 .page_container .main .room_title {
624   line-height: 50px;
625   color: rgba(255,255,255,1);
626   font-size: 36px;
627   text-align: center;
628   font-family: PingFangSC-medium;
629   padding: 10px 0;
630   background-color: rgba(34,123,235,1);
631   width: 400px;
632   margin: 39px auto 0 auto;
633 }
634 .page_container .main .room_main_tip {
635   line-height: 168px;
636   font-size: 120px;
637   color: rgba(46,77,124,1);
638   text-align: center;
639   font-family: PingFangSC-medium;
640   margin-top: 107px;
641   /* font-weight: bold; */
642 }
643 .page_container .main .room_main_tip.gray {
644   color: rgba(154,154,154,1);
645 }
646 .page_container .main .btn_box {
647   margin-top: 130px;
648 }
649 .page_container .main .btn_box__item {
650   width: 250px;
651   height: 120px;
652   border-radius: 10px;
653   box-shadow: 0px 2px 6px 0px rgba(206,206,206,1);
654   margin-right: 70px;
6da3c1 655   cursor: pointer;
bb2b08 656 }
J 657 .page_container .main .btn_box__item:last-child {
658   margin-right: 0;
659 }
660 .page_container .main .btn_box__item.white {
661   background-color: rgba(255,255,255,1);
662 }
663 .page_container .main .btn_box__item.blue {
664   background-color: rgba(46,77,124,1);
665 }
666 .page_container .main .btn_box__item.yellow {
667   background-color: rgba(255,199,115,1);
668 }
669 .page_container .main .btn_box__item.gray {
670   background-color: rgba(206,206,206,1);
671 }
672 .page_container .main .btn_box__item .icon {
673   width: 60px;
674   height: 60px;
675   display: block;
676   margin-right: 17px;
878885 677 }
J 678 .page_container .main .btn_box__item .icon .img {
679   width: 100%;
680   height: 100%;
bb2b08 681 }
J 682 .page_container .main .btn_box__item .tx {
683   line-height: 37px;
684   color: rgba(51,51,51,1);
685   font-size: 26px;
686   text-align: center;
687   font-family: PingFangSC-medium;
688 }
689 .page_container .main .btn_box__item .tx.white {
690   color: rgba(255,255,255,1);
691 }
692 .page_container .main .room_left_btn_box {
693   padding: 0 23px;
694   margin-top: 163px;
695 }
696 .page_container .main .room_left_btn_box__item {
1d1095 697   width: 500px;
J 698   height: 150px;
699   line-height: 73px;
700   border-radius: 10px;
701   font-size: 50px;
702   text-align: center;
703   margin: auto;
704 }
705 .page_container .main .room_left_btn_box__item.flex-1 {
706   width: auto;
bb2b08 707   height: 150px;
J 708   line-height: 58px;
709   border-radius: 10px;
710   font-size: 40px;
711   text-align: center;
712   font-family: Microsoft Yahei;
713   margin-right: 20px;
714   font-weight: bold;
715 }
1d1095 716 /* .page_container .main .room_left_btn_box__item:last-child {
bb2b08 717   margin-right: 0;
1d1095 718 } */
bb2b08 719 .page_container .main .room_left_btn_box__item.yellow {
J 720   color: rgba(255,255,255,1);
721   background-color: rgba(233,157,66,1);
722 }
723 .page_container .main .room_left_btn_box__item.gray {
724   background-color: rgba(206,206,206,1);
725   color: rgba(79,79,79,1);
726 }
727 .page_container .main .room_left_btn_box__item.green {
728   background-color: rgba(47,174,206,1);
729   color: rgba(255,255,255,1);
1d1095 730 }
J 731 .page_container .main .room_left_btn_box__item.b-green {
732   background-color: rgba(79,167,114,1);
733   color: rgba(255,255,255,1);
bb2b08 734 }
J 735 .page_container .main .room_content {
736   margin-top: 30px;
737 }
738 .page_container .main .room_content .tip {
739   line-height: 33px;
740   color: rgba(79,79,79,1);
741   font-size: 24px;
742   text-align: center;
743   font-family: PingFangSC-medium;
744 }
745 .page_container .main .room_content .name {
746   line-height: 168px;
747   color: rgba(51,51,51,1);
748   font-size: 120px;
749   text-align: center;
750   font-family: PingFangSC-medium;
751   margin-top: 13px;
752 }
cf3e3e 753 .page_container .main .room_content .name .tx {
J 754   max-width: 666px;
755   margin: auto;
1fa546 756   text-align: center;
J 757 }
758 .page_container .main .room_content .name_icon {
759   width: 40px;
760   height: 40px;
761   display: block;
762   margin-top: 13px;
763   padding: 20px;
764 }
765 .page_container .main .room_content .name_icon .img {
766   width: 100%;
767   height: 100%;
cf3e3e 768 }
bb2b08 769 .page_container .main .room_content .ciq {
J 770   line-height: 42px;
771   color: rgba(51,51,51,1);
772   font-size: 30px;
773   text-align: center;
774   font-family: PingFangSC-regular;
775   margin-top: -5px;
776 }
777 .page_container .main .room_content .time {
778   line-height: 42px;
779   color: rgba(0,0,0,1);
780   font-size: 30px;
781   text-align: center;
782   font-family: PingFangSC-medium;
783   font-weight: bold;
784   margin-top: 21px;
785 }
786 .page_container .right {
787   width: 686px;
788   margin-left: 30px;
878885 789   /* height: 100%; */
bb2b08 790 }
J 791 .page_container .right_block {
792   width: 100%;
793   height: 100%;
794 }
795 .page_container .right .guest_title {
796   height: 60px;
797   line-height: 28px;
798   border-radius: 10px 10px 0px 0px;
799   background-color: rgba(255,255,255,1);
800   color: rgba(34,123,235,1);
801   font-size: 20px;
802   text-align: center;
803   font-family: Roboto;
804   font-weight: bold;
805 }
806 .page_container .right .guest_block {
cf3e3e 807   background-color: #fff;
bb2b08 808   overflow: auto;
J 809 }
810 .page_container .right .guest_list {
811   background-color: #fff;
812   padding-bottom: 23px;
813 }
814 .page_container .right .guest_list__row {
815   min-height: 75px;
816   background-color: rgba(34,123,235,0.1);
817 }
818 .page_container .right .guest_list__row:nth-child(2n) {
819   background-color: #fff;
820 }
bf4dca 821 .page_container .right .guest_list__row.rowtip {
J 822   background-color: #fff;
823   line-height: 30px;
824   color: rgba(0,0,0,.5);
825   font-size: 22px;
826 }
bb2b08 827 .page_container .right .guest_list__td {}
J 828 .page_container .right .guest_list__td .tx {
829   line-height: 30px;
830   color: rgba(16,16,16,1);
831   font-size: 22px;
832   text-align: center;
833   font-family: PingFangSC-regular;
cf3e3e 834   box-sizing: border-box;
J 835   padding: 0 5px;
bb2b08 836 }
J 837 .page_container .right .guest_list__td .icon {
838   width: 20px;
839   height: 20px;
840   display: block;
841 }
878885 842 .page_container .right .guest_list__td .icon .img {
J 843   width: 100%;
844   height: 100%;
845 }
bb2b08 846 .page_container .right .guest_list__td:nth-child(1) {
J 847   width: 19.54%;
848 }
849 .page_container .right .guest_list__td:nth-child(2) {
850   width: 21.86%;
851 }
852 .page_container .right .guest_list__td:nth-child(3) {
853   width: 46.06%;
854 }
855 .page_container .right .guest_list__td:nth-child(4) {
856   width: 12.54%;
857 }
858 .page_container .right .room_info {
859   width: 100%;
860   border-radius: 10px;
861   background-color: rgba(255,255,255,0.3);
862 }
863 .page_container .right .room_info .staff_box {
864   margin-top: 30px;
865 }
866 .page_container .right .room_info .staff_box_item {
867   height: 180px;
868 }
869 .page_container .right .room_info .staff_box_item:nth-child(1) {
870   background-color: rgba(255,255,255,0.1);
871 }
872 .page_container .right .room_info .staff_box_item:nth-child(2) {
873   background-color: rgba(255,255,255,0.3);
874   margin: 0 10px;
875 }
876 .page_container .right .room_info .staff_box_item:nth-child(3) {
877   background-color: rgba(255,255,255,0.1);
878 }
879 .page_container .right .room_info .staff_box_item__title {
880   line-height: 28px;
881   color: rgba(255,255,255,1);
882   font-size: 20px;
883   text-align: center;
884   font-family: PingFangSC-regular;
885 }
886 .page_container .right .room_info .staff_box_item__name {
887   line-height: 56px;
888   color: rgba(255,255,255,1);
889   font-size: 40px;
890   text-align: center;
891   font-family: PingFangSC-medium;
892   margin-top: 5px;
893 }
894 .page_container .right .room_info .room_info_project {
895   padding: 36px 20px 20px 20px;
896   height: 138px;
897   box-sizing: border-box;
898   overflow: hidden;
899 }
900 .page_container .right .room_info .room_info_project_block {
901   box-sizing: border-box;
902   width: 100%;
903   height: 100%;
904   overflow: auto;
905 }
906 .page_container .right .room_info .room_info_project .tx {
907   line-height: 39px;
908   color: rgba(255,255,255,1);
909   font-size: 28px;
910   text-align: center;
911   font-family: PingFangSC-regular;
912 }
913 .page_container .right .guest_box {
914   margin-top: 65px;
915   width: 100%;
916   height: 345px;
917   background-color: #fff;
918   overflow: hidden;
919 }
920 </style>