修复砍价秒杀拼团数值不能连续添加的问题
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
|
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="选择商品:" prop="good">
|
<el-form-item label="选择商品:" prop="good">
|
||||||
<cgood v-model="form1.good":disabled="true" ></cgood>
|
<cgood v-model="form1.good" :disabled="true" ></cgood>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-form-item label="砍价名称">
|
<el-form-item label="砍价名称">
|
||||||
@ -121,6 +121,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
|
//that.form.minPrice = 0
|
||||||
|
//that.form.num = 1
|
||||||
|
//that.form.bargainMaxPrice = 0
|
||||||
|
//that.form.bargainMinPrice = 0
|
||||||
|
//that.form.bargainNum = 1
|
||||||
id: '',
|
id: '',
|
||||||
productId: '',
|
productId: '',
|
||||||
title: '',
|
title: '',
|
||||||
@ -135,11 +140,11 @@ export default {
|
|||||||
stopTime: '',
|
stopTime: '',
|
||||||
storeName: '',
|
storeName: '',
|
||||||
price: '',
|
price: '',
|
||||||
minPrice: '',
|
minPrice: 0,
|
||||||
num: '',
|
num: 1,
|
||||||
bargainMaxPrice: '',
|
bargainMaxPrice: 0,
|
||||||
bargainMinPrice: '',
|
bargainMinPrice: 0,
|
||||||
bargainNum: '',
|
bargainNum: 1,
|
||||||
status: 1,
|
status: 1,
|
||||||
description: '',
|
description: '',
|
||||||
giveIntegral: '',
|
giveIntegral: '',
|
||||||
@ -164,12 +169,13 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'form.imageArr': function(val) {
|
'form.imageArr': function(val) {
|
||||||
if (val) {
|
if (val && Array.isArray(val)) {
|
||||||
this.form.image = val.join(',')
|
this.form.image = val.join(',')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'form.sliderImageArr': function(val) {
|
'form.sliderImageArr': function(val) {
|
||||||
if (val) {
|
console.log("aaa:"+val)
|
||||||
|
if (val && Array.isArray(val)) {
|
||||||
this.form.images = val.join(',')
|
this.form.images = val.join(',')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -186,10 +192,13 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
getInfo(id).then(async res => {
|
getInfo(id).then(async res => {
|
||||||
let data = res.productInfo;
|
let data = res.productInfo;
|
||||||
console.log('data:'+data)
|
console.info('data:'+JSON.stringify(data))
|
||||||
if(data){
|
if(data){
|
||||||
let cate_id = parseInt(data.cate_id) || 0;
|
let cate_id = parseInt(data.cate_id) || 0;
|
||||||
that.form = data;
|
//that.form = data;
|
||||||
|
Object.keys(that.form).forEach(key=>{
|
||||||
|
if(data[key]) that.form[key] = data[key];
|
||||||
|
})
|
||||||
that.form.productId = data.id
|
that.form.productId = data.id
|
||||||
that.form.cate_id = cate_id;
|
that.form.cate_id = cate_id;
|
||||||
that.form.title = data.store_name
|
that.form.title = data.store_name
|
||||||
@ -198,11 +207,11 @@ export default {
|
|||||||
that.form.imageArr = data.image
|
that.form.imageArr = data.image
|
||||||
that.form.sliderImageArr = data.slider_image
|
that.form.sliderImageArr = data.slider_image
|
||||||
that.form.status = 1
|
that.form.status = 1
|
||||||
that.form.minPrice = 0
|
//that.form.minPrice = 0
|
||||||
that.form.num = 1
|
//that.form.num = 1
|
||||||
that.form.bargainMaxPrice = 0
|
//that.form.bargainMaxPrice = 0
|
||||||
that.form.bargainMinPrice = 0
|
//that.form.bargainMinPrice = 0
|
||||||
that.form.bargainNum = 1
|
//that.form.bargainNum = 1
|
||||||
|
|
||||||
}
|
}
|
||||||
that.templateList = res.tempList;
|
that.templateList = res.tempList;
|
||||||
|
|||||||
@ -69,7 +69,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="拼团人数" prop="people">
|
<el-form-item label="拼团人数" prop="people">
|
||||||
<el-input-number v-model="formValidate.people" />
|
<el-input-number :min="1" :max="99" v-model="formValidate.people" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
@ -258,10 +258,10 @@ export default {
|
|||||||
sliderImageArr: [],
|
sliderImageArr: [],
|
||||||
title: '',
|
title: '',
|
||||||
attr: '',
|
attr: '',
|
||||||
people: '1',
|
people: 1,
|
||||||
info: '',
|
info: '',
|
||||||
price: '',
|
price: '',
|
||||||
sort: '',
|
sort: 0,
|
||||||
sales: '',
|
sales: '',
|
||||||
stock: '',
|
stock: '',
|
||||||
addTime: '',
|
addTime: '',
|
||||||
@ -274,7 +274,7 @@ export default {
|
|||||||
description: '',
|
description: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
stopTime: '',
|
stopTime: '',
|
||||||
effectiveTime: '',
|
effectiveTime: 1,
|
||||||
cost: '',
|
cost: '',
|
||||||
unitName: '',
|
unitName: '',
|
||||||
combination: 1,
|
combination: 1,
|
||||||
@ -376,7 +376,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
|
|
||||||
'formValidate.slider_image': function(val) {
|
'formValidate.slider_image': function(val) {
|
||||||
if (val) {
|
if (val && Array.isArray(val)) {
|
||||||
this.formValidate.images = val.join(',')
|
this.formValidate.images = val.join(',')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -510,15 +510,18 @@ export default {
|
|||||||
let data = res.productInfo;
|
let data = res.productInfo;
|
||||||
if(data){
|
if(data){
|
||||||
that.attrs = data.items || [];
|
that.attrs = data.items || [];
|
||||||
that.formValidate = data;
|
//that.formValidate = data;
|
||||||
|
Object.keys(that.formValidate).forEach(key=>{
|
||||||
|
if(data[key]) that.formValidate[key] = data[key];
|
||||||
|
})
|
||||||
that.formValidate.id = 0;
|
that.formValidate.id = 0;
|
||||||
that.formValidate.productId = id
|
that.formValidate.productId = id
|
||||||
that.formValidate.title = data.store_name
|
that.formValidate.title = data.store_name
|
||||||
that.formValidate.info = data.store_info
|
that.formValidate.info = data.store_info
|
||||||
that.formValidate.unitName = data.unit_name
|
that.formValidate.unitName = data.unit_name
|
||||||
that.formValidate.isShow = 1
|
that.formValidate.isShow = 1
|
||||||
that.formValidate.people = 1
|
// that.formValidate.people = 0
|
||||||
that.formValidate.effectiveTime = 1
|
// that.formValidate.effectiveTime = 0
|
||||||
that.oneFormValidate = [data.attr];
|
that.oneFormValidate = [data.attr];
|
||||||
that.formValidate.header = [];
|
that.formValidate.header = [];
|
||||||
that.generate(null);
|
that.generate(null);
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="产品轮播图">
|
<el-form-item label="产品轮播图">
|
||||||
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -252,10 +252,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
formValidate: {
|
formValidate: {
|
||||||
|
slider_image: [],
|
||||||
otPrice: '',
|
otPrice: '',
|
||||||
giveIntegral: '',
|
giveIntegral: '',
|
||||||
status: '',
|
status: '',
|
||||||
num: '',
|
num: 1,
|
||||||
id: 0,
|
id: 0,
|
||||||
timeId: null,
|
timeId: null,
|
||||||
seckillId: 0,
|
seckillId: 0,
|
||||||
@ -270,7 +271,7 @@ export default {
|
|||||||
people: '',
|
people: '',
|
||||||
info: '',
|
info: '',
|
||||||
price: '',
|
price: '',
|
||||||
sort: '',
|
sort: 0,
|
||||||
sales: '',
|
sales: '',
|
||||||
stock: '',
|
stock: '',
|
||||||
addTime: '',
|
addTime: '',
|
||||||
@ -279,7 +280,7 @@ export default {
|
|||||||
isDel: 0,
|
isDel: 0,
|
||||||
merUse: '',
|
merUse: '',
|
||||||
isPostage: '',
|
isPostage: '',
|
||||||
postage: '',
|
postage: 0,
|
||||||
description: '',
|
description: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
stopTime: '',
|
stopTime: '',
|
||||||
@ -377,7 +378,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
|
|
||||||
'formValidate.slider_image': function(val) {
|
'formValidate.slider_image': function(val) {
|
||||||
if (val) {
|
if (val && Array.isArray(val)) {
|
||||||
this.formValidate.images = val.join(',')
|
this.formValidate.images = val.join(',')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -515,7 +516,10 @@ export default {
|
|||||||
if(data){
|
if(data){
|
||||||
let cate_id = parseInt(data.cate_id) || 0;
|
let cate_id = parseInt(data.cate_id) || 0;
|
||||||
that.attrs = data.items || [];
|
that.attrs = data.items || [];
|
||||||
that.formValidate = data;
|
//that.formValidate = data;
|
||||||
|
Object.keys(that.formValidate).forEach(key=>{
|
||||||
|
if(data[key]) that.formValidate[key] = data[key];
|
||||||
|
})
|
||||||
that.formValidate.id = 0;
|
that.formValidate.id = 0;
|
||||||
that.formValidate.productId = id
|
that.formValidate.productId = id
|
||||||
that.formValidate.cate_id = cate_id;
|
that.formValidate.cate_id = cate_id;
|
||||||
@ -523,9 +527,9 @@ export default {
|
|||||||
that.formValidate.title = data.store_name
|
that.formValidate.title = data.store_name
|
||||||
that.formValidate.info = data.store_info
|
that.formValidate.info = data.store_info
|
||||||
that.formValidate.unitName = data.unit_name
|
that.formValidate.unitName = data.unit_name
|
||||||
that.formValidate.sliderImageArr = data.slider_image
|
//that.formValidate.sliderImageArr = data.slider_image
|
||||||
that.formValidate.status = 1
|
that.formValidate.status = 1
|
||||||
that.formValidate.num = 1
|
//that.formValidate.num = 1
|
||||||
that.formValidate.header = [];
|
that.formValidate.header = [];
|
||||||
that.generate(null);
|
that.generate(null);
|
||||||
that.manyFormValidate = data.attrs;
|
that.manyFormValidate = data.attrs;
|
||||||
|
|||||||
Reference in New Issue
Block a user