|
|
|
@ -1,4 +1,7 @@ |
|
|
|
|
import { Component, OnInit } from "@angular/core"; |
|
|
|
|
import { CollaborateurDTO, CollaborateursService } from "@shared/api-swagger"; |
|
|
|
|
import { collaborateurTypeRecherche } from "@shared/utils/cles"; |
|
|
|
|
import { Subscription } from "rxjs"; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'assignation-referent', |
|
|
|
@ -6,9 +9,52 @@ import { Component, OnInit } from "@angular/core"; |
|
|
|
|
}) |
|
|
|
|
export class AssignationReferentComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor() {} |
|
|
|
|
rechercherParDate: boolean = false; |
|
|
|
|
|
|
|
|
|
rechercherParBu: boolean = true; |
|
|
|
|
|
|
|
|
|
referentChoisi : CollaborateurDTO = undefined; |
|
|
|
|
|
|
|
|
|
rolesReferents : string[] = ["Manager", "RA", "CP", "TL"]; |
|
|
|
|
|
|
|
|
|
rolesCollaborateurs : ["Collaborateur"]; |
|
|
|
|
|
|
|
|
|
typeRechercheReferent: string = collaborateurTypeRecherche.referents; |
|
|
|
|
|
|
|
|
|
collaborateursEP: CollaborateurDTO[] = []; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Liste des colonnes du tableau à afficher pour les référents. |
|
|
|
|
*/ |
|
|
|
|
displayedColumnsReferent : string[] = ["businessunit", "collaborateur"]; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Liste des colonnes du tableau à afficher. |
|
|
|
|
*/ |
|
|
|
|
displayedColumns : string[] = ["businessunit", "collaborateur"]; |
|
|
|
|
|
|
|
|
|
collaborateurSubscription: Subscription; |
|
|
|
|
|
|
|
|
|
constructor(private collaborateurService: CollaborateursService) {} |
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
choixReferent(event) { |
|
|
|
|
this.referentChoisi = event.collaborateur; |
|
|
|
|
this.setCollaborateurEP(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setCollaborateurEP() { |
|
|
|
|
this.collaborateurSubscription = this.collaborateurService.getCollaborateursByReferent(this.referentChoisi.id).subscribe( |
|
|
|
|
collaborateurs => { |
|
|
|
|
this.collaborateursEP = collaborateurs; |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
error => console.log(error) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |