|
@@ -135,7 +135,13 @@ export default {
|
|
|
this.teamid = this.$route.query.id;
|
|
|
}
|
|
|
window.addEventListener("scroll", this.getScroll);
|
|
|
- this.init();
|
|
|
+ this.topfor = JSON.parse(
|
|
|
+ localStorage.getItem(`${this.$route.query.id}base`)
|
|
|
+ );
|
|
|
+ this.$nextTick(res=>{
|
|
|
+ this.init();
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
deactivated() {
|
|
|
window.removeEventListener("scroll", this.getScroll);
|
|
@@ -173,16 +179,17 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
setStore() {
|
|
|
- sessionStorage.setItem(
|
|
|
+ localStorage.setItem(
|
|
|
`${this.teamid}sound`,
|
|
|
JSON.stringify(this.activeSoundList)
|
|
|
);
|
|
|
},
|
|
|
init() {
|
|
|
// 获取第一页的数据
|
|
|
- this.topfor = this.$store.getters.topinfo;
|
|
|
- let type = this.topfor.type;
|
|
|
- let section = this.topfor.section;
|
|
|
+ // this.topfor = this.$store.getters.topinfo;
|
|
|
+ // let type = this.topfor.type;
|
|
|
+ // let section = this.topfor.section;
|
|
|
+
|
|
|
this.teamStatus = this.$route.query.type;
|
|
|
if (
|
|
|
this.teamStatus == "look" ||
|
|
@@ -195,14 +202,14 @@ export default {
|
|
|
this.basdisabled = false;
|
|
|
}
|
|
|
let sotrage = JSON.parse(
|
|
|
- sessionStorage.getItem(`${this.$route.query.id}sound`)
|
|
|
+ localStorage.getItem(`${this.$route.query.id}sound`)
|
|
|
);
|
|
|
|
|
|
getSoundTree({ tenantId: 1 }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.soundList = res.data.rows;
|
|
|
- }
|
|
|
if (sotrage && sotrage[0]?.id) {
|
|
|
+ // this.$set(data,'activeSoundList',sotrage)
|
|
|
this.activeSoundList = sotrage;
|
|
|
let activeSound = [];
|
|
|
|
|
@@ -212,8 +219,11 @@ export default {
|
|
|
this.chioseActiveSound = activeSound;
|
|
|
this.activeSound = activeSound;
|
|
|
this.changeActiveSound(activeSound.join(","));
|
|
|
+ console.log(this.activeSoundList)
|
|
|
+ console.log('sotrage')
|
|
|
} else {
|
|
|
- if (this.teamStatus == "newTeam" && type && section) {
|
|
|
+ if (this.teamStatus == "newTeam") {
|
|
|
+ console.log('新舰团')
|
|
|
this.getDefaultSubject()
|
|
|
} else {
|
|
|
this.teamid = this.$route.query.id;
|
|
@@ -222,7 +232,8 @@ export default {
|
|
|
(res) => {
|
|
|
if (res.code == 200) {
|
|
|
// 如果没有一个声部 则请求默认声部
|
|
|
- if(res.data?.musicGroupSubjectPlans>0){
|
|
|
+
|
|
|
+ if(res.data?.musicGroupSubjectPlans?.length>0){
|
|
|
let activeSound = [];
|
|
|
this.activeSoundList = res.data?.musicGroupSubjectPlans.map(
|
|
|
(item) => {
|
|
@@ -272,6 +283,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
|
+ console.log('没有声部')
|
|
|
this.getDefaultSubject()
|
|
|
}
|
|
|
|
|
@@ -283,6 +295,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
});
|
|
|
getSubject({ tenantId: 1 }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -292,9 +305,9 @@ export default {
|
|
|
},
|
|
|
getDefaultSubject(){
|
|
|
this.topfor = JSON.parse(
|
|
|
- sessionStorage.getItem(`${this.$route.query.id}base`)
|
|
|
+ localStorage.getItem(`${this.$route.query.id}base`)
|
|
|
);
|
|
|
- let type = this.topfor.type;
|
|
|
+ let type = this.topfor.type;
|
|
|
let section = this.topfor.section;
|
|
|
getDefaultSubject({
|
|
|
chargeTypeId: type,
|
|
@@ -366,6 +379,7 @@ export default {
|
|
|
return obj;
|
|
|
},
|
|
|
changeActiveSound(val) {
|
|
|
+ console.log(this.topfor)
|
|
|
// 写入声部商品和辅件
|
|
|
getSubjectGoods({
|
|
|
subjectIds: val,
|