|
@@ -1,24 +1,20 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="soundBtnWrap">
|
|
|
- <el-button type="primary" @click="allin" v-if="teamStatus != 'resetTeam'"
|
|
|
+ <el-button type="primary" @click="allin" v-if="teamStatus != 'resetTeam'&&!basdisabled"
|
|
|
>全选</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
@click="deleteRow"
|
|
|
- v-if="teamStatus != 'resetTeam'"
|
|
|
+ v-if="teamStatus != 'resetTeam'&&!basdisabled"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
- <el-button type="primary" @click="soundVisible = true">添加</el-button>
|
|
|
+ <el-button type="primary" @click="soundVisible = true" v-if="!basdisabled">添加</el-button>
|
|
|
</div>
|
|
|
<div class="coreWrap">
|
|
|
- <el-checkbox-group v-model="checkList" @change="lookCheck">
|
|
|
- <el-collapse
|
|
|
- v-model="chioseActiveSound"
|
|
|
- accordion
|
|
|
- @change="changeActiveSound"
|
|
|
- >
|
|
|
+ <el-checkbox-group v-model="checkList" @change="lookCheck" >
|
|
|
+ <el-collapse v-model="chioseActiveSound">
|
|
|
<el-collapse-item
|
|
|
v-for="(item, index) in activeSoundList"
|
|
|
:name="item.id"
|
|
@@ -26,24 +22,26 @@
|
|
|
>
|
|
|
<template slot="title">
|
|
|
<div class="coreItemTitle">
|
|
|
- <el-checkbox :label="item.id">{{ item.sound }}</el-checkbox>
|
|
|
+ <el-checkbox :label="item.id" :disabled='basdisabled'>{{ item.sound }}</el-checkbox>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="coreItem">
|
|
|
<div class="coreItemRow">
|
|
|
<p class="title">计划招生人数:</p>
|
|
|
<el-input
|
|
|
+ :disabled='basdisabled'
|
|
|
style="width: 180px"
|
|
|
v-model="item.expectedStudentNum"
|
|
|
></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <chioseMusic :item="item" @lookMusic="lookMusic" />
|
|
|
+ <chioseMusic :item="item" @lookMusic="lookMusic" :basdisabled="basdisabled"/>
|
|
|
<div class="coreItemRow">
|
|
|
<p class="title">教辅:</p>
|
|
|
<el-select
|
|
|
style="width: 558px !important"
|
|
|
v-model="item.markChioseList"
|
|
|
+ :disabled='basdisabled'
|
|
|
clearable
|
|
|
filterable
|
|
|
multiple
|
|
@@ -97,20 +95,19 @@ export default {
|
|
|
childSoundList: [],
|
|
|
activeSoundList: [], //列表上的声部
|
|
|
activeSound: null, // 展开的列表
|
|
|
- chioseActiveSound: null,
|
|
|
+ chioseActiveSound: [],
|
|
|
soundList: [], // 接口返回的一级二级声部
|
|
|
childSoundList: [],
|
|
|
teamStatus: "", // 乐团状态
|
|
|
checkList: [],
|
|
|
+ basdisabled:false
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.init();
|
|
|
- console.log("mounted");
|
|
|
},
|
|
|
activated() {
|
|
|
this.init();
|
|
|
- console.log("activated");
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
@@ -124,6 +121,11 @@ export default {
|
|
|
if (this.$route.query.rules) {
|
|
|
this.Frules = this.$route.query.rules;
|
|
|
}
|
|
|
+ if (this.teamStatus == "look" || this.teamStatus == "teamAudit") {
|
|
|
+ this.basdisabled = true;
|
|
|
+ } else {
|
|
|
+ this.basdisabled = false;
|
|
|
+ }
|
|
|
getSoundTree({ tenantId: 1 }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.soundList = res.data.rows;
|
|
@@ -140,8 +142,8 @@ export default {
|
|
|
return this.initSound(item);
|
|
|
});
|
|
|
this.activeSound = activeSound;
|
|
|
- this.chioseActiveSound = activeSound[0];
|
|
|
- this.changeActiveSound(activeSound[0]);
|
|
|
+ this.chioseActiveSound = activeSound;
|
|
|
+ this.changeActiveSound(activeSound.join(","));
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -165,8 +167,8 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
this.activeSound = activeSound;
|
|
|
- this.chioseActiveSound = activeSound[0];
|
|
|
- this.changeActiveSound(activeSound[0]);
|
|
|
+ this.chioseActiveSound = activeSound;
|
|
|
+ this.changeActiveSound(activeSound.join(","));
|
|
|
// 格式化商品和教辅
|
|
|
|
|
|
res.data.musicGroupSubjectGoodsGroups.forEach((shop) => {
|
|
@@ -195,7 +197,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- console.log(this.activeSoundList);
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -231,6 +232,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.activeSoundList = newSoundList;
|
|
|
+ let newActiveSound = [];
|
|
|
+ this.activeSoundList.forEach((item) => {
|
|
|
+ newActiveSound.push(item.id);
|
|
|
+ });
|
|
|
+ this.activeSound = newActiveSound;
|
|
|
+ this.chioseActiveSound = newActiveSound;
|
|
|
+ console.log(newActiveSound.join(","));
|
|
|
+ this.changeActiveSound(newActiveSound.join(","));
|
|
|
this.soundVisible = false;
|
|
|
},
|
|
|
initSound(item) {
|
|
@@ -248,47 +257,76 @@ export default {
|
|
|
return obj;
|
|
|
},
|
|
|
changeActiveSound(val) {
|
|
|
- this.activeSoundList.forEach((item) => {
|
|
|
- if (item.id == val) {
|
|
|
- if (item.goodsList.length < 1 || item.markList.length < 1) {
|
|
|
- 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;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // 写入声部商品和辅件
|
|
|
+ getSubjectGoods({
|
|
|
+ subjectIds: val,
|
|
|
+ chargeTypeId: this.topfor.type,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let keys = Object.keys(res.data);
|
|
|
+ this.activeSoundList.forEach((item) => {
|
|
|
+ if (keys.indexOf(item.id + "") != -1) {
|
|
|
+ let goodList = [];
|
|
|
+ let markList = [];
|
|
|
+ res.data[item.id].forEach((shop) => {
|
|
|
+ if (shop.type == "INSTRUMENT") {
|
|
|
+ goodList.push(shop);
|
|
|
+ } else if (shop.type == "ACCESSORIES") {
|
|
|
+ markList.push(shop);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.goodsList = goodList;
|
|
|
+ item.markList = markList;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // return
|
|
|
+ // if (item.id == val) {
|
|
|
+ // if (item.goodsList.length < 1 || item.markList.length < 1) {
|
|
|
+ // getSubjectGoods({
|
|
|
+ // subjectIds: 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() {},
|
|
|
|
|
|
- submitInfo() {
|
|
|
+ submitInfo(type) {
|
|
|
// 计划招生人数
|
|
|
// 可选乐器
|
|
|
// 教辅
|
|
|
+ let flag = true;
|
|
|
this.activeSoundList.forEach((item) => {
|
|
|
if (!item.expectedStudentNum) {
|
|
|
this.$message.error(`请填写${item.sound}的预计招生人数`);
|
|
|
+ flag = false;
|
|
|
return;
|
|
|
}
|
|
|
if (!item.chioseMusic[0]?.musical) {
|
|
|
this.$message.error(`请至少一个选择${item.sound}的可选乐器`);
|
|
|
+ flag = false;
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
+ if (!flag) return;
|
|
|
// 新建团
|
|
|
let obj = {};
|
|
|
if (this.teamStatus == "newTeam") {
|
|
@@ -361,12 +399,26 @@ export default {
|
|
|
createTeam(obj).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
// 成功 跳转到乐团报名详情
|
|
|
+ let query = this.$route.query;
|
|
|
+ query.type = "teamDraft";
|
|
|
+ this.$router.push({
|
|
|
+ query: {
|
|
|
+ ...query,
|
|
|
+ id: res.data,
|
|
|
+ },
|
|
|
+ });
|
|
|
this.$emit("chiosetab", 2);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
obj.musicGroupId = this.teamid;
|
|
|
- obj.musicGroupStatus = "DRAFT";
|
|
|
+
|
|
|
+ if (type) {
|
|
|
+ obj.musicGroupStatus = "AUDIT";
|
|
|
+ } else {
|
|
|
+ obj.musicGroupStatus = "DRAFT";
|
|
|
+ }
|
|
|
+
|
|
|
updateSubjectInfo(obj).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("提交成功");
|
|
@@ -424,7 +476,7 @@ export default {
|
|
|
schoolId: this.topfor.address,
|
|
|
expectStartGroupDate: this.topfor.startTime,
|
|
|
isClassroomLessons: this.topfor.isClass,
|
|
|
- status: 'DRAFT',
|
|
|
+ status: "DRAFT",
|
|
|
ownershipType: this.topfor.ownershipType,
|
|
|
repairUserId: this.topfor.repairUserId,
|
|
|
feeType: this.topfor.feeType,
|
|
@@ -437,22 +489,22 @@ export default {
|
|
|
immediate: true,
|
|
|
deep: true,
|
|
|
handler(n) {
|
|
|
- let chioseSoundNum = 0;
|
|
|
- let PlannedCount =0;
|
|
|
+ let chioseSoundNum = 0;
|
|
|
+ let PlannedCount = 0;
|
|
|
let activeSoundList = this.activeSoundList;
|
|
|
- if (n) {
|
|
|
- let Count = 0;
|
|
|
- if (n.length > 0) {
|
|
|
- for (let item in n) {
|
|
|
- Count += parseInt(n[item]?.expectedStudentNum) || 0;
|
|
|
+ if (n) {
|
|
|
+ let Count = 0;
|
|
|
+ if (n.length > 0) {
|
|
|
+ for (let item in n) {
|
|
|
+ Count += parseInt(n[item]?.expectedStudentNum) || 0;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- chioseSoundNum = Count
|
|
|
- PlannedCount = n.length
|
|
|
- this.$emit('getNumber',chioseSoundNum,PlannedCount)
|
|
|
- }
|
|
|
- }
|
|
|
+ chioseSoundNum = Count;
|
|
|
+ PlannedCount = n.length;
|
|
|
+ this.$emit("getNumber", chioseSoundNum, PlannedCount);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
};
|