二手车交易,审核加字段

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('请填写不通过原因')
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 {
await auditCarInfo({
id: this.id,
auditResult: type ? 1 : 0 ,
auditReason: this.auditReason,
...this.form,
otherPhoto:this.otherImgSrc?.join(',')
})
// await this.submitHandle()
setTimeout(()=>{
this.closeParentDialog()
},1000)
@ -361,7 +386,7 @@ export default {
},
// 发布车源
async submitHandle(){
if (!this.radio && this.type==1) {
if (!this.radio) {
this.$toast('请勾选我已阅读并同意')
return
}
@ -395,23 +420,15 @@ export default {
otherPhoto:this.otherImgSrc?.join(',')
})
if(res.code == 200 && !res.msg){
sessionStorage.setItem('formInfo','')
sessionStorage.setItem('areaName','')
sessionStorage.setItem('vehicleLicensePhotoList','')
sessionStorage.setItem('vehicleAnglePhotoList','')
sessionStorage.setItem('otherImgSrcList','')
sessionStorage.setItem('otherImgSrc','')
if(this.type==1){
this.$toast('发布成功')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
this.$toast('发布成功')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
}else{
this.$toast(res.msg)

View File

@ -209,24 +209,43 @@ export default {
this.$toast('请填写不通过原因')
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 {
await auditCarInfo({
id: this.id,
auditResult: type ? 1 : 0 ,
auditReason: this.auditReason,
...this.form,
})
// await this.submitHandle()
setTimeout(()=>{
this.closeParentDialog()
},1000)
} finally {
} catch (e){
console.log(e)
}
finally {
console.log(type)
}
},
// 发布求购
async submitHandle(){
if (!this.radio && this.type==1) {
if (!this.radio) {
this.$toast('请勾选我已阅读并同意')
return
}
@ -251,17 +270,15 @@ export default {
...this.form,
})
if(res.code == 200 && !res.msg){
if(this.type==1){
this.$toast('发布成功')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
this.$toast('发布成功')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},1000)
}else{
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
}else{
this.$toast(res.msg)