|
|
@@ -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;
|