Commit dce0dfbf by 杨北旺

修复bug

1 parent bdf44421
...@@ -710,11 +710,11 @@ export default { ...@@ -710,11 +710,11 @@ export default {
operationalOptions: [ operationalOptions: [
{ {
label: '非营运', label: '非营运',
value: '1', value: '1'
}, },
{ {
label: '营运', label: '营运',
value: '0', value: '0'
} }
] ]
} }
...@@ -1921,82 +1921,87 @@ export default { ...@@ -1921,82 +1921,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
return true
}
var params = this.getParams()
delete params.attributes
params.operationType = 1
if ([2, 3, 4].includes(this.routeInfo.addOrEdit)) {
if (this.routeInfo.addOrEdit == 4 && this.editForm.orderStatus != 3) {
params.contractNo = ''
} else {
params.contractNo = this.routeInfo.contractNo
} }
} else { this.submit = true
params.contractNo = '' var list = ['Car', 'Brand', 'User', 'Shop', 'Other']
} var flag = true
const productflag = this.vaidProduct() var errorObjList = []
if (productflag) { for (var i = 0; i < list.length; i++) {
return if (this.$refs['editFormRef' + list[i]]) {
} var pRef = this.$refs['editFormRef' + list[i]]
params = { pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
...params, !valid && errorObjList.push(errorObj)
...vaidObj flag && (flag = valid)
} })
if (this.showUploadInfo) { }
const _check = this.checkAttachmentList() }
if (_check) { if (!flag) {
this.whereToGo(Object.keys(errorObjList[0])[0])
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 = {
...@@ -2076,6 +2081,9 @@ export default { ...@@ -2076,6 +2081,9 @@ export default {
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!