Parcourir la source

台账类批量导出

李帅 il y a 6 mois
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 38
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
39 39
       </el-form-item>
40 40
 
41
+      <el-button type="primary" @click="batchExport" style="float: right;">批量导出</el-button>
42
+
41 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 47
       <el-table-column label="序号" align="center" width="80">
45 48
         <template slot-scope="scope">
46 49
           <span>{{
@@ -480,14 +483,17 @@
480 483
 <script>
481 484
 import {
482 485
   postCheckedProblemList,
483
-  postCheckedProblemDetail
486
+  postCheckedProblemDetail,
487
+  batchExportTaiZhang
484 488
 } from '@/api/allApi/index.js'
489
+import download from "@/plugins/download.js";
485 490
 import { getBase64 } from '@/api/postInspectionPlanning/projectManagement.js'
486 491
 export default {
487 492
   name: 'PostResponsibilityMeun',
488 493
 
489 494
   data() {
490 495
     return {
496
+      ids:[],
491 497
       valueYear: '',
492 498
       queryParams: {
493 499
         dutyType: '',
@@ -605,6 +611,10 @@ export default {
605 611
   },
606 612
 
607 613
   methods: {
614
+    // 多选框选中数据
615
+    handleSelectionChange(selection) {
616
+      this.ids = selection.map((item) => item.id);
617
+    },
608 618
     initYear() {
609 619
       let _now = new Date()
610 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 683
 </script>