|
@@ -18,7 +18,7 @@
|
|
|
>清空列表</el-button
|
|
|
>
|
|
|
<div>
|
|
|
- <el-radio-group v-model="radio">
|
|
|
+ <el-radio-group v-model="radio" @change="changeMasterClass">
|
|
|
<el-table
|
|
|
:data="dataList"
|
|
|
height="300px"
|
|
@@ -48,8 +48,8 @@
|
|
|
>
|
|
|
<!-- -->
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-if="scope.row.studentList">
|
|
|
- {{ scope.row.studentList.length }}
|
|
|
+ <div>
|
|
|
+ {{ scope.row.studentList?scope.row.studentList.length:0 }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -59,7 +59,7 @@
|
|
|
<el-button type="text" @click="cancleCom(scope.row)"
|
|
|
>取消</el-button
|
|
|
>
|
|
|
- <el-button type="text" @click="showStudentList(scope.row)"
|
|
|
+ <el-button type="text" @click="showStudentList(scope.row)" :disabled="scope.row.id==radio"
|
|
|
>添加学生</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -89,6 +89,8 @@
|
|
|
width="800px"
|
|
|
>
|
|
|
<viewStudentList
|
|
|
+ :classId="activeRow.id"
|
|
|
+ :disabledList='allStudentList'
|
|
|
:list="studentList"
|
|
|
:chioseList="activeRow.studentList"
|
|
|
v-if="studentListModalVisible"
|
|
@@ -97,15 +99,30 @@
|
|
|
@close="closeStudentView"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="calenderStudentVisible"
|
|
|
+ title="学员缴费列表"
|
|
|
+ append-to-body
|
|
|
+ width="800px"
|
|
|
+ >
|
|
|
+ <!-- studentIds:[],
|
|
|
+ masterClassGroupId:'',
|
|
|
+ classGroupStudents:[] -->
|
|
|
+ <calenderStudentList v-if="calenderStudentVisible" :studentIds='studentIds' :masterClassGroupId='masterClassGroupId' :classGroupStudents='classGroupStudents'/>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
// import compoundClass from './compoundClass' compoundClass
|
|
|
-import viewStudentList from "../components/modals/view-student-list";
|
|
|
+import viewStudentList from "./student-list";
|
|
|
+import calenderStudentList from "./calenderStudentList"
|
|
|
import { getClassAllStudent } from "@/api/studentManager";
|
|
|
+import { getStudentPaymentCalenders } from '@/api/buildTeam'
|
|
|
+let that;
|
|
|
export default {
|
|
|
props: ["compoundList"],
|
|
|
- components: { viewStudentList },
|
|
|
+ components: { viewStudentList,calenderStudentList },
|
|
|
data() {
|
|
|
return {
|
|
|
radio: "",
|
|
@@ -116,8 +133,17 @@ export default {
|
|
|
studentList: [],
|
|
|
studentListModalVisible: false,
|
|
|
activeRow: null,
|
|
|
+ calenderStudentVisible:false,
|
|
|
+ studentIds:[],
|
|
|
+ masterClassGroupId:'',
|
|
|
+ classGroupStudents:[],
|
|
|
+ mergeInfo:{}
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
+ created(){
|
|
|
+ that = this;
|
|
|
+ },
|
|
|
methods: {
|
|
|
cancleCom(row) {
|
|
|
this.$emit("cancleCompound", row);
|
|
@@ -125,19 +151,27 @@ export default {
|
|
|
clearCom() {
|
|
|
this.$emit("clearCom");
|
|
|
},
|
|
|
- submitClass() {
|
|
|
+ async submitClass() {
|
|
|
if (!this.radio) {
|
|
|
this.$message.error("请选择一个主班");
|
|
|
return;
|
|
|
}
|
|
|
// let arr = []
|
|
|
- let idList = [];
|
|
|
+ // 主班id
|
|
|
+ // 第一个是所有学员 this.radio
|
|
|
+ // 班级和学生id的键值对
|
|
|
+ // 第三个是主班编号 this.radio
|
|
|
+ let idList = []; // 所有的班级id
|
|
|
+ this.classGroupStudents= []
|
|
|
let flag = false
|
|
|
this.dataList.forEach((com) => {
|
|
|
// arr.push(com.type)
|
|
|
- if(!com.studentList || com.studentList.length<=0){
|
|
|
+ if(!com.studentList&&com.id!=this.radio || com.studentList?.length<=0&&com.id!=this.radio){
|
|
|
flag = true
|
|
|
}
|
|
|
+ if(com.id!=this.radio){
|
|
|
+ this.classGroupStudents.push({[com.id]:com.studentList.map(stu=>stu.userId).join(',')})
|
|
|
+ }
|
|
|
idList.push(com.id);
|
|
|
});
|
|
|
if (this.dataList.length <= 1) {
|
|
@@ -149,9 +183,23 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
// 做判断
|
|
|
- this.idList = idList.join(",");
|
|
|
this.show = true;
|
|
|
this.isLook = false;
|
|
|
+ this.masterClassGroupId = this.radio;
|
|
|
+ this.studentIds = this.allStudentList.map(stu=>{
|
|
|
+ return stu.userId
|
|
|
+ })
|
|
|
+
|
|
|
+ try{
|
|
|
+ const rest = await getStudentPaymentCalenders({studentIds:this.studentIds,masterClassGroupId:this.masterClassGroupId,classGroupStudents:this.classGroupStudents})
|
|
|
+ this.mergeInfo = rest.data
|
|
|
+ this.calenderStudentVisible = true;
|
|
|
+ }catch(e){
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 试着请求
|
|
|
},
|
|
|
getList() {},
|
|
|
closeReset() {
|
|
@@ -182,12 +230,34 @@ export default {
|
|
|
this.dataList.splice(1, 0);
|
|
|
this.studentListModalVisible = false;
|
|
|
},
|
|
|
+ changeMasterClass(val){
|
|
|
+ this.dataList.forEach(classes=>{
|
|
|
+ if(classes.id == val){
|
|
|
+ classes.studentList = null;
|
|
|
+ this.dataList.splice(1, 0);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
compoundList(val) {
|
|
|
this.dataList = val;
|
|
|
},
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ allStudentList(){
|
|
|
+ let arr = []
|
|
|
+ that.dataList.forEach(classes=>{
|
|
|
+ if(classes.studentList){
|
|
|
+ arr = arr.concat(classes.studentList.map(stu=>{
|
|
|
+ stu.classId = classes.id
|
|
|
+ return stu
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|