feat: 收款认领页直连A301-2公告同步并支持A301-1认领结果查询回写
This commit is contained in:
@@ -80,6 +80,11 @@
|
||||
</section-card>
|
||||
|
||||
<section class="claim-record-page__table-panel">
|
||||
<div class="claim-record-page__toolbar">
|
||||
<el-button :loading="refreshing" @click="handleRefreshKingdeeResult">
|
||||
查询金蝶认领结果
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="rows" border>
|
||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||
<el-table-column
|
||||
@@ -167,6 +172,7 @@ export default {
|
||||
columns: receiptClaimRecordTableColumns,
|
||||
rows: [],
|
||||
loading: false,
|
||||
refreshing: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
};
|
||||
},
|
||||
@@ -237,6 +243,16 @@ export default {
|
||||
this.$message.success(`作废成功,金蝶冲单号:${kingdeeBillNo}`);
|
||||
await this.loadTable();
|
||||
},
|
||||
async handleRefreshKingdeeResult() {
|
||||
this.refreshing = true;
|
||||
try {
|
||||
const updated = Number(this.unwrapData(await api.queryKingdeeResult()) || 0);
|
||||
this.$message.success(`金蝶认领结果回写完成,更新${updated}条`);
|
||||
await this.loadTable();
|
||||
} finally {
|
||||
this.refreshing = false;
|
||||
}
|
||||
},
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission?.[code], false);
|
||||
},
|
||||
@@ -281,6 +297,13 @@ export default {
|
||||
.claim-record-page__table-panel {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.claim-record-page__toolbar {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.claim-record-page__pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@@ -194,64 +194,6 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/receiptFlow';
|
||||
import { receiptFlowTableColumns } from '@/option/payment/receiptFlow';
|
||||
|
||||
const receiptFlowMockTemplates = [
|
||||
{
|
||||
receiptNoticeNo: 'SKTZ20260827001',
|
||||
payerName: '华东供应链管理有限公司',
|
||||
receiptAmount: 48000,
|
||||
counterpartyName: '上海安捷运输有限公司',
|
||||
counterpartyAccount: '310000000000001001',
|
||||
counterpartyBank: '中国工商银行上海分行',
|
||||
summary: '运输服务款',
|
||||
transactionTime: '2026-08-27 09:30:00',
|
||||
detailSerialNo: 'MOCK-RF-20260827-001',
|
||||
sourceUpdatedTime: '2026-08-27 09:30:00',
|
||||
},
|
||||
{
|
||||
receiptNoticeNo: 'SKTZ20260827002',
|
||||
payerName: '华东供应链管理有限公司',
|
||||
receiptAmount: 26500,
|
||||
counterpartyName: '江苏联运物流有限公司',
|
||||
counterpartyAccount: '320100000000002002',
|
||||
counterpartyBank: '中国建设银行南京分行',
|
||||
summary: '物流服务款',
|
||||
transactionTime: '2026-08-27 13:45:00',
|
||||
detailSerialNo: 'MOCK-RF-20260827-002',
|
||||
sourceUpdatedTime: '2026-08-27 13:45:00',
|
||||
},
|
||||
];
|
||||
|
||||
const randomDigits = length =>
|
||||
Array.from({ length }, () => Math.floor(Math.random() * 10)).join('');
|
||||
|
||||
const formatMockDateTime = date => {
|
||||
const pad = value => String(value).padStart(2, '0');
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(
|
||||
date.getHours()
|
||||
)}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
||||
};
|
||||
|
||||
const createReceiptFlowMockRows = () => {
|
||||
const count = 20 + Math.floor(Math.random() * 31);
|
||||
return Array.from({ length: count }, (_, index) => {
|
||||
const template = receiptFlowMockTemplates[index % receiptFlowMockTemplates.length];
|
||||
const transactionDate = new Date();
|
||||
transactionDate.setDate(transactionDate.getDate() - Math.floor(Math.random() * 7));
|
||||
transactionDate.setHours(8 + Math.floor(Math.random() * 10), Math.floor(Math.random() * 60), 0);
|
||||
const transactionTime = formatMockDateTime(transactionDate);
|
||||
const dateCode = transactionTime.slice(0, 10).replaceAll('-', '');
|
||||
return {
|
||||
...template,
|
||||
receiptNoticeNo: `SKTZ${dateCode}${randomDigits(5)}`,
|
||||
receiptAmount: Math.floor(10000 + Math.random() * 90000),
|
||||
counterpartyAccount: `${template.counterpartyAccount.slice(0, -6)}${randomDigits(6)}`,
|
||||
transactionTime,
|
||||
detailSerialNo: `MOCK-RF-${dateCode}-${index + 1}${randomDigits(4)}`,
|
||||
sourceUpdatedTime: transactionTime,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const emptyQuery = () => ({
|
||||
receiptNoticeNo: '',
|
||||
counterpartyName: '',
|
||||
@@ -329,9 +271,8 @@ export default {
|
||||
async handleSync() {
|
||||
this.syncing = true;
|
||||
try {
|
||||
const mockRows = createReceiptFlowMockRows();
|
||||
const syncedCount = Number(this.unwrapData(await api.sync({ flows: mockRows })) || 0);
|
||||
this.$message.success(`流水同步完成,共同步${syncedCount}条`);
|
||||
const syncedCount = Number(this.unwrapData(await api.sync()) || 0);
|
||||
this.$message.success(`流水同步完成,共同步${syncedCount}条认领公告`);
|
||||
await this.loadTable();
|
||||
} finally {
|
||||
this.syncing = false;
|
||||
|
||||
Reference in New Issue
Block a user