liuyu 5 years ago
parent
commit
48bcac7d70
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/service/trainplan.js

+ 1 - 0
app/service/trainplan.js

@@ -168,6 +168,7 @@ class TrainplanService extends CrudService {
             } else {
               // 当班级数有更改时
               // 删除所有班级 并重新生成班级
+              await this.clamodel.deleteMany({ termid: el.id, batchid: batchnum.id });
               const classnum = batchnum.class;
               for (let i = 1; i <= classnum; i++) {
                 const newdata = { name: i + '班', number: batchnum.number, batchid: batchnum.id, termid: el.id };