zhangjie 4 سال پیش
والد
کامیت
741d56ae89

+ 3 - 0
src/modules/customer/api.js

@@ -7,3 +7,6 @@ export const customerCardTaskList = datas => {
 export const applyCustomerCard = datas => {
   return $post("/api/admin/exam/card/cust_save", datas);
 };
+export const customerPaperExport = datas => {
+  return $post("/api/admin/exam/card/cust_save", datas);
+};

+ 48 - 14
src/modules/customer/views/CustomerCard.vue

@@ -78,7 +78,14 @@
     </div>
 
     <div class="part-box">
-      <el-table ref="TableList" :data="taskList" border stripe>
+      <el-table
+        ref="TableList"
+        :data="taskList"
+        border
+        stripe
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column
           type="index"
           label="序号"
@@ -151,8 +158,7 @@
 
 <script>
 import pickerOptions from "@/constants/datePickerOptions";
-import { customerCardTaskList } from "../api";
-import { download, randomCode } from "@/plugins/utils";
+import { customerCardTaskList, customerPaperExport } from "../api";
 
 export default {
   name: "customer-card",
@@ -170,6 +176,7 @@ export default {
       current: 1,
       size: this.GLOBAL.pageSize,
       total: 0,
+      multipleSelection: [],
       AUDITING_STATUS: {
         STAGE: "待审核",
         SUBMIT: "已审核"
@@ -214,7 +221,12 @@ export default {
       this.current = page;
       this.getList();
     },
+    handleSelectionChange(val) {
+      this.multipleSelection = val.map(item => item.id);
+    },
     selectMenu(val) {
+      if (this.filter.status === val) return;
+      this.multipleSelection = [];
       this.caches[this.filter.status] = {
         current: this.current,
         taskList: this.taskList,
@@ -230,20 +242,42 @@ export default {
       }
     },
     async toExport() {
+      // TODO:
+      // if (this.loading) return;
+      // this.loading = true;
+      // const res = await download({
+      //   type: "post",
+      //   url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
+      //   data: {},
+      //   fileName: `${Date.now()}${randomCode()}.zip`,
+      //   header: this.getHeadIds()
+      // }).catch(error => {
+      //   this.$message.error(error + "文件下载失败,请重新尝试!");
+      // });
+      // this.loading = false;
+      // if (!res) return;
+      // this.$message.success("文件下载成功!");
+
+      if (!this.multipleSelection.length) {
+        this.$message.error("请选择要下载的记录!");
+        return;
+      }
+
       if (this.loading) return;
+
       this.loading = true;
-      const res = await download({
-        type: "post",
-        url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
-        data: {},
-        fileName: `${Date.now()}${randomCode()}.zip`,
-        header: this.getHeadIds()
-      }).catch(error => {
-        this.$message.error(error + "文件下载失败,请重新尝试!");
-      });
+      const res = await customerPaperExport({
+        ids: this.multipleSelection
+      }).catch(() => {});
       this.loading = false;
-      if (!res) return;
-      this.$message.success("文件下载成功!");
+
+      if (res) {
+        this.$message.success(
+          "下载任务已提交,请在数据管理-任务管理中下载文件!"
+        );
+      } else {
+        this.$message.error("下载任务提交失败,请重新尝试!");
+      }
     },
     toEdit(row) {
       this.$ls.set("prepareTcPCard", {

+ 3 - 0
src/modules/exam/api.js

@@ -80,6 +80,9 @@ export const updateTaskReview = datas => {
 export const batchUpdateTaskReview = datas => {
   return $post("/api/admin/exam/task/review_save_batch", datas);
 };
+export const reviewSampleDataExport = datas => {
+  return $post("/api/admin/exam/task/review_export", datas);
+};
 // task-paper-manage
 export const taskPaperListPage = datas => {
   return $postParam("/api/admin/exam/task/paper_list", datas);

+ 17 - 17
src/modules/exam/views/TaskReviewManage.vue

@@ -248,9 +248,9 @@ import pickerOptions from "@/constants/datePickerOptions";
 import {
   taskReviewAuditedListPage,
   taskReviewUnauditedListPage,
-  batchUpdateTaskReview
+  batchUpdateTaskReview,
+  reviewSampleDataExport
 } from "../api";
-import { download, randomCode } from "@/plugins/utils";
 import { mapActions } from "vuex";
 
 export default {
@@ -330,6 +330,8 @@ export default {
       console.log(this.multipleSelection);
     },
     selectMenu(val) {
+      if (this.auditStatus === val) return;
+
       this.caches[this.auditStatus] = {
         current: this.current,
         examTasks: this.examTasks,
@@ -383,28 +385,26 @@ export default {
       this.taskModified();
     },
     async toExport() {
-      if (this.loading) return;
-
       if (!this.multipleSelection.length) {
         this.$message.error("请选择要导出的记录!");
         return;
       }
 
+      if (this.loading) return;
+
       this.loading = true;
-      const res = await download({
-        type: "post",
-        url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
-        data: {
-          examTaskIds: this.multipleSelection
-        },
-        fileName: `${Date.now()}${randomCode()}.zip`,
-        header: this.getHeadIds()
-      }).catch(error => {
-        this.$message.error(error + "文件下载失败,请重新尝试!");
-      });
+      const res = await reviewSampleDataExport({
+        ids: this.multipleSelection
+      }).catch(() => {});
       this.loading = false;
-      if (!res) return;
-      this.$message.success("文件下载成功!");
+
+      if (res) {
+        this.$message.success(
+          "导出任务已提交,请在数据管理-任务管理中下载文件!"
+        );
+      } else {
+        this.$message.error("导出任务提交失败,请重新尝试!");
+      }
     },
     toEdit(row) {
       this.curExamTask = row;

+ 3 - 1
src/modules/print/views/BusinessDataExport.vue

@@ -243,7 +243,9 @@ export default {
       this.loading = false;
 
       if (res) {
-        this.$message.success("导出任务已提交,请在任务管理中下载文件!");
+        this.$message.success(
+          "导出任务已提交,请在数据管理-任务管理中下载文件!"
+        );
       } else {
         this.$message.error("导出任务提交失败,请重新尝试!");
       }

+ 2 - 2
src/modules/print/views/PrintTaskManage.vue

@@ -235,7 +235,7 @@
               type="text"
               icon="icon icon-circle-right"
               @click="toPreview(scope.row)"
-              title="查看"
+              title="查看印品模板"
             ></el-button>
             <el-button
               class="btn-table-icon"
@@ -425,7 +425,7 @@ export default {
       }
 
       this.loading = true;
-      const data = await downloadPrintTaskPdf(this.multipleSelection.join());
+      const data = await downloadPrintTaskPdf(this.multipleSelection);
       this.loading = false;
       if (!data) return;