Commit 382fb28b authored by hasan khaddour's avatar hasan khaddour

add completuon report

parent d6447fc8
import { Employee } from "../../../employees/models/responses/employee"
import { PersonalInfo } from "../../../employees/models/vakueObjects/personalInfo"
import { WorkInfo } from "../../../employees/models/vakueObjects/workInfo"
export class EmployeeContribution {
employee :Employee
contributionRatio : number
}
\ No newline at end of file
...@@ -20,6 +20,7 @@ import { CompleteProjectRequest } from '../models/requests/project-requests/comp ...@@ -20,6 +20,7 @@ import { CompleteProjectRequest } from '../models/requests/project-requests/comp
import { ChangeEmployeeParticipationRequest } from '../models/requests/project-requests/ChangeEmployeeParticipationRequest'; import { ChangeEmployeeParticipationRequest } from '../models/requests/project-requests/ChangeEmployeeParticipationRequest';
import { ParticipationChange } from '../models/responses/participationChange'; import { ParticipationChange } from '../models/responses/participationChange';
import { ProjectCompletion } from '../models/responses/ProjectCompletion'; import { ProjectCompletion } from '../models/responses/ProjectCompletion';
import { EmployeeContribution } from '../models/responses/employeeContribution';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -86,8 +87,21 @@ export class ProjectService { ...@@ -86,8 +87,21 @@ export class ProjectService {
.get<Project[]>(`${this.config.getServerUrl()}/Projects/ByFilter/?teamLeaderId=${request.teamLeaderrId}${pagination}`); .get<Project[]>(`${this.config.getServerUrl()}/Projects/ByFilter/?teamLeaderId=${request.teamLeaderrId}${pagination}`);
} }
public getCompletionContribution(projectId : number ):Observable<EmployeeContribution[]>{
return this
.http
.get<EmployeeContribution[]>(`${this.config.getServerUrl()}/Projects/CompletionContributions/${projectId}`);
}
//#endregion queries //#endregion queries
//#region planning managment //#region planning managment
//tihs method responsible for hanging the team leader //tihs method responsible for hanging the team leader
...@@ -216,6 +230,11 @@ export class ProjectService { ...@@ -216,6 +230,11 @@ export class ProjectService {
return this.http.get<Attachment[]>(this.config.getServerUrl()+ "/Projects/Attachments/?projectId="+projectId); return this.http.get<Attachment[]>(this.config.getServerUrl()+ "/Projects/Attachments/?projectId="+projectId);
}
public removeAttachment(projectId : number ,attachmentId : number ):Observable<Attachment[]>{
return this.http.get<Attachment[]>(this.config.getServerUrl()+ "/Projects/RemoveAttachment/?projectId="+projectId+"&attachmentId="+attachmentId);
} }
//#endregion attachments //#endregion attachments
......
<p>employee-contribution-table works!</p> <p><strong>المساهمين في المشروع</strong></p>
<table class="table table-borderless table-striped">
<thead>
<tr>
<th scope="col" class="text-center">#</th>
<th scope="col" class="text-center">الرقم الذاتي</th>
<th scope="col" class="text-center">اسم المشارك</th>
<th scope="col" class="text-center">الهيئة</th>
<th scope="col" class="text-center">الهيئة</th>
<th scope="col" class="text-center">نسبة المساهمة</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let participant of contributers ; index as i " >
<th scope="row" class="text-center">{{i+1}}</th>
<td class="text-center"> {{participant.employee.hiastId}}
</td>
<td class="text-center">{{participant.employee.personalInfo | fullname }}</td>
<td class="text-center">{{participant.employee.workInfo.workJob}}</td>
<td class="text-center">{{participant.employee.workInfo.workType}}</td>
<td class="text-center">{{participant.contributionRatio}}</td>
</tr>
<tr *ngIf="contributers.length==0" >
<th scope="row"></th>
<td class="text-center"> </td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tbody>
</table>
import { Component } from '@angular/core'; import { Component, Input } from '@angular/core';
import { EmployeeContribution } from '../../../projects/models/responses/employeeContribution';
@Component({ @Component({
selector: 'employee-contribution-table', selector: 'employee-contribution-table',
...@@ -6,5 +7,5 @@ import { Component } from '@angular/core'; ...@@ -6,5 +7,5 @@ import { Component } from '@angular/core';
styleUrl: './employee-contribution-table.component.css' styleUrl: './employee-contribution-table.component.css'
}) })
export class EmployeeContributionTableComponent { export class EmployeeContributionTableComponent {
@Input() contributers :EmployeeContribution[]
} }
import { PersonalInfo } from "../../employees/models/vakueObjects/personalInfo"
import { WorkInfo } from "../../employees/models/vakueObjects/workInfo"
export class EmployeeContribution {
Email :string
hiastId :number
personalInof : PersonalInfo
workInof :WorkInfo
contribution: number
}
\ No newline at end of file
<div class="container-fluid" *ngIf="project"> <div class="container-fluid" *ngIf="project && contributers ">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12"> <div class="col-12">
<div class="row align-items-center mb-4"> <div class="row align-items-center mb-4">
...@@ -35,17 +35,15 @@ ...@@ -35,17 +35,15 @@
<project-header [projectInfo]="project.projectInfo"></project-header> <project-header [projectInfo]="project.projectInfo"></project-header>
<project-subjective [project]="project"> </project-subjective> <project-subjective [project]="project"> </project-subjective>
<hr /> <hr />
<p><strong>مراحل المشروع</strong></p> <p><strong>مساهمات العاملين بالانجاز</strong></p>
<step-table [steps]="project.steps"></step-table>
<hr /> <employee-contribution-table
<participants-table [contributers]="contributers"
[employeeParticipates]="project.employeeParticipates" >
></participants-table>
<p><strong>خطة الانفاق</strong></p> </employee-contribution-table>
<financial-spend-table <hr>
[financialSpending]="project.financialSpending"
></financial-spend-table>
<project-footer <project-footer
[proposer]="project.proposer" [proposer]="project.proposer"
[executer]="project.executer" [executer]="project.executer"
......
...@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router'; ...@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { ProjectService } from '../../../projects/services/project.service'; import { ProjectService } from '../../../projects/services/project.service';
import { ProjectCompletion } from '../../../projects/models/responses/ProjectCompletion'; import { ProjectCompletion } from '../../../projects/models/responses/ProjectCompletion';
import { EmployeeContribution } from '../../models/employeeContribution'; import { EmployeeContribution } from '../../../projects/models/responses/employeeContribution';
import { Track } from '../../../tracks/models/responses/track'; import { Track } from '../../../tracks/models/responses/track';
@Component({ @Component({
...@@ -43,15 +43,28 @@ export class ProjectCompletionComponent implements OnInit{ ...@@ -43,15 +43,28 @@ export class ProjectCompletionComponent implements OnInit{
this.toastr.error('المشروع لم ينجز بعد'); this.toastr.error('المشروع لم ينجز بعد');
this.router.navigate(['/']); this.router.navigate(['/']);
}else { }else {
this.loadCompletion(); // this.loadCompletion();
this.loadContributions();
} }
} }
}); });
} }
loadTracks(){ loadContributions() {
this
.projectService
.getCompletionContribution(this.projectId)
.subscribe({
next : (data)=>{
this.contributers= data;
}
});
} }
loadCompletion() { loadCompletion() {
this this
.projectService .projectService
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
> >
طباعة طباعة
</button> </button>
<button *ngIf="project.currentState.toLocaleLowerCase()=='completed'" [routerLink]="['/reports/completion',project.id]" type="button" class="btn mr-1 btn-secondary m-1">
تقرير انجاز </button>
<button type="button" class="btn mr-1 btn-secondary m-1"> <button type="button" class="btn mr-1 btn-secondary m-1">
تقرير متابعة المراحل تقرير متابعة المراحل
</button> </button>
......
...@@ -2,10 +2,12 @@ import { NgModule } from '@angular/core'; ...@@ -2,10 +2,12 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { ProjectDefinitionComponent } from './pages/project-definition/project-definition.component'; import { ProjectDefinitionComponent } from './pages/project-definition/project-definition.component';
import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.component'; import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.component';
import { ProjectCompletionComponent } from './pages/project-completion/project-completion.component';
const routes: Routes = [ const routes: Routes = [
{path: 'definition/:id',component:ProjectDefinitionComponent}, {path: 'definition/:id',component:ProjectDefinitionComponent},
{path: 'timeline/:id',component:ProjectTimeLineComponent}, {path: 'timeline/:id',component:ProjectTimeLineComponent},
{path: 'completion/:id',component:ProjectCompletionComponent}
]; ];
......
...@@ -10,7 +10,7 @@ export class StateTranslatePipe implements PipeTransform { ...@@ -10,7 +10,7 @@ export class StateTranslatePipe implements PipeTransform {
switch (state){ switch (state){
case "InPlan": case "InPlan":
return "يخطط"; return "يخطط";
case "Complete": case "Completed":
return "مكتمل"; return "مكتمل";
case "InProgress" : case "InProgress" :
return "التنفيذ"; return "التنفيذ";
......
...@@ -65,7 +65,7 @@ export class AddStepTrackModalComponent { ...@@ -65,7 +65,7 @@ export class AddStepTrackModalComponent {
onStepSelected(step: Step): void { onStepSelected(step: Step): void {
this.stepTrackForm.patchValue({ stepName: step.stepInfo?.stepName }); this.stepTrackForm.patchValue({ stepName: step.stepInfo?.stepName });
//this.stepTrackForm.patchValue({id: step.id}); //this.stepTrackForm.patchValue({id: step.id});
......
...@@ -72,10 +72,11 @@ export class CompleteTrackModalComponent { ...@@ -72,10 +72,11 @@ export class CompleteTrackModalComponent {
private _setCanMove(){ private _setCanMove(){
this this
.canComplete = this .canComplete =! this
.track .track
.trackInfo .trackInfo
.isCompleted .isCompleted
console.log(this.track)
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="row"> <div class="row">
<div class="col-6 label ">تاريخ عملية المتابعة {{track.trackInfo.trackDate | date}}</div> <div class="col-6 label ">تاريخ عملية المتابعة {{track.trackInfo.trackDate | date}}</div>
<button class="col-2 mr-1 btn btn-primary" *ngIf="!track.trackInfo.isCompleted">اكمال المتابعة</button> <button (click)="openComplete()" class="col-2 mr-1 btn btn-primary" *ngIf="!track.trackInfo.isCompleted">اكمال المتابعة</button>
<div class="col-2 btn disabled btn-success ">{{track.trackInfo.isCompleted ? 'مكتملة':'غير مكتملة'}}</div> <div class="col-2 btn disabled btn-success ">{{track.trackInfo.isCompleted ? 'مكتملة':'غير مكتملة'}}</div>
</div> </div>
......
...@@ -159,6 +159,22 @@ export class TrackDetailsComponent implements OnInit { ...@@ -159,6 +159,22 @@ export class TrackDetailsComponent implements OnInit {
} }
openComplete(){
const modalRef = this.modalService.open(CompleteTrackModalComponent);
modalRef.componentInstance.track = this.track;
modalRef.result.then((result) => {
if (result) {
// Add the new project to the list
this.loadParticipants();
}
}, (reason) => {
});
}
loadTheNewStep(stId :number,request :AddStepTrackRequest ){ loadTheNewStep(stId :number,request :AddStepTrackRequest ){
......
...@@ -101,7 +101,7 @@ export class TrackService { ...@@ -101,7 +101,7 @@ export class TrackService {
return this return this
.http .http
.post<void>(`${this.config.getServerUrl()}/Tracks/AddStepTrack/`,request .post<void>(`${this.config.getServerUrl()}/Tracks/CompleteTrack/`,request
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment