Sales PDF download option enabled

This commit is contained in:
sriram-at-840620226347 2019-11-27 16:38:27 +05:30
parent 48569627ca
commit 5bee29aa2f
3 changed files with 48 additions and 5 deletions

View File

@ -19,9 +19,9 @@
<ion-content padding>
<ion-list >
<ion-grid class="fadeIn">
<mat-card class="md-box" reorder="true" >
<mat-card class="md-box" reorder="true">
<ion-list style="margin-top: 5px;">
<ion-item *ngFor="let val of sales_displayValue">
<ion-item *ngFor="let val of sales_displayValue" (click)="presentActionSheet(val.sales_pd_id)">
<!-- <p item-start class="lettericon">{{val.abbr}}</p> -->
<!-- <ion-icon style="font-size:90%" item-start="" class="lettericon" [style.background]="bgColor[i]" *ngIf="progess.applicat_details ===undefined || progess.applicat_details[0].applicant_name ==null">{{progess.pd_id}}</ion-icon> -->
<ion-row>
@ -47,7 +47,6 @@
<ion-col text-right>
<div style="font-size: 13px;">
<h6>{{val.abbr}}</h6>
</div>
</ion-col>
</ion-row>

View File

@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { IonicPage, NavController, NavParams, ActionSheetController } from 'ionic-angular';
import { SalesPdProvider } from '../../providers/sales-pd/sales-pd';
import { HomePage, Section1 } from '../home/home';
import { ToastProvider } from '../../../../providers/common-provider/toast';
@ -19,7 +19,7 @@ import { ToastProvider } from '../../../../providers/common-provider/toast';
export class SalesPDlistPage {
sales_displayValue: any=[];
constructor(public navCtrl: NavController, public navParams: NavParams,private salesPDService:SalesPdProvider,private toastProvider:ToastProvider) {
constructor(public actionSheetCtrl: ActionSheetController,public navCtrl: NavController, public navParams: NavParams,private salesPDService:SalesPdProvider,private toastProvider:ToastProvider) {
}
ionViewDidLoad() {
@ -48,6 +48,20 @@ export class SalesPDlistPage {
}
salesPDpdf(pdfdetail){
this.salesPDService.getSalesPdpdf(pdfdetail)
.subscribe(
data => {
if (data.status == 200) {
// window.open(data.records);
// window.location.href=data.records;
window.open(data.records, '_blank');
}
}
);
}
alertDecision(){
let btns={button1:'FreshPD',button2:'Continue'}
let alert = this.toastProvider.setAlertWithButtons("<small>You have one Incomplete PD<small>", "<strong>Are You Continue with that or Start with Fresh PD<br/><small>Note:Starting Fresh PD will Delete the existing one.</small></strong>",btns)
@ -66,4 +80,29 @@ export class SalesPDlistPage {
})
}
presentActionSheet(pdfdownlond) {
let actionSheet = this.actionSheetCtrl.create({
title: 'Select Option',
buttons: [
{
text: 'PDF Download',
role: 'destructive',
handler: () => {
this.salesPDpdf(pdfdownlond);
// console.log('pdf check',this.salesPDpdf);
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
}

View File

@ -131,4 +131,9 @@ current_section:any;
})
}
getSalesPdpdf(pdfdetail): Observable<any> {
return this.http.get<any[]>(this.apiUrl + "downloadSalesPDReport/" + pdfdetail)
}
}