|
@@ -0,0 +1,154 @@
|
|
1
|
+import React, { useState } from 'react';
|
|
2
|
+import { Avatar, Modal } from 'antd';
|
|
3
|
+import apis from '../../../services/apis';
|
|
4
|
+import moment from 'moment';
|
|
5
|
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
|
|
6
|
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
|
|
7
|
+import QueryTable from '@/components/QueryTable';
|
|
8
|
+import DealDetail from './detail';
|
|
9
|
+
|
|
10
|
+function costomerDrift(props) {
|
|
11
|
+ const [visible, setVisible] = useState(false);
|
|
12
|
+ const [detail, setDetail] = useState({});
|
|
13
|
+ const columns = [
|
|
14
|
+ {
|
|
15
|
+ title: '头像',
|
|
16
|
+ dataIndex: 'picture',
|
|
17
|
+ key: 'picture',
|
|
18
|
+ align: 'center',
|
|
19
|
+ render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
|
|
20
|
+ },
|
|
21
|
+ {
|
|
22
|
+ title: '姓名',
|
|
23
|
+ dataIndex: 'name',
|
|
24
|
+ key: 'name',
|
|
25
|
+ align: 'center',
|
|
26
|
+ },
|
|
27
|
+ {
|
|
28
|
+ title: '电话',
|
|
29
|
+ dataIndex: 'phone',
|
|
30
|
+ key: 'phone',
|
|
31
|
+ align: 'center',
|
|
32
|
+ },
|
|
33
|
+
|
|
34
|
+ {
|
|
35
|
+ title: '性别',
|
|
36
|
+ dataIndex: 'sex',
|
|
37
|
+ key: 'sex',
|
|
38
|
+ align: 'center',
|
|
39
|
+ // eslint-disable-next-line no-nested-ternary
|
|
40
|
+ render: (_, record) => (
|
|
41
|
+ <>
|
|
42
|
+ <span>{record.sex === '1' ? '男' : record.sex === '2' ? '女' : '未知'}</span>
|
|
43
|
+ </>
|
|
44
|
+ ),
|
|
45
|
+ },
|
|
46
|
+ {
|
|
47
|
+ title: '所属项目',
|
|
48
|
+ dataIndex: 'buildingName',
|
|
49
|
+ key: 'buildingName',
|
|
50
|
+ align: 'center',
|
|
51
|
+ },
|
|
52
|
+ {
|
|
53
|
+ title: '成交金额',
|
|
54
|
+ dataIndex: 'price',
|
|
55
|
+ key: 'price',
|
|
56
|
+ align: 'center',
|
|
57
|
+ },
|
|
58
|
+ {
|
|
59
|
+ title: '备注',
|
|
60
|
+ dataIndex: 'remark',
|
|
61
|
+ key: 'remark',
|
|
62
|
+ align: 'center',
|
|
63
|
+ width: 200,
|
|
64
|
+ },
|
|
65
|
+ {
|
|
66
|
+ title: '签约日期',
|
|
67
|
+ dataIndex: 'createDate',
|
|
68
|
+ key: 'createDate',
|
|
69
|
+ align: 'center',
|
|
70
|
+ render: t => moment(t).format('YYYY-MM-DD HH:mm:ss'),
|
|
71
|
+ },
|
|
72
|
+ {
|
|
73
|
+ title: '状态',
|
|
74
|
+ dataIndex: 'type',
|
|
75
|
+ key: 'type',
|
|
76
|
+ align: 'center',
|
|
77
|
+ render: t => t=='signatory'?'签约':t=='commission'?'结佣':'--'
|
|
78
|
+
|
|
79
|
+ },
|
|
80
|
+ {
|
|
81
|
+ title: '操作',
|
|
82
|
+ dataIndex: 'edit',
|
|
83
|
+ key: 'edit',
|
|
84
|
+ align: 'center',
|
|
85
|
+ render: (_, record) => (
|
|
86
|
+ <>
|
|
87
|
+ <a
|
|
88
|
+ onClick={() => {
|
|
89
|
+ setDetail(record), setVisible(true);
|
|
90
|
+ }}
|
|
91
|
+ >
|
|
92
|
+ 查看详情
|
|
93
|
+ </a>
|
|
94
|
+ </>
|
|
95
|
+ ),
|
|
96
|
+ },
|
|
97
|
+ ];
|
|
98
|
+
|
|
99
|
+ const searchFields = [
|
|
100
|
+ {
|
|
101
|
+ name: 'buildingId',
|
|
102
|
+ label: '项目',
|
|
103
|
+ placeholder: '请选择项目',
|
|
104
|
+ render: () => <BuildingSelect style={{ width: 160 }} />,
|
|
105
|
+ },
|
|
106
|
+ {
|
|
107
|
+ name: 'name',
|
|
108
|
+ label: '姓名',
|
|
109
|
+ placeholder: '请输入姓名',
|
|
110
|
+ },
|
|
111
|
+ {
|
|
112
|
+ name: 'phone',
|
|
113
|
+ label: '电话',
|
|
114
|
+ placeholder: '请输入电话',
|
|
115
|
+ },
|
|
116
|
+ {
|
|
117
|
+ name: 'type',
|
|
118
|
+ label: '状态',
|
|
119
|
+ placeholder: '请选择状态',
|
|
120
|
+ type: 'select',
|
|
121
|
+ options: [
|
|
122
|
+ { label: '全部', value: '' },
|
|
123
|
+ { label: '签约', value: 'signatory' },
|
|
124
|
+ { label: '结佣', value: 'commission' },
|
|
125
|
+ ],
|
|
126
|
+ },
|
|
127
|
+ ];
|
|
128
|
+ // pageNum=1&pageSize=10&buildingId=&name=&phone=&type=
|
|
129
|
+ return (
|
|
130
|
+ <>
|
|
131
|
+ <QueryTable
|
|
132
|
+ rowKey="customerSignatoryId"
|
|
133
|
+ api={apis.customer.getDealList}
|
|
134
|
+ searchFields={searchFields}
|
|
135
|
+ columns={columns}
|
|
136
|
+ />
|
|
137
|
+ <Modal
|
|
138
|
+ title='客户详情'
|
|
139
|
+ visible={visible}
|
|
140
|
+ onOk={() => {
|
|
141
|
+ setVisible(false);
|
|
142
|
+ }}
|
|
143
|
+ onCancel={() => {
|
|
144
|
+ setVisible(false);
|
|
145
|
+ }}
|
|
146
|
+ footer={null}
|
|
147
|
+ >
|
|
148
|
+ <DealDetail detail={detail} />
|
|
149
|
+ </Modal>
|
|
150
|
+ </>
|
|
151
|
+ );
|
|
152
|
+}
|
|
153
|
+
|
|
154
|
+export default costomerDrift;
|