Compare commits
6 Commits
bug463-fix
...
赵云-fix-476
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7480acaeb1 | ||
|
|
6940c3861d | ||
|
|
6e975bf9c4 | ||
|
|
3360cccaa5 | ||
|
|
fe138589a5 | ||
|
|
270475adb9 |
@@ -2107,11 +2107,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
sourceEnum, sourceBillNo);
|
||||
// 手术计费场景:sourceBillNo 不为空时,过滤掉药品(1),保留耗材(2)和诊疗(3/6)
|
||||
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||
&& dto.getAdviceType() == 1);
|
||||
}
|
||||
// 🔧 修复 Bug #444: 移除手术计费场景的药品过滤。
|
||||
// 原过滤会导致门诊手术医嘱界面无法获取手术计费创建的药品记录。
|
||||
// 前端各组件已根据自身业务逻辑做了正确的 adviceType 过滤。
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
T5.package_name,
|
||||
T6.name as sub_item_name
|
||||
FROM wor_activity_definition T1
|
||||
/* 只JOIN必要的价格表,使用INNER JOIN避免笛卡尔积 */
|
||||
INNER JOIN adm_charge_item_definition T2
|
||||
/* 价格表使用LEFT JOIN,避免因缺少价格记录导致搜索不到项目 */
|
||||
LEFT JOIN adm_charge_item_definition T2
|
||||
ON T1.id = T2.instance_id
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
/* 检验类型关联 */
|
||||
|
||||
@@ -1026,7 +1026,7 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
||||
return found.label;
|
||||
}
|
||||
|
||||
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失时的兜底,避免保存后"医嘱类型"列显示为空
|
||||
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失或标签为空时的兜底
|
||||
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
||||
if (type === 6) return '手术';
|
||||
if (type === 4) return '手术';
|
||||
@@ -1036,6 +1036,15 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
||||
return '诊疗';
|
||||
}
|
||||
|
||||
// 🔧 Bug #458 Fix: 兜底映射,确保所有有效 adviceType 都有显示标签
|
||||
// 不依赖字典数据和表名,直接返回标准类型名称
|
||||
if (type === 3) return '诊疗';
|
||||
if (type === 6) return '手术';
|
||||
if (type === 4) return '耗材';
|
||||
if (type === 1) return '西药';
|
||||
if (type === 2) return '中成药';
|
||||
if (type === 5) return '会诊';
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
@@ -1658,12 +1667,16 @@ function getListInfo(addNewRow) {
|
||||
contentJson?.consultationRequestId;
|
||||
|
||||
let adviceType = item.adviceType;
|
||||
|
||||
|
||||
// 🔧 Bug Fix: 后端保存时将耗材(4)转换为中成药(2),显示时需要转换回来
|
||||
// 检查 adviceTableName,如果是耗材表则应该是耗材类型
|
||||
const adviceTableName = contentJson?.adviceTableName || item.adviceTableName;
|
||||
|
||||
let adviceType_dictText = item.adviceType_dictText || mapAdviceTypeLabel(adviceType, adviceTableName);
|
||||
|
||||
// 🔧 Bug #458 Fix: 后端可能返回空字符串的 adviceType_dictText,需重新计算
|
||||
const backendDictText = item.adviceType_dictText;
|
||||
let adviceType_dictText = (backendDictText && backendDictText.trim())
|
||||
? backendDictText
|
||||
: mapAdviceTypeLabel(adviceType, adviceTableName);
|
||||
|
||||
// 如果是会诊类型,设置为会诊类型
|
||||
if (isConsultation) {
|
||||
|
||||
@@ -636,12 +636,11 @@ function getList() {
|
||||
if (res.code === 200) {
|
||||
surgeryList.value = res.data?.records || []
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '数据加载失败,请稍后重试')
|
||||
console.warn('手术列表加载失败(可能无权限或数据异常):', res.msg)
|
||||
surgeryList.value = []
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取手术列表失败:', error)
|
||||
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
||||
console.warn('手术列表请求异常:', error)
|
||||
surgeryList.value = []
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
@@ -1142,8 +1141,8 @@ function submitForm() {
|
||||
// 保存麻醉方式
|
||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||
open.value = false
|
||||
getList() // 提交成功后直接刷新列表
|
||||
emit('saved') // 通知父组件刷新医嘱列表
|
||||
// 由父组件 @saved 事件负责刷新列表(带延迟确保后端事务已提交)
|
||||
emit('saved')
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
||||
}
|
||||
@@ -1159,8 +1158,8 @@ function submitForm() {
|
||||
// 保存麻醉方式
|
||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||
open.value = false
|
||||
getList() // 修改成功后直接刷新列表
|
||||
emit('saved') // 通知父组件刷新医嘱列表
|
||||
// 由父组件 @saved 事件负责刷新列表
|
||||
emit('saved')
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="手术申请" name="surgery">
|
||||
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
||||
@saved="() => { prescriptionRef?.getListInfo(); surgeryRef?.getList() }" />
|
||||
@saved="() => { prescriptionRef?.getListInfo(); setTimeout(() => surgeryRef?.getList(), 500) }" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="电子处方" name="eprescription">
|
||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||
|
||||
@@ -678,15 +678,16 @@ const handlePrint = async (row) => {
|
||||
}
|
||||
|
||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
const fieldKeys = ['targetDepartment', 'urgencyLevel', 'expectedExaminationTime', 'allergyHistory', 'examinationPurpose', 'medicalHistorySummary', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
let descFieldsHtml = '';
|
||||
fieldKeys.forEach((key) => {
|
||||
const label = labelMap[key] || key;
|
||||
if (descData[key] != null && descData[key] !== '') {
|
||||
const value = transformField(key, descData[key]);
|
||||
if (value != null && value !== '') {
|
||||
descFieldsHtml += `
|
||||
<div class="info-row">
|
||||
<span class="label">${label}:</span>
|
||||
<span class="value">${descData[key]}</span>
|
||||
<span class="value">${value}</span>
|
||||
</div>`;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1535,8 +1535,8 @@ function handleMedicalAdvice(row) {
|
||||
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||
|
||||
// 调用计费接口获取数据
|
||||
getPrescriptionList(row.visitId).then((res) => {
|
||||
// 调用计费接口获取数据(使用手术计费来源参数,匹配 surgery billing 创建的记录)
|
||||
getPrescriptionList(row.visitId, 6, row.operCode).then((res) => {
|
||||
console.log('=== 拉取计费数据返回结果 ===', res)
|
||||
if (res.code === 200 && res.data) {
|
||||
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
||||
@@ -1741,27 +1741,39 @@ function handleTemporaryMedicalSubmit(data) {
|
||||
}
|
||||
})
|
||||
|
||||
// 🔧 修复 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') // 过滤掉空项
|
||||
)
|
||||
// 🔧 修复 Bug #445: 使用稳定可靠的字段组合匹配已提交项目,从已生成列表中剔除待生成项
|
||||
// 匹配键:优先使用 chargeItemId(后端费用项目ID,最可靠),其次使用 名称+规格+数量 组合
|
||||
const submittedKeys = new Set()
|
||||
const submittedChargeIds = new Set()
|
||||
|
||||
if (submittedKeys.size > 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) {
|
||||
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
||||
const key = `${m.medicineName || ''}|||${m.specification || ''}|||${m.quantity || 0}`
|
||||
// 优先用 chargeItemId 匹配
|
||||
if (m.chargeItemId && submittedChargeIds.has(m.chargeItemId)) {
|
||||
return false
|
||||
}
|
||||
// 兜底用 名称+规格+数量 匹配
|
||||
const key = `${m.medicineName || m.adviceName || ''}|||${m.specification || m.volume || ''}|||${m.quantity || 0}`
|
||||
return !submittedKeys.has(key)
|
||||
})
|
||||
} else {
|
||||
// 如果没有任何匹配键,清空待生成列表(所有项目都已提交)
|
||||
// 如果没有任何匹配标识,清空待生成列表(保守策略:认为所有项目都已提交)
|
||||
temporaryBillingMedicines.value = []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user