dingxin 5 gadus atpakaļ
vecāks
revīzija
40909978c4
2 mainītis faili ar 27 papildinājumiem un 26 dzēšanām
  1. 22
    26
      src/pages/activity/helpActivity/helpRecord.jsx
  2. 5
    0
      src/services/apis.js

+ 22
- 26
src/pages/activity/helpActivity/helpRecord.jsx Parādīt failu

65
     })
65
     })
66
   }
66
   }
67
 
67
 
68
+  exportHelp() {
69
+    request({ ...apis.helpActivity.gethelpRecordExport, responseType: 'blob', params: { } })
70
+      .then(data => {
71
+        if (!data) {
72
+          return
73
+        }
74
+        const url = window.URL.createObjectURL(new Blob([data]))
75
+        const link = document.createElement('a')
76
+        link.style.display = 'none'
77
+        link.href = url
78
+        link.setAttribute('download', '助力者记录.xlsx')
79
+        document.body.append(link)
80
+        link.click()
81
+      }).catch(() => {
82
+
83
+      })
84
+  }
85
+
86
+
68
   // 分页
87
   // 分页
69
   onChange (pageNum) {
88
   onChange (pageNum) {
70
     this.getList({ pageNumber: pageNum, pageSize: 5 })
89
     this.getList({ pageNumber: pageNum, pageSize: 5 })
104
           onCancel={(e) => this.handleCancel(e)}
123
           onCancel={(e) => this.handleCancel(e)}
105
         >
124
         >
106
 
125
 
107
-          
126
+      <Button type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
127
+        导出
128
+      </Button>
108
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
129
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
109
         </Modal>
130
         </Modal>
110
       </>
131
       </>
176
     this.getList({ helpRecordInitiateId: this.state.visibleData.customerId, verifyCode: this.state.visibleData.verificationCode })
197
     this.getList({ helpRecordInitiateId: this.state.visibleData.customerId, verifyCode: this.state.visibleData.verificationCode })
177
   }
198
   }
178
 
199
 
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
-
204
   render () {
200
   render () {
205
     return (
201
     return (
206
       <>
202
       <>

+ 5
- 0
src/services/apis.js Parādīt failu

724
     method: 'get',
724
     method: 'get',
725
     action: 'admin.taRole.get',
725
     action: 'admin.taRole.get',
726
   },
726
   },
727
+  gethelpRecordExport: {
728
+    url: `${prefix}/helpRecord/export`,
729
+    method: 'get',
730
+    action: 'admin.taRole.get',
731
+  },
727
  },
732
  },
728
  groupActivity: {
733
  groupActivity: {
729
   list: {
734
   list: {