zhangjie 1 rok temu
rodzic
commit
3ab5ed328d

+ 0 - 9
src/modules/base/api.js

@@ -232,15 +232,6 @@ export const downloadCardFile = (id) => {
     }
   );
 };
-export const downloadCardExchangeFile = (id) => {
-  return $postParam(
-    "/api/admin/exam/card/download_card_exchange",
-    { id },
-    {
-      responseType: "blob",
-    }
-  );
-};
 // course-target-template-manage
 export const courseTargetTemplateListPage = (datas) => {
   return $postParam("/api/admin/basic/course-target-template/list", datas);

+ 0 - 18
src/modules/base/views/CardManage.vue

@@ -190,13 +190,6 @@
               @click="toDownload(scope.row)"
               >下载题卡</el-button
             >
-            <el-button
-              v-if="checkPrivilege('link', 'Download')"
-              class="btn-primary"
-              type="text"
-              @click="toDownloadCardExchange(scope.row)"
-              >下载卡格式</el-button
-            >
           </template>
         </el-table-column>
       </el-table>
@@ -249,7 +242,6 @@ import {
   deleteCard,
   convertCardImage,
   downloadCardFile,
-  downloadCardExchangeFile,
 } from "../api";
 import ModifyCardInfo from "../components/ModifyCardInfo";
 import pickerOptions from "@/constants/datePickerOptions";
@@ -372,16 +364,6 @@ export default {
       if (!res) return;
       this.$message.success("下载成功!");
     },
-    async toDownloadCardExchange(row) {
-      const res = await downloadByApi(() => {
-        return downloadCardExchangeFile(row.id);
-      }, "").catch((e) => {
-        this.$message.error(e || "下载失败,请重新尝试!");
-      });
-
-      if (!res) return;
-      this.$message.success("下载成功!");
-    },
     // image-preview
     toPreviewImage(row) {
       this.imageList = row.imageUrls;

+ 1 - 1
src/modules/card/components/ModifyCard.vue

@@ -22,7 +22,7 @@
 </template>
 
 <script>
-import CardEdit from "../views/CardEdit";
+import CardEdit from "../views/CardEdit.vue";
 
 export default {
   name: "modify-card",

+ 2 - 2
src/modules/card/views/CardEdit.vue

@@ -237,7 +237,7 @@ export default {
       this.lastStageCardContent = cardInfo.content;
       this.$refs.CardDesign.updateUnsubmitStatus(true);
       if (!result) return;
-      this.cardId = result;
+      this.cardId = result.id;
       this.$ls.set("cardId", this.cardId);
     },
     async toSubmit(cardData) {
@@ -282,7 +282,7 @@ export default {
       this.$refs.CardDesign.unloading();
       if (result) {
         this.cardName = "";
-        this.cardId = result;
+        this.cardId = result.id;
         this.$ls.set("cardId", this.cardId);
         this.$refs.CardDesign.updateUnsubmitStatus(false);
         this.$message.success("提交成功!");

+ 1 - 1
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -372,7 +372,7 @@
 import { mapState, mapMutations } from "vuex";
 import UploadPaperDialog from "../UploadPaperDialog";
 import SimpleImagePreview from "@/components/SimpleImagePreview";
-import ModifyCard from "../../../card/components/ModifyCard";
+import ModifyCard from "../../../card/components/ModifyCard.vue";
 import SelectTikuPaperDialog from "./SelectTikuPaperDialog.vue";
 import { COMMON_CARD_RULE_ID } from "../../../../constants/enumerate";
 import { cardForSelectList } from "../../api";

+ 1 - 20
src/modules/exam/views/DataTaskManage.vue

@@ -155,14 +155,6 @@
               @click="toViewLog(scope.row)"
               >导出日志</el-button
             >
-            <el-button
-              v-if="scope.row.resetCreatePdf && checkPriv('link', 'createPdf')"
-              class="btn-primary"
-              type="text"
-              :disabled="loading"
-              @click="toResetCreatePdf(scope.row)"
-              >重新生成PDF</el-button
-            >
             <el-button
               v-if="scope.row.hasResultFile && checkPriv('link', 'download')"
               class="btn-primary"
@@ -220,7 +212,7 @@ import {
   DATA_TASK_TYPE,
   DATA_TASK_RESULT,
 } from "@/constants/enumerate";
-import { dataTaskList, removeDataTask, taskResetPdf } from "../api";
+import { dataTaskList, removeDataTask } from "../api";
 import { attachmentDownload } from "../../login/api";
 import { downloadByUrl } from "@/plugins/download";
 
@@ -347,17 +339,6 @@ export default {
       downloadByUrl(res.url);
       this.$message.success("文件下载成功!");
     },
-    async toResetCreatePdf(row) {
-      if (this.loading) return;
-
-      this.loading = true;
-      const res = await taskResetPdf(row.id).catch(() => {});
-      this.loading = false;
-      if (!res) return;
-
-      this.$message.success("操作成功!");
-      this.getList();
-    },
     toViewLog(row) {
       this.logList = (row.summary || "").split("\n");
       this.modalIsShow = true;

+ 66 - 11
src/modules/exam/views/PdfBuildManage.vue

@@ -180,13 +180,40 @@
         <p v-for="(cont, cidx) in logList" :key="cidx">{{ cont }}</p>
       </div>
     </el-dialog>
+    <!-- pdf-view -->
+    <el-dialog
+      class="pdf-view-dialog"
+      :visible.sync="padViewDialogVisible"
+      title="请选择PDF类型"
+      top="10vh"
+      width="600px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+    >
+      <div class="text-center">
+        <el-button size="large" @click="rebuildPdf({ type: undefined })"
+          >全部</el-button
+        >
+        <el-button
+          v-for="item in pdfList"
+          :key="item.name"
+          type="primary"
+          size="large"
+          @click="rebuildPdf(item)"
+          >{{ item.type | printPdfTypeFilter }}</el-button
+        >
+      </div>
+      <div slot="footer"></div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { DATA_TASK_STATUS, DATA_TASK_RESULT } from "@/constants/enumerate";
-import { pdfBuildListPage, taskResetPdf } from "../api";
+import { pdfBuildListPage } from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
+import { getPrintTaskPdf, rebuildPrintTaskPdf } from "@/modules/print/api";
 
 export default {
   name: "pdf-build-manage",
@@ -219,9 +246,11 @@ export default {
       // log dialog
       modalIsShow: false,
       logList: [],
+      // view-pdf
+      padViewDialogVisible: false,
+      pdfList: [],
     };
   },
-  mounted() {},
   methods: {
     async getList() {
       if (!this.checkPrivilege("list", "list")) return;
@@ -243,21 +272,47 @@ export default {
       this.current = page;
       this.getList();
     },
+    toViewLog(row) {
+      this.logList = (row.summary || "").split("\n");
+      this.modalIsShow = true;
+    },
     async toResetCreatePdf(row) {
-      if (this.loading) return;
+      this.curRow = row;
+      this.pdfList = [];
+      let result = true;
+      const data = await getPrintTaskPdf(row.id).catch(() => {
+        result = false;
+      });
+      if (!result) return;
+      if (!data || !data.length) {
+        this.$message.error("当前任务pdf还未生成好,请稍后再试!");
+        return;
+      }
+      if (data.length === 1) {
+        this.rebuildPdf(data[0]);
+      } else {
+        this.pdfList = data;
+        this.padViewDialogVisible = true;
+      }
+    },
+    async rebuildPdf(item) {
+      const action = await this.$confirm(
+        `确定要重新生成该印刷任务PDF吗?`,
+        "提示",
+        {
+          type: "warning",
+        }
+      ).catch(() => {});
+      if (action !== "confirm") return;
 
-      this.loading = true;
-      const res = await taskResetPdf(row.id).catch(() => {});
-      this.loading = false;
+      const res = await rebuildPrintTaskPdf(this.curRow.id, item.type).catch(
+        () => {}
+      );
       if (!res) return;
-
       this.$message.success("操作成功!");
+      this.padViewDialogVisible = false;
       this.getList();
     },
-    toViewLog(row) {
-      this.logList = (row.summary || "").split("\n");
-      this.modalIsShow = true;
-    },
   },
 };
 </script>

+ 1 - 3
src/modules/mark/components/ScoreReportPreview.vue

@@ -52,9 +52,7 @@ export default {
   computed: {
     title() {
       const course = `${this.instance.courseName}(${this.instance.courseCode})`;
-      return this.instance.className
-        ? `${this.instance.className}-${course}`
-        : course;
+      return course;
     },
   },
   methods: {

+ 13 - 0
src/modules/print/views/PrintTaskManage.vue

@@ -124,10 +124,20 @@
       <div class="box-justify">
         <div></div>
         <div>
+          <el-button
+            v-if="checkPrivilege('button', 'BatchEnd')"
+            icon="el-icon-finished"
+            type="success"
+            :disabled="searchfilter.status !== 'WAITING'"
+            @click="toBatchCancelOrSubmit('finish')"
+          >
+            批量完成
+          </el-button>
           <el-button
             v-if="checkPrivilege('button', 'BatchEnd')"
             icon="el-icon-bottom-left"
             type="danger"
+            :disabled="searchfilter.status !== 'WAITING'"
             @click="toBatchCancelOrSubmit('cancel')"
           >
             批量撤回
@@ -136,6 +146,7 @@
             v-if="checkPrivilege('button', 'BatchEnd')"
             icon="el-icon-top-right"
             type="primary"
+            :disabled="searchfilter.status !== 'READY'"
             @click="toBatchCancelOrSubmit('submit')"
           >
             批量提交
@@ -489,6 +500,7 @@ export default {
         printStartTime: "",
         printEndTime: "",
       },
+      searchfilter: {},
       current: 1,
       size: this.GLOBAL.pageSize,
       total: 0,
@@ -541,6 +553,7 @@ export default {
         return item;
       });
       this.total = data.total;
+      this.searchfilter = { ...this.filter };
     },
     toPage(page) {
       this.current = page;