diff --git a/src/views/material/repair/testExamine/component/homeApply.vue b/src/views/material/repair/testExamine/component/homeApply.vue index cbed23d2..f325c2fc 100644 --- a/src/views/material/repair/testExamine/component/homeApply.vue +++ b/src/views/material/repair/testExamine/component/homeApply.vue @@ -412,6 +412,8 @@ export default { confirmButtonText: "确定", }); } else { + // 添加全局loading + const loading = this.$loading({text: '提交中...'}); outerAudit(this.passTemp).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("通过成功"); @@ -420,8 +422,16 @@ export default { this.passTemp = []; this.failTemp = []; // router.go(0); // 刷新页面 + this.getList(); } - this.getTaskInfo(); + // this.getTaskInfo(); + }).catch((error) => { + // 捕获异常,防止loading一直显示 + console.error('通过操作失败:', error); + this.$modal.msgError("通过失败"); + }).finally(() => { + // 无论成功失败,都关闭loading + loading.close(); }); } }, @@ -433,6 +443,8 @@ export default { confirmButtonText: "确定", }); } else { + // 添加全局loading + const loading = this.$loading({text: '提交中...'}); outerAudit(this.failTemp).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("驳回成功"); @@ -441,8 +453,16 @@ export default { this.passTemp = []; this.failTemp = []; // router.go(0); // 刷新页面 + this.getList(); } - this.getTaskInfo(); + // this.getTaskInfo(); + }).catch((error) => { + // 捕获异常,防止loading一直显示 + console.error('驳回操作失败:', error); + this.$modal.msgError("驳回失败"); + }).finally(() => { + // 无论成功失败,都关闭loading + loading.close(); }); } },