11wqe1 8 月之前
父节点
当前提交
225d99661e
共有 1 个文件被更改,包括 32 次插入8 次删除
  1. 32 8
      src/components/pages/test/check/index.vue

+ 32 - 8
src/components/pages/test/check/index.vue

@@ -1033,8 +1033,32 @@ export default {
       this.ajax
           .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
           .then((res) => {
+            console.log('this.TeachingOptions',this.TeachingOptions);
+            console.log(res.data);
+            let data = res.data[0];
+            this.TeachingOptions.forEach(e=>{
+              data.forEach(i=>{
+                if (e.id == i.id) {
+                  e.name = i.name
+                }
+              })
+            })
+          })
+          .catch((err) => {
+              this.isLoading = false;
+              console.error(err);
+          });
+    },
+    getClass3() {
+      let params = {
+          oid: this.oid,
+      };
+      this.ajax
+          .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+          .then((res) => {
+            console.log(res.data);
               this.TeachingOptions = res.data[0];
-              console.log('this.TeachingOptions',this.TeachingOptions);
+              // console.log('this.TeachingOptions',this.TeachingOptions);
           })
           .catch((err) => {
               this.isLoading = false;
@@ -1161,14 +1185,14 @@ export default {
           console.log('this.testJson',JSON.parse(JSON.stringify(this.testJson)));
           if (this.testJson.juriP) {
             let ajuri2 =  this.testJson.juri2.split (',');
-            let ajurip =  this.testJson.juriP.split (',');
-            let JData = ajuri2.reverse()
-            // this.TeachingOptions = JData.map((key, index) => ({
-            //   id : key,
-            //   name: ajurip[index]
-            // }));
+            this.TeachingOptions = ajuri2.map((key, index) => ({
+              id : key,
+              name: ''
+            }));
+            this.getClass2()
+          }else{
+            this.getClass3()
           }
-          this.getClass2()
 
           // console.log('dddd',this.TeachingOptions);