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} 个医嘱项`); }