From b7708dec7dc6690d717199099f0ab6616da7ce24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Sat, 16 May 2026 13:18:36 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#445:=20=E9=97=A8=E8=AF=8A=E6=89=8B?= =?UTF-8?q?=E6=9C=AF=E5=AE=89=E6=8E=92-=E4=B8=B4=E6=97=B6=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E7=94=9F=E6=88=90=E7=95=8C=E9=9D=A2=EF=BC=9A=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E8=AE=A1=E8=B4=B9=E6=97=B6=E8=BF=87=E6=BB=A4=E5=B7=B2?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8C=BB=E5=98=B1=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: handleQuoteBilling 从后端拉取计费数据后,只用 requestId 过滤已生成项目, 但已生成医嘱的计费项在后端可能没有 requestId(从 adm_charge_item 关联来的项目 requestId 为空), 导致已提交项目重新出现在"待生成"列表中。 修复: 在 handleQuoteBilling 中,用 chargeItemId/requestId/id 三重匹配, 与已有的 temporaryAdvices 做比对,排除已生成项目。 **后端开发重点**:优先搜索 Java/Spring 后端代码。 关键词:Controller, Service, Mapper, API, 接口, 数据查询 搜索目录:openhis-server-new/src/, his-repo/src/ --- .../src/views/surgicalschedule/index.vue | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/openhis-ui-vue3/src/views/surgicalschedule/index.vue b/openhis-ui-vue3/src/views/surgicalschedule/index.vue index f90ec6f3a..1ab934c24 100755 --- a/openhis-ui-vue3/src/views/surgicalschedule/index.vue +++ b/openhis-ui-vue3/src/views/surgicalschedule/index.vue @@ -1944,6 +1944,30 @@ function handleQuoteBilling() { } }) + // 🔧 修复 Bug #445: 过滤掉已生成医嘱的项目,避免"引用计费"后已提交项目重新出现在"待生成"列表 + // 原因:后端返回的计费数据中,已生成医嘱的项目可能没有 requestId 字段 + // 方案:用 chargeItemId/requestId/id 与已有的 temporaryAdvices 做匹配,排除已生成项目 + if (temporaryAdvices.value.length > 0) { + const existingAdviceIds = new Set() + temporaryAdvices.value.forEach(a => { + const om = a.originalMedicine || {} + if (om.requestId) existingAdviceIds.add(String(om.requestId)) + if (om.chargeItemId) existingAdviceIds.add(String(om.chargeItemId)) + if (om.id) existingAdviceIds.add(String(om.id)) + }) + if (existingAdviceIds.size > 0) { + temporaryBillingMedicines.value = temporaryBillingMedicines.value.filter(m => { + const mRequestId = m.requestId != null ? String(m.requestId) : null + const mChargeItemId = m.chargeItemId != null ? String(m.chargeItemId) : null + const mId = m.id != null ? String(m.id) : null + if (mRequestId && existingAdviceIds.has(mRequestId)) return false + if (mChargeItemId && existingAdviceIds.has(mChargeItemId)) return false + if (mId && existingAdviceIds.has(mId)) return false + return true + }) + } + } + temporaryMedicalLoading.value = false // 🔧 新增:加载完成 ElMessage.success('已成功引用最新计费药品信息!') } else {