add
This commit is contained in:
parent
c5a5557da8
commit
39a49b1b43
|
@ -722,7 +722,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// console.log(this.formData)
|
console.log(this.formData)
|
||||||
this.$refs.formData.validate().then(res => {
|
this.$refs.formData.validate().then(res => {
|
||||||
this.handAdd()
|
this.handAdd()
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
|
@ -768,6 +768,12 @@
|
||||||
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
|
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
|
||||||
this.isSet2()
|
this.isSet2()
|
||||||
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
|
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
|
||||||
|
if (this.formData.delivery_way.length == 1) {
|
||||||
|
this.checkboxList1 = this.checkboxList1.filter(item => {
|
||||||
|
return item.value == this.formData.delivery_free[0]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (option.product_id) {
|
if (option.product_id) {
|
||||||
this.formData.product_id = option.product_id
|
this.formData.product_id = option.product_id
|
||||||
this.mode = 'edit'
|
this.mode = 'edit'
|
||||||
|
@ -781,9 +787,18 @@
|
||||||
delete this.formData.image_list
|
delete this.formData.image_list
|
||||||
if (!this.formData.imageList) this.formData.imageList = []
|
if (!this.formData.imageList) this.formData.imageList = []
|
||||||
this.oldToNew(this.formData)
|
this.oldToNew(this.formData)
|
||||||
|
if (this.formData.delivery_free.length == 1) {
|
||||||
|
this.checkboxList1 = this.checkboxList1.filter(item => {
|
||||||
|
return item.value == this.formData.delivery_free[0]
|
||||||
|
})
|
||||||
|
}
|
||||||
console.log(this.formData, 'formDATA')
|
console.log(this.formData, 'formDATA')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log(JSON.parse(option.formData))
|
||||||
|
|
||||||
},
|
},
|
||||||
onBackPress: function(e) {
|
onBackPress: function(e) {
|
||||||
this.showlay = true
|
this.showlay = true
|
||||||
|
|
|
@ -256,13 +256,11 @@
|
||||||
uni.$u.toast(errList[0])
|
uni.$u.toast(errList[0])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(this.attrValue)
|
|
||||||
// 校验结束
|
// 校验结束
|
||||||
this.formData.attr[0].detail = []
|
this.formData.attr[0].detail = []
|
||||||
this.attrValue.forEach(item => {
|
this.attrValue.forEach(item => {
|
||||||
typeof(item.detail) == 'object' ?
|
typeof(item.detail) == 'object' ?
|
||||||
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku)
|
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku)
|
||||||
console.log(this.formData.attr)
|
|
||||||
this.formData.attr[0].detail.push(item.sku)
|
this.formData.attr[0].detail.push(item.sku)
|
||||||
})
|
})
|
||||||
this.formData.attrValue = this.attrValue
|
this.formData.attrValue = this.attrValue
|
||||||
|
@ -270,11 +268,7 @@
|
||||||
item.is_use = item.is_use ? '0' : '1'
|
item.is_use = item.is_use ? '0' : '1'
|
||||||
})
|
})
|
||||||
let that = this
|
let that = this
|
||||||
// this.formData.attrValue.forEach((item, index) => {
|
console.log(this.formData.attrValue)
|
||||||
// item.detail.规格名 = this.formData.attr[index].value
|
|
||||||
// item.sku = this.formData.attr[index].value
|
|
||||||
|
|
||||||
// })
|
|
||||||
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
|
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
|
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
|
||||||
|
@ -302,7 +296,6 @@
|
||||||
detail: [],
|
detail: [],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(this.formData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue