|
|
@@ -32,6 +32,7 @@ export class MESMHSComponent implements AfterViewInit {
|
|
|
dataSource = new MatTableDataSource<any>(this.solicitudes);
|
|
|
subordinados: any;
|
|
|
isAdmin = false;
|
|
|
+ today = new Date();
|
|
|
@ViewChild(MatPaginator) paginator!: MatPaginator;
|
|
|
|
|
|
constructor(
|
|
|
@@ -98,7 +99,6 @@ export class MESMHSComponent implements AfterViewInit {
|
|
|
this.loading = false;
|
|
|
this.dataSource.data = res.response;
|
|
|
this.historial_admin = res.response;
|
|
|
- this.data_empty = false;
|
|
|
this.cargarTabla(res.response);
|
|
|
} else {
|
|
|
this.solicitudes = [];
|
|
|
@@ -329,6 +329,8 @@ export class MESMHSComponent implements AfterViewInit {
|
|
|
) => {
|
|
|
if (solicitud.PERIODOVACACIONAL == null) {
|
|
|
solicitud.PERIODOVACACIONAL = 'N/A';
|
|
|
+ } else {
|
|
|
+ solicitud.PERIODOVACACIONAL = this.formatoFechaPeriodo(solicitud.PERIODOVACACIONAL);
|
|
|
}
|
|
|
|
|
|
solicitud.FECHAINICIAL = this.formato(solicitud.FECHAINICIAL);
|
|
|
@@ -338,6 +340,16 @@ export class MESMHSComponent implements AfterViewInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ validatedDateNow(element:any) {
|
|
|
+ let finalDate = this.getDateWithString(this.dateFormat(element.FECHAFINAL));
|
|
|
+
|
|
|
+ if (element.ESTATUS !== 'Aprobado' && finalDate.getTime() > this.today.getTime()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
openDialogForm(item: any) {
|
|
|
let dataAction = {
|
|
|
action: 'Detalles solicitud',
|
|
|
@@ -360,6 +372,18 @@ export class MESMHSComponent implements AfterViewInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private getDateWithString(fecha: string) {
|
|
|
+ let fechaAux = fecha.split('-');
|
|
|
+
|
|
|
+ return new Date(parseInt(fechaAux[0]), parseInt(fechaAux[1]) - 1, parseInt(fechaAux[2]));
|
|
|
+ }
|
|
|
+
|
|
|
+ private dateFormat(fecha: string) {
|
|
|
+ let fechaAux = fecha.split('-');
|
|
|
+
|
|
|
+ return `${fechaAux[2]}-${fechaAux[1]}-${fechaAux[0]}`;
|
|
|
+ }
|
|
|
+
|
|
|
obtenerIDUsuario(item: any) {
|
|
|
|
|
|
let arr1 = item.split('(');
|