Explorar o código

基础技能班限制

1
mo %!s(int64=4) %!d(string=hai) anos
pai
achega
9da7937f66

+ 1 - 0
src/api/buildTeam.js

@@ -1450,3 +1450,4 @@ export function getOrganCourseDurationSettings (data) {
   })
 }
 
+

+ 3 - 2
src/views/teamBuild/teamSeting/components/setClassV2.vue

@@ -902,6 +902,8 @@ export default {
         return this.$message.error("班级人数必须为3-6人");
       }
       this.$refs["newClassForm"].validate((res) => {
+        // 判断基础技能班数量
+
         if (res) {
           let obj = {};
           obj.musicGroupId = this.teamid;
@@ -933,10 +935,9 @@ export default {
                 teacherRole: "TEACHING",
               });
             }
-            obj.memo = null;
+            obj.memo = subjectIdList;
           }
           obj.subjectIdList = subjectIdList;
-          obj.memo = subjectIdList
           createClass(obj).then((res) => {
             if (res.code == 200) {
               this.$message.success("创建成功");

+ 77 - 46
src/views/teamDetail/components/resetClass.vue

@@ -183,7 +183,7 @@
       <selectStudent
         :activeListStudent="activeListStudent"
         :studentList="studentList"
-        :soundList="soundList"
+        :soundList="activeSoundList"
         :classGroupId="activeClass"
         :isOnlyChangeUser="isOnlyChangeUser"
         :activeType="activeType"
@@ -301,7 +301,7 @@
       <el-form
         :model="newClassForm"
         :inline="true"
-        label-width="100px"
+         label-width="120px"
         ref="newClassForm"
         class="newClassForm"
       >
@@ -344,19 +344,11 @@
             { required: true, message: '请选择主教老师', trigger: 'blur' },
           ]"
         >
-          <el-select
-            placeholder="请选择主教老师"
+         <remote-search
+            :commit="'setTeachers'"
             v-model="newClassForm.bishop"
-            clearable
-            filterable
-          >
-            <el-option
-              v-for="(item, index) in teacherList"
-              :label="item.realName"
-              :value="item.id"
-              :key="index"
-            ></el-option>
-          </el-select>
+          />
+
         </el-form-item>
         <el-form-item
           label="预计招生数"
@@ -378,27 +370,18 @@
           v-if="newClassForm.type != 'HIGH_ONLINE'"
           prop="teaching"
         >
-          <el-select
-            placeholder="请选择助教老师"
+             <remote-search
+            :commit="'setTeachers'"
             v-model="newClassForm.teaching"
             @change="setAssistant1"
-            clearable
-            multiple
-            filterable
-          >
-            <el-option
-              v-for="(item, index) in teacherList"
-              :label="item.realName"
-              :value="item.id"
-              :key="index"
-            ></el-option>
-          </el-select>
+            :multiple="true"
+          />
         </el-form-item>
         <el-form-item
           label="声部"
           prop="subjectIdList"
           :rules="[{ required: true, message: '请选择声部', trigger: 'blur' }]"
-          v-if="newClassForm.type == 'HIGH' || newClassForm.type == 'NORMAL'"
+          v-if=" newClassForm.type == 'NORMAL'"
           :key="'HIGH'"
         >
           <el-select v-model="newClassForm.subjectIdList" clearable multiple>
@@ -416,10 +399,11 @@
           :rules="[
             { required: true, message: '请选择可报名声部', trigger: 'blur' },
           ]"
-          v-if="newClassForm.type == 'HIGH_ONLINE'"
+          v-if="newClassForm.type == 'HIGH' || newClassForm.type == 'HIGH_ONLINE'"
         >
-          <el-select v-model.trim="newClassForm.memo" multiple clearable>
+          <el-select v-model.trim="newClassForm.memo" multiple clearable   @change="changeMemo">
             <el-option
+
               v-for="(item, index) in soundList"
               :key="index"
               :label="item.name"
@@ -428,7 +412,7 @@
           </el-select>
         </el-form-item>
         <el-form-item
-          label="声部"
+          label="网络教室声部"
           prop="subjectId"
           :rules="[
             { required: true, message: '请选择线上声部', trigger: 'blur' },
@@ -652,7 +636,8 @@ export default {
       courseTime: "",
       studentResetVisiable: false,
       courseTypesByType:null,
-      mergeList:[]
+      mergeList:[],
+      activeSoundList:[]
     };
   },
   created() {
@@ -902,7 +887,19 @@ export default {
           });
         }
       });
-      this.getNoClassStudent(row.type,null,row.id);
+      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)
+      }
     },
     // 班级调整
     classAdjustment(row) {
@@ -997,10 +994,10 @@ export default {
         superFindClassGroups({ classGroupId: this.activeClass }).then((res) => {
           if (res.code == 200) {
             if (
-              this.activeListStudent.length + this.chioseStudent.length > 5 ||
+              this.activeListStudent.length + this.chioseStudent.length > 6 ||
               this.activeListStudent.length + this.chioseStudent.length < 3
             ) {
-              this.$message.error("线上技能班必须为3-5人");
+              this.$message.error("线上技能班必须为3-6人");
               return;
             } else {
               addStudents({
@@ -1082,10 +1079,10 @@ export default {
       }
       if (this.activeType == "HIGH_ONLINE") {
         if (
-          this.activeListStudent.length > 5 ||
+          this.activeListStudent.length > 6 ||
           this.activeListStudent.length < 3
         ) {
-          this.$message.error("线上技能班必须为3-5人");
+          this.$message.error("线上技能班必须为3-6人");
           return;
         }
         this.teacherForm.expectStudentNum = this.activeListStudent.length;
@@ -1252,11 +1249,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 = [];
@@ -1273,8 +1265,8 @@ export default {
             }
           } 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({
@@ -1282,7 +1274,7 @@ export default {
                 teacherRole: "TEACHING",
               });
             }
-            obj.memo = null;
+            obj.memo = subjectIdList;
           }
           obj.subjectIdList = subjectIdList;
           createClass(obj).then((res) => {
@@ -1422,11 +1414,50 @@ export default {
     closeStudentReset() {
       this.studentResetVisiable = false;
     },
+        changeMemo(val) {
+      // 声部id
+      let flag = false;
+      if (val.length < 1) {
+        this.soundList.forEach((sound) => {
+          sound.disabled = false;
+          this.appoint = false;
+        });
+      } else {
+        this.soundList.forEach((sound) => {
+          if (sound.id == val[0]) {
+            if (
+              sound.name.indexOf("上低音号") > -1 ||
+              sound.name.indexOf("长号") > -1
+            ) {
+              // 要么选中长号  要么选中上低音号
+              sound.disabled = false;
+              flag = true;
+            } else {
+              sound.disabled = true;
+              this.appoint = true;
+            }
+          }
+        });
+        if (flag) {
+          this.soundList.forEach((sound) => {
+            if (
+              sound.name.indexOf("上低音号") > -1 ||
+              sound.name.indexOf("长号") > -1
+            ) {
+              // 要么选中长号  要么选中上低音号
+              sound.disabled = false;
+            } else {
+              sound.disabled = true;
+            }
+          });
+        }
+      }
+    },
   },
   watch: {
     "newClassForm.type"() {
       if (this.newClassForm.type === "HIGH_ONLINE") {
-        this.$set(this.newClassForm, "expectStudentNum", 5);
+        this.$set(this.newClassForm, "expectStudentNum", 6);
       }
     },
     infoVisible(val) {