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 @@ -93,6 +93,7 @@ import {
93
93
usePriceFormat ,
94
94
validityTypeFormat
95
95
} from ' @/views/mall/promotion/coupon/formatter'
96
+ import { CouponTemplateTakeTypeEnum } from ' @/utils/constants'
96
97
97
98
defineOptions ({ name: ' PromotionCouponSendForm' })
98
99
@@ -105,7 +106,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
105
106
const queryParams = ref ({
106
107
pageNo: 1 ,
107
108
pageSize: 10 ,
108
- name: null
109
+ name: null ,
110
+ canTakeTypes: [CouponTemplateTakeTypeEnum .BY_ADMIN .type ]
109
111
}) // 查询参数
110
112
const queryFormRef = ref () // 搜索的表单
111
113
// 领取人的编号列表
@@ -125,7 +127,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
125
127
const getList = async () => {
126
128
loading .value = true
127
129
try {
128
- const data = await CouponTemplateApi .getCanTakeCouponTemplatePage (queryParams .value )
130
+ const data = await CouponTemplateApi .getCouponTemplatePage (queryParams .value )
129
131
list .value = data .list
130
132
total .value = data .total
131
133
} finally {
@@ -135,7 +137,7 @@ const getList = async () => {
135
137
136
138
/** 搜索按钮操作 */
137
139
const handleQuery = () => {
138
- queryParams .pageNo = 1
140
+ queryParams .value . pageNo = 1
139
141
getList ()
140
142
}
141
143
@@ -157,9 +159,4 @@ const handleSendCoupon = async (templateId: number) => {
157
159
sendLoading .value = false
158
160
}
159
161
}
160
-
161
- /** 初始化 **/
162
- // onMounted(async () => {
163
- // await getList()
164
- // })
165
162
</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