Преглед изворни кода

fix: 命题任务审核报错

zhangjie пре 1 година
родитељ
комит
bcb300bba9

+ 1 - 1
src/modules/base/components/ModifyExamStudent.vue

@@ -154,7 +154,7 @@
       <el-form-item prop="paperType" label="卷型:">
         <el-input
           v-model.trim="modalForm.paperType"
-          placeholder="请选择卷型"
+          placeholder="请输入卷型"
           clearable
           :maxlength="1"
           class="width-200"

+ 2 - 2
src/modules/exam/components/taskApply/ModifyTaskApply.vue

@@ -11,11 +11,11 @@
     @open="visibleChange"
     @close="closeHandle"
   >
-    <template v-if="dataReady">
+    <div v-if="dataReady" class="apply-content task-detail">
       <task-info></task-info>
       <task-paper ref="TaskPaper"></task-paper>
       <task-flow ref="TaskFlow"></task-flow>
-    </template>
+    </div>
 
     <div slot="footer">
       <el-button

+ 17 - 6
src/modules/exam/components/taskApply/TaskFlow.vue

@@ -228,7 +228,7 @@
 </template>
 
 <script>
-import { mapState, mapMutations } from "vuex";
+import { mapState, mapMutations, mapActions } from "vuex";
 import {
   taskFlowDetail,
   taskFlowNodeInfo,
@@ -250,7 +250,6 @@ export default {
       exchangeUsers: [],
       selectUserType: "exchange", // exchange:转审,approve:下一节点审核
       curSelectedUsers: [],
-      auditLogCache: { paper: {}, card: {} },
       // 选择下一节点审批人
       IS_NEED_SELECT_APPROVE_USER: false,
       nextFlowTaskResult: {}, //下一节点信息
@@ -309,10 +308,22 @@ export default {
     };
   },
   computed: {
-    ...mapState("exam", ["editType", "examTask", "curTaskApply", "taskStatus"]),
+    ...mapState("exam", [
+      "editType",
+      "examTask",
+      "curTaskApply",
+      "taskStatus",
+      "auditLogCache",
+    ]),
   },
   methods: {
-    ...mapMutations("exam", ["setEditType", "setExamTask", "setCurTaskApply"]),
+    ...mapMutations("exam", [
+      "setEditType",
+      "setExamTask",
+      "setCurTaskApply",
+      "setAuditLogCache",
+    ]),
+    ...mapActions("exam", ["addPreviewLog"]),
     async initData() {
       const paperAttachments = this.curTaskApply.paperAttachmentIds
         ? JSON.parse(this.curTaskApply.paperAttachmentIds)
@@ -328,7 +339,7 @@ export default {
         if (paper.cardId && this.curTaskApply.auditContent.includes("CARD"))
           auditLogCache.card[paper.cardId] = false;
       });
-      this.auditLogCache = auditLogCache;
+      this.setAuditLogCache(auditLogCache);
 
       if (this.curTaskApply.flowStatus === "START") {
         await this.getFlowList();
@@ -431,7 +442,7 @@ export default {
     },
     async downloadPaper(attachment) {
       if (!attachment.attachmentId) return;
-      this.addPreviewLog(attachment, "paper");
+      this.addPreviewLog({ attachment, type: "paper" });
       const data = await attachmentPreview(attachment.attachmentId);
       window.open(data.url);
     },

+ 1 - 1
src/modules/exam/components/taskApply/TaskInfo.vue

@@ -55,7 +55,7 @@
       </el-row>
     </el-form>
 
-    <div v-if="!IS_MODEL2" class="task-exam-room">
+    <div v-if="examRoomClassList.length && !IS_MODEL2" class="task-exam-room">
       <el-table
         :data="examRoomClassList"
         border

+ 11 - 4
src/modules/exam/components/taskApply/TaskPaper.vue

@@ -387,7 +387,7 @@
 </template>
 
 <script>
-import { mapState, mapMutations } from "vuex";
+import { mapState, mapMutations, mapActions } from "vuex";
 
 import { cardForSelectList } from "../../api";
 import { attachmentPreview } from "../../../login/api";
@@ -439,7 +439,13 @@ export default {
     };
   },
   computed: {
-    ...mapState("exam", ["editType", "examTask", "curTaskApply", "taskStatus"]),
+    ...mapState("exam", [
+      "editType",
+      "examTask",
+      "curTaskApply",
+      "taskStatus",
+      "auditLogCache",
+    ]),
     IS_TIKU_TAB() {
       return this.curTab === "tiku";
     },
@@ -454,6 +460,7 @@ export default {
   },
   methods: {
     ...mapMutations("exam", ["setEditType", "setExamTask", "setCurTaskApply"]),
+    ...mapActions("exam", ["addPreviewLog"]),
     initData() {
       this.paperAttachments = this.curTaskApply.paperAttachmentIds
         ? JSON.parse(this.curTaskApply.paperAttachmentIds)
@@ -589,7 +596,7 @@ export default {
       this.paperConfirmAttachments.splice(index, 1);
     },
     toViewCard(attachment) {
-      this.addPreviewLog(attachment, "card");
+      this.addPreviewLog({ attachment, type: "card" });
       window.open(
         this.getRouterPath({
           name: "CardPreview",
@@ -703,7 +710,7 @@ export default {
     },
     async downloadPaper(attachment) {
       if (!attachment.attachmentId) return;
-      this.addPreviewLog(attachment, "paper");
+      this.addPreviewLog({ attachment, type: "paper" });
       const data = await attachmentPreview(attachment.attachmentId);
       window.open(data.url);
     },

+ 23 - 1
src/modules/exam/store.js

@@ -1,4 +1,9 @@
-import { waitExamTaskCount, stmmsTaskCount, analysisTaskCount } from "./api";
+import {
+  waitExamTaskCount,
+  stmmsTaskCount,
+  analysisTaskCount,
+  savePreviewLog,
+} from "./api";
 import { calcSum } from "@/plugins/utils";
 
 const state = {
@@ -19,6 +24,7 @@ const state = {
   examTask: {},
   curTaskApply: {},
   taskStatus: {},
+  auditLogCache: { paper: {}, card: {} },
 };
 
 const mutations = {
@@ -66,6 +72,9 @@ const mutations = {
       curTaskApplyPartial
     );
   },
+  setAuditLogCache(state, auditLogCache) {
+    state.auditLogCache = auditLogCache;
+  },
 };
 
 const actions = {
@@ -100,6 +109,19 @@ const actions = {
     const count = calcSum(counts);
     commit("setWaitTaskCount", count || 0);
   },
+  async addPreviewLog({ state, commit }, { attachment, type }) {
+    if (!state.taskStatus.IS_AUDIT) return;
+    const id = type === "paper" ? attachment.attachmentId : attachment.cardId;
+    if (!Object.prototype.hasOwnProperty.call(state.auditLogCache[type], id))
+      return;
+
+    state.auditLogCache[type][id] = true;
+    await savePreviewLog({
+      examTaskId: state.curTaskApply.examTaskId,
+      paperType: attachment.name,
+      type,
+    });
+  },
 };
 
 export default {

+ 1 - 1
src/modules/mark/components/ModifyMarkSetting.vue

@@ -29,7 +29,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="markStartTime" label="评卷时间:">
+        <el-form-item label="评卷时间:">
           <el-date-picker
             v-model="markTime"
             type="datetimerange"