mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 20:28:45 +08:00 
			
		
		
		
	@@ -73,14 +73,6 @@ export function getCouponTemplatePage(params: PageParam) {
 | 
				
			|||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 获得可用于领取的优惠劵模板分页
 | 
					 | 
				
			||||||
export function getCanTakeCouponTemplatePage(params: PageParam) {
 | 
					 | 
				
			||||||
  return request.get({
 | 
					 | 
				
			||||||
    url: '/promotion/coupon-template/can-take-page',
 | 
					 | 
				
			||||||
    params: params
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 导出优惠劵模板 Excel
 | 
					// 导出优惠劵模板 Excel
 | 
				
			||||||
export function exportCouponTemplateExcel(params: PageParam) {
 | 
					export function exportCouponTemplateExcel(params: PageParam) {
 | 
				
			||||||
  return request.get({
 | 
					  return request.get({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -209,6 +209,24 @@ export const CouponTemplateValidityTypeEnum = {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 优惠劵模板的领取方式的枚举
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const CouponTemplateTakeTypeEnum = {
 | 
				
			||||||
 | 
					  BY_USER: {
 | 
				
			||||||
 | 
					    type: 1,
 | 
				
			||||||
 | 
					    name: '直接领取'
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  BY_ADMIN: {
 | 
				
			||||||
 | 
					    type: 2,
 | 
				
			||||||
 | 
					    name: '指定发放'
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  BY_REGISTER: {
 | 
				
			||||||
 | 
					    type: 3,
 | 
				
			||||||
 | 
					    name: '新人券'
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 营销的商品范围枚举
 | 
					 * 营销的商品范围枚举
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -93,6 +93,7 @@ import {
 | 
				
			|||||||
  usePriceFormat,
 | 
					  usePriceFormat,
 | 
				
			||||||
  validityTypeFormat
 | 
					  validityTypeFormat
 | 
				
			||||||
} from '@/views/mall/promotion/coupon/formatter'
 | 
					} from '@/views/mall/promotion/coupon/formatter'
 | 
				
			||||||
 | 
					import { CouponTemplateTakeTypeEnum } from '@/utils/constants'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
defineOptions({ name: 'PromotionCouponSendForm' })
 | 
					defineOptions({ name: 'PromotionCouponSendForm' })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -105,7 +106,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
 | 
				
			|||||||
const queryParams = ref({
 | 
					const queryParams = ref({
 | 
				
			||||||
  pageNo: 1,
 | 
					  pageNo: 1,
 | 
				
			||||||
  pageSize: 10,
 | 
					  pageSize: 10,
 | 
				
			||||||
  name: null
 | 
					  name: null,
 | 
				
			||||||
 | 
					  canTakeTypes: [CouponTemplateTakeTypeEnum.BY_ADMIN.type]
 | 
				
			||||||
}) // 查询参数
 | 
					}) // 查询参数
 | 
				
			||||||
const queryFormRef = ref() // 搜索的表单
 | 
					const queryFormRef = ref() // 搜索的表单
 | 
				
			||||||
// 领取人的编号列表
 | 
					// 领取人的编号列表
 | 
				
			||||||
@@ -125,7 +127,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 | 
				
			|||||||
const getList = async () => {
 | 
					const getList = async () => {
 | 
				
			||||||
  loading.value = true
 | 
					  loading.value = true
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const data = await CouponTemplateApi.getCanTakeCouponTemplatePage(queryParams.value)
 | 
					    const data = await CouponTemplateApi.getCouponTemplatePage(queryParams.value)
 | 
				
			||||||
    list.value = data.list
 | 
					    list.value = data.list
 | 
				
			||||||
    total.value = data.total
 | 
					    total.value = data.total
 | 
				
			||||||
  } finally {
 | 
					  } finally {
 | 
				
			||||||
@@ -135,7 +137,7 @@ const getList = async () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/** 搜索按钮操作 */
 | 
					/** 搜索按钮操作 */
 | 
				
			||||||
const handleQuery = () => {
 | 
					const handleQuery = () => {
 | 
				
			||||||
  queryParams.pageNo = 1
 | 
					  queryParams.value.pageNo = 1
 | 
				
			||||||
  getList()
 | 
					  getList()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -157,9 +159,4 @@ const handleSendCoupon = async (templateId: number) => {
 | 
				
			|||||||
    sendLoading.value = false
 | 
					    sendLoading.value = false
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
/** 初始化 **/
 | 
					 | 
				
			||||||
// onMounted(async () => {
 | 
					 | 
				
			||||||
// await getList()
 | 
					 | 
				
			||||||
// })
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -122,7 +122,8 @@ const queryParams = reactive({
 | 
				
			|||||||
  pageNo: 1,
 | 
					  pageNo: 1,
 | 
				
			||||||
  pageSize: 10,
 | 
					  pageSize: 10,
 | 
				
			||||||
  createTime: [],
 | 
					  createTime: [],
 | 
				
			||||||
  status: undefined
 | 
					  status: undefined,
 | 
				
			||||||
 | 
					  nickname: undefined
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
const queryFormRef = ref() // 搜索的表单
 | 
					const queryFormRef = ref() // 搜索的表单
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user