| | |
| | | // import xioFn from './utils/xio_fn.js' |
| | | var isUseDefault = false // 是否已使用默认客人 |
| | | var isUseDefaultChg = 0// 已使用默认客人后房间是否有改变状态 |
| | | var isOffNarcosis = '0'// 是否卸麻,默认已卸麻,即不弹出弹框 |
| | | var offNarcosisIds = [] // 是否已通知卸麻id数组 |
| | | export default { |
| | | name: 'RoomDetail', |
| | | components: { |
| | |
| | | console.log('roomDetail mounted') |
| | | // 记录当前的治疗ID |
| | | var curTreatId = localStorage.getItem('curTreatId') |
| | | var localIsOffNarcosis = localStorage.getItem('isOffNarcosis') |
| | | // 是否已通知卸麻 |
| | | if (localIsOffNarcosis) { |
| | | isOffNarcosis = localIsOffNarcosis |
| | | 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.pollingAjaxFn(this, 'getData', 'detail', 8000) |
| | | // this.getData() |
| | | }, |
| | | // 设置已通知卸麻id数组 |
| | | setLocalStorageOffNarcosisIds() { |
| | | localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds)) |
| | | }, |
| | | // 卸麻通知确认 |
| | | offNarcosisNoticeConfirm() { |
| | | isOffNarcosis = '1' |
| | | localStorage.setItem('isOffNarcosis', '1') |
| | | if (this.occupyInfoView) { |
| | | offNarcosisIds.push(this.occupyInfoView.visitOrderId) |
| | | this.setLocalStorageOffNarcosisIds() |
| | | } |
| | | }, |
| | | // 显示通知卸麻弹窗 |
| | | showOffNarcosisNotice() { |
| | |
| | | } |
| | | } |
| | | // console.log('999999999999999999999999999', res) |
| | | // todo 弹窗显示判断 |
| | | // isOffNarcosis === '0' |
| | | // this.showOffNarcosisNotice() |
| | | var offNarcosisTimer = null |
| | | offNarcosisTimer = setTimeout(() => { |
| | | console.log('================================>', this.occupyInfoView) |
| | | if (this.occupyInfoView && this.occupyInfoView.hempStatus === 1 && 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) |
| | | }) |
| | | }, |
| | | // 返回 |
| | |
| | | // 重置默认已使用客人的参数 |
| | | isUseDefault = false |
| | | isUseDefaultChg = 0 |
| | | isOffNarcosis = '0' |
| | | localStorage.setItem('isOffNarcosis', '0') |
| | | // 关闭计时 |
| | | this.stopCountGetTime('detail') |
| | | // 关闭轮询 |