From d46f78a301911945026ea68d97cf676d3778c5b4 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Wed, 2 Jan 2019 17:02:18 +0530 Subject: [PATCH] business info , company details added : kdk --- .../forms/business-info/business-info.component.ts | 11 ++++++++++- .../pd-service/pd-triger.service.ts | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index c8830ff46..3bb8344ef 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -94,6 +94,7 @@ export class BusinessInfoComponent implements OnInit { this.getStateCityList(); this.initBusinessForm(); this.getCompanyRelation(); + this.getCompanyListForBusiness(); // const Desgn = this.businessForm.controls['designation']; // const Partnr = this.businessForm.controls['partners']; // const otherDoc = this.businessForm.controls['documents']; @@ -516,7 +517,7 @@ export class BusinessInfoComponent implements OnInit { // otherDoc.push(this.createDocument()); // load exist company list from master - this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name); + // this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name); this.businessForm.controls['profession_name'].valueChanges.subscribe(val => { val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('profession_name_other'); @@ -1261,4 +1262,12 @@ export class BusinessInfoComponent implements OnInit { return merged.length > 0 ? merged : []; } } + + getCompanyListForBusiness(): void{ + this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if(data.dataStatus){ + this.existCompanyList = data.records; + } + }) + } } diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 538825a01..c7ced0d9d 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -469,6 +469,15 @@ export class PdTrigerService { catchError(this.handleError('operation', [])) ) } + + + getCompaniesListsForBusiness(pdid: any): Observable { + return this._http.post(this.apiUrl + "getCompaniesListsForBusiness", { "records":{ "pd_id" : pdid}}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // private handleError(operation = 'operation', result?: T) { // return (error: any): Observable => { // return of(result as T);