File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
src/views/mall/promotion/coupon Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,19 @@ export const validityTypeFormat = (row: CouponTemplateVO) => {
33
33
return '未知【' + row . validityType + '】'
34
34
}
35
35
36
+ // 格式化【totalCount】
37
+ export const totalCountFormat = ( row : CouponTemplateVO ) => {
38
+ if ( row . totalCount === - 1 ) {
39
+ return '不限制'
40
+ }
41
+ return row . totalCount
42
+ }
43
+
36
44
// 格式化【剩余数量】
37
45
export const remainedCountFormat = ( row : CouponTemplateVO ) => {
46
+ if ( row . totalCount === - 1 ) {
47
+ return '不限制'
48
+ }
38
49
return row . totalCount - row . takeCount
39
50
}
40
51
Original file line number Diff line number Diff line change 115
115
<el-radio-group v-model =" formData.takeType" >
116
116
<el-radio :key =" 1" :value =" 1" >直接领取</el-radio >
117
117
<el-radio :key =" 2" :value =" 2" >指定发放</el-radio >
118
+ <el-radio :key =" 2" :value =" 3" >新人卷</el-radio >
118
119
</el-radio-group >
119
120
</el-form-item >
120
121
<el-form-item v-if =" formData.takeType === 1" label =" 发放数量" prop =" totalCount" >
@@ -309,7 +310,9 @@ const submitForm = async () => {
309
310
validEndTime:
310
311
formData .value .validTimes && formData .value .validTimes .length === 2
311
312
? formData .value .validTimes [1 ]
312
- : undefined
313
+ : undefined ,
314
+ totalCount: formData .value .takeType === 1 ? formData .value .totalCount : - 1 ,
315
+ takeLimitCount: formData .value .takeType === 1 ? formData .value .takeLimitCount : - 1
313
316
} as unknown as CouponTemplateApi .CouponTemplateVO
314
317
315
318
// 设置商品范围
Original file line number Diff line number Diff line change 109
109
prop =" validityType"
110
110
width =" 185"
111
111
/>
112
- <el-table-column align =" center" label =" 发放数量" prop =" totalCount" />
112
+ <el-table-column
113
+ :formatter =" totalCountFormat"
114
+ align =" center"
115
+ label =" 发放数量"
116
+ prop =" totalCount"
117
+ />
113
118
<el-table-column
114
119
:formatter =" remainedCountFormat"
115
120
align =" center"
@@ -189,6 +194,7 @@ import {
189
194
discountFormat ,
190
195
remainedCountFormat ,
191
196
takeLimitCountFormat ,
197
+ totalCountFormat ,
192
198
validityTypeFormat
193
199
} from ' @/views/mall/promotion/coupon/formatter'
194
200
You can’t perform that action at this time.
0 commit comments