From 1aa533a552d6f8b8e7bff0da7faaad6552902b68 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 11 Feb 2019 11:16:12 +0530 Subject: [PATCH] start pd changes --- .../list-pd/view-pd/view-pd.component.html | 2 +- .../list-pd/view-pd/view-pd.component.ts | 26 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index c87152b7e..a9880f363 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -47,7 +47,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index ee6f765b0..cdb2ec224 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -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'){