Browse Source

证书:配合修改,毕业日期为班级最后一天

lrf402788946 4 years ago
parent
commit
1994b53452
1 changed files with 20 additions and 1 deletions
  1. 20 1
      src/views/classes/print.vue

+ 20 - 1
src/views/classes/print.vue

@@ -10,7 +10,7 @@
           </el-row>
         </el-tab-pane>
         <el-tab-pane label="打印证书" name="cert" :lazy="true">
-          <cert-card :list="studList" :startdate="startdate"></cert-card>
+          <cert-card :list="studList" :startdate="startdate" :enddate="enddate"></cert-card>
         </el-tab-pane>
         <el-tab-pane label="打印报道表" name="sign" :lazy="true">
           <sign-card v-loading="loading" :list="studList"></sign-card>
@@ -52,6 +52,8 @@ export default {
       lth: [], //table表头
       ltr: [], //table y轴
       lessons: [], //原始课表,取出来什么样就什么样
+      startdate: '',
+      enddate: '',
     };
   },
   created() {},
@@ -65,6 +67,7 @@ export default {
     ...director({ getDirector: 'fetch' }),
     tabChange() {
       if (this.active == 'name') this.nameList();
+      if (this.active == 'cert') this.certList();
       if (this.active == 'sign') this.signList();
       if (this.active == 'lesson') this.classLesson();
     },
@@ -99,6 +102,22 @@ export default {
       this.loading = false;
     },
 
+    async certList() {
+      this.loading = true;
+      let classInfo = {};
+      let cir = await this.getClass(this.id);
+      if (!this.$checkRes(cir)) return;
+      classInfo = cir.data;
+      let { _id: classid, enddate, startdate } = classInfo;
+      let res = await this.getStudentList({ classid });
+      if (this.$checkRes(res)) {
+        this.$set(this, `studList`, res.data);
+        this.$set(this, `startdate`, startdate);
+        this.$set(this, `enddate`, enddate);
+      }
+      this.loading = false;
+    },
+
     proLesson(data) {
       let duplicate = _.cloneDeep(data);
       let x = _.uniq(_.orderBy(duplicate, 'date', 'asc').map(i => i.date));