From cc50bd2289832c34ca503058513c610cc9754560 Mon Sep 17 00:00:00 2001 From: guanyu Date: Tue, 19 May 2026 08:59:52 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#548:=20=E5=8F=91=E5=BE=80=E7=A7=91?= =?UTF-8?q?=E5=AE=A4=E5=AD=97=E6=AE=B5=E6=9C=AA=E8=83=BD=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=20=E2=80=94=20=E7=BC=96=E8=BE=91=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=97=B6=20transferValue=20=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E8=A7=A6=E5=8F=91=20projectWithDepartment=20=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=20form.targetDepartment=EF=BC=8C=E5=B7=B2=E5=8A=A0=20?= =?UTF-8?q?isInitializing=20=E6=A0=87=E5=BF=97=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- .../components/order/applicationForm/laboratoryTests.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue index 23ff2965..6c8fe53c 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue @@ -244,6 +244,8 @@ const getList = async () => { const handleSearch = () => { // 搜索时保持已选中的项目不受影响 }; +// 编辑初始化标志:避免 applyEditTransferSelection 设置 transferValue 时触发 projectWithDepartment 覆盖 descJson 中的科室值 +const isInitializing = ref(false); const transferValue = ref([]); const form = reactive({ // categoryType: '', // 项目类别 @@ -341,6 +343,7 @@ const projectWithDepartment = (selectProjectIds, type) => { watch( () => transferValue.value, (newValue) => { + if (isInitializing.value) return; projectWithDepartment(newValue, 1); } ); @@ -377,7 +380,10 @@ const applyEditTransferSelection = () => { } } const uniq = [...new Set(selectedIds)] + // 设置初始化标志,防止 transferValue 变化触发 projectWithDepartment 覆盖 descJson 中的科室值 + isInitializing.value = true transferValue.value = uniq + isInitializing.value = false if (newData.requestFormDetailList.length && uniq.length === 0) { console.warn( '[LaboratoryTests] 申请单明细未能在项目字典中匹配到项,请核对 activityId / 项目名称', @@ -427,7 +433,9 @@ watch( selectedIds.push(matched.adviceDefinitionId); } }); + isInitializing.value = true; transferValue.value = selectedIds; + isInitializing.value = false; } );