Commit 5d3532aa by lixiaomin

修改优惠券回显

parent 6d04ed6a
......@@ -34,8 +34,7 @@
<el-button type="primary" plain size="mini" @click="giveClick"
v-hasPermi="['coupon:coupon:add']">赠送</el-button>
</el-col>
</el-row>
</el-row>
<el-table v-loading="loading" :data="couponList">
<el-table-column label="优惠券名称" align="center" prop="name">
<template slot-scope="scope">
......@@ -246,7 +245,9 @@ export default {
shopIds:[],
area:[],
city:[],
province:[]
province:[],
userLimit:null,
daysLimit:null
},
// 表单校验
rules: {
......@@ -429,9 +430,9 @@ export default {
this.queryParams.state=null;
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.sendMsgTag=2
this.open = true;
this.title = "新增优惠券";
......@@ -465,6 +466,7 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "修改优惠券";
this.getShopRangeList();
......@@ -475,8 +477,8 @@ export default {
this.form.id=response.data.id;
this.form.name=response.data.name;
this.form.categoryId=response.data.categoryId;
this.type=response.data.type;
if(this.type=="1"){
this.type=response.data.type;
if(this.type==1){
this.liJian=response.data.priceDiscount;
if(response.data.priceLimit==0){
this.firstRadioValue=1;
......@@ -484,14 +486,14 @@ export default {
this.firstRadioValue=2;
this.priceLimit=response.data.priceLimit;
}
}else if(this.type=="2"){
}else if(this.type==2){
this.jiZhe=response.data.priceDiscount;
if(response.data.orderLimit){
this.twoRadioValue=3;
}else{
this.twoRadioValue=4;
}
}else if(this.type=="3"){
}else if(this.type==3){
this.twoRadioValue=3;
if(response.data.priceLimit==0){
this.firstRadioValue=1;
......@@ -511,15 +513,30 @@ export default {
this.form.relativeTime=response.data.relativeTime;
this.form.receivableTime=response.data.receivableTime;
this.form.weekLimit=response.data.weekLimit;
if(response.data.categoryIds.length>0){
//适用范围分品类
if(response.data.categoryIds.length>0){
if(response.data.categoryIds[0]=='0'){
this.shopRange=[0];
}else{
console.log("response.data.categoryIds",response.data.categoryIds[0]);
this.shopRange=[1,"49"]
}else{
let sr_ary = new Array();
for(let i=0;i<response.data.categoryIds.length;i++){
sr_ary.push([1,response.data.categoryIds[i]])
}
this.shopRange=sr_ary;
}
}
//适用范围商品
if(response.data.shopIds!=null){
let sh_ary = new Array();
for(let i=0;i<response.data.shopIds.length;i++){
sh_ary.push([1,response.data.shopIds[i]])
}
this.shopRange=sh_ary;
}
//省市区门店
}
......@@ -574,7 +591,6 @@ export default {
this.form.useEndTime=this.form.times[1]
}
//适用下拉商品类范围
console.log("this.shopRange",this.shopRange);
if(this.shopRange.length>0){
let cateList=[];
let goodSList=[];
......@@ -686,17 +702,25 @@ export default {
}
});
},
// reset(){
// this.form.id=null;
// this.form.name=null;
// this.form.categoryId=null;
// this.form.categoryIds=null;
// this.form.userNumber=null,
// this.form.times=null;
// this.form.relativeTime=null;
// this.form.receivableTime=null;
// this.form.weekLimit=null;
// }
reset(){
this.form.id=null;
this.form.name=null;
this.form.categoryId=null;
this.form.categoryIds=[];
this.form.userNumber=null,
this.form.times=[];
this.form.relativeTime=null;
this.form.receivableTime=null;
this.form.weekLimit=[];
this.firstRadioValue=null;
this.twoRadioValue=null;
this.jiZhe="";
this.liJian="";
this.shopRange=[];
this.form.daysLimit=null;
this.form.userLimit=null;
this.priceLimit="";
}
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment