fix bug
This commit is contained in:
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-02-22 13:53:29
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-28 14:37:42
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\view-track\\view-track.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STColumn } from '@delon/abc/st';
|
||||
import {
|
||||
SFComponent,
|
||||
SFCustomWidgetSchema,
|
||||
SFNumberWidgetSchema,
|
||||
SFRadioWidgetSchema,
|
||||
SFSchema,
|
||||
SFTextareaWidgetSchema,
|
||||
SFUISchema
|
||||
} from '@delon/form';
|
||||
import format from 'date-fns/format';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { OrderManagementService } from '../../../services/order-management.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-management-view-track',
|
||||
styleUrls: ['./view-track.component.less'],
|
||||
templateUrl: './view-track.component.html'
|
||||
})
|
||||
export class OneCarOrderViewtrackComponent implements OnInit {
|
||||
i: any; // 单行数据
|
||||
MapList: any; // 地图数据
|
||||
trajectory = 'car';
|
||||
addressItems: any[] = []; //打点地址数据组
|
||||
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' }
|
||||
}
|
||||
}
|
||||
];
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private modal: NzModalService,
|
||||
private msgSrv: NzMessageService,
|
||||
public service: OrderManagementService
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.i);
|
||||
this.MapInit();
|
||||
|
||||
}
|
||||
// 获取轨迹
|
||||
MapInit() {
|
||||
this.service.request(this.service.$api_get_getTrajectory, { id: this.i.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);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
close(value: boolean): void {
|
||||
this.modalRef.close(false);
|
||||
}
|
||||
getLocalTime(time: any) {
|
||||
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user