From aa2d6665f95a0701b61272fd8065663070565034 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 15 四月 2025 12:31:05 +0800
Subject: [PATCH] bug fix:  pat_id  dev_id 都为空时 不应该取患者列表

---
 src/views/ecg/doctor/components/RoutinePanel.vue    |    3 +
 src/views/ecg/doctor/DevInstall.vue                 |   18 ++++-----
 src/views/ecg/doctor/Routine.vue                    |   14 +++---
 src/views/ecg/doctor/index.vue                      |    6 --
 src/views/ecg/doctor/components/DevInstallPanel.vue |   19 +++++----
 src/views/ecg/doctor/components/DevReadyPanel.vue   |    3 +
 6 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/src/views/ecg/doctor/DevInstall.vue b/src/views/ecg/doctor/DevInstall.vue
index 06bbebc..190c3df 100644
--- a/src/views/ecg/doctor/DevInstall.vue
+++ b/src/views/ecg/doctor/DevInstall.vue
@@ -3,7 +3,6 @@
 import DevInstallPanel from "@/views/ecg/doctor/components/DevInstallPanel.vue";
 import QueuePanel from "@/views/ecg/doctor/components/QueuePanel.vue";
 import {DoctorApi, PatientStatisticVO, RoomBedVO} from '@/api/ecg/doctor';
-import {useUserStore} from "@/store/modules/user";
 import {QueueVO} from "@/api/ecg/queue";
 import {ElNotification} from "element-plus";
 import {useRoomStore} from "@/store/modules/room";
@@ -18,10 +17,10 @@
     opType: null
 })
 
-const installingPatient = ref<QueueVO>({
+let installingPatient: QueueVO = {
   bedNo: "", bookCheckType: 0, bookTimeslot: 0, expired: 0, id: 0, jumpFlag: 0, passed: 0,
   patGender: 0, patId: "", patName: "", roomId: 0, roomName: "", seqNum: 0, status: 0
-})
+}
 
 const patientStat = ref<PatientStatisticVO>({
     finishedNum: 0,
@@ -49,7 +48,7 @@
     getInstallingPatient()
 
     // 鐢ㄤ簬瑙e喅 宸︿晶閲嶇疆鍚� 鑾峰彇褰撳墠 銆愬畨瑁呬腑銆戞偅鑰�
-    setInstallingPatient(installingPatient.value)
+    setInstallingPatient(installingPatient)
   } finally {
     finishFlag.value = false
   }
@@ -71,11 +70,11 @@
 }
 
 const getInstallingPatient = () => {
-  const tempPatient : QueueVO | undefined = patientList.value.find(item => item.status === 36)
-  if (undefined === tempPatient) {
+  const tempPatient : QueueVO | undefined | null = patientList.value.find(item => item.status === 36)
+  if (tempPatient == null) {
     //setInstallingPatient(undefined)
-  } else if (tempPatient.patId !== installingPatient.value.patId) {
-    installingPatient.value= tempPatient
+  } else if (tempPatient.patId !== installingPatient.patId) {
+    installingPatient = tempPatient
     setInstallingPatient(tempPatient)
   }
 }
@@ -155,8 +154,7 @@
 })
 
 const onEventDevInstall = () => {
-   //console.info("onDevInstallPanelEvent...")
-  installingPatient.value.patId = ""
+  installingPatient.patId = ""
 
   if (autoCall.value) {
     finishNextPatient()
diff --git a/src/views/ecg/doctor/Routine.vue b/src/views/ecg/doctor/Routine.vue
index c85e051..3b63189 100644
--- a/src/views/ecg/doctor/Routine.vue
+++ b/src/views/ecg/doctor/Routine.vue
@@ -18,12 +18,12 @@
     opType: null
 }
 
-const onStagePatient = ref<QueueVO>({
+let onStagePatient: QueueVO = {
   id: 0, patId: "", patName: "", patGender: 0,
   bookTimeslot: 0, bookCheckType: 0, isVip: 0, seqNum: 0, bookSeqNum: 0,
   passed: 0, expired: 0, jumpFlag: 0,
   roomId: 0, roomName: "", bedNo: "", status: 0
-})
+}
 
 const patientStat = ref<PatientStatisticVO>({
     finishedNum: 0,
@@ -51,7 +51,7 @@
     getOnstagePatient()
 
     // 鐢ㄤ簬瑙e喅 宸︿晶閲嶇疆鍚� 鑾峰彇褰撳墠銆愬氨璇婁腑銆戞偅鑰�
-    setOnStagePatient(onStagePatient.value)
+    setOnStagePatient(onStagePatient)
   } finally {
     finishFlag.value = false
   }
@@ -76,9 +76,9 @@
   const tempPatient : QueueVO | undefined = patientList.value.find(item => item.status === 30)
   if (undefined === tempPatient) {
     // setOnStagePatient(undefined)
-  } else if (tempPatient.patId !== onStagePatient.value.patId) {
-    onStagePatient.value= tempPatient
-    setOnStagePatient(onStagePatient.value)
+  } else if (tempPatient.patId !== onStagePatient.patId) {
+    onStagePatient = tempPatient
+    setOnStagePatient(onStagePatient)
   }
 }
 
@@ -156,7 +156,7 @@
 
 const onEventRoutine = () => {
    //console.info("onDevRentPanelEvent...")
-  onStagePatient.value.patId = ""
+  onStagePatient.patId = ""
 
   if (autoCall.value) {
     finishNextPatient()
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 9dc5525..9079021 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -142,8 +142,6 @@
 const { t } = useI18n() // 鍥介檯鍖�
 const message = useMessage() // 娑堟伅寮圭獥
 
-const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
-
 const formRef = ref() // 琛ㄥ崟 Ref
 
 const displayBarCode = ref<string> ()
@@ -180,14 +178,15 @@
 
 const checkTypeStore = useCheckTypeStore()
 
-const setPatient = (queueVO: QueueVO | undefined) => {
+const setPatient = (queueVO: QueueVO | undefined | null) => {
+  console.log("setPatient...", queueVO)
   resetForm()
   formData.value.applyNo = queueVO?.applyNo
   formData.value.episodeId = queueVO?.episodeId
   formData.value.patId = queueVO?.patId
   formData.value.patName = queueVO?.patName
   formData.value.checkType = queueVO?.bookCheckType
-  getReadyRentInfo(formData.value)
+  getReadyRentInfo(formData.value)    // 鑾峰彇棰嗙敤淇℃伅
   copyBarcode()
 }
 defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
@@ -207,12 +206,13 @@
     formData.value.bedNo = props.room.bedNo
     const data = formData.value as unknown as DevRentVO
     await DevRentApi.devInstall(data)
-    message.success(t('鎿嶄綔鎴愬姛'))
-    dialogVisible.value = false
-    // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
-    emit('event_dev_install')
+
     resetForm()
     getList()
+
+    // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+    emit('event_dev_install')
+    message.success(t('鎿嶄綔鎴愬姛'))
   } finally {
     formLoading.value = false
   }
@@ -271,6 +271,9 @@
 
 // 鑾峰彇鎮h�呯殑棰嗙敤淇℃伅
 const getReadyRentInfo = async (devRentVO) => {
+  if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '') )
+    return
+
   const data = await DevRentApi.getReadyRent(devRentVO)
   if ( data == null)
     return
diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index b06dfca..3d52e4c 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -215,6 +215,9 @@
 
 // 鏍规嵁鎮h�呮垨璁惧, 鑾峰彇 Free鐨勭璧�
 const getFreeRentInfo = async (devRentVO) => {
+  if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '') )
+    return
+
   const data = await DevRentApi.getFreeRent(devRentVO)
   if (null === data)
     return
diff --git a/src/views/ecg/doctor/components/RoutinePanel.vue b/src/views/ecg/doctor/components/RoutinePanel.vue
index 2b76667..bfb8206 100644
--- a/src/views/ecg/doctor/components/RoutinePanel.vue
+++ b/src/views/ecg/doctor/components/RoutinePanel.vue
@@ -242,6 +242,9 @@
 }
 
 const getFreeRentInfo = async (devRentVO) => {
+  if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '') )
+    return
+
   const data = await DevRentApi.getFreeRent(devRentVO)
   if (null === data)
     return
diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue
index 52e210f..f119c29 100644
--- a/src/views/ecg/doctor/index.vue
+++ b/src/views/ecg/doctor/index.vue
@@ -152,12 +152,8 @@
 })
 
 const onEventDevReady = () => {
-  onStagePatient = {
-    bedNo: "", bookCheckType: 0, bookTimeslot: 0, expired: 0, id: 0, jumpFlag: 0, passed: 0,
-    patGender: 0, patId: "", patName: "", roomId: 0, roomName: "", seqNum: 0, status: 0
-  }
+  onStagePatient.patId = ""
 
-  console.info("autoCall " + autoCall.value)
   if (autoCall.value) {
     finishNextPatient()
   } else {

--
Gitblit v1.9.3