parent
c399bb14fa
commit
4cfc1c8a13
@ -0,0 +1,31 @@ |
||||
<ng-container *ngIf="chargement"> |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
<ng-container *ngIf="!chargement"> |
||||
<ng-container *ngIf="ep == undefined"> |
||||
<p> Aucun prochain EP n'a été trouvé </p> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="ep != undefined"> |
||||
<ng-container *ngIf="ep.statut == statutEP.cree"> |
||||
<p> Prochain {{ep.type}} disponible pour saisie le {{ ep.dateDisponibilite | date: "dd/MM/yyyy" }} </p> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="ep.statut != statutEP.cree"> |
||||
<p> {{ep.type}} : {{ afficherStatutEP(ep.statut) }} </p> |
||||
<p> Disponible depuis le {{ ep.dateDisponibilite | date : "dd/MM/yyyy" }}</p> |
||||
<p> Date d'entretien le {{ ep.datePrevisionnelle | date : "dd/MM/yyyy" }}</p> |
||||
<ng-container *ngIf="ep.referent != undefined"> |
||||
<p> Référent EP : {{ep.referent.nom}} {{ep.referent.prenom}} </p> |
||||
</ng-container> |
||||
|
||||
|
||||
<ng-container *ngIf="ep.referent == undefined"> |
||||
<p> Il n'y a actuellement aucun référent pour cet EP </p> |
||||
</ng-container> |
||||
|
||||
<button mat-stroked-button *ngIf="ep.statut != statutEP.Disponible" [routerLink]="['/ep',ep.id]">Accéder à l'EP</button> |
||||
</ng-container> |
||||
</ng-container> |
||||
|
||||
</ng-container> |
@ -0,0 +1,50 @@ |
||||
import { Component, Input, OnInit } from "@angular/core" |
||||
import { affichageStatut, EpInformationDTO, EpService, StatutEp } from "@shared/api-swagger"; |
||||
import { Subscription } from "rxjs"; |
||||
|
||||
|
||||
|
||||
@Component({ |
||||
selector: "prochain-ep", |
||||
templateUrl: "./prochain-ep.component.html" |
||||
}) |
||||
export class ProchainEpComponent implements OnInit { |
||||
|
||||
statutEP : any = StatutEp; |
||||
|
||||
@Input() idCollaborateur: string; |
||||
|
||||
chargement: boolean = true; |
||||
|
||||
ep : EpInformationDTO; |
||||
|
||||
epSubscription: Subscription; |
||||
|
||||
constructor(private epService: EpService) { |
||||
|
||||
} |
||||
|
||||
ngOnInit() { |
||||
this.epSubscription = this.epService.getProchainEPCollaborateur(this.idCollaborateur).subscribe( |
||||
ep => { |
||||
console.log(ep); |
||||
this.ep = ep; |
||||
this.chargement = false; |
||||
}, |
||||
err => {
|
||||
this.chargement = false;
|
||||
console.log(err)
|
||||
} |
||||
); |
||||
} |
||||
|
||||
afficherStatutEP(statut: StatutEp) { |
||||
return affichageStatut(statut); |
||||
} |
||||
|
||||
ngDestroy() { |
||||
if(this.epSubscription != undefined) |
||||
this.epSubscription.unsubscribe(); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue