工单报备按钮加防重复点击
This commit is contained in:
@ -151,6 +151,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.id=this.$route.query?.id || ''
|
||||
this.$toast('id:', this.id)
|
||||
},
|
||||
async mounted() {
|
||||
const selectElement = document.getElementById('mySelect');
|
||||
@ -203,6 +204,13 @@ export default {
|
||||
this.$router.back()
|
||||
},
|
||||
async submitBtn(){
|
||||
this.$toast(JSON.stringify({
|
||||
vehicleId:this.id ? this.id : '',
|
||||
plateNumber:this.carNum ? this.carNum :'',
|
||||
vehicleType:this.selectedOption ? this.selectedOption : '',
|
||||
hasPolymerization:Number(this.isJoin ? this.isJoin : '') ,
|
||||
serviceIds:this.serviceIds ? this.serviceIds : []
|
||||
}))
|
||||
console.log("提交车辆");
|
||||
let res=await saveVehicle({
|
||||
vehicleId:this.id ? this.id : '',
|
||||
@ -214,6 +222,7 @@ export default {
|
||||
if(res.code === 200){
|
||||
if(this.id){
|
||||
this.$toast('修改成功')
|
||||
|
||||
}else{
|
||||
this.$toast('添加成功')
|
||||
}
|
||||
@ -221,6 +230,8 @@ export default {
|
||||
setTimeout(()=>{
|
||||
this.$router.back();
|
||||
},2000)
|
||||
}else{
|
||||
this.$toast(res.msg)
|
||||
}
|
||||
console.log("res",res)
|
||||
},
|
||||
|
Reference in New Issue
Block a user