|
@@ -59,7 +59,7 @@
|
|
|
<div slot="title">
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
<span>活动产品</span>
|
|
|
- <a-button size="small" @click="getActiveList" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
|
|
|
+ <a-button size="small" @click="getActiveList(true)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<activeStatisticsList
|
|
@@ -298,7 +298,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 获取销售单参与的活动列表
|
|
|
- async getActiveList () {
|
|
|
+ async getActiveList (flag) {
|
|
|
// 已参与活动列表
|
|
|
const list = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
|
|
|
this.activeList = list.filter(item => item.promotion && item.promotionRule)
|
|
@@ -306,12 +306,14 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
if (this.activeList.length) this.$refs.activeTjList.hasInit = false
|
|
|
})
|
|
|
- setTimeout(() => {
|
|
|
- // 刷新正常产品列表
|
|
|
- this.$refs.productNormalList.resetSearchForm()
|
|
|
- // 刷新活动产品列表
|
|
|
- if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
|
|
|
- }, 500)
|
|
|
+ if (!flag) {
|
|
|
+ setTimeout(() => {
|
|
|
+ // 刷新正常产品列表
|
|
|
+ this.$refs.productNormalList.resetSearchForm()
|
|
|
+ // 刷新活动产品列表
|
|
|
+ if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
},
|
|
|
// 获取是否有新活动,
|
|
|
async getNewActive () {
|
|
@@ -361,8 +363,11 @@ export default {
|
|
|
this.showCpModal = true
|
|
|
},
|
|
|
// 添加产品后,关闭弹框
|
|
|
- closeProductModal (type) {
|
|
|
+ closeProductModal (hasRefash) {
|
|
|
this.showCpModal = false
|
|
|
+ if (hasRefash) {
|
|
|
+ this.getActiveList()
|
|
|
+ }
|
|
|
},
|
|
|
// 获取指定活动的产品列表
|
|
|
getActiveProduct (active) {
|
|
@@ -375,18 +380,22 @@ export default {
|
|
|
// 如果是活动产品
|
|
|
if (type == 'promo') {
|
|
|
// 刷新正常产品列表
|
|
|
- this.$refs.productNormalList.resetSearchForm()
|
|
|
+ if (action != 'add') this.$refs.productNormalList.resetSearchForm()
|
|
|
} else if (type == 'normal') { // 如果是正常产品
|
|
|
// 刷新活动产品列表
|
|
|
- if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
|
|
|
+ if (this.activeList.length && action != 'add') this.$refs.productActiveList.resetSearchForm()
|
|
|
} else {
|
|
|
// 刷新正常产品列表
|
|
|
this.$refs.productNormalList.resetSearchForm()
|
|
|
// 刷新活动产品列表
|
|
|
if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
|
|
|
}
|
|
|
- // 重新获取详情信息和活动统计列表
|
|
|
- this.getOrderDetail(true)
|
|
|
+ // 重新获取详情信息
|
|
|
+ this.getOrderDetail(false)
|
|
|
+ if (action != 'add') {
|
|
|
+ // 重新获取参与活动列表
|
|
|
+ this.getActiveList(true)
|
|
|
+ }
|
|
|
},
|
|
|
// 确定新增产品到列表,
|
|
|
// row 产品信息,promo 活动规则信息,promoProductClz 规则类型,cptype 1 添加活动产品,2 累计产品
|