Commit 1b9c4797 by 杨北旺

修改bug

1 parent b5634f0f
...@@ -882,23 +882,24 @@ export default { ...@@ -882,23 +882,24 @@ export default {
this.$set(this.productList[this.vailIndex], 'disabled', true) this.$set(this.productList[this.vailIndex], 'disabled', true)
this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', true) this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', true)
this.errGlassName = '车辆价格超过50万,无法购买' this.errGlassName = '车辆价格超过50万,无法购买'
if(this.tempAttributeList.length&&this.packageCodeList.length){ this.vaildGlassParams()
if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){ // if(this.tempAttributeList.length&&this.packageCodeList.length){
let arr1 = [] // if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
let arr2 = [] // let arr1 = []
this.tempAttributeList.forEach(ele=>{ // let arr2 = []
if(ele.packageCode!=this.vailGlassCode){ // this.tempAttributeList.forEach(ele=>{
arr1.push(ele) // if(ele.packageCode!=this.vailGlassCode){
} // arr1.push(ele)
}) // }
this.packageCodeList.forEach(ele=>{ // })
if(ele!=this.vailGlassCode){ // this.packageCodeList.forEach(ele=>{
arr2.push(ele) // if(ele!=this.vailGlassCode){
} // arr2.push(ele)
}) // }
this.handleProductArrParam(arr1, arr2) // })
} // this.handleProductArrParam(arr1, arr2)
} // }
// }
} else { } else {
this.errGlassName = '' this.errGlassName = ''
if (this.vailIndex !=undefined) this.$set(this.productList[this.vailIndex], 'disabled', false) if (this.vailIndex !=undefined) this.$set(this.productList[this.vailIndex], 'disabled', false)
...@@ -910,17 +911,24 @@ export default { ...@@ -910,17 +911,24 @@ export default {
} }
}, },
// 轮胎玻璃提单参数处理 // 轮胎玻璃提单参数处理
vaildGlassParams(para){ vaildGlassParams(){
const index = this.checkCodeList.indexOf(this.vailGlassCode) if(this.equityRadio == 1&&this.tempAttributeList.length&&this.packageCodeList.length&&this.errGlassName){
if(index!=-1&&this.errGlassName){ if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
for(let key in para){ let arr1 = []
if(key.indexOf(`attributes[${index}]`)!=-1){ let arr2 = []
delete para[key] 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) { changeCheckBox(e, item, index) {
...@@ -1712,6 +1720,7 @@ export default { ...@@ -1712,6 +1720,7 @@ export default {
}, },
// 草稿 // 草稿
handleDraft() { handleDraft() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) { if (this.submit) {
return true return true
...@@ -1733,7 +1742,6 @@ export default { ...@@ -1733,7 +1742,6 @@ export default {
params.attributes = [] params.attributes = []
} }
params = Object.assign(params, vaidObj) params = Object.assign(params, vaidObj)
params = this.vaildGlassParams(params)
this.updateEquity(params) this.updateEquity(params)
}, },
updateEquity(params) { updateEquity(params) {
...@@ -1782,6 +1790,7 @@ export default { ...@@ -1782,6 +1790,7 @@ export default {
} }
}, },
handleConfirm() { handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}' const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) { if (isEmptyObj) {
...@@ -1828,7 +1837,6 @@ export default { ...@@ -1828,7 +1837,6 @@ export default {
...params, ...params,
...vaidObj ...vaidObj
} }
params = this.vaildGlassParams(params)
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => { this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') { if (res.code == '0') {
this.updateEquity(params) this.updateEquity(params)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!