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

车辆信息问题修改 gengdidi

parent bffc5c55
......@@ -312,7 +312,6 @@ export default {
this.backForm.vehicleId = row.vehicleId;
getLastLocation(param).then(res =>{
if(res){
console.log(res.data.longitude && res.data.latitude,"fdsfdsa")
if(res.data.longitude && res.data.latitude){
res.data.iconType = 9;
this.map.clearbackTrack(param.vehicleId)
......@@ -387,6 +386,27 @@ export default {
this.getList();
},
searchLocations(){
this.$refs.backForm.validate((valid) => {
if (valid) {
if (
moment(this.backForm.beginTime).valueOf() >
moment(this.backForm.endTime).valueOf()
) {
this.msgError("开始时间不能大于结束时间");
this.backForm.endTime = "";
return;
}
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){
......@@ -394,6 +414,11 @@ export default {
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]);
......@@ -403,6 +428,10 @@ export default {
}
})
}
});
}
}
};
......
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