Commit 6c4a2b17 authored by xxx's avatar xxx

1

parent 8413b7c5
...@@ -160,47 +160,56 @@ export default { ...@@ -160,47 +160,56 @@ export default {
}, },
//提交申报 //提交申报
submitDeFn(){ submitDeFn(){
httpPostForJson(faultDayAdd,this.from).then((res) => {}); if(this.from.carcode == ''){
httpPostForJson(faultMonthAdd,this.from).then((res) => {}); this.$notify({
httpPostForJson(faultYearAdd,this.from).then((res) => {}); title: '请输入车辆号码!',
let breakData1 = {}; type: 'error',
breakData1.number = this.from.carcode; duration: 2500
breakData1.driver = this.from.name; })
breakData1.carbreak = this.from.fault; }else{
breakData1.status = 1; httpPostForJson(faultDayAdd,this.from).then((res) => {});
breakData1.breakRemarks = this.from.problem; httpPostForJson(faultMonthAdd,this.from).then((res) => {});
httpPostForJson(carsInforQuery,breakData1).then((res) => {}); httpPostForJson(faultYearAdd,this.from).then((res) => {});
httpPostForJson(failureDeclarationAdd,this.from).then((res) => { let breakData1 = {};
if(res.code == 200){ breakData1.number = this.from.carcode;
this.$notify({ breakData1.driver = this.from.name;
title: '故障申报成功!', breakData1.carbreak = this.from.fault;
type: 'success', breakData1.status = 1;
duration: 2500 breakData1.breakRemarks = this.from.problem;
}); httpPostForJson(carsInforQuery,breakData1).then((res) => {});
this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''}; httpPostForJson(failureDeclarationAdd,this.from).then((res) => {
this.getLocationText = '点击获取车辆位置'; if(res.code == 200){
this.zuobiaoShow = false; this.$notify({
}else{ title: '故障申报成功!',
this.$notify({ type: 'success',
title: res.head.message, duration: 2500
type: 'error', });
duration: 2500 this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''};
}) this.getLocationText = '点击获取车辆位置';
this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''}; this.zuobiaoShow = false;
this.getLocationText = '点击获取车辆位置'; }else{
this.zuobiaoShow = false; this.$notify({
} title: res.head.message,
}); type: 'error',
//修改车辆状态 duration: 2500
httpGet(vehicleInformationQuery,{number:this.from.carcode}).then((res) => {
if(res.code == 200){
putForJson(vehicleInformationUpdate,{id:res.data.content[0].id,status:1}).then((res) => {
this.$nextTick(()=>{
window.location.reload();
}) })
}); this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''};
} this.getLocationText = '点击获取车辆位置';
}); this.zuobiaoShow = false;
}
});
//修改车辆状态
httpGet(vehicleInformationQuery,{number:this.from.carcode}).then((res) => {
if(res.code == 200){
putForJson(vehicleInformationUpdate,{id:res.data.content[0].id,status:1}).then((res) => {
this.$nextTick(()=>{
window.location.reload();
})
});
}
});
}
}, },
}, },
watch:{ watch:{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment