Fix Bug #445: 门诊手术安排-临时医嘱生成界面:引用计费时过滤已生成医嘱项目

根因: 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/
This commit is contained in:
关羽
2026-05-16 13:18:36 +08:00
parent e473e5159b
commit b7708dec7d

View File

@@ -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 {