fix: 付款管理批量同步增加遮罩并统一金蝶接口30s超时常量

This commit is contained in:
刘泉佳
2026-11-02 17:15:50 +08:00
parent f5735e6bad
commit daab1001db
2 changed files with 10 additions and 3 deletions
+3 -3
View File
@@ -27,13 +27,13 @@ export const returnBill = data => request({ url: `${baseUrl}/return`, method: 'p
export const voidBill = data => request({ url: `${baseUrl}/void`, method: 'post', data });
// 同步金蝶涉及多次金蝶远程接口调用(A103-2 预检 + A103-1/A103-3 推送),单笔可达 20s+,覆盖全局 10s 超时
export const syncKingdee = id =>
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', timeout: 30000, params: { id } });
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', timeout: APPROVE_TIMEOUT, params: { id } });
// 批量同步逐单单据级事务串行推送,耗时随单量线性增长
export const syncKingdeeBatch = ids =>
request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', timeout: 30000, data: ids });
request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', timeout: APPROVE_TIMEOUT, data: ids });
// 回写任务按 paymentNo 分批远程查询 A103-2/A103-4,同样可能超过全局超时
export const syncKingdeeResult = () =>
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post', timeout: 30000 });
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post', timeout: APPROVE_TIMEOUT });
export const paymentTypeOptions = [
{ label: '项目预付', value: 'project_advance' },
@@ -409,6 +409,12 @@ export default {
return;
}
this.syncLoading = true;
// 批量同步金蝶逐单串行推送耗时较长,加遮罩防重复操作(照审批通过遮罩)
const loading = this.$loading({
lock: true,
text: '正在批量同步金蝶,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
});
try {
const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || [];
const failedList = data.filter(item => String(item).includes('同步失败'));
@@ -425,6 +431,7 @@ export default {
this.warnAttachmentNotUploaded(rows.map(row => row.id));
} finally {
this.syncLoading = false;
loading.close();
}
},
// 附件联带同步提示:同步成功但附件未全部上传时追加 warning,重推即自动补传