【功能】完成满减送关闭的功能

pull/551/head
痴货 2024-08-27 12:12:22 +08:00
parent 0fd5904104
commit 5ff7d74b6d
2 changed files with 29 additions and 1 deletions

View File

@ -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 })
}

View File

@ -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()