Ver Fonte

详情提交与选择学员同逻辑,修复删除问题

wolyshaw há 3 anos atrás
pai
commit
2fcb22cf19
1 ficheiros alterados com 13 adições e 0 exclusões
  1. 13 0
      src/views/activeProgram/program.vue

+ 13 - 0
src/views/activeProgram/program.vue

@@ -527,6 +527,18 @@ export default {
                 return;
             }
 
+            if (this.isMusicTheory) {
+                if (!(this.checkboxSelectIds.length >= 1 && this.checkboxSelectIds.length <= this.studentNum)) {
+                    this.$toast(`请选择1-${this.form.studentNum}名学生,当前选择${this.checkboxSelectIds.length}名`);
+                    return;
+                }
+            } else {
+                if (this.checkboxSelectIds.length != this.studentNum) {
+                    this.$toast(`请选择学生${this.form.studentNum}名,当前选择${this.checkboxSelectIds.length}名`);
+                    return;
+                }
+            }
+
             let onlineClassesStatus = !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false;
             let offlineClassesStatus = !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false;
 
@@ -626,6 +638,7 @@ export default {
                     let index = this.studentList.indexOf(item);
                     if (index !== -1) {
                         this.studentList.splice(index, 1);
+                        this.checkboxSelectIds.splice(index, 1);
                     }
                 })
             } else if(type == 'class') {