From bd3f4b0a9b9207b647de0f0d8c52600a2742fd56 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 26 十一月 2026 09:34:58 +0800
Subject: [PATCH] 修改了框架,适用chrome85
---
src/views/ecg/doctor/DevInstall.vue | 115 ++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 93 insertions(+), 22 deletions(-)
diff --git a/src/views/ecg/doctor/DevInstall.vue b/src/views/ecg/doctor/DevInstall.vue
index 95f6ed4..54bd627 100644
--- a/src/views/ecg/doctor/DevInstall.vue
+++ b/src/views/ecg/doctor/DevInstall.vue
@@ -9,8 +9,9 @@
import QueuePanel from "@/views/ecg/doctor/components/QueuePanel.vue";
import DoctorPageLayout from "@/components/DoctorPageLayout/src/DoctorPageLayout.vue";
import {DoctorApi, PatientStatisticVO, RoomBedVO} from '@/api/ecg/doctor';
+import { notifySeatInvalidOnce, isSeatInvalidError, resetSeatInvalidNotify } from '@/utils/seatGuard'
import {QueueVO} from "@/api/ecg/queue";
-import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
+import {ElMessage, ElMessageBox} from "element-plus";
import {useRoomStore} from "@/store/modules/room";
const roomStore = useRoomStore();
@@ -40,6 +41,8 @@
const state = ref<boolean>()
const patientList = ref<QueueVO[]>([])
+/** 銆愯嚜鍔╄瘖鏂�戞渶杩戜竴娆″彇鏁扮殑璇存槑锛堢┖鍒楄〃鏃舵樉绀猴級 */
+const fetchInfo = ref('')
let timerRunFlag : boolean = false
const bedControlFlag = ref<boolean>(true);
@@ -49,12 +52,26 @@
const finishNextPatient = async () => {
finishFlag.value = true
try {
+ // 銆愭湰闇�姹傘�戝彨鍙峰墠鑻ヤ粛鏈夈�屽畨瑁呬腑(36)銆嶆偅鑰呬笖鏈偣銆岃鏈哄畬鎴愩�嶏紝鍏堣嚜鍔ㄥ畬鎴愪粬锛屽啀鍙笅涓�浣�
+ const installing = patientList.value.find(item => item.status === 36)
+ if (installing) {
+ const ok = (await devInstallPanelRef.value?.completeCurrent?.()) !== false
+ if (!ok) {
+ ElMessage.warning('鑷姩銆岃鏈哄畬鎴愩�嶆湭鎴愬姛锛岃鍏堟墜鍔ㄥ畬鎴愬綋鍓嶆偅鑰�')
+ return
+ }
+ }
patientList.value = await DoctorApi.finishInstallNextPatient(roomBedVO.value)
patientStat.value = await DoctorApi.getDevInstallStatistic(roomBedVO.value)
getInstallingPatient()
- // 鐢ㄤ簬瑙e喅 宸︿晶閲嶇疆鍚� 鑾峰彇褰撳墠 銆愬畨瑁呬腑銆戞偅鑰�
- setInstallingPatient(installingPatient)
+ // 鐢ㄤ簬瑙e喅 宸︿晶閲嶇疆鍚� 鑾峰彇褰撳墠銆愬畨瑁呬腑銆戞偅鑰咃紱
+ // 鑻ュ凡鏃犲畨瑁呬腑鎮h�咃紙鍒氬畬鎴愪笖娌℃湁涓嬩竴浣嶏級锛屾竻绌哄乏涓婅锛岄伩鍏嶆妸鍒氬畬鎴愮殑浜哄張鏄剧ず鍥炴潵
+ if (patientList.value.some(item => item.status === 36)) {
+ setInstallingPatient(installingPatient)
+ } else {
+ devInstallPanelRef.value?.setPatient?.(undefined)
+ }
} finally {
finishFlag.value = false
}
@@ -87,21 +104,34 @@
const initLoad = async () => {
if (roomBedVO.value.roomId == null) {
- ElNotification.error({
- message: '璇烽噸鏂板氨搴�!',
- type: 'info',
- duration: 3000 // 鑷姩鍏抽棴鏃堕棿锛岄粯璁や负3000ms
- })
+ // 銆愭湰闇�姹傘�戞病鏈夊伐浣嶏細鍋滄帀杞骞跺彧鎻愮ず涓�娆★紙鍘熸潵姣� 5 绉掑脊涓�娆★紝鐜板満琛ㄧ幇灏辨槸涓�鐩磋烦锛�
+ timerRunFlag = false
+ notifySeatInvalidOnce()
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)
+ // 銆愭湰闇�姹傘�慴ed-doctor-get 鏄�愭垜鏄惁杩樺潗鍦ㄨ繖閲屻�戠殑鍒ゅ畾锛氬け璐ヨ鏄庡伐浣嶅凡琚噴鏀� / 浠栦汉鎺ユ墜锛�
+ // 姝ゆ椂鍋滄帀杞骞朵竴娆℃�ф彁绀猴紝閬垮厤姣� 5 绉掑埛涓�娆°�愯閲嶆柊灏卞骇銆戙��
+ let queueVO2: any
+ try {
+ queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO.value)
+ } catch (e: any) {
+ if (isSeatInvalidError(e)) {
+ timerRunFlag = false
+ notifySeatInvalidOnce()
+ return
+ }
+ throw e
+ }
+ // 銆愬姞鍥恒�戞帴鍙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()
@@ -165,15 +195,20 @@
}
}
-const undoFinish = async () => {
- const last = await DoctorApi.lastFinishedPatient(roomBedVO.value)
- if (!last || !last.patId) {
- ElMessage.warning('鏈伐浣嶄粖鏃ユ殏鏃犲凡瀹屾垚鐨勬鏌ヨ褰�')
+/**
+ * 鎾ら攢銆岃鏈哄畬鎴愩�嶏細鎾ら攢**閫変腑鐨勯偅鏉�**瀹屾垚璁板綍锛�2026-11-25 闇�姹傦級銆�
+ * 鍘熷疄鐜扮敱鍚庣 lastFinishedPatient 鍙栨渶杩戜竴鏉★紝鍖荤敓鏃犳硶閫夋嫨锛涚幇鎸夈�屾偅鑰� + 妫�鏌ラ」鐩�嶇簿纭挙閿�銆�
+ */
+const undoFinish = async (record?: any) => {
+ if (!record || !record.patId) {
+ ElMessage.warning('璇峰厛鍦ㄣ�屽凡瀹屾垚鍒楄〃銆嶄腑鐐归�変竴鏉¤褰曪紝鍐嶇偣銆屾挙閿�銆�')
return
}
+ const who = record.patName || record.patId
+ const ctName = record.checkTypeName || record.checkType || ''
try {
await ElMessageBox.confirm(
- `纭畾鎾ら攢銆�${last.patName || last.patId}銆嶇殑瀹屾垚鎿嶄綔鍚楋紵璇ユ偅鑰呭皢鍥炲埌鍊欒瘖鍖恒�俙,
+ `纭畾鎾ら攢銆�${who}銆嶇殑銆�${ctName || '瑁呮満'}銆嶅畬鎴愯褰曞悧锛熻鎮h�呭皢鍥炲埌鍊欒瘖鍖恒�俙,
'鎾ら攢',
{ type: 'warning', confirmButtonText: '纭畾鎾ら攢', cancelButtonText: '鍙栨秷' }
)
@@ -184,10 +219,12 @@
try {
const msg = await DoctorApi.undoFinishPatient({
...roomBedVO.value,
- patId: last.patId,
- checkType: last.bookCheckType
+ patId: record.patId,
+ checkType: record.checkType
} as any)
ElMessage.success(msg || '宸叉挙閿�')
+ // 銆愭挙閿�鏍囪瘑銆戞挙閿�鍚庣珛鍒诲埛鏂般�屽凡瀹屾垚璁板綍銆嶅垪琛紝璁╄繖鏉¤褰曟樉绀烘垚銆屽凡鎾ら攢銆�
+ devInstallPanelRef.value?.getList?.()
await initLoad()
} finally {
undoFlag.value = false
@@ -211,12 +248,44 @@
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
+ // 銆愭湰闇�姹傘�戦噸鏂版嬁鍒板伐浣� -> 澶嶄綅銆愬伐浣嶅け鏁堛�戞彁绀猴紝鍏佽涓嬫鍐嶆彁绀轰竴娆�
+ resetSeatInvalidNotify()
+ // 銆愭湰娆¢渶姹傘�戞崲宸ヤ綅鍚�**鏁撮〉鏁版嵁閮芥崲鎴愭柊宸ヤ綅鐨�**锛�
+ // 鈶� 鍏堟竻绌哄乏渚�"鎮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
@@ -229,6 +298,7 @@
roomBedVO.value.bedNo = roomStore.room!.bedNo
roomBedVO.value.checkTypes = roomStore.room!.checkTypes
roomBedVO.value.opType = roomStore.room!.opType
+ resetSeatInvalidNotify()
timerRunFlag = true
doctorTimer()
@@ -278,7 +348,7 @@
甯冨眬浼樺寲锛氬姛鑳芥寜閽浐瀹氬湪椤甸潰搴曢儴锛屼笉鍐嶇敤 position:absolute 娴湪鍐呭涓娿��
璇﹁ components/DoctorPageLayout锛堜笌鍙彿妫�鏌�/璁惧棰嗙敤椤靛叡鐢ㄥ悓涓�甯冨眬锛夈��
-->
- <DoctorPageLayout>
+ <DoctorPageLayout :bed-switch-enabled="false">
<template #header>
<TitlePanel :titleType=2 :room="roomBedVO" :patientStatistic="patientStat" />
</template>
@@ -293,7 +363,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