Ver código fonte

修改表单去除评分

11wqe1 1 semana atrás
pai
commit
dcec2243a4

+ 1 - 0
src/components/pages/liyuan/teacherDevelop.vue

@@ -41,6 +41,7 @@ export default {
         { title: '课堂观察', icon: require('../../../assets/icon/liyuan/ketangguancha.svg'), type: 1, to: "/classroomObservation",role:0 },
         { title: '智能表单', icon: require('../../../assets/icon/liyuan/zhinengbiaodan.svg'), type: 1, to: "/test",role:1 },
         { title: '考核资料', icon: require('../../../assets/icon/liyuan/zlsj.svg'), type: 1, to: "/teadTest",role:0,sortId:'eefb7195-8ee7-11f0-9c7b-005056924926' },
+        { title: '考核审核', icon: require('../../../assets/icon/liyuan/workTest.svg'), type: 1, to: "/testReview",role:0 },
       ]
     }
   },

+ 66 - 24
src/components/pages/testStudent/view/preview.vue

@@ -5,35 +5,35 @@
         <div class="courseTop2" v-if="gotype">
           <div class="r_pub_button_retrun"  @click="retrunCourse">返回</div>
         </div>
-
+          
         <div class="courseTop" v-else :style="`justify-content: ${isN==1?'flex-end':'space-between'};`">
           <div class="stepsNav" v-if="isN !=1 && !gotype">
             <el-breadcrumb v-if="!gotype" separator-class="el-icon-arrow-right">
               <el-breadcrumb-item :to="{
-                  path:
-                    '/testPerson?userid=' +
-                    userid +
-                    '&oid=' +
-                    oid +
-                    '&org=' +
-                    org +
-                    '&role=' +
-                    role,
+    path:
+      '/testPerson?userid=' +
+      userid +
+      '&oid=' +
+      oid +
+      '&org=' +
+      org +
+      '&role=' +
+      role,
                 }" v-if="type == 3 && back!=1">个人中心</el-breadcrumb-item>
-                            <el-breadcrumb-item :to="{
-                  path:
-                    '/testStudent?userid=' +
-                    userid +
-                    '&oid=' +
-                    oid +
-                    '&org=' +
-                    org +
-                    '&role=' +
-                    role +
-                    '&isN=' +
-                    isN +
-                    '&tcid=' +
-                    tcid ,
+              <el-breadcrumb-item :to="{
+    path:
+      '/testStudent?userid=' +
+      userid +
+      '&oid=' +
+      oid +
+      '&org=' +
+      org +
+      '&role=' +
+      role +
+      '&isN=' +
+      isN +
+      '&tcid=' +
+      tcid ,
                 }" v-else v-show="back!=1">表单中心</el-breadcrumb-item>
               <el-breadcrumb-item>
                 <span style="color: rgb(15, 126, 255)">{{ title }}</span>
@@ -592,6 +592,7 @@ export default {
       this.ajax
         .post(this.$store.state.api + ((this.tid) ? "addTestWorks2" : "addTestWorks"), params)
         .then((res) => {
+          if (this.tid) this.delTestWork()
           this.$message.success('提交成功')
           if(this.back==1){
             return this.$router.back()
@@ -653,6 +654,8 @@ export default {
       this.ajax
         .post(this.$store.state.api + ((this.tid) ? "addTestWorks2" : "addTestWorks"), params)
         .then((res) => {
+          if (this.tid) this.delTestWork()
+
           this.$message.success('保存成功')
           setTimeout(() => {
             this.isloading = false
@@ -682,6 +685,45 @@ export default {
         return false
       }
     },
+    delTestWork(){
+      let params = {
+        tid: this.cid
+      };
+      console.log('params',params);
+      
+      this.ajax
+        .get(this.$store.state.api + "getTestAiSco", params)
+        .then((res) => {
+          let data = res.data[0]
+          if (!data.length) return
+          this.uploadSCo(JSON.parse(data[0].json),data[0].cueWord)
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+     // 上传评分
+    uploadSCo(val,cueWord){
+      // console.log('uploadSCo',val);
+      // 提交后删除评分
+      let scoArr = val.filter(e=> e.id != this.tid)
+
+      let params = [{
+        tid:this.cid,
+        uid:this.userid,
+        json:JSON.stringify(scoArr),
+        cw: cueWord
+      }]
+      console.log('params',params);
+       this.ajax
+        .post(this.$store.state.api + "addtestAiSco", params)
+        .then((res) => {
+          // console.log(res);
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     deleteTest(tid) {
       let _this = this;
       let params = [