|
@@ -214,29 +214,16 @@ export default {
|
|
|
this.changeActiveSound(activeSound.join(","));
|
|
|
} else {
|
|
|
if (this.teamStatus == "newTeam" && type && section) {
|
|
|
- getDefaultSubject({
|
|
|
- chargeTypeId: type,
|
|
|
- organId: 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;
|
|
|
- this.chioseActiveSound = activeSound;
|
|
|
- this.changeActiveSound(activeSound.join(","));
|
|
|
- }
|
|
|
- });
|
|
|
+ this.getDefaultSubject()
|
|
|
} else {
|
|
|
this.teamid = this.$route.query.id;
|
|
|
if (this.teamid) {
|
|
|
findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
|
|
|
(res) => {
|
|
|
if (res.code == 200) {
|
|
|
- let activeSound = [];
|
|
|
+ // 如果没有一个声部 则请求默认声部
|
|
|
+ if(res.data?.musicGroupSubjectPlans>0){
|
|
|
+ let activeSound = [];
|
|
|
this.activeSoundList = res.data?.musicGroupSubjectPlans.map(
|
|
|
(item) => {
|
|
|
activeSound.push(item.subjectId);
|
|
@@ -284,6 +271,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ }else{
|
|
|
+ this.getDefaultSubject()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 这里开始
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -297,6 +290,29 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ getDefaultSubject(){
|
|
|
+ this.topfor = JSON.parse(
|
|
|
+ sessionStorage.getItem(`${this.$route.query.id}base`)
|
|
|
+ );
|
|
|
+ let type = this.topfor.type;
|
|
|
+ let section = this.topfor.section;
|
|
|
+ getDefaultSubject({
|
|
|
+ chargeTypeId: type,
|
|
|
+ organId: 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;
|
|
|
+ this.chioseActiveSound = activeSound;
|
|
|
+ this.changeActiveSound(activeSound.join(","));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
lookCheck(val) {
|
|
|
this.checkList = [...new Set(val)];
|
|
|
},
|