index.tsx
2.52 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
import { RESPONSE_CODE } from '@/constants/enum';
import { postProcureBillPage } from '@/services';
import { DownOutlined } from '@ant-design/icons';
import { ProTable } from '@ant-design/pro-components';
import { Button } from 'antd';
export default () => {
const columns = [
{
title: '创建时间',
dataIndex: 'createTime',
ellipsis: true,
width: 180,
hideInSearch: true,
},
{
title: '创建人',
dataIndex: 'createByName',
ellipsis: true,
width: 180,
hideInSearch: true,
},
{
title: '总金额',
dataIndex: 'totalAmount',
ellipsis: true,
width: 180,
hideInSearch: true,
},
{
title: '审核状态',
dataIndex: 'auditStatusText',
ellipsis: true,
width: 180,
hideInSearch: true,
},
{
title: '审核备注',
dataIndex: 'auditNotes',
ellipsis: true,
width: 180,
hideInSearch: true,
},
{
title: '备注',
dataIndex: 'notes',
ellipsis: true,
width: 180,
hideInSearch: true,
},
];
return (
<ProTable
columns={columns}
request={async (params) => {
const res = await postProcureBillPage({
data: {
...params,
},
});
if (res.result === RESPONSE_CODE.SUCCESS) {
return {
data: res?.data?.data,
total: res?.data?.total || 0,
};
}
return {
data: [],
success: false,
};
}}
rowKey="id"
pagination={{
showQuickJumper: true,
}}
expandable={{
expandedRowRender: (record) => (
<ProTable
columns={[
{ title: '商品名称', dataIndex: 'totalPrice', key: 'totalPrice' },
{ title: '数量', dataIndex: 'number', key: 'number' },
{ title: '备注', dataIndex: 'notes', key: 'notes' },
]}
headerTitle={false}
search={false}
options={false}
dataSource={record.procureBillDetailList}
pagination={false}
/>
),
}}
search={false}
dateFormatter="string"
headerTitle="嵌套表格"
options={false}
toolBarRender={() => [
<Button key="show">查看日志</Button>,
<Button key="out">
导出数据
<DownOutlined />
</Button>,
<Button key="primary" type="primary">
创建应用
</Button>,
]}
/>
);
};