Sfoglia il codice sorgente

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

许静 5 anni fa
parent
commit
b1dda1edee

+ 6
- 1
src/pages/customer/independentList/index.jsx Vedi File

@@ -333,7 +333,12 @@ function body(props) {
333 333
   }
334 334
 
335 335
   function exportIndependen() {
336
+    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
337
+    .then(response => {
338
+      download(response)
339
+    }).catch(error => {
336 340
 
341
+    })
337 342
   }
338 343
 
339 344
   function download(data) {
@@ -432,7 +437,7 @@ function body(props) {
432 437
             </Button>
433 438
         </Form.Item>
434 439
       </Form>
435
-      <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
440
+      <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
436 441
         导出数据
437 442
       </Button>
438 443
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

+ 5
- 2
src/pages/customer/report/index.jsx Vedi File

@@ -71,7 +71,10 @@ function body(props) {
71 71
   }
72 72
 
73 73
   function exportReport() {
74
-
74
+    request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
75
+    .then(response => {
76
+      download(response)
77
+    })
75 78
   }
76 79
 
77 80
   function download(data) {
@@ -176,7 +179,7 @@ function body(props) {
176 179
             </Button>
177 180
         </Form.Item>
178 181
       </Form>
179
-      <Button type="primary" onClick={() => exportReport()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
182
+      <Button type="primary" onClick={() => exportReport()} className={Styles.SubmitButton} style={{ marginTop: '5px' }}>
180 183
         导出数据
181 184
       </Button>
182 185
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

+ 10
- 0
src/services/apis.js Vedi File

@@ -221,6 +221,16 @@ export default {
221 221
       url: `${prefix}/customer/recommend/recommender/export`,
222 222
       action: 'admin.customer.recommend.recommender.export.get',
223 223
     },
224
+    customerRecommendReportExport: { // 导出数据(报备客户)
225
+      method: 'GET',
226
+      url: `${prefix}/customer/recommend/report/export`,
227
+      action: 'admin.customer.recommend.report.export.get',
228
+    },
229
+    customerRecommendAgentsExport: { // 导出数据(经纪人)
230
+      method: 'GET',
231
+      url: `${prefix}/customer/recommend/agents/export`,
232
+      action: 'admin.customer.recommend.agents.export.get',
233
+    },
224 234
   },
225 235
   indexEcharts: {
226 236
     userResource: {

+ 1
- 1
src/utils/request.js Vedi File

@@ -79,7 +79,7 @@ request.interceptors.response.use(async (response, options) => {
79 79
       console.log('response.headers: ', response.headers)
80 80
       console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
81 81
       if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
82
-        return response
82
+        return await response.clone().blob();
83 83
       }
84 84
 
85 85
       const { code, data, message } = await response.clone().json();