营销活动

This commit is contained in:
13405411873 2024-09-26 15:19:59 +08:00
parent c274a7f9e1
commit 3f93dd7ade
4 changed files with 82 additions and 81 deletions

View File

@ -9,21 +9,21 @@
</el-form-item> </el-form-item>
<el-form-item label="活动时间" prop="activeTimeType"> <el-form-item label="活动时间" prop="activeTimeType">
<div class="d-s"> <div class="d-s">
<div class="icon-type" v-for="(item,index) in activityTimeTypeList" :key="index" <el-radio-group v-model="ruleForm.activeTimeType">
:class="{ 'acvtive' : index === tindex1 }" @click="Typeindex1(index)"> <el-radio :label="'0'">永久有效</el-radio>
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex1"> <el-radio :label="'1'">自定义</el-radio>
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex1"> </el-radio-group>
{{ item }}
</div>
<el-date-picker <el-date-picker
v-if="ruleForm.activeTimeType=='1'"
v-model="ruleForm.activeStartTime" v-model="ruleForm.activeStartTime"
style="width: 160px" style="width: 160px"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="开始日期"> placeholder="开始日期">
</el-date-picker> </el-date-picker>
<span style="margin: 0 5px"></span> <span v-if="ruleForm.activeTimeType=='1'" style="margin: 0 5px"></span>
<el-date-picker <el-date-picker
v-if="ruleForm.activeTimeType=='1'"
v-model="ruleForm.activeEndTime" v-model="ruleForm.activeEndTime"
style="width: 160px" style="width: 160px"
type="date" type="date"
@ -35,23 +35,21 @@
<el-form-item label="优惠类型" prop="offerType"> <el-form-item label="优惠类型" prop="offerType">
<div class="d-s"> <div class="d-s">
<div class="icon-type" v-for="(item,index) in preferentialTypeList" :key="index" <el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
:class="{ 'acvtive' : index === tindex2 }" @click="Typeindex2(index)"> <el-radio :label="'0'" >立减优惠</el-radio>
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex2"> <el-radio :label="'1'" >折扣优惠</el-radio>
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex2"> </el-radio-group>
{{ item }}
</div>
</div> </div>
<span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span> <span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span>
</el-form-item> </el-form-item>
<el-form-item label="活动类型" prop="activeType"> <el-form-item label="活动类型" prop="activeType">
<div class="d-s"> <div class="d-s">
<div class="icon-type" v-for="(item,index) in activityTypeList" :key="index" <el-radio-group v-model="ruleForm.activeType">
:class="{ 'acvtive' : index === tindex5 }" @click="Typeindex5(index)"> <el-radio :label="'0'">固定优惠</el-radio>
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex5"> <el-radio :label="'1'" v-if="ruleForm.offerType=='0'">随机满减</el-radio>
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex5"> <el-radio :label="'2'" v-if="ruleForm.offerType=='0'">每满</el-radio>
{{ item }} </el-radio-group>
</div>
</div> </div>
<div style="color: grey;font-size: 11px"> <div style="color: grey;font-size: 11px">
固定满减:订单满足规则时只优惠一次且金额固定:满100元立减5元订单金额是210元则优惠减5元 固定满减:订单满足规则时只优惠一次且金额固定:满100元立减5元订单金额是210元则优惠减5元
@ -96,27 +94,26 @@
</div> </div>
<div style="width: 50%"> <div style="width: 50%">
<el-form-item label="适用时间段" prop="timeType"> <el-form-item label="适用时间段" prop="timeType">
<div> <div style="width: 100px;margin-top: 10px">
<div class="icon-type" v-for="(item,index) in weekMonthTypeList" :key="index" <el-radio-group v-model="ruleForm.timeType">
:class="{ 'acvtive' : index === tindex3 }" @click="Typeindex3(index)"> <div style="display: flex; width: 500px;margin-bottom: 15px;">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex3"> <el-radio :label="'1'">每周</el-radio>
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex3"> <el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="ruleForm.timeType!='1'">
{{ item }} <el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
<el-checkbox-group v-model="weekDay" v-if="item=='每周'" style="margin-left: 20px" </el-checkbox-group>
:disabled="tindex3!=0"> </div>
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group> <el-radio :label="'2'">每月
<el-select v-model="monthDay" placeholder="请选择每月固定日期" multiple v-if="item=='每月'" <el-select :disabled="ruleForm.timeType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
:disabled="tindex3!=1" <el-option
style="margin-left: 20px"> v-for="item in 31"
<el-option :key="item+''"
v-for="item in 31" :label="item+'日'"
:key="item.value" :value="item+''">
:label="item+'日'" </el-option>
:value="item"> </el-select>
</el-option> </el-radio>
</el-select> </el-radio-group>
</div>
</div> </div>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<el-form-item label="时间段" prop="timeApplyStart" label-width="65px"> <el-form-item label="时间段" prop="timeApplyStart" label-width="65px">
@ -139,13 +136,11 @@
<el-form-item label="适用油品油号" prop="applyOilType"> <el-form-item label="适用油品油号" prop="applyOilType">
<div class="d-s"> <div class="d-s">
<div class="icon-type" v-for="(item,index) in oilTypeList" :key="index" <el-radio-group v-model="ruleForm.applyOilType">
:class="{ 'acvtive' : index === tindex4 }" @click="Typeindex4(index)"> <el-radio :label="'0'">不限</el-radio>
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex4"> <el-radio :label="'1'">自定义</el-radio>
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex4"> </el-radio-group>
{{ item }} <el-select v-if="ruleForm.applyOilType=='1'" v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
</div>
<el-select v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
<el-option v-for="(item,index) in oilNumberList" :key="index" <el-option v-for="(item,index) in oilNumberList" :key="index"
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option> :label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
</el-select> </el-select>
@ -347,13 +342,13 @@ export default {
data() { data() {
return { return {
ruleForm: { ruleForm: {
activeTimeType: 0, activeTimeType: '0',
paymentType: [], paymentType: [],
activeManner: [], activeManner: [],
offerType: 0, offerType: '0',
activeType: 0, activeType: '0',
timeType: 0, timeType: '0',
applyOilType: 0, applyOilType: '0',
}, },
userGradeList: [], userGradeList: [],
userLabelList: [], userLabelList: [],
@ -362,21 +357,21 @@ export default {
oilNumberList: [], oilNumberList: [],
activityTimeTypeList: ["永久有效", "自定义"], activityTimeTypeList: ["永久有效", "自定义"],
tindex1: 0, tindex1: '0',
preferentialTypeList: ["立减优惠", "折扣优惠"], preferentialTypeList: ["立减优惠", "折扣优惠"],
tindex2: 0, tindex2: '0',
weekMonthTypeList: ["每周", "每月"], weekMonthTypeList: ["每周", "每月"],
tindex3: 0, tindex3: '0',
oilTypeList: ['不限', '自定义'], oilTypeList: ['不限', '自定义'],
tindex4: 0, tindex4: '0',
activityTypeList: ['固定满减', '随机满减', '每满'], activityTypeList: ['固定满减', '随机满减', '每满'],
tindex5: 0, tindex5: '0',
weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"], weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
weekDay: [], weekDay: [],
monthDay: [], monthDay: [],
orderList: [{ orderList: [{
activeManner: 0, activeManner: '0',
full: "", full: "",
sub: "", sub: "",
randomFront: "", randomFront: "",
@ -385,7 +380,7 @@ export default {
enjoyDiscount: "", enjoyDiscount: "",
}], }],
refuelList: [{ refuelList: [{
activeManner: 1, activeManner: '0',
full: "", full: "",
sub: "", sub: "",
randomFront: "", randomFront: "",
@ -395,6 +390,12 @@ export default {
}], }],
// //
rules: { rules: {
timeType:[
{required: true, message: '适用时间段不能为空', trigger: 'blur'},
],
activeType:[
{required: true, message: '活动类型不能为空', trigger: 'blur'},
],
activeName: [ activeName: [
{required: true, message: '活动名称不能为空', trigger: 'blur'}, {required: true, message: '活动名称不能为空', trigger: 'blur'},
], ],
@ -438,6 +439,10 @@ export default {
this.getOilList() this.getOilList()
}, },
methods: { methods: {
changeOfferType(){
this.ruleForm.activeType = '0'
console.log( this.ruleForm,446)
},
getOilList() { getOilList() {
getOilNameList().then(response => { getOilNameList().then(response => {
this.oilNameList = response.data; this.oilNameList = response.data;
@ -476,9 +481,9 @@ export default {
if (res.data) { if (res.data) {
this.ruleForm = res.data this.ruleForm = res.data
if (res.data.timeSlots) { if (res.data.timeSlots) {
if (res.data.timeType == 0) { if (res.data.timeType == 1) {
this.weekDay = this.ruleForm.timeSlots.split(",") this.weekDay = this.ruleForm.timeSlots.split(",")
} else if (res.data.timeType == 1) { } else if (res.data.timeType == 2) {
this.monthDay = this.ruleForm.timeSlots.split(",") this.monthDay = this.ruleForm.timeSlots.split(",")
} }
} }
@ -491,13 +496,13 @@ export default {
if (res.data.refuelList) this.refuelList = this.ruleForm.refuelList if (res.data.refuelList) this.refuelList = this.ruleForm.refuelList
} else { } else {
this.ruleForm = { this.ruleForm = {
activeTimeType: 0, activeTimeType: '0',
paymentType: [], paymentType: [],
activeManner: [], activeManner: [],
offerType: 0, offerType: '0',
activeType: 0, activeType: '0',
timeType: 0, timeType: '0',
applyOilType: 0, applyOilType: '0',
} }
this.tindex1 = 0 this.tindex1 = 0
this.tindex2 = 0 this.tindex2 = 0
@ -714,9 +719,9 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if (this.ruleForm.timeType == 0) { if (this.ruleForm.timeType == 1) {
this.ruleForm.timeSlots = this.weekDay.toString() this.ruleForm.timeSlots = this.weekDay.toString()
} else if (this.ruleForm.timeType == 1) { } else if (this.ruleForm.timeType == 2) {
this.ruleForm.timeSlots = this.monthDay.toString() this.ruleForm.timeSlots = this.monthDay.toString()
} }
if (this.ruleForm.levelId) this.ruleForm.levelId = this.ruleForm.levelId.toString() if (this.ruleForm.levelId) this.ruleForm.levelId = this.ruleForm.levelId.toString()

View File

@ -725,9 +725,9 @@
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px"> <el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option <el-option
v-for="item in 31" v-for="item in 31"
:key="item.value" :key="item+''"
:label="item+'日'" :label="item+'日'"
:value="item"> :value="item+''">
</el-option> </el-option>
</el-select> </el-select>
</el-radio> </el-radio>
@ -763,9 +763,9 @@
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px"> <el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option <el-option
v-for="item in 31" v-for="item in 31"
:key="item.value" :key="item+''"
:label="item+'日'" :label="item+'日'"
:value="item"> :value="item+''">
</el-option> </el-option>
</el-select> </el-select>
</el-radio> </el-radio>

View File

@ -45,8 +45,10 @@ public class ActiveSubPrice extends Model<ActiveSubPrice> {
/** 活动时间类型0永久有效1自定义 */ /** 活动时间类型0永久有效1自定义 */
private String activeTimeType ; private String activeTimeType ;
/** 生效起始时间 */ /** 生效起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeStartTime ; private Date activeStartTime ;
/** 生效截止时间 */ /** 生效截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeEndTime ; private Date activeEndTime ;
/** 优惠类型0立减优惠|1活动优惠 */ /** 优惠类型0立减优惠|1活动优惠 */
private String offerType ; private String offerType ;
@ -87,4 +89,4 @@ public class ActiveSubPrice extends Model<ActiveSubPrice> {
/**加油升数列表*/ /**加油升数列表*/
@TableField(exist = false) @TableField(exist = false)
private List<ActiveSubPriceRule> refuelList; private List<ActiveSubPriceRule> refuelList;
} }

View File

@ -76,15 +76,9 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
**/ **/
@Override @Override
public boolean saveActiveSubPrice(boolean isAdd, ActiveSubPriceSaveVO saveVO) { public boolean saveActiveSubPrice(boolean isAdd, ActiveSubPriceSaveVO saveVO) {
// if (isAdd){
// ActiveSubPrice activeSubPrice = this.selectByStoreId();
// if (ObjectUtil.isNotEmpty(activeSubPrice)){
// return false;
// }
// }
ActiveSubPrice activeSubPrice = new ActiveSubPrice(); ActiveSubPrice activeSubPrice = new ActiveSubPrice();
BeanUtils.copyProperties(saveVO, activeSubPrice); BeanUtils.copyProperties(saveVO, activeSubPrice);
// 插入店铺id信息 //插入店铺id信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
activeSubPrice.setChainStorId(nowAccountInfo.getChainStoreId()); activeSubPrice.setChainStorId(nowAccountInfo.getChainStoreId());
activeSubPrice.setStoreId(nowAccountInfo.getStoreId()); activeSubPrice.setStoreId(nowAccountInfo.getStoreId());