Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-center

lrf402788946 4 years ago
parent
commit
1b1cf45486
1 changed files with 21 additions and 4 deletions
  1. 21 4
      src/views/train-plan/parts/class-table.vue

+ 21 - 4
src/views/train-plan/parts/class-table.vue

@@ -15,7 +15,10 @@
           <template v-slot="{ row, $index }">
             <el-row>
               <el-col :span="24">{{ getProp(row, `subname_day${index + 1}`) }}</el-col>
-              <el-col :span="24" v-if="getProp(row, `teaname_day${index + 1}`)">{{ getProp(row, `teaname_day${index + 1}`) }}</el-col>
+              <el-col :span="24" v-if="getProp(row, `teaname_day${index + 1}`)">
+                <p>{{ getProp(row, `teaname_day${index + 1}`) }}</p>
+                <p>{{ getPhone(row, `teaid_day${index + 1}`) }}</p>
+              </el-col>
               <el-col :span="24">
                 <el-link :type="wordColor(getNoticeResult(getProp(row, `teaid_day${index + 1}`)))">
                   {{ getNoticeResult(getProp(row, `teaid_day${index + 1}`)) }}
@@ -146,7 +149,7 @@ export default {
     ...mapUtil(['fetch']),
     ...lesson(['query', 'create', 'update']),
     ...subject({ getSubject: 'query' }),
-    ...teacher({ getTeacher: 'query' }),
+    ...teacher({ getTeacher: 'query', lessonteafetch: 'lessonteafetch' }),
     ...school({ getSchool: 'query' }),
     async search() {
       let res = await this.fetch({ model: 'lesson', classid: _.get(this.classInfo, '_id') });
@@ -158,6 +161,7 @@ export default {
         this.$set(this, `lessonInfo`, _.omit(res.data, ['lessons']));
         let arr = _.get(res.data, `lessons`, []);
         this.$set(this, `oLessonList`, _.cloneDeep(arr));
+        this.seachTeacher();
         let x = this.getX(JSON.parse(JSON.stringify(arr)));
         this.getY(JSON.parse(JSON.stringify(arr)));
         this.$set(this, `dateList`, x);
@@ -353,11 +357,19 @@ export default {
         arr.map(i => i.time)
       );
     },
-    //教师列表,课程列表,通知信息
+    //课程列表
     async getOtherList() {
       let res = await this.getSubject();
       if (this.$checkRes(res)) this.$set(this, `subjectList`, res.data);
-      res = await this.getTeacher({ status: '4' });
+      // res = await this.getTeacher({ status: '4' });
+      // if (this.$checkRes(res)) this.$set(this, `teacherList`, res.data);
+    },
+    // 教师列表
+    async seachTeacher() {
+      let arr = this.oLessonList.filter(item => item.teaid != null);
+      let NewArr = _.uniqBy(arr, 'teaid');
+      var ids = NewArr.map(item => item.teaid);
+      let res = await this.lessonteafetch(ids);
       if (this.$checkRes(res)) this.$set(this, `teacherList`, res.data);
       res = await this.fetch({ model: 'notice', classid: this.classInfo.id, type: '4', planid: this.classInfo.planid, termid: this.classInfo.termid });
       if (this.$checkRes(res)) this.$set(this, `noticeList`, res.data);
@@ -392,6 +404,11 @@ export default {
     getProp(data, prop) {
       return _.get(data, prop);
     },
+    // 手机号
+    getPhone(data, prop) {
+      let teacher = this.teacherList.find(f => f.id == _.get(data, prop));
+      if (teacher) return teacher.phone;
+    },
     //时间处理
     hsavetime(type) {
       let { index } = this.form;