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;" >
|
||||
<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.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>
|
||||
<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>
|
||||
@ -80,6 +80,30 @@
|
||||
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
|
||||
</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 fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
|
||||
<!-- pd documents card -->
|
||||
<mat-expansion-panel *ngIf="pdDocumentsData.length>0; else nodocument">
|
||||
|
||||
@ -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 { 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 { PdRequirementComponent } from './../../../personal-discussion/manage-pd/list-pd/pd-requirement/pd-requirement.component';
|
||||
import {DatePipe } from '@angular/common';
|
||||
@Component({
|
||||
selector: 'app-qc-view',
|
||||
templateUrl: './qc-view.component.html',
|
||||
@ -19,6 +20,7 @@ import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class QcViewComponent implements OnInit, OnDestroy {
|
||||
pipe = new DatePipe('en-US');
|
||||
public selectedMoment = new Date();
|
||||
private notifier:NotifierService;
|
||||
errorMessage: any;
|
||||
@ -31,7 +33,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
viewParams:any;
|
||||
destroyType:number=1;
|
||||
currentPDStatus:string;
|
||||
|
||||
pdAdditionalReqData: any=[];
|
||||
enableStartPD: boolean;
|
||||
// create values for status check
|
||||
pdStatusCheck :any={
|
||||
"DRAFT" :'DRAFT',
|
||||
@ -46,6 +49,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
||||
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) {
|
||||
this.notifier=notifier
|
||||
this.enableStartPD=false;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -64,8 +68,25 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
this.pdApplicantData= data.records.applicants_details;
|
||||
this.pdDocumentsData=data.records.pd_documnets;
|
||||
this.masterPdLogsData=data.records.pd_logs.master;
|
||||
this.pdAdditionalReqData = data.records.pd_additional_requirements;
|
||||
//this.applicantPDLogsData= data.records.pd_logs.master;
|
||||
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);
|
||||
@ -84,6 +105,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
|
||||
data: record,
|
||||
position: { right: '0'},
|
||||
width: '80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogPDMaster.afterClosed()
|
||||
@ -99,6 +122,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
|
||||
data: setPdDetails,
|
||||
position: { right: '0'},
|
||||
width: '60%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogApplicant.afterClosed()
|
||||
@ -107,6 +132,24 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
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
|
||||
pdAllocationTo(pdData:any) {
|
||||
if(pdData.fk_pd_type == 1){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user