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 788d56066..ea7dfba0b 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -482,14 +482,28 @@ async function loadPackageDetails(row, treeNode, resolve) { } } -// #428: 为已选择项目加载套餐明细 +// #428修复: 为已选择项目加载套餐明细(通过packageId或packageName查询) async function loadPackageDetailsForItem(item) { - if (!item.isPackage || !item.packageId) { + if (!item.isPackage || (!item.packageId && !item.packageName)) { return; } try { + let packageId = item.packageId; + if (!packageId && item.packageName) { + // CheckPart 没有 packageId 字段,需要通过 packageName 查询获取 + const pkgRes = await listCheckPackage({ packageName: item.packageName }); + let packages = pkgRes?.data || []; + if (!Array.isArray(packages)) { + packages = packages.records || packages.data || []; + } + if (packages.length === 0) { + item.packageDetails = []; + return; + } + packageId = packages[0].id; + } const res = await request({ - url: `/system/package/${item.packageId}/details`, + url: `/system/package/${packageId}/details`, method: 'get' }); if (res.code === 200 && res.data) { @@ -497,7 +511,7 @@ async function loadPackageDetailsForItem(item) { ...detail, name: detail.name || detail.itemName, unit: detail.unit || '次', - price: detail.price || detail.itemPrice || 0, + price: detail.price || detail.unitPrice || 0, quantity: detail.quantity || 1 })); } else { @@ -1241,6 +1255,7 @@ async function handleItemSelect(checked, item, cat) { selectedMethod: null, expanded: false, // Bug #384修复: 新增展开状态,默认不展开 isPackage: !!item.packageName, // Bug #428修复: 标记是否为套餐 + packageName: item.packageName || null, // Bug #426修复: 套餐名称,用于查找packageId packageId: item.packageId || null // Bug #428修复: 套餐ID });