Browse Source

教师中心

SanHQin 1 tuần trước cách đây
mục cha
commit
b467406cd0
1 tập tin đã thay đổi với 45 bổ sung2 xóa
  1. 45 2
      src/components/pages/testPerson/examine/index.vue

+ 45 - 2
src/components/pages/testPerson/examine/index.vue

@@ -52,7 +52,7 @@
             </el-option>
           </el-select>
         </div>
-
+        <!-- v-if="allData.type != 2" -->
         <el-button
           v-if="allData.type != 2"
           type="primary"
@@ -60,6 +60,14 @@
           @click="Submit"
           >提交</el-button
         >
+
+        <el-button
+          v-if="allData.type != 2"
+          type="primary"
+          size="mini"
+          @click="saveBtn"
+          >保存</el-button
+        >
       </div>
     </div>
     <div style="flex: 1;overflow: hidden;" class="notes">
@@ -273,7 +281,7 @@ export default {
     this.getPageBase2(1)
     this.getPageBase2(2)
     console.log('666');
-    
+
     // console.log(JSON.stringify(this.TeaTabJson));
   },
   methods: {
@@ -551,6 +559,41 @@ export default {
     handleClose(done) {
       this.getPageBase();
       done();
+    },
+    //保存按钮
+    saveBtn(){
+      this.$forceUpdate();
+      let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
+
+      for (const e of PageBaseDataCopy) {
+        for (const k of e.children) {
+          if (k.testid.test.length > 0) {
+            k.testid.test = k.testid.test.map(item => item.courseId);
+          }
+        }
+      }
+
+      let params = [
+        {
+          uid: this.userid,
+          oid: this.oid,
+          org: this.org,
+          type: this.pType,
+          json: JSON.stringify(PageBaseDataCopy),
+          ttype: 1,
+          tid:this.testExamineBaseList[0].id
+        }
+      ];
+      // return console.log(params);
+      this.ajax
+        .post(this.$store.state.api + "addTestExamineWorks2", params)
+        .then(res => {
+          console.log("addTestExamineWorks2", res);
+          this.$message.success("保存成功")
+        })
+        .catch(error => {
+          console.log(error);
+        });
     }
   }
 };