From 7ae7cfa35ca4c7c9b1f175ca5174576f331b8ec8 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Mon, 18 May 2026 09:11:50 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#524:=20[=E9=97=A8=E8=AF=8A/?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E4=B8=AA=E4=BA=BA=E6=8A=A5=E5=8D=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E4=BC=A0=E6=9F=93=E7=97=85=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=8D=A1=E4=BF=9D=E5=AD=98=E5=90=8E=E6=95=B0=E6=8D=AE=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E5=A4=B1=E8=B4=A5=20=E2=80=94=20=E6=A0=B9=E5=9B=A0?= =?UTF-8?q?=EF=BC=9AshowReport=20=E5=8A=A0=E8=BD=BD=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=20watch=20=E7=9B=91=E5=90=AC=20selectedClassA/B/C=20?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E6=B8=85=E7=A9=BA=E4=BA=86=20diseaseType=20?= =?UTF-8?q?=E5=88=86=E5=9E=8B=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=20loadingData=20=E6=A0=87=E5=BF=97?= =?UTF-8?q?=E5=9C=A8=20showReport=20=E5=8A=A0=E8=BD=BD=E6=9C=9F=E9=97=B4?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=20watch=20=E6=B8=85=E7=A9=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- .../diagnosis/infectiousDiseaseReportDialog.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue index 647bfa928..837f2eb1c 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue @@ -548,6 +548,8 @@ const dialogReadOnly = ref(false); const formRef = ref(null); // 保存按钮加载状态,防止重复提交 const submitLoading = ref(false); +// 数据加载中标志,防止 showReport 加载已有数据时 watch 清空分型字段 +const loadingData = ref(false); const props = defineProps({ title: { @@ -940,7 +942,8 @@ const showSubtypeSelect = computed(() => { // 监听疾病选择变化,自动清空分型选择 watch(() => [form.value.selectedClassA, form.value.selectedClassB, form.value.selectedClassC], (newVal, oldVal) => { // 如果疾病选择发生变化,清空分型选择 - if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) { + // 数据加载中时不清空,避免 showReport 加载已有数据时被错误清空 + if (JSON.stringify(newVal) !== JSON.stringify(oldVal) && !loadingData.value) { form.value.diseaseType = ''; } }, { deep: true }); @@ -1092,6 +1095,9 @@ function showReport(reportData = {}, readOnly = true) { dialogVisible.value = true; dialogReadOnly.value = readOnly; + // 标记数据加载中,防止 watch 清空 diseaseType 分型字段 + loadingData.value = true; + resetAddressSelector(); initProvinceOptions(); @@ -1149,6 +1155,9 @@ function showReport(reportData = {}, readOnly = true) { form.value.addressCounty, form.value.addressTown ); + + // 数据加载完成,恢复 watch 监听 + loadingData.value = false; } /**