|
@@ -1,590 +1,3 @@
|
1
|
|
-<<<<<<< HEAD
|
2
|
|
-import React, { useState, useEffect } from 'react';
|
3
|
|
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, message } from 'antd';
|
4
|
|
-import moment from 'moment';
|
5
|
|
-import request from '../../../utils/request';
|
6
|
|
-import apis from '../../../services/apis';
|
7
|
|
-import Styles from './style.less';
|
8
|
|
-import router from 'umi/router';
|
9
|
|
-
|
10
|
|
-import Attribution from './components/attribution'
|
11
|
|
-import AssistConsultant from './components/assistConsultant'
|
12
|
|
-import BatchAssistConsultant from './components/BatchAssistConsultant'
|
13
|
|
-import IntegralRecord from './components/integralRecord'
|
14
|
|
-import ModalRecommendRecord from './components/recommend'
|
15
|
|
-import ChangeStatus from './components/changeStatus'
|
16
|
|
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
|
17
|
|
-import AuthButton from '@/components/AuthButton';
|
18
|
|
-import WxDictSelect from '@/components/SelectButton/WxDictSelect';
|
19
|
|
-
|
20
|
|
-
|
21
|
|
-const { Option } = Select;
|
22
|
|
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
23
|
|
-const { Meta } = Card;
|
24
|
|
-
|
25
|
|
-/**
|
26
|
|
- *
|
27
|
|
- *
|
28
|
|
- * @param {*} props
|
29
|
|
- * @returns
|
30
|
|
- */
|
31
|
|
-function body(props) {
|
32
|
|
- const { getFieldDecorator, getFieldsValue } = props.form
|
33
|
|
-
|
34
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
35
|
|
- const [dataSource, setDataSource] = useState({ records: [] })
|
36
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
37
|
|
- // const [columns, setColumns] = useState(privateColumns)
|
38
|
|
-
|
39
|
|
- // 默认私客
|
40
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
41
|
|
- const [customerType, setCustomerType] = useState('private')
|
42
|
|
-
|
43
|
|
- // 调整归属 ============ start
|
44
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
45
|
|
- const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
46
|
|
- // 调整归属 ============= end
|
47
|
|
-
|
48
|
|
- // 积分记录 ============ start
|
49
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
50
|
|
- const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
|
51
|
|
- // 积分记录 ============= end
|
52
|
|
-
|
53
|
|
- // 变更状态 ============ start
|
54
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
55
|
|
- const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
|
56
|
|
- // 变更状态 ============= end
|
57
|
|
-
|
58
|
|
- // 推荐客户
|
59
|
|
- const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
|
60
|
|
-
|
61
|
|
- const [assistVisibleData, setAssistVisibleData] = useState({visible: false, customerId: ''})
|
62
|
|
-
|
63
|
|
- const [loadingStatus, setLoadingStatus] = useState(false)
|
64
|
|
-
|
65
|
|
- // 选中的公客信息
|
66
|
|
- const [personInfo, setPersonInfo] = useState([])
|
67
|
|
-
|
68
|
|
- const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({visible: false, customerId: []})
|
69
|
|
-
|
70
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
71
|
|
- useEffect(() => {
|
72
|
|
- getList({ pageNumber: 1, pageSize: 10, customerType })
|
73
|
|
- }, [])
|
74
|
|
-
|
75
|
|
- function getList(params) {
|
76
|
|
- // 网路请求
|
77
|
|
- request({ ...apis.customer.customerRecommend, params: { ...params } }).then(res => {
|
78
|
|
- setDataSource(res)
|
79
|
|
- }).catch(err => {
|
80
|
|
- // eslint-disable-next-line no-unused-expressions
|
81
|
|
- <Alert
|
82
|
|
- style={{
|
83
|
|
- marginBottom: 24,
|
84
|
|
- }}
|
85
|
|
- message={err}
|
86
|
|
- type="error"
|
87
|
|
- showIcon
|
88
|
|
- />
|
89
|
|
- })
|
90
|
|
- }
|
91
|
|
-
|
92
|
|
- function displayNone() {
|
93
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
94
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
95
|
|
- setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
96
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
97
|
|
- }
|
98
|
|
-
|
99
|
|
- // 提交事件
|
100
|
|
- function handleSubmit(e) {
|
101
|
|
- displayNone()
|
102
|
|
-
|
103
|
|
-
|
104
|
|
- e.preventDefault();
|
105
|
|
- props.form.validateFields((err, values) => {
|
106
|
|
- if (!err) {
|
107
|
|
- if (values.startCreateDate){
|
108
|
|
- values.startCreateDate = moment(values.startCreateDate).format('YYYY-MM-DD HH:mm:ss');
|
109
|
|
- }
|
110
|
|
- if (values.endCreateDate){
|
111
|
|
- values.endCreateDate = moment(values.endCreateDate).format('YYYY-MM-DD HH:mm:ss');
|
112
|
|
- }
|
113
|
|
- getList({ pageNum: 1, pageSize: 10, customerType, ...values })
|
114
|
|
- }
|
115
|
|
- });
|
116
|
|
- }
|
117
|
|
-
|
118
|
|
- // Change 事件
|
119
|
|
- function handleSelectChange(e) {
|
120
|
|
- // eslint-disable-next-line no-console
|
121
|
|
- console.log(e)
|
122
|
|
- }
|
123
|
|
-
|
124
|
|
- // 分页
|
125
|
|
- function onChange(pageNum) {
|
126
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
127
|
|
- props.form.validateFields((err, values) => {
|
128
|
|
- if (!err) {
|
129
|
|
- getList({ pageNumber: pageNum, pageSize: 10, customerType, ...values })
|
130
|
|
- }
|
131
|
|
- });
|
132
|
|
- }
|
133
|
|
-
|
134
|
|
- // 私客/公客切换
|
135
|
|
- function radioButtonHandleSizeChange(e) {
|
136
|
|
- displayNone()
|
137
|
|
-
|
138
|
|
- const { value } = e.target
|
139
|
|
- setCustomerType(value)
|
140
|
|
- //setColumns(value === 'private' ? privateColumns : publicColumns)
|
141
|
|
- getList({ pageNumber: 1, pageSize: 10, customerType: value })
|
142
|
|
- }
|
143
|
|
-
|
144
|
|
- function handleReset() {
|
145
|
|
- props.form.resetFields();
|
146
|
|
- getList({ pageNumber: 1, pageSize: 10, customerType })
|
147
|
|
- }
|
148
|
|
-
|
149
|
|
-
|
150
|
|
- // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
|
151
|
|
- // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
|
152
|
|
-
|
153
|
|
- function showGM(record) {
|
154
|
|
- setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
|
155
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
156
|
|
- setStatusVisibleData({ visible: false, customerId: '' })
|
157
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
158
|
|
- setBatchAssistVisibleData({ visible: false, customerId: '' })
|
159
|
|
- }
|
160
|
|
-
|
161
|
|
- function showRecord(record) {
|
162
|
|
- setRecordVisibleData({ visible: true, customerId: record.personId })
|
163
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
164
|
|
- setStatusVisibleData({ visible: false, customerId: '' })
|
165
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
166
|
|
- setBatchAssistVisibleData({ visible: false, customerId: '' })
|
167
|
|
- }
|
168
|
|
-
|
169
|
|
- function showStatus(record) {
|
170
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
171
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
172
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
173
|
|
- setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
|
174
|
|
- setBatchAssistVisibleData({ visible: false, customerId: '' })
|
175
|
|
- }
|
176
|
|
-
|
177
|
|
- // 推荐客户
|
178
|
|
- function showRecommend(personId) {
|
179
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
180
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
181
|
|
- setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
182
|
|
- setRecommendVisibleData({ visible: true, customerId: personId })
|
183
|
|
- setBatchAssistVisibleData({ visible: false, customerId: '' })
|
184
|
|
- }
|
185
|
|
-
|
186
|
|
- //分配置业顾问
|
187
|
|
- function assistConsultant(personId) {
|
188
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
189
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
190
|
|
- setStatusVisibleData({ visible: false, customerId: '' })
|
191
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
192
|
|
- setAssistVisibleData({ visible: true, customerId: personId })
|
193
|
|
- setBatchAssistVisibleData({ visible: false, customerId: '' })
|
194
|
|
- }
|
195
|
|
-
|
196
|
|
- function batchAssistConsultant(){
|
197
|
|
- if (personInfo.length <= 0){
|
198
|
|
- return message.info("请至少选择一条数据");
|
199
|
|
- }
|
200
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
201
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
202
|
|
- setStatusVisibleData({ visible: false, customerId: '' })
|
203
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
204
|
|
- setAssistVisibleData({ visible: false, customerId: '' })
|
205
|
|
- setBatchAssistVisibleData({ visible: true, customerId: personInfo })
|
206
|
|
- }
|
207
|
|
-
|
208
|
|
- function toCustomerDateil(record) {
|
209
|
|
- router.push({
|
210
|
|
- pathname: '/customer/customerlist/customerDetail',
|
211
|
|
- query: {
|
212
|
|
- id: record.customerId,
|
213
|
|
- },
|
214
|
|
- });
|
215
|
|
- }
|
216
|
|
- // 私客详情
|
217
|
|
- function publicCustomerDetail(record) {
|
218
|
|
- router.push({
|
219
|
|
- pathname: '/customer/customerlist/publicCustomerDetail',
|
220
|
|
- query: {
|
221
|
|
- id: record.personId,
|
222
|
|
- },
|
223
|
|
- });
|
224
|
|
- }
|
225
|
|
-
|
226
|
|
- function exportCustomer () {
|
227
|
|
- setLoadingStatus(true)
|
228
|
|
- const fieldsValue = getFieldsValue()
|
229
|
|
- request({ ...apis.customer.customerRecommendExport, responseType: 'blob', params: { ...fieldsValue, customerType } })
|
230
|
|
- .then(response => {
|
231
|
|
- download(response)
|
232
|
|
- setLoadingStatus(false)
|
233
|
|
- }).catch(error => {
|
234
|
|
- message.err("连接超时");
|
235
|
|
- setLoadingStatus(false)
|
236
|
|
- })
|
237
|
|
- }
|
238
|
|
-
|
239
|
|
- function download (data) {
|
240
|
|
- if (!data) {
|
241
|
|
- return
|
242
|
|
- }
|
243
|
|
- const url = window.URL.createObjectURL(new Blob([data]))
|
244
|
|
- const link = document.createElement('a')
|
245
|
|
- link.style.display = 'none'
|
246
|
|
- link.href = url
|
247
|
|
- link.setAttribute('download', '客户列表.xlsx')
|
248
|
|
- document.body.append(link)
|
249
|
|
- link.click()
|
250
|
|
- }
|
251
|
|
-
|
252
|
|
- // 关闭调整归属的窗口
|
253
|
|
- function closeAttribution() {
|
254
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
255
|
|
- getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
|
256
|
|
- }
|
257
|
|
- // 回调关闭所有弹框
|
258
|
|
- function closeAll() {
|
259
|
|
- setRecordVisibleData({ visible: false, customerId: '' })
|
260
|
|
- setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
261
|
|
- setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
262
|
|
- setRecommendVisibleData({ visible: false, customerId: '' })
|
263
|
|
- setAssistVisibleData({ visible: false, customerId: ''})
|
264
|
|
- setBatchAssistVisibleData({visible: false, customerId: ''})
|
265
|
|
- getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
|
266
|
|
- }
|
267
|
|
-
|
268
|
|
- const rowSelection = {
|
269
|
|
- onChange: (selectedRowKeys, selectedRows) => {
|
270
|
|
- console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
271
|
|
- setPersonInfo(selectedRows)
|
272
|
|
- },
|
273
|
|
- };
|
274
|
|
-
|
275
|
|
- const publicColumns = [
|
276
|
|
- {
|
277
|
|
- title: '头像',
|
278
|
|
- dataIndex: 'picture',
|
279
|
|
- key: 'picture',
|
280
|
|
- align: 'center',
|
281
|
|
- width: '15%',
|
282
|
|
- render: (_, record) => <Avatar shape="square" style={{color: 'blue',cursor: 'pointer'}} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
283
|
|
- },
|
284
|
|
- {
|
285
|
|
- title: '姓名',
|
286
|
|
- dataIndex: 'name',
|
287
|
|
- key: 'name',
|
288
|
|
- align: 'center',
|
289
|
|
- width: '10%',
|
290
|
|
- // eslint-disable-next-line no-nested-ternary
|
291
|
|
- render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => publicCustomerDetail(record)} >{customerType === 'private' ? record.name : record.nickname}</span></>,
|
292
|
|
- },
|
293
|
|
- {
|
294
|
|
- title: '电话',
|
295
|
|
- dataIndex: 'phone',
|
296
|
|
- key: 'phone',
|
297
|
|
- align: 'center',
|
298
|
|
- width: '15%',
|
299
|
|
- },
|
300
|
|
- {
|
301
|
|
- title: '推广人员',
|
302
|
|
- dataIndex: 'sharePersonName',
|
303
|
|
- key: 'sharePersonName',
|
304
|
|
- align: 'center',
|
305
|
|
- width: '15%',
|
306
|
|
- },
|
307
|
|
- {
|
308
|
|
- title: '性别',
|
309
|
|
- dataIndex: 'gender',
|
310
|
|
- key: 'gender',
|
311
|
|
- align: 'center',
|
312
|
|
- width: '10%',
|
313
|
|
- // eslint-disable-next-line no-nested-ternary
|
314
|
|
- render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
|
315
|
|
- },
|
316
|
|
- {
|
317
|
|
- title: '操作',
|
318
|
|
- dataIndex: 'customerId',
|
319
|
|
- key: 'customerId',
|
320
|
|
- align: 'center',
|
321
|
|
- width: '25%',
|
322
|
|
- // eslint-disable-next-line no-nested-ternary
|
323
|
|
- render: (_, record) => (
|
324
|
|
- <>
|
325
|
|
- {/* <AuthButton name="admin.customer.public.detail" noRight={null}>
|
326
|
|
- <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
|
327
|
|
- </AuthButton>
|
328
|
|
- */}
|
329
|
|
- <AuthButton name="admin.customer.recommend" noRight={null}>
|
330
|
|
- <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
|
331
|
|
- </AuthButton>
|
332
|
|
- <AuthButton name="admin.customer.assign" noRight={null}>
|
333
|
|
- <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => assistConsultant(record.personId)}>分配置业顾问</Button>
|
334
|
|
- </AuthButton>
|
335
|
|
- <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
|
336
|
|
- <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
|
337
|
|
- </AuthButton>
|
338
|
|
- </>
|
339
|
|
- ),
|
340
|
|
- },
|
341
|
|
- ]
|
342
|
|
-
|
343
|
|
- const privateColumns = [
|
344
|
|
- {
|
345
|
|
- title: '头像',
|
346
|
|
- dataIndex: 'picture',
|
347
|
|
- key: 'picture',
|
348
|
|
- align: 'center',
|
349
|
|
- width: '15%',
|
350
|
|
- render: (_, record) => <Avatar shape="square" style={{color: 'blue',cursor: 'pointer'}} onClick={() => toCustomerDateil(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
351
|
|
- },
|
352
|
|
- {
|
353
|
|
- title: '姓名',
|
354
|
|
- dataIndex: 'name',
|
355
|
|
- key: 'name',
|
356
|
|
- align: 'center',
|
357
|
|
- width: '10%',
|
358
|
|
- // eslint-disable-next-line no-nested-ternary
|
359
|
|
- render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => toCustomerDateil(record)}>{customerType === 'private' ? record.name : record.nickname}</span></>,
|
360
|
|
- },
|
361
|
|
- {
|
362
|
|
- title: '电话',
|
363
|
|
- dataIndex: 'phone',
|
364
|
|
- key: 'phone',
|
365
|
|
- align: 'center',
|
366
|
|
- width: '15%',
|
367
|
|
- },
|
368
|
|
- {
|
369
|
|
- title: '性别',
|
370
|
|
- dataIndex: 'sex',
|
371
|
|
- key: 'sex',
|
372
|
|
- align: 'center',
|
373
|
|
- width: '10%',
|
374
|
|
- // eslint-disable-next-line no-nested-ternary
|
375
|
|
- render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
|
376
|
|
- },
|
377
|
|
- {
|
378
|
|
- title: '置业顾问',
|
379
|
|
- dataIndex: 'consultantName',
|
380
|
|
- key: 'consultantName',
|
381
|
|
- align: 'center',
|
382
|
|
- width: '15%',
|
383
|
|
- // eslint-disable-next-line no-nested-ternary
|
384
|
|
- render: (_, record) => (
|
385
|
|
- <>
|
386
|
|
- <span>{record.consultantName}</span>
|
387
|
|
- <br />
|
388
|
|
- <span>{record.consultTel}</span>
|
389
|
|
- </>
|
390
|
|
- ),
|
391
|
|
- },
|
392
|
|
- {
|
393
|
|
- title: '推广人员',
|
394
|
|
- dataIndex: 'sharePersonName',
|
395
|
|
- key: 'sharePersonName',
|
396
|
|
- align: 'center',
|
397
|
|
- width: '15%',
|
398
|
|
- },
|
399
|
|
- {
|
400
|
|
- title: '客户状态',
|
401
|
|
- dataIndex: 'reportRecommendStatus',
|
402
|
|
- key: 'reportRecommendStatus',
|
403
|
|
- align: 'center',
|
404
|
|
- width: '10%',
|
405
|
|
- // eslint-disable-next-line no-nested-ternary
|
406
|
|
- render: (text, records) => {
|
407
|
|
- if (records.status === 1) { return '报备' }
|
408
|
|
- if (records.status === 2) { return '到访' }
|
409
|
|
- if (records.status === 3) { return '认购' }
|
410
|
|
- if (records.status === 4) { return '签约' }
|
411
|
|
- },
|
412
|
|
- },
|
413
|
|
- {
|
414
|
|
- title: '操作',
|
415
|
|
- dataIndex: 'customerId',
|
416
|
|
- key: 'customerId',
|
417
|
|
- align: 'center',
|
418
|
|
- width: '25%',
|
419
|
|
- // eslint-disable-next-line no-nested-ternary
|
420
|
|
- render: (_, record) => (
|
421
|
|
- <>
|
422
|
|
-
|
423
|
|
- <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
|
424
|
|
- <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
|
425
|
|
- </AuthButton>
|
426
|
|
-
|
427
|
|
- <AuthButton name="admin.customer.recommend.belong" noRight={null}>
|
428
|
|
- <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
|
429
|
|
- </AuthButton>
|
430
|
|
-
|
431
|
|
- {/* <AuthButton name="admin.customer.recommend.get" noRight={null}>
|
432
|
|
- <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
|
433
|
|
- </AuthButton>
|
434
|
|
- */}
|
435
|
|
- <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
|
436
|
|
- <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
|
437
|
|
- </AuthButton>
|
438
|
|
-
|
439
|
|
- <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
|
440
|
|
- <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
|
441
|
|
- </AuthButton>
|
442
|
|
- </>
|
443
|
|
- ),
|
444
|
|
- },
|
445
|
|
- ]
|
446
|
|
-
|
447
|
|
- return (
|
448
|
|
- <>
|
449
|
|
- {console.log('customerType', customerType)}
|
450
|
|
- <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
451
|
|
- <Form.Item>
|
452
|
|
- {getFieldDecorator('buildingId')(
|
453
|
|
- <BuildSelect />,
|
454
|
|
- )}
|
455
|
|
- </Form.Item>
|
456
|
|
- {customerType === 'private' && <Form.Item>
|
457
|
|
- {getFieldDecorator('status')(
|
458
|
|
- <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
|
459
|
|
- <Option value={1}>报备</Option>
|
460
|
|
- <Option value={2}>到访</Option>
|
461
|
|
- <Option value={3}>认筹</Option>
|
462
|
|
- <Option value={4}>签约</Option>
|
463
|
|
- </Select>,
|
464
|
|
- )}
|
465
|
|
- </Form.Item>}
|
466
|
|
- <Form.Item>
|
467
|
|
- {getFieldDecorator('name')(
|
468
|
|
- <Input
|
469
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
470
|
|
- placeholder="姓名"
|
471
|
|
- />,
|
472
|
|
- )}
|
473
|
|
- </Form.Item>
|
474
|
|
- <Form.Item>
|
475
|
|
- {getFieldDecorator('tel')(
|
476
|
|
- <Input
|
477
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
478
|
|
- placeholder="电话"
|
479
|
|
- />,
|
480
|
|
- )}
|
481
|
|
- </Form.Item>
|
482
|
|
- {customerType === 'private' && <Form.Item>
|
483
|
|
- {getFieldDecorator('consultName')(
|
484
|
|
- <Input placeholder="置业顾问" />,
|
485
|
|
- )}
|
486
|
|
- </Form.Item>}
|
487
|
|
- {customerType === 'private' && <Form.Item>
|
488
|
|
- {getFieldDecorator('consultTel')(
|
489
|
|
- <Input placeholder="置业顾问电话" />,
|
490
|
|
- )}
|
491
|
|
- </Form.Item>}
|
492
|
|
- <Form.Item>
|
493
|
|
- {getFieldDecorator('startCreateDate')(
|
494
|
|
- <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="注册开始时间"/>,
|
495
|
|
- )}
|
496
|
|
- </Form.Item>
|
497
|
|
- <Form.Item>
|
498
|
|
- {getFieldDecorator('endCreateDate')(
|
499
|
|
- <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="注册结束时间"/>,
|
500
|
|
- )}
|
501
|
|
- </Form.Item>
|
502
|
|
- <Form.Item>
|
503
|
|
- {getFieldDecorator('sceneType')(
|
504
|
|
- <WxDictSelect />,
|
505
|
|
- )}
|
506
|
|
- </Form.Item>
|
507
|
|
- <Form.Item>
|
508
|
|
- <AuthButton name="admin.customer.recommend.search" noRight={null}>
|
509
|
|
- <Button type="primary" htmlType="submit" >
|
510
|
|
- 查询
|
511
|
|
- </Button>
|
512
|
|
- </AuthButton>
|
513
|
|
- <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
514
|
|
- 重置
|
515
|
|
- </Button>
|
516
|
|
- </Form.Item>
|
517
|
|
- </Form>
|
518
|
|
- {
|
519
|
|
- customerType === 'private' ?
|
520
|
|
- <AuthButton name="admin.customer.import" noRight={null}>
|
521
|
|
- <Button type="primary" loading={loadingStatus} onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
|
522
|
|
- 导出
|
523
|
|
- </Button>
|
524
|
|
- </AuthButton> :
|
525
|
|
- <>
|
526
|
|
- <AuthButton name="admin.customer.import" noRight={null}>
|
527
|
|
- <Button type="primary" onClick={() => batchAssistConsultant()} style={{ float: 'right', margin: '20px 0', marginLeft:'20px', zIndex: 1 }}>
|
528
|
|
- 批量分配置业顾问
|
529
|
|
- </Button>
|
530
|
|
- </AuthButton>
|
531
|
|
- <AuthButton name="admin.customer.import" noRight={null}>
|
532
|
|
- <Button type="primary" loading={loadingStatus} onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
|
533
|
|
- 导出
|
534
|
|
- </Button>
|
535
|
|
- </AuthButton>
|
536
|
|
- </>
|
537
|
|
- }
|
538
|
|
-
|
539
|
|
-
|
540
|
|
- <div style={{ margin: '20px 0'}}>
|
541
|
|
- <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
|
542
|
|
- <Radio.Button value="private">私客</Radio.Button>
|
543
|
|
- <Radio.Button value="public">公客</Radio.Button>
|
544
|
|
- </Radio.Group>
|
545
|
|
- </div>
|
546
|
|
- {customerType === 'private' ?
|
547
|
|
- <Table
|
548
|
|
- // onRow={record => {
|
549
|
|
- // return {
|
550
|
|
- // onClick: () => toCustomerDateil(record),
|
551
|
|
- // };
|
552
|
|
- // }}
|
553
|
|
- dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
|
554
|
|
- <Table rowSelection={rowSelection}
|
555
|
|
- // onRow={record => {
|
556
|
|
- // return {
|
557
|
|
- // onClick: () => publicCustomerDetail(record),
|
558
|
|
- // };
|
559
|
|
- // }}
|
560
|
|
- dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
|
561
|
|
- }
|
562
|
|
-
|
563
|
|
- {/* 调整归属 */}
|
564
|
|
- <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
|
565
|
|
-
|
566
|
|
- {/* 积分记录 */}
|
567
|
|
- <IntegralRecord visibleData={recordVisibleData} onCancel={() => closeAll()} />
|
568
|
|
-
|
569
|
|
- {/* 变更状态 */}
|
570
|
|
- <ChangeStatus visibleData={statusVisibleData} onCancel={() => closeAll()}/>
|
571
|
|
-
|
572
|
|
- {/* 推荐客户 */}
|
573
|
|
- <ModalRecommendRecord visibleData={recommendVisibleData} onCancel={() => closeAll()}/>
|
574
|
|
-
|
575
|
|
- {/* 分配置业顾问 */}
|
576
|
|
- <AssistConsultant visibleData={assistVisibleData} onCancel={() => closeAll()}/>
|
577
|
|
-
|
578
|
|
- {/* 批量分配置业顾问 */}
|
579
|
|
- <BatchAssistConsultant visibleData={batchAssistVisibleData} onCancel={() => closeAll()}/>
|
580
|
|
- </>
|
581
|
|
- );
|
582
|
|
-}
|
583
|
|
-
|
584
|
|
-const WrappedBody = Form.create({ name: 'body' })(body);
|
585
|
|
-
|
586
|
|
-export default WrappedBody
|
587
|
|
-=======
|
588
|
1
|
import React, { useState, useEffect } from 'react';
|
589
|
2
|
import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, message } from 'antd';
|
590
|
3
|
import moment from 'moment';
|
|
@@ -1273,4 +686,3 @@ function body(props) {
|
1273
|
686
|
const WrappedBody = Form.create({ name: 'body' })(body);
|
1274
|
687
|
|
1275
|
688
|
export default WrappedBody
|
1276
|
|
->>>>>>> dev
|