From 9d0e77b624f57869b4995365d5fca4f9fbd30266 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 11 Sep 2024 20:55:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E6=8C=87=E5=AE=9A=E5=8F=91?= =?UTF-8?q?=E5=8D=B7=E3=80=81=E6=96=B0=E4=BA=BA=E5=8D=B7=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=97=A0=E9=99=90=E5=8F=91=E6=94=BE=E7=9A=84=E5=85=9C?= =?UTF-8?q?=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/coupon/formatter.ts | 11 +++++++++++ .../promotion/coupon/template/CouponTemplateForm.vue | 5 ++++- src/views/mall/promotion/coupon/template/index.vue | 8 +++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/mall/promotion/coupon/formatter.ts b/src/views/mall/promotion/coupon/formatter.ts index f00138a6..56b11402 100644 --- a/src/views/mall/promotion/coupon/formatter.ts +++ b/src/views/mall/promotion/coupon/formatter.ts @@ -33,8 +33,19 @@ export const validityTypeFormat = (row: CouponTemplateVO) => { return '未知【' + row.validityType + '】' } +// 格式化【totalCount】 +export const totalCountFormat = (row: CouponTemplateVO) => { + if (row.totalCount === -1) { + return '不限制' + } + return row.totalCount +} + // 格式化【剩余数量】 export const remainedCountFormat = (row: CouponTemplateVO) => { + if (row.totalCount === -1) { + return '不限制' + } return row.totalCount - row.takeCount } diff --git a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue index 28e15c72..58a88126 100644 --- a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue +++ b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue @@ -115,6 +115,7 @@ 直接领取 指定发放 + 新人卷 @@ -309,7 +310,9 @@ const submitForm = async () => { validEndTime: formData.value.validTimes && formData.value.validTimes.length === 2 ? formData.value.validTimes[1] - : undefined + : undefined, + totalCount: formData.value.takeType === 1 ? formData.value.totalCount : -1, + takeLimitCount: formData.value.takeType === 1 ? formData.value.takeLimitCount : -1 } as unknown as CouponTemplateApi.CouponTemplateVO // 设置商品范围 diff --git a/src/views/mall/promotion/coupon/template/index.vue b/src/views/mall/promotion/coupon/template/index.vue index 657ceada..bc121ead 100755 --- a/src/views/mall/promotion/coupon/template/index.vue +++ b/src/views/mall/promotion/coupon/template/index.vue @@ -109,7 +109,12 @@ prop="validityType" width="185" /> - +