From 4e51bdbd0322baadb821fec464db691389dbd200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Thu, 14 May 2026 05:06:38 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#492:=20=E3=80=90=E9=97=A8=E8=AF=8A?= =?UTF-8?q?=E6=89=8B=E6=9C=AF=E5=AE=89=E6=8E=92=E3=80=91=E5=85=B3=E9=97=AD?= =?UTF-8?q?"=E6=89=8B=E6=9C=AF=E8=AE=A1=E8=B4=B9"=E4=B8=BB=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=90=8E=EF=BC=8C=E9=A1=B9=E7=9B=AE=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=88=97=E8=A1=A8=E4=BE=9D=E7=84=B6=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E6=82=AC=E6=B5=AE=E5=9C=A8=E7=95=8C=E9=9D=A2=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: el-popover 通过 teleport 渲染在 document.body 上,closeChargeDialog() 调用 closeAllPopovers() 后立即设置 showChargeDialog=false,dialog 在 Vue 完成 popover DOM 清 理前就开始卸载,导致 teleported popover 残留。 修复: 1. closeChargeDialog 改为 async,closeAllPopovers 后 await nextTick() 确保 popover 可 见性变更的 DOM 更新完成后再关闭 dialog 2. el-dialog 添加 destroy-on-close 属性,确保关闭时完整销毁内容区及所有子组件的 teleport --- openhis-ui-vue3/src/views/surgicalschedule/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openhis-ui-vue3/src/views/surgicalschedule/index.vue b/openhis-ui-vue3/src/views/surgicalschedule/index.vue index 3598edc04..6866d3d58 100755 --- a/openhis-ui-vue3/src/views/surgicalschedule/index.vue +++ b/openhis-ui-vue3/src/views/surgicalschedule/index.vue @@ -803,7 +803,7 @@ - +
@@ -1456,11 +1456,14 @@ async function handleChargeCharge(row) { } // 关闭计费弹窗 -function closeChargeDialog() { +async function closeChargeDialog() { // 先关闭 prescriptionlist 内所有已打开的项目字典 popover if (prescriptionRef.value && prescriptionRef.value.closeAllPopovers) { prescriptionRef.value.closeAllPopovers() } + // 等待 Vue 完成 popover 可见性更新的 DOM 操作, + // 因为 el-popover 通过 teleport 渲染在 body 上,需要在 dialog 卸载前完成清理 + await nextTick() // 清空数据,避免下次打开时使用缓存 showChargeDialog.value = false chargePatientInfo.value = {}