|
@@ -55,8 +55,8 @@
|
|
|
<span style="margin-left:20px;color:#00aaff;cursor: pointer;" @click="(event) => {showDesc(event, item)}">
|
|
|
<a-icon :type="item.showDesc ? 'eye-invisible' : 'eye'"/> 活动详情
|
|
|
</span>
|
|
|
- <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disabledActive(event, item)}">
|
|
|
- <a-icon title="禁用规则" type="disconnect"/> {{item.disabled ? '启用规则' : '禁用规则'}}
|
|
|
+ <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disenablePromp(event, item)}">
|
|
|
+ <a-icon title="禁用规则" :type="item.disabled?'link':'disconnect'"/> {{item.disabled ? '启用规则' : '禁用规则'}}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
|
|
@@ -244,7 +244,7 @@ export default {
|
|
|
// 已参与活动列表
|
|
|
this.activeList = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
|
|
|
this.activeList.map(item => {
|
|
|
- item.isActive = true
|
|
|
+ item.isActive = item.enabledFlag == 1
|
|
|
item.showDesc = false
|
|
|
item.disabled = item.enabledFlag == 0
|
|
|
this.activeDesKey['search-'+item.promoRuleSn] = false
|
|
@@ -431,6 +431,7 @@ export default {
|
|
|
// 展开收缩活动详情
|
|
|
showDesc(e,item){
|
|
|
e.stopPropagation()
|
|
|
+ item.isActive = true
|
|
|
const row = this.$refs['productList-'+item.promoRuleSn][0]
|
|
|
row&&row.showDesc(item.promotionRule)
|
|
|
},
|
|
@@ -448,19 +449,47 @@ export default {
|
|
|
if(res.status == 200){
|
|
|
_this.$refs['productList-'+item.promoRuleSn][0].disableActive(false)
|
|
|
item.disabled = false
|
|
|
+ item.isActive = true
|
|
|
_this.activeList.splice()
|
|
|
_this.$message.success("操作成功,请添加产品")
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 禁用活动
|
|
|
+ // 禁用规则
|
|
|
disabledActive(e,item){
|
|
|
const _this = this
|
|
|
+ salesDisablePromo({
|
|
|
+ salesBillSn: _this.salesBillSn,
|
|
|
+ salesPromoSn: item.salesPromoSn,
|
|
|
+ promoRuleSn: item.promoRuleSn,
|
|
|
+ salesDisableType: _this.disabledActiveOption
|
|
|
+ }).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ _this.$refs['productList-'+item.promoRuleSn][0].disableActive(true)
|
|
|
+ _this.disabledActiveOption = null
|
|
|
+ item.disabled = true
|
|
|
+ item.isActive = false
|
|
|
+ _this.activeList.splice()
|
|
|
+ _this.$message.success("操作成功")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 禁用启用活动规则
|
|
|
+ disenablePromp(e,item){
|
|
|
+ const _this = this
|
|
|
+ const table = _this.$refs['productList-'+item.promoRuleSn][0]
|
|
|
+ // 是否启用规则
|
|
|
if(item.disabled){
|
|
|
- // 是否启用规则
|
|
|
this.enabledActive(e,item)
|
|
|
return
|
|
|
}
|
|
|
+ // 如果没有活动产品,直接禁用无需弹框提示
|
|
|
+ if(table.countData&&!table.countData.totalQty){
|
|
|
+ _this.disabledActiveOption = 'DELETE'
|
|
|
+ _this.disabledActive(e,item)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 弹框提示禁用方式
|
|
|
this.$confirm({
|
|
|
title: '确定禁用规则?',
|
|
|
centered: true,
|
|
@@ -480,19 +509,7 @@ export default {
|
|
|
</div>,
|
|
|
onOk() {
|
|
|
if(_this.disabledActiveOption){
|
|
|
- salesDisablePromo({
|
|
|
- salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: item.salesPromoSn,
|
|
|
- promoRuleSn: item.promoRuleSn,
|
|
|
- salesDisableType: _this.disabledActiveOption
|
|
|
- }).then(res => {
|
|
|
- if(res.status == 200){
|
|
|
- _this.$refs['productList-'+item.promoRuleSn][0].disableActive(true)
|
|
|
- _this.disabledActiveOption = null
|
|
|
- item.disabled = true
|
|
|
- _this.activeList.splice()
|
|
|
- }
|
|
|
- })
|
|
|
+ _this.disabledActive(e,item)
|
|
|
}else{
|
|
|
_this.$message.info("请选择禁用方式!")
|
|
|
return true
|
|
@@ -504,7 +521,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
changeDaOpt(e){
|
|
|
- console.log(e)
|
|
|
this.disabledActiveOption = e.target.value
|
|
|
},
|
|
|
pageInit () {
|