Commit 5cb2c7cb by lixiaomin

修改优惠券修改页面

parent 949c7129
...@@ -208,7 +208,6 @@ import {listSpu} from "@/api/system/goods"; ...@@ -208,7 +208,6 @@ import {listSpu} from "@/api/system/goods";
import {listShop,getShopAreaTree} from "@/api/system/shop"; import {listShop,getShopAreaTree} from "@/api/system/shop";
import piovince from '@/utils/piovince' import piovince from '@/utils/piovince'
export default { export default {
name: "Class",
components: { GiveCoupon}, components: { GiveCoupon},
data() { data() {
return { return {
...@@ -233,7 +232,15 @@ export default { ...@@ -233,7 +232,15 @@ export default {
}, },
// 表单参数 // 表单参数
form: { form: {
id:null,
name:null,
categoryId:null,
categoryIds:[], categoryIds:[],
userNumber:null,
times:[],
relativeTime:null,
receivableTime:null,
weekLimit:[],
goodsIds:[], goodsIds:[],
sendMsgTag:2, sendMsgTag:2,
shopIds:[], shopIds:[],
...@@ -458,12 +465,45 @@ export default { ...@@ -458,12 +465,45 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getClass(id).then((response) => {
this.form = response.data;
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
this.getShopRangeList();
this.getShopAreaTree();
getCouponDetail(row.id).then((response) => {
console.log("response",response.data);
if(response.code==200){
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.firstRadioValue=1;
}else{
this.firstRadioValue=1;
this.twoRadioValue=3;
}
if(response.data.daysLimit==0){
this.form.userNumber=2
}else if(response.data.daysLimit!=0){
this.form.userNumber=1
}
this.form.times.push(response.data.useEndTime);
this.form.times.push(response.data.useStartTime);
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[0][0]=='0'){
this.shopRange=[0];
}else{
}
}
this.form.goodsIds=goodSList;
}
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -516,6 +556,7 @@ export default { ...@@ -516,6 +556,7 @@ export default {
this.form.useStartTime=this.form.times[0]; this.form.useStartTime=this.form.times[0];
this.form.useEndTime=this.form.times[1] this.form.useEndTime=this.form.times[1]
} }
//适用下拉商品类范围
if(this.shopRange.length>0){ if(this.shopRange.length>0){
let cateList=[]; let cateList=[];
let goodSList=[]; let goodSList=[];
......
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