浏览代码

印刷任务管理批量提交

zhangjie 1 年之前
父节点
当前提交
6721e6e5d1
共有 2 个文件被更改,包括 19 次插入8 次删除
  1. 2 1
      src/modules/print/api.js
  2. 17 7
      src/modules/print/views/PrintTaskManage.vue

+ 2 - 1
src/modules/print/api.js

@@ -114,9 +114,10 @@ export const resubmitPrintTask = ({ id, printPlanId }) => {
 export const cancelPrintTask = (id) => {
   return $post("/api/admin/exam/print/task_cancel", { id, status: "READY" });
 };
-export const batchCancelPrintTask = (ids) => {
+export const batchCancelPrintTask = (ids, type) => {
   return $post("/api/admin/exam/print/task_batch_cancel", {
     ids,
+    type,
   });
 };
 export const printTaskTotalInfo = (datas) => {

+ 17 - 7
src/modules/print/views/PrintTaskManage.vue

@@ -126,12 +126,20 @@
         <div>
           <el-button
             v-if="checkPrivilege('button', 'BatchEnd')"
-            icon="el-icon-download"
+            icon="el-icon-bottom-left"
             type="danger"
-            @click="toBatchCancel"
+            @click="toBatchCancelOrSubmit('cancel')"
           >
             批量撤回
           </el-button>
+          <el-button
+            v-if="checkPrivilege('button', 'BatchEnd')"
+            icon="el-icon-top-right"
+            type="primary"
+            @click="toBatchCancelOrSubmit('submit')"
+          >
+            批量提交
+          </el-button>
           <el-button
             v-if="checkPrivilege('button', 'BatchDownload')"
             icon="el-icon-download"
@@ -612,21 +620,23 @@ export default {
         })
         .catch(() => {});
     },
-    toBatchCancel() {
+    toBatchCancelOrSubmit(type) {
+      const name = type === "submit" ? "提交" : "撤回";
       if (!this.multipleSelection.length) {
-        this.$message.error("请选择要撤回的记录!");
+        this.$message.error(`请选择要${name}的记录!`);
         return;
       }
-      this.$confirm("确定撤回选中的印刷任务的提交吗?", "提示", {
+      this.$confirm(`确定${name}选中的印刷任务的提交吗?`, "提示", {
         type: "warning",
       })
         .then(async () => {
           const data = await batchCancelPrintTask(
-            this.multipleSelection.join()
+            this.multipleSelection.join(),
+            type
           );
           if (!data) return;
 
-          this.$message.success("撤回成功!");
+          this.$message.success("操作成功!");
           this.getList();
         })
         .catch(() => {});