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 f01a3f645..6d5d29422 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -682,6 +682,7 @@ async function handleCategoryExpand(cat) { code: m.code, price: m.price || 0, packageName: m.packageName || '', + packageId: m.packageId || null, packagePrice: m.packagePrice || null, serviceFee: m.serviceFee || null })); @@ -1025,12 +1026,18 @@ function handleRowClick(row) { code: md.code, price: m.itemFee || 0, // fallback 到已保存的价格 packageName: md.packageName || '', + packageId: md.packageId || null, packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格 serviceFee: md.serviceFee || null })); // 如果有已保存的检查方法信息,尝试匹配 if (m.checkMethodId) { item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null; + // 从已保存的方法中获取套餐信息 + if (item.selectedMethod?.packageId) { + item.isPackage = true; + item.packageId = item.selectedMethod.packageId; + } } } } catch (err) { @@ -1091,6 +1098,13 @@ async function handleMethodSelect(checked, method, cat) { const existingItem = selectedItems.value.find(s => s.id === targetItem.id); if (existingItem) { existingItem.selectedMethod = method; + // 从方法中获取套餐信息 + if (method.packageId) { + existingItem.isPackage = true; + existingItem.packageId = method.packageId; + // 预加载套餐明细 + loadPackageDetailsForItem(existingItem); + } updateMethodDisplay(); return; } @@ -1105,7 +1119,7 @@ async function handleMethodSelect(checked, method, cat) { } } - selectedItems.value.push({ + const newItem = { id: targetItem.id, name: targetItem.name, price: targetItem.price, quantity: 1, serviceFee: targetItem.serviceFee || 0, @@ -1117,9 +1131,16 @@ async function handleMethodSelect(checked, method, cat) { methods: [method], selectedMethod: method, expanded: false, - isPackage: !!targetItem.packageName, - packageId: targetItem.packageId || null - }); + // 从方法中获取套餐信息(优先级高于项目本身的 packageName) + isPackage: !!method.packageId || !!targetItem.packageName, + packageId: method.packageId || targetItem.packageId || null + }; + selectedItems.value.push(newItem); + + // 如果是套餐,预加载套餐明细 + if (newItem.isPackage && newItem.packageId) { + loadPackageDetailsForItem(newItem); + } // 自动回填执行科室 if (selectedItems.value.length === 1 && cat?.performDeptName) { @@ -1164,6 +1185,7 @@ async function handleItemSelect(checked, item, cat) { code: m.code, price: m.price || item.price, // fallback 到项目价格 packageName: m.packageName || '', + packageId: m.packageId || null, packagePrice: m.packagePrice || null, // Bug #384修复: 套餐价格 serviceFee: m.serviceFee || null // Bug #384修复: 服务费 }));