Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f067518c0e | |||
| 11460f3378 |
@@ -20,6 +20,8 @@ export const syncKingdee = id =>
|
||||
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } });
|
||||
export const syncKingdeeBatch = 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 = [
|
||||
{ label: '项目预付', value: 'project_advance' },
|
||||
@@ -36,5 +38,8 @@ export const approvalStatusOptions = [
|
||||
export const kingdeeStatusOptions = [
|
||||
{ label: '未生成', value: 'unsynced' },
|
||||
{ label: '已生成', value: 'synced' },
|
||||
{ label: '付款中', value: 'paying' },
|
||||
{ label: '已付款', value: 'paid' },
|
||||
{ label: '已关闭', value: 'closed' },
|
||||
{ label: '生成失败', value: 'failed' },
|
||||
];
|
||||
|
||||
@@ -84,6 +84,13 @@
|
||||
@click="handleSync"
|
||||
>批量同步</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="hasPermission('payment_application_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleSyncResult"
|
||||
>同步付款结果</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="hasPermission('payment_application_add')"
|
||||
type="primary"
|
||||
@@ -396,8 +403,22 @@ export default {
|
||||
this.$message.warning('请选择至少一条审批通过的付款申请');
|
||||
return;
|
||||
}
|
||||
await api.syncKingdeeBatch(rows.map(row => row.id));
|
||||
this.$message.success(`已同步${rows.length}条付款申请`);
|
||||
const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || [];
|
||||
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();
|
||||
},
|
||||
handleExport() {
|
||||
|
||||
Reference in New Issue
Block a user