Commit 6c4a2b17 authored by xxx's avatar xxx

1

parent 8413b7c5
......@@ -160,47 +160,56 @@ export default {
},
//提交申报
submitDeFn(){
httpPostForJson(faultDayAdd,this.from).then((res) => {});
httpPostForJson(faultMonthAdd,this.from).then((res) => {});
httpPostForJson(faultYearAdd,this.from).then((res) => {});
let breakData1 = {};
breakData1.number = this.from.carcode;
breakData1.driver = this.from.name;
breakData1.carbreak = this.from.fault;
breakData1.status = 1;
breakData1.breakRemarks = this.from.problem;
httpPostForJson(carsInforQuery,breakData1).then((res) => {});
httpPostForJson(failureDeclarationAdd,this.from).then((res) => {
if(res.code == 200){
this.$notify({
title: '故障申报成功!',
type: 'success',
duration: 2500
});
this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''};
this.getLocationText = '点击获取车辆位置';
this.zuobiaoShow = false;
}else{
this.$notify({
title: res.head.message,
type: 'error',
duration: 2500
})
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();
if(this.from.carcode == ''){
this.$notify({
title: '请输入车辆号码!',
type: 'error',
duration: 2500
})
}else{
httpPostForJson(faultDayAdd,this.from).then((res) => {});
httpPostForJson(faultMonthAdd,this.from).then((res) => {});
httpPostForJson(faultYearAdd,this.from).then((res) => {});
let breakData1 = {};
breakData1.number = this.from.carcode;
breakData1.driver = this.from.name;
breakData1.carbreak = this.from.fault;
breakData1.status = 1;
breakData1.breakRemarks = this.from.problem;
httpPostForJson(carsInforQuery,breakData1).then((res) => {});
httpPostForJson(failureDeclarationAdd,this.from).then((res) => {
if(res.code == 200){
this.$notify({
title: '故障申报成功!',
type: 'success',
duration: 2500
});
this.from = {car:'',carcode:'',name:'',fault:'',problem:'',lat:'',lon:''};
this.getLocationText = '点击获取车辆位置';
this.zuobiaoShow = false;
}else{
this.$notify({
title: res.head.message,
type: 'error',
duration: 2500
})
});
}
});
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:{
......
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