Browse Source

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

guhongwei 4 years ago
parent
commit
5e4fb035d4

+ 10 - 0
src/views/train-plan/parts/term-lesson-table.vue

@@ -21,6 +21,13 @@
         <template #header="{column, $index}">
           <el-link type="primary" :underline="false" @click="handleToClass(index)">{{ column.label }}</el-link>
         </template>
+        <template v-slot="{ row }">
+          <el-row>
+            <el-col :span="24">
+              {{ getProp(row, `name_${index + 1}`) }}
+            </el-col>
+          </el-row>
+        </template>
       </el-table-column>
       <!-- <el-table-column align="center" label="2班(需要改班级名)" prop="name_2" :show-overflow-tooltip="true"></el-table-column> -->
     </el-table>
@@ -84,6 +91,9 @@ export default {
       let classid = _.get(this.classList[index], 'classid');
       this.$emit('toOneClass', classid);
     },
+    getProp(data, prop) {
+      return _.get(data, prop);
+    },
   },
   filters: {
     getWeekDay(date) {

+ 29 - 2
src/views/train-plan/term-lesson.vue

@@ -14,12 +14,28 @@
       </el-row>
       <el-row type="flex" v-loading="loading" style="min-height:500px">
         <el-col :span="8" v-for="(i, index) in list" :key="index">
-          <lesson-table type="usual" :data="i" :batch="`${index + 1}`" @lesson="toLesson" @other="toOther" @toOneClass="toOneClass"></lesson-table>
+          <lesson-table
+            type="usual"
+            :data="i"
+            :batch="`${index + 1}`"
+            :noticeList="noticeList"
+            @lesson="toLesson"
+            @other="toOther"
+            @toOneClass="toOneClass"
+          ></lesson-table>
         </el-col>
       </el-row>
       <el-row type="flex" v-loading="loading" style="min-height:500px" v-for="(i, index) in unusualList" :key="index">
         <el-col :span="8">
-          <lesson-table type="unusual" :data="i" :batch="`${index + 1}`" @lesson="toLesson" @other="toOther" @toOneClass="toOneClass"></lesson-table>
+          <lesson-table
+            type="unusual"
+            :data="i"
+            :batch="`${index + 1}`"
+            :noticeList="noticeList"
+            @lesson="toLesson"
+            @other="toOther"
+            @toOneClass="toOneClass"
+          ></lesson-table>
         </el-col>
       </el-row>
     </detail-frame>
@@ -62,6 +78,7 @@ const { mapActions: mapDept } = createNamespacedHelpers('dept');
 const { mapActions: director } = createNamespacedHelpers('director');
 const { mapActions: school } = createNamespacedHelpers('school'); //给选老师组件使用.这个页面请求完就不销毁了
 const { mapActions: subject } = createNamespacedHelpers('subject');
+const { mapActions: notice } = createNamespacedHelpers('notice');
 export default {
   name: 'term-lesson',
   props: {},
@@ -85,6 +102,8 @@ export default {
       headTeacherList: [],
       schoolList: [],
       subjectList: [],
+      //该期通知列表
+      noticeList: [],
     };
   },
   async created() {
@@ -109,6 +128,8 @@ export default {
     );
   },
   methods: {
+    ...notice({ getNoticeList: 'query' }),
+
     ...lesson({ getLesson: 'query', plupdate: 'pluralUpdate', autoArrange: 'arrange', confirmLesson: 'confirmLesson' }),
     ...classes({ getClass: 'query', pcupdate: 'pluralUpdate' }),
 
@@ -154,6 +175,7 @@ export default {
       let unusualRes = this.dealList(unusualList, lessonList);
       this.$set(this, `list`, usualRes);
       this.$set(this, `unusualList`, unusualRes);
+      this.toGetNoticeList();
       this.loading = false;
     },
     dealList(classList, lessonList) {
@@ -680,6 +702,11 @@ export default {
       const res = await this.confirmLesson(lessonIds);
       this.$checkRes(res, '课表确定成功', res.errmsg || '课表确定失败');
     },
+    async toGetNoticeList() {
+      const { planid, termid } = this.defaultOption;
+      const res = await this.getNoticeList({ planid, termid, type: '4' });
+      if (this.$checkRes(res)) this.$set(this, `noticeList`, res.data);
+    },
   },
   computed: {
     ...mapState(['user', 'defaultOption']),