|
@@ -7,7 +7,12 @@ import { MatTableDataSource } from '@angular/material/table';
|
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
|
import { lastValueFrom } from 'rxjs';
|
|
import { lastValueFrom } from 'rxjs';
|
|
|
import { AlertComponent } from 'src/app/components/resources/dialogs/alert/alert.component';
|
|
import { AlertComponent } from 'src/app/components/resources/dialogs/alert/alert.component';
|
|
|
-import { ObjectGetRequest, RequestLines, ResponseDataRequestLines, ResponseRequestLines } from 'src/app/interfaces/acquisition-management/acquisition/order.interface';
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ ObjectGetRequest,
|
|
|
|
|
+ RequestLines,
|
|
|
|
|
+ ResponseDataRequestLines,
|
|
|
|
|
+ ResponseRequestLines,
|
|
|
|
|
+} from 'src/app/interfaces/acquisition-management/acquisition/order.interface';
|
|
|
import { AlertData } from 'src/app/interfaces/alert.interface';
|
|
import { AlertData } from 'src/app/interfaces/alert.interface';
|
|
|
import { OrderService } from 'src/app/services/acquisition-management/acquisition/order.service';
|
|
import { OrderService } from 'src/app/services/acquisition-management/acquisition/order.service';
|
|
|
import { EncService } from 'src/app/services/enc/enc.service';
|
|
import { EncService } from 'src/app/services/enc/enc.service';
|
|
@@ -16,34 +21,83 @@ import { ResourcesService } from 'src/app/services/resources/resources.service';
|
|
|
@Component({
|
|
@Component({
|
|
|
selector: 'app-gdel',
|
|
selector: 'app-gdel',
|
|
|
templateUrl: './gdel.component.html',
|
|
templateUrl: './gdel.component.html',
|
|
|
- styleUrls: ['./gdel.component.css']
|
|
|
|
|
|
|
+ styleUrls: ['./gdel.component.css'],
|
|
|
})
|
|
})
|
|
|
-export class GDELComponent implements AfterViewInit, OnInit {
|
|
|
|
|
- public displayedColumns: Array<string> = ['ID','DESCRIPCION','CANTIDAD','FECHA','USUARIO','ESTADO','ACCIONES'];
|
|
|
|
|
- public dataSource: MatTableDataSource<RequestLines>;
|
|
|
|
|
|
|
+export class GDELComponent implements AfterViewInit, OnInit {
|
|
|
|
|
+ public displayedColumns: Array<string>;
|
|
|
|
|
+
|
|
|
|
|
+ public dataSource: MatTableDataSource<any>;
|
|
|
@ViewChild(MatPaginator) paginator!: MatPaginator;
|
|
@ViewChild(MatPaginator) paginator!: MatPaginator;
|
|
|
@ViewChild(MatSort) sort!: MatSort;
|
|
@ViewChild(MatSort) sort!: MatSort;
|
|
|
|
|
|
|
|
- public isLoading: boolean = false;
|
|
|
|
|
- public isLoadingForm: boolean = false;
|
|
|
|
|
-
|
|
|
|
|
- public btnSmall: boolean = false;
|
|
|
|
|
- public card_size = 'card-size-normal mat-elevation-z8';
|
|
|
|
|
-
|
|
|
|
|
- public quantityCarArtitle: number;
|
|
|
|
|
|
|
+ public isLoading: boolean;
|
|
|
|
|
+ public isLoadingForm: boolean;
|
|
|
|
|
+ public active: number = 0;
|
|
|
|
|
+ public btnSmall: boolean;
|
|
|
|
|
+ public ulOptSmall: boolean;
|
|
|
|
|
+ public txtBuscador: string;
|
|
|
|
|
+ public clickedIndex: any = 0;
|
|
|
|
|
+ public options = [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 1,
|
|
|
|
|
+ items: 'Mis documentos',
|
|
|
|
|
+ icon: 'local_library',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 2,
|
|
|
|
|
+ items: 'Compartidos Conmigo',
|
|
|
|
|
+ icon: 'group_add',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 3,
|
|
|
|
|
+ items: 'Papelera',
|
|
|
|
|
+ icon: 'delete',
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ public documents: Array<any> = [];
|
|
|
|
|
+ public visualice: boolean;
|
|
|
constructor(
|
|
constructor(
|
|
|
private _encService: EncService,
|
|
private _encService: EncService,
|
|
|
- private _orderService: OrderService,
|
|
|
|
|
private _resourcesServices: ResourcesService,
|
|
private _resourcesServices: ResourcesService,
|
|
|
private _dialog: MatDialog,
|
|
private _dialog: MatDialog,
|
|
|
- private _router: Router,
|
|
|
|
|
|
|
+ private _router: Router
|
|
|
) {
|
|
) {
|
|
|
|
|
+ this.displayedColumns = [
|
|
|
|
|
+ 'ID',
|
|
|
|
|
+ 'NOMBRE',
|
|
|
|
|
+ 'PROPIETARIO',
|
|
|
|
|
+ 'FERG',
|
|
|
|
|
+ 'TAMANIO',
|
|
|
|
|
+ 'ACCIONES',
|
|
|
|
|
+ ];
|
|
|
this.dataSource = new MatTableDataSource();
|
|
this.dataSource = new MatTableDataSource();
|
|
|
- this.quantityCarArtitle = null !;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.isLoading = false;
|
|
|
|
|
+ this.isLoadingForm = false;
|
|
|
|
|
+ this.btnSmall = false;
|
|
|
|
|
+ this.ulOptSmall = false;
|
|
|
|
|
+ this.txtBuscador = '';
|
|
|
|
|
+ this.visualice = true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
ngOnInit(): void {
|
|
|
this.onResize();
|
|
this.onResize();
|
|
|
|
|
+
|
|
|
|
|
+ this.dataSource.data = [
|
|
|
|
|
+ {
|
|
|
|
|
+ ID: 1,
|
|
|
|
|
+ NOMBRE: 'Mis documentos',
|
|
|
|
|
+ PROPIETARIO: 'local_library',
|
|
|
|
|
+ FERG: 'local_library',
|
|
|
|
|
+ TAMANIO: 'local_library',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ID: 2,
|
|
|
|
|
+ NOMBRE: 'Mis documentos',
|
|
|
|
|
+ PROPIETARIO: 'local_library',
|
|
|
|
|
+ FERG: 'local_library',
|
|
|
|
|
+ TAMANIO: 'local_library',
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
//this.getAllRequestLines();
|
|
//this.getAllRequestLines();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -57,9 +111,10 @@ export class GDELComponent implements AfterViewInit, OnInit {
|
|
|
let dataDialog: AlertData = {} as AlertData;
|
|
let dataDialog: AlertData = {} as AlertData;
|
|
|
if (type === 'CANCEL') {
|
|
if (type === 'CANCEL') {
|
|
|
dataDialog = {
|
|
dataDialog = {
|
|
|
- icon: "warning",
|
|
|
|
|
- title: "Cancelar Solicitud",
|
|
|
|
|
- description: "¿Está seguro de cancelar la línea de solicitud de compra?"
|
|
|
|
|
|
|
+ icon: 'warning',
|
|
|
|
|
+ title: 'Cancelar Solicitud',
|
|
|
|
|
+ description:
|
|
|
|
|
+ '¿Está seguro de cancelar la línea de solicitud de compra?',
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -73,6 +128,7 @@ export class GDELComponent implements AfterViewInit, OnInit {
|
|
|
// Se obtiene la respuesta obtenida por la alerta
|
|
// Se obtiene la respuesta obtenida por la alerta
|
|
|
dialogRef.afterClosed().subscribe((result) => {
|
|
dialogRef.afterClosed().subscribe((result) => {
|
|
|
if (result && type === 'CANCEL') {
|
|
if (result && type === 'CANCEL') {
|
|
|
|
|
+ console.log(result);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
this.isLoadingForm = false;
|
|
this.isLoadingForm = false;
|
|
@@ -83,22 +139,39 @@ export class GDELComponent implements AfterViewInit, OnInit {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Método de filtrado de datos
|
|
// Método de filtrado de datos
|
|
|
- public applyFilter(event: Event) {
|
|
|
|
|
- const filterValue = (event.target as HTMLInputElement).value;
|
|
|
|
|
|
|
+ public applyFilter(event: any, type: string): void {
|
|
|
|
|
+ let filterValue: string;
|
|
|
|
|
+ if (type == 'INP') {
|
|
|
|
|
+ filterValue = (event.target as HTMLInputElement).value;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.txtBuscador = event;
|
|
|
|
|
+ filterValue = event;
|
|
|
|
|
+ }
|
|
|
this.dataSource.filter = filterValue.trim().toLowerCase();
|
|
this.dataSource.filter = filterValue.trim().toLowerCase();
|
|
|
if (this.dataSource.paginator) {
|
|
if (this.dataSource.paginator) {
|
|
|
this.dataSource.paginator.firstPage();
|
|
this.dataSource.paginator.firstPage();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Método para reajustar la pantalla
|
|
|
|
|
- public onResize() {
|
|
|
|
|
- if (window.innerWidth <= 1400) {
|
|
|
|
|
- this.btnSmall = true;
|
|
|
|
|
- this.card_size = 'card-size-small';
|
|
|
|
|
- } else if (window.innerWidth > 1400) {
|
|
|
|
|
- this.btnSmall = false;
|
|
|
|
|
- this.card_size = 'card-size-normal mat-elevation-z8';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public onResize(): void {
|
|
|
|
|
+ this.btnSmall = window.innerWidth <= 1405;
|
|
|
|
|
+ this.ulOptSmall = window.innerWidth <= 1405;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ selectTab(index: number) {
|
|
|
|
|
+ this.active = index;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public openViewer() {
|
|
|
|
|
+ console.log('click');
|
|
|
|
|
+
|
|
|
|
|
+ this.visualice = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // Método para dar formato a las fechas y horas
|
|
|
|
|
+ public formatDate(dateRegister: string, dateUpdate: string | null): string {
|
|
|
|
|
+ let date: string = dateUpdate === null ? dateRegister : dateUpdate;
|
|
|
|
|
+ let arrDateTime: Array<string> = date.split(' ');
|
|
|
|
|
+ let arrDate: Array<string> = arrDateTime[0].split('-');
|
|
|
|
|
+ return `${arrDate[2]}-${arrDate[1]}-${arrDate[0]} ${arrDateTime[1]}`;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|