二手车交易,审核加字段

This commit is contained in:
2025-03-14 15:07:35 +08:00
parent 509ab301a2
commit 4dbf2dc8c7
2 changed files with 67 additions and 33 deletions

View File

@ -345,13 +345,38 @@ export default {
this.$toast('请填写不通过原因') this.$toast('请填写不通过原因')
return return
} }
if (!this.form.vehicleLicensePhoto) {
this.$toast('行驶证不能为空')
return
}
if (!this.form.vehicleAnglePhoto) {
this.$toast('车辆45度不能为空')
return
}
let flag=this.validateHandle()
if(flag){
this.$toast(flag)
return
}
if (this.form.vehicleType=='拖车' && !this.form.boardType) {
this.$toast('落板方式不能为空')
return
}else if(this.form.vehicleType !=='拖车'){
this.form.boardType=''
}
let rule=this.validationRules.find(item=>!item.value)
if(rule){
this.$toast(rule.name)
return
}
try { try {
await auditCarInfo({ await auditCarInfo({
id: this.id, id: this.id,
auditResult: type ? 1 : 0 , auditResult: type ? 1 : 0 ,
auditReason: this.auditReason, auditReason: this.auditReason,
...this.form,
otherPhoto:this.otherImgSrc?.join(',')
}) })
// await this.submitHandle()
setTimeout(()=>{ setTimeout(()=>{
this.closeParentDialog() this.closeParentDialog()
},1000) },1000)
@ -361,7 +386,7 @@ export default {
}, },
// 发布车源 // 发布车源
async submitHandle(){ async submitHandle(){
if (!this.radio && this.type==1) { if (!this.radio) {
this.$toast('请勾选我已阅读并同意') this.$toast('请勾选我已阅读并同意')
return return
} }
@ -395,23 +420,15 @@ export default {
otherPhoto:this.otherImgSrc?.join(',') otherPhoto:this.otherImgSrc?.join(',')
}) })
if(res.code == 200 && !res.msg){ if(res.code == 200 && !res.msg){
sessionStorage.setItem('formInfo','') this.$toast('发布成功')
sessionStorage.setItem('areaName','') if(this.isWebFunc()){
sessionStorage.setItem('vehicleLicensePhotoList','') setTimeout(()=>{
sessionStorage.setItem('vehicleAnglePhotoList','') this.closeParentDialog()
sessionStorage.setItem('otherImgSrcList','') },1000)
sessionStorage.setItem('otherImgSrc','') }else{
if(this.type==1){ setTimeout(()=>{
this.$toast('发布成功') this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
if(this.isWebFunc()){ },1000)
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
} }
}else{ }else{
this.$toast(res.msg) this.$toast(res.msg)

View File

@ -209,24 +209,43 @@ export default {
this.$toast('请填写不通过原因') this.$toast('请填写不通过原因')
return return
} }
let flag=this.validateHandle()
if(flag){
this.$toast(flag)
return
}
if (this.form.vehicleType=='拖车' && !this.form.boardType) {
this.$toast('落板方式不能为空')
return
}else if(this.form.vehicleType !=='拖车'){
this.form.boardType=''
}
let rule=this.validationRules.find(item=>!item.value)
if(rule){
this.$toast(rule.name)
return
}
try { try {
await auditCarInfo({ await auditCarInfo({
id: this.id, id: this.id,
auditResult: type ? 1 : 0 , auditResult: type ? 1 : 0 ,
auditReason: this.auditReason, auditReason: this.auditReason,
...this.form,
}) })
// await this.submitHandle()
setTimeout(()=>{ setTimeout(()=>{
this.closeParentDialog() this.closeParentDialog()
},1000) },1000)
} finally { } catch (e){
console.log(e)
}
finally {
console.log(type) console.log(type)
} }
}, },
// 发布求购 // 发布求购
async submitHandle(){ async submitHandle(){
if (!this.radio && this.type==1) { if (!this.radio) {
this.$toast('请勾选我已阅读并同意') this.$toast('请勾选我已阅读并同意')
return return
} }
@ -251,17 +270,15 @@ export default {
...this.form, ...this.form,
}) })
if(res.code == 200 && !res.msg){ if(res.code == 200 && !res.msg){
if(this.type==1){ this.$toast('发布成功')
this.$toast('发布成功') if(this.isWebFunc()){
if(this.isWebFunc()){ setTimeout(()=>{
setTimeout(()=>{ this.closeParentDialog()
this.closeParentDialog() },1000)
},1000) }else{
}else{ setTimeout(()=>{
setTimeout(()=>{ this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
this.$router.push({ name: "mineRelease",query:{activeTab : 1}}) },1000)
},1000)
}
} }
}else{ }else{
this.$toast(res.msg) this.$toast(res.msg)