feat: 正式结算、客商档案金蝶推送按钮增加防重复点击
This commit is contained in:
@@ -188,6 +188,7 @@
|
||||
</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
:disabled="kingdeeSyncingId === row.id"
|
||||
v-if="
|
||||
hasPermission('customer_archive_sync') &&
|
||||
row.approvalStatus === 'approved' &&
|
||||
@@ -195,7 +196,7 @@
|
||||
"
|
||||
@click="handleSyncKingdee(row)"
|
||||
>
|
||||
同步金蝶
|
||||
{{ kingdeeSyncingId === row.id ? '推送中…' : '同步金蝶' }}
|
||||
</el-link>
|
||||
<el-link
|
||||
type="danger"
|
||||
@@ -1669,6 +1670,7 @@ export default {
|
||||
archiveForm: this.emptyArchive(),
|
||||
kingdeeBlocked: false,
|
||||
kingdeeQueryTimer: null,
|
||||
kingdeeSyncingId: null,
|
||||
currentScore: { details: [] },
|
||||
scoreRecordIndex: -1,
|
||||
scoreAttachmentFiles: [],
|
||||
@@ -5102,24 +5104,32 @@ export default {
|
||||
this.$message({ type: 'success', message: '审核通过!' });
|
||||
});
|
||||
},
|
||||
handleSyncKingdee(row) {
|
||||
this.$confirm('是否确认推送金蝶?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => 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('是否确认审核不通过?', '提示', {
|
||||
|
||||
Reference in New Issue
Block a user