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>
</button> -->
<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>
</button>
</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: '' };
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 || ''],

View File

@ -97,7 +97,7 @@
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i =index;"
[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">
<mat-icon>edit</mat-icon>
</button>

View File

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

View File

@ -190,6 +190,12 @@ export class PdTrigerService {
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
// This function also called in Final Remarks Form

View File

@ -89,7 +89,7 @@
<ng-container matColumnDef="Applicant Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="!details.applicant_name" mat-line>
<small>Not Available</small>
<small>--</small>
</span><br>
<span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b>
@ -110,7 +110,7 @@
<ng-container matColumnDef="Officer Name">
<mat-cell class="cell center" *matCellDef="let details;">
<span *ngIf="!details.officer_name" mat-line>
<small>Not Available</small>
<small>--</small>
</span><br>
<span *ngIf="details.applicant_name" mat-line>
<small mat-line>{{details.officer_name}}</small>
@ -125,7 +125,7 @@
<ng-container matColumnDef="Action">
<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"
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>
</ng-container>
<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
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 = <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) {
console.log(e);