diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html index e7443ecc2..0c978aba3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html @@ -2,7 +2,7 @@
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts index e0dfa50c1..0b50cbef4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts @@ -47,24 +47,14 @@ export class ModelEditPdReportComponent implements OnInit { ngOnInit() { // alert(JSON.stringify(this.data)); // this.ngForm.controls['content'].setValue('

Home

'); - this.pdTrigerService.getActualPDReportModelTemplate(this.data.startId).subscribe(data => { - if(data.dataStatus){ + this.pdTrigerService.getActualPDReportModelTemplate(this.data).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; + }); + this.showEditor = true; } },err => { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index ab93fd424..a82a775da 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -7,7 +7,7 @@ - +
{{pdReportRecords?.billing_name}} @@ -42,18 +42,36 @@
- +
-
- +
+ + +
+
+
+ + -- + + {{ pd.doc_name }} ( Current Version ) + + +
+
+
+
+ + +
+
+ + +
+
-
-
- -
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index f9044faef..f773a14ba 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -1,14 +1,19 @@ import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser'; -import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core'; +import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy, Inject} from '@angular/core'; import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms'; import {ActivatedRoute, Router} from '@angular/router'; import {NotifierService} from 'angular-notifier'; import {ListPdComponent} from './../list-pd.component'; import {PdTrigerService} from '../../../pd-service/pd-triger.service'; -import { MatDialog } from "@angular/material"; +import { MatDialog, + MatDialogRef, + MAT_DIALOG_DATA } from "@angular/material"; import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component'; +/**sweet alert */ +// import Swal from 'sweetalert2'; + @Component({ selector: 'app-pd-report', templateUrl: './pd-report.component.html', @@ -21,10 +26,12 @@ export class PdReportComponent implements OnInit { // 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 generateBtn: Boolean = false; + public reGenerateBtn: Boolean = false; + public pdReportVersionList = []; // public src; pdReportRecords:any; - + latestPDDetails: any; private notifier: NotifierService; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, @@ -39,13 +46,61 @@ export class PdReportComponent implements OnInit { // 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"); - } ngOnInit() { this.listPDComponent.showListView(false); this.getPdReportDetails(); - this.getPdReportFinalTemplateDetails(); + this.getPdReportVersionList(); + } + + reGeneratePFReport(){ + let data = { + "pd_id": this.startPD, + "regenerate":"1" + }; + this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data=>{ + if(data.dataStatus){ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.getPdReportVersionList(); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } + generateNewPDReport() { + let data = { + "pd_id": this.startPD + }; + this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data=>{ + if(data.dataStatus){ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.getPdReportVersionList(); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } + + getPdReportVersionList(){ + this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { + if(data.status == 200 && data.dataStatus){ + this.pdReportVersionList = [...data.records].reverse(); + let datas = this.pdReportVersionList.filter((a)=>{return a.is_latest == 1;}) + this.latestPDDetails = datas[0]; + // alert(JSON.stringify(this.latestPDDetails)); + this.reGenerateBtn = true; + } else { + // this.reGenerateBtn = true; + this.generateBtn = true; + } + }, err=> { + + }) } getPdReportDetails() { @@ -60,18 +115,6 @@ 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 @@ -82,232 +125,122 @@ export class PdReportComponent implements OnInit { // add questions popup model call addNewQuestion() { const dialogRef = this.dialog.open(ModelEditPdReportComponent, { - data: { startId : this.startPD}, + data: { startId : this.startPD, version_id: this.latestPDDetails.doc_name}, disableClose: true }); dialogRef.afterClosed() .subscribe(dataresult => { - this.getPdReportFinalTemplateDetails(); + // this.getPdReportFinalTemplateDetails(); // this.getQuestionsMasters(); // this.getBranch(); // this.isPopupOpened = false; }); } + changeVersion(pd : any): void { + this.latestPDDetails = pd; + } + + changeDocumentEdit() : void{ + + + const dialogRef = this.dialog.open(DialogChangeCurrentVenrsion, { + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult) { + let data = { + "pd_id": this.startPD, + "doc_name": this.latestPDDetails.doc_name + }; + this.pdTrigerService.swapOlderPDReportToLatest(data).subscribe(data => { + if (data.status == 200) { + this.notifier.notify('success', 'Your Changes Updated.!'); + this.getPdReportVersionList(); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err=> { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } else { + } + }); + + + + + // Swal('User Created'); + // swal({ + // title: 'Error!', + // text: 'Do you want to continue', + // type: 'error', + // confirmButtonText: 'Cool' + // }); + + // Swal({ + // title: 'Are you sure?', + // type: 'warning', + // showCancelButton: true, + // confirmButtonColor: '#3085d6', + // cancelButtonColor: '#d33', + // confirmButtonText: SwalButtonText + // }).then((result) => { + // if (result.value) { + // // this._mastersService.editMasterDetails(ActiveDatas,'CITY') + // // .subscribe(dataresult=>{ + // // if (dataresult.dataStatus == true){ + // // Swal(this.SwalMessage,'success'); + // // this.getCity(); + // // } + // // else{ + // // Swal("Sorry Try Again !"); + // // } + // // }); + // } + // else{ + // // this.getCity(); + // }s + // }) + } } - // let Records = { - // "dataStatus": true, - // "status": 200, - // "records": { - // "pd_id": "1", - // "fk_lender_id": "7", - // "lender_full_name": "check", - // "lender_short_name": "check", - // "fk_entity_billing_id": "1", - // "billing_name": "ICICI- CHENNAI", - // "lender_applicant_id": "Le123", - // "pd_date_of_initiation": "06\/10\/2018", - // "fk_product_id": "8", - // "product_name": "Land Loan", - // "product_abbr": "LL", - // "fk_subproduct_id": "1", - // "subproduct_name": "Purchase (Resale) Loan. ", - // "subproduct_abbr": "HL PUR-RESALE", - // "fk_pd_type": "1", - // "pd_type_name": "Full PD ", - // "pd_status": "COMPLETED", - // "pd_status_name": null, - // "pd_specific_clarification": null, - // "createdon": "06\/10\/2018 05:43:58", - // "fk_createdby": "1", - // "updatedon": "16\/11\/2018 11:11:00", - // "fk_updatedby": "1", - // "createdby": "Krishna kumar", - // "updatedby": "Krishna kumar", - // "fk_pd_allocation_type": "1", - // "pd_allocation_type_name": "AUTO", - // "fk_pd_allocated_to": "128", - // "pd_allocated_to": "VinothKumar S", - // "executive_id": null, - // "executive_name": null, - // "central_pd_officer_id": null, - // "centralofficer": null, - // "fk_pd_template_id": "11", - // "template_name": "TMB", - // "fk_customer_segment": "2", - // "customer_segment_name": "Salary Cheque", - // "customer_segment_abbr": "SAL-CHQ", - // "pd_officier_final_judgement": null, - // "pd_agency_id": null, - // "agency_name": null, - // "loan_amount": "60000", - // "addressline1": "MGR Street,Vengaivasal Main Road", - // "addressline2": "Santhoshpuram", - // "addressline3": "chennai", - // "fk_city": "2", - // "city_name": "Chennai", - // "fk_state": "2", - // "state_name": "Tamil Nadu", - // "pincode": "600100", - // "pd_contact_person": "Ram", - // "pd_contact_mobileno": "32131233", - // "scheduled_on": "31\/12\/2018 12:59 PM", - // "completed_on": null, - // "remarks": null, - // "pd_applicant_details": [ - // { - // "pd_co_applicant_id": "1", - // "fk_pd_id": "1", - // "applicant_name": "Karthi Raj", - // "applicant_type": "1", - // "mobile_no": "4234234155", - // "email": "sivak@gmail.com", - // "addressline1": null, - // "addressline2": null, - // "addressline3": null, - // "fk_city": null, - // "fk_state": null, - // "pincode": null, - // "relation": "brother", - // "relation_name": null, - // "landline": null - // }, - // { - // "pd_co_applicant_id": "2", - // "fk_pd_id": "1", - // "applicant_name": "ramesh", - // "applicant_type": "0", - // "mobile_no": "3123123213", - // "email": "", - // "addressline1": null, - // "addressline2": null, - // "addressline3": null, - // "fk_city": null, - // "fk_state": null, - // "pincode": null, - // "relation": "brother", - // "relation_name": null, - // "landline": null - // } - // ], - // "question_answers": { - // "form_details": [ - // { - // "Name": "Supplied Details", - // "Details": [ - // { - // "question": "What are the main raw materials?(MEG Only)", - // "answer": "check checkcheck" - // }, - // { - // "question": "Supplier Name", - // "answer": "Resico" - // }, - // { - // "question": "Contact Person Name", - // "answer": "Karthick" - // }, - // { - // "question": "Contact Mobile Number", - // "answer": "9874115221" - // }, - // { - // "question": "Payment Mode", - // "answer": "Immediate Or Advanced Payment" - // }, - // { - // "question": "% of immediate \/ Advance Payment Purchase to Total Purchase?", - // "answer": "212" - // }, - // { - // "question": "Credit Period", - // "answer": "" - // }, - // { - // "question": "Frequency of Purchase", - // "answer": "Monthly" - // }, - // { - // "question": "Others Details", - // "answer": "" - // } - // ]}, - // { - // "Name": "Client Details", - // "Details": [ - // { - // "question": "Client Name", - // "answer": "Venba" - // }, - // { - // "question": "Contact Person Name", - // "answer": "test" - // }, - // { - // "question": "Contact Mobile Number", - // "answer": "9685471122" - // }, - // { - // "question": "Payment Mode", - // "answer": "Combination of Both" - // }, - // { - // "question": "% of immediate \/ Advance Payment Purchase to Total Purchase?", - // "answer": "12" - // }, - // { - // "question": "Credit Period", - // "answer": "10" - // }, - // { - // "question": "Frequency of Purchase", - // "answer": "Weekly" - // }, - // { - // "question": "Others Details", - // "answer": "" - // } - // ]}, - // { "Name": "Personal Details", - // "Details": [ - // { - // "question": "Name", - // "answer": "Karthi Raj" - // }, - // { - // "question": "Age", - // "answer": "50" - // }, - // { - // "question": "Entity", - // "answer": "Individual" - // }, - // { - // "question": "Name", - // "answer": "ramesh" - // }, - // { - // "question": "Age", - // "answer": "45" - // }, - // { - // "question": "Entity", - // "answer": "Individual" - // }, - // { - // "question": "Relationship With Main Applicant", - // "answer": "Brother" - // }, - // { - // "question": "Remarks", - // "answer": "good" - // } - // ]} - // ], - // "general_questions": [ - // ] - // } - // } - // } + +@Component({ + selector: 'dialog-overview-example-dialog', + styles: [` +.listHover: hover { + background: yellow; + }` + ], + template: ` +
+

Document is marked as final

+

Because you've marked the document as final, you can edit this document.

+
+ + +
+
+ ` +}) +export class DialogChangeCurrentVenrsion implements OnInit { + + public m_questions: any; + + public m_question_forms: any; + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) { + } + + ngOnInit(): void { + } + + getConfirmation(confim : Boolean) { + this.dialogRef.close(confim); + } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index f0045db23..4ebefbf78 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -51,7 +51,7 @@ formControlName="locality_others"> - + {{data.description}} @@ -59,7 +59,7 @@ - + {{data.rating}} @@ -86,11 +86,15 @@ - + - + + + + + Yes @@ -98,18 +102,64 @@ - - + + + + {{m_addressType.address_type}} - - + + - + +
+ + + {{i+1}} . {{PremisesLabel[i]}} + + + + + + + + + + {{CL.name}} + + + + + + + + + {{ownerShip.name}} + + + + + + + + + + + + + + + +
+
- + + - + + - + + + Net Profit + Net Loss + + + + + + - + + + + + + + + + + - + + - + -->