浏览代码

登记簿批量导出代码提交

jingyuanchao 1 年之前
父节点
当前提交
89a2b14385
共有 2 个文件被更改,包括 14 次插入3 次删除
  1. 9 0
      src/api/registerbook/registerBook.js
  2. 5 3
      src/views/registerBook/index.vue

+ 9 - 0
src/api/registerbook/registerBook.js

@@ -55,3 +55,12 @@ export function selectExport(data,fileName) {
     fileName,null,null
     fileName,null,null
   )
   )
 }
 }
+
+// 导出全部
+export function allExport(data) {
+  return request({
+    url: '/core/registerBook/batch/cutExport',
+    method: 'post',
+    data: data
+  })
+}

+ 5 - 3
src/views/registerBook/index.vue

@@ -163,6 +163,7 @@
 
 
 <script>
 <script>
 import {
 import {
+  allExport,
   listRegisterBook,
   listRegisterBook,
   selectExport,
   selectExport,
 } from "@/api/registerbook/registerBook.js";
 } from "@/api/registerbook/registerBook.js";
@@ -297,11 +298,13 @@ export default {
       this.single = selection.length !== 1
       this.single = selection.length !== 1
       this.multiple = !selection.length
       this.multiple = !selection.length
     },
     },
+    //导出全部
     async exportAll() {
     async exportAll() {
-      //this.search.exportType = 0;
-      //await cutExport(this.search);
+      this.queryParams.exportType = 0;
+      await allExport(this.queryParams)
       this.$message.success("导出成功,请稍后查看导出结果!");
       this.$message.success("导出成功,请稍后查看导出结果!");
     },
     },
+    //导出勾选
     async exportSelected() {
     async exportSelected() {
       if (!this.ids || this.ids.length == 0) {
       if (!this.ids || this.ids.length == 0) {
         this.$message.error('请先选择需要导出的文件!');
         this.$message.error('请先选择需要导出的文件!');
@@ -309,7 +312,6 @@ export default {
       }
       }
       let pdfIdList = this.ids;
       let pdfIdList = this.ids;
       this.queryParams.exportType = 1;
       this.queryParams.exportType = 1;
-      let fileName = `登记簿-${dayjs(new Date()).format("YYYYMMDD")}.zip`;
       await selectExport({...this.queryParams, pdfIdList},
       await selectExport({...this.queryParams, pdfIdList},
         `${this.selectedOrgName}_${this.$tab.getCurrentTabName()}_${dayjs().format("YYYYMMDD")}.zip`);
         `${this.selectedOrgName}_${this.$tab.getCurrentTabName()}_${dayjs().format("YYYYMMDD")}.zip`);