From b9de34aa0e6fb8cc987b1b82298a9fa84afe774b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Thu, 22 Oct 2026 14:06:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E9=98=B2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=EF=BC=8C=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/payment/invoice-application.vue | 20 ++++++++++------ src/views/payment/invoice-receipt.vue | 20 ++++++++++------ src/views/settlement/formal-settlement.vue | 28 +++++++++++++--------- src/views/settlement/pre-settlement.vue | 20 ++++++++++------ 4 files changed, 56 insertions(+), 32 deletions(-) diff --git a/src/views/payment/invoice-application.vue b/src/views/payment/invoice-application.vue index 3d3294d..a447f77 100644 --- a/src/views/payment/invoice-application.vue +++ b/src/views/payment/invoice-application.vue @@ -270,6 +270,7 @@ export default { rows: [], selection: [], loading: false, + approveLoading: false, batchSyncing: false, page: { current: 1, size: 10, total: 0 }, mkEnabled: false, @@ -408,13 +409,17 @@ export default { }); }, async handleApprove(row) { - await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' }); - const loading = this.$loading({ - lock: true, - text: '审批处理中,请稍候…', - background: 'rgba(255, 255, 255, 0.6)', - }); + // 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示 + if (this.approveLoading) return; + this.approveLoading = true; + let loading = null; try { + await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' }); + loading = this.$loading({ + lock: true, + text: '审批处理中,请稍候…', + background: 'rgba(255, 255, 255, 0.6)', + }); const res = await api.approve({ id: row.id }); // data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因 if (res.data.data === false) { @@ -424,7 +429,8 @@ export default { } this.loadTable(); } finally { - loading.close(); + loading?.close(); + this.approveLoading = false; } }, async handleReturn(row) { diff --git a/src/views/payment/invoice-receipt.vue b/src/views/payment/invoice-receipt.vue index c0cea3d..aed1115 100644 --- a/src/views/payment/invoice-receipt.vue +++ b/src/views/payment/invoice-receipt.vue @@ -255,6 +255,7 @@ export default { rows: [], selection: [], loading: false, + approveLoading: false, pushLoading: false, page: { current: 1, size: 10, total: 0 }, mkEnabled: false, @@ -365,13 +366,17 @@ export default { }); }, async handleApprove(row) { - await this.$confirm('确认审批通过该收票登记?', '提示', { type: 'warning' }); - const loading = this.$loading({ - lock: true, - text: '审批处理中,请稍候…', - background: 'rgba(255, 255, 255, 0.6)', - }); + // 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示 + if (this.approveLoading) return; + this.approveLoading = true; + let loading = null; try { + await this.$confirm('确认审批通过该收票登记?', '提示', { type: 'warning' }); + loading = this.$loading({ + lock: true, + text: '审批处理中,请稍候…', + background: 'rgba(255, 255, 255, 0.6)', + }); const res = await api.approve({ id: row.id }); // data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因 if (res.data.data === false) { @@ -381,7 +386,8 @@ export default { } this.loadTable(); } finally { - loading.close(); + loading?.close(); + this.approveLoading = false; } }, async handleReturn(row) { diff --git a/src/views/settlement/formal-settlement.vue b/src/views/settlement/formal-settlement.vue index b2c090f..3c7926c 100644 --- a/src/views/settlement/formal-settlement.vue +++ b/src/views/settlement/formal-settlement.vue @@ -140,6 +140,7 @@ export default { rows: [], selection: [], loading: false, + approveLoading: false, syncLoading: false, page: { currentPage: 1, pageSize: 10, pageSizes: [10, 20, 50, 100], total: 0 }, editor: { visible: false, id: null, readonly: false }, @@ -371,17 +372,21 @@ export default { }); }, async handleApprove(row) { - await this.$confirm( - `审核通过后${this.billLabel}生效,金额只能通过结算调整单处理,确认通过?`, - '提示', - { type: 'warning' } - ); - const loading = this.$loading({ - lock: true, - text: '审批处理中,请稍候…', - background: 'rgba(255, 255, 255, 0.6)', - }); + // 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示 + if (this.approveLoading) return; + this.approveLoading = true; + let loading = null; try { + await this.$confirm( + `审核通过后${this.billLabel}生效,金额只能通过结算调整单处理,确认通过?`, + '提示', + { type: 'warning' } + ); + loading = this.$loading({ + lock: true, + text: '审批处理中,请稍候…', + background: 'rgba(255, 255, 255, 0.6)', + }); const res = await api.approve({ id: row.id }); // data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因 if (res.data.data === false) { @@ -391,7 +396,8 @@ export default { } this.onLoad(this.page); } finally { - loading.close(); + loading?.close(); + this.approveLoading = false; } }, async handleReturn(row) { diff --git a/src/views/settlement/pre-settlement.vue b/src/views/settlement/pre-settlement.vue index d13597e..8648db4 100644 --- a/src/views/settlement/pre-settlement.vue +++ b/src/views/settlement/pre-settlement.vue @@ -334,6 +334,7 @@ export default { ArrowDown, ArrowUp, loading: false, + approveLoading: false, query: emptyQuery(), searchFields: preSettlementSearchFields, searchExpanded: false, @@ -691,18 +692,23 @@ export default { }); }, async handleApprove(row) { - await this.$confirm('确认审批通过该预付结算单?', '提示', { type: 'warning' }); - const loading = this.$loading({ - lock: true, - text: '审批处理中,请稍候…', - background: 'rgba(255, 255, 255, 0.6)', - }); + // 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示 + if (this.approveLoading) return; + this.approveLoading = true; + let loading = null; try { + await this.$confirm('确认审批通过该预付结算单?', '提示', { type: 'warning' }); + loading = this.$loading({ + lock: true, + text: '审批处理中,请稍候…', + background: 'rgba(255, 255, 255, 0.6)', + }); await approve({ id: row.id }); this.$message.success('审批通过'); this.loadTable(); } finally { - loading.close(); + loading?.close(); + this.approveLoading = false; } }, async handleReturn(row) {