Commit 869f1ae2 by zhangquan

生失效接口联调

1 parent eab0ad21
...@@ -83,6 +83,18 @@ const detailExportApi = params => { ...@@ -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 { export default {
getCouponsList, getCouponsList,
createCoupons, createCoupons,
...@@ -91,5 +103,6 @@ export default { ...@@ -91,5 +103,6 @@ export default {
getCouponDetailApi, getCouponDetailApi,
deleteCouponApi, deleteCouponApi,
couponUserCancelApi, couponUserCancelApi,
detailExportApi detailExportApi,
effectiveCouponApi
} }
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
return row.scope.status != 2 return row.scope.status != 2
}, },
listeners: { listeners: {
click: row => this.changeStatus(row.scope) click: row => this.takeEffect(row.scope, 2)
} }
}, },
{ {
...@@ -70,21 +70,21 @@ export default { ...@@ -70,21 +70,21 @@ export default {
return row.scope.status == 2 return row.scope.status == 2
}, },
listeners: { listeners: {
click: row => this.changeStatus(row.scope) click: row => this.takeEffect(row.scope, 3)
} }
}, },
{ {
type: 'GLButton', type: 'el-button',
name: '删除', name: '删除',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '删除' fn: '删除'
}, },
condition: row => { condition: row => {
return row.status == '3' return row.scope.status == 3
}, },
listeners: { listeners: {
click: this.del click: row => this.del(row.scope)
} }
}, },
{ {
...@@ -232,11 +232,21 @@ export default { ...@@ -232,11 +232,21 @@ export default {
}, },
//删除 //删除
del(row) { del(row) {
var params = {} const params = {
params.couponId = row.id couponId: row.id
}
this.secondConfirm('删除', '确定删除此优惠券?', 'goodsConponApi', 'deleteCouponApi', params) 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) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -251,7 +261,7 @@ export default { ...@@ -251,7 +261,7 @@ export default {
}) })
if (res.code == '0') { if (res.code == '0') {
fn && fn() 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!