Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-03-11 13:12:04 +08:00
commit a389ac5d43
3 changed files with 117 additions and 9 deletions

View File

@ -192,13 +192,17 @@
<el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item>
<el-form-item label="满减规则" prop="activeDiscountChildList">
<el-form-item label="折扣规则" prop="activeDiscountChildList">
<div style="width: 100%; display: flex;align-items: center; margin-bottom: 10px " v-for="(item,index) in activeDiscountChildList" :key="index">
<div style="width: 25%;display: flex; align-items: center;margin-right: 20px " >
<span></span> <el-input-number v-model="item.amount" :min="0" :max="99999" label="0"></el-input-number> <span></span>
<span style="margin: 0 5px"></span>
<el-input-number v-model="item.amount" :min="0" :max="99999" label="0"></el-input-number>
<span style="margin: 0 5px"></span>
</div>
<div style="width: 25%;display: flex; align-items: center;">
<span></span> <el-input-number v-model="item.discount" :min="0" :max="9.9" placeholder="1 ~ 9.9" label=""></el-input-number> <span></span>
<span style="margin: 0 5px"></span>
<el-input-number v-model="item.discount" :min="0" :max="9.9" placeholder="1 ~ 9.9" label=""></el-input-number>
<span style="margin: 0 5px"></span>
</div>
<div @click="deleteactiveDiscountChildList(index)">
@ -233,7 +237,29 @@
</el-col>
</el-row>
<el-form-item label="是否有会员日" prop="memberDayType">
<el-radio-group v-model="form.memberDayType">
<el-radio label="0">无会员日</el-radio>
<el-radio label="1">指定日</el-radio>
<el-radio label="2">指定星期</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.memberDayType=='1'" prop="monthDay">
<el-checkbox-group v-model="monthDay" @change="changeMonth">
<el-checkbox v-for="item in 31" :key="item" :label="item+''">{{item}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-if="form.memberDayType=='2'" prop="weekDay">
<el-checkbox-group v-model="weekDay">
<el-checkbox label="星期一">星期一</el-checkbox>
<el-checkbox label="星期二">星期二</el-checkbox>
<el-checkbox label="星期三">星期三</el-checkbox>
<el-checkbox label="星期四">星期四</el-checkbox>
<el-checkbox label="星期五">星期五</el-checkbox>
<el-checkbox label="星期六">星期六</el-checkbox>
<el-checkbox label="星期日">星期日</el-checkbox>
</el-checkbox-group>
</el-form-item>
@ -357,11 +383,12 @@ export default {
status: null,
isonline: null,
},
weekDay:[],
monthDay:[],
//
form: {
},
//
rules: {
@ -398,6 +425,9 @@ export default {
activeDiscountChildList:[
{ required: true, message: '不能为空', trigger: 'change' }
],
memberDayType:[
{ required: true, message: '不能为空', trigger: 'change' }
],
}
};
},
@ -509,9 +539,14 @@ export default {
handleAdd() {
this.reset();
this.activeDiscountChildList = [ {amount:'',discount:''}, ]
this.monthDay = []
this.weekDay = []
this.open = true;
this.title = "添加折扣营销";
},
changeMonth(val){
console.log(val,this.monthDay,111)
},
//
getName(oilNameList,ids){
let name = ""
@ -537,6 +572,16 @@ export default {
}else {
this.activeDiscountChildList = [ {amount:'',discount:''}, ]
}
if (this.form.monthDay){
this.monthDay = this.form.monthDay.split(",")
}else {
this.monthDay = []
}
if (this.form.weekDay){
this.weekDay = this.form.weekDay.split(",")
}else {
this.weekDay = []
}
this.open = true;
this.title = "修改折扣营销";
});
@ -602,6 +647,8 @@ export default {
this.form.activeDiscountChildList = this.activeDiscountChildList
this.$refs["form"].validate(valid => {
if (valid) {
this.form.monthDay = this.monthDay.toString()
this.form.weekDay = this.weekDay.toString()
if (this.form.id != null) {
updateActiveDiscount(this.form).then(response => {
this.$modal.msgSuccess("修改成功");

View File

@ -183,10 +183,14 @@
<el-form-item label="满减规则" prop="activeDiscountChildList">
<div style="width: 100%; display: flex;align-items: center; margin-bottom: 10px " v-for="(item,index) in activeDiscountChildList" :key="index">
<div style="width: 25%;display: flex; align-items: center;margin-right: 20px " >
<span></span> <el-input-number v-model="item.amount" :min="0" :max="99999" label="0"></el-input-number> <span></span>
<span style="margin: 0 5px"></span>
<el-input-number v-model="item.amount" :min="0" :max="99999" label="0"></el-input-number>
<span style="margin: 0 5px"></span>
</div>
<div style="width: 25%;display: flex; align-items: center;">
<span></span> <el-input-number v-model="item.deductionAmount" :min="0" :max="item.amount||0" label=""></el-input-number> <span></span>
<span style="margin: 0 5px"></span>
<el-input-number v-model="item.deductionAmount" :min="0" :max="item.amount||0" label=""></el-input-number>
<span style="margin: 0 5px"></span>
</div>
<div @click="deleteactiveDiscountChildList(index)">
<el-button type="danger" icon="el-icon-delete" circle style="margin-left: 8px" ></el-button>
@ -220,6 +224,31 @@
</el-col>
</el-row>
<el-form-item label="是否有会员日" prop="memberDayType">
<el-radio-group v-model="form.memberDayType">
<el-radio label="0">无会员日</el-radio>
<el-radio label="1">指定日</el-radio>
<el-radio label="2">指定星期</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.memberDayType=='1'" prop="monthDay">
<el-checkbox-group v-model="monthDay">
<el-checkbox v-for="item in 31" :key="item" :label="item+''">{{item}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-if="form.memberDayType=='2'" prop="weekDay">
<el-checkbox-group v-model="weekDay">
<el-checkbox label="星期一">星期一</el-checkbox>
<el-checkbox label="星期二">星期二</el-checkbox>
<el-checkbox label="星期三">星期三</el-checkbox>
<el-checkbox label="星期四">星期四</el-checkbox>
<el-checkbox label="星期五">星期五</el-checkbox>
<el-checkbox label="星期六">星期六</el-checkbox>
<el-checkbox label="星期日">星期日</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
@ -336,6 +365,8 @@ export default {
status: null,
isonline: null,
},
weekDay:[],
monthDay:[],
//
form: {},
//
@ -361,6 +392,9 @@ export default {
naturalUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
memberDayType:[
{ required: true, message: '不能为空', trigger: 'change' }
],
participationCondition:[
{ required: true, message: '不能为空', trigger: 'change' }
],
@ -393,7 +427,6 @@ export default {
},
getoilName(){
getoilName().then(res=>{
console.log(res)
this.oillist = res.data
})
@ -478,6 +511,8 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.monthDay = []
this.weekDay = []
this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ]
this.open = true;
this.title = "添加满减营销";
@ -500,13 +535,22 @@ export default {
this.reset();
const id = row.id || this.ids
getActiveFullminus(id).then(response => {
console.log(response)
this.form = response.data;
if (response.data.activeDiscountChildList && response.data.activeDiscountChildList.length>0){
this.activeDiscountChildList = response.data.activeDiscountChildList
}else {
this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ]
}
if (response.data.monthDay){
this.monthDay = response.data.monthDay.split(",")
}else {
this.monthDay = []
}
if (response.data.weekDay){
this.weekDay = response.data.weekDay.split(",")
}else {
this.weekDay = []
}
this.open = true;
this.title = "修改满减营销";
});
@ -570,6 +614,8 @@ export default {
this.form.activeDiscountChildList = this.activeDiscountChildList
this.$refs["form"].validate(valid => {
if (valid) {
this.form.monthDay = this.monthDay.toString()
this.form.weekDay = this.weekDay.toString()
if (this.form.id != null) {
updateActiveFullminus(this.form).then(response => {
this.$modal.msgSuccess("修改成功");

View File

@ -279,6 +279,13 @@
<el-radio label="2">会员等级</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="会员等级" prop="region" v-if="form.exclusiveFunction == '2' " >
<el-select v-model="form.membershipLevel" multiple placeholder="会员等级" >
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.id.toString()"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领取规则 " prop="claimRule">
<el-radio-group v-model="form.claimRule">
<el-radio label="0">每人限领一张</el-radio>
@ -386,6 +393,7 @@
import { listFavorable, getFavorable,getcardFavorable,getcount,getcountList, delFavorable, addFavorable, updateFavorable } from "@/api/EventMarketing/cardFavorable";
import { getoilName, } from "@/api/EventMarketing/activeConsumption";
import {deleteById} from "@/api/EventMarketing/oilBlock";
import {listUserGrade} from "@/api/EventMarketing/SaveBlock";
export default {
name: "Favorable",
data() {
@ -476,6 +484,7 @@ export default {
},
//
form: {},
vipname:[],
//
rules: {
timeType: [
@ -665,12 +674,18 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
listUserGrade().then(res=>{
this.vipname = res.data.records
})
this.open = true;
this.title = "添加优惠券";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
listUserGrade().then(res=>{
this.vipname = res.data.records
})
getcardFavorable(row.id).then(res=>{
console.log(res)
if(res.code == 200){