Commit c70c525d by 杨明

fixed

1 parent b431d7a5
......@@ -206,6 +206,8 @@ export default {
isSelectGoodsVisible: false,
isSelectEquityVisible: false,
editForm: {
marketingTitle: '',
activityTime: [],
superMarketingCouponRelRequestList: [],
backgroundImage: '',
detailImage: '',
......@@ -572,10 +574,6 @@ export default {
this.selectedGoodsList.splice(index, 1)
// this.setNameHide('goodsListBlock')
},
hasCouponBlock(isValidate = true) {
var idx = this.projuctEditFormData.findIndex(item => item.name == 'superMarketingCouponRelRequestListBlock')
this.projuctEditFormData[idx].isHide = !this.editForm.superMarketingCouponRelRequestList.length
},
// 礼包
recoveryGiftList() {
this.editForm.superMarketingCouponRelRequestList = []
......@@ -584,7 +582,6 @@ export default {
this.editForm.superMarketingCouponRelRequestList.push(k)
})
})
this.hasCouponBlock()
},
handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1)
......@@ -601,9 +598,6 @@ export default {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
}
})
// console.log(this.couponObj, 'this.couponObj')
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.superMarketingCouponRelRequestList)
this.hasCouponBlock(false)
},
// 计算预估成本
recoveryTotalPrice() {
......@@ -687,22 +681,31 @@ export default {
},
getInfo() {
this.loading = true
const { id } = this.activityInfo
this.$apis.activity
.findActivityInfo({ activityId: id })
const { id, subscribe } = this.activityInfo
const activityAPi = subscribe == 5 ? 'findActivityInfo' : 'activityDetail'
let param = {
activityId: id
}
if (subscribe != 5)
param = {
id
}
this.$apis.activity[activityAPi](param)
.then(res => {
this.setActivityInfo()
var info = res
this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info
if (info.activityName) {
this.editForm.marketingTitle = info.activityName
}
if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime, info.endtime])
}
// this.routeInfo.addOrEdit == 'edit' && this.getGoodInfo(info.goodsId)
// if (info.activityPrice != null && info.goodsStock != null) {
// this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
// this.editForm.goodsStock = info.goodsStock + ''
// }
if (info.startTime) {
this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')])
}
console.log(this.editForm.activityTime)
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
......@@ -710,13 +713,14 @@ export default {
if (info.activityPrice) {
this.editForm.activityPrice = info.activityPrice / 100
}
if (this.editForm.superMarketingCouponRelRequestList && this.editForm.superMarketingCouponRelRequestList.length) {
this.editForm.superMarketingCouponRelRequestList.forEach(item => {
let activityCoupon = this.editForm.activityCouponBaseInfoDTOS || this.editForm.couponList
if (activityCoupon && activityCoupon.length) {
activityCoupon.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = this.editForm.superMarketingCouponRelRequestList.filter(i => i.discountType == 8)
this.editForm.superMarketingCouponRelRequestList = this.editForm.superMarketingCouponRelRequestList.filter(i => i.discountType != 8)
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.editForm.superMarketingCouponRelRequestList = activityCoupon.filter(i => i.discountType != 8)
this.recoveryCoupon()
this.recoveryTotalPrice()
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!