| | |
| | | import {DoctorApi, PatientStatisticVO, RoomBedVO} from '@/api/ecg/doctor'; |
| | | import {useUserStore} from "@/store/modules/user"; |
| | | import {QueueVO} from "@/api/ecg/queue"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | |
| | | |
| | | const state = ref<boolean>() |
| | | |
| | | const list = ref<QueueVO[]>([]) |
| | | const patientList = ref<QueueVO[]>([]) |
| | | |
| | | let timerRunFlag : boolean = false |
| | | const bedControlFlag = ref<boolean>(true); |
| | |
| | | |
| | | const finishNextPatient = async () => { |
| | | finishFlag.value = true |
| | | list.value = await DoctorApi.finishNextPatient(roomBedVO) |
| | | try { |
| | | patientList.value = await DoctorApi.finishNextPatient(roomBedVO) |
| | | patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) |
| | | } finally { |
| | | finishFlag.value = false |
| | | } |
| | | } |
| | | |
| | | const passNextPatient = async () => { |
| | | passFlag.value = true |
| | | list.value = await DoctorApi.passNextPatient(roomBedVO) |
| | | try { |
| | | patientList.value = await DoctorApi.passNextPatient(roomBedVO) |
| | | patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) |
| | | } finally { |
| | | passFlag.value = false |
| | | } |
| | | } |
| | | |
| | | const initLoad = async () => { |
| | | list.value = await DoctorApi.getPatientList(roomBedVO) |
| | | patientList.value = await DoctorApi.getPatientList(roomBedVO) |
| | | patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) |
| | | const queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO) |
| | | if (queueVO2.status === 20) |
| | |
| | | |
| | | const bedControl = async () => { |
| | | bedControlFlag.value = true |
| | | try { |
| | | if (state.value) { |
| | | await DoctorApi.bedDoctorPause(roomBedVO) |
| | | state.value = false |
| | |
| | | await DoctorApi.bedDoctorResume(roomBedVO) |
| | | state.value = true |
| | | } |
| | | } finally { |
| | | bedControlFlag.value = false |
| | | } |
| | | } |
| | | |
| | | const doctorTimer = () => { |
| | |
| | | roomBedVO.roomId = userStore.room!.roomId |
| | | roomBedVO.roomName = userStore.room!.roomName |
| | | roomBedVO.bedNo = userStore.room!.bedNo |
| | | } else { |
| | | roomBedVO.roomId = null |
| | | roomBedVO.bedNo = null |
| | | } |
| | | |
| | | timerRunFlag = true |
| | | doctorTimer() |
| | | } else { |
| | | roomBedVO.roomId = null |
| | | roomBedVO.bedNo = null |
| | | |
| | | ElMessage({ |
| | | message: '请先入座!', |
| | | type: 'info', |
| | | duration: 3000 // 自动关闭时间,默认为3000ms |
| | | }) |
| | | } |
| | | |
| | | bedControlFlag.value = false |
| | | finishFlag.value = false |
| | |
| | | 装机界面 |
| | | </el-main> |
| | | <el-aside width="300px" style="background-color: var(--el-color-primary-light-7);"> |
| | | <QueuePanel :queue="list"/> |
| | | <QueuePanel :queue="patientList"/> |
| | | </el-aside> |
| | | </el-container> |
| | | <el-container style="justify-content: center; margin-top: 30px"> |