|
@@ -261,22 +261,28 @@ export default {
|
|
|
.then(setRes)
|
|
|
}
|
|
|
},
|
|
|
- subjectChange(id) {
|
|
|
+ async subjectChange(id) {
|
|
|
this.$set(this.form, 'musicalGoods', '')
|
|
|
- getSubjectGoodsAndInfo({
|
|
|
- musicGroupId: this.musicGroupId,
|
|
|
- subjectId: id,
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.musicGroupSubjectPlanFee = res.data.musicGroupSubjectPlan.fee
|
|
|
- const items = formatAllGoods(res.data, this.item.kitGroupPurchaseType)
|
|
|
- for (const key in items) {
|
|
|
- if (items.hasOwnProperty(key)) {
|
|
|
- const item = items[key]
|
|
|
- this[key] = item
|
|
|
- }
|
|
|
+ let data = null
|
|
|
+ if (id) {
|
|
|
+ await getSubjectGoodsAndInfo({
|
|
|
+ musicGroupId: this.musicGroupId,
|
|
|
+ subjectId: id,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ data = res.data
|
|
|
+ this.musicGroupSubjectPlanFee = res.data.musicGroupSubjectPlan.fee
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.musicGroupSubjectPlanFee = 0
|
|
|
+ }
|
|
|
+ const items = formatAllGoods(data, this.item.kitGroupPurchaseType)
|
|
|
+ for (const key in items) {
|
|
|
+ if (items.hasOwnProperty(key)) {
|
|
|
+ const item = items[key]
|
|
|
+ this[key] = item
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
musicalGoodsChange(val) {
|
|
|
const item = this.musicalGoodsById[val]
|