Commit 413e4894 authored by 耿迪迪's avatar 耿迪迪

车辆信息问题修改 gengdidi

parent bffc5c55
...@@ -312,7 +312,6 @@ export default { ...@@ -312,7 +312,6 @@ export default {
this.backForm.vehicleId = row.vehicleId; this.backForm.vehicleId = row.vehicleId;
getLastLocation(param).then(res =>{ getLastLocation(param).then(res =>{
if(res){ if(res){
console.log(res.data.longitude && res.data.latitude,"fdsfdsa")
if(res.data.longitude && res.data.latitude){ if(res.data.longitude && res.data.latitude){
res.data.iconType = 9; res.data.iconType = 9;
this.map.clearbackTrack(param.vehicleId) this.map.clearbackTrack(param.vehicleId)
...@@ -387,22 +386,52 @@ export default { ...@@ -387,22 +386,52 @@ export default {
this.getList(); this.getList();
}, },
searchLocations(){ searchLocations(){
getVehicleLocations(this.backForm).then(res =>{ this.$refs.backForm.validate((valid) => {
let paths = []; if (valid) {
if(res.data.length == 1){ if (
this.$message({ moment(this.backForm.beginTime).valueOf() >
message: '抱歉当前车辆只能查看位置信息,无法形成轨迹!', moment(this.backForm.endTime).valueOf()
type: 'warning' ) {
}); this.msgError("开始时间不能大于结束时间");
}else{ this.backForm.endTime = "";
res.data.forEach(item => { return;
paths.push([item.longitude,item.latitude]); }
if (this.backForm.changeTime != 3) {
this.radioChange(this.backForm.changeTime);
} else {
this.backForm.beginTime = moment(this.backForm.beginTime).format(
"YYYY-MM-DD HH:mm:ss"
);
this.backForm.endTime = moment(this.backForm.endTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
getVehicleLocations(this.backForm).then(res =>{
let paths = [];
if(res.data.length == 1){
this.$message({
message: '抱歉当前车辆只能查看位置信息,无法形成轨迹!',
type: 'warning'
});
}else if(res.data.length == 0){
this.$message({
message: '抱歉该时段未查到当前车辆轨迹信息!',
type: 'warning'
});
}else{
res.data.forEach(item => {
paths.push([item.longitude,item.latitude]);
})
this.map.backTrack(this.backForm.vehicleId,paths);
this.backOpen = false;
}
}) })
this.map.backTrack(this.backForm.vehicleId,paths);
this.backOpen = false;
} }
});
})
} }
} }
}; };
......
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