Fix Bug #405: 住院医生工作站:临床医嘱保存成功后,医嘱条目仍处于可编辑状态(未锁定展示)
- getListInfo: 增加 getPrescriptionList 的 .catch() 处理,API失败时锁定所有行(isEdit=false) 防止列表加载静默失败导致医嘱永久处于可编辑状态 - handleSaveBatch: 在 .catch() 中增加 isEdit=false 重置,保存失败时也锁定行 - 与之前的修复配合:保存成功时先设置 isEdit=false 再调用 getListInfo 刷新数据 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -631,6 +631,12 @@ function getListInfo(addNewRow) {
|
||||
handleAddPrescription();
|
||||
}
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error('处方列表加载失败:', err);
|
||||
// 🔧 Bug #405 修复:列表加载失败时,确保所有行被锁定(isEdit=false)
|
||||
// 防止行永久处于可编辑状态
|
||||
prescriptionList.value.forEach(item => { item.isEdit = false; });
|
||||
loadingInstance.close();
|
||||
});
|
||||
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
||||
contractList.value = res.data;
|
||||
@@ -1443,6 +1449,12 @@ function handleSaveBatch() {
|
||||
})
|
||||
.catch((error) => {
|
||||
isSaving.value = false;
|
||||
// 🔧 Bug #405 修复:保存失败时也锁定行,防止行永久处于可编辑状态
|
||||
filterPrescriptionList.value.forEach(item => {
|
||||
if (item.statusEnum == 1 && !item.requestId) {
|
||||
item.isEdit = false;
|
||||
}
|
||||
});
|
||||
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user