lex-xin 4 gadi atpakaļ
vecāks
revīzija
9193c5fa16

+ 6 - 1
src/views/teamBuild/teamSeting/components/setClassV2.vue

@@ -346,6 +346,7 @@
         :classGroupId="activeClass"
         :isOnlyChangeUser="true"
         :activeType="activeType"
+        :isStudentRemove="isStudentRemove"
         type="change"
         @changeActiveChioseSound="changeActiveChioseSound"
         @searchStudent="searchStudent"
@@ -859,6 +860,7 @@ export default {
       classList: [],
       appoint: false,
       activeSoundList: [],
+      isStudentRemove: false,
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -918,6 +920,8 @@ export default {
         return;
       }
       this.newClassVisible = true;
+      // 是否可以移除学员,下次优化会去掉
+      this.isStudentRemove = false;
     },
     newClassSecond() {
       // 判断当前选择的课程类型
@@ -1035,7 +1039,7 @@ export default {
       // let arr = this.chioseStudent.map(item => {
       //   return item.userId;
       // });
-      if (arr.length <= 0) {
+      if (arr.length <= 0 && !this.isStudentRemove) {
         this.$message.error("至少添加一名学员");
         return;
       }
@@ -1462,6 +1466,7 @@ export default {
       this.activeClass = row.id;
       this.isSearch = false;
       this.activeType = row.type;
+      this.isStudentRemove = true;
       this.newClassForm.type = row.type;
       this.activeChioseSound = null;
       // 根据单机班id 查询声部班内的所有学生