This commit is contained in:
wangshiming
2022-02-22 10:16:19 +08:00
parent 478739e51a
commit 67bb8b3ccf
3 changed files with 80 additions and 50 deletions

View File

@ -202,17 +202,23 @@
<nz-card>
<div nz-row>
<nz-card nzTitle="轨迹信息" style="width: 100%" #distannce5>
<nz-card nzTitle="轨迹信息" style="width: 100%" [nzExtra]="extraTemplate" #distannce5>
<div nz-row>
<div nz-col [nzSpan]="12">
<!-- <st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st> -->
<st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</div>
<div nz-col [nzSpan]="12">
<amap-path-simplifier></amap-path-simplifier>
<amap-path-simplifier [MapList]="MapList"></amap-path-simplifier>
</div>
</div>
</nz-card>
<ng-template #extraTemplate>
<nz-radio-group [(ngModel)]="trajectory">
<label nz-radio-button nzValue="car">车辆轨迹</label>
<label nz-radio-button nzValue="driver">司机轨迹</label>
</nz-radio-group>
</ng-template>
</div>
</nz-card>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:18:24
* @LastEditTime : 2022-02-22 10:16:11
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -17,14 +17,15 @@ import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { OrderManagementService } from '../../services/order-management.service';
import { NzCardComponent } from 'ng-zorro-antd/card';
import format from 'date-fns/format';
@Component({
selector: 'app-supply-management-bulk-detail',
templateUrl: './bulk-detail.component.html',
styleUrls: ['./bulk-detail.component.less']
})
export class OrderManagementBulkeDetailComponent implements OnInit {
MapList: any;
id = this.route.snapshot.params.id;
i: any;
imges: any;
@ -46,23 +47,23 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
'1': { text: '待申请', color: 'warning' },
'2': { text: '已支付', color: 'success' },
'3': { text: '已拒绝', color: 'warning' },
'4': { text: '申请中', color: 'warning' },
},
},
'4': { text: '申请中', color: 'warning' }
}
}
];
trajectory = 'car';
addressItems: any[] = []; //打点地址数据组
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: OrderManagementService,
private router: Router,
private modal: NzModalService,
) {
}
private modal: NzModalService
) {}
ngOnInit(): void {
this.initData()
this.initData();
this.MapInit();
}
initData() {
@ -72,30 +73,29 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0];
this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0];
}
})
});
}
goBack() {
window.history.go(-1);
}
// 修改订单
changeOrder() {
this.router.navigate(['order-management/bulk-detailChange', this.id])
this.router.navigate(['order-management/bulk-detailChange', this.id]);
}
agreement(value: any) {
if (value === '1') {
this.imges = this.i?.supplementAgreement
this.imges = this.i?.supplementAgreement;
} else if (value === '2') {
this.imges = this.i?.supplementAgreement
this.imges = this.i?.supplementAgreement;
}
this.isVisible = true;
}
handleCancel() {
this.isVisible = false
this.isVisible = false;
}
handleOK() {
this.isVisible = false
this.isVisible = false;
}
goDistance(elf: NzCardComponent) {
if (elf) {
@ -109,12 +109,37 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
nzTitle: '<b>确定取消该订单吗?</b>',
nzContent: `<b>取消后无法恢复,请确认</b>`,
nzOnOk: () =>
this.service.request(this.service.$api_get_cancelAnOrder, {id: this.id}).subscribe((res) => {
this.service.request(this.service.$api_get_cancelAnOrder, { id: this.id }).subscribe(res => {
if (res === true) {
this.service.msgSrv.success('操作成功!');
this.initData();
}
}),
})
});
}
// 获取轨迹
MapInit() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
points?.forEach((item: any) => {
this.MapList.push({
name: item.hgt,
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
});
});
this.addressItems = res.parkArray;
if (this.addressItems && this.addressItems.length > 0) {
this.addressItems.forEach(item => {
item.parkBte = this.getLocalTime(item.parkBte);
item.parkEte = this.getLocalTime(item.parkEte);
});
}
}
});
}
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
}

View File

@ -55,7 +55,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
}
}
];
trajectory = "car"
trajectory = 'car';
addressItems: any[] = []; //打点地址数据组
constructor(
@ -171,5 +171,4 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
}