|
@@ -0,0 +1,123 @@
|
|
1
|
+import React, { useMemo, useRef, 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
|
+import { useEffect } from 'react'
|
|
8
|
+
|
|
9
|
+const searchFields = [
|
|
10
|
+ {
|
|
11
|
+ name: 'name',
|
|
12
|
+ label: '姓名',
|
|
13
|
+ placeholder: '请输入客户姓名',
|
|
14
|
+ },
|
|
15
|
+ {
|
|
16
|
+ name: 'phone',
|
|
17
|
+ label: '手机号',
|
|
18
|
+ placeholder: '请输入客户手机号',
|
|
19
|
+ },
|
|
20
|
+]
|
|
21
|
+
|
|
22
|
+export default (props) => {
|
|
23
|
+ const { history } = props
|
|
24
|
+ const { recommendPerson } = history.location.query
|
|
25
|
+
|
|
26
|
+ const ref = useRef()
|
|
27
|
+ const [notQuery, setNotQuery] = useState(true);
|
|
28
|
+
|
|
29
|
+ const tableColumns = [
|
|
30
|
+ {
|
|
31
|
+ title: '姓名',
|
|
32
|
+ dataIndex: 'name',
|
|
33
|
+ key: 'name',
|
|
34
|
+ },
|
|
35
|
+ {
|
|
36
|
+ title: '手机号',
|
|
37
|
+ dataIndex: 'phone',
|
|
38
|
+ key: 'phone',
|
|
39
|
+ },
|
|
40
|
+ {
|
|
41
|
+ title: '归属楼盘',
|
|
42
|
+ dataIndex: 'buildingName',
|
|
43
|
+ key: 'buildingName',
|
|
44
|
+ },
|
|
45
|
+ {
|
|
46
|
+ title: '客户状态',
|
|
47
|
+ dataIndex: 'status',
|
|
48
|
+ key: 'status',
|
|
49
|
+ render: (_, row) => {
|
|
50
|
+ if (!row.status || row.status <= 1) {
|
|
51
|
+ return '待审核';
|
|
52
|
+ } else if (row.status === 3) {
|
|
53
|
+ return '驳回';
|
|
54
|
+ } else {
|
|
55
|
+ if (!row.commission_date) {
|
|
56
|
+ return '结佣';
|
|
57
|
+ }
|
|
58
|
+ if (!row.signed_date) {
|
|
59
|
+ return '签约';
|
|
60
|
+ }
|
|
61
|
+ if (!row.preparatory_date) {
|
|
62
|
+ return '认筹';
|
|
63
|
+ }
|
|
64
|
+ if (!row.visit_date) {
|
|
65
|
+ return '到访';
|
|
66
|
+ }
|
|
67
|
+ }
|
|
68
|
+
|
|
69
|
+ return '未知';
|
|
70
|
+ }
|
|
71
|
+ },
|
|
72
|
+ {
|
|
73
|
+ title: '佣金总数',
|
|
74
|
+ dataIndex: 'totalCommission',
|
|
75
|
+ key: 'totalCommission',
|
|
76
|
+ align: 'right',
|
|
77
|
+ width: 120,
|
|
78
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
79
|
+ },
|
|
80
|
+ {
|
|
81
|
+ title: '已结佣金',
|
|
82
|
+ dataIndex: 'settledCommission',
|
|
83
|
+ key: 'settledCommission',
|
|
84
|
+ align: 'right',
|
|
85
|
+ width: 120,
|
|
86
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
87
|
+ },
|
|
88
|
+ {
|
|
89
|
+ title: '待结佣金',
|
|
90
|
+ dataIndex: 'unsettledCommission',
|
|
91
|
+ key: 'unsettledCommission',
|
|
92
|
+ align: 'right',
|
|
93
|
+ width: 120,
|
|
94
|
+ render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
|
|
95
|
+ },
|
|
96
|
+ {
|
|
97
|
+ title: '时间',
|
|
98
|
+ dataIndex: 'createDate',
|
|
99
|
+ key: 'createDate',
|
|
100
|
+ align: 'center',
|
|
101
|
+ render: (t) => moment(t).format('YYYY-MM-DD HH:mm')
|
|
102
|
+ },
|
|
103
|
+ ]
|
|
104
|
+
|
|
105
|
+ useEffect(() => {
|
|
106
|
+ setNotQuery(!recommendPerson);
|
|
107
|
+
|
|
108
|
+ if (!recommendPerson) {
|
|
109
|
+ notification.warning({ message: "请设置经纪人" })
|
|
110
|
+ }
|
|
111
|
+ }, [recommendPerson])
|
|
112
|
+
|
|
113
|
+ return (
|
|
114
|
+ <QueryTable
|
|
115
|
+ ref={ref}
|
|
116
|
+ rowKey="channelCustomerId"
|
|
117
|
+ api={apis.broker.getCustomerList}
|
|
118
|
+ searchFields={searchFields}
|
|
119
|
+ columns={tableColumns}
|
|
120
|
+ params={{ recommendPerson }}
|
|
121
|
+ />
|
|
122
|
+ )
|
|
123
|
+}
|