xiatian il y a 3 ans
Parent
commit
94db5600e4

+ 7 - 5
src/modules/questions/views/EditPaper.vue

@@ -1255,12 +1255,14 @@ export default {
     showCheckDuplicate() {
       if (this.paper.checkDuplicateStatus == "DISPOSED") {
         this.showCheckDuplicateBtn = false;
-      } else {
+      } else if (this.paper.paperDetails) {
         for (let paperDetilData of this.paper.paperDetails) {
-          for (let unit of paperDetilData.paperDetailUnits) {
-            if (unit.question.checkDuplicateStatus == "TO_BE_DISPOSE") {
-              this.showCheckDuplicateBtn = true;
-              return;
+          if (paperDetilData.paperDetailUnits) {
+            for (let unit of paperDetilData.paperDetailUnits) {
+              if (unit.question.checkDuplicateStatus == "TO_BE_DISPOSE") {
+                this.showCheckDuplicateBtn = true;
+                return;
+              }
             }
           }
         }

+ 7 - 5
src/modules/questions/views/EditPaperPendingTrial.vue

@@ -1308,12 +1308,14 @@ export default {
     showCheckDuplicate() {
       if (this.paper.checkDuplicateStatus == "DISPOSED") {
         this.showCheckDuplicateBtn = false;
-      } else {
+      } else if (this.paper.paperDetails) {
         for (let paperDetilData of this.paper.paperDetails) {
-          for (let unit of paperDetilData.paperDetailUnits) {
-            if (unit.question.checkDuplicateStatus == "TO_BE_DISPOSE") {
-              this.showCheckDuplicateBtn = true;
-              return;
+          if (paperDetilData.paperDetailUnits) {
+            for (let unit of paperDetilData.paperDetailUnits) {
+              if (unit.question.checkDuplicateStatus == "TO_BE_DISPOSE") {
+                this.showCheckDuplicateBtn = true;
+                return;
+              }
             }
           }
         }

+ 26 - 6
src/modules/questions/views/GenPaperDetail.vue

@@ -1036,7 +1036,7 @@ export default {
 
       this.fullscreenLoading = true;
       this.$http.post(url, this.genPaper).then(
-        () => {
+        (res) => {
           this.$notify({
             message: "组卷成功",
             type: "success",
@@ -1046,7 +1046,7 @@ export default {
           // this.$router.push({
           //   path: "/edit_paper/" + paperId + "/gen_paper",
           // });
-          this.back();
+          this.back(res.data.status);
         },
         (error) => {
           this.$notify({
@@ -1079,7 +1079,7 @@ export default {
           this.genPaper.frozenPaperIds.push(element);
         });
         this.$http.post(url, this.genPaper).then(
-          () => {
+          (res) => {
             this.$notify({
               message: "组卷成功",
               type: "success",
@@ -1091,7 +1091,7 @@ export default {
             //     path: "/edit_paper/" + paperId + "/gen_paper",
             //   });
             // } else {
-            this.back();
+            this.back(res.data.status);
             // }
           },
           (error) => {
@@ -1108,8 +1108,28 @@ export default {
       this.curSelect = val;
       this.searchPaper();
     },
-    back() {
-      this.$router.push({ path: "/questions/gen_paper/1" });
+    back(status) {
+      if ("PASS" == status) {
+        this.$notify({
+          message: "上传成功",
+          type: "success",
+        });
+        this.$router.push({ path: "/questions/gen_paper/1" });
+      } else {
+        this.$confirm("已开启审核功能.是否跳转到待审列表?", "上传成功", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.$router.push({
+              path: "/questions/exam_paper_pending_trial/0",
+            });
+          })
+          .catch(() => {
+            this.$router.push({ path: "/questions/gen_paper/1" });
+          });
+      }
     },
     removePaper(id) {
       for (let [index, paper] of this.selectPapers.entries()) {