| | |
| | | </div> |
| | | </div> |
| | | <!-- 未有安排 --> |
| | | <div v-if="!occupyInfoView && (!assignTreatList || !assignTreatList.length)" class="page_container flex flex-1"> |
| | | <div v-if="!occupyInfoView && (!assignTreatListView || !assignTreatListView.length)" class="page_container flex flex-1"> |
| | | <div class="main flex-1"> |
| | | <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> |
| | | </div> |
| | | <!-- 没有客人和有安排 --> |
| | | <div v-if="!occupyInfoView && (assignTreatList && assignTreatList.length)" class="page_container flex flex-1"> |
| | | <div v-if="!occupyInfoView && (assignTreatListView && assignTreatListView.length)" class="page_container flex flex-1"> |
| | | <div class="main flex-1"> |
| | | <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div> |
| | | <div v-if="roomInfo" class="room_main_tip">-{{ statusTx[roomInfo.status] }}-</div> |
| | |
| | | <div class="right"> |
| | | <div class="right_block flex flex-col"> |
| | | <div class="guest_title flex flex-center">等待诊疗</div> |
| | | <div class="guest_block flex-1"> |
| | | <div v-if="assignTreatList && assignTreatList.length" class="guest_list"> |
| | | <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> |
| | | <div class="guest_block flex-1" style="border-radius: 0 0 10px 10px;"> |
| | | <div v-if="assignTreatListView && assignTreatListView.length" class="guest_list"> |
| | | <div v-for="(item, index) in assignTreatListView" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> |
| | | <div class="guest_list__td"> |
| | | <div class="tx flex flex-ver"> |
| | | <div class="flex-1 flex-1-w1 ell">{{ item.userName }}</div> |
| | |
| | | <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span> |
| | | </div> |
| | | <div class="guest_list__td flex flex-center"> |
| | | <div class="tx">切换</div> |
| | | <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">切换</div> |
| | | <!-- <div class="icon"> |
| | | <img class="img" src="static/imgs/choose.png"> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list"> |
| | | <div v-if="!assignTreatListView || !assignTreatListView.length" class="guest_list"> |
| | | <div class="guest_list__row flex flex-center rowtip">暂无数据</div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="guest_box flex flex-col"> |
| | | <div class="guest_box flex flex-col" style="border-radius: 10px;"> |
| | | <div class="guest_title flex flex-center">等待诊疗</div> |
| | | <div class="guest_block flex-1"> |
| | | <div v-if="assignTreatList && assignTreatList.length" class="guest_list"> |
| | | <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> |
| | | <div v-if="assignTreatListView && assignTreatListView.length" class="guest_list"> |
| | | <div v-for="(item, index) in assignTreatListView" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> |
| | | <div class="guest_list__td"> |
| | | <div class="tx flex flex-ver"> |
| | | <div class="flex-1 flex-1-w1 ell">{{ item.userName }}</div> |
| | |
| | | <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(医生)、':'' }}{{ item.aNurseName?item.aNurseName+'(护士)':'' }}</span> |
| | | </div> |
| | | <div class="guest_list__td flex flex-center"> |
| | | <div class="tx">切换</div> |
| | | <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">切换</div> |
| | | <!-- <div class="icon"> |
| | | <img class="img" src="static/imgs/choose.png"> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list"> |
| | | <div v-if="!assignTreatListView || !assignTreatListView.length" class="guest_list"> |
| | | <div class="guest_list__row flex flex-center rowtip">暂无数据</div> |
| | | </div> |
| | | </div> |
| | |
| | | occupyInfo: '', // 当前占用人的信息 |
| | | assignTreatList: [], |
| | | statusTx: ['空闲', '使用中', '客人休息', '打扫中'], |
| | | timeObj: {} // week:星期,date:年月日,timeMin:时分,time:时分秒,timeStamp:时间戳 |
| | | timeObj: {}, // week:星期,date:年月日,timeMin:时分,time:时分秒,timeStamp:时间戳 |
| | | curTreatId: '' |
| | | } |
| | | }, |
| | | computed: { |
| | | occupyInfoView() { |
| | | // console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg) |
| | | // 有占用 |
| | | if (this.occupyInfo) { |
| | | return this.occupyInfo |
| | | // 没有占用 |
| | | console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg) |
| | | // 有当前选中的,根据需求修改增加选中不更改状态,由空闲开始 |
| | | if (this.curTreatId) { |
| | | return this.gatCurTreatInfo() |
| | | } else { |
| | | // 还没使用默认客人值或者已使用默认客人值还没改变状态(适配轮询) |
| | | if ((!isUseDefault || (isUseDefault && isUseDefaultChg === 0)) && this.assignTreatList && this.assignTreatList.length) { |
| | | isUseDefault = true |
| | | return this.assignTreatList[0] |
| | | // 已使用过默认客人值 |
| | | // 有占用 |
| | | if (this.occupyInfo) { |
| | | return this.occupyInfo |
| | | // 没有占用 |
| | | } else { |
| | | return '' |
| | | // 还没使用默认客人值或者已使用默认客人值还没改变状态(适配轮询) |
| | | if ((!isUseDefault || (isUseDefault && isUseDefaultChg === 0)) && this.assignTreatList && this.assignTreatList.length) { |
| | | isUseDefault = true |
| | | return this.assignTreatList[0] |
| | | // 已使用过默认客人值 |
| | | } else { |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | assignTreatListView() { |
| | | if (this.assignTreatList && this.assignTreatList.length) { |
| | | this.assignTreatList.forEach((o) => { |
| | | o.act = false |
| | | if (this.occupyInfoView && this.occupyInfoView.id === o.id) { |
| | | o.act = true |
| | | } |
| | | }) |
| | | return this.assignTreatList |
| | | } else { |
| | | return [] |
| | | } |
| | | } |
| | | }, |
| | | activated() { |
| | | console.log('roomDetail mounted') |
| | | // 记录当前的治疗ID |
| | | var curTreatId = localStorage.getItem('curTreatId') |
| | | this.curTreatId = curTreatId || '' |
| | | this.id = this.$route.query.id || '' |
| | | this.init() |
| | | }, |
| | |
| | | // 轮询getData,8秒一次 |
| | | this.pollingAjaxFn(this, 'getData', 'detail', 8000) |
| | | // this.getData() |
| | | }, |
| | | // 获取当前治疗信息 |
| | | gatCurTreatInfo() { |
| | | if (this.assignTreatList && this.assignTreatList.length) { |
| | | return this.assignTreatList.find((o) => {return o.id === this.curTreatId}) |
| | | } |
| | | }, |
| | | // 获取房间详情 |
| | | getData() { |
| | |
| | | }, |
| | | // 返回 |
| | | back() { |
| | | // 重置默认已使用客人的参数 |
| | | isUseDefault = false |
| | | isUseDefaultChg = 0 |
| | | // 关闭计时 |
| | |
| | | }).then((res) => { |
| | | // 在已有默认客人的情况下,改变状态更改标识(适配轮询) |
| | | if (isUseDefault) { |
| | | console.log('在已有默认客人的情况下,改变状态更改标识') |
| | | isUseDefaultChg = 1 |
| | | } |
| | | // 当前选中的用户房间更改了状态,已经成为占用时,清除选中医疗记录id |
| | | if (item && item.id && item.id === this.curTreatId) { |
| | | console.log('当前选中的用户房间更改了状态,已经成为占用时,清除选中医疗记录id') |
| | | localStorage.removeItem('curTreatId') |
| | | this.curTreatId = '' |
| | | } |
| | | // 正常流程结束打扫 |
| | | if (item && item.id && status === 0) { |
| | | console.log('正常流程结束打扫') |
| | | // 重置默认已使用客人的参数 |
| | | isUseDefault = false |
| | | isUseDefaultChg = 0 |
| | | } |
| | | // console.log('8888888888888888888888888888888888', res) |
| | | cb && cb() |
| | |
| | | // if (roomInfo && opt.status * 1 == roomInfo.status) { |
| | | // return |
| | | // } |
| | | this.changeStatusFn(occupyInfoView, opt.status, () => { |
| | | // 清除选中医疗记录id |
| | | localStorage.removeItem('curTreatId') |
| | | this.curTreatId = '' |
| | | this.changeStatusFn({}, opt.status, () => { |
| | | // 刷新详情 |
| | | this.getData() |
| | | // 关闭弹窗 |
| | |
| | | }, |
| | | // 选择客户 |
| | | selectCustomer(item = {}) { |
| | | if (item.act) { |
| | | return |
| | | } |
| | | // 打开弹窗 |
| | | this.$refs['XioCustomerSelect'].showDialog() |
| | | // 组件客户数据处理 |
| | |
| | | // 选择客户确定 |
| | | selectCustomerSubmit(opt) { |
| | | console.log('submit', opt) |
| | | this.changeStatusFn(opt, 1, () => { |
| | | // 刷新详情 |
| | | this.getData() |
| | | // 关闭弹窗 |
| | | this.$refs['XioCustomerSelect'].hideDialog() |
| | | }) |
| | | // 确定选择的用户,记录id |
| | | localStorage.setItem('curTreatId', opt.id) |
| | | this.curTreatId = opt.id |
| | | // 重置房间状态 |
| | | if (this.roomInfo && this.roomInfo.status) { |
| | | this.changeStatusFn({}, 0, () => { |
| | | // 刷新详情 |
| | | this.getData() |
| | | }) |
| | | } |
| | | // 关闭弹窗 |
| | | this.$refs['XioCustomerSelect'].hideDialog() |
| | | } |
| | | } |
| | | } |