|
@@ -18,17 +18,17 @@ class ModalTable extends React.Component {
|
18
|
18
|
constructor(props) {
|
19
|
19
|
super(props);
|
20
|
20
|
this.state = {
|
21
|
|
- dataSource: { records: [] },
|
22
|
|
- visibleData: { visible: false, customerId: '', realtyConsultant: '' },
|
|
21
|
+ dataSource: { records: [] },
|
|
22
|
+ visibleData: { visible: false, customerId: '', realtyConsultant: '' },
|
23
|
23
|
}
|
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) {
|
|
@@ -69,17 +69,17 @@ class ModalTable extends React.Component {
|
69
|
69
|
})
|
70
|
70
|
}
|
71
|
71
|
|
72
|
|
- // 分页
|
73
|
|
- onChange(pageNum) {
|
|
72
|
+ // 分页
|
|
73
|
+ onChange (pageNum) {
|
74
|
74
|
this.getList({ pageNumber: pageNum, pageSize: 5 })
|
75
|
75
|
}
|
76
|
76
|
|
77
|
|
- render() {
|
|
77
|
+ render () {
|
78
|
78
|
const columns = [
|
79
|
79
|
{
|
80
|
80
|
title: '头像',
|
81
|
81
|
// eslint-disable-next-line jsx-a11y/alt-text
|
82
|
|
- render: (text, records) => <img src={records.picture } width={50} height={50} />,
|
|
82
|
+ render: (text, records) => <img src={records.picture} width={50} height={50} />,
|
83
|
83
|
},
|
84
|
84
|
{
|
85
|
85
|
title: '用户名',
|
|
@@ -95,7 +95,7 @@ class ModalTable extends React.Component {
|
95
|
95
|
title: '性别',
|
96
|
96
|
dataIndex: 'sex',
|
97
|
97
|
key: 'sex',
|
98
|
|
- render: (text, records) => <span>{ records.sex === 1 ? '男' : '女' }</span>,
|
|
98
|
+ render: (text, records) => <span>{records.sex === 1 ? '男' : '女'}</span>,
|
99
|
99
|
},
|
100
|
100
|
{
|
101
|
101
|
title: '意向项目',
|
|
@@ -111,29 +111,29 @@ class ModalTable extends React.Component {
|
111
|
111
|
title: '状态',
|
112
|
112
|
// eslint-disable-next-line consistent-return
|
113
|
113
|
render: (text, records) => {
|
114
|
|
- if (records.status === 1) { return '报备' }
|
115
|
|
- if (records.status === 2) { return '到访' }
|
116
|
|
- if (records.status === 3) { return '认购' }
|
117
|
|
- if (records.status === 4) { return '签约' }
|
118
|
|
- if (records.verifyStatus === 1) { return '待审核' }
|
119
|
|
- if (records.verifyStatus === 2) { return '审核同意' }
|
120
|
|
- if (records.verifyStatus === 3) { return '签约' }
|
121
|
|
- },
|
|
114
|
+ if (records.status === 1) { return '报备' }
|
|
115
|
+ if (records.status === 2) { return '到访' }
|
|
116
|
+ if (records.status === 3) { return '认购' }
|
|
117
|
+ if (records.status === 4) { return '签约' }
|
|
118
|
+ if (records.verifyStatus === 1) { return '待审核' }
|
|
119
|
+ if (records.verifyStatus === 2) { return '审核同意' }
|
|
120
|
+ if (records.verifyStatus === 3) { return '签约' }
|
|
121
|
+ },
|
122
|
122
|
},
|
123
|
123
|
]
|
124
|
124
|
return (
|
125
|
125
|
<>
|
126
|
126
|
<Modal
|
127
|
|
- title="推荐客户"
|
128
|
|
- destroyOnClose="true"
|
129
|
|
- width={900}
|
130
|
|
- footer={null}
|
131
|
|
- visible={this.state.visibleData.visible}
|
132
|
|
- // onOk={() => this.handleOk()}
|
133
|
|
- onCancel={(e) => this.handleCancel(e)}
|
134
|
|
- >
|
135
|
|
- <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
|
136
|
|
- </Modal>
|
|
127
|
+ title="推荐客户"
|
|
128
|
+ destroyOnClose="true"
|
|
129
|
+ width={900}
|
|
130
|
+ footer={null}
|
|
131
|
+ visible={this.state.visibleData.visible}
|
|
132
|
+ // onOk={() => this.handleOk()}
|
|
133
|
+ onCancel={(e) => this.handleCancel(e)}
|
|
134
|
+ >
|
|
135
|
+ <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
|
|
136
|
+ </Modal>
|
137
|
137
|
</>
|
138
|
138
|
);
|
139
|
139
|
}
|
|
@@ -147,18 +147,18 @@ class InviteTable extends React.Component {
|
147
|
147
|
constructor(props) {
|
148
|
148
|
super(props);
|
149
|
149
|
this.state = {
|
150
|
|
- dataSource: { records: [] },
|
151
|
|
- visibleData: { visible: false, customerId: '', realtyConsultant: '' },
|
|
150
|
+ dataSource: { records: [] },
|
|
151
|
+ visibleData: { visible: false, customerId: '', realtyConsultant: '' },
|
152
|
152
|
}
|
153
|
153
|
}
|
154
|
154
|
|
155
|
155
|
// 挂载之后
|
156
|
|
- componentDidMount() {
|
|
156
|
+ componentDidMount () {
|
157
|
157
|
const { customerId } = this.state.visibleData
|
158
|
158
|
this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
|
159
|
159
|
}
|
160
|
160
|
|
161
|
|
- componentDidUpdate(preProps, preState) {
|
|
161
|
+ componentDidUpdate (preProps, preState) {
|
162
|
162
|
const { customerId } = this.state.visibleData
|
163
|
163
|
if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
|
164
|
164
|
this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
|
|
@@ -168,17 +168,17 @@ class InviteTable extends React.Component {
|
168
|
168
|
|
169
|
169
|
// 弹框确定按钮
|
170
|
170
|
// eslint-disable-next-line react/sort-comp
|
171
|
|
- handleOk() {
|
|
171
|
+ handleOk () {
|
172
|
172
|
this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
173
|
173
|
}
|
174
|
174
|
|
175
|
175
|
// 弹框取消按钮
|
176
|
|
- handleCancel() {
|
|
176
|
+ handleCancel () {
|
177
|
177
|
this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
178
|
178
|
}
|
179
|
179
|
|
180
|
|
- getList(params) {
|
181
|
|
- const { customerId } = this.props.visibleData
|
|
180
|
+ getList (params) {
|
|
181
|
+ const { customerId } = this.props.visibleData
|
182
|
182
|
if (customerId === '' || customerId === undefined) {
|
183
|
183
|
return
|
184
|
184
|
}
|
|
@@ -197,19 +197,19 @@ class InviteTable extends React.Component {
|
197
|
197
|
})
|
198
|
198
|
}
|
199
|
199
|
|
200
|
|
- // 分页
|
201
|
|
- onChange(pageNum) {
|
|
200
|
+ // 分页
|
|
201
|
+ onChange (pageNum) {
|
202
|
202
|
this.getList({ pageNumber: pageNum, pageSize: 5 })
|
203
|
203
|
}
|
204
|
204
|
|
205
|
|
- render() {
|
|
205
|
+ render () {
|
206
|
206
|
const columns = [
|
207
|
207
|
{
|
208
|
208
|
title: '头像',
|
209
|
209
|
dataIndex: 'img',
|
210
|
210
|
key: 'img',
|
211
|
211
|
align: 'center',
|
212
|
|
- render: (text, record) => <img src={record.avatarurl} width = {50} height = {50}/>,
|
|
212
|
+ render: (text, record) => <img src={record.avatarurl} width={50} height={50} />,
|
213
|
213
|
},
|
214
|
214
|
{
|
215
|
215
|
title: '用户姓名',
|
|
@@ -229,22 +229,22 @@ class InviteTable extends React.Component {
|
229
|
229
|
dataIndex: 'sex',
|
230
|
230
|
key: 'sex',
|
231
|
231
|
align: 'center',
|
232
|
|
- render: (text, list) => <span>{ list.sex === 1 ? '男' : '女' }</span>,
|
|
232
|
+ render: (text, list) => <span>{list.sex === 1 ? '男' : '女'}</span>,
|
233
|
233
|
},
|
234
|
234
|
]
|
235
|
235
|
return (
|
236
|
236
|
<>
|
237
|
237
|
<Modal
|
238
|
|
- title="推荐客户"
|
239
|
|
- destroyOnClose="true"
|
240
|
|
- width={900}
|
241
|
|
- footer={null}
|
242
|
|
- visible={this.state.visibleData.visible}
|
243
|
|
- // onOk={() => this.handleOk()}
|
244
|
|
- onCancel={(e) => this.handleCancel(e)}
|
245
|
|
- >
|
246
|
|
- <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
|
247
|
|
- </Modal>
|
|
238
|
+ title="推荐客户"
|
|
239
|
+ destroyOnClose="true"
|
|
240
|
+ width={900}
|
|
241
|
+ footer={null}
|
|
242
|
+ visible={this.state.visibleData.visible}
|
|
243
|
+ // onOk={() => this.handleOk()}
|
|
244
|
+ onCancel={(e) => this.handleCancel(e)}
|
|
245
|
+ >
|
|
246
|
+ <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
|
|
247
|
+ </Modal>
|
248
|
248
|
</>
|
249
|
249
|
);
|
250
|
250
|
}
|
|
@@ -256,7 +256,7 @@ class InviteTable extends React.Component {
|
256
|
256
|
* @param {*} props
|
257
|
257
|
* @returns
|
258
|
258
|
*/
|
259
|
|
-function body(props) {
|
|
259
|
+function body (props) {
|
260
|
260
|
const { getFieldDecorator } = props.form
|
261
|
261
|
|
262
|
262
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -268,7 +268,7 @@ function body(props) {
|
268
|
268
|
}, [])
|
269
|
269
|
|
270
|
270
|
|
271
|
|
- function openNotificationWithIcon(type, message) {
|
|
271
|
+ function openNotificationWithIcon (type, message) {
|
272
|
272
|
notification[type]({
|
273
|
273
|
message,
|
274
|
274
|
description:
|
|
@@ -276,7 +276,7 @@ function body(props) {
|
276
|
276
|
});
|
277
|
277
|
}
|
278
|
278
|
|
279
|
|
- function getList(params) {
|
|
279
|
+ function getList (params) {
|
280
|
280
|
// 网路请求
|
281
|
281
|
request({ ...apis.customer.agents, params: { ...params } }).then(res => {
|
282
|
282
|
setDataSource(res)
|
|
@@ -286,7 +286,7 @@ function body(props) {
|
286
|
286
|
}
|
287
|
287
|
|
288
|
288
|
// 提交事件
|
289
|
|
- function handleSubmit(e) {
|
|
289
|
+ function handleSubmit (e) {
|
290
|
290
|
e.preventDefault();
|
291
|
291
|
props.form.validateFields((err, values) => {
|
292
|
292
|
if (!err) {
|
|
@@ -299,29 +299,36 @@ function body(props) {
|
299
|
299
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
300
|
300
|
const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
|
301
|
301
|
// Change 事件
|
302
|
|
- function handleSelectChange(e) {
|
|
302
|
+ function handleSelectChange (e) {
|
303
|
303
|
// eslint-disable-next-line no-console
|
304
|
304
|
console.log(e)
|
305
|
305
|
}
|
306
|
|
- function gM(row) {
|
|
306
|
+ function gM (row) {
|
307
|
307
|
setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
|
308
|
308
|
|
309
|
309
|
setGInviteData({ visible: false })
|
310
|
310
|
}
|
311
|
311
|
|
312
|
|
- function Invite(row) {
|
|
312
|
+ function Invite (row) {
|
313
|
313
|
setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
|
314
|
314
|
|
315
|
315
|
setGVisibleData({ visible: false })
|
316
|
316
|
}
|
317
|
317
|
|
318
|
318
|
// 分页
|
319
|
|
- function onChange(pageNum) {
|
|
319
|
+ function onChange (pageNum) {
|
320
|
320
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
321
|
|
- getList({ pageNumber: pageNum, pageSize: 10 })
|
|
321
|
+ getList({ pageNumber: pageNum, pageSize: 10 })
|
|
322
|
+ }
|
|
323
|
+
|
|
324
|
+ /**
|
|
325
|
+ * 重置搜索
|
|
326
|
+ */
|
|
327
|
+ function handleReset () {
|
|
328
|
+ props.form.resetFields();
|
322
|
329
|
}
|
323
|
330
|
|
324
|
|
- function toAudit(cuurentId) {
|
|
331
|
+ function toAudit (cuurentId) {
|
325
|
332
|
router.push({
|
326
|
333
|
pathname: '/customer/recommendCustomer/audit',
|
327
|
334
|
query: {
|
|
@@ -330,16 +337,16 @@ function body(props) {
|
330
|
337
|
})
|
331
|
338
|
}
|
332
|
339
|
|
333
|
|
- function exportIndependen() {
|
|
340
|
+ function exportIndependen () {
|
334
|
341
|
request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
|
335
|
|
- .then(response => {
|
336
|
|
- download(response)
|
337
|
|
- }).catch(error => {
|
|
342
|
+ .then(response => {
|
|
343
|
+ download(response)
|
|
344
|
+ }).catch(error => {
|
338
|
345
|
|
339
|
|
- })
|
|
346
|
+ })
|
340
|
347
|
}
|
341
|
348
|
|
342
|
|
- function download(data) {
|
|
349
|
+ function download (data) {
|
343
|
350
|
if (!data) {
|
344
|
351
|
return
|
345
|
352
|
}
|
|
@@ -374,13 +381,13 @@ function body(props) {
|
374
|
381
|
dataIndex: 'gender',
|
375
|
382
|
key: 'gender',
|
376
|
383
|
// eslint-disable-next-line no-nested-ternary
|
377
|
|
- render: (_, record) => <><span>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</span></>,
|
|
384
|
+ render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
|
378
|
385
|
},
|
379
|
386
|
{
|
380
|
387
|
title: '类型',
|
381
|
388
|
dataIndex: 'personType',
|
382
|
389
|
key: 'personType',
|
383
|
|
- render: (_, record) => <><span>{ record.channelName !== null ? '渠道经纪人' : '独立经纪人' }</span></>,
|
|
390
|
+ render: (_, record) => <><span>{record.channelName !== null ? '渠道经纪人' : '独立经纪人'}</span></>,
|
384
|
391
|
},
|
385
|
392
|
{
|
386
|
393
|
title: '所属渠道',
|
|
@@ -412,7 +419,7 @@ function body(props) {
|
412
|
419
|
|
413
|
420
|
return (
|
414
|
421
|
<>
|
415
|
|
- <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
422
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
|
416
|
423
|
<Form.Item>
|
417
|
424
|
{getFieldDecorator('name')(
|
418
|
425
|
<Input
|
|
@@ -429,19 +436,22 @@ function body(props) {
|
429
|
436
|
/>,
|
430
|
437
|
)}
|
431
|
438
|
</Form.Item>
|
432
|
|
- <Form.Item>
|
433
|
|
- <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
|
434
|
|
- 搜索
|
|
439
|
+ <Form.Item style={{ position: 'absolute', right: '38px' }} >
|
|
440
|
+ <Button type="primary" htmlType="submit" >
|
|
441
|
+ 搜索
|
|
442
|
+ </Button>
|
|
443
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
444
|
+ 重置
|
435
|
445
|
</Button>
|
436
|
446
|
</Form.Item>
|
437
|
447
|
</Form>
|
438
|
|
- <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
|
439
|
|
- 导出数据
|
|
448
|
+ <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0' }}>
|
|
449
|
+ 导出
|
440
|
450
|
</Button>
|
441
|
451
|
<Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
|
442
|
|
- {/* 调整归属 */}
|
443
|
|
- <ModalTable visibleData={gVisibleData} />
|
444
|
|
- <InviteTable visibleData={gInviteData} />
|
|
452
|
+ {/* 调整归属 */}
|
|
453
|
+ <ModalTable visibleData={gVisibleData} />
|
|
454
|
+ <InviteTable visibleData={gInviteData} />
|
445
|
455
|
</>
|
446
|
456
|
);
|
447
|
457
|
}
|