lrf402788946 4 years ago
parent
commit
e11a52307a
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/service/student.js

+ 4 - 2
app/service/student.js

@@ -424,7 +424,7 @@ class StudentService extends CrudService {
     for (const id of ids) {
       const cla = await this.ctx.service.class.fetch({ id });
       if (!cla) continue;
-      if (type !== 'insurance') { cla.date = moment(cla.startdate).add(1, 'd').format('YYYY-MM-DD'); }
+      if (type === 'insurance') { cla.date = moment(cla.startdate).add(1, 'd').format('YYYY-MM-DD'); }
       classList.push(cla);
     }
     studentList = studentList.map(i => {
@@ -435,7 +435,9 @@ class StudentService extends CrudService {
     const meta = this.metaBx(type);
     let fn = '学生名单';
     const head = _.head(classList);
-    if (head) fn = `${head.term}期-${head.batch}${fn}`;
+    if (head) {
+      if (type === 'class') { fn = `${head.term}期-${head.batch}批-${head.name}${fn}`; } else fn = `${head.term}期-${head.batch}${fn}`;
+    }
     return await this.ctx.service.util.toExcel(studentList, meta, fn);
   }