merge: kms
This commit is contained in:
commit
c553e658eb
3752
ng6-seed/package-lock.json
generated
3752
ng6-seed/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -47,8 +47,10 @@
|
|||||||
"moment": "^2.15.0",
|
"moment": "^2.15.0",
|
||||||
"ng-pick-datetime": "^6.0.16",
|
"ng-pick-datetime": "^6.0.16",
|
||||||
"ng2-charts": "1.6.0",
|
"ng2-charts": "1.6.0",
|
||||||
|
"ng2-ckeditor": "^1.2.2",
|
||||||
"ng2-dragula": "1.3.1",
|
"ng2-dragula": "1.3.1",
|
||||||
"ng2-file-upload": "1.2.1",
|
"ng2-file-upload": "1.2.1",
|
||||||
|
"ng2-pdf-viewer": "^5.2.3",
|
||||||
"ng2-toastr": "^4.1.2",
|
"ng2-toastr": "^4.1.2",
|
||||||
"ng2-validation": "4.2.0",
|
"ng2-validation": "4.2.0",
|
||||||
"ngx-color-picker": "^4.0.3",
|
"ngx-color-picker": "^4.0.3",
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
import { HttpModule, Http } from '@angular/http';
|
import { HttpModule, Http } from '@angular/http';
|
||||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS} from '@angular/common/http';
|
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS} from '@angular/common/http';
|
||||||
|
|
||||||
|
|
||||||
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
|
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
|
||||||
|
|
||||||
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
<h2 mat-dialog-title>Edit PD Report Details</h2>
|
||||||
|
<mat-dialog-content class="mat-typography">
|
||||||
|
<!--<h3>Develop across all platforms</h3>-->
|
||||||
|
<div style="margin: 12px;">
|
||||||
|
<form role="form" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
|
||||||
|
<div class="form-group has-feedback">
|
||||||
|
<ckeditor formControlName="content" name="myckeditor" required [config]="ckeConfig" debounce="500" (change)="onChange($event)">
|
||||||
|
</ckeditor>
|
||||||
|
<!--<div *ngIf="myckeditor.invalid && myckeditor.touched" class="help-block">Required field.</div>-->
|
||||||
|
</div>
|
||||||
|
<button [disabled]="ngForm.invalid" class="btn btn-primary" (click)="myClick()">Save</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<!--<div [innerHTML]="mycontent | safeHtml"></div>-->
|
||||||
|
</mat-dialog-content>
|
||||||
|
<mat-dialog-actions align="end">
|
||||||
|
<button mat-button mat-dialog-close>Cancel</button>
|
||||||
|
<!--<button mat-button [mat-dialog-close]="true" cdkFocusInitial>Install</button>-->
|
||||||
|
</mat-dialog-actions>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ModelEditPdReportComponent } from './model-edit-pd-report.component';
|
||||||
|
|
||||||
|
describe('ModelEditPdReportComponent', () => {
|
||||||
|
let component: ModelEditPdReportComponent;
|
||||||
|
let fixture: ComponentFixture<ModelEditPdReportComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ModelEditPdReportComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ModelEditPdReportComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
|
||||||
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
|
import { PdTrigerService } from '../../../../pd-service/pd-triger.service';
|
||||||
|
import { NotifierService } from "angular-notifier";
|
||||||
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
MatDialog,
|
||||||
|
MatDialogRef,
|
||||||
|
MAT_DIALOG_DATA
|
||||||
|
} from '@angular/material';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-model-edit-pd-report',
|
||||||
|
templateUrl: './model-edit-pd-report.component.html',
|
||||||
|
styleUrls: ['./model-edit-pd-report.component.scss']
|
||||||
|
})
|
||||||
|
export class ModelEditPdReportComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() questionId: number;
|
||||||
|
ngForm: FormGroup;
|
||||||
|
name = 'ng2-ckeditor';
|
||||||
|
ckeConfig: any;
|
||||||
|
recordData: any;
|
||||||
|
log = '';
|
||||||
|
showEditor= false;
|
||||||
|
@ViewChild('myckeditor') ckeditor: any;
|
||||||
|
/**
|
||||||
|
* Notifier service
|
||||||
|
*/
|
||||||
|
private notifier: NotifierService;
|
||||||
|
constructor( private _formBuilder: FormBuilder,
|
||||||
|
private pdTrigerService: PdTrigerService,
|
||||||
|
notifier: NotifierService ,
|
||||||
|
private dialogRef: MatDialogRef<ModelEditPdReportComponent>,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
this.ngForm = this._formBuilder.group({
|
||||||
|
report_template_id: [],
|
||||||
|
fk_template_id: [],
|
||||||
|
content: [null, Validators.compose([Validators.required])],
|
||||||
|
isactive:[1]
|
||||||
|
})
|
||||||
|
// this.mycontent = `<p>My html content</p>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
// alert(JSON.stringify(this.data));
|
||||||
|
// this.ngForm.controls['content'].setValue('<h1>Home<h1>');
|
||||||
|
this.pdTrigerService.getActualPDReportModelTemplate(this.data.startId).subscribe(data => {
|
||||||
|
if(data.dataStatus){
|
||||||
|
this.recordData = data.records[0];
|
||||||
|
|
||||||
|
this.ngForm = this._formBuilder.group({
|
||||||
|
content: [this.recordData.pd_report_latest_version_blob, Validators.compose([Validators.required])],
|
||||||
|
isactive:[this.recordData.isactive]
|
||||||
|
})
|
||||||
|
this.showEditor = true;
|
||||||
|
} else {
|
||||||
|
this.recordData = data.records;
|
||||||
|
this.ngForm = this._formBuilder.group({
|
||||||
|
report_template_id: [null],
|
||||||
|
fk_template_id: [this.questionId],
|
||||||
|
content: [null, Validators.compose([Validators.required])],
|
||||||
|
isactive:[1]
|
||||||
|
})
|
||||||
|
this.showEditor = true;
|
||||||
|
}
|
||||||
|
},err => {
|
||||||
|
|
||||||
|
});
|
||||||
|
// this.ckeConfig = {
|
||||||
|
// allowedContent: false,
|
||||||
|
// extraPlugins: 'divarea',
|
||||||
|
// forcePasteAsPlainText: true
|
||||||
|
// };
|
||||||
|
}
|
||||||
|
|
||||||
|
onChange($event: any): void {
|
||||||
|
console.log('onChange');
|
||||||
|
// this.log += new Date() + "<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
myClick(): void {
|
||||||
|
// let template = this.ngForm.controls['mycontent'].value;
|
||||||
|
// let data = {
|
||||||
|
// template: template,
|
||||||
|
// template_id: this.questionId
|
||||||
|
// }
|
||||||
|
// 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.!');
|
||||||
|
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +1,13 @@
|
|||||||
<mat-card style="min-height:540px;">
|
<div style="text-align: right;" class="mb-1">
|
||||||
<mat-card-content>
|
|
||||||
<div style="text-align: right;" class="mb-1">
|
|
||||||
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
|
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
|
||||||
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button>
|
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: right;" class="mb-1">
|
<div style="text-align: right;" class="mb-1">
|
||||||
|
</div>
|
||||||
</div>
|
<mat-card style="min-height:540px;">
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-tab-group>
|
||||||
|
<mat-tab label="PD Report">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<label>Billing Name : </label> {{pdReportRecords?.billing_name}}
|
<label>Billing Name : </label> {{pdReportRecords?.billing_name}}
|
||||||
@ -40,10 +41,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</mat-tab>
|
||||||
|
<mat-tab label="PD Report With Template">
|
||||||
|
<div>
|
||||||
|
<button (click)="addNewQuestion()">Edit</button>
|
||||||
|
<hr>
|
||||||
|
<pdf-viewer [src]="src"
|
||||||
|
[original-size]="false">
|
||||||
|
</pdf-viewer>
|
||||||
|
</div>
|
||||||
|
</mat-tab>
|
||||||
|
</mat-tab-group>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
<notifier-container></notifier-container>
|
<notifier-container></notifier-container>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';
|
||||||
import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core';
|
import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core';
|
||||||
import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms';
|
import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
@ -5,6 +6,8 @@ import {NotifierService} from 'angular-notifier';
|
|||||||
import {ListPdComponent} from './../list-pd.component';
|
import {ListPdComponent} from './../list-pd.component';
|
||||||
|
|
||||||
import {PdTrigerService} from '../../../pd-service/pd-triger.service';
|
import {PdTrigerService} from '../../../pd-service/pd-triger.service';
|
||||||
|
import { MatDialog } from "@angular/material";
|
||||||
|
import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pd-report',
|
selector: 'app-pd-report',
|
||||||
@ -12,27 +15,34 @@ import {PdTrigerService} from '../../../pd-service/pd-triger.service';
|
|||||||
styleUrls: ['./pd-report.component.scss']
|
styleUrls: ['./pd-report.component.scss']
|
||||||
})
|
})
|
||||||
export class PdReportComponent implements OnInit {
|
export class PdReportComponent implements OnInit {
|
||||||
|
Url : SafeUrl;
|
||||||
startPD: any;
|
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;
|
||||||
pdReportRecords:any;
|
pdReportRecords:any;
|
||||||
|
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent) {
|
private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent,
|
||||||
|
private dialog: MatDialog, private sanitizer: DomSanitizer) {
|
||||||
this.startPD = this.route.snapshot.params['pdid'];
|
this.startPD = this.route.snapshot.params['pdid'];
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
|
// 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");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.listPDComponent.showListView(false);
|
this.listPDComponent.showListView(false);
|
||||||
this.getPdReportDetails();
|
this.getPdReportDetails();
|
||||||
|
this.getPdReportFinalTemplateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
getPdReportDetails() {
|
getPdReportDetails() {
|
||||||
this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => {
|
this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
// this.pdReportRecords = data.records.question_answers;
|
// this.pdReportRecords = data.records.question_answers;
|
||||||
|
|
||||||
this.pdReportRecords = data.records;
|
this.pdReportRecords = data.records;
|
||||||
// this.pdReportRecords = data.records.qu;
|
// this.pdReportRecords = data.records.qu;
|
||||||
}
|
}
|
||||||
@ -41,12 +51,39 @@ export class PdReportComponent implements OnInit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPdReportFinalTemplateDetails(){
|
||||||
|
this.pdTrigerService.getPDReportFinalDocument(this.startPD).subscribe(data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
// this.pdReportRecords = data.records.question_answers;
|
||||||
|
// this.src = data.records.pd_report_uri;
|
||||||
|
// alert(this.src);
|
||||||
|
// this.pdReportRecords = data.records.qu;
|
||||||
|
}
|
||||||
|
}, err=> {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// load pd view component
|
// load pd view component
|
||||||
loadPdViewCompoent() {
|
loadPdViewCompoent() {
|
||||||
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
|
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add questions popup model call
|
||||||
|
addNewQuestion() {
|
||||||
|
const dialogRef = this.dialog.open(ModelEditPdReportComponent, {
|
||||||
|
data: { startId : this.startPD},
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogRef.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.getQuestionsMasters();
|
||||||
|
// this.getBranch();
|
||||||
|
// this.isPopupOpened = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
import { CKEditorModule } from 'ng2-ckeditor';
|
||||||
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
@ -72,6 +76,7 @@ import {RentalInfoComponent} from "./list-pd/start-pd/forms/rental-info/rental-i
|
|||||||
import { AllocationViewMoreComponent } from './list-pd/allocation-view-more/allocation-view-more.component';
|
import { AllocationViewMoreComponent } from './list-pd/allocation-view-more/allocation-view-more.component';
|
||||||
import { PdRequirementComponent } from './list-pd/pd-requirement/pd-requirement.component';
|
import { PdRequirementComponent } from './list-pd/pd-requirement/pd-requirement.component';
|
||||||
import { GeneralInfoComponent } from './list-pd/start-pd/forms/general-info/general-info.component';
|
import { GeneralInfoComponent } from './list-pd/start-pd/forms/general-info/general-info.component';
|
||||||
|
import { ModelEditPdReportComponent } from './list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component';
|
||||||
import { OtherApplicantDetailsComponent } from './list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component';
|
import { OtherApplicantDetailsComponent } from './list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component';
|
||||||
|
|
||||||
|
|
||||||
@ -251,7 +256,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||||
// OwlNativeDateTimeModule,
|
// OwlNativeDateTimeModule,
|
||||||
// ],
|
// ],
|
||||||
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, OtherApplicantDetailsComponent],
|
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent],
|
||||||
|
|
||||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
@ -260,6 +265,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
ManagePdRoutingModule,
|
ManagePdRoutingModule,
|
||||||
NotifierModule.withConfig(pdCustomNotifierOptions),
|
NotifierModule.withConfig(pdCustomNotifierOptions),
|
||||||
|
CKEditorModule,
|
||||||
|
PdfViewerModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
@ -287,7 +294,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
providers: [PdTrigerService, GetGeometricLocationService],
|
providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
|
|
||||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
|
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
|
||||||
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent],
|
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent],
|
||||||
|
|
||||||
})
|
})
|
||||||
export class ManagePdModule {
|
export class ManagePdModule {
|
||||||
|
|||||||
@ -289,6 +289,20 @@ getPDFormDetailsWithID(pdID, formID ):Observable<any> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPDReportFinalDocument(pdId: number){
|
||||||
|
return this._http.post<any>(this.apiUrl+"generatePDReport ",{"records":{"pd_id":pdId}})
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('operation', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
getActualPDReportModelTemplate(pdId: number) {
|
||||||
|
return this._http.post<any>(this.apiUrl+"getLatestPDReportBlob ",{"records":{"pd_id":pdId}})
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('operation', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// inWords(num) {
|
// inWords(num) {
|
||||||
// let a : any = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
|
// let a : any = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { CKEditorModule } from 'ng2-ckeditor';
|
||||||
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||||
import {
|
import {
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
@ -27,6 +30,8 @@ import { personalDiscussionRoutes } from './personal-discussion.routing';
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterModule.forChild(personalDiscussionRoutes),
|
RouterModule.forChild(personalDiscussionRoutes),
|
||||||
|
CKEditorModule,
|
||||||
|
PdfViewerModule,
|
||||||
ManagePdModule,
|
ManagePdModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
|
|||||||
@ -136,5 +136,15 @@ export class TemplatesService {
|
|||||||
return this._http.get<any[]>(this.apiUrl + "getListOfCategories");
|
return this._http.get<any[]>(this.apiUrl + "getListOfCategories");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addPDReportModelTemplate(Records : any): Observable<any> {
|
||||||
|
Records.fk_createdby = this._aws.getlocale();//to get user id for who is created the Record
|
||||||
|
// Records.createdon = currentdate;//to get Current date and Time for when the Record is created
|
||||||
|
return this._http.post<any[]>(this.apiUrl + "savePDReportTemplate", {'records': Records });
|
||||||
|
}
|
||||||
|
|
||||||
|
getPDReportModelTemplate(template_id: number): Observable<any> {
|
||||||
|
return this._http.post<any[]>(this.apiUrl + "getPDReportTemplate", { "records": {"fk_template_id": template_id }});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { CKEditorModule } from 'ng2-ckeditor';
|
||||||
import {
|
import {
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
@ -37,6 +37,7 @@ import { MastersService } from './service/masters/masters.service';
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
CKEditorModule,
|
||||||
RouterModule.forChild(TemplateRoutes),
|
RouterModule.forChild(TemplateRoutes),
|
||||||
TemplatesModule,
|
TemplatesModule,
|
||||||
QuestionsModule,
|
QuestionsModule,
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
<div style="margin: 12px;">
|
||||||
|
<form *ngIf="showEditor" role="form" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
|
||||||
|
<div class="form-group has-feedback" >
|
||||||
|
<ckeditor formControlName="content"
|
||||||
|
name="myckeditor"
|
||||||
|
required
|
||||||
|
[config]="ckeConfig"
|
||||||
|
debounce="500"
|
||||||
|
(change)="onChange($event)">
|
||||||
|
</ckeditor>
|
||||||
|
<!--<div *ngIf="myckeditor.invalid && myckeditor.touched" class="help-block">Required field.</div>-->
|
||||||
|
</div>
|
||||||
|
<button [disabled]="ngForm.invalid" class="btn btn-primary" (click)="myClick()">Save</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<!--<div [innerHTML]="mycontent | safeHtml"></div>-->
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ReportTemplateComponent } from './report-template.component';
|
||||||
|
|
||||||
|
describe('ReportTemplateComponent', () => {
|
||||||
|
let component: ReportTemplateComponent;
|
||||||
|
let fixture: ComponentFixture<ReportTemplateComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ReportTemplateComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ReportTemplateComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
import { Component, OnInit, ViewChild , Input} from '@angular/core';
|
||||||
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
|
import { TemplatesService } from './../../../../service/templates/templates.service';
|
||||||
|
import { NotifierService } from "angular-notifier";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-report-template',
|
||||||
|
templateUrl: './report-template.component.html',
|
||||||
|
styleUrls: ['./report-template.component.scss']
|
||||||
|
})
|
||||||
|
export class ReportTemplateComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() questionId: number;
|
||||||
|
ngForm: FormGroup;
|
||||||
|
name = 'ng2-ckeditor';
|
||||||
|
ckeConfig: any;
|
||||||
|
recordData: any;
|
||||||
|
log = '';
|
||||||
|
showEditor= false;
|
||||||
|
@ViewChild('myckeditor') ckeditor: any;
|
||||||
|
/**
|
||||||
|
* Notifier service
|
||||||
|
*/
|
||||||
|
private notifier: NotifierService;
|
||||||
|
constructor( private _formBuilder: FormBuilder,
|
||||||
|
private templatesService: TemplatesService,
|
||||||
|
notifier: NotifierService ) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
// this.ngForm = this._formBuilder.group({
|
||||||
|
// report_template_id: [],
|
||||||
|
// fk_template_id: [],
|
||||||
|
// content: [null, Validators.compose([Validators.required])],
|
||||||
|
// isactive:[1]
|
||||||
|
// })
|
||||||
|
// this.mycontent = `<p>My html content</p>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
// this.ngForm.controls['content'].setValue('<h1>Home<h1>');
|
||||||
|
this.templatesService.getPDReportModelTemplate(this.questionId).subscribe(data => {
|
||||||
|
if(data.dataStatus){
|
||||||
|
this.recordData = data.records[0];
|
||||||
|
|
||||||
|
this.ngForm = this._formBuilder.group({
|
||||||
|
report_template_id: [this.recordData.report_template_id],
|
||||||
|
fk_template_id: [this.recordData.fk_template_id],
|
||||||
|
content: [this.recordData.content, Validators.compose([Validators.required])],
|
||||||
|
isactive:[this.recordData.isactive]
|
||||||
|
})
|
||||||
|
this.showEditor = true;
|
||||||
|
} else {
|
||||||
|
this.recordData = data.records;
|
||||||
|
this.ngForm = this._formBuilder.group({
|
||||||
|
report_template_id: [null],
|
||||||
|
fk_template_id: [this.questionId],
|
||||||
|
content: [null, Validators.compose([Validators.required])],
|
||||||
|
isactive:[1]
|
||||||
|
})
|
||||||
|
this.showEditor = true;
|
||||||
|
}
|
||||||
|
},err => {
|
||||||
|
|
||||||
|
});
|
||||||
|
this.ckeConfig = {
|
||||||
|
allowedContent: false,
|
||||||
|
extraPlugins: 'divarea',
|
||||||
|
forcePasteAsPlainText: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onChange($event: any): void {
|
||||||
|
console.log('onChange');
|
||||||
|
// this.log += new Date() + "<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
myClick(): void {
|
||||||
|
// let template = this.ngForm.controls['mycontent'].value;
|
||||||
|
// let data = {
|
||||||
|
// template: template,
|
||||||
|
// template_id: this.questionId
|
||||||
|
// }
|
||||||
|
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.!');
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -45,6 +45,12 @@
|
|||||||
</app-template-edit-question-answer>
|
</app-template-edit-question-answer>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
<mat-tab label="Report Template">
|
||||||
|
<ng-template matTabContent>
|
||||||
|
<app-report-template [questionId]="question_id">
|
||||||
|
</app-report-template>
|
||||||
|
</ng-template>
|
||||||
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { CKEditorModule } from 'ng2-ckeditor';
|
||||||
|
|
||||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
@ -35,6 +36,7 @@ import { TemplatesService } from './../service/templates/templates.service';
|
|||||||
import { CategoryQuestionAnswerComponent } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
import { CategoryQuestionAnswerComponent } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
||||||
import { DialogOverviewExampleDialog } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
import { DialogOverviewExampleDialog } from './templates-list/edit/edit-question-answer/category-question-answer/category-question-answer.component';
|
||||||
import { TemplatesAddComponent } from './templates-list/templates-add/templates-add.component';
|
import { TemplatesAddComponent } from './templates-list/templates-add/templates-add.component';
|
||||||
|
import { ReportTemplateComponent } from './templates-list/edit/report-template/report-template.component';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Question Master Module details
|
* Question Master Module details
|
||||||
@ -87,6 +89,7 @@ const customNotifierOptions: NotifierOptions = {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
CKEditorModule,
|
||||||
NotifierModule.withConfig(customNotifierOptions),
|
NotifierModule.withConfig(customNotifierOptions),
|
||||||
FlexLayoutModule,
|
FlexLayoutModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
@ -115,7 +118,8 @@ const customNotifierOptions: NotifierOptions = {
|
|||||||
EditQuestionAnswerComponent,
|
EditQuestionAnswerComponent,
|
||||||
CategoryQuestionAnswerComponent,
|
CategoryQuestionAnswerComponent,
|
||||||
DialogOverviewExampleDialog,
|
DialogOverviewExampleDialog,
|
||||||
TemplatesAddComponent
|
TemplatesAddComponent,
|
||||||
|
ReportTemplateComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
DialogOverviewExampleDialog,
|
DialogOverviewExampleDialog,
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<base href="./">
|
<base href="./">
|
||||||
|
<script src="https://cdn.ckeditor.com/4.9.2/full-all/ckeditor.js"></script>
|
||||||
|
<script> CKEDITOR.config.forcePasteAsPlainText = true; </script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user