From 9125541bf113a2d07ad84e7ed9fb1506dbde813f Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期四, 24 十月 2024 16:57:48 +0800 Subject: [PATCH] update --- src/views/ecg/doctor/components/DevInstallPanel.vue | 51 +++++++++++++++++++++++++++++---------------------- 1 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue index 442d30e..b620d7d 100644 --- a/src/views/ecg/doctor/components/DevInstallPanel.vue +++ b/src/views/ecg/doctor/components/DevInstallPanel.vue @@ -116,11 +116,28 @@ import {isStringEmpty} from "@/utils/stringUtil"; import {curDayEnd, curDayStart} from "@/utils/dateUtil"; import {DeviceApi} from "@/api/ecg/devmanage"; +import {QueueVO} from "@/api/ecg/queue"; +import {RoomBedVO} from "@/api/ecg/doctor"; -/** 瑁呮満 琛ㄥ崟 */ -defineOptions({ name: 'DevrInstall' }) +/** 璁惧瑁呮満 琛ㄥ崟 */ +defineComponent({ name: 'DevInstallPanel' }) + +const props = defineProps({ + room: { + type: Object as PropType<RoomBedVO>, + required: true + } +}) const emit = defineEmits(['event_dev_install']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋� + +const setPatient = (queueVO: QueueVO | undefined) => { + resetForm() + formData.value.patId = queueVO?.patId + formData.value.patName = queueVO?.patName + getReadyRentInfo() +} +defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰� const { t } = useI18n() // 鍥介檯鍖� const message = useMessage() // 娑堟伅寮圭獥 @@ -144,8 +161,9 @@ // 鎻愪氦璇锋眰 formLoading.value = true try { + formData.value.roomId = props.room.roomId + formData.value.bedNo = props.room.bedNo const data = formData.value as unknown as DevRentVO - //await DevRentApi.updateDevRent(data) await DevRentApi.devInstall(data) message.success(t('鎿嶄綔鎴愬姛')) dialogVisible.value = false @@ -198,18 +216,6 @@ formData.value.model = data === null ? "" : data.model } -/* -const getRentInfoByDevId = () => { - const tempDevId = formData.value.devId; - resetForm() - if (isStringEmpty(tempDevId)) - return - - formData.value.devId = tempDevId; - getRentInfo() -} -*/ - const getRentInfoByPatId = () => { const tempPatId = formData.value.patId; resetForm() @@ -217,19 +223,18 @@ return formData.value.patId = tempPatId; - getRentInfo() + getReadyRentInfo(formData.value) } -const getRentInfo = async () => { - const data = await DevRentApi.getReadyRent(formData.value) +const getReadyRentInfo = async (devRentVO) => { + const data = await DevRentApi.getReadyRent(devRentVO) if (null === data) return - formData.value = data - if (data.returnTime === null) - data.returnTime = new Date().getTime() + // formData.value = data //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿瑁呮満鏃堕棿琚竻绌� + formData.value.id = data.id; + formData.value.patDetails = data.patDetails } - const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑 const list = ref<JobRecordVO[]>([]) // 鍒楄〃鐨勬暟鎹� @@ -270,6 +275,8 @@ } const cancelInstall = async () => { + formData.value.roomId = props.room.roomId + formData.value.bedNo = props.room.bedNo const data = formData.value as unknown as DevRentVO if (formData.value.id === null || formData.value.id === undefined) { const result = await DevRentApi.devInstallCancel(data) -- Gitblit v1.9.3