start pd changes

This commit is contained in:
gandhimathi 2019-02-11 11:16:12 +05:30
parent 4edf863ff0
commit 1aa533a552
2 changed files with 22 additions and 6 deletions

View File

@ -47,7 +47,7 @@
<span *ngFor="let master of pdMasterData">
<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 && 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.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,master.pd_status)"><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>
<!-- {{master | json}} -->

View File

@ -2,6 +2,7 @@ import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDes
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
import {DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
@ -12,8 +13,7 @@ import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.component';
import { PdRequirementComponent } from '../pd-requirement/pd-requirement.component';
import {DatePipe } from '@angular/common';
import { PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component';
/**sweet alert */
import Swal from 'sweetalert2';
@ -134,7 +134,6 @@ export class ViewPdComponent implements OnInit, OnDestroy {
if (data.status == 200) {
let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]);
console.log('this.pdMasterData',this.pdMasterData);
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData= data.records.applicants_details;
@ -354,9 +353,25 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// start pd
getPDStart(pdID:any){
getPDStart(pdID:any, status: string){
this.destroyType=3;
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
if(status==this.pdStatusCheck.SCHEDULED){
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.viewID, pd_status: this.pdStatusCheck.INPROGRESS },
disableClose: true,
minWidth:'30%',
maxWidth:'40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
}
});
}
else {
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
}
}
getPDIDReport(pdID:any) {
@ -429,6 +444,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// updateViewComponent(editBack:string) {
// if(editBack=='1'){