From 61c050d728f824c61e48cf5c792d596741eaac1e Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 13 Oct 2018 10:18:22 +0530 Subject: [PATCH] pd view changes --- .../list-pd/add-pd/add-pd.component.html | 134 +++++++----- .../list-pd/add-pd/add-pd.component.ts | 196 +++++++++++------- .../manage-pd/list-pd/list-pd.component.html | 7 +- .../manage-pd/list-pd/list-pd.component.ts | 5 + .../map-pd-view/map-pd-view.component.html | 2 +- .../pd-allocation.component.html | 43 ++++ .../pd-allocation.component.scss | 3 + .../pd-allocation/pd-allocation.component.ts | 90 ++++++++ .../list-pd/view-pd/view-pd.component.html | 87 ++++++++ .../list-pd/view-pd/view-pd.component.scss | 3 + .../list-pd/view-pd/view-pd.component.spec.ts | 25 +++ .../list-pd/view-pd/view-pd.component.ts | 94 +++++++++ .../manage-pd/manage-pd.module.ts | 5 +- .../manage-pd/manage-pd.routing.ts | 6 + .../template/questions/add/add.component.html | 2 +- 15 files changed, 578 insertions(+), 124 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 65cb39c83..3e43f0da0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -1,7 +1,11 @@ -
- -
+ + + +
+ +
@@ -11,67 +15,81 @@ - - + {{LL.full_name}} - Lender name is required. + + - Applicant id is required. + Applicant ID Required + + + + {{billL.billing_name}} + + + + + + + Contact Person Required + + + + Contact Number Required + - + {{PL.product_name}} - Product is required. + - + {{SPL.subproduct_name}} - Sub product is required. + - + {{CSL.customer_segment}} - Customer segment is required. + - + {{PDL.type_name}} - PD type is required. + - - Amount is required. - + + - - Address1 required. - + + @@ -82,31 +100,31 @@ - + {{SL.state_name}} - State is required. + - + ` {{CL.city_name}} - City is required. + - - Pincode is required. + + -
+
@@ -133,22 +151,23 @@ - - Name is required. + + - + - - Email number is required. + + + + + + + + - - - Mobile number is required. - - - +
@@ -169,8 +188,19 @@ - - + + + + {{rel.name}} + + + + +
+ + + +
@@ -182,7 +212,7 @@
Co-Applicant
- + @@ -197,7 +227,7 @@ - + @@ -213,7 +243,12 @@ - + +
+ + + +
@@ -228,10 +263,15 @@ --> - - + + + + +
+ \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 3cf94ed47..0ed9a60ae 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -15,6 +15,9 @@ import { AwsService } from '../../../../AwsService/aws.service'; export class AddPdComponent implements OnInit, OnDestroy { //@Output() loadParent = new EventEmitter(); cancelStatus: boolean; + enablePDButton: boolean; + draftStatus: boolean; + PDTriggerStatus: boolean; private notifier: NotifierService; public _PDtriggerForm: FormGroup; items: FormArray; @@ -25,15 +28,17 @@ export class AddPdComponent implements OnInit, OnDestroy { stateList:any; cityList:any; pdTypeList:any; + billingList: any; + relationShipList: any; errorMessage: any; // Dynamic co applicant createWithLongContent = false; dynamicCoApplicant = []; - allocationTypeModel: number; - allocationTypeCheck: boolean; - subAllocationTypeCheck: boolean; - allocationLabel: string; - subAllocationLabel: string; + //allocationTypeModel: number; + //allocationTypeCheck: boolean; + //subAllocationTypeCheck: boolean; + //allocationLabel: string; + //subAllocationLabel: string; constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute, private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) { this.notifier = notifier; @@ -42,6 +47,9 @@ export class AddPdComponent implements OnInit, OnDestroy { public totalFileName = []; public lengthCheckToaddMore =0; ngOnInit() { + this.draftStatus=false; + this.PDTriggerStatus=true; + this.enablePDButton=false; this.cancelStatus = false; this.ListPdComponent.pdListLoad(false); this.getLenderList(); @@ -49,31 +57,46 @@ export class AddPdComponent implements OnInit, OnDestroy { this.getCustomerSegmentList(); this.getStateCityList(); this.getPDTypeList(); + this.getRelationMaster(); this._PDtriggerForm = this._fb.group({ - fk_lender_id: [null, Validators.compose([Validators.required])], + fk_lender_id: [null], lender_applicant_id: [null, Validators.compose([Validators.required])], - fk_product_id: [null, Validators.compose([Validators.required])], - fk_subproduct_id: [null, Validators.compose([Validators.required])], - fk_pd_type: [null, Validators.compose([Validators.required])], - fk_customer_segment: [null, Validators.compose([Validators.required])], - loan_amount: [null, Validators.compose([Validators.required])], - applicant_name: [null, Validators.compose([Validators.required])], - mobile_no: [null, Validators.compose([Validators.required])], - email: [null, Validators.compose([Validators.required, CustomValidators.email])], -   addressline1: [null, Validators.compose([Validators.required])], + lender_contact_person: [null, Validators.compose([Validators.required])], + lender_contact_mobile: [null, Validators.compose([Validators.required])], + lender_billing: [null], + fk_product_id: [null], + fk_subproduct_id: [null], + fk_pd_type: [null], + fk_customer_segment: [null], + loan_amount: [null], + applicant_name: [null], + mobile_no: [null], + email: [null], +   addressline1: [null], addressline2: [null], addressline3: [null], - fk_city: [null, Validators.compose([Validators.required])], - fk_state: [null, Validators.compose([Validators.required])], -   pincode : [null, Validators.compose([Validators.required])], -   allocation_type: [null], -   sub_allocation_type: [null], + fk_city: [null], + fk_state: [null], +   pincode : [null], +   // allocation_type: [null], +   // sub_allocation_type: [null], items: this._fb.array([]), documents: this._fb.array([]) }); - + this.OnChanges(); } + // enable pd trigger submit function + OnChanges(): void{ + this._PDtriggerForm.valueChanges.subscribe(val => { + if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.applicant_name && val.mobile_no && val.addressline1 && val.fk_city && val.fk_state && val.pincode){ + this.enablePDButton=true; + } + else{ + this.enablePDButton=false; + } + }); + } getLenderList(){ this._pd.getLenderDetails().subscribe( data => { @@ -112,29 +135,34 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.pdTypeList=data.records.pd_type; - if(data.records.pd_allocation_type){ - let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1); - if(getDefaultAllocation[0].pd_allocation_type_id==1){ - this.allocationTypeModel=1; - this.allocationTypeCheck=false; - this.subAllocationTypeCheck=false; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; - } - else if(this.allocationTypeModel[0].pd_allocation_type_id==2){ - this.allocationTypeModel=2; - this.allocationTypeCheck=false; - this.subAllocationTypeCheck=true; - this.allocationLabel="Auto"; - this.subAllocationLabel="Nearest"; - } - else if(this.allocationTypeModel[0].pd_allocation_type_id==3){ - this.allocationTypeModel=3; - this.allocationTypeCheck=true; - this.allocationLabel="Manual"; - } + + //start hide pd allocation type functinality + + // if(data.records.pd_allocation_type){ + // let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1); + // if(getDefaultAllocation[0].pd_allocation_type_id==1){ + // this.allocationTypeModel=1; + // this.allocationTypeCheck=false; + // this.subAllocationTypeCheck=false; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // else if(this.allocationTypeModel[0].pd_allocation_type_id==2){ + // this.allocationTypeModel=2; + // this.allocationTypeCheck=false; + // this.subAllocationTypeCheck=true; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Nearest"; + // } + // else if(this.allocationTypeModel[0].pd_allocation_type_id==3){ + // this.allocationTypeModel=3; + // this.allocationTypeCheck=true; + // this.allocationLabel="Manual"; + // } - } + // } + + // end } }, error => this.errorMessage = error); @@ -151,6 +179,23 @@ export class AddPdComponent implements OnInit, OnDestroy { this.cityList= this.stateList.filter(item => item.state_id == stateID); this.cityList=this.cityList[0].cities; } + + // lendor billing address + getBillingDetails(lendorID:string){ + this.billingList= this.lenderList.filter(item => item.entity_id == lendorID); + this.billingList=this.billingList[0].billing_address; + } + // get relation master details + getRelationMaster(){ + let relation ="RELATIONSHIPS"; + this._pd.getAllMasterDatas(relation).subscribe( + data => { + if (data.status == 200) { + this.relationShipList=data.records; + + } + }, error => this.errorMessage = error); + } createItem(): FormGroup { return this._fb.group({ label: ['Co Applicant'], @@ -191,10 +236,14 @@ export class AddPdComponent implements OnInit, OnDestroy { get documents(): FormArray { return this._PDtriggerForm.get('documents') as FormArray; }; - get pdMain() { return this._PDtriggerForm.controls; } + get pdMain() { + return this._PDtriggerForm.controls; } get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; } - + removeCoApplicant(i: number) { + const control = this._PDtriggerForm.controls['items']; + control.removeAt(i); + } removeItem(index: number) { this.totalfiles.splice(index,1); this.totalFileName.splice(index,1); @@ -229,13 +278,16 @@ export class AddPdComponent implements OnInit, OnDestroy { this.lengthCheckToaddMore=1; } } - submitPdDetails(formValue: any) { + submitPdDetails(formValue: any, status:boolean) { if(this._PDtriggerForm.valid){ // let my_array = this.PDtriggerForm.value; // Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); let pd_details:any={ "fk_lender_id":formValue.fk_lender_id, "lender_applicant_id":formValue.lender_applicant_id, + "lender_billing_id":formValue.lender_billing, + "lender_contact_person":formValue.lender_contact_person, + "lender_contact_mobile":formValue.lender_contact_mobile, "fk_product_id":formValue.fk_product_id, "fk_subproduct_id":formValue.fk_subproduct_id, "fk_pd_type":formValue.fk_pd_type, @@ -247,7 +299,8 @@ export class AddPdComponent implements OnInit, OnDestroy { "fk_city":formValue.fk_city, "fk_state":formValue.fk_state, "pincode":formValue.pincode , - "fk_pd_allocation_type":this.allocationTypeModel , + "pd_status": status, + //"fk_pd_allocation_type":this.allocationTypeModel , "fk_createdby" : this._aws.getlocale(), "createdon": new Date().toJSON().slice(0,19).replace('T',' ') }; @@ -306,29 +359,32 @@ export class AddPdComponent implements OnInit, OnDestroy { }); } } - changeAllocationType(status: boolean) { - if(status){ - this.allocationTypeModel=3; - this.allocationLabel="Manual"; - } - else{ - this.allocationTypeModel=1; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; - } - } - changeSubAllocationType(status: boolean){ - if(status){ - this.allocationTypeModel=2; - this.allocationLabel="Auto"; - this.subAllocationLabel="Nearest"; - } - else{ - this.allocationTypeModel=1; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; - } - } + // start hide allocation type functionality + + // changeAllocationType(status: boolean) { + // if(status){ + // this.allocationTypeModel=3; + // this.allocationLabel="Manual"; + // } + // else{ + // this.allocationTypeModel=1; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // } + // changeSubAllocationType(status: boolean){ + // if(status){ + // this.allocationTypeModel=2; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Nearest"; + // } + // else{ + // this.allocationTypeModel=1; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // } + // end loadPdListCompoent(from:boolean) { if(from){ this.router.navigate([ '../../' ], { relativeTo: this.route }); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html index 6a958309b..b3922d059 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html @@ -1,6 +1,6 @@
- - + +
@@ -25,7 +25,7 @@
- + @@ -124,6 +124,7 @@ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts index 28305196a..791e98d32 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts @@ -79,6 +79,11 @@ export class ListPdComponent implements OnInit, OnDestroy { this.viewPdList = status; this.loadPDDetails(); } + viewPDDetails(pdid:string){ + this.viewPdList = !this.viewPdList; + this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route }); + + } ngOnDestroy(): void { this.viewPdList=false; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html index 5ea9b073b..9996d99eb 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html @@ -1,7 +1,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html new file mode 100644 index 000000000..d677abc20 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html @@ -0,0 +1,43 @@ +
+ + + {{pageTitle}} + + + + + + +

+ {{officer.first_name}} +

+

+ Allocated +

+

+ Scheduled +

+

+ Inprogress +

+ +
+
+ + +

PD officer not available..

+
+
+
+ + +
+ +
+
+
+ + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss new file mode 100644 index 000000000..6e263adae --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss @@ -0,0 +1,3 @@ +.example-full-width{ + width: 100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts new file mode 100644 index 000000000..842a1884f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; + +@Component({ + selector: 'app-pd-allocation', + templateUrl: './pd-allocation.component.html', + styleUrls: ['./pd-allocation.component.scss'] +}) +export class PdAllocationComponent implements OnInit { + public pageTitle: string = "PD Allocation To"; + public _pdAllocationForm: FormGroup; + public pdOfficerList: any = []; + errorMessage: any; + notifier : NotifierService; + selectedItem:any; + isDisabled: boolean; + constructor( notifier: NotifierService, + private _fb: FormBuilder, + private dialogRef: MatDialogRef, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier=notifier; + } + + ngOnInit() { + this.isDisabled=true; + this.getPDOfficerList(this.data.pd_id); + + // this._pdAllocationForm = this._fb.group({ + // pd_primary_id: [null], + // allocation_id: [null], + // }); + } + +// convenience getter for easy access to form fields +// get readForm() { return this._pdAllocationForm.controls; } + +// pd officer list + getPDOfficerList(pdID:string){ + this._pd.getPdOfficerList(pdID).subscribe( + data => { + if (data.status == 200) { + this.pdOfficerList=data.records; + + } + }, error => this.errorMessage = error); + + } + // select pd officer list + selectPdOfficer(selected:any){ + this.isDisabled=false; + this.selectedItem=selected; + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + } + /** To update pd officer*/ + updatePdOfficer(allocateDate:any) { + if(this.isDisabled){ + this.notifier.notify('warning', 'Please Choose PD Officer.!'); + } + else { + let updateData = { + "pd_id":this.data.pd_id, + "fk_pd_allocated_to":allocateDate.fk_user_id, + } + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Allocated.!'); + this.dialogRef.close(); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.errorMessage = "Something Wents Wrong Try Again.!"; + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.errorMessage = "Some Thing Wents Wrong Try Again.!"; + // this.dialogRef.close(); + }); + } + } +/** For Popup Close Button */ + closeAllocationComponent(): void { + this.dialogRef.close(); + } +} 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 new file mode 100644 index 000000000..ecb9de82e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -0,0 +1,87 @@ +
+ +
+ +
+ + + +
+ + + {{master.lender_full_name}} - {{master.lender_applicant_id}} + +  {{master.city_name}} / {{master.state_name}}-{{master.pincode}} + + + +

{{master.product_name}} / {{master.subproduct_name}}

+

{{master.pd_type_name}}   {{master.pd_allocation_type_name}}    {{master.pd_allocated_to}}

+

{{master.addressline1}}

+

{{master.addressline2}}

+

{{master.addressline3}}

+ +

 {{master.loan_amount}}    {{master.pd_status_name}}   {{master.pd_date_of_initiation}}

+ +
+
+ + + +
+ +
+ + Applicants + + + + +

+ +  {{applicant.applicant_name}}     + +  {{applicant.mobile_no}}     Main Applicant +    {{applicant.relation}} +

+ + +
+ +
+ +
+ +
+ + + + + Documents + + + + +

+ {{documents.pd_document_title}}     + +  {{documents.pd_document_name}} +

+
+ +
+ +
+ + + + PD History + + + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss new file mode 100644 index 000000000..fd48f4449 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss @@ -0,0 +1,3 @@ +.cardEdit { + display: inline;float:right;padding-top:3%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts new file mode 100644 index 000000000..51de6afa9 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewPdComponent } from './view-pd.component'; + +describe('ViewPdComponent', () => { + let component: ViewPdComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ViewPdComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewPdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..ee8a7e8cc --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDestroy } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MatDialog } from '@angular/material'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; +import { ListPdComponent } from '../list-pd.component'; +@Component({ + selector: 'app-view-pd', + templateUrl: './view-pd.component.html', + styleUrls: ['./view-pd.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class ViewPdComponent implements OnInit, OnDestroy { + + private notifier:NotifierService; + errorMessage: any; + pdMasterData: any; + pdApplicantData: any; + pdDocumentsData: any; + pdLogsData: any; + viewID:string; + viewParams:any; + // @Input() childData: string; + // @Output() loadParent = new EventEmitter(); + public _EditPDtriggerForm:FormGroup; + constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, + private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) { + this.notifier=notifier + } + + ngOnInit() { + this.ListPdComponent.pdListLoad(false); + this.route.params.subscribe(params => { + this.viewID = params['pdid']; + }); + + this.viewPdDetails(this.viewID); + } + viewPdDetails(editID:string){ + this._pd.editPdDetails(editID).subscribe( + data => { + if (data.status == 200) { + this.pdMasterData=data.records.pd_master_details; + this.pdApplicantData= data.records.applicants_details; + this.pdDocumentsData=data.records.pd_documnets; + this.pdLogsData=data.records.pd_logs; + } +}, error => this.errorMessage = error); + } + + loadPdListCompoent() { + this.router.navigate([ '../../' ], { relativeTo: this.route }); + this.ListPdComponent.showListView(true); + } + + editPdMaster(masterData:any){ + + } + editPdApplicant(applicantData:any){ + + } + // pd allocation to + // edit questions master details popup model + pdAllocationTo(pdID:any) { + const dialogRef = this.dialog.open(PdAllocationComponent, { + data: pdID, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + // this.viewPdDetails(this.childData) + }); + } + +// updateViewComponent(editBack:string) { + +// if(editBack=='1'){ +// this.showEditMasterComponent=!this.showEditMasterComponent +// } +// else if(editBack=='2'){ +// this.showEditApplicantComponent=!this.showEditApplicantComponent +// } +// else if(editBack=='3'){ +// this.showEditMasterComponent=!this.showEditMasterComponent +// } +// this.viewPdDetails(this.childData); +// } + ngOnDestroy(): void { + this.ListPdComponent.showListView(true); } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index bcaa5f044..59e77c3fd 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -25,7 +25,8 @@ import { ListPdComponent } from './list-pd/list-pd.component'; import { ManagePdComponent } from './manage-pd.component'; import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'; import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component'; - +import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component'; +import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component'; import { PdTrigerService } from '../pd-service/pd-triger.service'; import { GetGeometricLocationService } from '../location-service/get-geometric-location.service'; @@ -97,7 +98,7 @@ const pdCustomNotifierOptions: NotifierOptions = { NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), ], - declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent], + declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent], providers: [PdTrigerService, GetGeometricLocationService] }) export class ManagePdModule { } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts index fa000cb60..3b30f5bd6 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts @@ -4,6 +4,8 @@ import { ManagePdComponent } from './manage-pd.component'; import { ListPdComponent } from './list-pd/list-pd.component'; import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'; import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component'; +import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component'; + /* * manage pd router */ @@ -28,6 +30,10 @@ const routes: Routes = [ path: 'addpd', component: AddPdComponent, }, + { + path: 'viewpd/:pdid', + component: ViewPdComponent, + }, ] } ] diff --git a/ng6-seed/src/app/template/questions/add/add.component.html b/ng6-seed/src/app/template/questions/add/add.component.html index c088d4150..fe8959ae8 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.html +++ b/ng6-seed/src/app/template/questions/add/add.component.html @@ -3,7 +3,7 @@

{{pageTitle}}

-
+