Browse Source

添加导出

lex-xin 4 years ago
parent
commit
3b72efd8a1
1 changed files with 14 additions and 0 deletions
  1. 14 0
      src/views/repairManager/repairList.vue

+ 14 - 0
src/views/repairManager/repairList.vue

@@ -117,6 +117,8 @@
         <el-form-item>
           <el-button type="danger" native-type="submit">搜索</el-button>
           <el-button native-type="reset" type="primary">重置</el-button>
+           <!-- v-permission="'studentRepair/export'" -->
+          <el-button @click="onExport" type="primary" v-permission="'studentRepair/export'">导出</el-button>
         </el-form-item>
       </save-form>
       <div class="tableWrap">
@@ -426,6 +428,9 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { getSoundTree } from "@/api/buildTeam";
+import { Export } from '@/utils/downLoadFile'
+import qs from 'qs'
+import { getTimes } from "@/utils";
 import {
   findAllTechnician,
   studentRepairList,
@@ -573,6 +578,15 @@ export default {
         }
       });
     },
+    onExport() {
+      const {timer, ...rest} = this.searchForm
+      Export(this, {
+        url: '/api-web/studentRepair/export',
+        fileName: '维修单.xlsx',
+        method: 'post',
+        params: qs.stringify({ ...rest, ...getTimes(timer, ["startTime", "endTime"]) })
+      }, '您确定导出维修单列表?')
+    }
   },
   watch: {
     repairVisible(val) {