From 2123d222ebc18802fb18882c1d8a922ccf5e36b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Wed, 13 May 2026 01:11:11 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#428:=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=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=9A=E6=9C=AA=E5=AE=9E=E7=8E=B0=E5=88=86=E7=B1=BB=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E6=A3=80=E6=9F=A5=E6=96=B9=E6=B3=95=E5=8F=8A=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E6=98=8E=E7=BB=86=E5=B1=95=E7=A4=BA=E4=B8=8E=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根本原因: 1. 分类联动加载检查方法时,未提取后端返回的 packageId 字段 2. 勾选检查方法后,未从方法中获取套餐信息(isPackage/packageId) 3. 选中带套餐的检查方法后,未调用 loadPackageDetailsForItem 预加载套餐明细 修复内容(4处手术式修改): - handleCategoryExpand:方法映射增加 packageId 字段 - handleRowClick:回充已有申请单时,从匹配的方法中获取套餐信息 - handleMethodSelect:从方法获取套餐信息并预加载套餐明细 - handleItemSelect:方法映射增加 packageId 字段 Co-Authored-By: Claude Opus 4.7 --- .../examination/examinationApplication.vue | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 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 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修复: 服务费 }));