营销活动
This commit is contained in:
parent
c274a7f9e1
commit
3f93dd7ade
@ -9,21 +9,21 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间" prop="activeTimeType">
|
||||
<div class="d-s">
|
||||
<div class="icon-type" v-for="(item,index) in activityTimeTypeList" :key="index"
|
||||
:class="{ 'acvtive' : index === tindex1 }" @click="Typeindex1(index)">
|
||||
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex1">
|
||||
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex1">
|
||||
{{ item }}
|
||||
</div>
|
||||
<el-radio-group v-model="ruleForm.activeTimeType">
|
||||
<el-radio :label="'0'">永久有效</el-radio>
|
||||
<el-radio :label="'1'">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-if="ruleForm.activeTimeType=='1'"
|
||||
v-model="ruleForm.activeStartTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
<span style="margin: 0 5px">至</span>
|
||||
<span v-if="ruleForm.activeTimeType=='1'" style="margin: 0 5px">至</span>
|
||||
<el-date-picker
|
||||
v-if="ruleForm.activeTimeType=='1'"
|
||||
v-model="ruleForm.activeEndTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
@ -35,23 +35,21 @@
|
||||
|
||||
<el-form-item label="优惠类型" prop="offerType">
|
||||
<div class="d-s">
|
||||
<div class="icon-type" v-for="(item,index) in preferentialTypeList" :key="index"
|
||||
:class="{ 'acvtive' : index === tindex2 }" @click="Typeindex2(index)">
|
||||
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex2">
|
||||
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex2">
|
||||
{{ item }}
|
||||
</div>
|
||||
<el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
|
||||
<el-radio :label="'0'" >立减优惠</el-radio>
|
||||
<el-radio :label="'1'" >折扣优惠</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<span style="color: grey;font-size: 12px">例如:立减优惠,满100立减2元;折扣优惠,满200享受95折</span>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="活动类型" prop="activeType">
|
||||
<div class="d-s">
|
||||
<div class="icon-type" v-for="(item,index) in activityTypeList" :key="index"
|
||||
:class="{ 'acvtive' : index === tindex5 }" @click="Typeindex5(index)">
|
||||
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex5">
|
||||
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex5">
|
||||
{{ item }}
|
||||
</div>
|
||||
<el-radio-group v-model="ruleForm.activeType">
|
||||
<el-radio :label="'0'">固定优惠</el-radio>
|
||||
<el-radio :label="'1'" v-if="ruleForm.offerType=='0'">随机满减</el-radio>
|
||||
<el-radio :label="'2'" v-if="ruleForm.offerType=='0'">每满</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="color: grey;font-size: 11px">
|
||||
固定满减:订单满足规则时,只优惠一次且金额固定。如:满100元立减5元,订单金额是210元,则优惠减5元。
|
||||
@ -96,27 +94,26 @@
|
||||
</div>
|
||||
<div style="width: 50%">
|
||||
<el-form-item label="适用时间段" prop="timeType">
|
||||
<div>
|
||||
<div class="icon-type" v-for="(item,index) in weekMonthTypeList" :key="index"
|
||||
:class="{ 'acvtive' : index === tindex3 }" @click="Typeindex3(index)">
|
||||
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex3">
|
||||
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex3">
|
||||
{{ item }}
|
||||
<el-checkbox-group v-model="weekDay" v-if="item=='每周'" style="margin-left: 20px"
|
||||
:disabled="tindex3!=0">
|
||||
<div style="width: 100px;margin-top: 10px">
|
||||
<el-radio-group v-model="ruleForm.timeType">
|
||||
<div style="display: flex; width: 500px;margin-bottom: 15px;">
|
||||
<el-radio :label="'1'">每周</el-radio>
|
||||
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="ruleForm.timeType!='1'">
|
||||
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-select v-model="monthDay" placeholder="请选择每月固定日期" multiple v-if="item=='每月'"
|
||||
:disabled="tindex3!=1"
|
||||
style="margin-left: 20px">
|
||||
</div>
|
||||
|
||||
<el-radio :label="'2'">每月
|
||||
<el-select :disabled="ruleForm.timeType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
|
||||
<el-option
|
||||
v-for="item in 31"
|
||||
:key="item.value"
|
||||
:key="item+''"
|
||||
:label="item+'日'"
|
||||
:value="item">
|
||||
:value="item+''">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="margin-top: 20px">
|
||||
<el-form-item label="时间段" prop="timeApplyStart" label-width="65px">
|
||||
@ -139,13 +136,11 @@
|
||||
|
||||
<el-form-item label="适用油品油号" prop="applyOilType">
|
||||
<div class="d-s">
|
||||
<div class="icon-type" v-for="(item,index) in oilTypeList" :key="index"
|
||||
:class="{ 'acvtive' : index === tindex4 }" @click="Typeindex4(index)">
|
||||
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex4">
|
||||
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex4">
|
||||
{{ item }}
|
||||
</div>
|
||||
<el-select v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
|
||||
<el-radio-group v-model="ruleForm.applyOilType">
|
||||
<el-radio :label="'0'">不限</el-radio>
|
||||
<el-radio :label="'1'">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
<el-select v-if="ruleForm.applyOilType=='1'" v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
|
||||
<el-option v-for="(item,index) in oilNumberList" :key="index"
|
||||
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
|
||||
</el-select>
|
||||
@ -347,13 +342,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {
|
||||
activeTimeType: 0,
|
||||
activeTimeType: '0',
|
||||
paymentType: [],
|
||||
activeManner: [],
|
||||
offerType: 0,
|
||||
activeType: 0,
|
||||
timeType: 0,
|
||||
applyOilType: 0,
|
||||
offerType: '0',
|
||||
activeType: '0',
|
||||
timeType: '0',
|
||||
applyOilType: '0',
|
||||
},
|
||||
userGradeList: [],
|
||||
userLabelList: [],
|
||||
@ -362,21 +357,21 @@ export default {
|
||||
oilNumberList: [],
|
||||
|
||||
activityTimeTypeList: ["永久有效", "自定义"],
|
||||
tindex1: 0,
|
||||
tindex1: '0',
|
||||
preferentialTypeList: ["立减优惠", "折扣优惠"],
|
||||
tindex2: 0,
|
||||
tindex2: '0',
|
||||
weekMonthTypeList: ["每周", "每月"],
|
||||
tindex3: 0,
|
||||
tindex3: '0',
|
||||
oilTypeList: ['不限', '自定义'],
|
||||
tindex4: 0,
|
||||
tindex4: '0',
|
||||
activityTypeList: ['固定满减', '随机满减', '每满'],
|
||||
tindex5: 0,
|
||||
tindex5: '0',
|
||||
|
||||
weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
||||
weekDay: [],
|
||||
monthDay: [],
|
||||
orderList: [{
|
||||
activeManner: 0,
|
||||
activeManner: '0',
|
||||
full: "",
|
||||
sub: "",
|
||||
randomFront: "",
|
||||
@ -385,7 +380,7 @@ export default {
|
||||
enjoyDiscount: "",
|
||||
}],
|
||||
refuelList: [{
|
||||
activeManner: 1,
|
||||
activeManner: '0',
|
||||
full: "",
|
||||
sub: "",
|
||||
randomFront: "",
|
||||
@ -395,6 +390,12 @@ export default {
|
||||
}],
|
||||
// 表单校验
|
||||
rules: {
|
||||
timeType:[
|
||||
{required: true, message: '适用时间段不能为空', trigger: 'blur'},
|
||||
],
|
||||
activeType:[
|
||||
{required: true, message: '活动类型不能为空', trigger: 'blur'},
|
||||
],
|
||||
activeName: [
|
||||
{required: true, message: '活动名称不能为空', trigger: 'blur'},
|
||||
],
|
||||
@ -438,6 +439,10 @@ export default {
|
||||
this.getOilList()
|
||||
},
|
||||
methods: {
|
||||
changeOfferType(){
|
||||
this.ruleForm.activeType = '0'
|
||||
console.log( this.ruleForm,446)
|
||||
},
|
||||
getOilList() {
|
||||
getOilNameList().then(response => {
|
||||
this.oilNameList = response.data;
|
||||
@ -476,9 +481,9 @@ export default {
|
||||
if (res.data) {
|
||||
this.ruleForm = res.data
|
||||
if (res.data.timeSlots) {
|
||||
if (res.data.timeType == 0) {
|
||||
if (res.data.timeType == 1) {
|
||||
this.weekDay = this.ruleForm.timeSlots.split(",")
|
||||
} else if (res.data.timeType == 1) {
|
||||
} else if (res.data.timeType == 2) {
|
||||
this.monthDay = this.ruleForm.timeSlots.split(",")
|
||||
}
|
||||
}
|
||||
@ -491,13 +496,13 @@ export default {
|
||||
if (res.data.refuelList) this.refuelList = this.ruleForm.refuelList
|
||||
} else {
|
||||
this.ruleForm = {
|
||||
activeTimeType: 0,
|
||||
activeTimeType: '0',
|
||||
paymentType: [],
|
||||
activeManner: [],
|
||||
offerType: 0,
|
||||
activeType: 0,
|
||||
timeType: 0,
|
||||
applyOilType: 0,
|
||||
offerType: '0',
|
||||
activeType: '0',
|
||||
timeType: '0',
|
||||
applyOilType: '0',
|
||||
}
|
||||
this.tindex1 = 0
|
||||
this.tindex2 = 0
|
||||
@ -714,9 +719,9 @@ export default {
|
||||
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.ruleForm.timeType == 0) {
|
||||
if (this.ruleForm.timeType == 1) {
|
||||
this.ruleForm.timeSlots = this.weekDay.toString()
|
||||
} else if (this.ruleForm.timeType == 1) {
|
||||
} else if (this.ruleForm.timeType == 2) {
|
||||
this.ruleForm.timeSlots = this.monthDay.toString()
|
||||
}
|
||||
if (this.ruleForm.levelId) this.ruleForm.levelId = this.ruleForm.levelId.toString()
|
||||
|
@ -725,9 +725,9 @@
|
||||
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
|
||||
<el-option
|
||||
v-for="item in 31"
|
||||
:key="item.value"
|
||||
:key="item+''"
|
||||
:label="item+'日'"
|
||||
:value="item">
|
||||
:value="item+''">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
@ -763,9 +763,9 @@
|
||||
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
|
||||
<el-option
|
||||
v-for="item in 31"
|
||||
:key="item.value"
|
||||
:key="item+''"
|
||||
:label="item+'日'"
|
||||
:value="item">
|
||||
:value="item+''">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
|
@ -45,8 +45,10 @@ public class ActiveSubPrice extends Model<ActiveSubPrice> {
|
||||
/** 活动时间类型:0永久有效;1自定义 */
|
||||
private String activeTimeType ;
|
||||
/** 生效起始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
|
||||
private Date activeStartTime ;
|
||||
/** 生效截止时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
|
||||
private Date activeEndTime ;
|
||||
/** 优惠类型(0立减优惠|1活动优惠) */
|
||||
private String offerType ;
|
||||
|
@ -76,12 +76,6 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
|
||||
**/
|
||||
@Override
|
||||
public boolean saveActiveSubPrice(boolean isAdd, ActiveSubPriceSaveVO saveVO) {
|
||||
// if (isAdd){
|
||||
// ActiveSubPrice activeSubPrice = this.selectByStoreId();
|
||||
// if (ObjectUtil.isNotEmpty(activeSubPrice)){
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
ActiveSubPrice activeSubPrice = new ActiveSubPrice();
|
||||
BeanUtils.copyProperties(saveVO, activeSubPrice);
|
||||
//插入店铺id信息
|
||||
|
Loading…
Reference in New Issue
Block a user