mall:优惠券发送优化

This commit is contained in:
owen
2023-09-01 23:50:26 +08:00
parent 190c6e384c
commit 76c4644b4b
4 changed files with 25 additions and 17 deletions

View File

@ -90,6 +90,7 @@ import {
userPriceFormat,
validityTypeFormat
} from '@/views/mall/promotion/coupon/formatter'
import { CouponTemplateTakeTypeEnum } from '@/utils/constants'
defineOptions({ name: 'PromotionCouponSend' })
@ -102,7 +103,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const queryParams = ref({
pageNo: 1,
pageSize: 10,
name: null
name: null,
canTakeTypes: [CouponTemplateTakeTypeEnum.BY_ADMIN.type]
}) // 查询参数
const queryFormRef = ref() // 搜索的表单
// 领取人的编号列表
@ -122,7 +124,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const getList = async () => {
loading.value = true
try {
const data = await CouponTemplateApi.getCanTakeCouponTemplatePage(queryParams.value)
const data = await CouponTemplateApi.getCouponTemplatePage(queryParams.value)
list.value = data.list
total.value = data.total
} finally {
@ -132,7 +134,7 @@ const getList = async () => {
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
queryParams.value.pageNo = 1
getList()
}
@ -154,9 +156,4 @@ const handleSendCoupon = async (templateId: number) => {
sendLoading.value = false
}
}
/** 初始化 **/
// onMounted(async () => {
// await getList()
// })
</script>

View File

@ -122,7 +122,8 @@ const queryParams = reactive({
pageNo: 1,
pageSize: 10,
createTime: [],
status: undefined
status: undefined,
nickname: undefined
})
const queryFormRef = ref() // 搜索的表单