dingxin 5 lat temu
rodzic
commit
5a775f1476
1 zmienionych plików z 28 dodań i 15 usunięć
  1. 28
    15
      src/pages/activity/helpActivity/helpRecord.jsx

+ 28
- 15
src/pages/activity/helpActivity/helpRecord.jsx Wyświetl plik

42
   // 弹框确定按钮
42
   // 弹框确定按钮
43
   // eslint-disable-next-line react/sort-comp
43
   // eslint-disable-next-line react/sort-comp
44
   handleOk () {
44
   handleOk () {
45
-    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
45
+    this.props.onCancel()
46
   }
46
   }
47
 
47
 
48
   // 弹框取消按钮
48
   // 弹框取消按钮
49
   handleCancel () {
49
   handleCancel () {
50
-    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
50
+    this.props.onCancel()
51
   }
51
   }
52
 
52
 
53
   getList (params) {
53
   getList (params) {
112
         dataIndex: 'createDate',
112
         dataIndex: 'createDate',
113
         key: 'createDate',
113
         key: 'createDate',
114
         align: 'center',
114
         align: 'center',
115
+        render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
115
       },
116
       },
116
     ]
117
     ]
117
     return (
118
     return (
123
           footer={null}
124
           footer={null}
124
           visible={this.state.visibleData.visible}
125
           visible={this.state.visibleData.visible}
125
           // onOk={() => this.handleOk()}
126
           // onOk={() => this.handleOk()}
126
-          onCancel={(e) => this.handleCancel(e)}
127
+          onCancel={e => this.handleCancel(e)}
127
         >
128
         >
128
 
129
 
129
       <Button type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
130
       <Button type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
166
   // eslint-disable-next-line react/sort-comp
167
   // eslint-disable-next-line react/sort-comp
167
   handleOk () {
168
   handleOk () {
168
     this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
169
     this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
169
-    
170
   }
170
   }
171
 
171
 
172
   // 弹框取消按钮
172
   // 弹框取消按钮
173
   handleCancel () {
173
   handleCancel () {
174
-    this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
174
+    console.log('核销关闭');
175
+    // this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
176
+    this.props.onCancel()
175
   }
177
   }
176
 
178
 
177
   // eslint-disable-next-line class-methods-use-this
179
   // eslint-disable-next-line class-methods-use-this
213
           footer={null}
215
           footer={null}
214
           visible={this.state.visibleData.visible}
216
           visible={this.state.visibleData.visible}
215
           // onOk={() => this.handleOk()}
217
           // onOk={() => this.handleOk()}
216
-          onCancel={(e) => this.handleCancel(e)}
218
+          onCancel={e => this.handleCancel(e)}
217
         >
219
         >
218
           <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
220
           <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
219
-           <Button onClick={(e) => this.verification(e)} style={{ marginLeft: '80px' }}>立即核销</Button>
221
+           <Button onClick={e => this.verification(e)} style={{ marginLeft: '80px' }}>立即核销</Button>
220
           </div>
222
           </div>
221
         </Modal>
223
         </Modal>
222
       </>
224
       </>
286
 
288
 
287
   // 提交事件
289
   // 提交事件
288
   function handleSubmit(e) {
290
   function handleSubmit(e) {
289
-    displayNone()
291
+    // displayNone()
290
 
292
 
291
 
293
 
292
     e.preventDefault();
294
     e.preventDefault();
313
   function radioButtonHandleSizeChange(e) {
315
   function radioButtonHandleSizeChange(e) {
314
     setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
316
     setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
315
     setVerifierData({ visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' })
317
     setVerifierData({ visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' })
316
-    displayNone()
318
+    // displayNone()
317
 
319
 
318
     const { value } = e.target
320
     const { value } = e.target
319
     setCustomerType(value)
321
     setCustomerType(value)
375
  function onSuccess(e) {
377
  function onSuccess(e) {
376
    console.log('回调:', e)
378
    console.log('回调:', e)
377
    getList(e)
379
    getList(e)
378
-     // 核销
379
-   setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
380
+    
381
+   // 关闭
382
+   onCancel()
380
  }
383
  }
384
+
385
+ function onCancel(e) {
386
+  // 核销
387
+  setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
388
+  // 助力者
389
+  setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
390
+ }
391
+
381
  // 返回到首页
392
  // 返回到首页
382
  function returList(params) {
393
  function returList(params) {
383
   router.push({
394
   router.push({
406
       key: 'createDate',
417
       key: 'createDate',
407
       align: 'center',
418
       align: 'center',
408
       width: '15%',
419
       width: '15%',
420
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
409
     },
421
     },
410
     {
422
     {
411
       title: '助力者',
423
       title: '助力者',
441
       key: 'createDate',
453
       key: 'createDate',
442
       align: 'center',
454
       align: 'center',
443
       width: '10%',
455
       width: '10%',
456
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
444
       // eslint-disable-next-line no-nested-ternary
457
       // eslint-disable-next-line no-nested-ternary
445
     },
458
     },
446
     {
459
     {
459
       width: '10%',
472
       width: '10%',
460
       // eslint-disable-next-line no-nested-ternary
473
       // eslint-disable-next-line no-nested-ternary
461
       render: (text, records) => {
474
       render: (text, records) => {
462
-        if (records.verificationStatus === 0) { return '未核销' }
475
+        if (records.verificationStatus === 0 || records.verificationStatus === null) { return '未核销' }
463
         if (records.verificationStatus === 1) { return '已核销' }
476
         if (records.verificationStatus === 1) { return '已核销' }
464
       },
477
       },
465
     },
478
     },
518
       </div>
531
       </div>
519
       {customerType === 'helpSucceed' ?
532
       {customerType === 'helpSucceed' ?
520
         <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
533
         <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
521
-        <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
534
+        <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
522
       }
535
       }
523
-        <Verifier visibleData={gVerifierData} onSuccess={(e) => onSuccess(e)} />
524
-       <InviteTable visibleData={gInviteData} />  
536
+        <Verifier visibleData={gVerifierData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)} />
537
+       <InviteTable visibleData={gInviteData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)}/>
525
     </>
538
     </>
526
   );
539
   );
527
 }
540
 }