|
|
|
|
58
|
// 推荐客户
|
58
|
// 推荐客户
|
59
|
const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
|
59
|
const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
|
60
|
|
60
|
|
61
|
- const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '',buildingId:'' })
|
|
|
|
|
61
|
+ const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '', buildingId: '' })
|
62
|
|
62
|
|
63
|
const [loadingStatus, setLoadingStatus] = useState(false)
|
63
|
const [loadingStatus, setLoadingStatus] = useState(false)
|
64
|
|
64
|
|
65
|
// 选中的公客信息
|
65
|
// 选中的公客信息
|
66
|
const [personInfo, setPersonInfo] = useState([])
|
66
|
const [personInfo, setPersonInfo] = useState([])
|
67
|
|
67
|
|
68
|
- const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] ,buildingId:''})
|
|
|
|
|
68
|
+ const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [], buildingId: '' })
|
69
|
|
69
|
|
70
|
const [currentSelectedRows, setSelectedRows] = useState([])
|
70
|
const [currentSelectedRows, setSelectedRows] = useState([])
|
71
|
|
71
|
|
72
|
- const [selectedRowKeys,setSelectedRowKeys] = useState([])
|
|
|
|
|
72
|
+ const [selectedRowKeys, setSelectedRowKeys] = useState([])
|
73
|
|
73
|
|
74
|
-// const [ radio, setRadio] = useState(true)
|
|
|
|
|
74
|
+ // const [ radio, setRadio] = useState(true)
|
75
|
|
75
|
|
76
|
// const [page, setPage] = useState(1)
|
76
|
// const [page, setPage] = useState(1)
|
77
|
|
77
|
|
|
|
|
|
93
|
localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
|
93
|
localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
|
94
|
getList({ pageNumber: 1, pageSize: 10, customerType })
|
94
|
getList({ pageNumber: 1, pageSize: 10, customerType })
|
95
|
}
|
95
|
}
|
96
|
- }, [])
|
|
|
|
|
96
|
+ }, [])
|
97
|
|
97
|
|
98
|
function getList(params) {
|
98
|
function getList(params) {
|
99
|
// 网路请求
|
99
|
// 网路请求
|
|
|
|
|
179
|
|
179
|
|
180
|
// 私客/公客切换
|
180
|
// 私客/公客切换
|
181
|
function radioButtonHandleSizeChange(e) {
|
181
|
function radioButtonHandleSizeChange(e) {
|
182
|
-
|
|
|
|
|
182
|
+
|
183
|
displayNone()
|
183
|
displayNone()
|
184
|
-
|
|
|
|
|
184
|
+
|
185
|
props.form.resetFields();
|
185
|
props.form.resetFields();
|
186
|
const { value } = e.target
|
186
|
const { value } = e.target
|
187
|
setCustomerType(value)
|
187
|
setCustomerType(value)
|
|
|
|
|
233
|
setRecordVisibleData({ visible: false, customerId: '' })
|
233
|
setRecordVisibleData({ visible: false, customerId: '' })
|
234
|
setStatusVisibleData({ visible: false, customerId: '' })
|
234
|
setStatusVisibleData({ visible: false, customerId: '' })
|
235
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
235
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
236
|
- setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
|
|
|
|
|
236
|
+ setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
237
|
}
|
237
|
}
|
238
|
|
238
|
|
239
|
function showRecord(record) {
|
239
|
function showRecord(record) {
|
|
|
|
|
241
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
241
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
242
|
setStatusVisibleData({ visible: false, customerId: '' })
|
242
|
setStatusVisibleData({ visible: false, customerId: '' })
|
243
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
243
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
244
|
- setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
|
|
|
|
|
244
|
+ setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
245
|
}
|
245
|
}
|
246
|
|
246
|
|
247
|
function showStatus(record) {
|
247
|
function showStatus(record) {
|
|
|
|
|
249
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
249
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
250
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
250
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
251
|
setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
|
251
|
setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
|
252
|
- setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
|
|
|
|
|
252
|
+ setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
253
|
}
|
253
|
}
|
254
|
|
254
|
|
255
|
// 推荐客户
|
255
|
// 推荐客户
|
|
|
|
|
262
|
}
|
262
|
}
|
263
|
|
263
|
|
264
|
//分配置业顾问
|
264
|
//分配置业顾问
|
265
|
- function assistConsultant(personId,buildingId) {
|
|
|
|
|
265
|
+ function assistConsultant(personId, buildingId) {
|
266
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
266
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
267
|
setRecordVisibleData({ visible: false, customerId: '' })
|
267
|
setRecordVisibleData({ visible: false, customerId: '' })
|
268
|
setStatusVisibleData({ visible: false, customerId: '' })
|
268
|
setStatusVisibleData({ visible: false, customerId: '' })
|
269
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
269
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
270
|
- setAssistVisibleData({ visible: true, customerId: personId ,buildingId:buildingId})
|
|
|
271
|
- setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
|
|
|
|
|
270
|
+ setAssistVisibleData({ visible: true, customerId: personId, buildingId: buildingId })
|
|
|
271
|
+ setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
272
|
}
|
272
|
}
|
273
|
|
273
|
|
274
|
function batchAssistConsultant() {
|
274
|
function batchAssistConsultant() {
|
|
|
|
|
281
|
const compareSet = new Set();
|
281
|
const compareSet = new Set();
|
282
|
personInfo.filter(record => {
|
282
|
personInfo.filter(record => {
|
283
|
compareSet.add(record.buildingName)
|
283
|
compareSet.add(record.buildingName)
|
284
|
- } )
|
|
|
|
|
284
|
+ })
|
285
|
|
285
|
|
286
|
- if(compareSet.size != 1){
|
|
|
|
|
286
|
+ if (compareSet.size != 1) {
|
287
|
return message.info("请选择项目");
|
287
|
return message.info("请选择项目");
|
288
|
}
|
288
|
}
|
289
|
|
289
|
|
290
|
// const newSelectedRows = personInfo.filter()
|
290
|
// const newSelectedRows = personInfo.filter()
|
291
|
-
|
|
|
|
|
291
|
+
|
292
|
// console.log(newSelectedRows,'newSelectedRows')
|
292
|
// console.log(newSelectedRows,'newSelectedRows')
|
293
|
|
293
|
|
294
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
294
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
295
|
setRecordVisibleData({ visible: false, customerId: '' })
|
295
|
setRecordVisibleData({ visible: false, customerId: '' })
|
296
|
setStatusVisibleData({ visible: false, customerId: '' })
|
296
|
setStatusVisibleData({ visible: false, customerId: '' })
|
297
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
297
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
298
|
- setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
|
|
|
299
|
- setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId})
|
|
|
|
|
298
|
+ setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
|
|
299
|
+ setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId })
|
300
|
}
|
300
|
}
|
301
|
|
301
|
|
302
|
function toCustomerDateil(record) {
|
302
|
function toCustomerDateil(record) {
|
|
|
|
|
325
|
download(response)
|
325
|
download(response)
|
326
|
setLoadingStatus(false)
|
326
|
setLoadingStatus(false)
|
327
|
}).catch(error => {
|
327
|
}).catch(error => {
|
328
|
- message.err("连接超时");
|
|
|
|
|
328
|
+ message.err('连接超时');
|
329
|
setLoadingStatus(false)
|
329
|
setLoadingStatus(false)
|
330
|
})
|
330
|
})
|
331
|
}
|
331
|
}
|
|
|
|
|
347
|
function closeAttribution() {
|
347
|
function closeAttribution() {
|
348
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
348
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
349
|
if (customerType === 'private') {
|
349
|
if (customerType === 'private') {
|
350
|
-
|
|
|
351
|
- getList(JSON.parse(localStorage.getItem("priPageParams")))
|
|
|
|
|
350
|
+ getList(JSON.parse(localStorage.getItem('priPageParams')))
|
352
|
} else {
|
351
|
} else {
|
353
|
-
|
|
|
354
|
- getList(JSON.parse(localStorage.getItem("pubPageParams")))
|
|
|
|
|
352
|
+ getList(JSON.parse(localStorage.getItem('pubPageParams')))
|
355
|
}
|
353
|
}
|
356
|
-
|
|
|
357
|
}
|
354
|
}
|
358
|
// 回调关闭所有弹框
|
355
|
// 回调关闭所有弹框
|
359
|
function closeAll() {
|
356
|
function closeAll() {
|
|
|
|
|
361
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
358
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
362
|
setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
359
|
setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
363
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
360
|
setRecommendVisibleData({ visible: false, customerId: '' })
|
364
|
- setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
|
|
|
|
|
361
|
+ setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
|
365
|
setBatchAssistVisibleData({ visible: false, customerId: '' })
|
362
|
setBatchAssistVisibleData({ visible: false, customerId: '' })
|
366
|
if (customerType === 'private') {
|
363
|
if (customerType === 'private') {
|
367
|
|
364
|
|
|
|
|
|
379
|
console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
376
|
console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
380
|
setSelectedRowKeys(selectedRowKeys)
|
377
|
setSelectedRowKeys(selectedRowKeys)
|
381
|
const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId)) // 去重
|
378
|
const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId)) // 去重
|
382
|
- .concat(selectedRows) // 新增选择
|
|
|
383
|
- .filter(x => selectedRowKeys.some(y => y === x.customerId)) // 去掉未选的数据
|
|
|
|
|
379
|
+ .concat(selectedRows) // 新增选择
|
|
|
380
|
+ .filter(x => selectedRowKeys.some(y => y === x.customerId)) // 去掉未选的数据
|
384
|
|
381
|
|
385
|
// setSelectedRows(newSelectedRows)
|
382
|
// setSelectedRows(newSelectedRows)
|
386
|
- console.log(newSelectedRows,"33333333333333333333")
|
|
|
|
|
383
|
+ console.log(newSelectedRows, "33333333333333333333")
|
387
|
setPersonInfo(newSelectedRows)
|
384
|
setPersonInfo(newSelectedRows)
|
388
|
},
|
385
|
},
|
389
|
};
|
386
|
};
|
|
|
|
|
396
|
align: 'center',
|
393
|
align: 'center',
|
397
|
width: '15%',
|
394
|
width: '15%',
|
398
|
// render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
395
|
// render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
399
|
- render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture } size={64} icon="user" />,
|
|
|
|
|
396
|
+ render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture} size={64} icon="user" />,
|
400
|
},
|
397
|
},
|
401
|
{
|
398
|
{
|
402
|
title: '姓名',
|
399
|
title: '姓名',
|
|
|
|
|
462
|
<Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
|
459
|
<Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
|
463
|
</AuthButton>
|
460
|
</AuthButton>
|
464
|
<AuthButton name="admin.customer.assign" noRight={null}>
|
461
|
<AuthButton name="admin.customer.assign" noRight={null}>
|
465
|
- <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId,record.buildingId)}>分配置业顾问</Button>
|
|
|
|
|
462
|
+ <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId, record.buildingId)}>分配置业顾问</Button>
|
466
|
</AuthButton>
|
463
|
</AuthButton>
|
467
|
<AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
|
464
|
<AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
|
468
|
<Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
|
465
|
<Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
|
|
|
|
|
586
|
return (
|
583
|
return (
|
587
|
<>
|
584
|
<>
|
588
|
<Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
585
|
<Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
589
|
- {customerType === 'public' && <Form.Item>
|
|
|
|
|
586
|
+ {customerType === 'public' && <Form.Item>
|
590
|
{getFieldDecorator('belongStatus')(
|
587
|
{getFieldDecorator('belongStatus')(
|
591
|
<Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
|
588
|
<Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
|
592
|
<Option value={1}>是</Option>
|
589
|
<Option value={1}>是</Option>
|