dingxin 5 лет назад
Родитель
Сommit
93e9078472

+ 11
- 1
src/pages/activity/drainage/Detail.jsx Просмотреть файл

21
   const [columns, setColumns] = useState([])
21
   const [columns, setColumns] = useState([])
22
   const [startDate, setStartDate] = useState('')
22
   const [startDate, setStartDate] = useState('')
23
   const [endDate, setEndDate] = useState('')
23
   const [endDate, setEndDate] = useState('')
24
+  const [total,setTotal] = useState({})
24
   let daterange = []
25
   let daterange = []
25
   // let content = {}
26
   // let content = {}
26
   useEffect(() => {
27
   useEffect(() => {
32
   function gettaDrainageRecord (params) {
33
   function gettaDrainageRecord (params) {
33
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34
       // setDatas(data)
35
       // setDatas(data)
35
-      console.log(data, '3333333333333')
36
+      setTotal(data)
37
+      console.log(data.total, '3333333333333')
36
       setDatas(tableData(data.records))
38
       setDatas(tableData(data.records))
37
       // content = data.records[0]
39
       // content = data.records[0]
38
       console.log('json: ', eval('(' + data.records[0].content + ')'))
40
       console.log('json: ', eval('(' + data.records[0].content + ')'))
86
     
88
     
87
   }
89
   }
88
 
90
 
91
+  const changePageNum = pageNumber => {
92
+    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10 ,drainageId: drainageId, startTime: fromTime(startDate) ,endTime: fromTime(endDate)})
93
+}
89
   function excelPort(){
94
   function excelPort(){
90
     // const fieldsValue = getFieldsValue()
95
     // const fieldsValue = getFieldsValue()
91
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
96
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
96
       })
101
       })
97
   }
102
   }
98
 
103
 
104
+
105
+
99
   function download (data) {
106
   function download (data) {
100
     if (!data) {
107
     if (!data) {
101
       return
108
       return
131
         {/* H5项目名称 */}
138
         {/* H5项目名称 */}
132
         {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
139
         {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
133
         <Table columns={columns} dataSource={datas}  pagination={false} />
140
         <Table columns={columns} dataSource={datas}  pagination={false} />
141
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
142
+       <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} />
143
+      </div>
134
       </div>
144
       </div>
135
 
145
 
136
 
146
 

+ 6
- 3
src/pages/activity/drainage/DrainageList.jsx Просмотреть файл

231
       visible: true,
231
       visible: true,
232
     });
232
     });
233
   };
233
   };
234
-
234
+  const changePageNum = pageNumber => {
235
+    gettaDrainage({ pageNum: pageNumber, pageSize: 10 })
236
+}
235
 
237
 
236
   function handleOk () {
238
   function handleOk () {
237
 
239
 
277
                 // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
279
                 // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
278
                 placeholder="H5项目编号"
280
                 placeholder="H5项目编号"
279
               />,
281
               />,
280
-
281
               // {getFieldDecorator('name', {
282
               // {getFieldDecorator('name', {
282
               // })(<Input/>)}
283
               // })(<Input/>)}
283
             )}
284
             )}
313
           <Forms />
314
           <Forms />
314
         </Modal>
315
         </Modal>
315
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
316
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
316
-     
317
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
318
+       <Pagination showQuickJumper defaultCurrent={1} total={datas.total} onChange={(e) => changePageNum(e)} />
319
+      </div>
317
       </div>
320
       </div>
318
     </>
321
     </>
319
   )
322
   )

+ 70
- 50
src/pages/activity/groupActivity/helpRecord.jsx Просмотреть файл

20
     super(props);
20
     super(props);
21
     this.state = {
21
     this.state = {
22
       dataSource: { records: [] },
22
       dataSource: { records: [] },
23
-      visibleData: { visible: false, customerId: '', realtyConsultant: '' },
23
+      visibleData: { visible: false, groupActivityId: '', groupStatus: ''},
24
     }
24
     }
25
   }
25
   }
26
 
26
 
27
   // 挂载之后
27
   // 挂载之后
28
   componentDidMount () {
28
   componentDidMount () {
29
-    const { customerId } = this.state.visibleData
30
-    this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
29
+    const { groupActivityId } = this.state.visibleData
30
+    this.getList({ groupActivityId: groupActivityId, groupStatus:status,  pageNumber: 1, pageSize: 5 })
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate (preProps, preState) {
33
   componentDidUpdate (preProps, preState) {
34
-    const { customerId } = this.state.visibleData
35
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
-      this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
34
+    const { groupActivityId } = this.props.visibleData
35
+    console.log("groupActivityId",this.props.visibleData);
36
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
+      this.getList({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })
37
       this.setState({ visibleData: this.props.visibleData });
38
       this.setState({ visibleData: this.props.visibleData });
38
     }
39
     }
39
   }
40
   }
41
   // 弹框确定按钮
42
   // 弹框确定按钮
42
   // eslint-disable-next-line react/sort-comp
43
   // eslint-disable-next-line react/sort-comp
43
   handleOk () {
44
   handleOk () {
44
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
45
+    this.setState({ visibleData: { visible: false, groupActivityId: '', realtyConsultant: '' } })
45
   }
46
   }
46
 
47
 
47
   // 弹框取消按钮
48
   // 弹框取消按钮
48
   handleCancel () {
49
   handleCancel () {
49
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
50
+    this.setState({ visibleData: { visible: false, groupActivityId: '', realtyConsultant: '' } })
50
   }
51
   }
51
 
52
 
52
   getList (params) {
53
   getList (params) {
53
-    request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
54
+    console.log("params",params);
55
+    request({ ...apis.groupActivity.shareChildList, params: { ...params } }).then(res => {
54
       this.setState({ dataSource: res })
56
       this.setState({ dataSource: res })
55
     }).catch(err => {
57
     }).catch(err => {
56
       // eslint-disable-next-line no-unused-expressions
58
       // eslint-disable-next-line no-unused-expressions
70
     this.getList({ pageNumber: pageNum, pageSize: 5 })
72
     this.getList({ pageNumber: pageNum, pageSize: 5 })
71
   }
73
   }
72
 
74
 
75
+  exportChildRecord(params) {
76
+    request({ ...apis.groupActivity.exportShareChildRecord, responseType: 'blob', params: { ...params} })
77
+      .then(data => {
78
+        if (!data) {
79
+          return
80
+        }
81
+        const url = window.URL.createObjectURL(new Blob([data]))
82
+        const link = document.createElement('a')
83
+        link.style.display = 'none'
84
+        link.href = url
85
+        link.setAttribute('download', '拼团发起记录.xlsx')
86
+        document.body.append(link)
87
+        link.click()
88
+      }).catch(() => {
89
+
90
+      })
91
+  }
92
+
73
   render () {
93
   render () {
74
     const columns = [
94
     const columns = [
75
       {
95
       {
76
         title: '用户姓名',
96
         title: '用户姓名',
77
-        dataIndex: 'name',
78
-        key: 'name',
97
+        dataIndex: 'nickname',
98
+        key: 'nickname',
79
         align: 'center',
99
         align: 'center',
80
       },
100
       },
81
       {
101
       {
87
       },
107
       },
88
       {
108
       {
89
         title: '开团时间',
109
         title: '开团时间',
90
-        dataIndex: 'createDate',
91
-        key: 'createDate',
110
+        dataIndex: 'createTime',
111
+        key: 'createTime',
92
         align: 'center',
112
         align: 'center',
93
       },
113
       },
94
     ]
114
     ]
103
           // onOk={() => this.handleOk()}
123
           // onOk={() => this.handleOk()}
104
           onCancel={(e) => this.handleCancel(e)}
124
           onCancel={(e) => this.handleCancel(e)}
105
         >
125
         >
126
+          <Button type="primary" onClick={() => this.exportChildRecord({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
127
+            导出
128
+          </Button>
129
+
106
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
130
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
107
         </Modal>
131
         </Modal>
108
       </>
132
       </>
111
 }
135
 }
112
 
136
 
113
 
137
 
114
-
115
-
116
-
117
-
118
-
119
 /**
138
 /**
120
- * 拼团者弹框
139
+ * 核销弹框
121
  */
140
  */
122
 class Verifier extends React.Component {
141
 class Verifier extends React.Component {
123
   constructor(props) {
142
   constructor(props) {
146
   // 弹框确定按钮
165
   // 弹框确定按钮
147
   // eslint-disable-next-line react/sort-comp
166
   // eslint-disable-next-line react/sort-comp
148
   handleOk () {
167
   handleOk () {
149
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
168
+    // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
150
   }
169
   }
151
 
170
 
152
   // 弹框取消按钮
171
   // 弹框取消按钮
153
   handleCancel () {
172
   handleCancel () {
154
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
173
+    // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
174
+    this.props.onCancel();
155
   }
175
   }
156
 
176
 
157
   getList (params) {
177
   getList (params) {
210
  * @returns
230
  * @returns
211
  */
231
  */
212
 function body(props) {
232
 function body(props) {
213
-  const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
233
+  const [gInviteData, setGInviteData] = useState({ visible: false, groupActivityId : '', recordId:'',  groupStatus: ''})
214
 
234
 
215
-  const [gVerifierData, setVerifierData] = useState({ visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '' })
235
+  const [gVerifierData, setVerifierData] = useState({ visible: false, groupActivityId: '', groupStatus: '' })
216
 
236
 
217
   const { getFieldDecorator, getFieldsValue } = props.form
237
   const { getFieldDecorator, getFieldsValue } = props.form
218
 
238
 
227
 
247
 
228
   // 调整归属 ============  start
248
   // 调整归属 ============  start
229
   // eslint-disable-next-line react-hooks/rules-of-hooks
249
   // eslint-disable-next-line react-hooks/rules-of-hooks
230
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
250
+  const [gVisibleData, setGVisibleData] = useState({ visible: false})
231
 
251
 
232
 
252
 
233
   // 变更状态 ============= end
253
   // 变更状态 ============= end
235
   // eslint-disable-next-line react-hooks/rules-of-hooks
255
   // eslint-disable-next-line react-hooks/rules-of-hooks
236
   const { groupActivityId } = props.location.query
256
   const { groupActivityId } = props.location.query
237
   useEffect(() => {
257
   useEffect(() => {
238
-    getList({ pageNumber: 1, pageSize: 10, status: groupStatus, groupActivityId: groupActivityId })
258
+    getList({ pageNumber: 1, pageSize: 10, groupStatus: groupStatus, groupActivityId: groupActivityId })
239
   }, [])
259
   }, [])
240
 
260
 
241
   
261
   
258
   }
278
   }
259
 
279
 
260
   function getList(params) {
280
   function getList(params) {
281
+    console.log(params);
261
     // 网路请求
282
     // 网路请求
262
     request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
283
     request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
263
-        console.log(res);
264
       setDataSource(res)
284
       setDataSource(res)
265
     }).catch(err => {
285
     }).catch(err => {
266
       // eslint-disable-next-line no-unused-expressions
286
       // eslint-disable-next-line no-unused-expressions
306
 
326
 
307
   // 助力成功/进行中/助力失败
327
   // 助力成功/进行中/助力失败
308
   function radioButtonHandleSizeChange(e) {
328
   function radioButtonHandleSizeChange(e) {
309
-    setGInviteData({ visible: true, customerId: '', realtyConsultant: '' })
329
+    setGInviteData({ visible: false})
310
     displayNone()
330
     displayNone()
311
 
331
 
312
     const { value } = e.target
332
     const { value } = e.target
313
     setgroupStatus(value)
333
     setgroupStatus(value)
314
-    // setColumns(value === 'helpSucceed' ? privateColumns : publicColumns)
315
     if (value == 0) { 
334
     if (value == 0) { 
316
         console.log("success", value)
335
         console.log("success", value)
317
-        getList({ pageNumber: 1, pageSize: 10, status: value, groupActivityId }) }
336
+        getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId }) }
318
     if (value == 1 || value == 2) {
337
     if (value == 1 || value == 2) {
319
         console.log("faile", value)
338
         console.log("faile", value)
320
-         getFailList({ pageNumber: 1, pageSize: 10, status: value, groupActivityId })
339
+         getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId })
321
          }
340
          }
322
   }
341
   }
323
 
342
 
335
     });
354
     });
336
   }
355
   }
337
 
356
 
338
-  function exportCustomer () {
339
-    const fieldsValue = getFieldsValue()
340
-    request({ ...apis.customer.customerRecommendExport, responseType: 'blob', params: { ...fieldsValue, groupStatus } })
341
-      .then(response => {
342
-        download(response)
343
-      }).catch(error => {
344
-
345
-      })
346
-  }
347
-
348
   function download (data) {
357
   function download (data) {
349
     if (!data) {
358
     if (!data) {
350
       return
359
       return
353
     const link = document.createElement('a')
362
     const link = document.createElement('a')
354
     link.style.display = 'none'
363
     link.style.display = 'none'
355
     link.href = url
364
     link.href = url
356
-    link.setAttribute('download', '客户列表.xlsx')
365
+    link.setAttribute('download', '拼团列表.xlsx')
357
     document.body.append(link)
366
     document.body.append(link)
358
     link.click()
367
     link.click()
359
   }
368
   }
360
 
369
 
370
+  function exportRecord () {
371
+    request({ ...apis.groupActivity.exportShareRecord, responseType: 'blob', params: {groupActivityId: groupActivityId, groupStatus: groupStatus } })
372
+      .then(response => {
373
+        download(response)
374
+      }).catch(error => {
375
+
376
+      })
377
+  }
378
+
361
 // 助力记录弹框
379
 // 助力记录弹框
362
 function helpRecord(row) {
380
 function helpRecord(row) {
363
 // 关闭核销
381
 // 关闭核销
364
 // eslint-disable-next-line max-len
382
 // eslint-disable-next-line max-len
365
-setVerifierData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
383
+  setVerifierData({ visible: false, helpRecordInitiateId: row.helpRecordInitiateId})
366
   // eslint-disable-next-line max-len
384
   // eslint-disable-next-line max-len
367
-  setGInviteData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
385
+  console.log("tttttttttt",row);
386
+  setGInviteData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: row.status, recordId: row.recordId})
368
 }
387
 }
369
  // 核销
388
  // 核销
370
  function helpInitiateRecordVerify(row) {
389
  function helpInitiateRecordVerify(row) {
371
 // 关闭助力记录弹框
390
 // 关闭助力记录弹框
372
 // eslint-disable-next-line max-len
391
 // eslint-disable-next-line max-len
373
-  setVerifierData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
392
+  setVerifierData({ visible: true, helpRecordInitiateId: row.helpRecordInitiateId})
374
   // eslint-disable-next-line max-len
393
   // eslint-disable-next-line max-len
375
-  setGInviteData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
394
+  setGInviteData({ visible: false, helpRecordInitiateId: row.helpRecordInitiateId})
376
  }
395
  }
377
 
396
 
378
   const publicColumns = [
397
   const publicColumns = [
463
         <>
482
         <>
464
           {row.verificationStatus === 0 &&
483
           {row.verificationStatus === 0 &&
465
           <AuthButton name="admin.SignList.get" noRight={null}>
484
           <AuthButton name="admin.SignList.get" noRight={null}>
466
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={() => helpInitiateRecordVerify(row)}>核销</span>
485
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={(e) => helpInitiateRecordVerify(row)}>核销</span>
467
           </AuthButton>
486
           </AuthButton>
468
         }
487
         }
469
         </>
488
         </>
480
     <>
499
     <>
481
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
500
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
482
         <Form.Item>
501
         <Form.Item>
483
-          {getFieldDecorator('tel')(
502
+          {getFieldDecorator('phone')(
484
             <Input
503
             <Input
485
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
504
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
486
               placeholder="电话"
505
               placeholder="电话"
499
             </Button>
518
             </Button>
500
         </Form.Item>
519
         </Form.Item>
501
       </Form>
520
       </Form>
502
-      <Button type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
521
+      <Button type="primary" onClick={() => exportRecord()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
503
         导出
522
         导出
504
       </Button>
523
       </Button>
505
 
524
 
517
         <Table dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
536
         <Table dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
518
         <Table dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
537
         <Table dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
519
       }
538
       }
520
-       {/* <InviteTable visibleData={gInviteData} />
521
-       <Verifier visibleData={gVerifierData} /> */}
539
+       <InviteTable visibleData={gInviteData} />
540
+       {/* 核销 */}
541
+       <Verifier visibleData={gVerifierData} />
522
     </>
542
     </>
523
   );
543
   );
524
 }
544
 }

+ 15
- 0
src/services/apis.js Просмотреть файл

801
     url: `${prefix}/taShareFailAndProcessingRecord`,
801
     url: `${prefix}/taShareFailAndProcessingRecord`,
802
     method: 'get',
802
     method: 'get',
803
     action: 'admin.taRole.get',
803
     action: 'admin.taRole.get',
804
+  },
805
+  shareChildList : {
806
+    url: `${prefix}/taShareChildRecord`,
807
+    method: 'get',
808
+    action: 'admin.taRole.get',
809
+  },
810
+  exportShareChildRecord: {
811
+    url: `${prefix}/taShareChildRecord/export`,
812
+    method: 'get',
813
+    action: 'admin.taRole.get',
814
+  },
815
+  exportShareRecord: {
816
+    url: `${prefix}/taShareRecord/export`,
817
+    method: 'get',
818
+    action: 'admin.taRole.get',
804
   }
819
   }
805
  },
820
  },
806
  third: {
821
  third: {