Commit 6ecbc84d by 杨明

fixed

1 parent 9372b332
......@@ -189,7 +189,7 @@ export default {
return
}
this.init()
this.$nextTick(() => {
this.$nextTick(async () => {
if (info.serviceMerchantPackageConfigDTOS) this.selectedCarList = info.serviceMerchantPackageConfigDTOS
let activityCoupon = info.activityCouponBaseInfoDTOS || info.couponList || info.couponItemList
......@@ -206,15 +206,15 @@ export default {
}
this.giftValue = info.giftId || ''
if (this.giftValue && info.ghExclusiveFlag == 2) {
this.getModel()
await this.getModel()
} else {
this.getList()
}
setTimeout(() => {
if (this.routerInfo.addOrEdit == 'edit') {
this.handleSaveGift(false)
}
}, 0)
this.getList()
})
},
deep: true
......@@ -659,7 +659,7 @@ export default {
this.loading = true
this.$apis.marketing.servicePage(params).then(res => {
this.loading = false
this.selectedCarList = []
if (!isChecked) this.selectedCarList = []
this.$refs['carRef'].$refs['listMutiTable'].clearSelection()
this.carList = res.list || []
this.carList.forEach(p => {
......@@ -667,6 +667,7 @@ export default {
if (isChecked) {
this.selectedCarList.forEach(s => {
if (p.packageCode == s.packageCode) {
s.packageName = p.packageName || p.serviceName
p.packageAmount = s.packageAmount || 0
}
})
......@@ -685,36 +686,42 @@ export default {
this.getCarMoreList()
return
}
this.$apis.giftBag.packageDetail({ id: this.giftValue }).then(res => {
this.$nextTick(async () => {
this.selectedCarList = res.serviceMerchantPackageConfigDTOS || []
return new Promise(resolve => {
this.$apis.giftBag.packageDetail({ id: this.giftValue }).then(res => {
this.$nextTick(async () => {
this.selectedCarList = res.serviceMerchantPackageConfigDTOS || []
let activityCoupon = res.couponList || []
let activityCoupon = res.couponList || []
activityCoupon.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
if (res.name == '自定义套餐') {
try {
const serviceItem = Object.entries(JSON.parse(res.serviceItem))
this.selectedCarList = serviceItem.map(item => {
return {
packageCode: item[0],
serviceCode: item[0],
packageAmount: +item[1]
}
})
await this.getCarMoreList(true)
this.selectedPreExisting(this.selectedCarList, this.carList, 'packageCode', this.$refs['carRef'])
} catch (e) {
console.log(e)
activityCoupon.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
if (res.name == '自定义套餐') {
try {
const serviceItem = Object.entries(JSON.parse(res.serviceItem))
this.selectedCarList = serviceItem.map(item => {
return {
packageCode: item[0],
serviceCode: item[0],
packageAmount: +item[1]
}
})
await this.getCarMoreList(true)
console.log(this.selectedCarList, this.carList, 7777777777)
this.selectedPreExisting(this.selectedCarList, this.carList, 'packageCode', this.$refs['carRef'])
resolve()
} catch (e) {
console.log(e)
resolve()
}
} else {
this.getList()
resolve()
}
} else {
this.getList()
}
})
})
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!