File tree Expand file tree Collapse file tree 4 files changed +25
-17
lines changed
api/mall/promotion/coupon
views/mall/promotion/coupon Expand file tree Collapse file tree 4 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,6 @@ export function getCouponTemplatePage(params: PageParam) {
73
73
} )
74
74
}
75
75
76
- // 获得可用于领取的优惠劵模板分页
77
- export function getCanTakeCouponTemplatePage ( params : PageParam ) {
78
- return request . get ( {
79
- url : '/promotion/coupon-template/can-take-page' ,
80
- params : params
81
- } )
82
- }
83
-
84
76
// 导出优惠劵模板 Excel
85
77
export function exportCouponTemplateExcel ( params : PageParam ) {
86
78
return request . get ( {
Original file line number Diff line number Diff line change @@ -209,6 +209,24 @@ export const CouponTemplateValidityTypeEnum = {
209
209
}
210
210
}
211
211
212
+ /**
213
+ * 优惠劵模板的领取方式的枚举
214
+ */
215
+ export const CouponTemplateTakeTypeEnum = {
216
+ BY_USER : {
217
+ type : 1 ,
218
+ name : '直接领取'
219
+ } ,
220
+ BY_ADMIN : {
221
+ type : 2 ,
222
+ name : '指定发放'
223
+ } ,
224
+ BY_REGISTER : {
225
+ type : 3 ,
226
+ name : '新人券'
227
+ }
228
+ }
229
+
212
230
/**
213
231
* 营销的商品范围枚举
214
232
*/
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ import {
90
90
userPriceFormat ,
91
91
validityTypeFormat
92
92
} from ' @/views/mall/promotion/coupon/formatter'
93
+ import { CouponTemplateTakeTypeEnum } from ' @/utils/constants'
93
94
94
95
defineOptions ({ name: ' PromotionCouponSend' })
95
96
@@ -102,7 +103,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
102
103
const queryParams = ref ({
103
104
pageNo: 1 ,
104
105
pageSize: 10 ,
105
- name: null
106
+ name: null ,
107
+ canTakeTypes: [CouponTemplateTakeTypeEnum .BY_ADMIN .type ]
106
108
}) // 查询参数
107
109
const queryFormRef = ref () // 搜索的表单
108
110
// 领取人的编号列表
@@ -122,7 +124,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
122
124
const getList = async () => {
123
125
loading .value = true
124
126
try {
125
- const data = await CouponTemplateApi .getCanTakeCouponTemplatePage (queryParams .value )
127
+ const data = await CouponTemplateApi .getCouponTemplatePage (queryParams .value )
126
128
list .value = data .list
127
129
total .value = data .total
128
130
} finally {
@@ -132,7 +134,7 @@ const getList = async () => {
132
134
133
135
/** 搜索按钮操作 */
134
136
const handleQuery = () => {
135
- queryParams .pageNo = 1
137
+ queryParams .value . pageNo = 1
136
138
getList ()
137
139
}
138
140
@@ -154,9 +156,4 @@ const handleSendCoupon = async (templateId: number) => {
154
156
sendLoading .value = false
155
157
}
156
158
}
157
-
158
- /** 初始化 **/
159
- // onMounted(async () => {
160
- // await getList()
161
- // })
162
159
</script >
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ const queryParams = reactive({
122
122
pageNo: 1 ,
123
123
pageSize: 10 ,
124
124
createTime: [],
125
- status: undefined
125
+ status: undefined ,
126
+ nickname: undefined
126
127
})
127
128
const queryFormRef = ref () // 搜索的表单
128
129
You can’t perform that action at this time.
0 commit comments