lrf402788946 преди 4 години
родител
ревизия
bad3c31465
променени са 1 файла, в които са добавени 57 реда и са изтрити 8 реда
  1. 57 8
      src/views/new-plan/teacher-lesson.vue

+ 57 - 8
src/views/new-plan/teacher-lesson.vue

@@ -54,7 +54,18 @@
         <el-table-column align="center" label="班级" prop="name" sortable></el-table-column>
         <el-table-column align="center" label="科目" prop="subname" sortable></el-table-column>
         <el-table-column align="center" label="日期" prop="day" sortable></el-table-column>
-        <el-table-column align="center" label="已安排授课教师(点击修改)" prop="teaname"></el-table-column>
+        <el-table-column align="center" label="已安排授课教师(点击修改)" prop="teaname">
+          <template v-slot="{ row }">
+            <el-row>
+              <el-col :span="24">
+                {{ row.teaname }}
+                <el-link v-if="getNoticeStatus(row)" :type="getNoticeStatus(row) === '0' ? 'warning' : 'success'">
+                  {{ getNoticeStatus(row) === '0' ? '未确认' : '已确认' }}
+                </el-link>
+              </el-col>
+            </el-row>
+          </template>
+        </el-table-column>
       </el-table>
 
       <el-dialog title="选择教师" width="30%" :visible.sync="dialog" center :destroy-on-close="true" @close="toClose">
@@ -84,6 +95,17 @@
             </el-col>
           </el-checkbox-group>
         </el-row>
+        <el-row style="text-align:center" class="msgrow">
+          <el-col :span="24">请选择班级类型</el-col>
+          <el-radio-group v-model="ctselect">
+            <el-col :span="8">
+              <el-radio border size="small" :label="undefined">全部</el-radio>
+            </el-col>
+            <el-col :span="8" v-for="(i, index) in ctList" :key="index">
+              <el-radio :label="i.code" border size="small">{{ i.name }}</el-radio>
+            </el-col>
+          </el-radio-group>
+        </el-row>
         <span slot="footer" class="dialog-footer">
           <el-button @click="msgDialog = false">取 消</el-button>
           <el-button type="primary" @click="toSendMsg">确 定</el-button>
@@ -117,6 +139,7 @@ const { mapActions: subject } = createNamespacedHelpers('subject');
 const { mapActions: ct } = createNamespacedHelpers('classtype');
 const { mapActions: teacher } = createNamespacedHelpers('teacher');
 const { mapActions: teaplan } = createNamespacedHelpers('teaPlan');
+const { mapActions: notice } = createNamespacedHelpers('notice');
 export default {
   name: 'teacher-lesson',
   props: {},
@@ -133,6 +156,7 @@ export default {
       },
       msgForm: [],
       conForm: [],
+      ctselect: undefined,
       teacherList: [],
       plan: {},
       options: null,
@@ -142,10 +166,12 @@ export default {
       termList: [],
       applyList: [],
       info: {},
+      noticeList: {},
     };
   },
   created() {},
   methods: {
+    ...notice({ getNoticeList: 'query' }),
     ...teaplan({ getApplyTeacher: 'query', toArrrangeTeacher: 'arrangeTeacher', sendMsg: 'sendMsg', confirmPlan: 'confirmPlan' }),
     ...ct({ getCt: 'query' }),
     ...subject({ getSubject: 'query' }),
@@ -227,7 +253,8 @@ export default {
     async toSendMsg() {
       const { planid } = this.options;
       const dup = _.cloneDeep(this.msgForm);
-      const res = await this.sendMsg({ planid, ids: dup });
+      console.log(this.ctselect);
+      const res = await this.sendMsg({ planid, ids: dup, classtype: this.ctselect });
       this.toClose();
     },
     // 确认指定期安排
@@ -247,6 +274,7 @@ export default {
         await this.getCtList();
         await this.getSubjectList();
         await this.getTeacherList();
+        await this.getNotice();
       }
       await this.getTrain();
       this.setData();
@@ -360,6 +388,7 @@ export default {
     selectTeacher(teaid) {
       let r = this.applyList.find(f => f.teacherid == teaid);
       if (r) this.info.teaname = r.teaname;
+      else this.$set(this, `info`, _.omit(this.info, ['teaid', 'teaname']));
     },
     async toArrrange() {
       let msg = this.$message({ message: '正在处理,请稍后...', duration: 0 });
@@ -370,12 +399,32 @@ export default {
         this.getInfo('reload');
       }
     },
+    async getNotice() {
+      const { planid } = this.defaultOption;
+      const res = await this.getNoticeList({ planid, type: '6' });
+      if (this.$checkRes(res)) this.$set(this, `noticeList`, res.data);
+    },
     toSendDialog() {
       this.msgDialog = true;
     },
     toConDialog() {
       this.conDialog = true;
     },
+    getNoticeStatus(row) {
+      const { teaid } = row;
+      if (!teaid) return;
+      const res = this.noticeList.find(f => f.termid == row.termid && f.classid == row.classid);
+      if (res) {
+        const { notified } = res;
+        if (_.isArray(notified)) {
+          const r = notified.find(f => f.notifiedid === teaid);
+          if (r) {
+            console.log(r);
+            return r.status;
+          }
+        }
+      }
+    },
   },
   watch: {
     defaultOption: {
@@ -391,12 +440,12 @@ export default {
           if (nplanid && !_.isEqual(nplanid, oplanid)) {
             this.getInfo();
           }
-          let ntermid = _.get(val, 'termid');
-          let otermid = _.get(this.options, 'termid');
-          if (ntermid && !_.isEqual(ntermid, otermid)) {
-            this.$set(this, `options`, _.cloneDeep(val));
-            this.getInfo();
-          }
+          // let ntermid = _.get(val, 'termid');
+          // let otermid = _.get(this.options, 'termid');
+          // if (ntermid && !_.isEqual(ntermid, otermid)) {
+          //   this.$set(this, `options`, _.cloneDeep(val));
+          //   this.getInfo();
+          // }
         }
       },
     },