From 5c71891cfe6e04082f6e01bf9b22e17a84bc5a34 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 11 Sep 2025 10:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../leasePublish/component/addToolsApply.vue | 11 ++++++- .../lease/apply/component/homeApply.vue | 31 ++++++++++++++----- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/views/business/leasePublish/component/addToolsApply.vue b/src/views/business/leasePublish/component/addToolsApply.vue index ba4c22c5..6246da50 100644 --- a/src/views/business/leasePublish/component/addToolsApply.vue +++ b/src/views/business/leasePublish/component/addToolsApply.vue @@ -129,6 +129,7 @@ width="600px" append-to-body @close="closeView" + v-loading="loading" > @@ -266,6 +267,7 @@ export default { }, data() { return { + isSubmit: false, taskId: "", // isEdit: false, // 遮罩层 @@ -511,6 +513,9 @@ export default { return this.$modal.msgError(errorInfo); } console.log("xxxxxxxxxxxxxxxxxxxxxx", itemsTemp) + if (this.isSubmit) return + this.isSubmit = true + this.loading = true applySubmit({ leaseApplyDetailsList: itemsTemp, leaseApplyInfo: leaseApplyInfo, @@ -524,7 +529,11 @@ export default { this.$emit("addToolsSuccess"); } this.loading = false; - }); + this.isSubmit = false + }).catch(() => { + this.loading = false + this.isSubmit = false + }) } }) diff --git a/src/views/material/lease/apply/component/homeApply.vue b/src/views/material/lease/apply/component/homeApply.vue index aa9e7f3a..51829bd9 100644 --- a/src/views/material/lease/apply/component/homeApply.vue +++ b/src/views/material/lease/apply/component/homeApply.vue @@ -46,7 +46,7 @@ 领料申请 - + 发布 @@ -453,6 +453,7 @@ export default { data() { return { // 遮罩层 + isSubmit: false, loading: true, loadingTwo: true, updateTime: '', @@ -1173,12 +1174,20 @@ export default { const param = { id: row.id, taskId: row.taskId } this.$modal .confirm('是否确认发布所选择的数据项?') - .then(function () { - return applySend(param) - }) - .then(() => { - this.getList() - this.$modal.msgSuccess('发布成功') + .then(async () => { + try { + if (this.isSubmit) return + this.isSubmit = true + this.loading = true + await applySend(param) + this.getList() + this.$modal.msgSuccess('发布成功') + } catch (error) { + console.log('🚀 ~ handleSend ~ error:', error) + } finally { + this.isSubmit = false + this.loading = false + } }) .catch(() => {}) }, @@ -1191,11 +1200,19 @@ export default { }) return } else { + if (this.isSubmit) return + this.isSubmit = true + this.loading = true applySendAll(this.sendTemp).then(response => { + this.isSubmit = false + this.loading = false if (response.code == 200) { this.$modal.msgSuccess('发布成功') } this.getList() + }).catch(() => { + this.isSubmit = false + this.loading = false }) } },