|
@@ -902,9 +902,24 @@ export default {
|
|
|
// }
|
|
|
// })
|
|
|
// }
|
|
|
+ // res.data - activeListStudent
|
|
|
getMusicGroupStuNoClassType({ musicGroupId: this.teamid, type }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.studentList = res.data
|
|
|
+ // this.studentList = res.data.concat(this.activeListStudent).filter(item=>{
|
|
|
+ // return res.data
|
|
|
+ // });
|
|
|
+ let idarr1 = [];
|
|
|
+ let idarr2 = [];
|
|
|
+ let arr3 = res.data.concat(this.activeListStudent);
|
|
|
+ for (let i in res.data) {
|
|
|
+ idarr1.push(res.data[i].userId);
|
|
|
+ }
|
|
|
+ for (let j in this.activeListStudent) {
|
|
|
+ idarr2.push(this.activeListStudent[j].userId);
|
|
|
+ }
|
|
|
+ this.studentList = arr3.filter(item => {
|
|
|
+ return idarr1.indexOf(item.userId) === -1 || (idarr2.indexOf(item.userId) === -1)
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -914,6 +929,7 @@ export default {
|
|
|
// removeStudents({ classGroupId:}).then(res => {
|
|
|
removeStudents({ classGroupId: this.activeClass, userId: item.userId }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
+ this.$message.success('删除成功');
|
|
|
item.isVisible = false;
|
|
|
// 这里刷新 this.studentList this.activeListStudent
|
|
|
this.getList(this.activeMixClass);
|
|
@@ -942,6 +958,10 @@ export default {
|
|
|
let arr = this.chioseStudent.map(item => {
|
|
|
return item.userId;
|
|
|
});
|
|
|
+ if (arr.length <= 0) {
|
|
|
+ this.$message.error('至少添加一名学员')
|
|
|
+ return;
|
|
|
+ }
|
|
|
addStudents({ classGroupId: this.activeClass, userIdsStr: arr.join(',') }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.studentVisible = false;
|