From 8a5398658e0c6b2815921e8f478e0e8cc1a49d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Thu, 25 Feb 2021 10:37:56 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20d=C3=A9tails=20col?= =?UTF-8?q?laborateur=20et=20r=C3=A9f=C3=A9rent=20pour=20afficher=20les=20?= =?UTF-8?q?EP=20en=20cours=20et=20les=20EP=20pass=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../affichage-details-collaborateur.html | 11 ++-- .../affichage-details-collaborateur.ts | 14 +++++- .../shared/mat-tables/ep-table/ep-table.html | 2 +- .../shared/mat-tables/ep-table/ep-table.ts | 50 +++++++++++++++++-- src/app/shared/utils/cles.ts | 6 ++- 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html index 2b0f210..5f725a0 100644 --- a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html +++ b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html @@ -12,20 +12,23 @@ + - + - + - + + - + + diff --git a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts index d036ea4..3981b82 100644 --- a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts +++ b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from "@angular/core"; import { CollaborateurDTO, CollaborateursService, ParticipationFormationDTO, ParticipationsFormationsService } from "@shared/api-swagger"; import { Subscription } from "rxjs"; -import { collaborateurTypeRecherche } from "@shared/utils/cles"; +import { collaborateurTypeRecherche, epTypeRecherche } from "@shared/utils/cles"; import { MatDialog } from "@angular/material/dialog"; import { DialogAssignationRapideReferentComponent, DialogAssignationRapideCollaborateursComponent } from "./dialog-assignation-rapide/dialog-assignation-rapide.component"; import { Router } from "@angular/router"; @@ -18,9 +18,19 @@ export class AffichageDetailsCollaborateurComponent implements OnInit{ typeRecherche : string = collaborateurTypeRecherche.collaborateursEP; - displayedColumns : string[] = ["businessunit", "collaborateur", "datearrivee"]; + + epTypeRecherche : any = epTypeRecherche; + + displayedColumnsCollaborateurs : string[] = ["businessunit", "collaborateur", "datearrivee"]; + + displayedColumnsEPReferent : string[] = ["agence", "collaborateur", "datearrivee", "typeep", "statutep", "dateentretien" ]; + displayedColumnsParticipationFormaton: string[]= ["intitule", "statut", "dateCreation", "ep", "evaluation"]; + + displayedColumnsEPCollaborateur: string[] = ["agence", "referent", "typeep", "statutep", "dateentretien" ]; + rechercherParBU: boolean = false; + rechercherParDate: boolean= false; collaborateur: CollaborateurDTO = undefined; diff --git a/src/app/shared/mat-tables/ep-table/ep-table.html b/src/app/shared/mat-tables/ep-table/ep-table.html index c03a7cf..7b08a9a 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.html +++ b/src/app/shared/mat-tables/ep-table/ep-table.html @@ -93,7 +93,7 @@ - Date prévisionnelle + Date entretien {{ row.datePrevisionnelle | date : 'dd/MM/yyyy'}} diff --git a/src/app/shared/mat-tables/ep-table/ep-table.ts b/src/app/shared/mat-tables/ep-table/ep-table.ts index f01a626..5138072 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.ts +++ b/src/app/shared/mat-tables/ep-table/ep-table.ts @@ -63,6 +63,8 @@ export class EpTableComponent implements OnInit{ dataSource : MatTableDataSource; + @Input() idCollaborateur : string; + @Input() typeRechercheEP : string; @Input() displayedColumns: string[]; @@ -98,10 +100,52 @@ export class EpTableComponent implements OnInit{ this.getEPEnCours(); break; case epTypeRecherche.EPSignes: - this.getEPEnSignes(); + this.getEPSignes(); + break; + case epTypeRecherche.RechercheEPReferentEnCours: + this.getEPEnCoursReferent(); + break; + case epTypeRecherche.RechercheEPReferentSignes: + this.getEPSignesReferent(); + break; + case epTypeRecherche.RechercheEPCollaborateursSignes: + this.getEpsignesCollaborateur(); break; } - + } + + + getEpsignesCollaborateur() { + this.epSubscription = this.epService.getEPSignesCollaborateur(this.idCollaborateur).subscribe( + eps => this.dataSource = new MatTableDataSource(eps), + err => console.log(err), + ); + } + + getEPSignesReferent() { + this.epSubscription = this.epService.getEPSignesReferent(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin).subscribe( + eps => { + this.dataSource = new MatTableDataSource(eps); + this.epCountSubscription = this.epService.getEPSignesReferentCount(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin).subscribe( + count => this.taille = count, + err => console.log(err) + ); + }, + err => console.log(err) + ); + } + + getEPEnCoursReferent() { + this.epSubscription = this.epService.getEPEnCoursReferent(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri, true, this.dateDebut, this.dateFin ).subscribe( + eps => { + this.dataSource = new MatTableDataSource(eps); + this.epCountSubscription = this.epService.getEPSignesReferentCount(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin ).subscribe( + count => this.taille = count, + err => console.log(err) + ); + }, + err => console.log(err) + ); } getEPEnCours() { @@ -128,7 +172,7 @@ export class EpTableComponent implements OnInit{ return estEnAttente(statut); } - getEPEnSignes() { + getEPSignes() { this.epSubscription = this.epService.getEPSignes(this.busIds, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin).subscribe( eps => { console.log(eps); diff --git a/src/app/shared/utils/cles.ts b/src/app/shared/utils/cles.ts index d2154cd..a61f9d5 100644 --- a/src/app/shared/utils/cles.ts +++ b/src/app/shared/utils/cles.ts @@ -16,5 +16,9 @@ export const engagementTypeRecherche = { export const epTypeRecherche = { EPEnCours: "EPEnCours", - EPSignes: "EPSignes" + EPSignes: "EPSignes", + RechercheEPReferentEnCours : "RechercheEPReferentEnCours", + RechercheEPReferentSignes : "RechercheEPReferentEnSignes", + RechercheEPCollaborateursSignes : "RechercheEPCollaborateursSignes" + } \ No newline at end of file