|
@@ -28,7 +28,7 @@ function body(props) {
|
28
|
28
|
|
29
|
29
|
// 默认私客
|
30
|
30
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
31
|
|
- const [customerType, setCustomerType] = useState('private')
|
|
31
|
+ const [customerType, setCustomerType] = useState('helpSucceed')
|
32
|
32
|
|
33
|
33
|
// 调整归属 ============ start
|
34
|
34
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -46,13 +46,15 @@ function body(props) {
|
46
|
46
|
// 变更状态 ============= end
|
47
|
47
|
|
48
|
48
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
49
|
+ const { helpActivityId } = props.location.query
|
49
|
50
|
useEffect(() => {
|
50
|
|
- getList({ pageNumber: 1, pageSize: 10, customerType })
|
|
51
|
+ console.log('customerType', customerType)
|
|
52
|
+ getList({ pageNumber: 1, pageSize: 10, status: customerType, helpActivityId })
|
51
|
53
|
}, [])
|
52
|
54
|
|
53
|
55
|
function getList(params) {
|
54
|
56
|
// 网路请求
|
55
|
|
- request({ ...apis.customer.customerRecommend, params: { ...params } }).then(res => {
|
|
57
|
+ request({ ...apis.helpActivity.record, params: { ...params } }).then(res => {
|
56
|
58
|
setDataSource(res)
|
57
|
59
|
}).catch(err => {
|
58
|
60
|
// eslint-disable-next-line no-unused-expressions
|
|
@@ -104,8 +106,8 @@ function body(props) {
|
104
|
106
|
|
105
|
107
|
const { value } = e.target
|
106
|
108
|
setCustomerType(value)
|
107
|
|
- //setColumns(value === 'private' ? privateColumns : publicColumns)
|
108
|
|
- getList({ pageNumber: 1, pageSize: 10, customerType: value })
|
|
109
|
+ // setColumns(value === 'helpSucceed' ? privateColumns : publicColumns)
|
|
110
|
+ getList({ pageNumber: 1, pageSize: 10, status: value, helpActivityId })
|
109
|
111
|
}
|
110
|
112
|
|
111
|
113
|
function handleReset() {
|
|
@@ -168,106 +170,80 @@ function body(props) {
|
168
|
170
|
|
169
|
171
|
const publicColumns = [
|
170
|
172
|
{
|
171
|
|
- title: '头像',
|
172
|
|
- dataIndex: 'picture',
|
173
|
|
- key: 'picture',
|
|
173
|
+ title: '发起者',
|
|
174
|
+ dataIndex: 'name',
|
|
175
|
+ key: 'name',
|
174
|
176
|
align: 'center',
|
175
|
177
|
width: '15%',
|
176
|
|
- render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
177
|
178
|
},
|
178
|
179
|
{
|
179
|
|
- title: '姓名',
|
180
|
|
- dataIndex: 'name',
|
181
|
|
- key: 'name',
|
|
180
|
+ title: '发起者手机号',
|
|
181
|
+ dataIndex: 'phone',
|
|
182
|
+ key: 'phone',
|
182
|
183
|
align: 'center',
|
183
|
184
|
width: '10%',
|
184
|
|
- // eslint-disable-next-line no-nested-ternary
|
185
|
|
- render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
|
186
|
185
|
},
|
187
|
186
|
{
|
188
|
|
- title: '电话',
|
189
|
|
- dataIndex: 'phone',
|
190
|
|
- key: 'phone',
|
|
187
|
+ title: '发起时间',
|
|
188
|
+ dataIndex: 'createDate',
|
|
189
|
+ key: 'createDate',
|
191
|
190
|
align: 'center',
|
192
|
191
|
width: '15%',
|
193
|
192
|
},
|
194
|
193
|
{
|
195
|
|
- title: '推广人员',
|
196
|
|
- dataIndex: 'sharePersonName',
|
197
|
|
- key: 'sharePersonName',
|
|
194
|
+ title: '助力者',
|
|
195
|
+ dataIndex: 'helpCount',
|
|
196
|
+ key: 'helpCount',
|
198
|
197
|
align: 'center',
|
199
|
198
|
width: '15%',
|
|
199
|
+ render: (text, record) => <a style={ { color: '#66B3FF' } } >{record.helpCount}/{record.persionNumCount}</a>,
|
200
|
200
|
},
|
201
|
201
|
]
|
202
|
202
|
|
203
|
203
|
const privateColumns = [
|
204
|
204
|
{
|
205
|
|
- title: '头像',
|
206
|
|
- dataIndex: 'picture',
|
207
|
|
- key: 'picture',
|
208
|
|
- align: 'center',
|
209
|
|
- width: '15%',
|
210
|
|
- render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
211
|
|
- },
|
212
|
|
- {
|
213
|
|
- title: '姓名',
|
|
205
|
+ title: '发起者',
|
214
|
206
|
dataIndex: 'name',
|
215
|
207
|
key: 'name',
|
216
|
208
|
align: 'center',
|
217
|
|
- width: '10%',
|
218
|
|
- // eslint-disable-next-line no-nested-ternary
|
219
|
|
- render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
|
|
209
|
+ width: '15%',
|
|
210
|
+ // render: (_, record) => <Avatar shape="square" src={customerType === 'helpSucceed' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
220
|
211
|
},
|
221
|
212
|
{
|
222
|
|
- title: '电话',
|
|
213
|
+ title: '手机号',
|
223
|
214
|
dataIndex: 'phone',
|
224
|
215
|
key: 'phone',
|
225
|
216
|
align: 'center',
|
226
|
|
- width: '15%',
|
227
|
|
- },
|
228
|
|
- {
|
229
|
|
- title: '性别',
|
230
|
|
- dataIndex: 'sex',
|
231
|
|
- key: 'sex',
|
232
|
|
- align: 'center',
|
233
|
217
|
width: '10%',
|
234
|
218
|
// eslint-disable-next-line no-nested-ternary
|
235
|
|
- render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
|
|
219
|
+ // render: (_, record) => <><span>{customerType === 'helpSucceed' ? record.name : record.nickname}</span></>,
|
236
|
220
|
},
|
237
|
221
|
{
|
238
|
|
- title: '置业顾问',
|
239
|
|
- dataIndex: 'consultantName',
|
240
|
|
- key: 'consultantName',
|
|
222
|
+ title: '发起时间',
|
|
223
|
+ dataIndex: 'createDate',
|
|
224
|
+ key: 'createDate',
|
241
|
225
|
align: 'center',
|
242
|
|
- width: '15%',
|
|
226
|
+ width: '10%',
|
243
|
227
|
// eslint-disable-next-line no-nested-ternary
|
244
|
|
- render: (_, record) => (
|
245
|
|
- <>
|
246
|
|
- <span>{record.consultantName}</span>
|
247
|
|
- <br />
|
248
|
|
- <span>{record.consultTel}</span>
|
249
|
|
- </>
|
250
|
|
- ),
|
251
|
228
|
},
|
252
|
229
|
{
|
253
|
|
- title: '推广人员',
|
254
|
|
- dataIndex: 'sharePersonName',
|
255
|
|
- key: 'sharePersonName',
|
|
230
|
+ title: '助力者',
|
|
231
|
+ dataIndex: 'helpCount',
|
|
232
|
+ key: 'helpCount',
|
256
|
233
|
align: 'center',
|
257
|
234
|
width: '15%',
|
|
235
|
+ render: (text, record) => <a style={ { color: '#66B3FF' } } >{record.helpCount}人</a>,
|
258
|
236
|
},
|
259
|
237
|
{
|
260
|
|
- title: '客户状态',
|
|
238
|
+ title: '核销状态',
|
261
|
239
|
dataIndex: 'reportRecommendStatus',
|
262
|
240
|
key: 'reportRecommendStatus',
|
263
|
241
|
align: 'center',
|
264
|
242
|
width: '10%',
|
265
|
243
|
// eslint-disable-next-line no-nested-ternary
|
266
|
244
|
render: (text, records) => {
|
267
|
|
- if (records.status === 1) { return '报备' }
|
268
|
|
- if (records.status === 2) { return '到访' }
|
269
|
|
- if (records.status === 3) { return '认筹' }
|
270
|
|
- if (records.status === 4) { return '签约' }
|
|
245
|
+ if (records.verificationStatus === 0) { return '未核销' }
|
|
246
|
+ if (records.verificationStatus === 1) { return '已核销' }
|
271
|
247
|
},
|
272
|
248
|
},
|
273
|
249
|
{
|
|
@@ -276,7 +252,15 @@ function body(props) {
|
276
|
252
|
key: 'customerId',
|
277
|
253
|
align: 'center',
|
278
|
254
|
width: '25%',
|
279
|
|
- // eslint-disable-next-line no-nested-ternary
|
|
255
|
+ render: (x, row) => (
|
|
256
|
+ <>
|
|
257
|
+ {row.verificationStatus === 0 &&
|
|
258
|
+ <AuthButton name="admin.SignList.get" noRight={null}>
|
|
259
|
+ <span style={{ color: '#1990FF', cursor: 'pointer' }}>核销</span>
|
|
260
|
+ </AuthButton>
|
|
261
|
+ }
|
|
262
|
+ </>
|
|
263
|
+ ),
|
280
|
264
|
},
|
281
|
265
|
]
|
282
|
266
|
|
|
@@ -308,18 +292,18 @@ function body(props) {
|
308
|
292
|
导出
|
309
|
293
|
</Button>
|
310
|
294
|
|
311
|
|
- <div style={{ margin: '20px 0'}}>
|
|
295
|
+ <div style={{ margin: '20px 0' }}>
|
312
|
296
|
<AuthButton name="admin.customer.recommend.get" noRight={null}>
|
313
|
297
|
<Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
|
314
|
|
- <Radio.Button value="private">助力成功</Radio.Button>
|
315
|
|
- <Radio.Button value="public">进行中</Radio.Button>
|
316
|
|
- <Radio.Button value="error ">助力失败</Radio.Button>
|
|
298
|
+ <Radio.Button value="helpSucceed">助力成功</Radio.Button>
|
|
299
|
+ <Radio.Button value="helpUnderway">进行中</Radio.Button>
|
|
300
|
+ <Radio.Button value="helpUnfinished ">助力失败</Radio.Button>
|
317
|
301
|
</Radio.Group>
|
318
|
302
|
</AuthButton>
|
319
|
303
|
</div>
|
320
|
|
- {customerType === 'private' ?
|
321
|
|
- <Table dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
|
322
|
|
- <Table dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
|
|
304
|
+ {customerType === 'helpSucceed' ?
|
|
305
|
+ <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
|
|
306
|
+ <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
|
323
|
307
|
}
|
324
|
308
|
</>
|
325
|
309
|
);
|