Skip to content

Commit 523784c

Browse files
YunaiVgitee-org
authored andcommitted
!264 营销活动:添加拼团记录
Merge pull request !264 from puhui999/dev-to-dev
2 parents 24fc36e + 5b4983a commit 523784c

File tree

8 files changed

+382
-29
lines changed

8 files changed

+382
-29
lines changed

src/api/mall/product/spu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export interface Sku {
2020
stock?: number // 库存
2121
weight?: number // 商品重量,单位:kg 千克
2222
volume?: number // 商品体积,单位:m^3 平米
23-
firstBrokerageRecord?: number | string // 一级分销的佣金
24-
secondBrokerageRecord?: number | string // 二级分销的佣金
23+
firstBrokeragePrice?: number | string // 一级分销的佣金
24+
secondBrokeragePrice?: number | string // 二级分销的佣金
2525
salesCount?: number // 商品销量
2626
}
2727

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import request from '@/config/axios'
2+
3+
export interface CombinationRecordVO {
4+
id: number // 拼团记录编号
5+
activityId: number // 拼团活动编号
6+
nickname: string // 用户昵称
7+
avatar: string // 用户头像
8+
headId: number // 团长编号
9+
expireTime: string // 过期时间
10+
userSize: number // 可参团人数
11+
userCount: number // 已参团人数
12+
status: number // 拼团状态
13+
spuName: string // 商品名字
14+
picUrl: string // 商品图片
15+
virtualGroup: boolean // 是否虚拟成团
16+
startTime: string // 开始时间 (订单付款后开始的时间)
17+
endTime: string // 结束时间(成团时间/失败时间)
18+
}
19+
20+
// 查询拼团记录列表
21+
export const getCombinationRecordPage = async (params) => {
22+
return await request.get({ url: '/promotion/combination-record/page', params })
23+
}
24+
25+
// 获得拼团记录的概要信息
26+
export const getCombinationRecordSummary = async () => {
27+
return await request.get({ url: '/promotion/combination-record/get-summary' })
28+
}
29+
30+
// 获得拼团记录分页 tab count
31+
export const getCombinationRecordCount = async () => {
32+
return await request.get({ url: '/promotion/combination-record/get-count' })
33+
}

src/utils/dict.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const getDictOptions = (dictType: string) => {
2424
return dictStore.getDictByType(dictType) || []
2525
}
2626

27-
export const getIntDictOptions = (dictType: string) => {
27+
export const getIntDictOptions = (dictType: string): DictDataType[] => {
2828
const dictOption: DictDataType[] = []
2929
const dictOptions: DictDataType[] = getDictOptions(dictType)
3030
dictOptions.forEach((dict: DictDataType) => {
@@ -181,5 +181,6 @@ export enum DICT_TYPE {
181181
PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
182182
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
183183
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
184-
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status' // 砍价记录的状态
184+
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态
185+
PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status' // 拼团记录的状态
185186
}

src/views/mall/product/spu/components/SkuList.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<el-table-column align="center" label="一级返佣(元)" min-width="168">
8181
<template #default="{ row }">
8282
<el-input-number
83-
v-model="row.firstBrokerageRecord"
83+
v-model="row.firstBrokeragePrice"
8484
:min="0"
8585
:precision="2"
8686
:step="0.1"
@@ -91,7 +91,7 @@
9191
<el-table-column align="center" label="二级返佣(元)" min-width="168">
9292
<template #default="{ row }">
9393
<el-input-number
94-
v-model="row.secondBrokerageRecord"
94+
v-model="row.secondBrokeragePrice"
9595
:min="0"
9696
:precision="2"
9797
:step="0.1"
@@ -181,12 +181,12 @@
181181
<template v-if="formData!.subCommissionType">
182182
<el-table-column align="center" label="一级返佣(元)" min-width="80">
183183
<template #default="{ row }">
184-
{{ row.firstBrokerageRecord }}
184+
{{ row.firstBrokeragePrice }}
185185
</template>
186186
</el-table-column>
187187
<el-table-column align="center" label="二级返佣(元)" min-width="80">
188188
<template #default="{ row }">
189-
{{ row.secondBrokerageRecord }}
189+
{{ row.secondBrokeragePrice }}
190190
</template>
191191
</el-table-column>
192192
</template>
@@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([
295295
stock: 0, // 库存
296296
weight: 0, // 商品重量
297297
volume: 0, // 商品体积
298-
firstBrokerageRecord: 0, // 一级分销的佣金
299-
secondBrokerageRecord: 0 // 二级分销的佣金
298+
firstBrokeragePrice: 0, // 一级分销的佣金
299+
secondBrokeragePrice: 0 // 二级分销的佣金
300300
}
301301
]) // 批量添加时的临时数据
302302
@@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => {
415415
stock: 0,
416416
weight: 0,
417417
volume: 0,
418-
firstBrokerageRecord: 0,
419-
secondBrokerageRecord: 0
418+
firstBrokeragePrice: 0,
419+
secondBrokeragePrice: 0
420420
}
421421
// 如果存在属性相同的 sku 则不做处理
422422
const index = formData.value!.skus!.findIndex(
@@ -491,8 +491,8 @@ watch(
491491
stock: 0,
492492
weight: 0,
493493
volume: 0,
494-
firstBrokerageRecord: 0,
495-
secondBrokerageRecord: 0
494+
firstBrokeragePrice: 0,
495+
secondBrokeragePrice: 0
496496
}
497497
]
498498
}

src/views/mall/product/spu/form/BasicInfoForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ defineExpose({ validate })
329329
const changeSubCommissionType = () => {
330330
// 默认为零,类型切换后也要重置为零
331331
for (const item of formData.skus) {
332-
item.firstBrokerageRecord = 0
333-
item.secondBrokerageRecord = 0
332+
item.firstBrokeragePrice = 0
333+
item.secondBrokeragePrice = 0
334334
}
335335
}
336336
@@ -349,8 +349,8 @@ const onChangeSpec = () => {
349349
stock: 0,
350350
weight: 0,
351351
volume: 0,
352-
firstBrokerageRecord: 0,
353-
secondBrokerageRecord: 0
352+
firstBrokeragePrice: 0,
353+
secondBrokeragePrice: 0
354354
}
355355
]
356356
}

src/views/mall/product/spu/form/index.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({
8282
stock: 0, // 库存
8383
weight: 0, // 商品重量
8484
volume: 0, // 商品体积
85-
firstBrokerageRecord: 0, // 一级分销的佣金
86-
secondBrokerageRecord: 0 // 二级分销的佣金
85+
firstBrokeragePrice: 0, // 一级分销的佣金
86+
secondBrokeragePrice: 0 // 二级分销的佣金
8787
}
8888
],
8989
description: '', // 商品详情
@@ -112,15 +112,15 @@ const getDetail = async () => {
112112
item.price = floatToFixed2(item.price)
113113
item.marketPrice = floatToFixed2(item.marketPrice)
114114
item.costPrice = floatToFixed2(item.costPrice)
115-
item.firstBrokerageRecord = floatToFixed2(item.firstBrokerageRecord)
116-
item.secondBrokerageRecord = floatToFixed2(item.secondBrokerageRecord)
115+
item.firstBrokeragePrice = floatToFixed2(item.firstBrokeragePrice)
116+
item.secondBrokeragePrice = floatToFixed2(item.secondBrokeragePrice)
117117
} else {
118118
// 回显价格分转元
119119
item.price = formatToFraction(item.price)
120120
item.marketPrice = formatToFraction(item.marketPrice)
121121
item.costPrice = formatToFraction(item.costPrice)
122-
item.firstBrokerageRecord = formatToFraction(item.firstBrokerageRecord)
123-
item.secondBrokerageRecord = formatToFraction(item.secondBrokerageRecord)
122+
item.firstBrokeragePrice = formatToFraction(item.firstBrokeragePrice)
123+
item.secondBrokeragePrice = formatToFraction(item.secondBrokeragePrice)
124124
}
125125
})
126126
formData.value = res
@@ -149,8 +149,8 @@ const submitForm = async () => {
149149
item.price = convertToInteger(item.price)
150150
item.marketPrice = convertToInteger(item.marketPrice)
151151
item.costPrice = convertToInteger(item.costPrice)
152-
item.firstBrokerageRecord = convertToInteger(item.firstBrokerageRecord)
153-
item.secondBrokerageRecord = convertToInteger(item.secondBrokerageRecord)
152+
item.firstBrokeragePrice = convertToInteger(item.firstBrokeragePrice)
153+
item.secondBrokeragePrice = convertToInteger(item.secondBrokeragePrice)
154154
})
155155
// 处理轮播图列表
156156
const newSliderPicUrls: any[] = []

src/views/mall/promotion/combination/activity/combinationActivity.data.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const rules = reactive({
99
startTime: [required],
1010
endTime: [required],
1111
userSize: [required],
12-
limitDuration: [required]
12+
limitDuration: [required],
13+
virtualGroup: [required]
1314
})
1415

1516
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
@@ -114,6 +115,17 @@ const crudSchemas = reactive<CrudSchema[]>([
114115
value: 0
115116
}
116117
},
118+
{
119+
label: '虚拟成团',
120+
field: 'virtualGroup',
121+
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
122+
dictClass: 'boolean',
123+
isSearch: true,
124+
form: {
125+
component: 'Radio',
126+
value: false
127+
}
128+
},
117129
{
118130
label: '拼团商品',
119131
field: 'spuId',

0 commit comments

Comments
 (0)