dingxin 5 anos atrás
pai
commit
5a775f1476
1 arquivos alterados com 28 adições e 15 exclusões
  1. 28
    15
      src/pages/activity/helpActivity/helpRecord.jsx

+ 28
- 15
src/pages/activity/helpActivity/helpRecord.jsx Ver arquivo

@@ -42,12 +42,12 @@ class InviteTable extends React.Component {
42 42
   // 弹框确定按钮
43 43
   // eslint-disable-next-line react/sort-comp
44 44
   handleOk () {
45
-    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
45
+    this.props.onCancel()
46 46
   }
47 47
 
48 48
   // 弹框取消按钮
49 49
   handleCancel () {
50
-    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
50
+    this.props.onCancel()
51 51
   }
52 52
 
53 53
   getList (params) {
@@ -112,6 +112,7 @@ class InviteTable extends React.Component {
112 112
         dataIndex: 'createDate',
113 113
         key: 'createDate',
114 114
         align: 'center',
115
+        render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
115 116
       },
116 117
     ]
117 118
     return (
@@ -123,7 +124,7 @@ class InviteTable extends React.Component {
123 124
           footer={null}
124 125
           visible={this.state.visibleData.visible}
125 126
           // onOk={() => this.handleOk()}
126
-          onCancel={(e) => this.handleCancel(e)}
127
+          onCancel={e => this.handleCancel(e)}
127 128
         >
128 129
 
129 130
       <Button type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
@@ -166,12 +167,13 @@ class Verifier extends React.Component {
166 167
   // eslint-disable-next-line react/sort-comp
167 168
   handleOk () {
168 169
     this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
169
-    
170 170
   }
171 171
 
172 172
   // 弹框取消按钮
173 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 179
   // eslint-disable-next-line class-methods-use-this
@@ -213,10 +215,10 @@ class Verifier extends React.Component {
213 215
           footer={null}
214 216
           visible={this.state.visibleData.visible}
215 217
           // onOk={() => this.handleOk()}
216
-          onCancel={(e) => this.handleCancel(e)}
218
+          onCancel={e => this.handleCancel(e)}
217 219
         >
218 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 222
           </div>
221 223
         </Modal>
222 224
       </>
@@ -286,7 +288,7 @@ function body(props) {
286 288
 
287 289
   // 提交事件
288 290
   function handleSubmit(e) {
289
-    displayNone()
291
+    // displayNone()
290 292
 
291 293
 
292 294
     e.preventDefault();
@@ -313,7 +315,7 @@ function body(props) {
313 315
   function radioButtonHandleSizeChange(e) {
314 316
     setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
315 317
     setVerifierData({ visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' })
316
-    displayNone()
318
+    // displayNone()
317 319
 
318 320
     const { value } = e.target
319 321
     setCustomerType(value)
@@ -375,9 +377,18 @@ function helpRecord(row) {
375 377
  function onSuccess(e) {
376 378
    console.log('回调:', e)
377 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 393
  function returList(params) {
383 394
   router.push({
@@ -406,6 +417,7 @@ function helpRecord(row) {
406 417
       key: 'createDate',
407 418
       align: 'center',
408 419
       width: '15%',
420
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
409 421
     },
410 422
     {
411 423
       title: '助力者',
@@ -441,6 +453,7 @@ function helpRecord(row) {
441 453
       key: 'createDate',
442 454
       align: 'center',
443 455
       width: '10%',
456
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
444 457
       // eslint-disable-next-line no-nested-ternary
445 458
     },
446 459
     {
@@ -459,7 +472,7 @@ function helpRecord(row) {
459 472
       width: '10%',
460 473
       // eslint-disable-next-line no-nested-ternary
461 474
       render: (text, records) => {
462
-        if (records.verificationStatus === 0) { return '未核销' }
475
+        if (records.verificationStatus === 0 || records.verificationStatus === null) { return '未核销' }
463 476
         if (records.verificationStatus === 1) { return '已核销' }
464 477
       },
465 478
     },
@@ -518,10 +531,10 @@ function helpRecord(row) {
518 531
       </div>
519 532
       {customerType === 'helpSucceed' ?
520 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
 }