From 77f6b78397f162e367a7b4a57a8cf712c4d35ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Sat, 16 May 2026 14:28:18 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#472:=20=E4=BD=8F=E9=99=A2=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E6=89=8B=E6=9C=AF?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=95=EF=BC=9A=E5=8B=BE=E9=80=89=E6=89=8B?= =?UTF-8?q?=E6=9C=AF=E9=A1=B9=E7=9B=AE=E6=97=A0=E6=95=88=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=BC=80=E7=AB=8B?= =?UTF-8?q?=E5=8C=BB=E5=98=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:getSurgeryPage SQL 的 LEFT JOIN 在价格表存在多条记录时产生重复行, 导致 el-transfer 中出现相同 key 的条目,Vue diff 算法无法正确追踪选中状态 修复: - SQL 添加 DISTINCT ON (t1.ID) 去重(与旧版 getAdviceBaseInfo 一致) - 前端 applicationList 初始化为空数组 + 过滤空 adviceDefinitionId - 同步修复 getExaminationPage 的相同问题 Co-Authored-By: Claude Opus 4.7 --- .../mapper/doctorstation/DoctorStationAdviceAppMapper.xml | 8 ++++---- .../home/components/order/applicationForm/surgery.vue | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index a6ce1d80d..1fd1d6558 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -872,7 +872,7 @@ \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue index 1afeb32c6..0e50c0431 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue @@ -128,7 +128,7 @@ const emits = defineEmits(['submitOk']); const props = defineProps({}); const state = reactive({}); const applicationListAll = ref(); -const applicationList = ref(); +const applicationList = ref([]); const orgOptions = ref([]); // 科室选项 const loading = ref(false); // 加载状态 const mapToTransferItem = (item) => { @@ -174,7 +174,9 @@ const loadPage = (key) => { dbTotal.value = res.data.total || 0; const records = res.data.records; applicationListAll.value = records; - applicationList.value = records.map(mapToTransferItem); + applicationList.value = records + .filter(item => item.adviceDefinitionId != null) + .map(mapToTransferItem); // 仅在无搜索时缓存 if (!key) { surgeryRecordsCache = records;