4
0

2 Commity 9587e87732 ... 42941dbb74

Autor SHA1 Správa Dátum
  Alan Garcia 42941dbb74 Merge branch 'master' of http://209.50.56.224/git/ITTEC/SistemaIntegralRecursosHumanos 3 rokov pred
  Alan Garcia c8bf747610 Empleados de Jefe Directo en reportes 3 rokov pred

+ 1 - 1
vacaciones/src/app/components/mes/mesmre/mesmre.component.html

@@ -16,7 +16,7 @@
               >
                 {{ opcion.valor == 0 ? opcion.tipo + ': [' +nombre_usuario+ ']' : opcion.tipo }}
               </mat-option>
-              <ng-template [ngIf]="!isUser">
+              <ng-template [ngIf]="role == 'Administrador' || role == 'Jefe Directo'">
                 <mat-divider></mat-divider>
                 <mat-option class="secondary">{{
                     role == "Administrador"

+ 10 - 8
vacaciones/src/app/components/mes/mesmre/mesmre.component.ts

@@ -200,7 +200,7 @@ export class MESMREComponent implements AfterViewInit {
             )
           )
       );
-    } else if (this._encService.desencriptar(JSON.parse(localStorage.getItem('TIMUSERENC')!).PERFIL) !== '1') {
+    } else {
       await lastValueFrom(this.__mesmreService.consultarEmpleados()).then(
         (res: any) => {
           if (res.error) {
@@ -209,6 +209,10 @@ export class MESMREComponent implements AfterViewInit {
             );
           } else {
             this.empleados = res.response;
+
+            if (this.empleados.length > 0) {
+                this.role = "Jefe Directo"
+            }
           }
         },
         (error: any) => {
@@ -223,12 +227,10 @@ export class MESMREComponent implements AfterViewInit {
           }
         }
       );
-
-      this.empleados = [
-        ...new Map(
-          this.empleados.map((empleado) => [empleado.NOMBREEMPLEADO, empleado])
-        ).values(),
-      ];
+      
+      this.empleados = this.empleados.map(function(empleado) {
+          return {NOMBREEMPLEADO: empleado.USUARIO}
+      }) as MESMREInterface[];
     }
   }
 
@@ -268,7 +270,7 @@ export class MESMREComponent implements AfterViewInit {
   }
 
   async filtroSolicitudes(filtro: string) {
-    if (!this.isUser) {
+    if (this.role === 'Administrador' || this.role === 'Jefe Directo') {
       let aux_response: any;
       this.isReloading = true;
       this.tipoSolicitud = filtro;

+ 2 - 1
vacaciones/src/app/interfaces/mes/mesmre/mesmre-interface.ts

@@ -7,5 +7,6 @@ export interface MESMREInterface {
     ESTATUS: string,
     PERIODOVACACIONAL: string,
     VACACIONESANTES: number,
-    VACACIONESDESPUES: number
+    VACACIONESDESPUES: number, 
+    USUARIO: string
 }