From 8850689f1f230ac746e49d97bbb7912591b22743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Sat, 16 May 2026 12:02:35 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#426:=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=E5=BC=80=E7=AB=8B?= =?UTF-8?q?=EF=BC=9A=E5=B7=B2=E9=80=89=E6=8B=A9=E5=88=97=E8=A1=A8=E5=BA=94?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=91=E5=BD=A2=E5=B1=95=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A5=97=E9=A4=90=E6=98=8E=E7=BB=86=EF=BC=88?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE/=E6=95=B0=E9=87=8F/=E5=8D=95=E4=BB=B7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: Element Plus el-table 懒加载模式下,tree-props.hasChildren 要求行数据 包含 hasChildren: true 才能显示展开箭头。所有创建套餐项的代码路径都设置了 isPackage: true 和 packageId,但未设置 hasChildren 属性。 修复: 在 7 处代码路径中补充 hasChildren 属性设置。 --- .../examination/examinationApplication.vue | 13 ++++++++++--- 1 file changed, 10 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 dc50881a1..add31a486 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -1250,7 +1250,8 @@ function handleRowClick(row) { expanded: false, packageDetailsLoading: false, isPackage: false, - packageId: null + packageId: null, + hasChildren: false // #426修复: 树形表格懒加载展开标记,后续根据packageId动态设置 }; // 加载该项目的检查方法 if (m.bodyPartCode) { @@ -1278,6 +1279,7 @@ function handleRowClick(row) { if (item.selectedMethod?.packageId) { item.isPackage = true; item.packageId = item.selectedMethod.packageId; + item.hasChildren = true; // #426修复 } } if (!item.selectedMethod && item.methods.length) { @@ -1286,6 +1288,7 @@ function handleRowClick(row) { if (item.selectedMethod?.packageId) { item.packageId = item.selectedMethod.packageId; item.isPackage = true; + item.hasChildren = true; // #426修复 } } } catch (err) { @@ -1361,6 +1364,7 @@ async function handleMethodSelect(checked, method, cat) { if (method.packageId) { existingItem.isPackage = true; existingItem.packageId = method.packageId; + existingItem.hasChildren = true; // #426修复 existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步 // 预加载套餐明细 loadPackageDetailsForItem(existingItem); @@ -1395,7 +1399,8 @@ async function handleMethodSelect(checked, method, cat) { // 从方法或项目中获取套餐信息 isPackage: !!method.packageId || !!targetItem.packageName, packageId: method.packageId || targetItem.packageId || null, - packageName: method.packageName || targetItem.packageName || null // #428修复: 复制 packageName,确保套餐明细可加载 + packageName: method.packageName || targetItem.packageName || null, // #428修复: 复制 packageName,确保套餐明细可加载 + hasChildren: !!(method.packageId || targetItem.packageId) // #426修复: 树形表格懒加载展开标记 }; selectedItems.value.push(newItem); @@ -1483,7 +1488,8 @@ async function handleItemSelect(checked, item, cat) { isPackage: !!(item.packageId || item.packageName), packageName: item.packageName || null, packageDetailsLoading: false, - packageId: item.packageId || null + packageId: item.packageId || null, + hasChildren: !!(item.packageId) // #426修复: 树形表格懒加载展开标记 }; selectedItems.value.push(newRow); // 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」) @@ -1605,6 +1611,7 @@ async function onDetailMethodChange(row, val) { if (val?.packageId) { row.packageId = val.packageId; row.isPackage = true; + row.hasChildren = true; // #426修复 } row.packageDetailsDisplay = undefined; const carrier = getPackageCarrier(row);