pd view discussion options enabled
This commit is contained in:
parent
562c7533ce
commit
ddd6968a85
@ -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.COMPLETED && 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.COMPLETED && 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 && currentPDStatus!=pdStatusCheck.DRAFT && 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 *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
|
||||
|
||||
|
||||
@ -60,16 +60,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
this.route.params.subscribe(params => {
|
||||
this.viewID = params['pdid'];
|
||||
});
|
||||
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
||||
let scheduledDateTime: string="2018-12-03 08:20";
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
this.viewPdDetails(this.viewID);
|
||||
}
|
||||
@ -84,6 +75,22 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
//this.applicantPDLogsData= data.records.pd_logs.master;
|
||||
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
|
||||
this.pdAdditionalReqData = data.records.pd_additional_requirements;
|
||||
// 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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user