diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index 6fc10513..06d645cd 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -730,6 +730,7 @@ export default { return; } + let loadingInstance = null; try { this.loading = true; @@ -759,11 +760,12 @@ export default { }; console.log('提交的合卷数据:', mergeData); - const loadingInstance = this.$loading({ + loadingInstance = this.$loading({ lock: true, text: '正在合卷,请稍后...', background: 'rgba(0, 0, 0, 0.7)' - }) + }); + const response = await mergeMaterialCoil(mergeData); if (response.code === 200) { this.$message.success('合卷保存成功'); @@ -783,7 +785,9 @@ export default { console.error(error); } finally { this.loading = false; - loadingInstance.close(); + if (loadingInstance) { + loadingInstance.close(); + } } },