【功能】完成满减送关闭的功能
parent
0fd5904104
commit
5ff7d74b6d
|
|
@ -42,7 +42,12 @@ export const getReward = async (id: number) => {
|
||||||
return await request.get({ url: '/promotion/reward-activity/get?id=' + id })
|
return await request.get({ url: '/promotion/reward-activity/get?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除限时折扣活动
|
// 删除满减送活动
|
||||||
export const deleteRewardActivity = async (id: number) => {
|
export const deleteRewardActivity = async (id: number) => {
|
||||||
return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id })
|
return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭满减送活动
|
||||||
|
export const closeRewardActivity = async (id: number) => {
|
||||||
|
return await request.put({ url: '/promotion/reward-activity/close?id=' + id })
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,16 @@
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
|
@click="handleClose(scope.row.id)"
|
||||||
|
v-if="scope.row.status === 10 || scope.row.status === 20"
|
||||||
|
v-hasPermi="['promotion:reward-activity:close']"
|
||||||
|
>
|
||||||
|
关闭
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
v-else
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
v-hasPermi="['product:brand:delete']"
|
v-hasPermi="['product:brand:delete']"
|
||||||
>
|
>
|
||||||
|
|
@ -186,6 +196,19 @@ const handleDelete = async (id: number) => {
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 关闭按钮操作 */
|
||||||
|
const handleClose = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 关闭的二次确认
|
||||||
|
await message.confirm('确认关闭该满减送活动吗?')
|
||||||
|
// 发起关闭
|
||||||
|
await RewardActivityApi.closeRewardActivity(id)
|
||||||
|
message.success('关闭成功')
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue