|
@@ -40,7 +40,7 @@
|
|
@spinning="e=>spinning=e"
|
|
@spinning="e=>spinning=e"
|
|
@openCpModal="openProductModal"
|
|
@openCpModal="openProductModal"
|
|
@allThreeStock="searchAllThreeStock"
|
|
@allThreeStock="searchAllThreeStock"
|
|
- @addActive="addActive"
|
|
|
|
|
|
+ @addActive="upActive"
|
|
:showTotal="showTotal"
|
|
:showTotal="showTotal"
|
|
:hasActive="activeList.length>0"
|
|
:hasActive="activeList.length>0"
|
|
:detailData="detailData"
|
|
:detailData="detailData"
|
|
@@ -389,36 +389,25 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 正常产品参与活动
|
|
|
|
- addActive (data, params) {
|
|
|
|
- const promo = data.split('-')
|
|
|
|
- const newSn = this.activeList.find(item => item.promoRuleSn == promo[1])
|
|
|
|
- const newSalesPromoSn = newSn && newSn.salesPromoSn || ''
|
|
|
|
- salesChangePromo({
|
|
|
|
- salesPromoSn: newSalesPromoSn,
|
|
|
|
- promoRuleSn: promo[1],
|
|
|
|
- ...params
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- // 刷新正常活动
|
|
|
|
- this.$refs.productNormalList.addAcitveSuccess()
|
|
|
|
- // 刷新活动统计
|
|
|
|
- this.$refs.activeTjList.refashRow(newSn, 1)
|
|
|
|
- // 刷新详情统计
|
|
|
|
- this.refashTableData('normal')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 更换活动
|
|
|
|
- upActive (params) {
|
|
|
|
|
|
+ // 更换活动,type 1 促销活动,0 正常活动
|
|
|
|
+ upActive (params, type) {
|
|
salesChangePromo(params).then(res => {
|
|
salesChangePromo(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- // 刷新活动产品
|
|
|
|
- this.$refs.productActiveList.upAcitveSuccess()
|
|
|
|
- // 刷新活动统计
|
|
|
|
- this.$refs.activeTjList.refashRow('', 1)
|
|
|
|
- // 刷新详情统计
|
|
|
|
- this.refashTableData('promo')
|
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ // 刷新活动产品
|
|
|
|
+ this.$refs.productActiveList.upAcitveSuccess()
|
|
|
|
+ // 刷新活动统计
|
|
|
|
+ this.$refs.activeTjList.getDataList()
|
|
|
|
+ // 刷新详情统计
|
|
|
|
+ this.refashTableData('promo')
|
|
|
|
+ } else {
|
|
|
|
+ // 刷新正常活动
|
|
|
|
+ this.$refs.productNormalList.addAcitveSuccess()
|
|
|
|
+ // 刷新活动统计
|
|
|
|
+ this.$refs.activeTjList.getDataList()
|
|
|
|
+ // 刷新详情统计
|
|
|
|
+ this.refashTableData('normal')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|