From b87df3c2685cd1db96a61571075a0f60293b08cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Wed, 13 May 2026 19:07: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. getRowSelectValue: 校验行数据是否在选项列表中,不存在时返回undefined避免el-select回显原始数字 2. filterPrescriptionList: 复合值'1-2'过滤时提取adviceType部分比较,避免类型过滤失效 3. handleSaveSign: 严格校验itemNo非空且为有效字符串,trim检查并显式String()转换,避免后端报缺参错误 Co-Authored-By: Claude Opus 4.7 --- .../home/components/order/index.vue | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) 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 8b00c3c8b..82aa40277 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 @@ -710,9 +710,17 @@ function loadConfiguredCategories() { // 数据过滤 const filterPrescriptionList = computed(() => { const pList = prescriptionList.value.filter((item) => { + // 修复 Bug #488:orderClassCode 可能是复合值 '1-2',需提取 adviceType 部分进行比较 + let matchAdviceType = true; + if (orderClassCode.value) { + const filterAdviceType = String(orderClassCode.value).includes('-') + ? parseInt(String(orderClassCode.value).split('-')[0]) + : orderClassCode.value; + matchAdviceType = filterAdviceType == item.adviceType; + } return ( (!therapyEnum.value || therapyEnum.value == item.therapyEnum) && - (!orderClassCode.value || orderClassCode.value == item.adviceType) && + matchAdviceType && (!orderStatus.value || (orderStatus.value == item.statusEnum && item.requestId)) ); }); @@ -740,12 +748,28 @@ function getRowDisabled(row) { /** * 将行的 adviceType + categoryCode 映射为 el-select 的选中值 * 药品子分类使用复合值如 '1-2'(adviceType-categoryCode),诊疗/手术/全部使用原始值 + * 修复 Bug #488:当行的 adviceType 在当前配置中找不到匹配选项时,返回最接近的可用值,避免回显为纯数字 */ function getRowSelectValue(row) { if (row.adviceType == 1 && row.categoryCode) { - return '1-' + row.categoryCode; + const compositeValue = '1-' + row.categoryCode; + // 检查复合值是否在选项列表中 + if (adviceTypeList.value.some(item => item.value === compositeValue)) { + return compositeValue; + } + // 配置的 categoryCode 已变更,回退到第一个药品选项 + const firstPharmacy = adviceTypeList.value.find(item => String(item.value).startsWith('1-')); + if (firstPharmacy) { + return firstPharmacy.value; + } + return row.adviceType; } - return row.adviceType; + // 诊疗/手术等非药品类型,检查其值是否在选项列表中 + if (adviceTypeList.value.some(item => item.value === row.adviceType)) { + return row.adviceType; + } + // 不在选项中的值(如已废弃的 adviceType),返回 undefined 让 el-select 显示为空 + return undefined; } // 新增医嘱 @@ -1320,11 +1344,12 @@ function handleCancelEdit(row, index) { function handleSaveSign(row, index) { if (row.adviceType != 2) { + // 修复 Bug #488:严格校验 itemNo,确保非空且为有效字符串才发起请求 let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId; - if (!itemNo) { + if (!itemNo || String(itemNo).trim() === '') { console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')'); } else { - getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => { + getBindDevice({ typeCode: row.adviceType, itemNo: String(itemNo) }).then((res) => { if (res.data.length == 0) { return; }