Browse Source

台账类批量导出

李帅 6 months ago
parent
commit
826b25a9e5

+ 9 - 0
src/api/allApi/index.js

@@ -616,3 +616,12 @@ export function approveTypeUserList1() {
616
   });
616
   });
617
 }
617
 }
618
 
618
 
619
+// 台账导出
620
+export function batchExportTaiZhang(params) {
621
+  return request({
622
+    url: "/postCheck/postCheckedProblem/batchExportTaiZhang",
623
+    method: "get",
624
+    params
625
+  });
626
+}
627
+

+ 18 - 3
src/views/jobinspectionHistory/jobinspectionProblem/index.vue

@@ -38,9 +38,12 @@
38
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
38
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
39
       </el-form-item>
39
       </el-form-item>
40
 
40
 
41
+      <el-button type="primary" @click="batchExport" style="float: right;">批量导出</el-button>
42
+
41
     </el-form>
43
     </el-form>
42
 
44
 
43
-    <el-table border v-loading="loading" :data="tableData" height="calc(100% - 100px)">
45
+    <el-table border v-loading="loading" :data="tableData" height="calc(100% - 100px)" @selection-change="handleSelectionChange">
46
+      <el-table-column type="selection" width="55" align="center" />
44
       <el-table-column label="序号" align="center" width="80">
47
       <el-table-column label="序号" align="center" width="80">
45
         <template slot-scope="scope">
48
         <template slot-scope="scope">
46
           <span>{{
49
           <span>{{
@@ -480,14 +483,17 @@
480
 <script>
483
 <script>
481
 import {
484
 import {
482
   postCheckedProblemList,
485
   postCheckedProblemList,
483
-  postCheckedProblemDetail
486
+  postCheckedProblemDetail,
487
+  batchExportTaiZhang
484
 } from '@/api/allApi/index.js'
488
 } from '@/api/allApi/index.js'
489
+import download from "@/plugins/download.js";
485
 import { getBase64 } from '@/api/postInspectionPlanning/projectManagement.js'
490
 import { getBase64 } from '@/api/postInspectionPlanning/projectManagement.js'
486
 export default {
491
 export default {
487
   name: 'PostResponsibilityMeun',
492
   name: 'PostResponsibilityMeun',
488
 
493
 
489
   data() {
494
   data() {
490
     return {
495
     return {
496
+      ids:[],
491
       valueYear: '',
497
       valueYear: '',
492
       queryParams: {
498
       queryParams: {
493
         dutyType: '',
499
         dutyType: '',
@@ -605,6 +611,10 @@ export default {
605
   },
611
   },
606
 
612
 
607
   methods: {
613
   methods: {
614
+    // 多选框选中数据
615
+    handleSelectionChange(selection) {
616
+      this.ids = selection.map((item) => item.id);
617
+    },
608
     initYear() {
618
     initYear() {
609
       let _now = new Date()
619
       let _now = new Date()
610
       let currentYear = _now.getFullYear()
620
       let currentYear = _now.getFullYear()
@@ -662,7 +672,12 @@ export default {
662
           }
672
           }
663
         )
673
         )
664
       }
674
       }
665
-    }
675
+    },
676
+    batchExport() {
677
+      batchExportTaiZhang({ ids: this.ids.join(",") }).then((res) => {
678
+        download.resource(res.msg);
679
+      });
680
+    },
666
   }
681
   }
667
 }
682
 }
668
 </script>
683
 </script>