From 4ca01635eeaeb016e1489cfac1088f396d93e519 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 10 九月 2024 16:57:17 +0800
Subject: [PATCH] 装机 用户通过 上级设置 不通过 property

---
 src/views/ecg/doctor/index.vue                      |    8 +++++---
 src/views/ecg/doctor/components/DevInstallPanel.vue |   10 +++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 22b0a62..48b0bcd 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -1,5 +1,5 @@
 <template>
-  褰撳墠鎮h��: {{patient.patId}} {{isStringEmpty(patient.patName)?'鏃�':patient.patName}}
+  褰撳墠鎮h��: {{patient?.patId}} {{isStringEmpty(patient?.patName)?'鏃�':patient.patName}}
     <el-form
       ref="formRef"
       :model="formData"
@@ -117,8 +117,8 @@
   formData.value = {
     id: undefined,
     devId: undefined,
-    patId: patient.value.patId,
-    patName: patient.value.patName,
+    patId: patient.value?.patId,
+    patName: patient.value?.patName,
     rentTime: new Date().getTime(),
     returnTime: undefined,
     interference: undefined,
@@ -129,9 +129,9 @@
   formRef.value?.resetFields()
 }
 
-const setPatient = (queueVO: QueueVO) => {
+const setPatient = (queueVO: QueueVO | undefined) => {
   patient.value = queueVO
-  formData.value.id = undefined
+  resetForm()
 }
 defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
 
diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue
index 1a8b80e..2e74ca7 100644
--- a/src/views/ecg/doctor/index.vue
+++ b/src/views/ecg/doctor/index.vue
@@ -58,7 +58,9 @@
 
 const getOnstagePatient = () => {
   const tempPatient : QueueVO | undefined = patientList.value.find(item => item.status === 30)
-  if (tempPatient !== undefined && tempPatient.patId !== onStagePatient.value.patId) {
+  if (undefined === tempPatient) {
+    setOnStagePatient(undefined)
+  } else if (tempPatient.patId !== onStagePatient.value.patId) {
     onStagePatient.value= tempPatient
     setOnStagePatient(tempPatient)
   }
@@ -135,12 +137,12 @@
 })
 
 const onEvent = () => {
-  console.info("onDevRentPanelEvent...")
+  // console.info("onDevRentPanelEvent...")
 }
 
 /** 鎮h�呭彉鏇存搷浣� */
 const devInstallPanelRef = ref()
-const setOnStagePatient = (tempPatient: QueueVO) => {
+const setOnStagePatient = (tempPatient: QueueVO | undefined) => {
   devInstallPanelRef.value.setPatient(tempPatient)
 }
 

--
Gitblit v1.9.3