| | |
| | | import QueuePanel from '@/views/ecg/doctor/components/QueuePanel.vue' |
| | | import DoctorPageLayout from '@/components/DoctorPageLayout/src/DoctorPageLayout.vue' |
| | | import { DoctorApi, PatientStatisticVO, RoomBedVO, } from '@/api/ecg/doctor' |
| | | import { notifySeatInvalidOnce, isSeatInvalidError, resetSeatInvalidNotify } from '@/utils/seatGuard' |
| | | import { QueueVO } from '@/api/ecg/queue' |
| | | import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import RoutinePanel from '@/views/ecg/doctor/components/RoutinePanel.vue' |
| | | import { useRoomStore } from '@/store/modules/room' |
| | | |
| | |
| | | |
| | | // ==================== 需求3:停止候诊开关 ==================== |
| | | // 语义:开启后【已有候诊病人继续叫号,但不再新增候诊病人】;关闭后恢复。 |
| | | // 与上面的"暂停/恢复"是**两个独立概念**:暂停会把就诊中患者强制完成、 |
| | | // 并把候诊患者踢出工位;本开关只拦截"新增",不动已有患者。 |
| | | // 与上面的"暂停/恢复"是**两个独立概念**(注意:两者都只拦截"新增",都不动已有患者): |
| | | // · 暂停:工位状态 20「在座」→ 30「暂停」(管理端/监控页可见),同时摘出分流队列; |
| | | // · 停止候诊:工位状态仍是 20「在座」,只写 clinic_room.stop_ready 并摘出分流队列。 |
| | | // 两者都**不会**强制完成「就诊中」患者、也**不会**清空「候诊中」患者; |
| | | // 叫号接口(nextPatient)不检查这两个状态,所以已有候诊仍可正常叫号。 |
| | | const stopReady = ref<boolean>(false) |
| | | const stopReadyFlag = ref<boolean>(true) // 防连点 |
| | | |
| | |
| | | |
| | | const initLoad = async () => { |
| | | if (roomBedVO.roomId == null) { |
| | | ElNotification.error({ |
| | | message: '请重新就座!', |
| | | type: 'info', |
| | | duration: 3000 // 自动关闭时间,默认为3000ms |
| | | }) |
| | | // 【本需求】没有工位:**停掉轮询**并只提示一次(原来每 5 秒弹一次,现场表现就是"一直跳") |
| | | timerRunFlag = false |
| | | notifySeatInvalidOnce() |
| | | return |
| | | } |
| | | |
| | |
| | | loadRoomWaitingList() |
| | | getOnstagePatient() |
| | | patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) |
| | | const queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO) |
| | | // 【本需求】bed-doctor-get 是"我是否还坐在这里"的判定:失败说明工位已被释放 / 他人接手, |
| | | // 此时停掉轮询并一次性提示,避免每 5 秒刷一次"请重新就座"。 |
| | | let queueVO2: any |
| | | try { |
| | | queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO) |
| | | } catch (e: any) { |
| | | if (isSeatInvalidError(e)) { |
| | | timerRunFlag = false |
| | | notifySeatInvalidOnce() |
| | | return |
| | | } |
| | | throw e |
| | | } |
| | | // 【加固】接口可能返回 null,原来直接取 .status 会抛异常、中断本轮后续步骤 |
| | | if (queueVO2 && queueVO2.status === 20) state.value = true |
| | | else if (queueVO2 && queueVO2.status === 30) state.value = false |
| | |
| | | roomBedVO.bedNo = roomStore.room.bedNo |
| | | roomBedVO.checkTypes = roomStore.room.checkTypes |
| | | roomBedVO.opType = roomStore.room.opType |
| | | // 【本需求】重新拿到工位 -> 复位【工位失效】提示,允许下次再提示一次 |
| | | resetSeatInvalidNotify() |
| | | // 【本次需求】换工位后**整页数据都换成新工位的**: |
| | | // ① 先清空左侧"患者信息"(避免还显示上一个工位的患者) |
| | | routimePanelRef.value?.setPatient?.(undefined) |
| | |
| | | roomBedVO.bedNo = roomStore.room!.bedNo |
| | | roomBedVO.checkTypes = roomStore.room!.checkTypes |
| | | roomBedVO.opType = roomStore.room!.opType |
| | | resetSeatInvalidNotify() |
| | | |
| | | timerRunFlag = true |
| | | doctorTimer() |