|
@@ -141,27 +141,6 @@
|
|
|
prop="jiaopu">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <!-- <el-popover placement="bottom"
|
|
|
- v-model="scope.row.markVisible"
|
|
|
- @show="chioseMark"
|
|
|
- v-if='scope.row.type == 1'>
|
|
|
- <div slot='reference'
|
|
|
- class='chiose'>
|
|
|
- 操作
|
|
|
- </div>
|
|
|
- <el-input v-model="scope.row.fangshi"></el-input>
|
|
|
- 1111
|
|
|
- <div style="text-align: right; margin: 0">
|
|
|
- <el-button size="mini"
|
|
|
- type="text"
|
|
|
- @click="scope.row.provideVisible = false">取消</el-button>
|
|
|
- <el-button type="primary"
|
|
|
- size="mini"
|
|
|
- @click="scope.row.provideVisible = false">确定</el-button>
|
|
|
- </div>
|
|
|
- </el-popover> -->
|
|
|
- <!-- scope.row.markVisible = true -->
|
|
|
-
|
|
|
<el-dialog :visible.sync="scope.row.markVisible"
|
|
|
style="text-align:left;"
|
|
|
width="60%">
|
|
@@ -278,13 +257,15 @@
|
|
|
<div class="PrevBtn"
|
|
|
@click="goback">上一步</div>
|
|
|
<div class="submitBtn"
|
|
|
- @click="submitInfo">提交</div>
|
|
|
+ @click="submitInfo(1)">保存</div>
|
|
|
+ <div class="submitBtn"
|
|
|
+ @click="submitInfo(2)">提交</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import store from '@/store'
|
|
|
-import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree } from '@/api/buildTeam'
|
|
|
+import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree, findMusicGroupSubjectInfo, updateSubjectInfo } from '@/api/buildTeam'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -297,7 +278,9 @@ export default {
|
|
|
isLoop: '', // 是否显示周期循环
|
|
|
payfor: {},
|
|
|
topfor: {},
|
|
|
- checkfor: {}
|
|
|
+ checkfor: {},
|
|
|
+ teamStatus: '',
|
|
|
+ teamid: ''
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -375,6 +358,7 @@ export default {
|
|
|
},
|
|
|
// 根据声部id查询可选教辅
|
|
|
chioseMark (row) {
|
|
|
+ console.log(row);
|
|
|
row.markVisible = true
|
|
|
let id = row.id;
|
|
|
getGoods({ 'subjectId': id, 'type': 'ACCESSORIES' }).then(res => {
|
|
@@ -402,129 +386,155 @@ export default {
|
|
|
goback () {
|
|
|
this.$emit('chiosetab', 0);
|
|
|
},
|
|
|
- submitInfo () {
|
|
|
- // 整理数据提交
|
|
|
- let obj = {};
|
|
|
- this.payfor.student.chiose == 'loop' ? obj.months = this.payfor.chioseMonth : obj.months = [];
|
|
|
- obj.musicGroup = {
|
|
|
- settlementType: this.topfor.salary,
|
|
|
- applyExpireDate: this.topfor.time + ' 00:00:01',
|
|
|
- chargeTypeId: this.topfor.type,
|
|
|
- cooperationOrganId: this.topfor.school,
|
|
|
- teamTeacherId: this.topfor.boss,
|
|
|
- educationalTeacherId: this.topfor.teacher,
|
|
|
- enrollClasses: this.topfor.startClass.join(','),
|
|
|
- name: this.topfor.name,
|
|
|
- organId: this.topfor.section,
|
|
|
- // paymentMonths:obj.months 有待确认
|
|
|
- schoolId: this.topfor.address,
|
|
|
- courseForm: JSON.stringify(this.checkfor)
|
|
|
- }
|
|
|
- obj.musicGroupPaymentEntities = []
|
|
|
- // 添加学校主体付费方式
|
|
|
- if (this.payfor.school.ischeck) {
|
|
|
- obj.musicGroupPaymentEntities.push({
|
|
|
- 'amount': this.payfor.school.price,
|
|
|
- 'memo': this.payfor.school.value,
|
|
|
- 'paymentMethod': this.payfor.school.chiose,
|
|
|
- 'name': '学校'
|
|
|
- })
|
|
|
- }
|
|
|
- // 添加公司主体付费方式
|
|
|
- if (this.payfor.company.ischeck) {
|
|
|
- obj.musicGroupPaymentEntities.push({
|
|
|
- 'amount': this.payfor.company.price,
|
|
|
- 'memo': this.payfor.company.value,
|
|
|
- 'paymentMethod': this.payfor.company.chiose,
|
|
|
- 'name': '公司'
|
|
|
- })
|
|
|
+ submitInfo (type) {
|
|
|
+ let status;
|
|
|
+ if (type == 1) {
|
|
|
+ // 保存
|
|
|
+ status = 'DRAFT'
|
|
|
+ } else if (type == 2) {
|
|
|
+ // 提交
|
|
|
+ status = 'AUDIT'
|
|
|
}
|
|
|
- let activeSoundList = this.activeSoundList
|
|
|
- // 添加商品以及教辅
|
|
|
- obj.musicGroupSubjectGoodsGroups = []
|
|
|
- obj.musicGroupSubjectPlans = []
|
|
|
- activeSoundList.forEach(active => {
|
|
|
- // 乐器
|
|
|
- active.zhonglei.forEach(zl => {
|
|
|
- let some = {
|
|
|
+ // 整理数据提交
|
|
|
+ if (this.teamStatus == 'newTeam') {
|
|
|
+ let obj = {};
|
|
|
+
|
|
|
+ obj.months = this.payfor.chioseMonth || [];
|
|
|
+ let enrollClasses;
|
|
|
+ this.topfor.startClass ? enrollClasses = this.topfor.startClass.join(',') : enrollClasses = null;
|
|
|
+ obj.musicGroup = {
|
|
|
+ settlementType: this.topfor.salary,
|
|
|
+ applyExpireDate: this.topfor.time + ' 00:00:01',
|
|
|
+ chargeTypeId: this.topfor.type,
|
|
|
+ cooperationOrganId: this.topfor.school,
|
|
|
+ teamTeacherId: this.topfor.boss,
|
|
|
+ educationalTeacherId: this.topfor.teacher,
|
|
|
+ enrollClasses,
|
|
|
+ name: this.topfor.name,
|
|
|
+ organId: this.topfor.section,
|
|
|
+ // paymentMonths:obj.months 有待确认
|
|
|
+ schoolId: this.topfor.address,
|
|
|
+ courseForm: JSON.stringify(this.checkfor),
|
|
|
+ isClassroomLessons: this.topfor.isClass,
|
|
|
+ status
|
|
|
+ }
|
|
|
+ obj.musicGroupPaymentEntities = []
|
|
|
+ // 添加学校主体付费方式
|
|
|
+ if (this.payfor.school.ischeck) {
|
|
|
+ obj.musicGroupPaymentEntities.push({
|
|
|
+ 'amount': this.payfor.school.price,
|
|
|
+ 'memo': this.payfor.school.value,
|
|
|
+ 'paymentMethod': this.payfor.school.chiose,
|
|
|
+ 'name': '学校'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 添加公司主体付费方式
|
|
|
+ if (this.payfor.company.ischeck) {
|
|
|
+ obj.musicGroupPaymentEntities.push({
|
|
|
+ 'amount': this.payfor.company.price,
|
|
|
+ 'memo': this.payfor.company.value,
|
|
|
+ 'paymentMethod': this.payfor.company.chiose,
|
|
|
+ 'name': '公司'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let activeSoundList = this.activeSoundList
|
|
|
+ // 添加商品以及教辅
|
|
|
+ obj.musicGroupSubjectGoodsGroups = []
|
|
|
+ obj.musicGroupSubjectPlans = []
|
|
|
+ activeSoundList.forEach(active => {
|
|
|
+ // 乐器
|
|
|
+ active.zhonglei.forEach(zl => {
|
|
|
+ let some = {
|
|
|
+ subjectId: active.id,
|
|
|
+ type: 'INSTRUMENT',
|
|
|
+ goodsIdList: zl
|
|
|
+ }
|
|
|
+ obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ })
|
|
|
+
|
|
|
+ // 附件
|
|
|
+ active.markList.forEach(mark => {
|
|
|
+ let some = {
|
|
|
+ subjectId: active.id,
|
|
|
+ type: 'ACCESSORIES',
|
|
|
+ goodsIdList: mark.goods,
|
|
|
+ name: mark.name,
|
|
|
+ price: mark.price
|
|
|
+ }
|
|
|
+ obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ })
|
|
|
+
|
|
|
+ // 添加声部
|
|
|
+ let item = {
|
|
|
+ expectedStudentNum: active.jihua,
|
|
|
+ fee: active.yuji,
|
|
|
+ kitGroupPurchaseType: active.fangshi,
|
|
|
+ subName: active.sound,
|
|
|
subjectId: active.id,
|
|
|
- type: 'INSTRUMENT',
|
|
|
- goodsIdList: zl
|
|
|
+ depositFee: active.fangshiprice // depositFee 只有租赁才有
|
|
|
}
|
|
|
- obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ obj.musicGroupSubjectPlans.push(item);
|
|
|
})
|
|
|
+ createTeam(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 成功 跳转到乐团报名详情
|
|
|
+ this.$router.push({ path: '/business/teamDetail' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 只提交第二页的数据
|
|
|
+ let obj = {};
|
|
|
+ let activeSoundList = this.activeSoundList
|
|
|
+ // 添加商品以及教辅
|
|
|
+ obj.musicGroupId = this.teamid
|
|
|
+ obj.musicGroupSubjectGoodsGroups = []
|
|
|
+ obj.musicGroupSubjectPlans = []
|
|
|
+ activeSoundList.forEach(active => {
|
|
|
+ // 乐器
|
|
|
+ active.zhonglei.forEach(zl => {
|
|
|
+ let some = {
|
|
|
+ subjectId: active.id,
|
|
|
+ type: 'INSTRUMENT',
|
|
|
+ goodsIdList: zl
|
|
|
+ }
|
|
|
+ obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ })
|
|
|
|
|
|
- // 遍历声部里的乐器
|
|
|
- active.markList.forEach(mark => {
|
|
|
- let some = {
|
|
|
+ // 遍历声部里的教辅
|
|
|
+ active.markList.forEach(mark => {
|
|
|
+ let some = {
|
|
|
+ subjectId: active.id,
|
|
|
+ type: 'ACCESSORIES',
|
|
|
+ goodsIdList: mark.goods ? mark.goods.join(',') : '',
|
|
|
+ name: mark.name,
|
|
|
+ price: mark.price
|
|
|
+ }
|
|
|
+ obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ })
|
|
|
+ // 添加声部
|
|
|
+ let item = {
|
|
|
+ expectedStudentNum: active.jihua,
|
|
|
+ fee: active.yuji,
|
|
|
+ kitGroupPurchaseType: active.fangshi,
|
|
|
+ subName: active.sound,
|
|
|
subjectId: active.id,
|
|
|
- type: 'ACCESSORIES',
|
|
|
- goodsIdList: mark,
|
|
|
- name: mark.name,
|
|
|
- price: mark.price
|
|
|
+ depositFee: active.fangshiprice // depositFee 只有租赁才有
|
|
|
}
|
|
|
- obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
+ obj.musicGroupSubjectPlans.push(item);
|
|
|
})
|
|
|
+ // 发请求修改声部信息
|
|
|
+ updateSubjectInfo(obj).then(res => {
|
|
|
|
|
|
- // 添加声部
|
|
|
-
|
|
|
-
|
|
|
- let item = {
|
|
|
- expectedStudentNum: active.jihua,
|
|
|
- fee: active.yuji,
|
|
|
- kitGroupPurchaseType: active.fangshi,
|
|
|
- subName: active.sound,
|
|
|
- subjectId: active.id,
|
|
|
- depositFee: active.fangshiprice // depositFee 只有租赁才有
|
|
|
- }
|
|
|
- obj.musicGroupSubjectPlans.push(item);
|
|
|
- })
|
|
|
- // for (let i in this.activeSoundList) {
|
|
|
- // // 遍历声部里的乐器
|
|
|
- // let some = {};
|
|
|
- // some.subjectId = this.activeSoundList[i].id;
|
|
|
- // some.type = 'INSTRUMENT';
|
|
|
- // some.goodsIdList = this.activeSoundList[i].zhonglei.join(',');
|
|
|
- // obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
- // }
|
|
|
- // // 遍历声部里的教辅
|
|
|
- // for (let i in this.activeSoundList) {
|
|
|
- // // 遍历声部里的乐器
|
|
|
- // for (let j in this.activeSoundList[i].markList) {
|
|
|
- // let some = {};
|
|
|
- // some.subjectId = this.activeSoundList[i].id;
|
|
|
- // some.type = 'ACCESSORIES';
|
|
|
- // some.goodsIdList = this.activeSoundList[i].markList[j].goods.join(',');
|
|
|
- // some.name = this.activeSoundList[i].markList[j].name;
|
|
|
- // some.price = this.activeSoundList[i].markList[j].price;
|
|
|
- // obj.musicGroupSubjectGoodsGroups.push(some);
|
|
|
- // }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- // }
|
|
|
- // // 添加声部
|
|
|
- // obj.musicGroupSubjectPlans = [];
|
|
|
- // for (let i in this.activeSoundList) {
|
|
|
- // let item = {};
|
|
|
- // // expectedStudentNum
|
|
|
- // item.expectedStudentNum = this.activeSoundList[i].jihua;
|
|
|
- // item.fee = this.activeSoundList[i].yuji;
|
|
|
- // item.kitGroupPurchaseType = this.activeSoundList[i].fangshi;
|
|
|
- // item.subName = this.activeSoundList[i].sound;
|
|
|
- // item.subjectId = this.activeSoundList[i].id;
|
|
|
- // // depositFee 只有租赁才有
|
|
|
- // item.depositFee = this.activeSoundList[i].fangshiprice;
|
|
|
- // obj.musicGroupSubjectPlans.push(item);
|
|
|
- // }
|
|
|
- createTeam(obj).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- // 成功 跳转到乐团报名详情
|
|
|
- this.$router.push({ path: '/business/teamDetail' })
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
zhongleiFilter (val, list) {
|
|
|
+ if (list.length <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let arr = []
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
for (let j = 0; j < val.length; j++) {
|
|
@@ -533,7 +543,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return arr.join(',')
|
|
|
+ if (arr.length > 0) {
|
|
|
+ return arr.join(',')
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
fangshiFilter (val, price) {
|
|
|
let str = ''
|
|
@@ -549,6 +564,9 @@ export default {
|
|
|
return str + '费用:' + price
|
|
|
},
|
|
|
goodsFilter (val, list) {
|
|
|
+ if (list.length <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < val.length; i++) {
|
|
|
for (let j = 0; j < list.length; j++) {
|
|
@@ -557,7 +575,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return arr.join(',');
|
|
|
+ if (arr.length > 0) {
|
|
|
+ return arr.join(',')
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
}
|
|
|
// markFilter(val){
|
|
|
// for
|
|
@@ -575,16 +597,59 @@ export default {
|
|
|
for (let key in this.soundList) {
|
|
|
this.$set(this.soundLists, key, [])
|
|
|
}
|
|
|
- getDefaultSubject({ chargeTypeId: type }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.activeSoundList = res.data.map(item => {
|
|
|
- this.soundLists[0].push(item.id)
|
|
|
- let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': 0, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 0, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
|
|
|
- return obj;
|
|
|
- })
|
|
|
- // 并且把所有soundLists 里面
|
|
|
- }
|
|
|
- });
|
|
|
+ // 新建团带默认的数据
|
|
|
+ if (this.teamStatus == 'newTeam') {
|
|
|
+ getDefaultSubject({ chargeTypeId: type }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.activeSoundList = res.data.map(item => {
|
|
|
+ this.soundLists[0].push(item.id)
|
|
|
+ let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': 0, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 0, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
|
|
|
+ return obj;
|
|
|
+ })
|
|
|
+ // 并且把所有soundLists 里面
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 修改带原有团的数据
|
|
|
+ if (this.teamStatus == 'teamDraft') {
|
|
|
+ // 获取第二页的数据
|
|
|
+ this.teamid = this.$route.query.id;
|
|
|
+ findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.activeSoundList = res.data.musicGroupSubjectPlans.map(item => {
|
|
|
+ this.soundLists[0].push(item.subjectId)
|
|
|
+ let obj = { 'id': item.subjectId, 'sound': item.subName, 'jihua': item.expectedStudentNum, 'yuji': item.fee, 'zhonglei': [], 'fangshi': item.kitGroupPurchaseType, 'fangshiprice': item.depositFee, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
|
|
|
+ return obj;
|
|
|
+ })
|
|
|
+ // 循环列表里的声部 拿取商品
|
|
|
+ for (let i in this.activeSoundList) {
|
|
|
+ for (let j in res.data.musicGroupSubjectGoodsGroups) {
|
|
|
+ if (this.activeSoundList[i].id == res.data.musicGroupSubjectGoodsGroups[j].subjectId) {
|
|
|
+ if (res.data.musicGroupSubjectGoodsGroups[j].type == 'INSTRUMENT') {
|
|
|
+ let arr = [...res.data.musicGroupSubjectGoodsGroups[j].goodsIdList];
|
|
|
+ this.activeSoundList[i].zhonglei = arr.map(item => {
|
|
|
+ return parseInt(item)
|
|
|
+ })
|
|
|
+ // goodsList
|
|
|
+
|
|
|
+ }
|
|
|
+ if (res.data.musicGroupSubjectGoodsGroups[j].type == 'ACCESSORIES') {
|
|
|
+ if (res.data.musicGroupSubjectGoodsGroups[j].goodsList.length >= 0) {
|
|
|
+ this.activeSoundList[i].markList = res.data.musicGroupSubjectGoodsGroups[j].goodsList;
|
|
|
+ console.log(this.activeSoundList[i].markList);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.activeSoundList[i].markList = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
})
|
|
@@ -593,6 +658,9 @@ export default {
|
|
|
this.topfor = this.$store.getters.topinfo;
|
|
|
this.checkfor = this.$store.getters.checkinfo;
|
|
|
let type = this.topfor.type;
|
|
|
+ // 判断进来的乐团状态
|
|
|
+ this.teamStatus = this.$route.query.type;
|
|
|
+ console.log(this.teamStatus)
|
|
|
|
|
|
// console.log(this.topfor);
|
|
|
// console.log(this.checkfor);
|