lrf402788946 4 سال پیش
والد
کامیت
a49dd87ef1
2فایلهای تغییر یافته به همراه43 افزوده شده و 23 حذف شده
  1. 1 1
      src/views/classes/lesson.vue
  2. 42 22
      src/views/classes/parts/class-info.vue

+ 1 - 1
src/views/classes/lesson.vue

@@ -118,7 +118,7 @@ export default {
           });
           this.$set(this, `headTeacherList`, arr);
           //班主任筛选可以当礼仪老师列表,和 礼仪教师列表合并
-          duplicate = duplicate.filter(f => f.islyteacher == '1');
+          // duplicate = duplicate.filter(f => f.islyteacher == '1');
           this.$set(this, `lyTeacherList`, [...this.lyTeacherList, ...duplicate]);
         }
       }

+ 42 - 22
src/views/classes/parts/class-info.vue

@@ -1,34 +1,15 @@
 <template>
   <div id="class-info">
     <data-form ref="form" :inline="true" :needSave="false" :data="form" :fields="fields" :rules="{}" @save="handleSave" :reset="false">
-      <!-- <template #options="{item, form}">
-        <template v-if="item.model == 'headteacherid'">
-          <el-option-group v-for="(dept, index) in headTeacherList" :label="dept.name" :key="index">
-            <el-option v-for="(i, tIndex) in dept.list" :key="`${index}-${tIndex}`" :label="i.name" :value="i._id"></el-option>
-          </el-option-group>
-        </template>
-        <template v-if="item.model == 'lyteacherid'">
-          <el-option v-for="(tea, index) in lyTeacherList" :key="`${item.model}${index}`" :label="tea.name" :value="tea.id"></el-option>
-        </template>
-        <template v-if="item.model == 'jslocationid'">
-          <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
-        </template>
-        <template v-if="item.model == 'kbyslocationid'">
-          <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
-        </template>
-        <template v-if="item.model == 'kzjhlocationid'">
-          <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
-        </template>
-        <template v-if="item.model == 'yclocationid'">
-          <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
-        </template>
-      </template> -->
       <template #custom="{item, form}">
         <template v-if="item.model == 'headteacherid'">
           {{ classInfo.headteacher || '暂无' }}
         </template>
         <template v-else-if="item.model == 'lyteacherid'">
           {{ getly(form.lyteacherid) || '暂无' }}
+          <el-link :type="wordColor(getNoticeResult(form.lyteacherid))">
+            {{ getNoticeResult(form.lyteacherid) }}
+          </el-link>
         </template>
         <template v-else-if="item.model == 'jslocationid'">
           {{ classInfo.jslocation || '暂无' }}
@@ -52,6 +33,7 @@ import _ from 'lodash';
 import dataForm from '@frame/components/form';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: classes } = createNamespacedHelpers('classes');
+const { mapActions: mapUtil } = createNamespacedHelpers('util');
 export default {
   name: 'class-info',
   props: {
@@ -75,10 +57,12 @@ export default {
         { label: '拓展训练地点', model: 'kzjhlocationid', type: 'text', custom: true },
         { label: '用餐地点', model: 'yclocationid', type: 'text', custom: true },
       ],
+      noticeList: [],
     };
   },
   created() {},
   methods: {
+    ...mapUtil(['fetch']),
     ...classes(['update']),
     toSave() {
       this.$refs.form.save();
@@ -93,6 +77,42 @@ export default {
       let res = this.lyTeacherList.find(i => i.id == id);
       if (res) return res.name;
     },
+    // 消息列表
+    async getNoticeList() {
+      let { _id: classid, planid, termid } = this.classInfo;
+      let 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);
+    },
+    getNoticeResult(teaid) {
+      let word = '';
+      if (teaid) {
+        const { notified } = this.noticeList;
+        if (notified) {
+          const r = notified.find(f => f.notifiedid == teaid);
+          if (!r) word = '未收到通知';
+          else {
+            word = r.status == '0' ? '未确认' : '已确认';
+          }
+        }
+      }
+      return word;
+    },
+    wordColor(word) {
+      let type = 'danger';
+      if (word == '未确认') type = 'warning';
+      if (word == '已确认') type = 'success';
+      return type;
+    },
+  },
+  watch: {
+    classInfo: {
+      handler(val) {
+        let id = _.get(val, '_id');
+        if (id) this.getNoticeList();
+      },
+      immediate: true,
+      deep: true,
+    },
   },
   computed: {
     ...mapState(['user']),