guhongwei 4 anni fa
parent
commit
17c28aab53

+ 13 - 5
src/views/new-plan/arrange/director-arrange.vue

@@ -28,7 +28,7 @@
           </el-table-column>
           <el-table-column label="月份" prop="month" align="center"> </el-table-column>
           <el-table-column label="班级总数" prop="num" align="center">
-            <template v-slot="{ row }">{{ classNum(row.startdate) }}</template>
+            <template v-slot="{ row }">{{ classNum(row.enddate) }}</template>
           </el-table-column>
         </el-table>
       </el-row>
@@ -37,7 +37,7 @@
       <el-form :model="form">
         <el-form-item label="班主任" label-width="120px">
           <el-select v-model="form.rightHeader" placeholder="请选择班主任">
-            <el-option v-for="item in dirList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            <el-option v-for="item in rightHeaderList" :key="item.id" :label="item.name" :value="item.id"></el-option>
           </el-select>
         </el-form-item>
       </el-form>
@@ -72,7 +72,7 @@ export default {
       loading: true,
       // 动态部门列表
       rightHeader: [],
-      // 教师列表
+      // 班主任列表
       dirList: [],
       // 全年计划
       planData: {},
@@ -81,6 +81,8 @@ export default {
       // 修改班主任
       drawer: false,
       form: {},
+      // 部门下的班主任
+      rightHeaderList: [],
       // 督导值班
       reteacherData: {},
     };
@@ -139,7 +141,7 @@ export default {
     classNum(month) {
       month = moment(month).month() + 1;
       let newMonth = this.list.map(i => {
-        i.month = moment(i.startdate).month() + 1;
+        i.month = moment(i.enddate).month() + 1;
         return i;
       });
       let data = _.groupBy(newMonth, 'month');
@@ -184,7 +186,7 @@ export default {
         }
       } else if (prop === 'month' || prop === 'num') {
         let newMonth = this.list.map(i => {
-          i.month = moment(i.startdate).month() + 1;
+          i.month = moment(i.enddate).month() + 1;
           return i;
         });
         let data = _.flatten(_.toPairs(_.groupBy(newMonth, 'month'))).filter(_.isArray);
@@ -245,9 +247,15 @@ export default {
         this.$set(this, `reteacherData`, reteacherData);
       } else {
         this.$set(this, `form`, row);
+        this.changeRightHeader(prop);
         this.drawer = true;
       }
     },
+    changeRightHeader(deptid) {
+      var arr = this.dirList.filter(item => item.department === deptid);
+      console.log(arr);
+      this.$set(this, `rightHeaderList`, arr);
+    },
     // 保存
     async onSubmit() {
       let data = this.form;

+ 15 - 11
src/views/train-plan/remind.vue

@@ -71,7 +71,6 @@ export default {
     },
     // 通知打开
     toSendMsg({ data } = {}) {
-      console.log(data);
       if (data) this.$set(this, `classid`, data.id);
       this.dialogSend = true;
     },
@@ -90,33 +89,38 @@ export default {
         let arr = [...students, ...teachers];
         return arr;
       };
+      console.log(dealData);
       //如果classid为空,就说明是本期发送,应该把每个班的人都拽出来发送
       if (classid) {
         let r = await this.classNameList(classid);
-        if (!r.errcode != 0) return;
+        if (r.errcode != 0) return;
+        console.log('不为空');
         data.notified = dealData(r.data);
       } else {
         let classids = this.list.map(i => i._id);
         let rarr = [];
         for (const classid of classids) {
           let r = await this.classNameList(classid);
-          if (!r.errcode != 0) continue;
+          if (r.errcode != 0) continue;
           let arr = dealData(r.data);
           rarr = [...rarr, ...arr];
         }
         data.notified = rarr;
+        console.log(rarr);
       }
+      console.log(data);
       data.noticeid = this.user.userid;
       let { planyearid, planid, termid } = this.defaultOption;
       data = { ...data, planyearid, planid, termid };
-      const arr = await this.noticeCreate(data);
-      if (this.$checkRes(arr)) {
-        this.$message({
-          message: '通知成功',
-          type: 'success',
-        });
-        this.resetForm();
-      }
+
+      // const arr = await this.noticeCreate(data);
+      // if (this.$checkRes(arr)) {
+      //   this.$message({
+      //     message: '通知成功',
+      //     type: 'success',
+      //   });
+      //   this.resetForm();
+      // }
     },
     toSelect(val) {
       this.selected = val;