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 + ')'); }); } }