4242 </el-col >
4343 <el-col :span =" 24" >
4444 <el-form-item label =" 活动优先级" >
45- <!-- TODO @puhui999:这个目前先写死;主要是,这个优惠类型不好用 promotion_type_enum;因为优惠劵、会员折扣都算。 -->
4645 <ActivityOrdersSort
4746 v-model:activity-orders =" formData.activityOrders"
4847 :promotion-types =" promotionTypes"
4948 />
5049 </el-form-item >
5150 </el-col >
52- <el-col :span =" 24" >
53- <el-form-item label =" 赠送优惠劵" >
54- <el-tag
55- v-for =" coupon in formData.giveCouponTemplates"
56- :key =" coupon.id as number"
57- class =" mr-[10px]"
58- >
59- {{ coupon.name }}
60- </el-tag >
61- <el-button @click =" openCouponSelect" >选择优惠券</el-button >
62- </el-form-item >
63- </el-col >
6451 </el-row >
6552 </el-form >
6653
9178 {{ promotionTypes.find((item) => item.value === activityType)?.label }}
9279 </el-tag >
9380 </template >
94- <template #giveCouponTemplates =" { row } " >
95- <el-tag
96- v-for =" coupon in row.giveCouponTemplates"
97- :key =" coupon.id as number"
98- class =" mr-[10px]"
99- >
100- {{ coupon.name }}
101- </el-tag >
102- </template >
10381 </Descriptions >
104- <CouponSelect ref =" couponSelectRef" v-model:multiple-selection =" formData.giveCouponTemplates" />
10582</template >
10683<script lang="ts" setup>
10784import type { Spu } from ' @/api/mall/product/spu'
10885import { PropType } from ' vue'
10986import { propTypes } from ' @/utils/propTypes'
11087import { copyValueToTarget } from ' @/utils'
11188import { otherSettingsSchema } from ' ./spu.data'
112- import { DICT_TYPE , DictDataType , getIntDictOptions } from ' @/utils/dict'
113- import CouponSelect from ' ./CouponSelect.vue'
89+ import { DICT_TYPE , DictDataType } from ' @/utils/dict'
11490import ActivityOrdersSort from ' ./ActivityOrdersSort.vue'
11591
11692defineOptions ({ name: ' OtherSettingsForm' })
@@ -128,14 +104,66 @@ const props = defineProps({
128104 isDetail: propTypes .bool .def (false ) // 是否作为详情组件
129105})
130106
131- // 优惠卷
132- const couponSelectRef = ref () // 优惠卷模版选择 Ref
133- const openCouponSelect = () => {
134- couponSelectRef .value ?.open ()
135- }
136-
107+ // TODO @puhui999:这个目前先写死;主要是,这个优惠类型不好用 promotion_type_enum;因为优惠劵、会员折扣都算
137108// 活动优先级处理
138- const promotionTypes = ref <DictDataType []>(getIntDictOptions (DICT_TYPE .PROMOTION_TYPE_ENUM ))
109+ const promotionTypes = ref <DictDataType []>([
110+ {
111+ dictType: ' promotionTypes' ,
112+ label: ' 秒杀活动' ,
113+ value: 1 ,
114+ colorType: ' warning' ,
115+ cssClass: ' '
116+ },
117+ {
118+ dictType: ' promotionTypes' ,
119+ label: ' 砍价活动' ,
120+ value: 2 ,
121+ colorType: ' warning' ,
122+ cssClass: ' '
123+ },
124+ {
125+ dictType: ' promotionTypes' ,
126+ label: ' 拼团活动' ,
127+ value: 3 ,
128+ colorType: ' warning' ,
129+ cssClass: ' '
130+ },
131+ {
132+ dictType: ' promotionTypes' ,
133+ label: ' 限时折扣' ,
134+ value: 4 ,
135+ colorType: ' warning' ,
136+ cssClass: ' '
137+ },
138+ {
139+ dictType: ' promotionTypes' ,
140+ label: ' 满减送' ,
141+ value: 5 ,
142+ colorType: ' warning' ,
143+ cssClass: ' '
144+ },
145+ {
146+ dictType: ' promotionTypes' ,
147+ label: ' 会员折扣' ,
148+ value: 6 ,
149+ colorType: ' warning' ,
150+ cssClass: ' '
151+ },
152+ {
153+ dictType: ' promotionTypes' ,
154+ label: ' 优惠劵' ,
155+ value: 7 ,
156+ colorType: ' warning' ,
157+ cssClass: ' '
158+ },
159+ {
160+ dictType: ' promotionTypes' ,
161+ label: ' 积分' ,
162+ value: 8 ,
163+ colorType: ' warning' ,
164+ cssClass: ' '
165+ }
166+ ])
139167
140168const otherSettingsFormRef = ref () // 表单Ref
141169// 表单数据
@@ -148,8 +176,7 @@ const formData = ref<Spu>({
148176 recommendBest: false , // 是否精品
149177 recommendNew: false , // 是否新品
150178 recommendGood: false , // 是否优品
151- activityOrders: [], // 活动排序
152- giveCouponTemplates: [] // 赠送的优惠券
179+ activityOrders: [] // 活动排序
153180})
154181// 表单规则
155182const rules = reactive ({
0 commit comments