44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { Component, ChangeDetectorRef } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { TableModule } from 'primeng/table';
|
|
import { RouteNoAssignedResponse } from '../../../core/models/route.model';
|
|
import { RouteState } from '../../../core/route-state/route';
|
|
|
|
@Component({
|
|
standalone: true,
|
|
selector: 'app-no-assigned-route',
|
|
imports: [CommonModule, TableModule],
|
|
templateUrl: './no-assigned-route.component.html',
|
|
styleUrls: ['./no-assigned-route.component.css']
|
|
})
|
|
export class NoAssignedRouteComponent {
|
|
|
|
noAssignedRoutes: RouteNoAssignedResponse[] = [];
|
|
isLoading = false;
|
|
cols: any[] = [];
|
|
|
|
constructor(
|
|
private routesState: RouteState,
|
|
private cdr: ChangeDetectorRef
|
|
) {}
|
|
|
|
ngOnInit() {
|
|
this.routesState.loading$.subscribe(value => {
|
|
this.isLoading = value;
|
|
this.cdr.detectChanges();
|
|
});
|
|
this.routesState.noAssignedRoutes$.subscribe(data => {
|
|
this.noAssignedRoutes = [...data];
|
|
this.cdr.detectChanges();
|
|
});
|
|
this.cols = [
|
|
{ field: 'pdv_id', header: 'PDV ID' },
|
|
{ field: 'pdv_nombre', header: 'Nombre' },
|
|
{ field: 'minimo_horas_semana', header: 'Min. Horas/Sem' },
|
|
{ field: 'latitud', header: 'Latitud' },
|
|
{ field: 'longitud', header: 'Longitud' },
|
|
{ field: 'motivo', header: 'Motivo' }
|
|
];
|
|
}
|
|
}
|