From 16923ed45eb1957141c51c677fc51c1476a3a004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Thu, 14 May 2026 23:12:10 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#488:=20=E3=80=90=E4=B8=B4=E5=BA=8A?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E3=80=91=E5=8F=8C=E5=87=BB=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=BE=85=E7=AD=BE=E5=8F=91=E5=8C=BB=E5=98=B1=EF=BC=8C=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E7=B1=BB=E5=9E=8B=E5=9B=9E=E6=98=BE=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E4=B8=94=E7=82=B9=E5=87=BB=E7=A1=AE=E8=AE=A4=E6=8A=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题1-医嘱类型回显为数字: 编辑待签发医嘱时,当行的adviceType值(如3/诊疗) 不在当前adviceTypeList选项列表中时,el-select会回显为纯数字。 修复:新增hasAdviceTypeOption和getAdviceTypeLabel函数,当类型无匹配选项时 显示el-tag标签而非空下拉框,避免数字回显。 问题2-点击确认报itemNo接口错误: getBindDevice接口调用无catch处理, 接口失败时promise rejection阻断主流程保存。 修复:为getBindDevice调用链添加.catch()静默降级,确保绑定设备接口失败 不影响医嘱主流程保存。 Co-Authored-By: Claude Opus 4.7 --- .../home/components/order/index.vue | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index f7891dc1b..d7f484005 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -142,6 +142,11 @@ {{ scope.row.adviceName }} @@ -750,6 +756,31 @@ function getRowDisabled(row) { return row.isEdit; } +/** + * 判断行的 adviceType 是否在当前 adviceTypeList 选项中有匹配项 + * 修复 Bug #488:避免 el-select 因无匹配选项而回显为纯数字 + */ +function hasAdviceTypeOption(row) { + if (!row.adviceType && row.adviceType !== 0) return false; + if (row.adviceType == 1 && row.categoryCode) { + const compositeValue = '1-' + row.categoryCode; + return adviceTypeList.value.some(item => item.value === compositeValue); + } + return adviceTypeList.value.some(item => item.value === row.adviceType); +} + +/** + * 将原始 adviceType 数字映射为人类可读标签 + * 修复 Bug #488:当 adviceType 不在选项列表中时,显示标签而非数字 + */ +function getAdviceTypeLabel(type) { + if (!type && type !== 0) return ''; + // 优先使用字典文本(如果后端返回了 adviceType_dictText) + // 但由于当前行数据可能没有 dictText,提供兜底映射 + const fallbackMap = { 1: '西药', 2: '中成药', 3: '诊疗', 4: '耗材', 5: '会诊', 6: '手术', 23: '检查' }; + return fallbackMap[type] || String(type); +} + /** * 将行的 adviceType + categoryCode 映射为 el-select 的选中值 * 药品子分类使用复合值如 '1-2'(adviceType-categoryCode),诊疗/手术/全部使用原始值 @@ -1378,6 +1409,9 @@ function handleSaveSign(row, index) { bindMethod.value[itemNo] = true; } } + }).catch(() => { + // 绑定设备接口失败不影响主流程保存,静默降级 + console.warn('绑定设备检查接口调用失败(adviceType=' + row.adviceType + ', itemNo=' + itemNo + ')'); }); } }