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 bea406574..475e14d0c 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -639,9 +639,9 @@ function getPackageDetailsList(item) { return Array.isArray(carrier?.packageDetails) ? carrier.packageDetails : []; } -/** 有套餐 ID 的已选行才展示右侧套餐区(加载中 / 空 / 明细列表) */ +/** 有套餐 ID 或 packageName 的已选行才展示右侧套餐区(加载中 / 空 / 明细列表) */ function shouldShowPackageBody(item) { - return !!getPackageCarrier(item)?.packageId; + return !!(getPackageCarrier(item)?.packageId || item.packageName || item.packageId); } /** 金额展示:统一两位小数 */ @@ -1381,10 +1381,10 @@ async function handleMethodSelect(checked, method, cat) { const existingItem = selectedItems.value.find(s => s.id === targetItem.id); if (existingItem) { existingItem.selectedMethod = method; - // 从方法中获取套餐信息 - if (method.packageId) { + // 从方法中获取套餐信息(支持 packageId 或 packageName 解析) + if (method.packageId || method.packageName) { existingItem.isPackage = true; - existingItem.packageId = method.packageId; + existingItem.packageId = method.packageId || existingItem.packageId; existingItem.hasChildren = true; // #426修复 existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步 // 预加载套餐明细 @@ -1421,12 +1421,12 @@ 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,确保套餐明细可加载 - hasChildren: !!(method.packageId || targetItem.packageId) // #426修复: 树形表格懒加载展开标记 + hasChildren: !!(method.packageId || method.packageName || targetItem.packageId || targetItem.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析 }; selectedItems.value.push(newItem); // 如果是套餐,预加载套餐明细 - if (newItem.isPackage && newItem.packageId) { + if (newItem.isPackage && (newItem.packageId || newItem.packageName)) { loadPackageDetailsForItem(newItem); } @@ -1564,7 +1564,7 @@ async function toggleItemExpand(item) { async function selectMethodCheckbox(checked, item, method) { if (checked) { item.selectedMethod = method; - if (item.expanded && method.packageId) { + if (item.expanded && (method.packageId || method.packageName)) { loadPackageDetailsForItem(item); } // 动态加载该方法对应的套餐明细 @@ -1629,8 +1629,9 @@ async function loadMethodPackageDetails(item, method) { /** 检查明细表格中切换检查方法 */ async function onDetailMethodChange(row, val) { row.selectedMethod = val || null; - if (val?.packageId) { - row.packageId = val.packageId; + if (val?.packageId || val?.packageName) { + row.packageId = val.packageId || row.packageId; + row.packageName = val.packageName || row.packageName; row.isPackage = true; row.hasChildren = true; // #426修复 }