Commit 106c7bf2 authored by hasan khaddour's avatar hasan khaddour

add employees track report

parent 4823c71d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<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>
<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>
......
<p>employee-trak-table works!</p> <table class="table table-borderless table-striped">
<thead>
<tr>
<th scope="col" class="text-left">الرقم الذاتي</th>
<th scope="col" class="text-left">الاسم والشهرة</th>
<th scope="col" class="text-left">ساعات العمل<br> المسندة</th>
<th scope="col" class="text-left">ساعات العمل <br>المنفذة</th>
<th scope="col" class="text-left">نسبة المساهمة</th>
<th scope="col" class="text-left">العمل المسند</th>
<th scope="col" class="text-left">العمل المنجز</th>
<th scope="col" class="text-left">التاريخ المتوقع <br>لانهاء الاعمال</th>
<th scope="col" class="text-left">الملاحظات</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let empTrack of employeeTrack ; index as i " >
<th scope="row">{{empTrack.employee.hiastId}}</th>
<td> {{empTrack.employee.personalInfo | fullname }}
</td>
<td class="text-left">{{empTrack.employee.workInfo.workType}}</td>
<td class="text-left">{{empTrack.employeeWork.assignedWorkingHours}}</td>
<td class="text-left">{{empTrack.employeeWork.workedHours}}</td>
<td class="text-left">{{empTrack.employeeWork.contributingRatio}}</td>
<td class="text-left">{{empTrack.employeeWorkInfo.assignedWork}}</td>
<td class="text-left">{{empTrack.employeeWorkInfo.performedWork}}</td>
<td class="text-left">{{empTrack.employeeWorkInfo.assignedWorkEnd | date}}</td>
<td class="text-left">{{empTrack.notes}}</td>
</tr>
<tr *ngIf="employeeTrack.length==0" >
<th scope="row" class="text-center"></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>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tbody>
</table>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, Input } from '@angular/core';
import { EmployeeTrack } from '../../../../tracks/models/responses/employeeTrack';
@Component({ @Component({
selector: 'employee-trak-table', selector: 'employee-trak-table',
...@@ -7,4 +8,5 @@ import { Component } from '@angular/core'; ...@@ -7,4 +8,5 @@ import { Component } from '@angular/core';
}) })
export class EmployeeTrakTableComponent { export class EmployeeTrakTableComponent {
@Input() employeeTrack : EmployeeTrack[]
} }
<div class="container-fluid" *ngIf="project && track && employeesTrack ">
<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
[routerLink]="['/reports',projectId,'steptracks',trackId]"
type="button" class="btn mr-1 btn-secondary m-1">
تقرير متابعة المراحل
</button>
<button *ngIf="project.currentState.toLowerCase()=='completed'" 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>
قائمة متابعة العاملين لعملية المتابعة التي حدثت بتاريخ {{track.trackInfo.trackDate}}
</strong>
</p>
<employee-trak-table
[employeeTrack]="employeesTrack" >
</employee-trak-table>
<hr>
<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 { ToastrService } from 'ngx-toastr';
import { ProjectService } from '../../../projects/services/project.service';
import { TrackService } from '../../../tracks/services/track.service';
import { Track } from '../../../tracks/models/responses/track';
import { EmployeeTrack } from '../../../tracks/models/responses/employeeTrack';
import { ActivatedRoute, Router } from '@angular/router';
import { Project } from '../../../projects/models/responses/project';
import { data } from 'jquery';
@Component({ @Component({
selector: 'employees-track-report', selector: 'employees-track-report',
templateUrl: './employees-track-report.component.html', templateUrl: './employees-track-report.component.html',
styleUrl: './employees-track-report.component.css' styleUrl: './employees-track-report.component.css'
}) })
export class EmployeesTrackReportComponent { export class EmployeesTrackReportComponent implements OnInit{
trackId :number
projectId :number
project :Project
track : Track
employeesTrack : EmployeeTrack[]
constructor(
private tostrService :ToastrService ,
private projectService : ProjectService,
private trackService : TrackService,
private route : ActivatedRoute,
private router : Router
){}
ngOnInit(): void {
this.trackId= Number(this.route.snapshot.paramMap.get('id'))
this.projectId= Number(this.route.snapshot.paramMap.get('projectId'))
this.loadTracks();
this.loadEmployeeTrack();
this.loadProject()
}
loadProject() {
this
.projectService
.getProjectById(this.projectId)
.subscribe({
next : (data)=>{
this.project=data;
}
});
}
loadEmployeeTrack() {
this
.trackService
.getEmployeesTrackById(this.trackId)
.subscribe({
next: (data)=>{
this.tostrService.success('تم تحميل التقرير بنجاح')
this.employeesTrack=data
}
});
}
loadTracks() {
this
.trackService
.getByTrackById(this.trackId)
.subscribe({
next : (data)=>{
this.track = data;
}
});
}
} }
...@@ -3,11 +3,15 @@ import { RouterModule, Routes } from '@angular/router'; ...@@ -3,11 +3,15 @@ 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'; import { ProjectCompletionComponent } from './pages/project-completion/project-completion.component';
import { EmployeesTrackReportComponent } from './pages/employees-track-report/employees-track-report.component';
import { StepsTrackReportComponent } from './pages/steps-track-report/steps-track-report.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} {path: 'completion/:id',component:ProjectCompletionComponent},
{path: 'employees-tracks/:projectId/track/:id',component:EmployeesTrackReportComponent} ,
{path: 'steps-tracks/:projectId/track/:id',component:StepsTrackReportComponent}
]; ];
......
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
<div class="tab-pane fade pt-3" id="profile-change-password" role="tabpanel"> <div class="tab-pane fade pt-3" id="profile-change-password" role="tabpanel">
<div class="row" > <div class="row" >
<button class="btn btn-primary col-3 offset-1">تقرير انشغالية عاملين </button> <button [routerLink]="['/reports/employees-tracks',track.projectId,'track',trackId]" class="btn btn-primary col-3 offset-1">تقرير انشغالية عاملين </button>
<button class="btn btn-primary col-3 offset-1">تقرير متابعة مراحل </button> <button [routerLink]="['/reports/steps-tracks',track.projectId,'track',trackId]" class="btn btn-primary col-3 offset-1">تقرير متابعة مراحل </button>
</div> </div>
</div> </div>
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { TracksRoutingModule } from './tracks-routing.module'; import { TracksRoutingModule } from './routing/tracks-routing.module';
import { TracksListComponent } from './pages/tracks-list/tracks-list.component'; import { TracksListComponent } from './pages/tracks-list/tracks-list.component';
import { TrackDetailsComponent } from './pages/track-details/track-details.component'; import { TrackDetailsComponent } from './pages/track-details/track-details.component';
import { StepTrackComponent } from './components/step-track/step-track.component'; import { StepTrackComponent } from './components/step-track/step-track.component';
......
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