Fix Bug #528: [住院医生工作站-检查申请] 修改申请单成功后,弹窗未自动关闭且列表数据未自动刷新
根因:submit() 方法的 .then() 回调中 else 分支使用 res.message(后端返回 res.msg), 且缺少 .catch() 错误处理。当请求异常时既无错误提示也不触发 submitOk 事件。 修复: 1. 统一使用 res.msg 替代 res.message 2. 添加 .catch() 错误处理(console.error + 用户提示) 3. 统一使用已导入的 ElMessage 替代 proxy.$message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -499,17 +499,16 @@ const submit = () => {
|
||||
categoryEnum: '22',
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (props.isEditMode) {
|
||||
proxy.$message.success(res.msg || '修改成功');
|
||||
} else {
|
||||
proxy.$message.success(res.msg);
|
||||
}
|
||||
ElMessage.success(res.msg || (props.isEditMode ? '修改成功' : '保存成功'));
|
||||
applicationList.value = [];
|
||||
resetForm();
|
||||
emits('submitOk');
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
ElMessage.error(res.msg || '保存失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('保存检查申请失败:', error);
|
||||
ElMessage.error('保存失败,请稍后重试');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user