Commit c70c525d by 杨明

fixed

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