Revert "Merge remote-tracking branch 'origin/develop' into develop"
This reverts commit5946c1ea4b, reversing changes made to8d905c9844.
This commit is contained in:
@@ -1535,8 +1535,8 @@ function handleMedicalAdvice(row) {
|
||||
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||
|
||||
// 调用计费接口获取数据(使用手术计费来源参数,匹配 surgery billing 创建的记录)
|
||||
getPrescriptionList(row.visitId, 6, row.operCode).then((res) => {
|
||||
// 调用计费接口获取数据
|
||||
getPrescriptionList(row.visitId).then((res) => {
|
||||
console.log('=== 拉取计费数据返回结果 ===', res)
|
||||
if (res.code === 200 && res.data) {
|
||||
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
||||
@@ -1741,39 +1741,27 @@ function handleTemporaryMedicalSubmit(data) {
|
||||
}
|
||||
})
|
||||
|
||||
// 🔧 修复 Bug #445: 使用稳定可靠的字段组合匹配已提交项目,从已生成列表中剔除待生成项
|
||||
// 匹配键:优先使用 chargeItemId(后端费用项目ID,最可靠),其次使用 名称+规格+数量 组合
|
||||
const submittedKeys = new Set()
|
||||
const submittedChargeIds = new Set()
|
||||
// 🔧 修复 Bug #445: 使用稳定的字段组合匹配已提交项目,而不是依赖可能为空的 requestId/chargeItemId
|
||||
// 构建已提交项目的匹配键集合(药品名称 + 规格 + 数量)
|
||||
const submittedKeys = new Set(
|
||||
(data.temporaryAdvices || [])
|
||||
.map(a => {
|
||||
const om = a.originalMedicine || {}
|
||||
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
||||
const spec = om.specification || om.volume || ''
|
||||
const qty = om.quantity || 0
|
||||
return `${name}|||${spec}|||${qty}`
|
||||
})
|
||||
.filter(k => k !== '|||0') // 过滤掉空项
|
||||
)
|
||||
|
||||
;(data.temporaryAdvices || []).forEach(a => {
|
||||
const om = a.originalMedicine || {}
|
||||
// 收集 chargeItemId(最可靠的匹配标识)
|
||||
if (om.chargeItemId) {
|
||||
submittedChargeIds.add(om.chargeItemId)
|
||||
}
|
||||
// 构建名称+规格+数量的匹配键(用于无 chargeItemId 的兜底匹配)
|
||||
// 注意:originalMedicine 中的名称字段是 adviceName(来自 billingMedicines.map 时的字段)
|
||||
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
||||
const spec = om.specification || om.volume || ''
|
||||
const qty = om.quantity || 0
|
||||
if (name) {
|
||||
submittedKeys.add(`${name}|||${spec}|||${qty}`)
|
||||
}
|
||||
})
|
||||
|
||||
if (submittedChargeIds.size > 0 || submittedKeys.size > 0) {
|
||||
if (submittedKeys.size > 0) {
|
||||
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
||||
// 优先用 chargeItemId 匹配
|
||||
if (m.chargeItemId && submittedChargeIds.has(m.chargeItemId)) {
|
||||
return false
|
||||
}
|
||||
// 兜底用 名称+规格+数量 匹配
|
||||
const key = `${m.medicineName || m.adviceName || ''}|||${m.specification || m.volume || ''}|||${m.quantity || 0}`
|
||||
const key = `${m.medicineName || ''}|||${m.specification || ''}|||${m.quantity || 0}`
|
||||
return !submittedKeys.has(key)
|
||||
})
|
||||
} else {
|
||||
// 如果没有任何匹配标识,清空待生成列表(保守策略:认为所有项目都已提交)
|
||||
// 如果没有任何匹配键,清空待生成列表(所有项目都已提交)
|
||||
temporaryBillingMedicines.value = []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user