新增:优惠券

This commit is contained in:
2025-08-09 19:59:32 +08:00
parent be3efaad57
commit 7074da30f4
3 changed files with 44 additions and 83 deletions

View File

@@ -1,10 +1,9 @@
<template>
<div class="page">
<div class="ele-body">
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="shopCouponId"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
@@ -46,8 +45,7 @@
<!-- 编辑弹窗 -->
<ShopCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
</a-page-header>
</template>
<script lang="ts" setup>
@@ -61,6 +59,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import ShopCouponEdit from './components/shopCouponEdit.vue';
import { pageShopCoupon, removeShopCoupon, removeBatchShopCoupon } from '@/api/shop/shopCoupon';
import type { ShopCoupon, ShopCouponParam } from '@/api/shop/shopCoupon/model';
@@ -113,14 +112,14 @@
key: 'name',
align: 'center',
},
// {
// title: '优惠券描述',
// dataIndex: 'description',
// key: 'description',
// align: 'center',
// },
{
title: '优惠券描述',
dataIndex: 'description',
key: 'description',
align: 'center',
},
{
title: '优惠券类型(10满减券 20折扣券 30免费劵)',
title: '优惠券类型',
dataIndex: 'type',
key: 'type',
align: 'center',
@@ -132,7 +131,7 @@
align: 'center',
},
{
title: '折扣券-折扣率(0-100)',
title: '折扣率(0-100)',
dataIndex: 'discount',
key: 'discount',
align: 'center',
@@ -143,18 +142,6 @@
key: 'minPrice',
align: 'center',
},
{
title: '到期类型(10领取后生效 20固定时间)',
dataIndex: 'expireType',
key: 'expireType',
align: 'center',
},
{
title: '领取后生效-有效天数',
dataIndex: 'expireDay',
key: 'expireDay',
align: 'center',
},
{
title: '有效期开始时间',
dataIndex: 'startTime',
@@ -168,62 +155,11 @@
align: 'center',
},
{
title: '适用范围(10全部商品 20指定商品 30指定分类)',
dataIndex: 'applyRange',
key: 'applyRange',
align: 'center',
},
{
title: '适用范围配置(json格式)',
dataIndex: 'applyRangeConfig',
key: 'applyRangeConfig',
align: 'center',
},
{
title: '是否过期(0未过期 1已过期)',
title: '是否过期',
dataIndex: 'isExpire',
key: 'isExpire',
align: 'center',
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
},
{
title: '状态, 0正常, 1禁用',
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
},
{
title: '创建用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
},
{
title: '发放总数量(-1表示无限制)',
dataIndex: 'totalCount',
@@ -248,6 +184,33 @@
key: 'enabled',
align: 'center',
},
{
title: '创建用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
},
{
title: '排序',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '操作',
key: 'action',
@@ -278,7 +241,7 @@
/* 删除单个 */
const remove = (row: ShopCoupon) => {
const hide = message.loading('请求中..', 0);
removeShopCoupon(row.shopCouponId)
removeShopCoupon(row.id)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -1,6 +1,5 @@
<template>
<div class="page">
<div class="ele-body">
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
@@ -46,8 +45,7 @@
<!-- 编辑弹窗 -->
<ShopUserCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
</a-page-header>
</template>
<script lang="ts" setup>