dingxin 5 years ago
parent
commit
3068cfb77e
1 changed files with 30 additions and 9 deletions
  1. 30
    9
      src/pages/activity/helpActivity/helpRecord.jsx

+ 30
- 9
src/pages/activity/helpActivity/helpRecord.jsx View File

@@ -103,6 +103,8 @@ class InviteTable extends React.Component {
103 103
           // onOk={() => this.handleOk()}
104 104
           onCancel={(e) => this.handleCancel(e)}
105 105
         >
106
+
107
+          
106 108
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
107 109
         </Modal>
108 110
       </>
@@ -111,11 +113,6 @@ class InviteTable extends React.Component {
111 113
 }
112 114
 
113 115
 
114
-
115
-
116
-
117
-
118
-
119 116
 /**
120 117
  * 助力者弹框
121 118
  */
@@ -179,6 +176,31 @@ class Verifier extends React.Component {
179 176
     this.getList({ helpRecordInitiateId: this.state.visibleData.customerId, verifyCode: this.state.visibleData.verificationCode })
180 177
   }
181 178
 
179
+  //  exportCustomer() {
180
+  //   const code = customerType === 'helpSucceed' ? 1 : 0
181
+  //   request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, code } })
182
+  //     .then(response => {
183
+  //       download(response)
184
+  //     }).catch(() => {
185
+
186
+  //     })
187
+  // }
188
+
189
+  //  download(data) {
190
+  //   if (!data) {
191
+  //     return
192
+  //   }
193
+  //   const url = window.URL.createObjectURL(new Blob([data]))
194
+  //   const link = document.createElement('a')
195
+  //   link.style.display = 'none'
196
+  //   link.href = url
197
+  //   link.setAttribute('download', '助力记录.xlsx')
198
+  //   document.body.append(link)
199
+  //   link.click()
200
+  // }
201
+
202
+
203
+
182 204
   render () {
183 205
     return (
184 206
       <>
@@ -309,9 +331,8 @@ function body(props) {
309 331
 
310 332
   function exportCustomer () {
311 333
     const fieldsValue = getFieldsValue()
312
-    // request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType } })
313
-    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { helpActivityId: 6 } })
314
-
334
+    const code = customerType === 'helpSucceed' ? 1 : 0
335
+    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, code } })
315 336
       .then(response => {
316 337
         download(response)
317 338
       }).catch(error => {
@@ -327,7 +348,7 @@ function body(props) {
327 348
     const link = document.createElement('a')
328 349
     link.style.display = 'none'
329 350
     link.href = url
330
-    link.setAttribute('download', '客户列表.xlsx')
351
+    link.setAttribute('download', '助力记录.xlsx')
331 352
     document.body.append(link)
332 353
     link.click()
333 354
   }