Fix Bug #458: 门诊医生站:诊疗类医嘱保存成功后,列表"医嘱类型"列显示为空值
根因:mapAdviceTypeLabel 函数依赖 drord_doctor_type 字典数据进行类型映射, 当字典中缺少 value=3(诊疗)的条目时,find() 返回 undefined,函数返回空字符串, 导致保存后刷新列表时"医嘱类型"列显示为空白。 修复:在 mapAdviceTypeLabel 中为诊疗/手术类医嘱(wor_activity_definition 表) 添加兜底映射逻辑:type 3→诊疗, 6→手术, 4→手术, 1→检验, 2→检查, 5→其他, 确保即使字典缺失对应条目也能正确显示类型标签。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1013,15 +1013,29 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
if (type === 2 && adviceTableName === 'adm_device_definition') {
|
if (type === 2 && adviceTableName === 'adm_device_definition') {
|
||||||
return '耗材';
|
return '耗材';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug Fix: 处理检查类型(adviceType=23)
|
// 🔧 Bug Fix: 处理检查类型(adviceType=23)
|
||||||
// 检查类型属于诊疗类,应该显示为"检查"
|
// 检查类型属于诊疗类,应该显示为"检查"
|
||||||
if (type === 23) {
|
if (type === 23) {
|
||||||
return '检查';
|
return '检查';
|
||||||
}
|
}
|
||||||
|
|
||||||
const found = adviceTypeList.value.find((item) => item.value === type);
|
const found = adviceTypeList.value.find((item) => item.value === type);
|
||||||
return found ? found.label : '';
|
if (found) {
|
||||||
|
return found.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失时的兜底,避免保存后"医嘱类型"列显示为空
|
||||||
|
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
||||||
|
if (type === 6) return '手术';
|
||||||
|
if (type === 4) return '手术';
|
||||||
|
if (type === 1) return '检验';
|
||||||
|
if (type === 2) return '检查';
|
||||||
|
if (type === 5) return '其他';
|
||||||
|
return '诊疗';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 西药处方管理相关变量
|
// 西药处方管理相关变量
|
||||||
|
|||||||
Reference in New Issue
Block a user