From ec56ee07bea071f5a31776f3fa12d31a9e0d5712 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:08:01 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=AD=A3=E5=BC=8F=E7=BB=93=E7=AE=97?=
=?UTF-8?q?=E3=80=81=E5=AE=A2=E5=95=86=E6=A1=A3=E6=A1=88=E9=87=91=E8=9D=B6?=
=?UTF-8?q?=E6=8E=A8=E9=80=81=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E9=98=B2?=
=?UTF-8?q?=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
---
.../formal-settlement-table-panel.vue | 2 +
src/views/settlement/formal-settlement.vue | 17 +++++--
src/views/vehicle/customer-archive.vue | 46 +++++++++++--------
3 files changed, 43 insertions(+), 22 deletions(-)
diff --git a/src/views/settlement/components/formal-settlement-table-panel.vue b/src/views/settlement/components/formal-settlement-table-panel.vue
index 63a5859..b65a6c3 100644
--- a/src/views/settlement/components/formal-settlement-table-panel.vue
+++ b/src/views/settlement/components/formal-settlement-table-panel.vue
@@ -21,6 +21,7 @@
type="primary"
plain
:disabled="selection.length !== 1"
+ :loading="syncLoading"
@click="$emit('sync')"
>同步金蝶
@@ -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 },
},
diff --git a/src/views/settlement/formal-settlement.vue b/src/views/settlement/formal-settlement.vue
index 985e1a0..7c1d109 100644
--- a/src/views/settlement/formal-settlement.vue
+++ b/src/views/settlement/formal-settlement.vue
@@ -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('请至少选择一条正式结算单');
diff --git a/src/views/vehicle/customer-archive.vue b/src/views/vehicle/customer-archive.vue
index d9170c6..81186b1 100644
--- a/src/views/vehicle/customer-archive.vue
+++ b/src/views/vehicle/customer-archive.vue
@@ -188,6 +188,7 @@
- 同步金蝶
+ {{ kingdeeSyncingId === row.id ? '推送中…' : '同步金蝶' }}
syncKingdee(row.id))
- .then(res => {
- const archive = res?.data?.data || {};
- if (archive.kingdeeStatus === 'synced') {
- this.$message.success('推送成功,金蝶客户编码与客商编号一致');
- } else if (archive.kingdeeStatus === 'exist') {
- this.$message.info('金蝶已有该客商档案,无需推送');
- } else {
- this.$message.warning(`推送失败:${archive.kingdeeFailReason || '未知原因'}`);
- }
- this.onLoad(this.page);
+ async handleSyncKingdee(row) {
+ if (this.kingdeeSyncingId) return;
+ try {
+ await this.$confirm('是否确认推送金蝶?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
});
+ } catch (exception) {
+ return;
+ }
+ this.kingdeeSyncingId = row.id;
+ try {
+ const res = await syncKingdee(row.id);
+ const archive = res?.data?.data || {};
+ if (archive.kingdeeStatus === 'synced') {
+ this.$message.success('推送成功,金蝶客户编码与客商编号一致');
+ } else if (archive.kingdeeStatus === 'exist') {
+ this.$message.info('金蝶已有该客商档案,无需推送');
+ } else {
+ this.$message.warning(`推送失败:${archive.kingdeeFailReason || '未知原因'}`);
+ }
+ this.onLoad(this.page);
+ } finally {
+ this.kingdeeSyncingId = null;
+ }
},
handleReject(row) {
this.$confirm('是否确认审核不通过?', '提示', {