Commit dce0dfbf by 杨北旺

修复bug

1 parent bdf44421
......@@ -710,11 +710,11 @@ export default {
operationalOptions: [
{
label: '非营运',
value: '1',
value: '1'
},
{
label: '营运',
value: '0',
value: '0'
}
]
}
......@@ -1921,82 +1921,87 @@ export default {
}
},
handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) {
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)
})
try {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) {
this.$message({ message: '请选择产品信息', type: 'error' })
return
}
}
if (!flag) {
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
if (this.submit) {
return true
}
} else {
params.contractNo = ''
}
const productflag = this.vaidProduct()
if (productflag) {
return
}
params = {
...params,
...vaidObj
}
if (this.showUploadInfo) {
const _check = this.checkAttachmentList()
if (_check) {
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 (!flag) {
this.whereToGo(Object.keys(errorObjList[0])[0])
this.submit = false
this.$message({ message: '请补充全部资料', type: 'error' })
return
return true
}
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)
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 = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(params)
}
}
})
params.contractNo = ''
}
})
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() {
this.editForm = {
......@@ -2076,6 +2081,9 @@ export default {
if ((!this.attachmentList || !this.attachmentList.length) && this.attachmentListQuery.length) {
this.attachmentList = this.attachmentListQuery || []
}
if(!this.attachmentList){
this.attachmentList = []
}
this.attachmentList.forEach(el => {
if (_typeCode.includes(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!