Commit e78e2d1b by zhangquan

bug修复

1 parent 70799933
......@@ -845,23 +845,7 @@ export default {
this.$set(this.productList[this.vailIndex], 'disabled', true)
this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', true)
this.errGlassName = '车辆价格超过50万,无法购买'
if(this.tempAttributeList.length&&this.packageCodeList.length){
if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
let arr1 = []
let arr2 = []
this.tempAttributeList.forEach(ele=>{
if(ele.packageCode!=this.vailGlassCode){
arr1.push(ele)
}
})
this.packageCodeList.forEach(ele=>{
if(ele!=this.vailGlassCode){
arr2.push(ele)
}
})
this.handleProductArrParam(arr1, arr2)
}
}
this.vaildGlassParams()
} else {
this.errGlassName = ''
if (this.vailIndex !=undefined) this.$set(this.productList[this.vailIndex], 'disabled', false)
......@@ -873,17 +857,24 @@ export default {
}
},
// 轮胎玻璃提单参数处理
vaildGlassParams(para){
const index = this.checkCodeList.indexOf(this.vailGlassCode)
if(index!=-1&&this.errGlassName){
for(let key in para){
if(key.indexOf(`attributes[${index}]`)!=-1){
delete para[key]
}
vaildGlassParams(){
if(this.equityRadio == 1&&this.tempAttributeList.length&&this.packageCodeList.length){
if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
let arr1 = []
let arr2 = []
this.tempAttributeList.forEach(ele=>{
if(ele.packageCode!=this.vailGlassCode){
arr1.push(ele)
}
})
this.packageCodeList.forEach(ele=>{
if(ele!=this.vailGlassCode){
arr2.push(ele)
}
})
this.handleProductArrParam(arr1, arr2)
}
return para
}
return para
},
// 切换套餐---赋默认值
changeCheckBox(e, item, index) {
......@@ -1662,6 +1653,7 @@ export default {
},
// 草稿
handleDraft() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) {
return true
......@@ -1732,6 +1724,7 @@ export default {
}
},
handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) {
......@@ -1778,7 +1771,6 @@ export default {
...params,
...vaidObj
}
params = this.vaildGlassParams(params)
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!