pd report view pdf changes : kdk

This commit is contained in:
dineshkumarkannan 2018-12-10 18:58:04 +05:30
parent 61250f930e
commit 521850ff36
4 changed files with 45 additions and 18 deletions

View File

@ -82,19 +82,23 @@ export class ModelEditPdReportComponent implements OnInit {
}
myClick(): void {
// let template = this.ngForm.controls['mycontent'].value;
// let data = {
// template: template,
// template_id: this.questionId
// }
let template = this.ngForm.controls['content'].value;
// alert(template);
let data = {
content: template,
pd_id: this.data.startId
}
// alert(JSON.stringify(data));
// var formValues = this.ngForm.value;
// Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
// this.templatesService.addPDReportModelTemplate(formValues).subscribe(data=>{
// this.notifier.notify('success', 'Your Changes Updated.!');
// }, err => {
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.pdTrigerService.updatePDReportDetails(data).subscribe(data=>{
this.notifier.notify('success', 'Your Changes Updated.!');
this.dialogRef.close();
}, err => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// })
})
}
}

View File

@ -44,12 +44,18 @@
</mat-tab>
<mat-tab label="PD Report With Template">
<div>
<button (click)="addNewQuestion()">Edit</button>
<div style="text-align: right;" class="mb-1">
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Edit" matTooltipPosition="above"
(click)="addNewQuestion()"><mat-icon>edit</mat-icon></button>
</div>
<hr>
<pdf-viewer [src]="src"
[original-size]="false">
<div style="margin: 12px;
background: #ddd;
padding: 8px;">
<pdf-viewer [src]="src" [original-size]="false">
</pdf-viewer>
</div>
</div>
</mat-tab>
</mat-tab-group>
</mat-card-content>

View File

@ -17,18 +17,27 @@ import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-
export class PdReportComponent implements OnInit {
Url : SafeUrl;
startPD: any;
public src = 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf';
// public src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181207T122031Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=fac718f35d195ecb45d1dc7049fbaf0fa3158f237deeedac3bae60f8ec22e822';
// public src = 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf';
// public src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b';
public src;
public document;
// public src;
pdReportRecords:any;
private notifier: NotifierService;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent,
private dialog: MatDialog, private sanitizer: DomSanitizer) {
this.startPD = this.route.snapshot.params['pdid'];
this.notifier = notifier;
// this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb';
// this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b");
// alert(JSON.stringify(this.src));
// this.document = { name: 'Angular 2',
// description: 'An amazing Angular 2 pdf',
// url: { url: 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b', withCredentials: true } };
// this.Url = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181207T122031Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=fac718f35d195ecb45d1dc7049fbaf0fa3158f237deeedac3bae60f8ec22e822");
}
@ -55,7 +64,7 @@ export class PdReportComponent implements OnInit {
this.pdTrigerService.getPDReportFinalDocument(this.startPD).subscribe(data => {
if (data.status == 200) {
// this.pdReportRecords = data.records.question_answers;
// this.src = data.records.pd_report_uri;
this.src = data.records.pd_report_uri;
// alert(this.src);
// this.pdReportRecords = data.records.qu;
}
@ -78,6 +87,7 @@ export class PdReportComponent implements OnInit {
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getPdReportFinalTemplateDetails();
// this.getQuestionsMasters();
// this.getBranch();
// this.isPopupOpened = false;

View File

@ -303,6 +303,13 @@ getPDFormDetailsWithID(pdID, formID ):Observable<any> {
)
}
updatePDReportDetails(records: any){
return this._http.post<any>(this.apiUrl+"saveNewVersionOfPDReport ",{"records": records})
.pipe(
catchError(this.handleError('operation', []))
)
}
// inWords(num) {
// let a : any = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];