Commit 5d3532aa by lixiaomin

修改优惠券回显

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