sales PD pdf

This commit is contained in:
sriram-at-840620226347 2019-11-15 14:31:05 +05:30
parent 11914393e3
commit c6ac4664e2
7 changed files with 38 additions and 10 deletions

View File

@ -70,7 +70,7 @@
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> --> </button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save"
matTooltipPosition="above" (click)="saveApplicant(_OtherForm.value)"> matTooltipPosition="above" (click)="saveApplicant(_OtherForm.getRawValue())">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>

View File

@ -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: '' }; applicantInfo: any = { 'pd_co_applicant_id': "", 'applicant_name': '', 'is_applicant': false, 'is_person_met': false, applicant_title_name: '', age: '', qualification: '', course_name: '' };
titleList: any = []; titleList: any = [];
qualificationList: any = []; qualificationList: any = [];
individuals_order_id: any;
//EditGeneralFormData: any=[]; //EditGeneralFormData: any=[];
//EditFlag: boolean = false; //EditFlag: boolean = false;
@ -77,10 +78,11 @@ export class OtherApplicantDetailsComponent implements OnInit {
// create applicant form array // create applicant form array
createApplicant(elementValue: any) { createApplicant(elementValue: any) {
console.log('00000',elementValue);
return this._fb.group({ return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id], pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_title_name: [elementValue.applicant_title_name, Validators.required], applicant_title_name: [elementValue.applicant_title_name, Validators.required],
applicant_name: [elementValue.applicant_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_applicant: [elementValue.is_applicant || false],
is_person_met: [elementValue.is_person_met || false], is_person_met: [elementValue.is_person_met || false],
age: [elementValue.age || ''], age: [elementValue.age || ''],

View File

@ -97,7 +97,7 @@
<mat-header-cell *matHeaderCellDef> </mat-header-cell> <mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i =index;" <mat-cell *matCellDef="let details;let i =index;"
[style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'"> [style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'">
<button type="button" *ngIf="i > 0" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="editIndividuals(details,i)" <button type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="editIndividuals(details,i)"
matTooltip="Edit " matTooltipPosition="below"> matTooltip="Edit " matTooltipPosition="below">
<mat-icon>edit</mat-icon> <mat-icon>edit</mat-icon>
</button> </button>

View File

@ -574,6 +574,7 @@ export class GeneralInfoComponent implements OnInit {
width: '40%', width: '40%',
disableClose: true disableClose: true
}); });
console.log(value);
dialogRef.afterClosed() dialogRef.afterClosed()
.subscribe(dataRes=>{ .subscribe(dataRes=>{
// console.log("close",dataRes) // console.log("close",dataRes)

View File

@ -190,6 +190,12 @@ export class PdTrigerService {
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
getSalesPdpdf(pdfdetail): Observable<any> {
return this._http.get<any[]>(this.apiUrl + "downloadSalesPDReport/" + pdfdetail)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get edit row pd details // get edit row pd details
// This function also called in Final Remarks Form // This function also called in Final Remarks Form

View File

@ -89,7 +89,7 @@
<ng-container matColumnDef="Applicant Name"> <ng-container matColumnDef="Applicant Name">
<mat-cell class="cell" *matCellDef="let details;"> <mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="!details.applicant_name" mat-line> <span *ngIf="!details.applicant_name" mat-line>
<small>Not Available</small> <small>--</small>
</span><br> </span><br>
<span *ngIf="details.applicant_name" mat-line> <span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b> <b>{{details.applicant_name}}</b>
@ -110,7 +110,7 @@
<ng-container matColumnDef="Officer Name"> <ng-container matColumnDef="Officer Name">
<mat-cell class="cell center" *matCellDef="let details;"> <mat-cell class="cell center" *matCellDef="let details;">
<span *ngIf="!details.officer_name" mat-line> <span *ngIf="!details.officer_name" mat-line>
<small>Not Available</small> <small>--</small>
</span><br> </span><br>
<span *ngIf="details.applicant_name" mat-line> <span *ngIf="details.applicant_name" mat-line>
<small mat-line>{{details.officer_name}}</small> <small mat-line>{{details.officer_name}}</small>
@ -125,7 +125,7 @@
<ng-container matColumnDef="Action"> <ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;"> <mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PDF Download" <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PDF Download"
matTooltipPosition="above" color="primary"><mat-icon>file_download</mat-icon></button> matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;"> <mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -19,6 +19,7 @@ export class SalesPdComponent implements OnInit {
// data source variable details // data source variable details
salesPdData:any[] = []; salesPdData:any[] = [];
salesPdpdf:any[] = [];
errorMessage:any[]=[]; errorMessage:any[]=[];
recordStatus: boolean; recordStatus: boolean;
@ -33,7 +34,8 @@ export class SalesPdComponent implements OnInit {
constructor(private _pdSales: PdTrigerService) { } constructor(private _pdSales: PdTrigerService) { }
ngOnInit() { ngOnInit() {
this.loadSalesPDDetails() this.loadSalesPDDetails();
// this.salesPDpdf();
} }
@ -59,7 +61,24 @@ export class SalesPdComponent implements OnInit {
// 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.!'); // 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); 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 = <any> 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) { pageChange(e) {