From bbeddc307740beacffa231ccb20a555b81eb7673 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Wed, 20 May 2026 11:06:24 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#559:=20=E6=A0=B9=E5=9B=A0+?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B9=E6=A1=88=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/inpatientDoctor/home/components/order/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ace8cdda..48107699 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 @@ -1575,6 +1575,9 @@ function handleSaveGroup(orderGroupList) { // 收集所有要添加的新行,最后统一 unshift 到数组开头(置顶显示) const newRows = []; + // 记录循环前的数组长度,用于清理循环中创建的临时行 + const originalLength = prescriptionList.value.length; + orderGroupList.forEach((item) => { // 使用临时索引,先追加到末尾用于 setValue 填充 const tempIndex = prescriptionList.value.length; @@ -1664,8 +1667,9 @@ function handleSaveGroup(orderGroupList) { successCount++; }); - // 统一添加到数组开头(置顶显示) + // 清理循环中创建的临时行,统一添加到数组开头(置顶显示) if (newRows.length > 0) { + prescriptionList.value.splice(originalLength); // 移除循环中追加到末尾的临时行 prescriptionList.value.unshift(...newRows); proxy.$modal.msgSuccess(`成功添加 ${successCount} 个医嘱项`); }