mo 4 years ago
parent
commit
cd5fbb21fe
1 changed files with 35 additions and 11 deletions
  1. 35 11
      src/views/teamBuild/teamSeting/components/setClassV2.vue

+ 35 - 11
src/views/teamBuild/teamSeting/components/setClassV2.vue

@@ -303,7 +303,7 @@
       <selectStudent
         :activeListStudent="activeListStudent"
         :studentList="studentList"
-        :soundList="soundList"
+        :soundList="activeSoundList"
         :classGroupId="activeClass"
         :isOnlyChangeUser="true"
         :activeType="activeType"
@@ -819,6 +819,7 @@ export default {
       activeStudentList: [],
       classList: [],
       appoint: false,
+      activeSoundList:[]
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -907,12 +908,6 @@ export default {
           obj.name = this.newClassForm.className;
           obj.type = this.newClassForm.type;
           obj.groupType = "MUSIC";
-          // if (this.newClassForm.memo.length > 0) {
-          //   obj.memo = this.newClassForm.memo.join(',')
-          // } else {
-          //   obj.memo = null
-          // }
-
           obj.expectStudentNum = this.newClassForm.expectStudentNum;
           obj.teacherMapperList = [];
           obj.teacherMapperList.push({
@@ -927,9 +922,10 @@ export default {
               obj.memo = this.newClassForm.memo.join(",");
             }
           } else {
+            // 线下基础技能班
             subjectIdList =
-              this.newClassForm.subjectIdList.length > 0
-                ? this.newClassForm.subjectIdList.join(",")
+              this.newClassForm.memo.length > 0
+                ? this.newClassForm.memo.join(",")
                 : null;
             for (let i in this.newClassForm.teaching) {
               obj.teacherMapperList.push({
@@ -940,9 +936,11 @@ export default {
             obj.memo = null;
           }
           obj.subjectIdList = subjectIdList;
+          obj.memo = subjectIdList
           createClass(obj).then((res) => {
             if (res.code == 200) {
               this.$message.success("创建成功");
+              this.resetClassFrom()
               this.getList();
               this.newClassVisible = false;
             }
@@ -950,6 +948,18 @@ export default {
         }
       });
     },
+    resetClassFrom() {
+      this.newClassForm = {
+        className: null,
+        type: null,
+        subjectIdList: [],
+        subjectId: "",
+        expectStudentNum: null,
+        bishop: null,
+        teaching: [],
+        memo: [],
+      };
+    },
     removeStudent(item) {
       removeStudents({
         classGroupId: this.activeClass,
@@ -1144,6 +1154,7 @@ export default {
         if (res.code == 200) {
           this.$message.success("创建成功");
           this.getList();
+          this.resetClassFrom()
           this.studentVisible = false;
           this.newClassVisible = false;
         }
@@ -1421,7 +1432,20 @@ export default {
           });
         }
       });
-      this.getNoClassStudent(row.type);
+      if( this.activeType == 'HIGH' || this.activeType=='HIGH_ONLINE'){
+        this.getNoClassStudent(row.type,row.memo);
+        let arr = row.memo.split(',')
+        console.log(arr)
+        this.activeSoundList = this.soundList.filter(sound=>{
+          return arr.indexOf(sound.id+'') != -1
+        })
+        console.log(this.activeSoundList)
+      }else{
+        this.activeSoundList = this.soundList
+        this.getNoClassStudent(row.type);
+          console.log(this.activeSoundList)
+      }
+
     },
     // 排课开始
     arrangeStart() {
@@ -1676,7 +1700,7 @@ export default {
             ) {
               // 要么选中长号  要么选中上低音号
               sound.disabled = false;
-            }else{
+            } else {
               sound.disabled = true;
             }
           });