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
import { ChangeEmployeeParticipationRequest } from '../models/requests/project-requests/ChangeEmployeeParticipationRequest';
import { ParticipationChange } from '../models/responses/participationChange';
import { ProjectCompletion } from '../models/responses/ProjectCompletion';
import { EmployeeContribution } from '../models/responses/employeeContribution';
@Injectable({
providedIn: 'root'
......@@ -86,8 +87,21 @@ export class ProjectService {
.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
//#region planning managment
//tihs method responsible for hanging the team leader
......@@ -216,6 +230,11 @@ export class ProjectService {
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
......
<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({
selector: 'employee-contribution-table',
......@@ -6,5 +7,5 @@ import { Component } from '@angular/core';
styleUrl: './employee-contribution-table.component.css'
})
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="col-12">
<div class="row align-items-center mb-4">
......@@ -35,16 +35,14 @@
<project-header [projectInfo]="project.projectInfo"></project-header>
<project-subjective [project]="project"> </project-subjective>
<hr />
<p><strong>مراحل المشروع</strong></p>
<step-table [steps]="project.steps"></step-table>
<hr />
<participants-table
[employeeParticipates]="project.employeeParticipates"
></participants-table>
<p><strong>خطة الانفاق</strong></p>
<financial-spend-table
[financialSpending]="project.financialSpending"
></financial-spend-table>
<p><strong>مساهمات العاملين بالانجاز</strong></p>
<employee-contribution-table
[contributers]="contributers"
>
</employee-contribution-table>
<hr>
<project-footer
[proposer]="project.proposer"
......
......@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import { ProjectService } from '../../../projects/services/project.service';
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';
@Component({
......@@ -43,15 +43,28 @@ export class ProjectCompletionComponent implements OnInit{
this.toastr.error('المشروع لم ينجز بعد');
this.router.navigate(['/']);
}else {
this.loadCompletion();
// this.loadCompletion();
this.loadContributions();
}
}
});
}
loadTracks(){
loadContributions() {
this
.projectService
.getCompletionContribution(this.projectId)
.subscribe({
next : (data)=>{
this.contributers= data;
}
});
}
loadCompletion() {
this
.projectService
......
......@@ -15,6 +15,9 @@
>
طباعة
</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>
......
......@@ -2,10 +2,12 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProjectDefinitionComponent } from './pages/project-definition/project-definition.component';
import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.component';
import { ProjectCompletionComponent } from './pages/project-completion/project-completion.component';
const routes: Routes = [
{path: 'definition/:id',component:ProjectDefinitionComponent},
{path: 'timeline/:id',component:ProjectTimeLineComponent},
{path: 'completion/:id',component:ProjectCompletionComponent}
];
......
......@@ -10,7 +10,7 @@ export class StateTranslatePipe implements PipeTransform {
switch (state){
case "InPlan":
return "يخطط";
case "Complete":
case "Completed":
return "مكتمل";
case "InProgress" :
return "التنفيذ";
......
......@@ -72,10 +72,11 @@ export class CompleteTrackModalComponent {
private _setCanMove(){
this
.canComplete = this
.canComplete =! this
.track
.trackInfo
.isCompleted
console.log(this.track)
}
......
......@@ -55,7 +55,7 @@
<div class="row">
<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>
......
......@@ -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 ){
......
......@@ -101,7 +101,7 @@ export class TrackService {
return this
.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