approval-columns.tsx
2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { UTag } from '@uj/ui';
import type { DataTableColumnsType } from '@/components';
import type { ApprovalRow } from '@/api';
import { APPROVAL_STATUS, statusMeta } from '@/features/shared/dictionaries';
import { dateTimeOr, numberOr, textOr } from '@/features/shared/format';
/**
* 列顺序、标题与宽度逐字对齐老系统 approve.vue 的 tableColumns(15 列)。
* 状态一列老系统用的是 constants.tableStatus(审批七个状态),与筛选项的 statusList 同一份字典,
* 这里也用 APPROVAL_STATUS 一处维护。
*/
export function buildApprovalColumns(): DataTableColumnsType<ApprovalRow> {
return [
{ title: '批次号', dataIndex: 'batchNo', width: 120, render: (value) => textOr(value) },
{
title: '客户数量',
dataIndex: 'customerCount',
width: 110,
render: (value) => numberOr(value),
},
{ title: '积分总额', dataIndex: 'pointTotal', width: 110, render: (value) => numberOr(value) },
{
title: '付款总额/元',
dataIndex: 'paymentTotal',
width: 120,
render: (value) => numberOr(value),
},
{
title: '付款渠道',
dataIndex: 'paymentChannel',
width: 200,
render: (value) => textOr(value),
},
{
title: '付款主体',
dataIndex: 'paymentSubject',
width: 200,
render: (value) => textOr(value),
},
{
title: '代征主体',
dataIndex: 'channelAccount',
width: 200,
// 老系统这列读的是行对象里嵌套的 channelAccount.levyName,没有就显示占位符。
render: (_value, row) => textOr(row.channelAccount?.levyName),
},
{
title: '状态',
dataIndex: 'status',
width: 140,
render: (value) => {
const meta = statusMeta(APPROVAL_STATUS, value);
return meta ? <UTag color={meta.color}>{meta.label}</UTag> : textOr(value);
},
},
{
title: '批次生成时间',
dataIndex: 'createdDate',
width: 180,
render: (value) => dateTimeOr(value),
},
{ title: '审批人', dataIndex: 'approver', width: 150, render: (value) => textOr(value) },
{
title: '审批时间',
dataIndex: 'approvalTime',
width: 180,
render: (value) => dateTimeOr(value),
},
{ title: 'OA审批编号', dataIndex: 'oaSpNo', width: 200, render: (value) => textOr(value) },
{
title: 'OA审批时间',
dataIndex: 'oaApprovalTime',
width: 180,
render: (value) => dateTimeOr(value),
},
{
title: '渠道到账时间',
dataIndex: 'channelSettleTime',
width: 180,
render: (value) => dateTimeOr(value),
},
{
title: '用户到账时间',
dataIndex: 'userSettleTime',
width: 180,
render: (value) => dateTimeOr(value),
},
];
}