From a5eeda615243dc8c14d6250a71e116d51dd96512 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, 24 Sep 2026 05:07:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=98=E6=AC=BE=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E3=80=81=E5=BC=80=E7=A5=A8=E7=94=B3=E8=AF=B7=E3=80=81=E6=94=B6?= =?UTF-8?q?=E7=A5=A8=E7=99=BB=E8=AE=B0=E9=87=91=E8=9D=B6=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=98=B2=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/payment/invoice-application.vue | 14 ++++++-- src/views/payment/invoice-receipt.vue | 14 ++++++-- src/views/payment/payment-application.vue | 44 +++++++++++++++-------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/src/views/payment/invoice-application.vue b/src/views/payment/invoice-application.vue index b701546..98ba1fc 100644 --- a/src/views/payment/invoice-application.vue +++ b/src/views/payment/invoice-application.vue @@ -61,6 +61,7 @@ v-if="hasPermission('invoice_application_sync')" type="primary" plain + :loading="batchSyncing" @click="handleBatchSync" >批量同步 @@ -270,6 +271,7 @@ export default { rows: [], selection: [], loading: false, + batchSyncing: false, page: { current: 1, size: 10, total: 0 }, flowDialog: { visible: false, loading: false, row: {}, records: [] }, }; @@ -399,14 +401,20 @@ export default { this.loadTable(); }, async handleBatchSync() { + if (this.batchSyncing) return; const rows = this.selection.filter(row => row.approvalStatus === 'approved'); if (!rows.length) { this.$message.warning('请选择至少一条审批通过的开票申请'); return; } - await Promise.all(rows.map(row => api.syncKingdee(row.id))); - this.$message.success(`已同步${rows.length}条开票申请`); - this.loadTable(); + this.batchSyncing = true; + try { + await Promise.all(rows.map(row => api.syncKingdee(row.id))); + this.$message.success(`已同步${rows.length}条开票申请`); + this.loadTable(); + } finally { + this.batchSyncing = false; + } }, async handleExport() { const data = this.unwrapData(await api.getList(1, 100000, this.query)); diff --git a/src/views/payment/invoice-receipt.vue b/src/views/payment/invoice-receipt.vue index a0774f6..56cb577 100644 --- a/src/views/payment/invoice-receipt.vue +++ b/src/views/payment/invoice-receipt.vue @@ -70,6 +70,7 @@ v-if="hasPermission('invoice_receipt_sync')" type="primary" plain + :loading="pushLoading" @click="handlePushKingdee" >批量同步 @@ -263,6 +264,7 @@ export default { rows: [], selection: [], loading: false, + pushLoading: false, page: { current: 1, size: 10, total: 0 }, flowDialog: { visible: false, loading: false, row: {}, records: [] }, }; @@ -364,6 +366,7 @@ export default { this.loadTable(); }, async handlePushKingdee() { + if (this.pushLoading) return; const rows = this.selection.filter(row => row.approvalStatus === 'approved'); if (!rows.length) { this.$message.warning('请选择至少一条审批通过的收票登记'); @@ -372,9 +375,14 @@ export default { await this.$confirm(`确认将选中的 ${rows.length} 条收票登记同步至金蝶?`, '提示', { type: 'warning', }); - const summary = this.unwrapData(await api.pushKingdee(rows.map(row => row.id))); - this.$alert(summary || '推送完成', '推送结果', { confirmButtonText: '知道了' }); - this.loadTable(); + this.pushLoading = true; + try { + const summary = this.unwrapData(await api.pushKingdee(rows.map(row => row.id))); + this.$alert(summary || '推送完成', '推送结果', { confirmButtonText: '知道了' }); + this.loadTable(); + } finally { + this.pushLoading = false; + } }, async handleExport() { const data = this.unwrapData(await api.getList(1, 100000, this.query)); diff --git a/src/views/payment/payment-application.vue b/src/views/payment/payment-application.vue index 4bdb19d..b90a5fe 100644 --- a/src/views/payment/payment-application.vue +++ b/src/views/payment/payment-application.vue @@ -81,6 +81,7 @@ v-if="hasPermission('payment_application_sync')" type="primary" plain + :loading="syncLoading" @click="handleSync" >批量同步 @@ -88,6 +89,7 @@ v-if="hasPermission('payment_application_sync')" type="primary" plain + :loading="resultSyncing" @click="handleSyncResult" >同步付款结果 @@ -271,6 +273,8 @@ export default { rows: [], selection: [], loading: false, + syncLoading: false, + resultSyncing: false, page: { current: 1, size: 10, total: 0 }, flowDialog: { visible: false, row: {} }, }; @@ -405,28 +409,40 @@ export default { this.loadTable(); }, async handleSync() { + if (this.syncLoading) return; const rows = this.selection.filter(row => row.approvalStatus === 'approved'); if (!rows.length) { this.$message.warning('请选择至少一条审批通过的付款申请'); return; } - const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || []; - const failedList = data.filter(item => String(item).includes('同步失败')); - if (failedList.length) { - this.$message({ - type: 'warning', - message: `同步完成:成功${data.length - failedList.length}条,失败${failedList.length}条。${failedList.join(';')}`, - duration: 8000, - }); - } else { - this.$message.success(`已同步${data.length}条付款申请`); + this.syncLoading = true; + try { + const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || []; + const failedList = data.filter(item => String(item).includes('同步失败')); + if (failedList.length) { + this.$message({ + type: 'warning', + message: `同步完成:成功${data.length - failedList.length}条,失败${failedList.length}条。${failedList.join(';')}`, + duration: 8000, + }); + } else { + this.$message.success(`已同步${data.length}条付款申请`); + } + this.loadTable(); + } finally { + this.syncLoading = false; } - this.loadTable(); }, async handleSyncResult() { - const data = this.unwrapData(await api.syncKingdeeResult()); - this.$message.success(data || '金蝶付款结果回写完成'); - this.loadTable(); + if (this.resultSyncing) return; + this.resultSyncing = true; + try { + const data = this.unwrapData(await api.syncKingdeeResult()); + this.$message.success(data || '金蝶付款结果回写完成'); + this.loadTable(); + } finally { + this.resultSyncing = false; + } }, handleExport() { const headers = this.columns.map(item => item.label);