|
|
@@ -200,6 +200,9 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
this.snackAlert('Sesión expirada. Vuelva a iniciar sesión');
|
|
|
}else if (!res.status && res.response.length > 0) {
|
|
|
this.periodos = res.response;
|
|
|
+ this.periodos.map((periodo) => {
|
|
|
+ periodo.PERIODO = this.formatoFechaPeriodo(periodo.PERIODO).join();
|
|
|
+ })
|
|
|
}else{
|
|
|
if (res.msg !== "EXITO") {
|
|
|
this.snackAlert(res.msg);
|
|
|
@@ -345,10 +348,10 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
filtro_solicitudes = filtro_solicitudes.filter(solicitud => solicitud.ESTATUS == this.opcionEstatus);
|
|
|
//RANGO FECHAS Y PERIODO
|
|
|
}else if (this.rango.value.fecha_inicio != null && this.rango.value.fecha_fin != null && this.opcionPeriodo != null) {
|
|
|
- filtro_solicitudes = filtro_solicitudes.filter(solicitud => solicitud.ESTATUS == this.opcionEstatus);
|
|
|
+ filtro_solicitudes = filtro_solicitudes.filter(solicitud => solicitud.PERIODOVACACIONAL == this.opcionPeriodo);
|
|
|
//ESTATUS Y PERIODO
|
|
|
}else if (this.opcionEstatus != null && this.opcionPeriodo != null) {
|
|
|
- filtro_solicitudes = this.solicitudes.filter(solicitud => solicitud.ESTATUS == this.opcionEstatus && solicitud.PERIODOVACACIONAL == this.opcionPeriodo);
|
|
|
+ filtro_solicitudes = this.solicitudes.filter(solicitud => solicitud.ESTATUS == this.opcionEstatus && solicitud.PERIODOVACACIONAL == this.opcionPeriodo);
|
|
|
//ESTATUS
|
|
|
}else if (this.opcionEstatus != null) {
|
|
|
filtro_solicitudes = this.solicitudes.filter(solicitud => solicitud.ESTATUS == this.opcionEstatus);
|
|
|
@@ -472,11 +475,13 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
}
|
|
|
|
|
|
mapearTabla() {
|
|
|
- this.solicitudes.map(function (
|
|
|
+ this.solicitudes.map((
|
|
|
solicitud: MESMREInterface
|
|
|
- ) {
|
|
|
+ ) => {
|
|
|
if (solicitud.PERIODOVACACIONAL == null) {
|
|
|
solicitud.PERIODOVACACIONAL = 'N/A';
|
|
|
+ } else {
|
|
|
+ solicitud.PERIODOVACACIONAL = this.formatoFechaPeriodo(solicitud.PERIODOVACACIONAL).join();
|
|
|
}
|
|
|
if (solicitud.VACACIONESANTES == null) {
|
|
|
solicitud.VACACIONESANTES = 0;
|
|
|
@@ -484,6 +489,7 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
if (solicitud.VACACIONESDESPUES == null) {
|
|
|
solicitud.VACACIONESDESPUES = 0;
|
|
|
}
|
|
|
+
|
|
|
return {
|
|
|
IDSOLICITUD: solicitud.IDSOLICITUD,
|
|
|
NOMBREEMPLEADO: solicitud.NOMBREEMPLEADO,
|
|
|
@@ -534,11 +540,6 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
this.mapearTabla();
|
|
|
}
|
|
|
|
|
|
- formatoFecha(fecha:string): string {
|
|
|
- let split = fecha.split('-');
|
|
|
- return `${split[2]}-${split[1]}-${split[0]}`
|
|
|
- }
|
|
|
-
|
|
|
applyFilter(filterValue: any) {
|
|
|
this.dataSource.filter = filterValue.target.value.trim().toLowerCase();
|
|
|
}
|
|
|
@@ -581,15 +582,24 @@ export class MESMREComponent implements AfterViewInit {
|
|
|
+ (dia < 10 ? '0': '') + dia + '_' + (hora < 10 ? '0': '') + hora
|
|
|
+ (minuto < 10 ? '0': '') + minuto + (segundos < 10 ? '0': '') + segundos;
|
|
|
|
|
|
- this.excel.generarExcel(this.selection.selected, filename, titulo)
|
|
|
+ this.excel.generarExcel(this.selection.selected, filename, titulo);
|
|
|
} else {
|
|
|
this.snackAlert('Para generar el Excel se debe seleccionar al menos una fila');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- formatDate(fecha:string){
|
|
|
- let arrFecha = fecha.split("-");
|
|
|
- return `${arrFecha[2]}-${arrFecha[1]}-${arrFecha[0]}`;
|
|
|
+ formatoFecha(fecha:string): string {
|
|
|
+ let split = fecha.split('-');
|
|
|
+ return `${split[2]}-${split[1]}-${split[0]}`
|
|
|
+ }
|
|
|
+
|
|
|
+ formatoFechaPeriodo(item: any) {
|
|
|
+ let arrPeriodoVacacional = [];
|
|
|
+ let fechaPeriodo = item.split('|');
|
|
|
+
|
|
|
+ arrPeriodoVacacional.push('De ' + this.formatoFecha(fechaPeriodo[0]) + ' a ' +this.formatoFecha(fechaPeriodo[1]));
|
|
|
+
|
|
|
+ return arrPeriodoVacacional;
|
|
|
}
|
|
|
|
|
|
private snackAlert(mensaje: string) {
|