From 8c03559c872822064cbd85069b624de4d77b6fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Wed, 13 May 2026 15:10:29 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#428:=20=E9=97=A8=E8=AF=8A=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E7=AB=99-=E6=A3=80=E6=9F=A5=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=9A=E6=9C=AA=E5=AE=9E=E7=8E=B0=E5=88=86=E7=B1=BB=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E6=A3=80=E6=9F=A5=E6=96=B9=E6=B3=95=E5=8F=8A=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E6=98=8E=E7=BB=86=E5=B1=95=E7=A4=BA=E4=B8=8E=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复三个根因问题: 1. handleCollapseChange 从 filteredCategoryList(计算属性映射副本)查找分类, 改为从 categoryList(原始响应式数组)查找,确保 handleCategoryExpand 对 cat.methods 的赋值能正确触发 Vue 响应式更新,分类展开后检查方法列表正常渲染 2. handleMethodSelect 跨分类检查中 cat.typeCode 与 newItem.checkType(cat.typeName) 类型不匹配,改为统一使用 cat.typeName 比较 3. handleItemSelect 同样存在 typeCode vs typeName 不匹配问题,一并修复 Co-Authored-By: Claude Opus 4.7 --- .../components/examination/examinationApplication.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue index ea7dfba0b..14fa2b0fb 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -730,7 +730,9 @@ function handleCollapseChange(activeName) { setTimeout(() => { isAnimating.value = false; }, 300); // 与 CSS 过渡时长一致 if (activeName) { - const cat = filteredCategoryList.value.find(c => c.typeId == activeName); + // Bug #428修复: 直接从 categoryList(原始响应式数组)查找分类, + // 确保后续 handleCategoryExpand 对 cat.methods 的赋值能正确触发 Vue 响应式更新 + const cat = categoryList.value.find(c => c.typeId == activeName); if (cat && (!cat.methods || cat.methods.length === 0)) { handleCategoryExpand(cat); // 异步加载,不 await } @@ -1149,7 +1151,8 @@ async function handleMethodSelect(checked, method, cat) { // 如果该项目不存在,创建一个并关联方法 if (selectedItems.value.length > 0) { const currentCategory = selectedItems.value[0].checkType; - const newCategory = cat.typeCode || ''; + // Bug #428修复: 使用 cat.typeName 进行比较(与 newItem.checkType 保持一致) + const newCategory = cat.typeName || ''; if (currentCategory !== newCategory) { ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目'); return; @@ -1234,7 +1237,8 @@ async function handleItemSelect(checked, item, cat) { if (selectedItems.value.length > 0) { const currentCategory = selectedItems.value[0].checkType; - const newCategory = cat.typeCode || ''; + // Bug #428修复: 使用 cat.typeName 进行比较(与 effectiveCheckType 保持一致) + const newCategory = cat.typeName || ''; if (currentCategory !== newCategory) { ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目'); item.checked = false;