Skip to content

Commit

Permalink
feat(top): mostrar cantidad solicitudes (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
plammel authored Dec 18, 2020
1 parent efe9f9c commit 989b171
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
19 changes: 19 additions & 0 deletions src/app/components/top/pipes/auditorias-solicitud.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Auth } from '@andes/auth';
import { Pipe, PipeTransform } from '@angular/core';
import { IPrestacion } from '../../../modules/rup/interfaces/prestacion.interface';

@Pipe({
name: 'auditoriasSolicitud'
})
export class AuditoriasSolicitudPipe implements PipeTransform {
constructor(private auth: Auth) { }
transform(prestacion: IPrestacion): any {
const accionesAuditorias = [
'rechazada',
'pendiente',
'referir',
'devolver'
];
return prestacion.solicitud.historial.filter(e => accionesAuditorias.includes(e.accion)).length;
}
}
16 changes: 12 additions & 4 deletions src/app/components/top/solicitudes/solicitudes.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,18 @@
<plex-badge type="info" *ngIf="!prestacion.solicitud.turno && estado === 'rechazada'">
CONTRARREFERIDA
</plex-badge>
<plex-badge type="warning"
*ngIf=" !prestacion.solicitud.turno && prestacion.estadoActual.tipo === 'auditoria'">
{{prestacion.estadoActual.tipo}}
</plex-badge>

<ng-container *ngIf="!prestacion.solicitud.turno && prestacion.estadoActual.tipo === 'auditoria'">
<plex-badge type="warning" class="mr-0">
{{prestacion.estadoActual.tipo}}
</plex-badge>
<plex-badge type="danger bg-danger" class="ml-0" *ngIf="prestacion | auditoriasSolicitud as auditorias">
<span class="text-white">
<strong>{{auditorias}}</strong>
</span>
</plex-badge>
</ng-container>

<plex-badge *ngIf="estado === 'Turno dado'" type="success">Turno dado</plex-badge>
<plex-badge *ngIf="prestacion.solicitud.turno && prestacion.estadoActual.tipo === 'validada'"
type="success">Registro en HUDS</plex-badge>
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/top/top.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { DetalleSolicitudComponent } from './solicitudes/detalleSolicitud.compon
import { PrestacionSolicitudComponent } from './solicitudes/prestacionSolicitud.component';
import { VisualizacionReglasTopComponent } from './reglas/visualizacionReglasTop.component';
import { EstadoSolicitudPipe } from './pipes/estado-solicitud.pipe';
import { AuditoriasSolicitudPipe } from './pipes/auditorias-solicitud.pipe';
import { BotonesSolicitudPipe } from './pipes/botones.pipe';


Expand Down Expand Up @@ -63,6 +64,7 @@ export const TOP_ROUTES = [
ListaReglasComponent,
BusquedaPacienteComponent,
EstadoSolicitudPipe,
AuditoriasSolicitudPipe,
BotonesSolicitudPipe
]
})
Expand Down

0 comments on commit 989b171

Please sign in to comment.