|
@@ -220,7 +220,7 @@ export default {
|
|
|
});
|
|
|
this.chioseActiveSound = activeSound;
|
|
|
this.activeSound = activeSound;
|
|
|
- await this.changeActiveSound(activeSound.join(","));
|
|
|
+ await this.changeActiveSound(activeSound.join(","));
|
|
|
} else {
|
|
|
if (this.teamStatus == "newTeam") {
|
|
|
this.getDefaultSubject();
|
|
@@ -233,6 +233,7 @@ export default {
|
|
|
// 如果没有一个声部 则请求默认声部
|
|
|
|
|
|
if (res.data?.musicGroupSubjectPlans?.length > 0) {
|
|
|
+
|
|
|
let activeSound = [];
|
|
|
this.activeSoundList =
|
|
|
res.data?.musicGroupSubjectPlans.map((item) => {
|
|
@@ -249,10 +250,8 @@ export default {
|
|
|
});
|
|
|
this.activeSound = activeSound;
|
|
|
this.chioseActiveSound = activeSound;
|
|
|
-
|
|
|
// 格式化商品和教辅
|
|
|
res.data.musicGroupSubjectGoodsGroups.forEach(
|
|
|
-
|
|
|
(shop) => {
|
|
|
let index = findIndex(this.activeSoundList, (o) => {
|
|
|
return o.id == shop.subjectId;
|
|
@@ -270,6 +269,7 @@ export default {
|
|
|
let typeJson = Object.keys(
|
|
|
JSON.parse(shop.kitGroupPurchaseTypeJson)
|
|
|
);
|
|
|
+
|
|
|
this.activeSoundList[index].chioseMusic.push({
|
|
|
musical: parseInt(shop.goodsIdList),
|
|
|
type: typeJson,
|
|
@@ -283,7 +283,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
- await this.changeActiveSound(activeSound.join(","));
|
|
|
+ await this.changeActiveSound(activeSound.join(","));
|
|
|
} else {
|
|
|
this.getDefaultSubject();
|
|
|
}
|
|
@@ -319,14 +319,14 @@ export default {
|
|
|
});
|
|
|
this.activeSound = activeSound;
|
|
|
this.chioseActiveSound = activeSound;
|
|
|
- await this.changeActiveSound(activeSound.join(","));
|
|
|
+ await this.changeActiveSound(activeSound.join(","));
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
lookCheck(val) {
|
|
|
this.checkList = [...new Set(val)];
|
|
|
},
|
|
|
- async chioseSound(activeSound) {
|
|
|
+ async chioseSound(activeSound) {
|
|
|
// 同步数据
|
|
|
this.activeSound = [...new Set(activeSound)];
|
|
|
let newSoundList = [];
|
|
@@ -352,7 +352,7 @@ export default {
|
|
|
});
|
|
|
this.activeSound = newActiveSound;
|
|
|
this.chioseActiveSound = newActiveSound;
|
|
|
- await this.changeActiveSound(newActiveSound.join(","));
|
|
|
+ await this.changeActiveSound(newActiveSound.join(","));
|
|
|
this.soundVisible = false;
|
|
|
},
|
|
|
initSound(item) {
|
|
@@ -377,7 +377,7 @@ export default {
|
|
|
},
|
|
|
async changeActiveSound(val) {
|
|
|
// 写入声部商品和辅件
|
|
|
- return getSubjectGoods({
|
|
|
+ return getSubjectGoods({
|
|
|
subjectIds: val,
|
|
|
chargeTypeId: this.topfor.type,
|
|
|
musicGroupId: this.teamid,
|
|
@@ -386,7 +386,6 @@ export default {
|
|
|
if (res.code == 200) {
|
|
|
if (res.data) {
|
|
|
let keys = Object.keys(res.data);
|
|
|
- console.log("activeSoundList", this.activeSoundList);
|
|
|
this.activeSoundList.forEach((item) => {
|
|
|
if (keys.indexOf(item.id + "") != -1) {
|
|
|
let goodList = [];
|
|
@@ -402,7 +401,7 @@ export default {
|
|
|
item.markList = markList;
|
|
|
}
|
|
|
});
|
|
|
- this.checkShopAndMark()
|
|
|
+ this.checkShopAndMark();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -410,46 +409,53 @@ export default {
|
|
|
lookMusic() {},
|
|
|
checkShopAndMark() {
|
|
|
let loadash = this.$helpers.lodash;
|
|
|
- let errorShop = []
|
|
|
- let flag = false
|
|
|
+ let errorShop = [];
|
|
|
+ let flag = false;
|
|
|
this.activeSoundList.forEach((item) => {
|
|
|
// 格式化教辅
|
|
|
let markIdList = item.markList.map((mark) => {
|
|
|
return mark.id;
|
|
|
});
|
|
|
- let goodsIdList = item.goodsList.map(good=>{
|
|
|
- return good.id
|
|
|
- })
|
|
|
+ let goodsIdList = item.goodsList.map((good) => {
|
|
|
+ return good.id;
|
|
|
+ });
|
|
|
for (let i = 0; i < item.markChioseList.length; i++) {
|
|
|
- if (!markIdList.includes(item.markChioseList[i])&&item.markChioseList[i]) {
|
|
|
- errorShop.push(item.markChioseList[i])
|
|
|
- flag = true
|
|
|
+ if (
|
|
|
+ !markIdList.includes(item.markChioseList[i]) &&
|
|
|
+ item.markChioseList[i]
|
|
|
+ ) {
|
|
|
+ errorShop.push(item.markChioseList[i]);
|
|
|
+ flag = true;
|
|
|
item.markChioseList.splice(i--, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (let i = 0; i < item.chioseMusic.length; i++) {
|
|
|
- if (!goodsIdList.includes(item.chioseMusic[i].musical)&&item.chioseMusic[i].musical) {
|
|
|
- errorShop.push(item.chioseMusic[i].musical)
|
|
|
- flag = true
|
|
|
- item.chioseMusic[i].musical = null
|
|
|
- item.chioseMusic[i].groupPrice = null
|
|
|
+ for (let i = 0; i < item.chioseMusic.length; i++) {
|
|
|
+ if (
|
|
|
+ !goodsIdList.includes(item.chioseMusic[i].musical) &&
|
|
|
+ item.chioseMusic[i].musical
|
|
|
+ ) {
|
|
|
+ errorShop.push(item.chioseMusic[i].musical);
|
|
|
+ flag = true;
|
|
|
+ item.chioseMusic[i].musical = null;
|
|
|
+ item.chioseMusic[i].groupPrice = null;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- console.log(errorShop)
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
// 提示
|
|
|
|
|
|
- this.$message.error(`{${errorShop.join(',')}}商品已失效,请联系仓库主管`)
|
|
|
+ this.$message.error(
|
|
|
+ `{${errorShop.join(",")}}商品已失效,请联系仓库主管`
|
|
|
+ );
|
|
|
}
|
|
|
- this.$set(this,'activeSoundList',this.activeSoundList)
|
|
|
+ this.$set(this, "activeSoundList", this.activeSoundList);
|
|
|
},
|
|
|
- checkSubmit (){
|
|
|
- let flag = true;
|
|
|
+ checkSubmit() {
|
|
|
+ let flag = true;
|
|
|
if (this.activeSoundList.length <= 0) {
|
|
|
this.$message.error(`请至少设置一个声部`);
|
|
|
- flag = false
|
|
|
+ flag = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -473,14 +479,14 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- return flag
|
|
|
+ return flag;
|
|
|
},
|
|
|
submitInfo(type) {
|
|
|
// 计划招生人数
|
|
|
// 可选乐器
|
|
|
// 教辅
|
|
|
|
|
|
- let flag = this.checkSubmit()
|
|
|
+ let flag = this.checkSubmit();
|
|
|
if (!flag) return;
|
|
|
// 新建团
|
|
|
let obj = {};
|