Commit fb7c550c by cwq0219

商品-价格

1 parent 2d0a211e
......@@ -319,7 +319,7 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs.editProRef1.validateField(targetItem.name)
this.$refs.editFormRef.$refs.editProRef0.validateField(targetItem.name)
})
}
},
......@@ -339,7 +339,7 @@ export default {
resType: 1,
bizType: 1
})
this.$refs.editFormRef.$refs.editProRef1.validateField(targetItem.name)
this.$refs.editFormRef.$refs.editProRef0.validateField(targetItem.name)
})
}
},
......@@ -808,7 +808,6 @@ export default {
goodsVideo: res.goodsVideo || '',
classifyIdList: res.classifyList.map(item => item.id),
originalPrice: (res.originalPrice / 100).toFixed(2),
// retailPrice: res.retailPrice ? (res.retailPrice / 100).toFixed(2) : '',
retailPrice: '',
supplyPrice: res.supplyPrice ? (res.supplyPrice / 100).toFixed(2) : '',
describeTxt: '',
......@@ -911,22 +910,75 @@ export default {
},
// 图片-描述-end
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id
}
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
}
this.$refs.editFormRef[0].$refs.editProRef0.validate(valid0 => {
this.$refs.editFormRef[1].$refs.editProRef1.validate(valid1 => {
this.$refs.editFormRef[2].$refs.editProRef2.validate(valid2 => {
if (valid0 && valid1 && valid2) {
var params = this.$common.utils.deepClone(this.editForm)
var deleteAttrList = ['descImgList', 'describeTxt']
var priceList = ['retailPrice', 'originalPrice', 'supplyPrice', 'expressFee']
if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id
}
// 描述
params.goodsDescList = this.$common.utils.deepClone(this.editForm.descImgList)
if (this.editForm.describeTxt) {
params.goodsDescList.unshift({
content: this.editForm.describeTxt,
resType: 2,
bizType: 2
})
}
// 规格
params.specificationDetailList = []
this.nameToValSpecsList.forEach((item, index) => {
var specificationData = ''
item.specsValueList.forEach((subItem, subIndex) => {
if (subIndex != 0) {
specificationData += '&'
}
specificationData = specificationData + this.specificationDetailList[subIndex].specificationName + '-' + subItem
})
params.specificationDetailList.push({
specificationData: specificationData,
retailPrice: (item.retailPrice * 100).toFixed(0),
stock: item.stock
})
})
// 专区-门店没有专区
if (this.routeInfo.groupOrStore != 1) {
delete params.zoneId
}
// 价格格式化(计算到分)
priceList.forEach(item => {
if (params[item]) {
params[item] = (this.editForm[item] * 100).toFixed(0)
}
})
params.supplyMerchantList = []
this.editForm.supplyMerchantList.forEach(item => {
params.supplyMerchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
deleteAttrList.forEach(item => {
delete params[item]
})
console.log(params)
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
}
})
})
})
},
handleCancel() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!