From c6ac4664e2ee7063afcaf30c6a8f7f5bfd83ff4a Mon Sep 17 00:00:00 2001 From: sriram-at-840620226347 Date: Fri, 15 Nov 2019 14:31:05 +0530 Subject: [PATCH] sales PD pdf --- .../other-applicant-details.component.html | 2 +- .../other-applicant-details.component.ts | 6 +++-- .../general-info/general-info.component.html | 2 +- .../general-info/general-info.component.ts | 1 + .../pd-service/pd-triger.service.ts | 6 +++++ .../src/app/sales-pd/sales-pd.component.html | 6 ++--- .../src/app/sales-pd/sales-pd.component.ts | 25 ++++++++++++++++--- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index 98c09f699..69a88e926 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -70,7 +70,7 @@ add --> \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts index eb3c1c646..8cac3dc77 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts @@ -15,6 +15,7 @@ export class OtherApplicantDetailsComponent implements OnInit { applicantInfo: any = { 'pd_co_applicant_id': "", 'applicant_name': '', 'is_applicant': false, 'is_person_met': false, applicant_title_name: '', age: '', qualification: '', course_name: '' }; titleList: any = []; qualificationList: any = []; + individuals_order_id: any; //EditGeneralFormData: any=[]; //EditFlag: boolean = false; @@ -77,10 +78,11 @@ export class OtherApplicantDetailsComponent implements OnInit { // create applicant form array createApplicant(elementValue: any) { + console.log('00000',elementValue); return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], - applicant_title_name: [elementValue.applicant_title_name, Validators.required], - applicant_name: [elementValue.applicant_name || '', Validators.required], + applicant_title_name: [elementValue.applicant_title_name, Validators.required], + applicant_name: [{value:elementValue.applicant_name, disabled : elementValue.individuals_order_id == 1 ? true : false} || '', Validators.required], is_applicant: [elementValue.is_applicant || false], is_person_met: [elementValue.is_person_met || false], age: [elementValue.age || ''], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 20d43ab9e..d4dbdd2b3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -97,7 +97,7 @@ - diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index d197f31eb..3e05a54e4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -574,6 +574,7 @@ export class GeneralInfoComponent implements OnInit { width: '40%', disableClose: true }); + console.log(value); dialogRef.afterClosed() .subscribe(dataRes=>{ // console.log("close",dataRes) 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 8de13e322..d0e4b2835 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 @@ -190,6 +190,12 @@ export class PdTrigerService { catchError(this.handleError('operation', [])) ) } + getSalesPdpdf(pdfdetail): Observable { + return this._http.get(this.apiUrl + "downloadSalesPDReport/" + pdfdetail) + .pipe( + catchError(this.handleError('operation', [])) + ) + } // get edit row pd details // This function also called in Final Remarks Form diff --git a/ng6-seed/src/app/sales-pd/sales-pd.component.html b/ng6-seed/src/app/sales-pd/sales-pd.component.html index 832af6ef3..592875d90 100644 --- a/ng6-seed/src/app/sales-pd/sales-pd.component.html +++ b/ng6-seed/src/app/sales-pd/sales-pd.component.html @@ -89,7 +89,7 @@ - Not Available + --
{{details.applicant_name}} @@ -110,7 +110,7 @@ - Not Available + --
{{details.officer_name}} @@ -125,7 +125,7 @@ + matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)">file_download diff --git a/ng6-seed/src/app/sales-pd/sales-pd.component.ts b/ng6-seed/src/app/sales-pd/sales-pd.component.ts index 8699d8e42..cd35947da 100644 --- a/ng6-seed/src/app/sales-pd/sales-pd.component.ts +++ b/ng6-seed/src/app/sales-pd/sales-pd.component.ts @@ -19,6 +19,7 @@ export class SalesPdComponent implements OnInit { // data source variable details salesPdData:any[] = []; + salesPdpdf:any[] = []; errorMessage:any[]=[]; recordStatus: boolean; @@ -33,7 +34,8 @@ export class SalesPdComponent implements OnInit { constructor(private _pdSales: PdTrigerService) { } ngOnInit() { - this.loadSalesPDDetails() + this.loadSalesPDDetails(); + // this.salesPDpdf(); } @@ -58,9 +60,26 @@ export class SalesPdComponent implements OnInit { this.errorMessage.push(error); // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); alert(error.html_format); - }); + }); + } + + salesPDpdf(pdfdetail){ + this._pdSales.getSalesPdpdf(pdfdetail) + .subscribe( + data => { + if (data.status == 200) { + // window.location.href=data.records; + window.open(data.records, '_blank'); + } + + } + // , error => this.errorMessage = error); + ,error => { + this.errorMessage.push(error); + // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); + alert(error.html_format); + }); - } pageChange(e) { console.log(e);