Browse Source

导入试卷跳转

xiatian 3 years ago
parent
commit
89ef0c3fcb
1 changed files with 18 additions and 11 deletions
  1. 18 11
      src/modules/questions/views/ImportPaperInfo.vue

+ 18 - 11
src/modules/questions/views/ImportPaperInfo.vue

@@ -203,20 +203,27 @@ export default {
     uploadProgress() {
       console.log("uploadProgress");
     },
-    uploadSuccess() {
-      this.$notify({
-        message: "上传成功",
-        type: "success",
-      });
+    uploadSuccess(res) {
       this.fileLoading = false;
       sessionStorage.setItem("question_back", "true");
-      if (this.importType == "word") {
-        // this.$router.push({
-        //   path: "/edit_paper/" + response.id + "/import_paper",
-        // });
-        this.back();
+      if ("PASS" == res) {
+        this.$notify({
+          message: "上传成功",
+          type: "success",
+        });
+        this.$router.push({ path: "/questions/import_paper/0" });
       } else {
-        this.back();
+        this.$confirm("已开启审核功能.是否跳转到待审列表?", "上传成功", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.$router.push({ path: "/questions/paper_pending_trial/0" });
+          })
+          .catch(() => {
+            this.$router.push({ path: "/questions/import_paper/0" });
+          });
       }
     },
     uploadError(err) {