|
@@ -13,23 +13,39 @@
|
|
|
<div class="coreWrap">
|
|
|
<el-checkbox-group v-model="checkList"
|
|
|
@change='lookCheck'>
|
|
|
- <el-collapse>
|
|
|
- <el-collapse-item>
|
|
|
+ <el-collapse v-model="activeSound"
|
|
|
+ accordion
|
|
|
+ @change="changeActiveSound">
|
|
|
+ <el-collapse-item v-for="(item,index) in activeSoundList"
|
|
|
+ :name="item.id"
|
|
|
+ :key="index">
|
|
|
<template slot="title">
|
|
|
<div class="coreItemTitle">
|
|
|
- <el-checkbox label="单簧管"
|
|
|
- value='1'></el-checkbox>
|
|
|
+ <el-checkbox :label="item.id">{{item.sound}}</el-checkbox>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="coreItem">
|
|
|
<div class="coreItemRow">
|
|
|
<p class="title">计划招生人数:</p>
|
|
|
- <el-input style="width:180px"></el-input>
|
|
|
+ <el-input style="width:180px"
|
|
|
+ v-model="item.expectedStudentNum"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <chioseMusic />
|
|
|
- <el-divider></el-divider>
|
|
|
- <chioseAccessory />
|
|
|
+ <chioseMusic :item="item"
|
|
|
+ @lookMusic="lookMusic" />
|
|
|
+ <div class="coreItemRow">
|
|
|
+ <p class="title">教辅:</p>
|
|
|
+ <el-select style="width:558px!important;"
|
|
|
+ v-model="item.markChioseList"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ multiple>
|
|
|
+ <el-option v-for="(item,index) in item.markList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
</el-collapse-item>
|
|
|
|
|
|
</el-collapse>
|
|
@@ -39,6 +55,7 @@
|
|
|
:visible.sync="soundVisible"
|
|
|
:modal-append-to-body="false">
|
|
|
<chioseSoundList :soundList="soundList"
|
|
|
+ :activeSound='activeSound'
|
|
|
@chioseSound="chioseSound" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -66,6 +83,7 @@ export default {
|
|
|
components: { chioseMusic, chioseAccessory, chioseSoundList },
|
|
|
data () {
|
|
|
return {
|
|
|
+ topfor: null, // 第一页的数据
|
|
|
chioseSoundNum: 0,
|
|
|
PlannedCount: 0,
|
|
|
checkList: [],
|
|
@@ -73,6 +91,10 @@ export default {
|
|
|
Frules: null,
|
|
|
soundList: [], // 接口返回的一级二级声部
|
|
|
soundVisible: false, // 设置声部弹窗
|
|
|
+ childSoundList: [],
|
|
|
+ teamStatus: '',// 乐团状态
|
|
|
+ activeSoundList: [], //列表上的声部
|
|
|
+ activeSound: null, // 展开的列表
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -81,6 +103,10 @@ export default {
|
|
|
activated () { },
|
|
|
methods: {
|
|
|
init () {
|
|
|
+ // 获取第一页的数据
|
|
|
+ this.topfor = this.$store.getters.topinfo;
|
|
|
+ let type = this.topfor.type;
|
|
|
+ this.teamStatus = this.$route.query.type;
|
|
|
if (this.$route.query.search) {
|
|
|
this.Fsearch = this.$route.query.search;
|
|
|
}
|
|
@@ -90,15 +116,108 @@ export default {
|
|
|
getSoundTree({ tenantId: 1 }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.soundList = res.data.rows
|
|
|
+ if (this.teamStatus == "newTeam") {
|
|
|
+ getDefaultSubject({
|
|
|
+ chargeTypeId: type,
|
|
|
+ organId: this.topfor.section,
|
|
|
+ number: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let activeSound = []
|
|
|
+ this.activeSoundList = res.data.map(item => {
|
|
|
+ activeSound.push(item.id)
|
|
|
+ return this.initSound(item);
|
|
|
+ });
|
|
|
+ this.activeSound = activeSound;
|
|
|
+
|
|
|
+ // = arr;
|
|
|
+ // this.soundList.forEach((item, i) => {
|
|
|
+ // item.subjects.forEach((some, j) => {
|
|
|
+ // res.data.forEach((sub, x) => {
|
|
|
+ // if (sub.id == some.id) {
|
|
|
+ // this.soundLists[i].push(some.id);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // 并且把所有soundLists 里面
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
+ getSubject({ tenantId: 1 }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.childSoundList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
lookCheck (val) {
|
|
|
console.log(val)
|
|
|
},
|
|
|
chioseSound (activeSound) {
|
|
|
- console.log(activeSound)
|
|
|
+ // 同步数据
|
|
|
+ this.activeSound = activeSound;
|
|
|
+ let newSoundList = []
|
|
|
+
|
|
|
+ for (let i in this.childSoundList) {
|
|
|
+ if (activeSound.includes(this.childSoundList[i].id)) {
|
|
|
+ console.log(this.childSoundList[i])
|
|
|
+ newSoundList.push(this.initSound(this.childSoundList[i]))
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ let idList = this.activeSoundList.map(item => {
|
|
|
+ console.log(item)
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ console.log(newSoundList, idList, this.activeSoundList)
|
|
|
+ for (let x in newSoundList) {
|
|
|
+ if (idList.includes(newSoundList[x].id)) {
|
|
|
+ console.log(x)
|
|
|
+ newSoundList[x] = this.activeSoundList[x]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.activeSoundList = newSoundList
|
|
|
this.soundVisible = false
|
|
|
+ },
|
|
|
+ initSound (item) {
|
|
|
+ let obj = {
|
|
|
+ id: item.id,
|
|
|
+ sound: item.name,
|
|
|
+ expectedStudentNum: item.expectedStudentNum,
|
|
|
+ chioseMusic: [{ musical: '', type: 'GROUP', groupPrice: 0, borrowPrice: 1500 }],
|
|
|
+ markChioseList: [],
|
|
|
+ goodsList: [],
|
|
|
+ markList: [],
|
|
|
+
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ },
|
|
|
+ changeActiveSound (val) {
|
|
|
+ this.activeSoundList.map(item => {
|
|
|
+ if (item.id == val) {
|
|
|
+ getSubjectGoods({ subjectId: item.id, chargeTypeId: this.topfor.type }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let goodList = []
|
|
|
+ let markList = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ if (item.type == 'INSTRUMENT') {
|
|
|
+ goodList.push(item)
|
|
|
+ } else if (item.type == 'ACCESSORIES') {
|
|
|
+ markList.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.goodsList = goodList;
|
|
|
+ item.markList = markList;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ lookMusic () {
|
|
|
+ console.log(this.activeSoundList)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -126,9 +245,10 @@ export default {
|
|
|
padding: 0 20px;
|
|
|
}
|
|
|
.coreItem {
|
|
|
- padding: 25px 20px 0;
|
|
|
+ padding: 25px 0 0;
|
|
|
}
|
|
|
.coreItemRow {
|
|
|
+ padding: 0 20px;
|
|
|
line-height: 50px;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|