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-24 16:58:02
* @LastEditors : Shiming
* @LastEditTime : 2022-03-08 13:55:14
* @LastEditTime : 2022-03-08 14:55:05
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -41,9 +41,7 @@ function getBase64(file: File): Promise<string | ArrayBuffer | null> {
export class OrderManagementBulkDetailChangeComponent implements OnInit {
validateForm1: FormGroup;
id = this.route.snapshot.params.id;
trajectory = 'car';
@ViewChild('distannce3', { static: false })
MapList: any[]=[];
i: any= {unLoadingPlaceList:[]};
totalDistance = 0.0; //总里程
totalTime = 0.0; //路程总时间
@ -70,16 +68,38 @@ loadTime: any; // 货源单设置回显
schema4: SFSchema = {};
isVisible = false;
billExpenses: any[] = []; //运费信息表格信息
addressItems: any[] = []; //打点地址数据组
ui4!: SFUISchema;
formData: any;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {};
ui: SFUISchema = {};
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';
mapList:any[] = []; //地图点位数据组
addressItems:any[] = []; //打点地址数据组
constructor(
private route: ActivatedRoute,
private router: Router,
@ -102,6 +122,7 @@ loadTime: any; // 货源单设置回显
this.initData()
this.initSF3();
this.initSF4();
this.getTrajectory()
}
initSF() {
this.schema = {
@ -887,30 +908,61 @@ goDistance(elf: NzCardComponent) {
});
}
}
// 获取轨迹
MapInit() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
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))]
});
// 获取车辆轨迹
getTrajectory(){
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
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.cityArray;
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.vinOutTime);
});
this.MapList = list;
this.addressItems = res.parkArray;
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.vinOutTime);
});
}
}
});
}
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
});
}
// 获取司机轨迹
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');
}
}