修复:优化解绑优惠券和余额历史

This commit is contained in:
xiaowang
2026-03-27 11:34:53 +08:00
parent 7f92e302bb
commit b1fc6c3b79
9 changed files with 130 additions and 20 deletions
+2 -10
View File
@@ -7,7 +7,7 @@
<a-space>
<a-input-search
v-model:value="searchText"
placeholder="搜索优惠券名称或编码"
placeholder="搜索优惠券名称"
style="width: 260px"
@search="handleSearch"
/>
@@ -115,10 +115,6 @@
:label-col="{ span: 6 }"
:wrapper-col="{ span: 16 }"
>
<a-form-item label="优惠券编码" name="couponCode">
<a-input v-model:value="formState.couponCode" placeholder="请输入优惠券编码" />
</a-form-item>
<a-form-item label="优惠券名称" name="couponName">
<a-input v-model:value="formState.couponName" placeholder="请输入优惠券名称" />
</a-form-item>
@@ -212,7 +208,6 @@
@cancel="viewModalVisible = false"
>
<a-descriptions bordered :column="1" size="small">
<a-descriptions-item label="优惠券编码">{{ currentCoupon?.couponCode || '-' }}</a-descriptions-item>
<a-descriptions-item label="优惠券名称">{{ currentCoupon?.couponName || '-' }}</a-descriptions-item>
<a-descriptions-item label="所属店铺">{{ currentCoupon?.shopName || '-' }}</a-descriptions-item>
<a-descriptions-item label="优惠券类型">{{ currentCoupon?.couponType === 1 ? '折扣券' : '满减券' }}</a-descriptions-item>
@@ -368,7 +363,6 @@ const distributeFormState = reactive({
})
const formRules = {
couponCode: [{ required: true, message: '请输入优惠券编码', trigger: 'blur' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'blur' }],
couponType: [{ required: true, message: '请选择优惠券类型', trigger: 'change' }],
couponScene: [{ required: true, message: '请选择优惠场景', trigger: 'change' }],
@@ -385,7 +379,6 @@ const distributeFormRules = {
} as any
const columns = [
{ title: '优惠券编码', dataIndex: 'couponCode', key: 'couponCode' },
{ title: '优惠券名称', dataIndex: 'couponName', key: 'couponName' },
{ title: '所属店铺', key: 'shop', width: 140 },
{ title: '类型', key: 'couponType', width: 100 },
@@ -530,8 +523,7 @@ const fetchCoupons = async () => {
const list = Array.isArray(coupons) ? coupons : []
const keyword = searchText.value.trim()
couponList.value = keyword
? list.filter(item =>
(item.couponName || '').includes(keyword) || (item.couponCode || '').includes(keyword))
? list.filter(item => (item.couponName || '').includes(keyword))
: list
pagination.total = couponList.value.length
} catch (error) {