二手车交易,必填项回到原本

This commit is contained in:
2025-03-17 16:53:13 +08:00
parent cf45da3ef7
commit affe57159d
2 changed files with 61 additions and 29 deletions

View File

@ -312,24 +312,6 @@ export default {
this.$toast('请填写不通过原因')
return
}
await this.commonMethods();
try {
await auditCarInfo({
id: this.id,
auditResult: type ? 1 : 0 ,
auditReason: this.auditReason,
...this.form,
otherPhoto:this.otherImgSrc?.join(',')
})
this.clearStorageFormInfo()
setTimeout(()=>{
this.closeParentDialog()
},1000)
} finally {
console.log(type)
}
},
commonMethods(){
if (!this.form.vehicleLicensePhoto) {
this.$toast('行驶证不能为空')
return
@ -354,6 +336,21 @@ export default {
this.$toast(rule.name)
return
}
try {
await auditCarInfo({
id: this.id,
auditResult: type ? 1 : 0 ,
auditReason: this.auditReason,
...this.form,
otherPhoto:this.otherImgSrc?.join(',')
})
this.clearStorageFormInfo()
setTimeout(()=>{
this.closeParentDialog()
},1000)
} finally {
console.log(type)
}
},
// 发布车源
async submitHandle(){
@ -361,7 +358,30 @@ export default {
this.$toast('请勾选我已阅读并同意')
return
}
await this.commonMethods();
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 {
let res = await publishCarInfo({
...this.form,

View File

@ -194,7 +194,22 @@ export default {
this.$toast('请填写不通过原因')
return
}
await this.commonMethods()
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,
@ -215,7 +230,12 @@ export default {
}
},
commonMethods() {
// 发布求购
async submitHandle(){
if (!this.radio) {
this.$toast('请勾选我已阅读并同意')
return
}
let flag=this.validateHandle()
if(flag){
this.$toast(flag)
@ -232,14 +252,6 @@ export default {
this.$toast(rule.name)
return
}
},
// 发布求购
async submitHandle(){
if (!this.radio) {
this.$toast('请勾选我已阅读并同意')
return
}
await this.commonMethods()
try {
let res = await publishCarInfo({
...this.form,