fix
This commit is contained in:
@@ -75,7 +75,11 @@
|
||||
{{ displayValue(row[column.prop]) }}
|
||||
</el-link>
|
||||
<span v-else-if="column.link">{{ displayValue(row[column.prop]) }}</span>
|
||||
<el-tag v-else-if="column.status" :type="statusType(row.claimStatus)" class="status-text">
|
||||
<el-tag
|
||||
v-else-if="column.status"
|
||||
:type="statusType(row.claimStatus)"
|
||||
class="status-text"
|
||||
>
|
||||
{{ displayValue(row[column.prop]) }}
|
||||
</el-tag>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
@@ -109,7 +113,7 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/receiptFlow';
|
||||
import { receiptFlowTableColumns } from '@/option/payment/receiptFlow';
|
||||
|
||||
const receiptFlowMockRows = [
|
||||
const receiptFlowMockTemplates = [
|
||||
{
|
||||
receiptNoticeNo: 'SKTZ20260827001',
|
||||
payerName: '华东供应链管理有限公司',
|
||||
@@ -136,6 +140,34 @@ const receiptFlowMockRows = [
|
||||
},
|
||||
];
|
||||
|
||||
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 = () =>
|
||||
receiptFlowMockTemplates.map((template, index) => {
|
||||
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: '',
|
||||
@@ -210,9 +242,8 @@ export default {
|
||||
async handleSync() {
|
||||
this.syncing = true;
|
||||
try {
|
||||
const syncedCount = Number(
|
||||
this.unwrapData(await api.sync({ flows: receiptFlowMockRows })) || 0
|
||||
);
|
||||
const mockRows = createReceiptFlowMockRows();
|
||||
const syncedCount = Number(this.unwrapData(await api.sync({ flows: mockRows })) || 0);
|
||||
this.$message.success(`流水同步完成,共同步${syncedCount}条`);
|
||||
await this.loadTable();
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user