shish 2 лет назад
Родитель
Сommit
4e4803499f
2 измененных файлов с 19 добавлено и 1 удалено
  1. 7 0
      ghs/src/service/order/index.js
  2. 12 1
      ghs/src/views/order/list.vue

+ 7 - 0
ghs/src/service/order/index.js

@@ -5,6 +5,13 @@ import { baseUrl } from '@/config/env';
 @Service('order')
 export class OrderService extends BaseService {
 
+	getOrderList(data) {
+		return this.request({
+			url: '/list',
+			params: data
+		});
+	}
+
 	getAccountList(data) {
 		return this.request({
 			url: '/account-list',

+ 12 - 1
ghs/src/views/order/list.vue

@@ -134,6 +134,10 @@
 				<el-button type="primary" size="mini" style="margin-left:20px;" @click="billing()">开单</el-button>
 			</template>
 
+			<template #slot-export-order>
+				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportData()">导出数据</el-button>
+			</template>
+
     </x-crud>
     <!-- 用户详情 -->
     <order-detail ref="orderDetail" :orderOperate="optionData" />
@@ -422,6 +426,13 @@ export default {
     handleClick(tab, e) {
       this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
     },
+		exportData(){
+			this.$service.order.getOrderList({status: this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,pageSize:9999999,export:1}).then(res => {
+				if(res.file){
+					window.location.href = res.file
+				}
+			})
+		},
     onLoad({ ctx, app }) {
       this.app = app;
       if(this.$route.query.status){
@@ -568,7 +579,7 @@ export default {
           })
           .set('layout', [
             ['slot-tabs'],
-            ['slot-search-option','search-key','slot-billing'],
+            ['slot-search-option','search-key','slot-billing','slot-export-order'],
             ['data-table'],
             ['flex1', 'pagination']
           ])