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);