Merge remote-tracking branch 'yudao/dev' into dev-crm

pull/555/head
puhui999 2024-09-22 23:29:41 +08:00
commit a45c8e6d2d
12 changed files with 54 additions and 17 deletions

View File

@ -87,7 +87,7 @@
"source.fixAll.stylelint": "explicit" "source.fixAll.stylelint": "explicit"
}, },
"[vue]": { "[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"i18n-ally.localesPaths": ["src/locales"], "i18n-ally.localesPaths": ["src/locales"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",

View File

@ -47,12 +47,12 @@ export const getReward = async (id: number) => {
return await request.get({ url: '/promotion/reward-activity/get?id=' + id }) return await request.get({ url: '/promotion/reward-activity/get?id=' + id })
} }
// 关闭拼团活动 // 删除满减送活动
export const closeRewardActivity = async (id: number) => {
return await request.put({ url: '/promotion/reward-activity/close?id=' + id })
}
// 删除限时折扣活动
export const deleteRewardActivity = async (id: number) => { export const deleteRewardActivity = async (id: number) => {
return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id })
} }
// 关闭满减送活动
export const closeRewardActivity = async (id: number) => {
return await request.put({ url: '/promotion/reward-activity/close?id=' + id })
}

View File

@ -67,7 +67,7 @@
class="text-16px" class="text-16px"
:style="{ color: property.fields.price.color }" :style="{ color: property.fields.price.color }"
> >
{{ fenToYuan(spu.price) }} {{ fenToYuan(spu.price as any) }}
</span> </span>
<!-- 市场价 --> <!-- 市场价 -->
<span <span

View File

@ -194,7 +194,6 @@ export enum DICT_TYPE {
PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型 PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型
PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态 PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态
PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式 PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态 PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态
PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态 PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态

View File

@ -45,7 +45,7 @@
:show-word-limit="true" :show-word-limit="true"
class="w-80!" class="w-80!"
maxlength="128" maxlength="128"
placeholder="请输入商品名称" placeholder="请输入商品简介"
type="textarea" type="textarea"
/> />
</el-form-item> </el-form-item>

View File

@ -116,6 +116,7 @@ import {
validityTypeFormat validityTypeFormat
} from '@/views/mall/promotion/coupon/formatter' } from '@/views/mall/promotion/coupon/formatter'
import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate' import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
import { CouponTemplateTakeTypeEnum } from '@/utils/constants'
defineOptions({ name: 'CouponSelect' }) defineOptions({ name: 'CouponSelect' })
@ -138,7 +139,7 @@ const queryParams = reactive({
pageSize: 10, pageSize: 10,
name: null, name: null,
discountType: null, discountType: null,
canTakeTypes: null canTakeTypes: [CouponTemplateTakeTypeEnum.USER.type] //
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const selectedCouponList = ref<CouponTemplateApi.CouponTemplateVO[]>([]) // const selectedCouponList = ref<CouponTemplateApi.CouponTemplateVO[]>([]) //

View File

@ -16,10 +16,14 @@ export const discountFormat = (row: CouponTemplateVO) => {
// 格式化【领取上限】 // 格式化【领取上限】
export const takeLimitCountFormat = (row: CouponTemplateVO) => { export const takeLimitCountFormat = (row: CouponTemplateVO) => {
if (row.takeLimitCount === -1) { if (row.takeLimitCount) {
return '无领取限制' if (row.takeLimitCount === -1) {
return '无领取限制'
}
return `${row.takeLimitCount} 张/人`
} else {
return ' '
} }
return `${row.takeLimitCount} 张/人`
} }
// 格式化【有效期限】 // 格式化【有效期限】

View File

@ -190,7 +190,7 @@ const submitForm = async () => {
const products = cloneDeep(spuAndSkuListRef.value.getSkuConfigs('productConfig')) const products = cloneDeep(spuAndSkuListRef.value.getSkuConfigs('productConfig'))
products.forEach((item: DiscountActivityApi.DiscountProductVO) => { products.forEach((item: DiscountActivityApi.DiscountProductVO) => {
item.discountPercent = convertToInteger(item.discountPercent) item.discountPercent = convertToInteger(item.discountPercent)
item.discountPrice = convertToInteger(item.discountPrice) item.discountPrice = convertToInteger(yuanToFen(item.discountPrice))
}) })
const data = cloneDeep(formRef.value.formModel) as DiscountActivityApi.DiscountActivityVO const data = cloneDeep(formRef.value.formModel) as DiscountActivityApi.DiscountActivityVO
data.products = products data.products = products

View File

@ -70,6 +70,17 @@ const crudSchemas = reactive<CrudSchema[]>([
width: 120 width: 120
} }
}, },
{
label: '优惠类型',
field: 'discountType',
dictType: DICT_TYPE.PROMOTION_DISCOUNT_TYPE,
dictClass: 'number',
isSearch: true,
form: {
component: 'Radio',
value: 1
}
},
{ {
label: '活动商品', label: '活动商品',
field: 'spuId', field: 'spuId',

View File

@ -119,6 +119,9 @@ const open = async (type: string, id?: number) => {
// //
data.rules?.forEach((item: any) => { data.rules?.forEach((item: any) => {
item.discountPrice = fenToYuan(item.discountPrice || 0) item.discountPrice = fenToYuan(item.discountPrice || 0)
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
item.limit = fenToYuan(item.limit || 0)
}
}) })
formData.value = data formData.value = data
// //
@ -151,6 +154,9 @@ const submitForm = async () => {
// //
data.rules.forEach((item) => { data.rules.forEach((item) => {
item.discountPrice = yuanToFen(item.discountPrice || 0) item.discountPrice = yuanToFen(item.discountPrice || 0)
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
item.limit = yuanToFen(item.limit || 0)
}
}) })
// //
setProductScopeValues(data) setProductScopeValues(data)

View File

@ -10,14 +10,25 @@
<el-form ref="formRef" :model="rule"> <el-form ref="formRef" :model="rule">
<el-form-item label="优惠门槛:" label-width="100px" prop="limit"> <el-form-item label="优惠门槛:" label-width="100px" prop="limit">
<el-input-number
v-if="PromotionConditionTypeEnum.PRICE.type === formData.conditionType"
v-model="rule.limit"
:min="0"
:precision="2"
:step="0.1"
class="w-150px! p-x-20px!"
placeholder=""
type="number"
controls-position="right"
/>
<el-input <el-input
v-else
v-model="rule.limit" v-model="rule.limit"
:min="0" :min="0"
class="w-150px! p-x-20px!" class="w-150px! p-x-20px!"
placeholder="" placeholder=""
type="number" type="number"
/> />
<!-- TODO @puhui999走字典数据 -->
{{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }} {{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }}
</el-form-item> </el-form-item>
<el-form-item label="优惠内容:" label-width="100px"> <el-form-item label="优惠内容:" label-width="100px">

View File

@ -27,7 +27,7 @@
placeholder="请选择活动状态" placeholder="请选择活动状态"
> >
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -71,6 +71,11 @@
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" default-expand-all row-key="id"> <el-table v-loading="loading" :data="list" default-expand-all row-key="id">
<el-table-column label="活动名称" prop="name" /> <el-table-column label="活动名称" prop="name" />
<el-table-column label="活动范围" prop="productScope" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.PROMOTION_PRODUCT_SCOPE" :value="scope.row.productScope" />
</template>
</el-table-column>
<el-table-column <el-table-column
:formatter="dateFormatter" :formatter="dateFormatter"
align="center" align="center"