Commit 6ecbc84d by 杨明

fixed

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