Browse Source

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

许静 5 years ago
parent
commit
b1dda1edee

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

333
   }
333
   }
334
 
334
 
335
   function exportIndependen() {
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
   function download(data) {
344
   function download(data) {
432
             </Button>
437
             </Button>
433
         </Form.Item>
438
         </Form.Item>
434
       </Form>
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
       </Button>
442
       </Button>
438
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
443
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

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

71
   }
71
   }
72
 
72
 
73
   function exportReport() {
73
   function exportReport() {
74
-
74
+    request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
75
+    .then(response => {
76
+      download(response)
77
+    })
75
   }
78
   }
76
 
79
 
77
   function download(data) {
80
   function download(data) {
176
             </Button>
179
             </Button>
177
         </Form.Item>
180
         </Form.Item>
178
       </Form>
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
       </Button>
184
       </Button>
182
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
185
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

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

221
       url: `${prefix}/customer/recommend/recommender/export`,
221
       url: `${prefix}/customer/recommend/recommender/export`,
222
       action: 'admin.customer.recommend.recommender.export.get',
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
   indexEcharts: {
235
   indexEcharts: {
226
     userResource: {
236
     userResource: {

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

79
       console.log('response.headers: ', response.headers)
79
       console.log('response.headers: ', response.headers)
80
       console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
80
       console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
81
       if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
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
       const { code, data, message } = await response.clone().json();
85
       const { code, data, message } = await response.clone().json();