|
@@ -24,11 +24,11 @@ class ModalTable extends React.Component {
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
// 挂载之后
|
27
|
|
- componentDidMount () {
|
|
27
|
+ componentDidMount() {
|
28
|
28
|
this.getList({ pageNumber: 1, pageSize: 5 })
|
29
|
29
|
}
|
30
|
30
|
|
31
|
|
- componentDidUpdate (preProps, preState) {
|
|
31
|
+ componentDidUpdate(preProps, preState) {
|
32
|
32
|
if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
|
33
|
33
|
this.getList({ pageNumber: 1, pageSize: 5 })
|
34
|
34
|
this.setState({ visibleData: this.props.visibleData });
|
|
@@ -37,16 +37,16 @@ class ModalTable extends React.Component {
|
37
|
37
|
|
38
|
38
|
// 弹框确定按钮
|
39
|
39
|
// eslint-disable-next-line react/sort-comp
|
40
|
|
- handleOk () {
|
|
40
|
+ handleOk() {
|
41
|
41
|
this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
42
|
42
|
}
|
43
|
43
|
|
44
|
44
|
// 弹框取消按钮
|
45
|
|
- handleCancel () {
|
|
45
|
+ handleCancel() {
|
46
|
46
|
this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
47
|
47
|
}
|
48
|
48
|
|
49
|
|
- getList (params) {
|
|
49
|
+ getList(params) {
|
50
|
50
|
console.log('this.state.visibleData', this.state.visibleData)
|
51
|
51
|
const { customerId } = this.state.visibleData
|
52
|
52
|
if (customerId === '' || customerId === undefined) {
|
|
@@ -70,7 +70,7 @@ class ModalTable extends React.Component {
|
70
|
70
|
}
|
71
|
71
|
|
72
|
72
|
// 分页
|
73
|
|
- onChange (pageNum) {
|
|
73
|
+ onChange(pageNum) {
|
74
|
74
|
props.form.validateFields((err, values) => {
|
75
|
75
|
if (!err) {
|
76
|
76
|
getList({ pageNumber: pageNum, pageSize: 5, ...values })
|
|
@@ -78,7 +78,7 @@ class ModalTable extends React.Component {
|
78
|
78
|
});
|
79
|
79
|
}
|
80
|
80
|
|
81
|
|
- render () {
|
|
81
|
+ render() {
|
82
|
82
|
const columns = [
|
83
|
83
|
{
|
84
|
84
|
title: '头像',
|
|
@@ -89,7 +89,7 @@ class ModalTable extends React.Component {
|
89
|
89
|
title: '用户名',
|
90
|
90
|
dataIndex: 'name',
|
91
|
91
|
key: 'name',
|
92
|
|
- render: (row) => <><span>{console.log(row,'row')}{ row.name || row.nickname }</span></>,
|
|
92
|
+ // render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
|
93
|
93
|
},
|
94
|
94
|
{
|
95
|
95
|
title: '电话',
|
|
@@ -111,20 +111,20 @@ class ModalTable extends React.Component {
|
111
|
111
|
title: '推荐时间',
|
112
|
112
|
dataIndex: 'createDate',
|
113
|
113
|
key: 'createDate',
|
114
|
|
- render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss') }</span></>,
|
|
114
|
+ render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
|
115
|
115
|
},
|
116
|
116
|
{
|
117
|
117
|
title: '状态',
|
118
|
118
|
// eslint-disable-next-line consistent-return
|
119
|
119
|
render: (text, records) => {
|
120
|
120
|
console.log("retrun", records)
|
121
|
|
- // if (records.status === 1) { return '报备' }
|
122
|
|
- // if (records.status === 2) { return '推荐' }
|
123
|
|
- // if (records.status === 3) { return '认购' }
|
124
|
|
- // if (records.status === 4) { return '签约' }
|
125
|
|
- // if (records.verifyStatus === 1) { return '待审核' }
|
126
|
|
- // if (records.verifyStatus === 2) { return '审核同意' }
|
127
|
|
- // if (records.verifyStatus === 3) { return '签约' }
|
|
121
|
+ // if (records.status === 1) { return '报备' }
|
|
122
|
+ // if (records.status === 2) { return '推荐' }
|
|
123
|
+ // if (records.status === 3) { return '认购' }
|
|
124
|
+ // if (records.status === 4) { return '签约' }
|
|
125
|
+ // if (records.verifyStatus === 1) { return '待审核' }
|
|
126
|
+ // if (records.verifyStatus === 2) { return '审核同意' }
|
|
127
|
+ // if (records.verifyStatus === 3) { return '签约' }
|
128
|
128
|
// if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'} }
|
129
|
129
|
// if (records.status === 2) { return '到访' }
|
130
|
130
|
// if (records.status === 3) { return '认购' }
|
|
@@ -132,7 +132,12 @@ class ModalTable extends React.Component {
|
132
|
132
|
// if (records.verifyStatus === 1) { return '待审核' }
|
133
|
133
|
// if (records.verifyStatus === 2) { return '审核同意' }
|
134
|
134
|
// if (records.verifyStatus === 3) { return '签约' }
|
135
|
|
- if (records.status === 1) { if(records.verifyStatus === 0) {return '待审核'} if(records.verifyStatus === 1) {return '报备'} if(records.verifyStatus === 2) {return '审核不通过'} }
|
|
135
|
+ if (records.status === 1) {
|
|
136
|
+ if (records.verifyStatus === 0) { return '待审核' }
|
|
137
|
+ if (records.verifyStatus === 1) {
|
|
138
|
+ if (records.reportRecommendStatus === 1) { return '报备' }
|
|
139
|
+ if (records.reportRecommendStatus === 2) { return '推荐' }}
|
|
140
|
+ if (records.verifyStatus === 2) { return '审核驳回' } }
|
136
|
141
|
if (records.status === 2) { return '到访' }
|
137
|
142
|
if (records.status === 3) { return '认购' }
|
138
|
143
|
if (records.status === 4) { return '签约' }
|
|
@@ -172,13 +177,13 @@ class InviteTable extends React.Component {
|
172
|
177
|
}
|
173
|
178
|
|
174
|
179
|
// 挂载之后
|
175
|
|
- componentDidMount () {
|
176
|
|
-
|
|
180
|
+ componentDidMount() {
|
|
181
|
+
|
177
|
182
|
}
|
178
|
183
|
|
179
|
|
- componentDidUpdate (preProps, preState) {
|
|
184
|
+ componentDidUpdate(preProps, preState) {
|
180
|
185
|
const { customerId } = this.props.visibleData
|
181
|
|
-
|
|
186
|
+
|
182
|
187
|
if (this.props.visibleData.visible !== preState.visibleData.visible) {
|
183
|
188
|
this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
|
184
|
189
|
this.setState({ visibleData: this.props.visibleData });
|
|
@@ -187,18 +192,18 @@ class InviteTable extends React.Component {
|
187
|
192
|
|
188
|
193
|
// 弹框确定按钮
|
189
|
194
|
// eslint-disable-next-line react/sort-comp
|
190
|
|
- handleOk () {
|
|
195
|
+ handleOk() {
|
191
|
196
|
this.setState({ dataSource: { records: [] } })
|
192
|
197
|
this.props.onCancel()
|
193
|
198
|
}
|
194
|
199
|
|
195
|
200
|
// 弹框取消按钮
|
196
|
|
- handleCancel () {
|
|
201
|
+ handleCancel() {
|
197
|
202
|
this.setState({ dataSource: { records: [] } })
|
198
|
203
|
this.props.onCancel()
|
199
|
204
|
}
|
200
|
205
|
|
201
|
|
- getList (params) {
|
|
206
|
+ getList(params) {
|
202
|
207
|
const { id } = params
|
203
|
208
|
console.log(id)
|
204
|
209
|
if (id === '' || id === undefined) {
|
|
@@ -208,16 +213,16 @@ class InviteTable extends React.Component {
|
208
|
213
|
this.setState({ dataSource: res })
|
209
|
214
|
}).catch(err => {
|
210
|
215
|
// eslint-disable-next-line no-unused-expressions
|
211
|
|
-
|
|
216
|
+
|
212
|
217
|
})
|
213
|
218
|
}
|
214
|
219
|
|
215
|
220
|
// 分页
|
216
|
|
- onChange (pageNum) {
|
|
221
|
+ onChange(pageNum) {
|
217
|
222
|
this.getList({ pageNumber: pageNum, pageSize: 5 })
|
218
|
223
|
}
|
219
|
224
|
|
220
|
|
- render () {
|
|
225
|
+ render() {
|
221
|
226
|
const columns = [
|
222
|
227
|
{
|
223
|
228
|
title: '头像',
|
|
@@ -231,7 +236,7 @@ class InviteTable extends React.Component {
|
231
|
236
|
dataIndex: 'nickname',
|
232
|
237
|
key: 'nickname',
|
233
|
238
|
align: 'center',
|
234
|
|
- render: (row) => <><span>{console.log(row,'row')}{ row.name || row.nickname }</span></>,
|
|
239
|
+ render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
|
235
|
240
|
},
|
236
|
241
|
{
|
237
|
242
|
title: '电话',
|
|
@@ -271,7 +276,7 @@ class InviteTable extends React.Component {
|
271
|
276
|
* @param {*} props
|
272
|
277
|
* @returns
|
273
|
278
|
*/
|
274
|
|
-function body (props) {
|
|
279
|
+function body(props) {
|
275
|
280
|
const { getFieldDecorator, getFieldsValue } = props.form
|
276
|
281
|
|
277
|
282
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -283,7 +288,7 @@ function body (props) {
|
283
|
288
|
}, [])
|
284
|
289
|
|
285
|
290
|
|
286
|
|
- function openNotificationWithIcon (type, message) {
|
|
291
|
+ function openNotificationWithIcon(type, message) {
|
287
|
292
|
notification[type]({
|
288
|
293
|
message,
|
289
|
294
|
description:
|
|
@@ -291,7 +296,7 @@ function body (props) {
|
291
|
296
|
});
|
292
|
297
|
}
|
293
|
298
|
|
294
|
|
- function getList (params) {
|
|
299
|
+ function getList(params) {
|
295
|
300
|
// 网路请求
|
296
|
301
|
request({ ...apis.customer.agents, params: { ...params } }).then(res => {
|
297
|
302
|
setDataSource(res)
|
|
@@ -301,7 +306,7 @@ function body (props) {
|
301
|
306
|
}
|
302
|
307
|
|
303
|
308
|
// 提交事件
|
304
|
|
- function handleSubmit (e) {
|
|
309
|
+ function handleSubmit(e) {
|
305
|
310
|
e.preventDefault();
|
306
|
311
|
props.form.validateFields((err, values) => {
|
307
|
312
|
if (!err) {
|
|
@@ -314,24 +319,24 @@ function body (props) {
|
314
|
319
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
315
|
320
|
const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
|
316
|
321
|
// Change 事件
|
317
|
|
- function handleSelectChange (e) {
|
|
322
|
+ function handleSelectChange(e) {
|
318
|
323
|
// eslint-disable-next-line no-console
|
319
|
324
|
console.log(e)
|
320
|
325
|
}
|
321
|
|
- function gM (row) {
|
|
326
|
+ function gM(row) {
|
322
|
327
|
setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
|
323
|
328
|
|
324
|
329
|
setGInviteData({ visible: false })
|
325
|
330
|
}
|
326
|
331
|
|
327
|
|
- function Invite (row) {
|
|
332
|
+ function Invite(row) {
|
328
|
333
|
setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
|
329
|
334
|
|
330
|
335
|
setGVisibleData({ visible: false })
|
331
|
336
|
}
|
332
|
337
|
|
333
|
338
|
// 分页
|
334
|
|
- function onChange (pageNum) {
|
|
339
|
+ function onChange(pageNum) {
|
335
|
340
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
336
|
341
|
getList({ pageNumber: pageNum, pageSize: 10 })
|
337
|
342
|
}
|
|
@@ -339,11 +344,11 @@ function body (props) {
|
339
|
344
|
/**
|
340
|
345
|
* 重置搜索
|
341
|
346
|
*/
|
342
|
|
- function handleReset () {
|
|
347
|
+ function handleReset() {
|
343
|
348
|
props.form.resetFields();
|
344
|
349
|
}
|
345
|
350
|
|
346
|
|
- function toAudit (cuurentId) {
|
|
351
|
+ function toAudit(cuurentId) {
|
347
|
352
|
router.push({
|
348
|
353
|
pathname: '/customer/recommendCustomer/audit',
|
349
|
354
|
query: {
|
|
@@ -352,7 +357,7 @@ function body (props) {
|
352
|
357
|
})
|
353
|
358
|
}
|
354
|
359
|
|
355
|
|
- function exportIndependen () {
|
|
360
|
+ function exportIndependen() {
|
356
|
361
|
const fieldsValue = getFieldsValue()
|
357
|
362
|
console.log('fieldsValue', fieldsValue)
|
358
|
363
|
request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob', params: { ...fieldsValue } })
|
|
@@ -363,7 +368,7 @@ function body (props) {
|
363
|
368
|
})
|
364
|
369
|
}
|
365
|
370
|
|
366
|
|
- function download (data) {
|
|
371
|
+ function download(data) {
|
367
|
372
|
if (!data) {
|
368
|
373
|
return
|
369
|
374
|
}
|
|
@@ -387,7 +392,7 @@ function body (props) {
|
387
|
392
|
title: '姓名',
|
388
|
393
|
dataIndex: 'nickname',
|
389
|
394
|
key: 'nickname',
|
390
|
|
- render: (_, record) => <><span>{ record.name || record.nickname }</span></>,
|
|
395
|
+ render: (_, record) => <><span>{record.name || record.nickname}</span></>,
|
391
|
396
|
},
|
392
|
397
|
{
|
393
|
398
|
title: '电话',
|
|
@@ -411,7 +416,7 @@ function body (props) {
|
411
|
416
|
title: '所属渠道',
|
412
|
417
|
dataIndex: 'channelName',
|
413
|
418
|
key: 'channelName',
|
414
|
|
- render: (_, record) => <><span>{record.channelName }</span></>,
|
|
419
|
+ render: (_, record) => <><span>{record.channelName}</span></>,
|
415
|
420
|
},
|
416
|
421
|
{
|
417
|
422
|
title: '操作',
|
|
@@ -451,16 +456,16 @@ function body (props) {
|
451
|
456
|
return (
|
452
|
457
|
<>
|
453
|
458
|
<Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
|
454
|
|
- <Form.Item>
|
|
459
|
+ <Form.Item>
|
455
|
460
|
{getFieldDecorator('channelId')(
|
456
|
|
- <ChannelSelect />
|
457
|
|
- // <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
|
458
|
|
- // <option value="">全部</option>
|
459
|
|
- // {data.channelNmae.map(Item =>
|
460
|
|
- // <Option value={Item.channelId}> {Item.channelName} </Option>,
|
461
|
|
- // )}
|
462
|
|
-
|
463
|
|
- // </Select>,
|
|
461
|
+ <ChannelSelect />
|
|
462
|
+ // <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
|
|
463
|
+ // <option value="">全部</option>
|
|
464
|
+ // {data.channelNmae.map(Item =>
|
|
465
|
+ // <Option value={Item.channelId}> {Item.channelName} </Option>,
|
|
466
|
+ // )}
|
|
467
|
+
|
|
468
|
+ // </Select>,
|
464
|
469
|
)}
|
465
|
470
|
</Form.Item>
|
466
|
471
|
<Form.Item>
|