Commit d6447fc8 authored by hasan khaddour's avatar hasan khaddour

add contribution reports

parent ccdf2e4c
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="row align-items-center justify-content-between"> <div class="row align-items-center justify-content-between">
<div class="col text-center"> <div class="col text-center">
<small> <small>
<a [routerLink]="['/uploads',attachment.attachmentUrl]" class="btn btn-primary">تنزيل </a> <a class="btn btn-primary">تنزيل </a>
</small> </small>
</div> </div>
......
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Attachment } from '../../models/responses/attachment'; import { Attachment } from '../../models/responses/attachment';
import { ConfigurationService } from '../../../core/services/configuration/configuration.service';
@Component({ @Component({
selector: 'attahment-item', selector: 'attahment-item',
...@@ -10,6 +11,11 @@ export class AttahmentItemComponent { ...@@ -10,6 +11,11 @@ export class AttahmentItemComponent {
@Input() attachment : Attachment @Input() attachment : Attachment
@Output() selected = new EventEmitter<Attachment>() @Output() selected = new EventEmitter<Attachment>()
constructor(
public config :ConfigurationService
){}
onSelected() { onSelected() {
this.selected.emit(this.attachment) 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'; ...@@ -19,6 +19,7 @@ import { Attachment } from '../models/responses/attachment';
import { CompleteProjectRequest } from '../models/requests/project-requests/completeProjectRequest'; import { CompleteProjectRequest } from '../models/requests/project-requests/completeProjectRequest';
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';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -62,6 +63,12 @@ export class ProjectService { ...@@ -62,6 +63,12 @@ export class ProjectService {
return this.http.get<Project>(this.config.getServerUrl()+ "/Projects/"+id); 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 // this method retreive the projects by its manager
public getByProjectManger(request : GetProjectsByProjectManagerRequest ):Observable<Project[]>{ 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 { Component, Input } from '@angular/core';
import { Customer } from '../../../customers/models/responses/customer'; import { Customer } from '../../../../customers/models/responses/customer';
import { Employee } from '../../../employees/models/responses/employee'; import { Employee } from '../../../../employees/models/responses/employee';
import { Department } from '../../../projects/models/responses/department'; import { Department } from '../../../../projects/models/responses/department';
@Component({ @Component({
selector: 'project-footer', selector: 'project-footer',
......
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { ProjectInfo } from '../../../projects/models/valueObjects/ProjectInfo'; import { ProjectInfo } from '../../../../projects/models/valueObjects/ProjectInfo';
import { ProposalInfo } from '../../../projects/models/valueObjects/proposalInfo'; import { ProposalInfo } from '../../../../projects/models/valueObjects/proposalInfo';
import { Employee } from '../../../employees/models/responses/employee'; import { Employee } from '../../../../employees/models/responses/employee';
@Component({ @Component({
selector: 'project-header', 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({ @Component({
selector: 'project-completion', selector: 'project-completion',
templateUrl: './project-completion.component.html', templateUrl: './project-completion.component.html',
styleUrl: './project-completion.component.css' 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="container-fluid" *ngIf="project">
<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">
<div class="col"> <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>
<div class="col-auto"> <div class="col-auto">
<button type="button" (click)="downloadAsPdf()" class="btn mr-1 btn-secondary m-1">طباعة</button> <button
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير متابعة المراحل</button> type="button"
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير انشغالية</button> (click)="downloadAsPdf()"
<button type="button" [routerLink]="['/reports/timeline/',project.id]" class="btn mr-1 btn-secondary m-1">تقرير خطة زمنية</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> </div>
<div class="card shadow" id="pdfContent"> <div class="card shadow" id="pdfContent">
<div class="card-body p-5"> <div class="card-body p-5">
<project-header [projectInfo]="project.projectInfo"></project-header> <project-header [projectInfo]="project.projectInfo"></project-header>
<div class="row mb-5"> <project-subjective [project]="project"> </project-subjective>
<div class="col-md-4"> <hr />
<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>
<p><strong>مراحل المشروع</strong></p> <p><strong>مراحل المشروع</strong></p>
<step-table [steps]="project.steps"></step-table> <step-table [steps]="project.steps"></step-table>
<hr> <hr />
<participants-table [employeeParticipates]="project.employeeParticipates"></participants-table> <participants-table
[employeeParticipates]="project.employeeParticipates"
></participants-table>
<p><strong>خطة الانفاق</strong></p> <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" [executer]="project.executer"
[projectManager]="project.projectManager" [projectManager]="project.projectManager"
[teamLeader]="project.teamLeader" [teamLeader]="project.teamLeader"
> >
</project-footer> </project-footer>
</div> <!-- /.card-body --> </div>
</div> <!-- /.card --> <!-- /.card-body -->
</div> <!-- /.col-12 --> </div>
<!-- /.card -->
</div> </div>
<!-- /.col-12 -->
</div>
</div> </div>
...@@ -8,13 +8,17 @@ import { EmployeesTrackReportComponent } from './pages/employees-track-report/em ...@@ -8,13 +8,17 @@ import { EmployeesTrackReportComponent } from './pages/employees-track-report/em
import { StepsTrackReportComponent } from './pages/steps-track-report/steps-track-report.component'; import { StepsTrackReportComponent } from './pages/steps-track-report/steps-track-report.component';
import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component'; import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component';
import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.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 { FinancialSpendTableComponent } from './componenets/financial-spend-table/financial-spend-table.component';
import { ParticipantsTableComponent } from './componenets/participants-table/participants-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 { StepTableComponent } from './componenets/step-table/step-table.component';
import { SharedModule } from '../shared/shared.module'; import { SharedModule } from '../shared/shared.module';
import { GanttChartComponent } from './componenets/gantt-chart/gantt-chart.component'; 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({ @NgModule({
...@@ -30,7 +34,11 @@ import { GanttChartComponent } from './componenets/gantt-chart/gantt-chart.compo ...@@ -30,7 +34,11 @@ import { GanttChartComponent } from './componenets/gantt-chart/gantt-chart.compo
ProjectFooterComponent, ProjectFooterComponent,
ProjectHeaderComponent, ProjectHeaderComponent,
ProjectTimeLineComponent, ProjectTimeLineComponent,
GanttChartComponent GanttChartComponent,
ProjectSubjectiveComponent,
EmployeeTrakTableComponent,
StepTrakTableComponent,
EmployeeContributionTableComponent
], ],
imports: [ imports: [
CommonModule, 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