From 2555a2f5fd4c1976f81c3788bd6bf321acb914a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Thu, 14 May 2026 21:12:58 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#458:=20=E9=97=A8=E8=AF=8A=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E7=AB=99=EF=BC=9A=E8=AF=8A=E7=96=97=E7=B1=BB=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8"=E5=8C=BB=E5=98=B1=E7=B1=BB=E5=9E=8B"?= =?UTF-8?q?=E5=88=97=E6=98=BE=E7=A4=BA=E4=B8=BA=E7=A9=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增强 mapAdviceTypeLabel 函数的兜底映射:在原有表名匹配兜底的基础上, 新增不依赖表名的最终兜底映射(1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=会诊, 6=手术), 确保即使字典缺失或表名不匹配也能正确显示类型标签。 同时修复 getListInfo 中 adviceType_dictText 的空字符串判断逻辑, 使用显式 trim() 检查替代 || 运算符,避免后端返回空字符串时未被重新计算。 Co-Authored-By: Claude Opus 4.7 --- .../prescription/prescriptionlist.vue | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index cd137662c..95945dbb9 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -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) {