feat: 正式结算、客商档案金蝶推送按钮增加防重复点击

This commit is contained in:
刘泉佳
2026-09-24 05:08:01 +08:00
parent a5eeda6152
commit ec56ee07be
3 changed files with 43 additions and 22 deletions
@@ -21,6 +21,7 @@
type="primary"
plain
:disabled="selection.length !== 1"
:loading="syncLoading"
@click="$emit('sync')"
>同步金蝶</el-button
>
@@ -132,6 +133,7 @@ export default {
rows: { type: Array, default: () => [] },
columns: { type: Array, default: () => [] },
loading: { type: Boolean, default: false },
syncLoading: { type: Boolean, default: false },
page: { type: Object, required: true },
hasPermission: { type: Function, required: true },
},
+13 -4
View File
@@ -64,6 +64,7 @@
:loading="loading"
:page="page"
:has-permission="hasPermissionFn"
:sync-loading="syncLoading"
@create="openCreate"
@payment="openPaymentDialog"
@sync="handleSync"
@@ -82,6 +83,7 @@
:loading="loading"
:page="page"
:has-permission="hasPermissionFn"
:sync-loading="syncLoading"
@create="openCreate"
@payment="openPaymentDialog"
@sync="handleSync"
@@ -215,6 +217,7 @@ export default {
rows: [],
selection: [],
loading: false,
syncLoading: false,
page: { current: 1, size: 10, total: 0 },
editor: { visible: false, id: null, readonly: false },
paymentDialog: {
@@ -381,12 +384,18 @@ export default {
return this.selection[0];
},
async handleSync() {
if (this.syncLoading) return;
const row = this.selectedOne('同步金蝶');
if (!row) return;
const response = await api.syncKingdee(row.id);
const data = this.unwrapData(response);
this.$message.success(`同步成功,金蝶单据号:${data}`);
this.loadTable();
this.syncLoading = true;
try {
const response = await api.syncKingdee(row.id);
const data = this.unwrapData(response);
this.$message.success(`同步成功,金蝶单据号:${data}`);
this.loadTable();
} finally {
this.syncLoading = false;
}
},
async openPaymentDialog() {
if (!this.selection.length) return this.$message.warning('请至少选择一条正式结算单');