工单报备按钮加防重复点击1

This commit is contained in:
2023-08-23 10:59:22 +08:00
parent eb7e1da368
commit 552453203b

View File

@ -105,27 +105,30 @@ export default {
this.states=e this.states=e
}, },
async submitBtn(){ async submitBtn(){
let res = await saveDriver({ this.$toast(1111)
driverId:this.id ? this.id : '', try {
driverName:this.driverName , let res = await saveDriver({
driverPhone:this.driverPhone, driverId:this.id ? this.id : '',
identityCardNumber:this.identityCardNumber, driverName:this.driverName ,
drivingModel:this.drivingModel, driverPhone:this.driverPhone,
states:Number(this.states), identityCardNumber:this.identityCardNumber,
createTime:timeFormat(new Date()) drivingModel:this.drivingModel,
}) states:Number(this.states),
if(res.code === 200){ createTime:timeFormat(new Date())
if(this.id){ })
this.$toast('修改成功') if(res.code === 200){
if(this.id){
this.$toast('修改成功')
}else{ }else{
this.$toast('添加成功') this.$toast('添加成功')
}
setTimeout(()=>{
this.$router.back();
},2000)
} }
setTimeout(()=>{ }catch (e){
this.$router.back(); this.$toast(JSON.stringify(e), "eeeeeeee")
},2000)
}else{
this.$toast(res.msg)
} }
}, },
cancelBtn(){//取消 cancelBtn(){//取消