|
@@ -10,7 +10,7 @@
|
|
|
/>
|
|
|
<otherform :form="other" ref="other" />
|
|
|
<el-table
|
|
|
- :data="mergeInfoList"
|
|
|
+ :data="dataList"
|
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
max-height="300px"
|
|
|
>
|
|
@@ -28,22 +28,38 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column prop="phone" align="center" width="120" label="课程类型">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{ scope.row.courseType | coursesType }}
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in scope.row.courseList"
|
|
|
+ :key="index"
|
|
|
+ class="courseDiv"
|
|
|
+ >
|
|
|
+ {{ item.courseType | coursesType }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="subjectNames" align="center" label="原价">
|
|
|
+ <el-table-column align="center" label="现价">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <el-input v-model="scope.row.courseOriginalPrice"></el-input>
|
|
|
+ <div >
|
|
|
+ <div
|
|
|
+ class="courseDiv"
|
|
|
+ v-for="(item, index) in scope.row.courseList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <el-input v-model="item.courseCurrentPrice"></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="现价">
|
|
|
+ <el-table-column prop="subjectNames" align="center" label="原价">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <el-input v-model="scope.row.courseCurrentPrice"></el-input>
|
|
|
+ <div
|
|
|
+ class="courseDiv"
|
|
|
+ v-for="(item, index) in scope.row.courseList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <el-input v-model="item.courseOriginalPrice"></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -76,6 +92,7 @@ export default {
|
|
|
paymentPattern: null,
|
|
|
},
|
|
|
other: {},
|
|
|
+ dataList: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -87,6 +104,7 @@ export default {
|
|
|
for (let merge in this.mergeInfo) {
|
|
|
this.mergeInfoList = this.mergeInfoList.concat(this.mergeInfo[merge]);
|
|
|
}
|
|
|
+ this.concatCourseLst(this.mergeInfoList);
|
|
|
},
|
|
|
methods: {
|
|
|
getCLassName(key) {
|
|
@@ -100,13 +118,12 @@ export default {
|
|
|
},
|
|
|
async submit() {
|
|
|
let obj = {};
|
|
|
- let some = this.getData()
|
|
|
- console.log(some)
|
|
|
- if(some){
|
|
|
+ let some = this.getData();
|
|
|
+ console.log(some);
|
|
|
+ if (some) {
|
|
|
obj.musicGroupPaymentCalenderDtos = [some];
|
|
|
-
|
|
|
- }else{
|
|
|
- return
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
obj.classGroupIds = this.classList.map((classes) => {
|
|
@@ -114,15 +131,14 @@ export default {
|
|
|
});
|
|
|
obj.masterClassGroupId = this.masterClassGroupId;
|
|
|
obj.classGroupStudents = this.classGroupStudents;
|
|
|
- obj.studentIds = this.studentIds
|
|
|
- // console.log(obj);
|
|
|
+ obj.studentIds = this.studentIds;
|
|
|
try {
|
|
|
const reset = await spanGroupMergeClassSplitClassAffirm(obj);
|
|
|
this.$message.success("合并成功");
|
|
|
// 1.关闭弹窗
|
|
|
// 2.清空合并班
|
|
|
// 3.刷新列表
|
|
|
- this.$emit('refresh')
|
|
|
+ this.$emit("refresh");
|
|
|
console.log(reset);
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
@@ -187,10 +203,33 @@ export default {
|
|
|
return null;
|
|
|
}
|
|
|
},
|
|
|
+ concatCourseLst(arr) {
|
|
|
+ let data = {};
|
|
|
+ arr.forEach((some) => {
|
|
|
+ if (data[some.userId]) {
|
|
|
+ // data[some.userId].push(some)
|
|
|
+ data[some.userId].courseList.push(some);
|
|
|
+ } else {
|
|
|
+ data[some.userId] = {};
|
|
|
+ data[some.userId].userId = some.userId;
|
|
|
+ data[some.userId].username = some.username;
|
|
|
+ data[some.userId].courseList = [];
|
|
|
+ data[some.userId].courseList.push(some);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.dataList = Object.values(data);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.courseDiv {
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
/deep/ .header {
|
|
|
display: flex;
|
|
|
align-items: center;
|