qc view changes
This commit is contained in:
parent
893fb760ca
commit
59a0317dee
@ -11,7 +11,7 @@
|
|||||||
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" >
|
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" >
|
||||||
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
|
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
|
||||||
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
|
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
|
||||||
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
|
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
|
||||||
<br>
|
<br>
|
||||||
<span *ngIf="master.pd_allocated_to" style="color:#fff;text-align:left"><mat-icon class="hover-icon" matTooltip="PD Officer" matTooltipPosition="above">person</mat-icon>{{master.pd_allocated_to | titlecase}}</span>
|
<span *ngIf="master.pd_allocated_to" style="color:#fff;text-align:left"><mat-icon class="hover-icon" matTooltip="PD Officer" matTooltipPosition="above">person</mat-icon>{{master.pd_allocated_to | titlecase}}</span>
|
||||||
@ -79,6 +79,30 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
|
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
<!-- applicant card -->
|
||||||
|
<mat-card class="minheight">
|
||||||
|
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED || currentPDStatus==pdStatusCheck.COMPLETED">
|
||||||
|
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
<mat-card-header>
|
||||||
|
<mat-card-title style="color:red !important;">Additional Requirements</mat-card-title>
|
||||||
|
</mat-card-header>
|
||||||
|
|
||||||
|
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">
|
||||||
|
<mat-list *ngFor="let requirement of pdAdditionalReqData">
|
||||||
|
<mat-list-item>
|
||||||
|
<p>{{requirement.add_requirement}}</p>
|
||||||
|
</mat-list-item>
|
||||||
|
</mat-list>
|
||||||
|
</mat-card-content>
|
||||||
|
<ng-template #noRequirement><mat-card-content><p>No Additional Requirements</p></mat-card-content></ng-template>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
|
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
|
||||||
<!-- pd documents card -->
|
<!-- pd documents card -->
|
||||||
|
|||||||
@ -11,7 +11,8 @@ import { TelePdAllocationComponent } from './../../../personal-discussion/manage
|
|||||||
import { SchedulePdComponent } from './../../../personal-discussion/manage-pd/list-pd/schedule-pd/schedule-pd.component';
|
import { SchedulePdComponent } from './../../../personal-discussion/manage-pd/list-pd/schedule-pd/schedule-pd.component';
|
||||||
import { EditPdApplicantComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component';
|
import { EditPdApplicantComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component';
|
||||||
import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component';
|
import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component';
|
||||||
|
import { PdRequirementComponent } from './../../../personal-discussion/manage-pd/list-pd/pd-requirement/pd-requirement.component';
|
||||||
|
import {DatePipe } from '@angular/common';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-qc-view',
|
selector: 'app-qc-view',
|
||||||
templateUrl: './qc-view.component.html',
|
templateUrl: './qc-view.component.html',
|
||||||
@ -19,6 +20,7 @@ import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class QcViewComponent implements OnInit, OnDestroy {
|
export class QcViewComponent implements OnInit, OnDestroy {
|
||||||
|
pipe = new DatePipe('en-US');
|
||||||
public selectedMoment = new Date();
|
public selectedMoment = new Date();
|
||||||
private notifier:NotifierService;
|
private notifier:NotifierService;
|
||||||
errorMessage: any;
|
errorMessage: any;
|
||||||
@ -31,7 +33,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
viewParams:any;
|
viewParams:any;
|
||||||
destroyType:number=1;
|
destroyType:number=1;
|
||||||
currentPDStatus:string;
|
currentPDStatus:string;
|
||||||
|
pdAdditionalReqData: any=[];
|
||||||
|
enableStartPD: boolean;
|
||||||
// create values for status check
|
// create values for status check
|
||||||
pdStatusCheck :any={
|
pdStatusCheck :any={
|
||||||
"DRAFT" :'DRAFT',
|
"DRAFT" :'DRAFT',
|
||||||
@ -46,6 +49,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
||||||
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) {
|
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) {
|
||||||
this.notifier=notifier
|
this.notifier=notifier
|
||||||
|
this.enableStartPD=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -64,8 +68,25 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
this.pdApplicantData= data.records.applicants_details;
|
this.pdApplicantData= data.records.applicants_details;
|
||||||
this.pdDocumentsData=data.records.pd_documnets;
|
this.pdDocumentsData=data.records.pd_documnets;
|
||||||
this.masterPdLogsData=data.records.pd_logs.master;
|
this.masterPdLogsData=data.records.pd_logs.master;
|
||||||
|
this.pdAdditionalReqData = data.records.pd_additional_requirements;
|
||||||
//this.applicantPDLogsData= data.records.pd_logs.master;
|
//this.applicantPDLogsData= data.records.pd_logs.master;
|
||||||
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
|
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
|
||||||
|
// enable pd start time
|
||||||
|
if(data.records.pd_master_details[0].scheduled_on_for_validation){
|
||||||
|
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
||||||
|
let scheduledDateTime: string=data.records.pd_master_details[0].scheduled_on_for_validation;
|
||||||
|
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
|
||||||
|
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
|
||||||
|
if(diffInHours>=-4){
|
||||||
|
this.enableStartPD=true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.enableStartPD=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.enableStartPD=false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
@ -84,6 +105,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
|
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
|
||||||
data: record,
|
data: record,
|
||||||
|
position: { right: '0'},
|
||||||
|
width: '80%',
|
||||||
disableClose: true
|
disableClose: true
|
||||||
});
|
});
|
||||||
dialogPDMaster.afterClosed()
|
dialogPDMaster.afterClosed()
|
||||||
@ -99,6 +122,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
|
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
|
||||||
data: setPdDetails,
|
data: setPdDetails,
|
||||||
|
position: { right: '0'},
|
||||||
|
width: '60%',
|
||||||
disableClose: true
|
disableClose: true
|
||||||
});
|
});
|
||||||
dialogApplicant.afterClosed()
|
dialogApplicant.afterClosed()
|
||||||
@ -107,6 +132,24 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
|||||||
this.viewPdDetails(this.viewID)
|
this.viewPdDetails(this.viewID)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// edit pd addtional requirements
|
||||||
|
editAdditionalRequirement(requirementData:any){
|
||||||
|
let setPdDetails = {
|
||||||
|
"pdID":this.viewID,
|
||||||
|
"records":requirementData
|
||||||
|
}
|
||||||
|
const dialogRequirement = this.dialog.open(PdRequirementComponent, {
|
||||||
|
data: setPdDetails,
|
||||||
|
position: { right: '0'},
|
||||||
|
width: '60%',
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogRequirement.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||||
|
this.viewPdDetails(this.viewID)
|
||||||
|
});
|
||||||
|
}
|
||||||
// pd allocation to
|
// pd allocation to
|
||||||
pdAllocationTo(pdData:any) {
|
pdAllocationTo(pdData:any) {
|
||||||
if(pdData.fk_pd_type == 1){
|
if(pdData.fk_pd_type == 1){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user