From 3ee09b22c7b0cfbfab54c23085f7ee869b2a55e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Fri, 15 May 2026 01:27:53 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#511:=20[=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E4=B8=B4?= =?UTF-8?q?=E5=BA=8A=E5=8C=BB=E5=98=B1]=20=E6=8A=A4=E5=A3=AB=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=E5=8C=BB=E5=98=B1=E5=9C=A8=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E7=AB=99=E5=8F=8C=E5=87=BB=E6=97=A0=E6=B3=95=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BF=AE=E6=94=B9=E9=87=8D=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 Number() 做 statusEnum 类型转换并用 === 严格比较,避免前后端类型不一致导致双击无响应 - 使用 splice 替代直接赋值更新 prescriptionList,确保 Vue 响应式系统能正确触发渲染更新 - 使用 nextTick 包裹 expandOrder 设置,确保数据更新后再设置展开状态,保证 el-table 正确识别 row-key - 增加 findIndex 返回 -1 时的错误处理,给用户可见提示而非静默失败 --- .../home/components/order/index.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 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 b16de7c0d..d3d4016db 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 @@ -863,13 +863,22 @@ function clickRowDb(row, column, event) { } row.showPopover = false; // 仅”待签发(statusEnum==1)”允许编辑;”已签发(statusEnum==2)”及之后状态不允许编辑 - if (row.statusEnum == 1) { + // 使用 Number() 做类型转换,确保后端返回的数值能正确比较 + if (Number(row.statusEnum) === 1) { // 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1') row.therapyEnum = String(row.therapyEnum ?? '1'); row.isEdit = true; const index = prescriptionList.value.findIndex((item) => item.uniqueKey === row.uniqueKey); - prescriptionList.value[index] = row; - expandOrder.value = [row.uniqueKey]; + if (index !== -1) { + prescriptionList.value.splice(index, 1, row); + // 使用 nextTick 确保数据更新后再设置展开状态,保证 el-table 能正确识别 row-key + nextTick(() => { + expandOrder.value = [row.uniqueKey]; + }); + } else { + console.warn('⚠️ clickRowDb 未找到匹配行: uniqueKey=', row.uniqueKey, ', row=', row); + proxy.$modal.msgWarning('无法进入编辑模式,请刷新列表后重试'); + } } }