| | |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | resetCurSel() |
| | | |
| | | const data = await RoomApi.getOpeningBedMap() |
| | | console.info(data) |
| | | bedMap.value = data; |
| | | |
| | | isEmptyOpeningBed.value = true |
| | | isEmptyOpeningBed.value = true |
| | | for (const key in data) { |
| | | isEmptyOpeningBed.value = false |
| | | const roomVOArray = data[key] as RoomVO[]; |
| | |
| | | |
| | | if (newRoomVO !== curSel.value) { |
| | | let data; |
| | | if (curSel.value.roomId !== null) { |
| | | if (curSel.value.docId !== null) { |
| | | data = await queueApi.bedDoctorOff(curSel.value) |
| | | if (data !== 0) { |
| | | ElMessage({ |
| | |
| | | return |
| | | } |
| | | } |
| | | curSel.value.docId = null |
| | | curSel.value.docName = null |
| | | |
| | | data = await queueApi.bedDoctorOn(tempRoomVO) |
| | | if (data !== 0) { |
| | | ElMessage({ |
| | |
| | | } |
| | | } |
| | | |
| | | userStore.setRoomInfoAction(tempRoomVO) |
| | | |
| | | if (curSel.value.roomId !== null) { |
| | | curSel.value.docId = null |
| | | curSel.value.docName = null |
| | | } |
| | | |
| | | newRoomVO.docId = curUser.id |
| | | newRoomVO.docName = curUser.nickname |
| | | curSel.value = newRoomVO |
| | | userStore.setRoomInfoAction(curSel.value) |
| | | |
| | | if (isStringEmpty(route.redirectedFrom?.fullPath)) |
| | | push({ path: "/"}) |
| | |
| | | |
| | | curSel.value.docId = null |
| | | curSel.value.docName = null |
| | | curSel.value = { |
| | | id: null, |
| | | roomId: null, |
| | | roomName: null, |
| | | bedNo: null, |
| | | status: null, |
| | | docId: null, |
| | | docName: null |
| | | } |
| | | resetCurSel() |
| | | } |
| | | |
| | | userStore.clearRoomInfoAction() |
| | |
| | | push({ path: route.redirectedFrom?.fullPath}) |
| | | } |
| | | |
| | | const resetCurSel = () => { |
| | | curSel.value.id = null |
| | | curSel.value.roomId = null |
| | | curSel.value.roomName = null |
| | | curSel.value.bedNo = null |
| | | curSel.value.status = null |
| | | curSel.value.docId = null |
| | | curSel.value.docName = null |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |