This commit is contained in:
Taric Xin
2022-04-15 17:34:59 +08:00
parent aacf116e4b
commit df09ed518a
19 changed files with 688 additions and 707 deletions

View File

@ -20,27 +20,26 @@ import { WaybillManagementServe } from '../../services/waybill-management.servic
@Component({
selector: 'app-supply-management-bulk-detail',
templateUrl: './bulk-detail.component.html',
styleUrls: ['./bulk-detail.component.less']
styleUrls: ['./bulk-detail.component.less', '../../../commom/less/trajectory.less']
})
export class WaybillManagementBulkeDetailComponent implements OnInit {
id = this.route.snapshot.params.id;
i: any;
totalObj: any;
attObj: any;
isVisible = false;
MapList: any[]=[];
MapList: any[] = [];
trajectory = 'car';
mapList:any[] = []; //地图点位数据组
addressItems:any[] = []; //打点地址数据组
mapList: any[] = []; //地图点位数据组
addressItems: any[] = []; //打点地址数据组
billExpenses: any[] = []; //运费信息表格信息
imges: any;
modalcontent: any;
modalTitle:string = '';
modalTitle: string = '';
unLoadingPlaceVOList: any = [];
logColumns2: STColumn[] = [
{ title: '时间', index: 'parkBte' },
{ title: '地点', index: 'parkAdr' },
{ title: '地点', index: 'parkAdr' }
];
logColumns: STColumn[] = [
{ title: '款项', index: 'costCodeLabel' },
@ -65,33 +64,30 @@ export class WaybillManagementBulkeDetailComponent implements OnInit {
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
private modal: NzModalService,
private modal: NzModalService,
private service: WaybillManagementServe,
private modalService: NzModalService
) {
}
) {}
ngOnInit(): void {
this.initData()
this.getTrajectory()
this.initData();
this.getTrajectory();
}
initData() {
const params = {
id: this.id
}
this.service.request(this.service.$api_get_getBulkDetail, params).subscribe((res) => {
console.log(res)
this.unLoadingPlaceVOList.push(...res.loadingPlace)
this.unLoadingPlaceVOList.push(...res.dischargePlace)
console.log(this.unLoadingPlaceVOList)
};
this.service.request(this.service.$api_get_getBulkDetail, params).subscribe(res => {
console.log(res);
this.unLoadingPlaceVOList.push(...res.loadingPlace);
this.unLoadingPlaceVOList.push(...res.dischargePlace);
console.log(this.unLoadingPlaceVOList);
this.i = res;
this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.costCode === 'TRA');
this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE");
})
this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE');
});
}
hand() {
this.modalService.create({
nzTitle: '',
@ -104,66 +100,64 @@ export class WaybillManagementBulkeDetailComponent implements OnInit {
window.history.go(-1);
}
agreement(value: any) {
if(value ==='1'){
if (value === '1') {
this.modalTitle = '附件信息';
this.modalcontent = this.i?.contractContent?.contractContent;
}else if(value === '2'){
} else if (value === '2') {
this.modalTitle = '补充协议';
this.modalcontent = this.i?.supplementContent?.contractContent;
}
this.isVisible = true;
}
handleCancel() {
this.isVisible = false
}
handleOK() {
this.isVisible = false
}
goDistance(elf: NzCardComponent) {
if (elf) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
this.isVisible = false;
}
handleOK() {
this.isVisible = false;
}
goDistance(elf: any) {
if (elf) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
}
}
// *确认发车
sureDepart(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认发车',
nzWidth: '50%',
nzContent: VehicleSureDepartComponent,
nzComponentParams: {
i: item,
Status: 2
},
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
this.initData();
});
}
// 确认到车
sureArrive(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认到车',
nzWidth: '50%',
nzContent: VehicleSureArriveComponent,
nzComponentParams: {
i: item,
Status: 2
},
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
this.initData();
});
}
}
// *确认发车
sureDepart(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认发车',
nzWidth: '50%',
nzContent: VehicleSureDepartComponent,
nzComponentParams: {
i: item,
Status: 2
},
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
this.initData()
});
}
// 确认到车
sureArrive(item: any) {
const modalRef = this.modal.create({
nzTitle: '确认到车',
nzWidth: '50%',
nzContent: VehicleSureArriveComponent,
nzComponentParams: {
i: item,
Status: 2
},
nzFooter: null
});
modalRef.afterClose.subscribe((result: any) => {
this.initData()
});
}
// 获取车辆轨迹
getTrajectory(){
getTrajectory() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
let list :any[] = [];
let list: any[] = [];
points?.forEach((item: any) => {
list.push({
name: item.hgt,
@ -173,7 +167,7 @@ sureArrive(item: any) {
});
this.mapList = list;
this.addressItems = res.parkArray;
if(this.addressItems && this.addressItems.length > 0){
if (this.addressItems && this.addressItems.length > 0) {
this.addressItems.forEach(item => {
item.parkBte = this.getLocalTime(item.parkBte);
});
@ -182,12 +176,12 @@ sureArrive(item: any) {
});
}
// 获取司机轨迹
getDriverTrajectory(){
// 获取司机轨迹
getDriverTrajectory() {
this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => {
if (res) {
const points = res.tracks;
let list :any[] = [];
let list: any[] = [];
points?.forEach((item: any) => {
list.push({
name: item.hgt,
@ -196,23 +190,27 @@ sureArrive(item: any) {
});
});
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;
const addressItems = [...res.tracks];
if (addressItems) {
addressItems.forEach(item => {
// item.parkBte = item.gtm;
item.parkBte = this.getLocalTime(item.gtm);
item.parkAdr = item.appAdress;
});
this.addressItems = [...addressItems];
} else {
this.addressItems = [];
}
}
});
}
trajectoryChange(event:any){
if(event ==='car'){
this.getTrajectory()
}else if(event ==='driver'){
}
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');
}