|
@@ -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,11 +70,11 @@ class ModalTable extends React.Component {
|
70
|
70
|
}
|
71
|
71
|
|
72
|
72
|
// 分页
|
73
|
|
- onChange(pageNum) {
|
|
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: '头像',
|
|
@@ -153,12 +153,12 @@ class InviteTable extends React.Component {
|
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,16 +168,16 @@ 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) {
|
|
180
|
+ getList (params) {
|
181
|
181
|
const { customerId } = this.props.visibleData
|
182
|
182
|
if (customerId === '' || customerId === undefined) {
|
183
|
183
|
return
|
|
@@ -198,11 +198,11 @@ class InviteTable extends React.Component {
|
198
|
198
|
}
|
199
|
199
|
|
200
|
200
|
// 分页
|
201
|
|
- onChange(pageNum) {
|
|
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: '头像',
|
|
@@ -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
|
321
|
getList({ pageNumber: pageNum, pageSize: 10 })
|
322
|
322
|
}
|
323
|
323
|
|
324
|
|
- function toAudit(cuurentId) {
|
|
324
|
+ /**
|
|
325
|
+ * 重置搜索
|
|
326
|
+ */
|
|
327
|
+ function handleReset () {
|
|
328
|
+ props.form.resetFields();
|
|
329
|
+ }
|
|
330
|
+
|
|
331
|
+ function toAudit (cuurentId) {
|
325
|
332
|
router.push({
|
326
|
333
|
pathname: '/customer/recommendCustomer/audit',
|
327
|
334
|
query: {
|
|
@@ -330,7 +337,7 @@ function body(props) {
|
330
|
337
|
})
|
331
|
338
|
}
|
332
|
339
|
|
333
|
|
- function exportIndependen() {
|
|
340
|
+ function exportIndependen () {
|
334
|
341
|
request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
|
335
|
342
|
.then(response => {
|
336
|
343
|
download(response)
|
|
@@ -339,7 +346,7 @@ function body(props) {
|
339
|
346
|
})
|
340
|
347
|
}
|
341
|
348
|
|
342
|
|
- function download(data) {
|
|
349
|
+ function download (data) {
|
343
|
350
|
if (!data) {
|
344
|
351
|
return
|
345
|
352
|
}
|
|
@@ -429,13 +436,16 @@ function body(props) {
|
429
|
436
|
/>,
|
430
|
437
|
)}
|
431
|
438
|
</Form.Item>
|
432
|
|
- <Form.Item style={{ position:'absolute',right:'38px' }} >
|
|
439
|
+ <Form.Item style={{ position: 'absolute', right: '38px' }} >
|
433
|
440
|
<Button type="primary" htmlType="submit" >
|
434
|
441
|
搜索
|
435
|
442
|
</Button>
|
|
443
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
444
|
+ 重置
|
|
445
|
+ </Button>
|
436
|
446
|
</Form.Item>
|
437
|
447
|
</Form>
|
438
|
|
- <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0' }}>
|
|
448
|
+ <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0' }}>
|
439
|
449
|
导出
|
440
|
450
|
</Button>
|
441
|
451
|
<Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
|