dingxin 5 年前
父节点
当前提交
ccd0c9591a
共有 3 个文件被更改,包括 61 次插入72 次删除
  1. 52
    68
      src/pages/activity/helpActivity/helpRecord.jsx
  2. 4
    4
      src/pages/activity/helpActivity/list.jsx
  3. 5
    0
      src/services/apis.js

+ 52
- 68
src/pages/activity/helpActivity/helpRecord.jsx 查看文件

28
 
28
 
29
   // 默认私客
29
   // 默认私客
30
   // eslint-disable-next-line react-hooks/rules-of-hooks
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
   // 调整归属 ============  start
33
   // 调整归属 ============  start
34
   // eslint-disable-next-line react-hooks/rules-of-hooks
34
   // eslint-disable-next-line react-hooks/rules-of-hooks
46
   // 变更状态 ============= end
46
   // 变更状态 ============= end
47
 
47
 
48
   // eslint-disable-next-line react-hooks/rules-of-hooks
48
   // eslint-disable-next-line react-hooks/rules-of-hooks
49
+  const { helpActivityId } = props.location.query
49
   useEffect(() => {
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
   function getList(params) {
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
       setDataSource(res)
58
       setDataSource(res)
57
     }).catch(err => {
59
     }).catch(err => {
58
       // eslint-disable-next-line no-unused-expressions
60
       // eslint-disable-next-line no-unused-expressions
104
 
106
 
105
     const { value } = e.target
107
     const { value } = e.target
106
     setCustomerType(value)
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
   function handleReset() {
113
   function handleReset() {
168
 
170
 
169
   const publicColumns = [
171
   const publicColumns = [
170
     {
172
     {
171
-      title: '头像',
172
-      dataIndex: 'picture',
173
-      key: 'picture',
173
+      title: '发起者',
174
+      dataIndex: 'name',
175
+      key: 'name',
174
       align: 'center',
176
       align: 'center',
175
       width: '15%',
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
       align: 'center',
183
       align: 'center',
183
       width: '10%',
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
       align: 'center',
190
       align: 'center',
192
       width: '15%',
191
       width: '15%',
193
     },
192
     },
194
     {
193
     {
195
-      title: '推广人员',
196
-      dataIndex: 'sharePersonName',
197
-      key: 'sharePersonName',
194
+      title: '助力者',
195
+      dataIndex: 'helpCount',
196
+      key: 'helpCount',
198
       align: 'center',
197
       align: 'center',
199
       width: '15%',
198
       width: '15%',
199
+      render: (text, record) => <a style={ { color: '#66B3FF' } } >{record.helpCount}/{record.persionNumCount}</a>,
200
     },
200
     },
201
   ]
201
   ]
202
 
202
 
203
   const privateColumns = [
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
       dataIndex: 'name',
206
       dataIndex: 'name',
215
       key: 'name',
207
       key: 'name',
216
       align: 'center',
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
       dataIndex: 'phone',
214
       dataIndex: 'phone',
224
       key: 'phone',
215
       key: 'phone',
225
       align: 'center',
216
       align: 'center',
226
-      width: '15%',
227
-    },
228
-    {
229
-      title: '性别',
230
-      dataIndex: 'sex',
231
-      key: 'sex',
232
-      align: 'center',
233
       width: '10%',
217
       width: '10%',
234
       // eslint-disable-next-line no-nested-ternary
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
       align: 'center',
225
       align: 'center',
242
-      width: '15%',
226
+      width: '10%',
243
       // eslint-disable-next-line no-nested-ternary
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
       align: 'center',
233
       align: 'center',
257
       width: '15%',
234
       width: '15%',
235
+      render: (text, record) => <a style={ { color: '#66B3FF' } } >{record.helpCount}人</a>,
258
     },
236
     },
259
     {
237
     {
260
-      title: '客户状态',
238
+      title: '核销状态',
261
       dataIndex: 'reportRecommendStatus',
239
       dataIndex: 'reportRecommendStatus',
262
       key: 'reportRecommendStatus',
240
       key: 'reportRecommendStatus',
263
       align: 'center',
241
       align: 'center',
264
       width: '10%',
242
       width: '10%',
265
       // eslint-disable-next-line no-nested-ternary
243
       // eslint-disable-next-line no-nested-ternary
266
       render: (text, records) => {
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
       key: 'customerId',
252
       key: 'customerId',
277
       align: 'center',
253
       align: 'center',
278
       width: '25%',
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
         导出
292
         导出
309
       </Button>
293
       </Button>
310
 
294
 
311
-      <div style={{ margin: '20px 0'}}>
295
+      <div style={{ margin: '20px 0' }}>
312
         <AuthButton name="admin.customer.recommend.get" noRight={null}>
296
         <AuthButton name="admin.customer.recommend.get" noRight={null}>
313
           <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
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
           </Radio.Group>
301
           </Radio.Group>
318
         </AuthButton>
302
         </AuthButton>
319
       </div>
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
   );

+ 4
- 4
src/pages/activity/helpActivity/list.jsx 查看文件

94
           {row.status === 1 &&
94
           {row.status === 1 &&
95
           <AuthButton name="admin.SignList.get" noRight={null}>
95
           <AuthButton name="admin.SignList.get" noRight={null}>
96
         
96
         
97
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.dynamicId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
97
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
98
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
98
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
99
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
99
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
111
 
111
 
112
           {row.status === 2 &&
112
           {row.status === 2 &&
113
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
113
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
114
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.dynamicId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
114
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
115
            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
115
            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
116
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
116
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
117
         </AuthButton>
117
         </AuthButton>
120
       ),
120
       ),
121
     },
121
     },
122
   ];
122
   ];
123
-  const getSignList = (dynamicId) => {
123
+  const getSignList = helpActivityId => {
124
       router.push({
124
       router.push({
125
           pathname: '/activity/helpActivity/helpRecord',
125
           pathname: '/activity/helpActivity/helpRecord',
126
           query: {
126
           query: {
127
-              dynamicId
127
+            helpActivityId,
128
           },
128
           },
129
         });
129
         });
130
   }
130
   }

+ 5
- 0
src/services/apis.js 查看文件

704
     method: 'post',
704
     method: 'post',
705
     action: 'admin.taRole.get',
705
     action: 'admin.taRole.get',
706
   },
706
   },
707
+  record: {
708
+    url: `${prefix}/helpRecord`,
709
+    method: 'get',
710
+    action: 'admin.taRole.get',
711
+  },
707
  },
712
  },
708
  third: {
713
  third: {
709
   thirdPartyMiniapp: {
714
   thirdPartyMiniapp: {