This commit is contained in:
wangshiming
2022-03-08 18:59:25 +08:00
parent 14cba100e4
commit bbd531326a
14 changed files with 414 additions and 181 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-03-04 14:07:44
* @LastEditTime : 2022-03-08 14:53:01
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -204,16 +204,16 @@
<nz-card nzTitle="轨迹信息" style="width: 100%" [nzExtra]="extraTemplate" #distannce5>
<div nz-row>
<div nz-col [nzSpan]="12">
<st [scroll]="{y: '500px'}" #st [data]="addressItems" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
<st [scroll]="{y: '500px'}" #st [data]="addressItems" [columns]="logColumns2" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</div>
<div nz-col [nzSpan]="12">
<amap-path-simplifier [mapWidth]="'100%'" [mapHeight]="'600px'" [MapList]="MapList"></amap-path-simplifier>
<amap-path-simplifier [mapWidth]="'100%'" [mapHeight]="'600px'" [MapList]="mapList"></amap-path-simplifier>
</div>
</div>
</nz-card>
<ng-template #extraTemplate>
<nz-radio-group [(ngModel)]="trajectory">
<nz-radio-group [(ngModel)]="trajectory" (ngModelChange)="trajectoryChange($event)">
<label nz-radio-button nzValue="car">车辆轨迹</label>
<label nz-radio-button nzValue="driver">司机轨迹</label>
</nz-radio-group>

View File

@ -33,12 +33,33 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
totalObj: any;
attObj: any;
isVisible = false;
logColumns: STColumn[] = [
logColumns2: STColumn[] = [
{ title: '时间', index: 'vinOutTime' },
{ title: '地点', index: 'cityName' },
];
logColumns: STColumn[] = [
{ title: '款项', index: 'expenseCodeLabel' },
{ title: '小计(元)', render: 'price' },
{ title: '运输费(元)', render: 'price' },
{ title: '附加费(元)', render: 'surcharge' },
{ title: '支付时间', index: 'paymentTime' },
{
title: '支付状态',
className: 'text-center',
index: 'paymentStatus',
type: 'badge',
width: '120px',
badge: {
'1': { text: '待申请', color: 'warning' },
'2': { text: '已支付', color: 'success' },
'3': { text: '已拒绝', color: 'warning' },
'4': { text: '申请中', color: 'warning' }
}
}
];
trajectory = 'car';
addressItems: any[] = []; //打点地址数据组
mapList:any[] = []; //地图点位数据组
addressItems:any[] = []; //打点地址数据组
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
@ -49,7 +70,7 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
ngOnInit(): void {
this.initData();
this.MapInit();
this.getTrajectory();
}
initData() {
@ -103,8 +124,9 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
})
});
}
// 获取轨迹
MapInit() {
// 获取车辆轨迹
getTrajectory(){
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
@ -115,8 +137,8 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
});
});
this.MapList = list;
this.addressItems = res.parkArray;
this.mapList = list;
this.addressItems = res.cityArray;
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.vinOutTime);
@ -126,6 +148,36 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
});
}
// 获取司机轨迹
getDriverTrajectory(){
this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => {
if (res) {
const points = res.tracks;
let list :any[] = [];
points?.forEach((item: any) => {
list.push({
name: item.hgt,
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
});
});
this.mapList = list;
this.addressItems = [...res.enclosureDataAppTrack];
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.gtm);
item.cityName = item.appAdress;
});
}
}
});
}
trajectoryChange(event:any){
if(event ==='car'){
this.getTrajectory()
}else if(event ==='driver'){
this.getDriverTrajectory();
}
}
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}