|
@@ -0,0 +1,133 @@
|
|
1
|
+import React, { useMemo, useRef, useCallback, useState } from 'react'
|
|
2
|
+import { Button, notification, Spin, Badge, Select } from 'antd'
|
|
3
|
+import { router } from 'umi'
|
|
4
|
+import moment from 'moment'
|
|
5
|
+import QueryTable from '@/components/QueryTable'
|
|
6
|
+import { fetch, apis } from '@/utils/request';
|
|
7
|
+
|
|
8
|
+const searchFields = [
|
|
9
|
+ {
|
|
10
|
+ name: 'name',
|
|
11
|
+ label: '姓名',
|
|
12
|
+ placeholder: '请输入经纪人姓名',
|
|
13
|
+ },
|
|
14
|
+ {
|
|
15
|
+ name: 'phone',
|
|
16
|
+ label: '手机号',
|
|
17
|
+ placeholder: '请输入经纪人手机号',
|
|
18
|
+ },
|
|
19
|
+ {
|
|
20
|
+ name: 'recommendPersonName',
|
|
21
|
+ label: '推荐人',
|
|
22
|
+ placeholder: '请输入推荐人姓名',
|
|
23
|
+ },
|
|
24
|
+ {
|
|
25
|
+ name: 'sortOrder',
|
|
26
|
+ label: '排序规则',
|
|
27
|
+ render: () => (
|
|
28
|
+ <Select style={{ width: '160px' }} placeholder="请选择排序规则">
|
|
29
|
+ <Select.Option value="ASC">升序</Select.Option>
|
|
30
|
+ <Select.Option value="DESC">降序</Select.Option>
|
|
31
|
+ </Select>
|
|
32
|
+ )
|
|
33
|
+ },
|
|
34
|
+ {
|
|
35
|
+ name: 'sortField',
|
|
36
|
+ label: '排序字段',
|
|
37
|
+ render: () => (
|
|
38
|
+ <Select style={{ width: '160px' }} placeholder="请选择排序字段">
|
|
39
|
+ <Select.Option value="create_date">时间</Select.Option>
|
|
40
|
+ <Select.Option value="customer_num">客户数</Select.Option>
|
|
41
|
+ <Select.Option value="total_commission">佣金总数</Select.Option>
|
|
42
|
+ <Select.Option value="settled_commission">已结佣金</Select.Option>
|
|
43
|
+ <Select.Option value="unsettled_commission">待结佣金</Select.Option>
|
|
44
|
+ </Select>
|
|
45
|
+ )
|
|
46
|
+ },
|
|
47
|
+]
|
|
48
|
+
|
|
49
|
+export default (props) => {
|
|
50
|
+ const ref = useRef()
|
|
51
|
+
|
|
52
|
+ const tableColumns = [
|
|
53
|
+ {
|
|
54
|
+ title: '图片',
|
|
55
|
+ dataIndex: 'avatarurl',
|
|
56
|
+ key: 'avatarurl',
|
|
57
|
+ align: 'center',
|
|
58
|
+ render: (t) => {
|
|
59
|
+ return <img src={t} width={64} height={64} style={{borderRadius: '4px'}} alt="" />
|
|
60
|
+ }
|
|
61
|
+ },
|
|
62
|
+ {
|
|
63
|
+ title: '姓名',
|
|
64
|
+ dataIndex: 'name',
|
|
65
|
+ key: 'name',
|
|
66
|
+ render: (t, row) => row.name || row.nickname
|
|
67
|
+ },
|
|
68
|
+ {
|
|
69
|
+ title: '推荐人',
|
|
70
|
+ dataIndex: 'recommendPersonName',
|
|
71
|
+ key: 'recommendPersonName',
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ title: '客户数',
|
|
75
|
+ dataIndex: 'customerNum',
|
|
76
|
+ key: 'customerNum',
|
|
77
|
+ align: 'right',
|
|
78
|
+ width: 120,
|
|
79
|
+ },
|
|
80
|
+ {
|
|
81
|
+ title: '佣金总数',
|
|
82
|
+ dataIndex: 'totalCommission',
|
|
83
|
+ key: 'totalCommission',
|
|
84
|
+ align: 'right',
|
|
85
|
+ width: 120,
|
|
86
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
87
|
+ },
|
|
88
|
+ {
|
|
89
|
+ title: '已结佣金',
|
|
90
|
+ dataIndex: 'settledCommission',
|
|
91
|
+ key: 'settledCommission',
|
|
92
|
+ align: 'right',
|
|
93
|
+ width: 120,
|
|
94
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
95
|
+ },
|
|
96
|
+ {
|
|
97
|
+ title: '待结佣金',
|
|
98
|
+ dataIndex: 'unsettledCommission',
|
|
99
|
+ key: 'unsettledCommission',
|
|
100
|
+ align: 'right',
|
|
101
|
+ width: 120,
|
|
102
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
103
|
+ },
|
|
104
|
+ {
|
|
105
|
+ title: '时间',
|
|
106
|
+ dataIndex: 'createDate',
|
|
107
|
+ key: 'createDate',
|
|
108
|
+ align: 'center',
|
|
109
|
+ render: (t) => moment(t).format('YYYY-MM-DD HH:mm')
|
|
110
|
+ },
|
|
111
|
+ // {
|
|
112
|
+ // title: '操作',
|
|
113
|
+ // key: 'options',
|
|
114
|
+ // align: 'center',
|
|
115
|
+ // render: (_, row) => (
|
|
116
|
+ // <>
|
|
117
|
+ // <OperButton onClick={() => router.push(`/borker/announcement/edit?id=${row.screenId}`)}>详情</OperButton>
|
|
118
|
+ // <OperButton.Confirm title="确认进行操作?" color="#1890ff" onClick={() => onPublish(row)}>{row.status === 1 ? '取消发布' : '发布'}</OperButton.Confirm>
|
|
119
|
+ // </>
|
|
120
|
+ // )
|
|
121
|
+ // },
|
|
122
|
+ ]
|
|
123
|
+
|
|
124
|
+ return (
|
|
125
|
+ <QueryTable
|
|
126
|
+ ref={ref}
|
|
127
|
+ rowKey="personId"
|
|
128
|
+ api={apis.borker.getBorkerList}
|
|
129
|
+ searchFields={searchFields}
|
|
130
|
+ columns={tableColumns}
|
|
131
|
+ />
|
|
132
|
+ )
|
|
133
|
+}
|