approvalTransfer.tsx
3.53 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import { UTag } from '@uj/ui';
import type { DataTableColumnsType, FieldSchema } from '@/components';
import type { WithdrawRow } from '@/api';
import { PAY_MODE, TRANSFER_STATUS, optionLabel, statusMeta } from './dictionaries';
import { centsToYuan, dateTimeOr, numberOr, textOr } from './format';
/** 批次编辑与到账明细两个子页面的筛选项,老系统两处是同一份两个输入框。 */
export const APPROVAL_TRANSFER_FIELDS: FieldSchema<Record<string, unknown>>[] = [
{
name: 'customerName',
label: '客户名称',
type: 'input',
placeholder: '请输入客户名称',
inputProps: { maxLength: 20 },
},
{
name: 'customerPhone',
label: '手机号',
type: 'input',
placeholder: '请输入手机号',
inputProps: { maxLength: 11 },
},
];
/**
* 批次内提现记录的列(老系统 approveEdit.vue 与 approveDetail.vue 各抄了一遍同样的 12 列)。
* 到账明细页在这 12 列前面加「提现单号」、后面加「到账情况」与「到账时间」,其余逐字相同。
*/
export function buildApprovalTransferColumns(
kind: 'batch' | 'arrival',
): DataTableColumnsType<WithdrawRow> {
const shared: DataTableColumnsType<WithdrawRow> = [
{ title: '客户名称', dataIndex: 'customerName', width: 150, render: (value) => textOr(value) },
{
title: '提现方式',
dataIndex: 'mode',
width: 200,
render: (value) => optionLabel(PAY_MODE, value) || '—',
},
{
title: '手机号',
dataIndex: 'customerPhone',
width: 140,
render: (value) => <span className="uj-code">{textOr(value)}</span>,
},
{
title: '所属门店',
dataIndex: 'merchantName',
line: 1,
width: 150,
render: (value) => textOr(value),
},
{
title: '提现积分',
dataIndex: 'integralAmount',
width: 100,
render: (value) => numberOr(value),
},
{
title: '提现金额/元',
dataIndex: 'payAmount',
width: 110,
render: (value) => centsToYuan(value),
},
{
title: '提现时间',
dataIndex: 'createdDate',
width: 180,
render: (value) => dateTimeOr(value),
},
{ title: '收款人姓名', dataIndex: 'name', width: 110, render: (value) => textOr(value) },
{
title: '收款人身份证',
dataIndex: 'idCardNo',
width: 180,
render: (value) => <span className="uj-code">{textOr(value)}</span>,
},
{
title: '收款银行卡号',
dataIndex: 'recvBankCardNo',
width: 230,
render: (value) => <span className="uj-code">{textOr(value)}</span>,
},
{
title: '收款银行',
dataIndex: 'recvBank',
line: 1,
width: 150,
render: (value) => textOr(value),
},
{
title: '收款手机号',
dataIndex: 'mobile',
width: 130,
render: (value) => <span className="uj-code">{textOr(value)}</span>,
},
];
if (kind === 'batch') return shared;
return [
{
title: '提现单号',
dataIndex: 'outSettleOrderId',
width: 200,
render: (value) => <span className="uj-code">{textOr(value)}</span>,
},
...shared,
{
title: '到账情况',
dataIndex: 'status',
width: 200,
render: (value) => {
const meta = statusMeta(TRANSFER_STATUS, value);
return meta ? <UTag color={meta.color}>{meta.label}</UTag> : textOr(value);
},
},
{
title: '到账时间',
dataIndex: 'receiptDate',
width: 180,
render: (value) => dateTimeOr(value),
},
];
}