|
@@ -49,7 +49,9 @@
|
|
|
<!-- -->
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.studentList?scope.row.studentList.length:0 }}
|
|
|
+ {{
|
|
|
+ scope.row.studentList ? scope.row.studentList.length : 0
|
|
|
+ }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -59,7 +61,10 @@
|
|
|
<el-button type="text" @click="cancleCom(scope.row)"
|
|
|
>取消</el-button
|
|
|
>
|
|
|
- <el-button type="text" @click="showStudentList(scope.row)" :disabled="scope.row.id==radio"
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="showStudentList(scope.row)"
|
|
|
+ :disabled="scope.row.id == radio"
|
|
|
>添加学生</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -89,8 +94,8 @@
|
|
|
width="800px"
|
|
|
>
|
|
|
<viewStudentList
|
|
|
- :classId="activeRow.id"
|
|
|
- :disabledList='allStudentList'
|
|
|
+ :classId="activeRow.id"
|
|
|
+ :disabledList="allStudentList"
|
|
|
:list="studentList"
|
|
|
:chioseList="activeRow.studentList"
|
|
|
v-if="studentListModalVisible"
|
|
@@ -100,29 +105,43 @@
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
+ <el-dialog
|
|
|
:visible.sync="calenderStudentVisible"
|
|
|
title="学员缴费列表"
|
|
|
append-to-body
|
|
|
width="800px"
|
|
|
>
|
|
|
- <!-- studentIds:[],
|
|
|
+ <!-- studentIds:[],
|
|
|
masterClassGroupId:'',
|
|
|
classGroupStudents:[] -->
|
|
|
- <calenderStudentList v-if="calenderStudentVisible" :studentIds='studentIds' :masterClassGroupId='masterClassGroupId' :classGroupStudents='classGroupStudents'/>
|
|
|
+ <calenderStudentList
|
|
|
+ ref='calenderStudentList'
|
|
|
+ v-if="calenderStudentVisible"
|
|
|
+ :classList="dataList"
|
|
|
+ :studentIds="studentIds"
|
|
|
+ :masterClassGroupId="masterClassGroupId"
|
|
|
+ :classGroupStudents="classGroupStudents"
|
|
|
+ :mergeInfo="mergeInfo"
|
|
|
+ />
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="calenderStudentVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitInfo"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
// import compoundClass from './compoundClass' compoundClass
|
|
|
import viewStudentList from "./student-list";
|
|
|
-import calenderStudentList from "./calenderStudentList"
|
|
|
+import calenderStudentList from "./calenderStudentList";
|
|
|
import { getClassAllStudent } from "@/api/studentManager";
|
|
|
-import { getStudentPaymentCalenders } from '@/api/buildTeam'
|
|
|
+import { getStudentPaymentCalenders } from "@/api/buildTeam";
|
|
|
let that;
|
|
|
export default {
|
|
|
props: ["compoundList"],
|
|
|
- components: { viewStudentList,calenderStudentList },
|
|
|
+ components: { viewStudentList, calenderStudentList },
|
|
|
data() {
|
|
|
return {
|
|
|
radio: "",
|
|
@@ -133,15 +152,14 @@ export default {
|
|
|
studentList: [],
|
|
|
studentListModalVisible: false,
|
|
|
activeRow: null,
|
|
|
- calenderStudentVisible:false,
|
|
|
- studentIds:[],
|
|
|
- masterClassGroupId:'',
|
|
|
- classGroupStudents:[],
|
|
|
- mergeInfo:{}
|
|
|
-
|
|
|
+ calenderStudentVisible: false,
|
|
|
+ studentIds: [],
|
|
|
+ masterClassGroupId: "",
|
|
|
+ classGroupStudents: [],
|
|
|
+ mergeInfo: {},
|
|
|
};
|
|
|
},
|
|
|
- created(){
|
|
|
+ created() {
|
|
|
that = this;
|
|
|
},
|
|
|
methods: {
|
|
@@ -151,7 +169,7 @@ export default {
|
|
|
clearCom() {
|
|
|
this.$emit("clearCom");
|
|
|
},
|
|
|
- async submitClass() {
|
|
|
+ async submitClass() {
|
|
|
if (!this.radio) {
|
|
|
this.$message.error("请选择一个主班");
|
|
|
return;
|
|
@@ -162,15 +180,20 @@ export default {
|
|
|
// 班级和学生id的键值对
|
|
|
// 第三个是主班编号 this.radio
|
|
|
let idList = []; // 所有的班级id
|
|
|
- this.classGroupStudents= []
|
|
|
- let flag = false
|
|
|
+ this.classGroupStudents = [];
|
|
|
+ let flag = false;
|
|
|
this.dataList.forEach((com) => {
|
|
|
// arr.push(com.type)
|
|
|
- if(!com.studentList&&com.id!=this.radio || com.studentList?.length<=0&&com.id!=this.radio){
|
|
|
- flag = true
|
|
|
+ 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(',')})
|
|
|
+ if (com.id != this.radio) {
|
|
|
+ this.classGroupStudents.push({
|
|
|
+ [com.id]: com.studentList.map((stu) => stu.userId).join(","),
|
|
|
+ });
|
|
|
}
|
|
|
idList.push(com.id);
|
|
|
});
|
|
@@ -178,27 +201,30 @@ export default {
|
|
|
this.$message.error("请至少选择2个班级");
|
|
|
return;
|
|
|
}
|
|
|
- if(flag){
|
|
|
- this.$message.error("请保证每个班至少勾选一名学员");
|
|
|
- return
|
|
|
+ if (flag) {
|
|
|
+ this.$message.error("请保证每个班至少勾选一名学员");
|
|
|
+ return;
|
|
|
}
|
|
|
// 做判断
|
|
|
this.show = true;
|
|
|
this.isLook = false;
|
|
|
- this.masterClassGroupId = this.radio;
|
|
|
- this.studentIds = this.allStudentList.map(stu=>{
|
|
|
- return stu.userId
|
|
|
- })
|
|
|
+ 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
|
|
|
+ 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)
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 试着请求
|
|
|
},
|
|
|
getList() {},
|
|
@@ -230,13 +256,16 @@ export default {
|
|
|
this.dataList.splice(1, 0);
|
|
|
this.studentListModalVisible = false;
|
|
|
},
|
|
|
- changeMasterClass(val){
|
|
|
- this.dataList.forEach(classes=>{
|
|
|
- if(classes.id == val){
|
|
|
+ changeMasterClass(val) {
|
|
|
+ this.dataList.forEach((classes) => {
|
|
|
+ if (classes.id == val) {
|
|
|
classes.studentList = null;
|
|
|
- this.dataList.splice(1, 0);
|
|
|
+ this.dataList.splice(1, 0);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitInfo(){
|
|
|
+ this.$refs.calenderStudentList.submit()
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -244,20 +273,22 @@ export default {
|
|
|
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
|
|
|
- }
|
|
|
- }
|
|
|
+ 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>
|