Browse Source

12/17 15:02

1
mo 4 years ago
parent
commit
7bed746bae
1 changed files with 27 additions and 11 deletions
  1. 27 11
      src/views/teamDetail/componentCourse/resetClass.vue

+ 27 - 11
src/views/teamDetail/componentCourse/resetClass.vue

@@ -23,7 +23,7 @@
           filterable
         >
           <el-option
-            v-for="(item, index) in teacherList"
+            v-for="(item, index) in selects.teachers"
             :key="index"
             :value="item.id"
             :label="item.realName"
@@ -38,7 +38,7 @@
           filterable
         >
           <el-option
-            v-for="(item, index) in teacherList"
+            v-for="(item, index) in selects.teachers"
             :key="index"
             :value="item.id"
             :label="item.realName"
@@ -63,7 +63,7 @@
           collapse-tags
         >
           <el-option
-            v-for="(item, index) in teacherList"
+            v-for="(item, index) in selects.teachers"
             :key="index"
             :value="item.id"
             :label="item.realName"
@@ -161,6 +161,7 @@ import {
   getTeacher,
   resetCourse,
   getCourseScheduleDetail,
+  getOrganCourseDurationSettings,
 } from "@/api/buildTeam";
 import { getTeachSchool } from "@/api/teacherManager";
 import { getSchool } from "@/api/systemManage";
@@ -194,16 +195,17 @@ export default {
       teacherList: [],
       schoolList: [],
       typeTimeList: [],
-       courseTimeList:{},
+      courseTimeList: {},
+      organId: "",
     };
   },
   async mounted() {
-    await getTeacher().then((res) => {
-      if (res.code == 200) {
-        this.teacherList = res.data;
-      }
-    });
-
+    // await getTeacher().then((res) => {
+    //   if (res.code == 200) {
+    //     this.teacherList = res.data;
+    //   }
+    // });
+    this.$store.dispatch("setTeachers");
     this.getDetail(this.id);
   },
   methods: {
@@ -285,7 +287,7 @@ export default {
       }
     },
     getDetail(id) {
-      getCourseScheduleDetail({ courseScheduleId: id }).then((res) => {
+      getCourseScheduleDetail({ courseScheduleId: id }).then(async (res) => {
         if (res.code == 200) {
           this.maskForm = {
             id: res.data.id,
@@ -311,6 +313,20 @@ export default {
             dayjs(res.data.startClassTime).format("HH:mm"),
             dayjs(res.data.endClassTime).format("HH:mm")
           );
+          this.organId = res.data.organId;
+          let type = res.data.type
+          try {
+            const res = await getOrganCourseDurationSettings({
+              organId: this.organId,
+            });
+            this.courseTimeList = res.data;
+            for (let key in this.courseTimeList) {
+              if (key == type) {
+                this.typeTimeList = this.courseTimeList[key].split(",");
+              }
+            }
+          } catch (e) {}
+
           this.maskForm.timer = time;
           if (this.maskForm.teacher && this.maskForm.type == "VIP") {
             getTeachSchool({