zhangjie 1 an în urmă
părinte
comite
585f887578

+ 24 - 15
src/modules/exam/components/createExamAndPrintTask/InfoPrintTask.vue

@@ -273,6 +273,18 @@ import { mapState, mapMutations } from "vuex";
 import UploadButton from "@/components/UploadButton";
 import templateDownload from "@/mixins/templateDownload";
 
+const initModalForm = {
+  examStartTime: "",
+  examEndTime: "",
+  paperNumber: "",
+  courseName: "",
+  courseCode: "",
+  totalSubjects: 1,
+  printHouseId: "",
+  backupCount: null,
+  classId: "",
+};
+
 export default {
   name: "info-print-task",
   components: { ModifyExamTaskStudent, PreviewTaskStudent, UploadButton },
@@ -280,15 +292,7 @@ export default {
   data() {
     return {
       modalForm: {
-        examStartTime: "",
-        examEndTime: "",
-        paperNumber: "",
-        courseName: "",
-        courseCode: "",
-        totalSubjects: 1,
-        printHouseId: "",
-        backupCount: null,
-        classId: "",
+        ...initModalForm,
       },
       tableData: [],
       model2ClassList: [],
@@ -351,17 +355,22 @@ export default {
   methods: {
     ...mapMutations("exam", ["updateTaskInfo"]),
     initData() {
+      this.modalForm = Object.assign(
+        { ...initModalForm },
+        {
+          paperNumber: this.infoExamTask.paperNumber,
+          courseName: this.infoExamTask.courseName,
+          courseCode: this.infoExamTask.courseCode,
+        }
+      );
+
       if (this.IS_MODEL2) {
         this.modalForm.backupCount = this.infoExamPrintPlan.backupCount;
+        this.model2ClassList = [];
+        this.model2ClassIds = [];
         return;
       }
 
-      this.modalForm = Object.assign(this.modalForm, {
-        paperNumber: this.infoExamTask.paperNumber,
-        courseName: this.infoExamTask.courseName,
-        courseCode: this.infoExamTask.courseCode,
-      });
-
       const { examStartTime, examEndTime } = this.infoPrintTask;
       if (examStartTime && examEndTime) {
         this.createTime = [examStartTime, examEndTime];