feat: 付款申请、开票申请、收票登记金蝶按钮增加防重复点击
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
v-if="hasPermission('invoice_application_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="batchSyncing"
|
||||
@click="handleBatchSync"
|
||||
>批量同步</el-button
|
||||
>
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user