Commit d6447fc8 authored by hasan khaddour's avatar hasan khaddour

add contribution reports

parent ccdf2e4c
......@@ -14,7 +14,7 @@
<div class="row align-items-center justify-content-between">
<div class="col text-center">
<small>
<a [routerLink]="['/uploads',attachment.attachmentUrl]" class="btn btn-primary">تنزيل </a>
<a class="btn btn-primary">تنزيل </a>
</small>
</div>
......
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Attachment } from '../../models/responses/attachment';
import { ConfigurationService } from '../../../core/services/configuration/configuration.service';
@Component({
selector: 'attahment-item',
......@@ -10,6 +11,11 @@ export class AttahmentItemComponent {
@Input() attachment : Attachment
@Output() selected = new EventEmitter<Attachment>()
constructor(
public config :ConfigurationService
){}
onSelected() {
this.selected.emit(this.attachment)
}
......
export class ProjectCompletion {
projectId: number;
completionDate: Date;
customerNotes: string;
customerRate: number;
}
......@@ -19,6 +19,7 @@ import { Attachment } from '../models/responses/attachment';
import { CompleteProjectRequest } from '../models/requests/project-requests/completeProjectRequest';
import { ChangeEmployeeParticipationRequest } from '../models/requests/project-requests/ChangeEmployeeParticipationRequest';
import { ParticipationChange } from '../models/responses/participationChange';
import { ProjectCompletion } from '../models/responses/ProjectCompletion';
@Injectable({
providedIn: 'root'
......@@ -62,6 +63,12 @@ export class ProjectService {
return this.http.get<Project>(this.config.getServerUrl()+ "/Projects/"+id);
}
public getProjectCompletion(projectId : number ):Observable<ProjectCompletion>{
return this.http.get<ProjectCompletion>(this.config.getServerUrl()+ "/Projects/Completion/"+projectId);
}
// this method retreive the projects by its manager
public getByProjectManger(request : GetProjectsByProjectManagerRequest ):Observable<Project[]>{
......
import { Component } from '@angular/core';
@Component({
selector: 'employee-contribution-table',
templateUrl: './employee-contribution-table.component.html',
styleUrl: './employee-contribution-table.component.css'
})
export class EmployeeContributionTableComponent {
}
import { Component, Input } from '@angular/core';
import { Customer } from '../../../customers/models/responses/customer';
import { Employee } from '../../../employees/models/responses/employee';
import { Department } from '../../../projects/models/responses/department';
import { Customer } from '../../../../customers/models/responses/customer';
import { Employee } from '../../../../employees/models/responses/employee';
import { Department } from '../../../../projects/models/responses/department';
@Component({
selector: 'project-footer',
......
import { Component, Input } from '@angular/core';
import { ProjectInfo } from '../../../projects/models/valueObjects/ProjectInfo';
import { ProposalInfo } from '../../../projects/models/valueObjects/proposalInfo';
import { Employee } from '../../../employees/models/responses/employee';
import { ProjectInfo } from '../../../../projects/models/valueObjects/ProjectInfo';
import { ProposalInfo } from '../../../../projects/models/valueObjects/proposalInfo';
import { Employee } from '../../../../employees/models/responses/employee';
@Component({
selector: 'project-header',
......
<div class="row mb-5">
<div class="col-md-4">
<p class="mb-4">
<strong>ذاتية المشروع</strong>
<br /> رمز المشروع: <small>{{project.projectInfo.code}}</small>
<br /> كتاب الطرح : <small>{{project.proposalInfo.proposingBookNumber}} / {{project.proposalInfo.proposingBookDate | date}}</small>
<br />كتاب الموافقة : <small>{{project.projectAggreement.aggreementNumber}} / {{project.projectAggreement.aggreementDate |date}}</small>
<br />التمويل : <small> {{project.financialFund.financialStatus}} / {{project.financialFund.source}} </small>
</p>
</div>
<div class="col-md-4 text-center">
<p class="mb-4">
<strong>المعلومات التنفيذية</strong>
<br /> الجهة المنفذة: <small>{{project.executer.name}}</small>
<br /> رئيس فريق العمل: <small>{{project.teamLeader.personalInfo | fullname}}</small>
<br /> مدير المشروع : <small>{{project.projectManager.personalInfo | fullname}}</small>
<br />ينفذ لصالح : <small> {{project.proposer.customerName}} </small>
</p>
</div>
<div class="col-md-4">
<p class="mb-4">
<strong>معلومات حالة المشروع </strong>
<br /> المرحلة التطويرير : <small>{{project.currentState | stateTranslate}} </small>
<br />نوع المشروع : <small>{{project.projectType.typeName}} </small>
<br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small>
</p>
</div>
</div> <!-- /.row -->
import { Component, Input } from '@angular/core';
import { Project } from '../../../../projects/models/responses/project';
@Component({
selector: 'project-subjective',
templateUrl: './project-subjective.component.html',
styleUrl: './project-subjective.component.css'
})
export class ProjectSubjectiveComponent {
@Input() project : Project
}
import { Component } from '@angular/core';
@Component({
selector: 'employee-trak-table',
templateUrl: './employee-trak-table.component.html',
styleUrl: './employee-trak-table.component.css'
})
export class EmployeeTrakTableComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'step-trak-table',
templateUrl: './step-trak-table.component.html',
styleUrl: './step-trak-table.component.css'
})
export class StepTrakTableComponent {
}
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
<p>project-completion works!</p>
<div class="container-fluid" *ngIf="project">
<div class="row justify-content-center">
<div class="col-12">
<div class="row align-items-center mb-4">
<div class="col">
<h2 class="h5 page-title">
<small class="text-muted text-uppercase">بطاقة معلومات مشروع</small>
</h2>
</div>
<div class="col-auto">
<button
type="button"
class="btn mr-1 btn-secondary m-1"
>
طباعة
</button>
<button type="button" class="btn mr-1 btn-secondary m-1">
تقرير متابعة المراحل
</button>
<button type="button" class="btn mr-1 btn-secondary m-1">
تقرير انشغالية
</button>
<button
type="button"
[routerLink]="['/reports/timeline/', project.id]"
class="btn mr-1 btn-secondary m-1"
>
تقرير خطة زمنية
</button>
</div>
</div>
<div class="card shadow" id="pdfContent">
<div class="card-body p-5">
<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>
<project-footer
[proposer]="project.proposer"
[executer]="project.executer"
[projectManager]="project.projectManager"
[teamLeader]="project.teamLeader"
>
</project-footer>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col-12 -->
</div>
</div>
\ No newline at end of file
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Project } from '../../../projects/models/responses/project';
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 { Track } from '../../../tracks/models/responses/track';
@Component({
selector: 'project-completion',
templateUrl: './project-completion.component.html',
styleUrl: './project-completion.component.css'
})
export class ProjectCompletionComponent {
export class ProjectCompletionComponent implements OnInit{
projectId : number
project :Project
completion : ProjectCompletion
contributers : EmployeeContribution[]
tracks : Track[]
iscalculated :boolean =false
constructor (
private route :ActivatedRoute ,
private projectService : ProjectService,
private router :Router,
private toastr :ToastrService
){}
ngOnInit(): void {
this.projectId= Number(this.route.snapshot.paramMap.get('id'))
this
.projectService
.getProjectById(this.projectId)
.subscribe({
next:(data)=>{
this.project=data ;
if(this.project.currentState.toLowerCase()!="completed"){
this.toastr.error('المشروع لم ينجز بعد');
this.router.navigate(['/']);
}else {
this.loadCompletion();
}
}
});
}
loadTracks(){
}
loadCompletion() {
this
.projectService
.getProjectCompletion(this.projectId)
.subscribe({
next:(data)=>{
this.completion= data;
}
});
}
}
<div class="container-fluid" *ngIf="project">
<div class="row justify-content-center">
<div class="col-12 ">
<div class="col-12">
<div class="row align-items-center mb-4">
<div class="col">
<h2 class="h5 page-title"><small class="text-muted text-uppercase">بطاقة معلومات مشروع</small></h2>
<h2 class="h5 page-title">
<small class="text-muted text-uppercase">بطاقة معلومات مشروع</small>
</h2>
</div>
<div class="col-auto">
<button type="button" (click)="downloadAsPdf()" class="btn mr-1 btn-secondary m-1">طباعة</button>
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير متابعة المراحل</button>
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير انشغالية</button>
<button type="button" [routerLink]="['/reports/timeline/',project.id]" class="btn mr-1 btn-secondary m-1">تقرير خطة زمنية</button>
<button
type="button"
(click)="downloadAsPdf()"
class="btn mr-1 btn-secondary m-1"
>
طباعة
</button>
<button type="button" class="btn mr-1 btn-secondary m-1">
تقرير متابعة المراحل
</button>
<button type="button" class="btn mr-1 btn-secondary m-1">
تقرير انشغالية
</button>
<button
type="button"
[routerLink]="['/reports/timeline/', project.id]"
class="btn mr-1 btn-secondary m-1"
>
تقرير خطة زمنية
</button>
</div>
</div>
<div class="card shadow" id="pdfContent">
<div class="card-body p-5">
<project-header [projectInfo]="project.projectInfo"></project-header>
<div class="row mb-5">
<div class="col-md-4">
<p class="mb-4">
<strong>ذاتية المشروع</strong>
<br /> رمز المشروع: <small>{{project.projectInfo.code}}</small>
<br /> كتاب الطرح : <small>{{project.proposalInfo.proposingBookNumber}} / {{project.proposalInfo.proposingBookDate | date}}</small>
<br />كتاب الموافقة : <small>{{project.projectAggreement.aggreementNumber}} / {{project.projectAggreement.aggreementDate |date}}</small>
<br />التمويل : <small> {{project.financialFund.financialStatus}} / {{project.financialFund.source}} </small>
</p>
</div>
<div class="col-md-4 text-center">
<p class="mb-4">
<strong>المعلومات التنفيذية</strong>
<br /> الجهة المنفذة: <small>{{project.executer.name}}</small>
<br /> رئيس فريق العمل: <small>{{project.teamLeader.personalInfo | fullname}}</small>
<br /> مدير المشروع : <small>{{project.projectManager.personalInfo | fullname}}</small>
<br />ينفذ لصالح : <small> {{project.proposer.customerName}} </small>
</p>
</div>
<div class="col-md-4">
<p class="mb-4">
<strong>معلومات حالة المشروع </strong>
<br /> المرحلة التطويرير : <small>{{project.currentState | stateTranslate}} </small>
<br />نوع المشروع : <small>{{project.projectType.typeName}} </small>
<br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small>
</p>
</div>
</div> <!-- /.row -->
<hr>
<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>
<hr />
<participants-table
[employeeParticipates]="project.employeeParticipates"
></participants-table>
<p><strong>خطة الانفاق</strong></p>
<financial-spend-table [financialSpending]="project.financialSpending"></financial-spend-table>
<financial-spend-table
[financialSpending]="project.financialSpending"
></financial-spend-table>
<project-footer [proposer]="project.proposer"
<project-footer
[proposer]="project.proposer"
[executer]="project.executer"
[projectManager]="project.projectManager"
[teamLeader]="project.teamLeader"
>
</project-footer>
</div> <!-- /.card-body -->
</div> <!-- /.card -->
</div> <!-- /.col-12 -->
</div>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col-12 -->
</div>
</div>
......@@ -8,13 +8,17 @@ import { EmployeesTrackReportComponent } from './pages/employees-track-report/em
import { StepsTrackReportComponent } from './pages/steps-track-report/steps-track-report.component';
import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component';
import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.component';
import { ProjectHeaderComponent } from './componenets/project-header/project-header.component';
import { ProjectHeaderComponent } from './componenets/project-report-layout/project-header/project-header.component';
import { FinancialSpendTableComponent } from './componenets/financial-spend-table/financial-spend-table.component';
import { ParticipantsTableComponent } from './componenets/participants-table/participants-table.component';
import { ProjectFooterComponent } from './componenets/project-footer/project-footer.component';
import { ProjectFooterComponent } from './componenets/project-report-layout/project-footer/project-footer.component';
import { StepTableComponent } from './componenets/step-table/step-table.component';
import { SharedModule } from '../shared/shared.module';
import { GanttChartComponent } from './componenets/gantt-chart/gantt-chart.component';
import { ProjectSubjectiveComponent } from './componenets/project-report-layout/project-subjective/project-subjective.component';
import { EmployeeTrakTableComponent } from './componenets/tracks-components/employee-trak-table/employee-trak-table.component';
import { StepTrakTableComponent } from './componenets/tracks-components/step-trak-table/step-trak-table.component';
import { EmployeeContributionTableComponent } from './componenets/employee-contribution-table/employee-contribution-table.component';
@NgModule({
......@@ -30,7 +34,11 @@ import { GanttChartComponent } from './componenets/gantt-chart/gantt-chart.compo
ProjectFooterComponent,
ProjectHeaderComponent,
ProjectTimeLineComponent,
GanttChartComponent
GanttChartComponent,
ProjectSubjectiveComponent,
EmployeeTrakTableComponent,
StepTrakTableComponent,
EmployeeContributionTableComponent
],
imports: [
CommonModule,
......
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