浏览代码

导出打印

Liugl 3 年之前
父节点
当前提交
f30dfc97fa
共有 2 个文件被更改,包括 60 次插入1 次删除
  1. 11 0
      src/api/business/ticket.js
  2. 49 1
      src/views/business/ticket/index.vue

+ 11 - 0
src/api/business/ticket.js

@@ -37,6 +37,17 @@ export function exportTicket(data) {
     data
     data
   })
   })
 }
 }
+
+// 导出印刷
+export function exportDraw(data) {
+  return request({
+    url: '/api/v1/mp/admin/ticket/box/exportDraw',
+    method: 'post',
+    timeout: 15 * 60 * 1000,
+    data
+  })
+}
+
 // 下载批量导入模板
 // 下载批量导入模板
 export function importTemplate(){
 export function importTemplate(){
   return request({
   return request({

+ 49 - 1
src/views/business/ticket/index.vue

@@ -97,6 +97,21 @@
           >导出</el-button
           >导出</el-button
         >
         >
       </el-col>
       </el-col>
+
+      <el-col :span="1.5">
+        <el-button
+          type="infor"
+          plain
+          icon="el-icon-printer"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExportDraw"
+          v-hasPermi="['business:ticket:export']"
+          >导出印刷</el-button
+        >
+      </el-col>
+
+
       <right-toolbar
       <right-toolbar
         :showSearch.sync="showSearch"
         :showSearch.sync="showSearch"
         @queryTable="getList"
         @queryTable="getList"
@@ -228,6 +243,7 @@
 import {
 import {
   getTicketList,
   getTicketList,
   exportTicket,
   exportTicket,
+  exportDraw,
   ticketBoxPut,
   ticketBoxPut,
   ticketBoxRemove,
   ticketBoxRemove,
 } from "@/api/business/ticket";
 } from "@/api/business/ticket";
@@ -366,7 +382,7 @@ export default {
     /** 导出按钮操作 */
     /** 导出按钮操作 */
     handleExport() {
     handleExport() {
       const boxIds = this.ids || [];
       const boxIds = this.ids || [];
-      
+
       if (boxIds.length == 0) {
       if (boxIds.length == 0) {
         this.$alert("请选择你要导出的盲票组!", "提示", { type: "warning" });
         this.$alert("请选择你要导出的盲票组!", "提示", { type: "warning" });
       } else {
       } else {
@@ -394,6 +410,38 @@ export default {
           });
           });
       }
       }
     },
     },
+
+    /** 导出按钮操作 */
+    handleExportDraw() {
+      const boxIds = this.ids || [];
+
+      if (boxIds.length == 0) {
+        this.$alert("请选择你要导出的盲票组!", "提示", { type: "warning" });
+      } else {
+        this.$confirm("是否确认导出所选盲票数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.vloading = this.$loading({
+              lock: true,
+              text: "正在导出印刷.....",
+              background: "rgba(0, 0, 0, 0.7)",
+            });
+            return exportDraw({ ids: boxIds });
+          })
+          .then((response) => {
+            this.vloading.close();
+            this.download(response.msg);
+            this.exportLoading = false;
+          })
+          .catch(() => {
+            this.vloading.close();
+            this.exportLoading = false;
+          });
+      }
+    },
   },
   },
   mounted() {},
   mounted() {},
   destroyed() {},
   destroyed() {},