Commit 869f1ae2 by zhangquan

生失效接口联调

1 parent eab0ad21
......@@ -83,6 +83,18 @@ const detailExportApi = params => {
})
}
//生效/失效
const effectiveCouponApi = params => {
params.method = `${defaultPath}effective`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
getCouponsList,
createCoupons,
......@@ -91,5 +103,6 @@ export default {
getCouponDetailApi,
deleteCouponApi,
couponUserCancelApi,
detailExportApi
detailExportApi,
effectiveCouponApi
}
......@@ -54,7 +54,7 @@ export default {
return row.scope.status != 2
},
listeners: {
click: row => this.changeStatus(row.scope)
click: row => this.takeEffect(row.scope, 2)
}
},
{
......@@ -70,21 +70,21 @@ export default {
return row.scope.status == 2
},
listeners: {
click: row => this.changeStatus(row.scope)
click: row => this.takeEffect(row.scope, 3)
}
},
{
type: 'GLButton',
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
condition: row => {
return row.status == '3'
return row.scope.status == 3
},
listeners: {
click: this.del
click: row => this.del(row.scope)
}
},
{
......@@ -232,11 +232,21 @@ export default {
},
//删除
del(row) {
var params = {}
params.couponId = row.id
const params = {
couponId: row.id
}
this.secondConfirm('删除', '确定删除此优惠券?', 'goodsConponApi', 'deleteCouponApi', params)
},
takeEffect(row, key) {
const params = {
couponId: row.id,
status: key
}
const title = key == 2 ? '生效' : '失效'
this.secondConfirm(title, `确定要${title}该优惠券?`, 'goodsConponApi', 'effectiveCouponApi', params)
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
......@@ -251,7 +261,7 @@ export default {
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
this.handleOk()
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!