From cfbd375a489aa41219f42929356f0add6b28b654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Sun, 17 May 2026 16:26:13 +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=E6=A0=91?= =?UTF-8?q?=E5=BD=A2=E5=B1=95=E5=BC=80=E6=94=AF=E6=8C=81=20packageName=20?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=A5=97=E9=A4=90=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:树形表格懒加载函数 loadPackageDetails 只支持 packageId,但 check_part 表 只有 package_name 字段(无 package_id),导致从左侧分类勾选套餐项目时, 右侧已选择面板能展开(走 loadPackageDetailsForItem),但检查明细树形表格展开为空。 修复:在 loadPackageDetails 中增加 packageName → packageId 解析逻辑, 与 loadPackageDetailsForItem 保持一致。 Co-Authored-By: Claude Opus 4.7 --- .../examination/examinationApplication.vue | 24 +++++++++++++++---- 1 file changed, 20 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 f5e597847..bea406574 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -582,15 +582,30 @@ function handleResetSearch() { // 初始化默认日期范围为近一周 handleResetSearch(); -// 🔧 BugFix#426: 懒加载套餐明细 +// 🔧 BugFix#426/#430: 懒加载套餐明细(支持 packageName 解析) async function loadPackageDetails(row, treeNode, resolve) { - if (!row.packageId) { + let packageId = row.packageId; + if (!packageId && row.packageName) { + try { + const pkgRes = await listCheckPackage({ packageName: row.packageName }); + let packages = pkgRes?.data || []; + if (!Array.isArray(packages)) { + packages = packages.records || packages.data || []; + } + if (packages.length > 0) { + packageId = packages[0].id; + } + } catch (err) { + console.error('套餐名称解析失败:', err); + } + } + if (!packageId) { resolve([]); return; } try { const res = await request({ - url: `/system/check-type/package/${row.packageId}/details`, + url: `/system/check-type/package/${packageId}/details`, method: 'get' }); const list = parsePackageDetailsPayload(res); @@ -1058,7 +1073,8 @@ const filteredCategoryList = computed(() => { const key = dictSearchKey.value.toLowerCase(); return categoryList.value.map(cat => ({ ...cat, - items: cat.items.filter(item => (item.name || '').toLowerCase().includes(key)) + items: cat.items.filter(item => (item.name || '').toLowerCase().includes(key)), + methods: cat.methods || [] })).filter(cat => cat.items.length > 0); });