2 Commits

Author SHA1 Message Date
刘泉佳 f067518c0e fix: 付款申请批量同步金蝶失败时展示失败原因
- 批量同步后解析返回结果,按"同步失败"标识区分成功与失败条目
- 部分失败时以 warning 提示成功/失败条数及具体失败原因(停留8秒),全部成功仍提示已同步条数
2026-09-18 11:58:00 +08:00
刘泉佳 11460f3378 付款管理新增同步付款结果按钮并扩展金蝶单据状态选项 2026-09-18 11:57:59 +08:00
2 changed files with 28 additions and 2 deletions
+5
View File
@@ -20,6 +20,8 @@ export const syncKingdee = id =>
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } }); request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } });
export const syncKingdeeBatch = ids => export const syncKingdeeBatch = ids =>
request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', data: ids }); request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', data: ids });
export const syncKingdeeResult = () =>
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post' });
export const paymentTypeOptions = [ export const paymentTypeOptions = [
{ label: '项目预付', value: 'project_advance' }, { label: '项目预付', value: 'project_advance' },
@@ -36,5 +38,8 @@ export const approvalStatusOptions = [
export const kingdeeStatusOptions = [ export const kingdeeStatusOptions = [
{ label: '未生成', value: 'unsynced' }, { label: '未生成', value: 'unsynced' },
{ label: '已生成', value: 'synced' }, { label: '已生成', value: 'synced' },
{ label: '付款中', value: 'paying' },
{ label: '已付款', value: 'paid' },
{ label: '已关闭', value: 'closed' },
{ label: '生成失败', value: 'failed' }, { label: '生成失败', value: 'failed' },
]; ];
+23 -2
View File
@@ -84,6 +84,13 @@
@click="handleSync" @click="handleSync"
>批量同步</el-button >批量同步</el-button
> >
<el-button
v-if="hasPermission('payment_application_sync')"
type="primary"
plain
@click="handleSyncResult"
>同步付款结果</el-button
>
<el-button <el-button
v-if="hasPermission('payment_application_add')" v-if="hasPermission('payment_application_add')"
type="primary" type="primary"
@@ -396,8 +403,22 @@ export default {
this.$message.warning('请选择至少一条审批通过的付款申请'); this.$message.warning('请选择至少一条审批通过的付款申请');
return; return;
} }
await api.syncKingdeeBatch(rows.map(row => row.id)); const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || [];
this.$message.success(`已同步${rows.length}条付款申请`); const failedList = data.filter(item => String(item).includes('同步失败'));
if (failedList.length) {
this.$message({
type: 'warning',
message: `同步完成:成功${data.length - failedList.length}条,失败${failedList.length}条。${failedList.join('')}`,
duration: 8000,
});
} else {
this.$message.success(`已同步${data.length}条付款申请`);
}
this.loadTable();
},
async handleSyncResult() {
const data = this.unwrapData(await api.syncKingdeeResult());
this.$message.success(data || '金蝶付款结果回写完成');
this.loadTable(); this.loadTable();
}, },
handleExport() { handleExport() {