Fix Bug #559: 根因+修复方案摘要
This commit is contained in:
@@ -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} 个医嘱项`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user