From 1446994d504819c367e1ff667360eadb314f9ac6 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 18 十月 2026 16:52:18 +0800
Subject: [PATCH] 修改了诊室工号

---
 src/views/ecg/doctor/DevInstall.vue |   50 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/src/views/ecg/doctor/DevInstall.vue b/src/views/ecg/doctor/DevInstall.vue
index 95f6ed4..0e5a846 100644
--- a/src/views/ecg/doctor/DevInstall.vue
+++ b/src/views/ecg/doctor/DevInstall.vue
@@ -40,6 +40,8 @@
 const state = ref<boolean>()
 
 const patientList = ref<QueueVO[]>([])
+/** 銆愯嚜鍔╄瘖鏂�戞渶杩戜竴娆″彇鏁扮殑璇存槑锛堢┖鍒楄〃鏃舵樉绀猴級 */
+const fetchInfo = ref('')
 
 let timerRunFlag : boolean = false
 const bedControlFlag = ref<boolean>(true);
@@ -95,13 +97,16 @@
     return
   }
 
-  patientList.value = await DoctorApi.getToBeInstalledPatientList(roomBedVO.value)
+  patientList.value = (await DoctorApi.getToBeInstalledPatientList(roomBedVO.value)) || []
+  // 銆愯嚜鍔╄瘖鏂�戣褰曟湰娆″彇鏁版椂闂翠笌鏉℃暟锛堢┖鍒楄〃鏃舵樉绀猴級
+  fetchInfo.value = `鏈�杩戝彇鏁� ${new Date().toLocaleTimeString()} 路 杩斿洖 ${patientList.value.length} 鏉
   getInstallingPatient()
   patientStat.value = await DoctorApi.getDevInstallStatistic(roomBedVO.value)
   const queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO.value)
-  if (queueVO2.status === 20)
+  // 銆愬姞鍥恒�戞帴鍙e彲鑳借繑鍥� null锛屽師鏉ョ洿鎺ュ彇 .status 浼氭姏寮傚父銆佷腑鏂湰杞悗缁楠�
+  if (queueVO2 && queueVO2.status === 20)
     state.value = true
-  else if (queueVO2.status === 30)
+  else if (queueVO2 && queueVO2.status === 30)
     state.value = false
   // 闇�姹�3锛氬悓姝�"鍋滄鍊欒瘖"寮�鍏崇姸鎬�
   await loadStopReady()
@@ -188,6 +193,8 @@
       checkType: last.bookCheckType
     } as any)
     ElMessage.success(msg || '宸叉挙閿�')
+    // 銆愭挙閿�鏍囪瘑銆戞挙閿�鍚庣珛鍒诲埛鏂般�屽凡瀹屾垚璁板綍銆嶅垪琛紝璁╄繖鏉¤褰曟樉绀烘垚銆屽凡鎾ら攢銆�
+    devInstallPanelRef.value?.getList?.()
     await initLoad()
   } finally {
     undoFlag.value = false
@@ -211,12 +218,42 @@
 
 const doctorTimer = () => {
   console.log('doctorTimer ...')
-  initLoad()
+  // 銆愬姞鍥恒�戝崟杞彇鏁板け璐ヤ笉鑳藉彉鎴� unhandled rejection锛堝師鏉� `initLoad()` 涓� await 涓� catch锛�
+  // 鏌愯疆鎺ュ彛寮傚父浼氳椤甸潰鍋滃湪鏃ф暟鎹紝鐜板満琛ㄧ幇灏辨槸"鍒楄〃涓�鐩存槸绌虹殑"锛夈��
+  initLoad().catch((e) => console.error('[doctorTimer] 鏈疆鍙栨暟澶辫触锛堝凡蹇界暐锛屼笅涓�杞户缁級', e))
   if (timerRunFlag)
     setTimeout(doctorTimer, 5000) // five seconds
 }
 
 /** 鍒濆鍖� **/
+/**
+ * 銆愪富/鍥磋銆戣窡闅� store 鍒囨崲"姝e湪鏌ョ湅鐨勫伐浣�"锛堝師鏉ュ彧鍦� onMounted 鎷蜂竴娆★紝
+ * 鍒囧埌鍒殑浜哄伐浣嶅洿瑙傚悗鏈〉鏁版嵁涓嶅彉锛屽繀椤诲埛鏂伴〉闈㈡墠鐢熸晥锛夈��
+ */
+watch(
+  () => [roomStore.room?.roomId, roomStore.room?.bedNo],
+  async () => {
+    if (!roomStore.room) return
+    roomBedVO.value.roomId = roomStore.room.roomId
+    roomBedVO.value.roomName = roomStore.room.roomName
+    roomBedVO.value.bedNo = roomStore.room.bedNo
+    roomBedVO.value.checkTypes = roomStore.room.checkTypes
+    roomBedVO.value.opType = roomStore.room.opType
+    // 銆愭湰娆¢渶姹傘�戞崲宸ヤ綅鍚�**鏁撮〉鏁版嵁閮芥崲鎴愭柊宸ヤ綅鐨�**锛�
+    // 鈶� 鍏堟竻绌哄乏渚�"鎮h�呬俊鎭�"锛堥伩鍏嶈繕鏄剧ず涓婁竴涓伐浣嶇殑鎮h�咃級
+    devInstallPanelRef.value?.setPatient?.(undefined)
+    // 鈶� 鍚姩/缁х画鍙栨暟瀹氭椂鍣紙寰呰鍒楄〃銆佺粺璁°�佸綋鍓嶅彨鍙锋偅鑰呫�佸仠姝㈠�欒瘖寮�鍏抽兘浼氬埛鏂帮級
+    if (!timerRunFlag && roomBedVO.value.roomId != null) {
+      timerRunFlag = true
+      doctorTimer()
+    } else if (roomBedVO.value.roomId != null) {
+      await initLoad()
+    }
+    // 鈶� 鍒锋柊銆屽凡瀹屾垚鍒楄〃銆嶏紙闈㈡澘鍐呬細鎸夋柊宸ヤ綅鐨� checkTypes 閲嶆柊杩囨护锛�
+    devInstallPanelRef.value?.getList?.()
+  }
+)
+
 onMounted(() => {
   timerRunFlag = false
   bedControlFlag.value = true
@@ -278,7 +315,7 @@
     甯冨眬浼樺寲锛氬姛鑳芥寜閽浐瀹氬湪椤甸潰搴曢儴锛屼笉鍐嶇敤 position:absolute 娴湪鍐呭涓娿��
     璇﹁ components/DoctorPageLayout锛堜笌鍙彿妫�鏌�/璁惧棰嗙敤椤靛叡鐢ㄥ悓涓�甯冨眬锛夈��
   -->
-  <DoctorPageLayout>
+  <DoctorPageLayout :bed-switch-enabled="false">
     <template #header>
       <TitlePanel :titleType=2 :room="roomBedVO" :patientStatistic="patientStat" />
     </template>
@@ -293,7 +330,8 @@
     />
 
     <template #aside>
-      <QueuePanel :room="roomBedVO" :queue="patientList" @event_RecallFinish="onEventRecallFinish"/>
+      <QueuePanel :room="roomBedVO" :queue="patientList" :fetch-info="fetchInfo"
+                  @event_RecallFinish="onEventRecallFinish"/>
     </template>
 
 

--
Gitblit v1.9.3