Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9d0e77b6
authored
Sep 11, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能修复】商城:指定发卷、新人卷,支持无限发放的兜底
parent
8d116599
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
src/views/mall/promotion/coupon/formatter.ts
+11
-0
src/views/mall/promotion/coupon/template/CouponTemplateForm.vue
+4
-1
src/views/mall/promotion/coupon/template/index.vue
+7
-1
No files found.
src/views/mall/promotion/coupon/formatter.ts
View file @
9d0e77b6
...
...
@@ -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
}
...
...
src/views/mall/promotion/coupon/template/CouponTemplateForm.vue
View file @
9d0e77b6
...
...
@@ -115,6 +115,7 @@
<el-radio-group
v-model=
"formData.takeType"
>
<el-radio
:key=
"1"
:value=
"1"
>
直接领取
</el-radio>
<el-radio
:key=
"2"
:value=
"2"
>
指定发放
</el-radio>
<el-radio
:key=
"2"
:value=
"3"
>
新人卷
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if=
"formData.takeType === 1"
label=
"发放数量"
prop=
"totalCount"
>
...
...
@@ -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
// 设置商品范围
...
...
src/views/mall/promotion/coupon/template/index.vue
View file @
9d0e77b6
...
...
@@ -109,7 +109,12 @@
prop=
"validityType"
width=
"185"
/>
<el-table-column
align=
"center"
label=
"发放数量"
prop=
"totalCount"
/>
<el-table-column
:formatter=
"totalCountFormat"
align=
"center"
label=
"发放数量"
prop=
"totalCount"
/>
<el-table-column
:formatter=
"remainedCountFormat"
align=
"center"
...
...
@@ -189,6 +194,7 @@ import {
discountFormat
,
remainedCountFormat
,
takeLimitCountFormat
,
totalCountFormat
,
validityTypeFormat
}
from
'@/views/mall/promotion/coupon/formatter'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment