From bd32d8b406d90e72ba97273c0862adeb67d39073 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期三, 28 八月 2024 11:38:07 +0800 Subject: [PATCH] update --- src/views/ecg/doctor/index.vue | 53 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue index d2fe88a..85f55e8 100644 --- a/src/views/ecg/doctor/index.vue +++ b/src/views/ecg/doctor/index.vue @@ -1,31 +1,56 @@ <script setup lang="ts"> import TitlePanel from "@/views/ecg/doctor/components/TitlePanel.vue"; import QueuePanel from "@/views/ecg/doctor/components/QueuePanel.vue"; -import { DoctorApi, RoomBedVO } from '@/api/ecg/doctor'; +import {DoctorApi, PatientStatisticVO, RoomBedVO} from '@/api/ecg/doctor'; import {useUserStore} from "@/store/modules/user"; -import {queueVO} from "@/api/ecg/queue"; +import {queueApi, queueVO} from "@/api/ecg/queue"; const userStore = useUserStore(); const roomBedVO: RoomBedVO = { - roomId: userStore.room.roomId, - bedNo: userStore.room.bedNo + roomId: userStore.room!.roomId, + bedNo: userStore.room!.bedNo } + +const patientStat = ref<PatientStatisticVO>({ + finishedNum: 0, + readyNum: 0, + passedNum: 0, + queuingNum: 0 +}) + +const state = ref<boolean>(true) const list = ref<queueVO[]>([]) -const nextPatient = async () => { - const data = await DoctorApi.nextPatient(roomBedVO) - list.value = data +const finishNextPatient = async () => { + list.value = await DoctorApi.finishNextPatient(roomBedVO) + patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) } -const finishPatient = async () => { +const passNextPatient = async () => { + list.value = await DoctorApi.passNextPatient(roomBedVO) + patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) +} +const getPatientList = async () => { + list.value = await DoctorApi.getPatientList(roomBedVO) + patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) +} + +const pauseQueue = async () => { + state.value = false + queueApi.bedDoctorPause(roomBedVO) +} + +const resumeQueue = async () => { + state.value = true + queueApi.bedDoctorResume(roomBedVO) } /** 鍒濆鍖� **/ onMounted(() => { - nextPatient() + getPatientList() }) </script> @@ -33,7 +58,7 @@ <template> <el-container> <el-header style="background-color: var(--el-color-primary-light-7); font-size: 24px"> - <TitlePanel room="A208"/> + <TitlePanel :patientStatistic="patientStat" /> </el-header> <el-container> <el-main> @@ -43,9 +68,11 @@ <QueuePanel :queue="list"/> </el-aside> </el-container> - <el-container style="justify-content: center;"> - <el-button type="primary" @click="finishPatient">瀹屾垚</el-button> - <el-button type="primary" @click="nextPatient">涓嬩竴浣�</el-button> + <el-container style="justify-content: center; margin-top: 30px"> + <el-button type="primary" @click="finishNextPatient">鍙彿</el-button> + <el-button type="primary" @click="passNextPatient">杩囧彿</el-button> + <el-button v-if="state" type="primary" @click="pauseQueue">鏆傚仠</el-button> + <el-button v-else type="primary" @click="resumeQueue">鎭㈠</el-button> </el-container> </el-container> </template> -- Gitblit v1.9.3