【功能】完成满减送关闭的功能
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 })
|
||||
}
|
||||
|
||||
// 删除限时折扣活动
|
||||
// 删除满减送活动
|
||||
export const deleteRewardActivity = async (id: number) => {
|
||||
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
|
||||
link
|
||||
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)"
|
||||
v-hasPermi="['product:brand:delete']"
|
||||
>
|
||||
|
|
@ -186,6 +196,19 @@ const handleDelete = async (id: number) => {
|
|||
} catch {}
|
||||
}
|
||||
|
||||
/** 关闭按钮操作 */
|
||||
const handleClose = async (id: number) => {
|
||||
try {
|
||||
// 关闭的二次确认
|
||||
await message.confirm('确认关闭该满减送活动吗?')
|
||||
// 发起关闭
|
||||
await RewardActivityApi.closeRewardActivity(id)
|
||||
message.success('关闭成功')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
|
|
|||
Loading…
Reference in New Issue