From 82b5fc747ec860940eae249e83f20c2710e953a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Sat, 16 May 2026 16:30:06 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#426:=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=E5=BC=80=E7=AB=8B?= =?UTF-8?q?=EF=BC=9A=E5=B7=B2=E9=80=89=E6=8B=A9=E5=88=97=E8=A1=A8=E5=BA=94?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=91=E5=BD=A2=E5=B1=95=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A5=97=E9=A4=90=E6=98=8E=E7=BB=86=EF=BC=88?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE/=E6=95=B0=E9=87=8F/=E5=8D=95=E4=BB=B7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: loadPackageDetails 函数中 res.code === 200 判断永远为 false(Axios 拦截 器已对 code===200 解包返回 res.data,解包后对象不含 code 字段),导致树形表格懒加 载套餐明细永远返回空数组。handleItemSelect 中 hasChildren 只判断了 packageId 但数据 库 check_part 表只有 package_name 无 package_id,导致套餐项无展开箭头。 修复: 1. loadPackageDetails 去掉 res.code 检查,直接用 parsePackageDetailsPayload 解析 (与 loadPackageDetailsForItem 保持一致) 2. handleItemSelect hasChildren 增加 || item.packageName 条件 Co-Authored-By: Claude Opus 4.7 --- .../examination/examinationApplication.vue | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 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 add31a486..7928c1a08 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -584,20 +584,16 @@ async function loadPackageDetails(row, treeNode, resolve) { url: `/system/check-type/package/${row.packageId}/details`, method: 'get' }); - if (res.code === 200) { - const list = parsePackageDetailsPayload(res); - const children = list.map((child) => ({ - ...child, - name: child.name || child.itemName, - unit: child.unit || '次', - price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0, - quantity: row.quantity || 1, - isPackageDetail: true - })); - resolve(children); - } else { - resolve([]); - } + const list = parsePackageDetailsPayload(res); + const children = list.map((child) => ({ + ...child, + name: child.name || child.itemName, + unit: child.unit || '次', + price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0, + quantity: row.quantity || 1, + isPackageDetail: true + })); + resolve(children); } catch (err) { console.error('加载套餐明细失败:', err); resolve([]); @@ -1489,7 +1485,7 @@ async function handleItemSelect(checked, item, cat) { packageName: item.packageName || null, packageDetailsLoading: false, packageId: item.packageId || null, - hasChildren: !!(item.packageId) // #426修复: 树形表格懒加载展开标记 + hasChildren: !!(item.packageId || item.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析 }; selectedItems.value.push(newRow); // 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」)