Commit e793f7b6 by 杨北旺

修复bug

1 parent 370396e9
...@@ -1331,7 +1331,7 @@ export default { ...@@ -1331,7 +1331,7 @@ export default {
} }
} else if (e.attributeName === 'gearbox') { } else if (e.attributeName === 'gearbox') {
e.optionList = this.gearboxOptions e.optionList = this.gearboxOptions
}else if (e.attributeName==='vehicle_nature'){ } else if (e.attributeName === 'vehicle_nature') {
e.optionList = this.operationalOptions e.optionList = this.operationalOptions
this.$set(this.productModal[item.idName], `${e.attributeName}`, e.optionList[0].value) this.$set(this.productModal[item.idName], `${e.attributeName}`, e.optionList[0].value)
} }
...@@ -1912,82 +1912,87 @@ export default { ...@@ -1912,82 +1912,87 @@ export default {
} }
}, },
handleConfirm() { handleConfirm() {
this.vaildGlassParams() try {
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct this.vaildGlassParams()
const isEmptyObj = JSON.stringify(vaidObj) == '{}' const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (isEmptyObj) { const isEmptyObj = JSON.stringify(vaidObj) == '{}'
this.$message({ message: '请选择产品信息', type: 'error' }) if (isEmptyObj) {
return this.$message({ message: '请选择产品信息', type: 'error' })
} return
if (this.submit) {
return true
}
this.submit = true
var list = ['Car', 'Brand', 'User', 'Shop', 'Other']
var flag = true
var errorObjList = []
for (var i = 0; i < list.length; i++) {
if (this.$refs['editFormRef' + list[i]]) {
var pRef = this.$refs['editFormRef' + list[i]]
pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
!valid && errorObjList.push(errorObj)
flag && (flag = valid)
})
} }
} if (this.submit) {
if (!flag) { return true
this.whereToGo(Object.keys(errorObjList[0])[0]) }
this.submit = false this.submit = true
return true var list = ['Car', 'Brand', 'User', 'Shop', 'Other']
} var flag = true
var params = this.getParams() var errorObjList = []
delete params.attributes for (var i = 0; i < list.length; i++) {
params.operationType = 1 if (this.$refs['editFormRef' + list[i]]) {
if ([2, 3, 4].includes(this.routeInfo.addOrEdit)) { var pRef = this.$refs['editFormRef' + list[i]]
if (this.routeInfo.addOrEdit == 4 && this.editForm.orderStatus != 3) { pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
params.contractNo = '' !valid && errorObjList.push(errorObj)
} else { flag && (flag = valid)
params.contractNo = this.routeInfo.contractNo })
}
} }
} else { if (!flag) {
params.contractNo = '' this.whereToGo(Object.keys(errorObjList[0])[0])
}
const productflag = this.vaidProduct()
if (productflag) {
return
}
params = {
...params,
...vaidObj
}
if (this.showUploadInfo) {
const _check = this.checkAttachmentList()
if (_check) {
this.submit = false this.submit = false
this.$message({ message: '请补充全部资料', type: 'error' }) return true
return
} }
params.attachmentList = this.attachmentList || [] var params = this.getParams()
} delete params.attributes
params.attachmentList = params.attachmentList || [] params.operationType = 1
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => { if ([2, 3, 4].includes(this.routeInfo.addOrEdit)) {
if (res.code == '0') { if (this.routeInfo.addOrEdit == 4 && this.editForm.orderStatus != 3) {
this.updateEquity(params) params.contractNo = ''
} else {
params.contractNo = this.routeInfo.contractNo
}
} else { } else {
this.submit = false params.contractNo = ''
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(params)
}
}
})
} }
}) const productflag = this.vaidProduct()
if (productflag) {
return
}
params = {
...params,
...vaidObj
}
if (this.showUploadInfo) {
const _check = this.checkAttachmentList()
if (_check) {
this.submit = false
this.$message({ message: '请补充全部资料', type: 'error' })
return
}
params.attachmentList = this.attachmentList || []
}
params.attachmentList = params.attachmentList || []
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params)
} else {
this.submit = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(params)
}
}
})
}
})
} catch (error) {
console.log(error)
this.submit = false
}
}, },
handleReset() { handleReset() {
this.editForm = { this.editForm = {
...@@ -2056,9 +2061,12 @@ export default { ...@@ -2056,9 +2061,12 @@ export default {
let _code = [], let _code = [],
_typeCode = ['YB0001', 'YB0002', 'YB0003', 'YB0004'], _typeCode = ['YB0001', 'YB0002', 'YB0003', 'YB0004'],
flag = false flag = false
if((!this.attachmentList || !this.attachmentList.length)&&this.attachmentListQuery.length){ if ((!this.attachmentList || !this.attachmentList.length) && this.attachmentListQuery.length) {
this.attachmentList = this.attachmentListQuery || [] this.attachmentList = this.attachmentListQuery || []
} }
if (!this.attachmentList) {
this.attachmentList = []
}
this.attachmentList.forEach(el => { this.attachmentList.forEach(el => {
if (_typeCode.includes(el.attachmentCode)) { if (_typeCode.includes(el.attachmentCode)) {
_code.push(el.attachmentCode) _code.push(el.attachmentCode)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!