|
@@ -37,12 +37,34 @@
|
|
|
<el-table-column align='center'
|
|
|
prop=""
|
|
|
label="主教老师">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.classGroupTeacherMapperList">
|
|
|
+ <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
|
|
|
+ v-if="item.teacherRole == 'BISHOP'"
|
|
|
+ :key='index'>{{item.userName}}</p>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
label="助教老师">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.classGroupTeacherMapperList">
|
|
|
+ <p v-for="(item,index) in scope.row.classGroupTeacherMapperList"
|
|
|
+ v-if="item.teacherRole == 'TEACHING'"
|
|
|
+ :key='index'>{{item.userName}}</p>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
label="是否排课">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <p v-if="scope.row.totalClassTimes > 0"> 是</p>
|
|
|
+ <p v-if="scope.row.totalClassTimes <= 0"> 否</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
label="操作">
|
|
@@ -113,25 +135,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
-
|
|
|
<!-- multiple
|
|
|
collapse-tags -->
|
|
|
- <el-select v-model="activeChioseSound"
|
|
|
+ <el-select v-if="isNewClass"
|
|
|
+ v-model="activeChioseSound"
|
|
|
style="width:180px"
|
|
|
clearable
|
|
|
placeholder="声部选择">
|
|
|
- <el-option v-for='(item,index) in chioseSoundList'
|
|
|
+ <el-option v-for='(item,index) in soundList'
|
|
|
:key='index'
|
|
|
:label="item.name"
|
|
|
:value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
- <el-button type="danger"
|
|
|
+ <el-button v-if="isNewClass"
|
|
|
+ type="danger"
|
|
|
style="margin-left:20px;"
|
|
|
@click="searchStudent">搜索</el-button>
|
|
|
|
|
|
<!-- 列表开始 -->
|
|
|
<div class="tableList">
|
|
|
<el-table tooltip-effect="dark"
|
|
|
+ v-if="!isNewClass"
|
|
|
style="width: 100%; margin-top:10px;"
|
|
|
:data='studentList'
|
|
|
ref='studentList'
|
|
@@ -150,7 +174,34 @@
|
|
|
width="55"
|
|
|
label="性别">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="musicGroupName"
|
|
|
+ <el-table-column prop="subjectName"
|
|
|
+ align='center'
|
|
|
+ label="学员声部">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 新增班级的table -->
|
|
|
+ <el-table tooltip-effect="dark"
|
|
|
+ v-if="isNewClass"
|
|
|
+ style="width: 100%; margin-top:10px;"
|
|
|
+ :data='studentList'
|
|
|
+ ref='studentList'
|
|
|
+ @selection-change="NewselectionStudent">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ align='center'
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name"
|
|
|
+ align='center'
|
|
|
+ width="80"
|
|
|
+ label="姓名">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="gender"
|
|
|
+ align='center'
|
|
|
+ width="55"
|
|
|
+ label="性别">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="subjectName"
|
|
|
align='center'
|
|
|
label="学员声部">
|
|
|
</el-table-column>
|
|
@@ -162,15 +213,21 @@
|
|
|
<div slot="footer"
|
|
|
class="dialog-footer">
|
|
|
<el-button @click="studentVisible = false">取 消</el-button>
|
|
|
+ <!-- 班级学员修改 -->
|
|
|
<el-button type="primary"
|
|
|
+ v-if="!isNewClass"
|
|
|
+ @click="addSomeStudent">确 定</el-button>
|
|
|
+ <!-- 临时调整或者新建班级 -->
|
|
|
+ <el-button type="primary"
|
|
|
+ v-if="isNewClass"
|
|
|
@click="studentVisible = false">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getAllClass, getAllSignClassandTeacher, getAllSignClass, removeSingleClass, getNoClassStudentAll } from '@/api/buildTeam'
|
|
|
-import { getClassAllStudent, removeStudents } from '@/api/studentManager'
|
|
|
+import { getAllClass, getAllSignClassandTeacher, getAllSignClass, removeSingleClass, getNoClassStudentAll, findSound, teamSoundStudent } from '@/api/buildTeam'
|
|
|
+import { getClassAllStudent, removeStudents, addStudents } from '@/api/studentManager'
|
|
|
import axios from 'axios'
|
|
|
import qs from 'qs'
|
|
|
export default {
|
|
@@ -190,9 +247,11 @@ export default {
|
|
|
chioseSoundList: [], //当前的所有声部
|
|
|
studentList: [], //列表里的学生集合
|
|
|
activeMixClass: '', // 选中的合奏班
|
|
|
+ chioseStudent: [],// 勾选的学生信息
|
|
|
isNewClass: true,
|
|
|
className: '', // 班级名称
|
|
|
- activeClass: ''
|
|
|
+ activeClass: '', // 当前操作的班级
|
|
|
+ soundList: []
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -213,8 +272,15 @@ export default {
|
|
|
// this.holidayList = Object.keys(res.data[year])
|
|
|
// })
|
|
|
// getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
|
|
|
-
|
|
|
// })
|
|
|
+
|
|
|
+
|
|
|
+ // 根据乐团id获取乐团的所有声部
|
|
|
+ findSound({ musicGroupId: this.teamid }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.soundList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
changeMixClass (val) {
|
|
@@ -234,14 +300,38 @@ export default {
|
|
|
temporary () {
|
|
|
if (!this.topForm.mixClass) {
|
|
|
this.$message.error('请先选择合奏班')
|
|
|
+ return
|
|
|
}
|
|
|
+ this.activeClass = '';
|
|
|
+ this.isNewClass = true;
|
|
|
+ this.studentVisible = true;
|
|
|
+
|
|
|
},
|
|
|
searchStudent () {
|
|
|
// 搜索学生
|
|
|
+ // 根据声部id 乐团id搜索学生
|
|
|
+ teamSoundStudent({ musicGroupId: this.teamid, actualSubjectId: this.activeChioseSound }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.studentList = res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- // 选择学生的方法
|
|
|
- SelectionStudent () {
|
|
|
-
|
|
|
+ // 选择学生的方法修改
|
|
|
+ SelectionStudent (val) {
|
|
|
+ console.log(val)
|
|
|
+ this.chioseStudent = val;
|
|
|
+ if (this.chioseStudent.length > 0) {
|
|
|
+ this.chioseStudent = this.chioseStudent.concat(val);
|
|
|
+ } else {
|
|
|
+ this.chioseStudent = val;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增选中的学生
|
|
|
+ NewselectionStudent (val) {
|
|
|
+ console.log(1111);
|
|
|
+ this.chioseStudent = val;
|
|
|
+ // 这里新增的添加到选中的学生列表 根据学生id去重
|
|
|
+ console.log(this.chioseStudent)
|
|
|
},
|
|
|
// 删除班级
|
|
|
removeClass (scope) {
|
|
@@ -276,7 +366,9 @@ export default {
|
|
|
|
|
|
// 获取乐团内所有未分班的学生
|
|
|
getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
|
|
|
-
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.studentList = res.data
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 删除学生
|
|
@@ -286,12 +378,45 @@ export default {
|
|
|
removeStudents({ classGroupId: this.activeClass, userId: item.userId }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('删除成功')
|
|
|
- item.isVisible = false;
|
|
|
+
|
|
|
+ getClassAllStudent({ classGroupId: row.id }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.activeListStudent = res.data.map(item => {
|
|
|
+ item.isVisible = false;
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 批量添加学生
|
|
|
+ addSomeStudent () {
|
|
|
+ // 获取勾选的学生
|
|
|
+ let arr = this.chioseStudent.map(item => {
|
|
|
+ return item.userId;
|
|
|
+ });
|
|
|
+ addStudents({ classGroupId: this.activeClass, userIdsStr: arr.join(',') }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.studentVisible = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 对象数组去重
|
|
|
+ objArrayRemoval (arr, attr) {
|
|
|
+ let obj = {};
|
|
|
+ let result = [];
|
|
|
+ // console.log(this.allActiveStudent.length);
|
|
|
+ for (let x in arr) {
|
|
|
+ if (!obj[arr[x][attr]]) {
|
|
|
+ result.push(arr[x]);
|
|
|
+ obj[arr[x][attr]] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|