Fix Bug #405: 住院医生工作站:临床医嘱保存成功后,医嘱条目仍处于可编辑状态(未锁定展示)
根因:handleSaveBatch 保存成功后,原有修复通过 uniqueKey 查找 prescriptionList 中的行并设置 isEdit=false, 但由于 saveList 中的 item 本身就是 prescriptionList 中对象的同一引用,通过 find(uniqueKey) 查找存在匹配失败的风险。 修复:直接对 saveList 中的对象引用设置 isEdit=false(同引用无需查找),并兜底遍历所有 statusEnum==1 的行锁定。 同时清空 expandOrder 展开状态,确保医嘱行完全回到只读展示模式。
This commit is contained in:
@@ -1477,11 +1477,18 @@ function handleSaveBatch() {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess('保存成功');
|
proxy.$modal.msgSuccess('保存成功');
|
||||||
// 修复【#405】:保存成功后重置所有待保存行的 isEdit 为 false,锁定医嘱不再编辑
|
// 修复 Bug #405:保存成功后锁定所有待保存行,避免医嘱条目仍处于可编辑状态
|
||||||
|
// saveList 中的 item 与 prescriptionList 是同一对象引用,直接修改即可
|
||||||
saveList.forEach(item => {
|
saveList.forEach(item => {
|
||||||
const row = prescriptionList.value.find(r => r.uniqueKey === item.uniqueKey);
|
item.isEdit = false;
|
||||||
if (row) row.isEdit = false;
|
|
||||||
});
|
});
|
||||||
|
// 兜底:锁定所有 statusEnum == 1 的行,确保没有遗漏
|
||||||
|
prescriptionList.value.forEach(row => {
|
||||||
|
if (row.statusEnum == 1) {
|
||||||
|
row.isEdit = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
expandOrder.value = [];
|
||||||
getListInfo(false);
|
getListInfo(false);
|
||||||
nextId.value = 1;
|
nextId.value = 1;
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user