Browse Source

学时要求不满足时可以直接去学习课程

dedsudiyu 16 hours ago
parent
commit
0c0a450ba5

+ 31 - 23
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/index.vue

@@ -162,29 +162,37 @@
       //操作按钮
       tableButton(item) {
         let self = this;
-        if(item.conditionType == 1){
-          this.$confirm('还未达到学时要求,是否现在去学习?', "提示", {
-            confirmButtonText: "确认",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
-          }).then(() => {
-            //学时要求
-            self.$router.push({
-              path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
-              query: {}
-            })
-          }).catch(() => {});
-        }else{
-          //学习课程
-          this.$router.push({
-            path: '/learningCourse',
-            query: {
-              courseId: item.courseId,
-              examId: item.examId,
-            }
-          })
-        }
+        //学习课程
+        this.$router.push({
+          path: '/learningCourse',
+          query: {
+            courseId: item.courseId,
+            examId: item.examId,
+          }
+        })
+        // if(item.conditionType == 1){
+        //   this.$confirm('还未达到学时要求,是否现在去学习?', "提示", {
+        //     confirmButtonText: "确认",
+        //     cancelButtonText: "取消",
+        //     type: "warning"
+        //   }).then(function() {
+        //   }).then(() => {
+        //     //学时要求
+        //     self.$router.push({
+        //       path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
+        //       query: {}
+        //     })
+        //   }).catch(() => {});
+        // }else{
+        //   //学习课程
+        //   this.$router.push({
+        //     path: '/learningCourse',
+        //     query: {
+        //       courseId: item.courseId,
+        //       examId: item.examId,
+        //     }
+        //   })
+        // }
       },
       examElKnowledgePointTreeList(){
         examElKnowledgePointTreeList({}).then(response => {

+ 16 - 6
src/views/safetyEducationExaminationNew/safetyTest/onlineExam/index.vue

@@ -105,7 +105,6 @@
     components: { richTextPdf },
     data() {
       return {
-        tableButtonType: this.hasPermiDom(['demo:demo:detail', 'demo:demo:edit', 'demo:demo:del']),
         //页面状态
         pageType: 1,
         //横向列表
@@ -276,11 +275,22 @@
       tableButton(type, item) {
         let self = this
         if (type == 1) {
-          //学时要求
-          self.$router.push({
-            path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
-            query: {}
-          })
+          if(item.examStudy&&item.courseId){
+            //学习课程
+            this.$router.push({
+              path: '/learningCourse',
+              query: {
+                courseId: item.courseId,
+                examId: item.examId,
+              }
+            })
+          }else{
+            //学时要求
+            self.$router.push({
+              path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
+              query: {}
+            })
+          }
         }else if(type == 2){
           //学习课程
           this.$router.push({

+ 72 - 3
src/views/safetyEducationExaminationNew/workbench/TaskCard.vue

@@ -26,7 +26,7 @@
         </div>
         <div class="bottom-content-box scrollbar-box">
           <p class="null-p" v-if="!dataList2[0]">暂无数据</p>
-          <div class="bottom-big-box-5" v-for="(item,index) in dataList2" @click="tableButton(item.conditionType,item)">
+          <div class="bottom-big-box-5" v-for="(item,index) in dataList2" @click="tableButtonOne(item.conditionType,item)">
             <p class="text-name-p">{{item.examName}}</p>
             <div class="text-flex-box" v-if="item.conditionType == 1">
               <p>考前学习</p>
@@ -94,8 +94,9 @@
           </div>
           <div class="bottom-big-box-4" v-if="item.examStudy">
             <p>考前学习</p>
-            <p class="colorA" v-if="!item.needStudy" @click="tableButton(2,item)">开始学习</p>
-            <p class="colorC" v-if="item.needStudy">待满足学时要求后解锁</p>
+            <p class="colorA" @click="tableButton(2,item)">开始学习</p>
+            <!--<p class="colorA" v-if="!item.needStudy" @click="tableButton(2,item)">开始学习</p>-->
+            <!--<p class="colorC" v-if="item.needStudy">待满足学时要求后解锁</p>-->
           </div>
           <div class="bottom-big-box-4" v-if="item.mockExam">
             <p>模拟考试</p>
@@ -268,6 +269,74 @@ export default {
       })
     },
     //考试跳转
+    tableButtonOne(type,item){
+      let self = this;
+      if(type == 1){
+        if(item.examStudy&&item.courseId){
+          //学习课程
+          this.$router.push({
+            path: '/learningCourse',
+            query: {
+              courseId: item.courseId,
+              examId: item.examId,
+            }
+          })
+        }else{
+          //学时要求
+          let obj = {
+            examName:item.examName,
+            knowledgePointIds:item.knowledgePointIds,
+            completedStudyHours:item.completedStudyHours,
+            studyHoursRequirement:item.studyHoursRequirement,
+          }
+          let text = Encrypt(JSON.stringify(obj))
+          self.$router.push({
+            path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
+            query: {
+              text : text
+            }
+          })
+        }
+      }else if(type == 2){
+        //学习课程
+        this.$router.push({
+          path: '/learningCourse',
+          query: {
+            courseId: item.courseId,
+            examId: item.examId,
+          }
+        })
+      }else if(type == 3){
+        //模拟考试
+        if(item.mockExamId){
+          this.$router.push({
+            path: '/mockExam',
+            query: {
+              examId: item.examId,
+              attemptId: item.mockExamId,
+            }
+          })
+        }else{
+          examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
+            if(response.data.attemptId){
+              this.$router.push({
+                path: '/mockExam',
+                query: {
+                  examId: item.examId,
+                  attemptId: response.data.attemptId,
+                }
+              })
+            }else{
+              this.msgError(response.message)
+            }
+          })
+        }
+      }else if(type == 4){
+        //在线考试//补考
+        this.setRichExamData(item);
+      }
+    },
+    //考试跳转
     tableButton(type,item){
       let self = this;
       if(type == 1){