From 77518de272d21c1a223565f1fe74b8f12a7ea50e Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 28 Feb 2019 12:30:49 +0530 Subject: [PATCH 1/2] pd report changes , pd list, filter changes --- .../list-pd/all-pd/all-pd.component.html | 39 +- .../list-pd/all-pd/all-pd.component.scss | 36 - .../completed-pd/completed-pd.component.html | 41 +- .../completed-pd/completed-pd.component.scss | 47 - .../completed-pd/completed-pd.component.ts | 2 +- .../inprogress-pd.component.html | 41 +- .../inprogress-pd.component.scss | 35 - .../inprogress-pd/inprogress-pd.component.ts | 2 +- .../pd-report/pd-report.component.html | 207 ++--- .../pd-report/pd-report.component.scss | 2 +- .../list-pd/pd-report/pd-report.component.ts | 9 +- .../qc-completed-pd.component.html | 43 +- .../qc-completed-pd.component.scss | 35 - .../qc-completed-pd.component.ts | 2 +- .../scheduled-pd/scheduled-pd.component.html | 46 +- .../scheduled-pd/scheduled-pd.component.scss | 26 - .../scheduled-pd/scheduled-pd.component.ts | 2 +- .../list-pd/view-pd/view-pd.component.html | 2 +- .../list-pd/view-pd/view-pd.component.ts | 2 +- .../manage-pd/manage-pd.routing.ts | 2 +- .../model-edit-pd-report.component.html | 19 + .../model-edit-pd-report.component.scss | 0 .../model-edit-pd-report.component.spec.ts | 25 + .../model-edit-pd-report.component.ts | 94 ++ .../qc-pd-report/qc-pd-report.component.html | 96 ++ .../qc-pd-report/qc-pd-report.component.scss | 117 +++ .../qc-pd-report.component.spec.ts | 25 + .../qc-pd-report/qc-pd-report.component.ts | 320 +++++++ .../qc-review/qc-review.component.html | 49 ++ .../qc-review/qc-review.component.scss | 0 .../qc-review/qc-review.component.spec.ts | 25 + .../qc-review/qc-review.component.ts | 109 +++ .../qc-list/qc-start/qc-start.component.html | 425 +-------- .../qc-list/qc-start/qc-start.component.scss | 217 ++--- .../qc-list/qc-start/qc-start.component.ts | 830 +++++++++--------- .../qc-list/qc-view/qc-view.component.html | 445 ++++++---- .../qc-list/qc-view/qc-view.component.ts | 69 +- .../quality-check/qc-service/qc.service.ts | 615 +++++++++++-- .../quality-check-routing.module.ts | 7 +- .../app/quality-check/quality-check.module.ts | 19 +- 40 files changed, 2515 insertions(+), 1612 deletions(-) create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.spec.ts create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts create mode 100644 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html create mode 100644 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss create mode 100644 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.spec.ts create mode 100644 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.html create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.scss create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.spec.ts create mode 100755 ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html index 9e0eb7f67..952abdbd1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html @@ -9,52 +9,53 @@
- + {{type.type_name}}     - + {{status.pd_status_name}} - +     - + - + {{pro.name}}     - + {{city.name}}     - + {{ent.full_name}} - +     - + -
- +
+ +
@@ -64,13 +65,9 @@ - - -
- {{(details.pd_type_name | slice:0:1)}} -
- + +
{{details.pd_id}}
+ {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.scss index 2d0c755e6..9e293a473 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.scss @@ -13,40 +13,4 @@ } .fontsize{ font-size:14px; -} -// .pd_circle { -// border: 5px red !important; -// width: 50px; -// height: 50px; -// border-radius: 50px !important; -// // font-size: 18px; -// // color: red; -// // line-height: 50px; -// // text-align: center; -// background: #fff; -// } -.commonPDType{ - display:flex; - justify-content:flex-end; - color: #ffffff; - margin-top:4px; - margin-bottom:4px; - width: 95px; - height: 95px; - justify-content:center; - text-align: center; - border-radius: 50%; - line-height: 95px; -} -.fullPD{ - background:#009688; - border: 2px #009688; -} -.smartPD{ - background:#673ab7; - border: 2px #673ab7; -} -.telePD{ - background:#2196f3; - border: 2px #2196f3; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html index deed72217..9f6dac593 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html @@ -9,52 +9,53 @@
- + {{type.type_name}}     - + +     - + - + {{pro.name}}     - + {{city.name}}     - + {{ent.full_name}} - +     - + -
- +
+ +
@@ -64,12 +65,10 @@ - - -
{{(details.pd_type_name | slice:0:1)}}
-
+ +
{{details.pd_id}}
+ {{details.pd_type_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.scss index da56e3a1e..614782224 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.scss @@ -14,50 +14,3 @@ .fontsize{ font-size:14px; } -// .pd_circle { -// width: 60px !important; -// height: 60px; -// border-radius: 50%; -// font-size: 18px; -// color: #ffffff; -// text-align: center; -// background: red -// } -// .FullPD-Class{ -// background:lightcoral; -// border: 2px lightcoral; -// } -// .SmartPD-Class{ -// background:thistle; -// border: 2px thistle; -// } -// .TelePD-Class{ -// background:lawngreen; -// border: 2px lawngreen; -// } - -.commonPDType{ - display:flex; - justify-content:flex-end; - color: #ffffff; - margin-top:4px; - margin-bottom:4px; - width: 95px; - height: 95px; - justify-content:center; - text-align: center; - border-radius: 50%; - line-height: 95px; -} -.fullPD{ - background:#009688; - border: 2px #009688; -} -.smartPD{ - background:#673ab7; - border: 2px #673ab7; -} -.telePD{ - background:#2196f3; - border: 2px #2196f3; -} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts index ded10cde3..890a1aaea 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts @@ -52,7 +52,7 @@ export class CompletedPdComponent implements OnInit, OnChanges { this.searchForm = this._fb.group( { pd_type:[null], - pd_status:[null], + pd_status:['COMPLETED'], pd_from_date:[null], pd_to_date:[null], pd_city:[null], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html index e681cb2cf..2b210d292 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html @@ -8,52 +8,53 @@
- + {{type.type_name}}     - + +     - + - + {{pro.name}}     - + {{city.name}}     - + {{ent.full_name}} - +     - + -
- +
+ +
@@ -61,12 +62,10 @@
- - -
{{(details.pd_type_name | slice:0:1)}}
-
+ +
{{details.pd_id}}
+ {{details.pd_type_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.scss index 5f4ab542d..9e293a473 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.scss @@ -13,39 +13,4 @@ } .fontsize{ font-size:14px; -} -// .pd_circle { -// width: 50px !important; -// height: 50px; -// border-radius: 50%; -// font-size: 18px; -// color: #ffffff; -// line-height: 50px; -// text-align: center; -// background: red -// } -.commonPDType{ - display:flex; - justify-content:flex-end; - color: #ffffff; - margin-top:4px; - margin-bottom:4px; - width: 95px; - height: 95px; - justify-content:center; - text-align: center; - border-radius: 50%; - line-height: 95px; -} -.fullPD{ - background:#009688; - border: 2px #009688; -} -.smartPD{ - background:#673ab7; - border: 2px #673ab7; -} -.telePD{ - background:#2196f3; - border: 2px #2196f3; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts index 95a5fd103..01f088775 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts @@ -46,7 +46,7 @@ export class InprogressPdComponent implements OnInit, OnChanges { this.searchForm = this._fb.group( { pd_type:[null], - pd_status:[null], + pd_status:['INPROGRESS'], pd_from_date:[null], pd_to_date:[null], pd_city:[null], 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 34ebafa73..170ed331f 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 @@ -1,127 +1,96 @@ -
- -
-
-
- - -
- - - -
- - -
- -
-
-
- {{pdReportRecords?.billing_name}} -
-
- {{pdReportRecords?.product_name}} -
-
- {{pdReportRecords?.customer_segment_name}} -
-
- {{pdReportRecords?.pd_type_name}} -
-
- {{pdReportRecords?.pd_status}} -
-
- - {{applicants.applicant_name}} , -
- -
- -
-

{{data.name}}

-
-
{{dataQA.question}}
-
{{dataQA.answer}}
-
-
-
-
-
-
- -
- - - - + + + + + + + + + - - - - - - - -
- -
- -
-
-
- - -
-
- - -
+ + + + +
+ +
+
+
+
+ + +
+
+ + + +
+ +
+
+ +
-
- -
-
-
- + +
+ +
+
+
+
{{message}}
+
+ +
+
+
+
+
+ + + + +
-
- - -
-
-
-
-
{{message}}
-
- + + + + +
+ +
+ +
+
+ +
+ + + +
+ +
-
-
-
+ +
- - - - - + + + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss index 7f50479c8..b8d8535d4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss @@ -7,7 +7,7 @@ } :host /deep/ { mat-sidenav { - width: 267px; + max-width: 300px; } .mat-sidenav-content { padding: 0; 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 33e15c2d0..9a8658e4e 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 @@ -28,9 +28,9 @@ import { HttpResponse } from "@angular/common/http"; 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%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 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 generateBtn: Boolean = false; public reGenerateBtn: Boolean = false; @@ -39,7 +39,6 @@ export class PdReportComponent implements OnInit { pdReportRecords: any; latestPDDetails: any; message: any; - private notifier: NotifierService; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent, @@ -145,7 +144,7 @@ export class PdReportComponent implements OnInit { getPdReportDetails() { 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; // this.pdReportRecords = data.records.qu; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html index 5c49ab160..04626951e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html @@ -8,52 +8,55 @@
- + {{type.type_name}}     - + +     - + - + {{pro.name}}     - + {{city.name}}     - + {{ent.full_name}} - +     - + -
- +
+ +
+ +
@@ -61,12 +64,10 @@
- - -
{{(details.pd_type_name | slice:0:1)}}
-
+ +
{{details.pd_id}}
+ {{details.pd_type_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.scss index 5f4ab542d..9e293a473 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.scss @@ -13,39 +13,4 @@ } .fontsize{ font-size:14px; -} -// .pd_circle { -// width: 50px !important; -// height: 50px; -// border-radius: 50%; -// font-size: 18px; -// color: #ffffff; -// line-height: 50px; -// text-align: center; -// background: red -// } -.commonPDType{ - display:flex; - justify-content:flex-end; - color: #ffffff; - margin-top:4px; - margin-bottom:4px; - width: 95px; - height: 95px; - justify-content:center; - text-align: center; - border-radius: 50%; - line-height: 95px; -} -.fullPD{ - background:#009688; - border: 2px #009688; -} -.smartPD{ - background:#673ab7; - border: 2px #673ab7; -} -.telePD{ - background:#2196f3; - border: 2px #2196f3; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.ts index 97d4fc0e2..801f151c1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.ts @@ -50,7 +50,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges { this.searchForm = this._fb.group( { pd_type: [null], - pd_status: [null], + pd_status: ['QC_COMPLETED'], pd_from_date: [null], pd_to_date: [null], pd_city: [null], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html index dc3f96197..bf3ad7162 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html @@ -8,52 +8,54 @@
- + {{type.type_name}}     - - - {{status.pd_status_name}} + +     - + - + {{pro.name}}     - + {{city.name}}     - + {{ent.full_name}} - +     - + -
- +
+ +
+
@@ -61,12 +63,10 @@
- - -
{{(details.pd_type_name | slice:0:1)}}
-
+ +
{{details.pd_id}}
+ {{details.pd_type_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.scss index ed717c562..9e293a473 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.scss @@ -13,30 +13,4 @@ } .fontsize{ font-size:14px; -} - -.commonPDType{ - display:flex; - justify-content:flex-end; - color: #ffffff; - margin-top:4px; - margin-bottom:4px; - width: 95px; - height: 95px; - justify-content:center; - text-align: center; - border-radius: 50%; - line-height: 95px; -} -.fullPD{ - background:#009688; - border: 2px #009688; -} -.smartPD{ - background:#673ab7; - border: 2px #673ab7; -} -.telePD{ - background:#2196f3; - border: 2px #2196f3; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.ts index c31951f5d..db2ce26a2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.ts @@ -47,7 +47,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges { this.searchForm = this._fb.group( { pd_type:[null], - pd_status:[null], + pd_status:['SCHEDULED'], pd_from_date:[null], pd_to_date:[null], pd_city:[null], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index cfa01dd06..dd6f5be88 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -49,7 +49,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index cdb2ec224..140e47f10 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -376,7 +376,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { getPDIDReport(pdID:any) { this.destroyType=3; - this.router.navigate([ '../../pdRecord',pdID], { relativeTo: this.route }); + this.router.navigate([ '../../pd_report',pdID], { relativeTo: this.route }); } // // direct trigger the pd diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts index be5c9caaa..b5a4caa22 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts @@ -40,7 +40,7 @@ const routes: Routes = [ component: StartPdComponent, }, { - path: 'pdRecord/:pdid', + path: 'pd_report/:pdid', component: PdReportComponent, } ] diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html new file mode 100755 index 000000000..0c978aba3 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html @@ -0,0 +1,19 @@ +

Edit PD Report Details

+ + +
+
+
+ + + +
+ +
+
+ +
+ + + + \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss new file mode 100755 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.spec.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.spec.ts new file mode 100755 index 000000000..03efc6ed7 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.spec.ts @@ -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; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ModelEditPdReportComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ModelEditPdReportComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts new file mode 100755 index 000000000..4a76ad601 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { QcService } from './../../../qc-service/qc.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: QcService, + notifier: NotifierService , + private dialogRef: MatDialogRef, + @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 = `

My html content

`; + } + + ngOnInit() { + // alert(JSON.stringify(this.data)); + // this.ngForm.controls['content'].setValue('

Home

'); + 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; + } + },err => { + + }); + // this.ckeConfig = { + // allowedContent: false, + // extraPlugins: 'divarea', + // forcePasteAsPlainText: true + // }; + } + + onChange($event: any): void { + console.log('onChange'); + // this.log += new Date() + "
"; + } + + myClick(): void { + 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.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.!'); + + }) + } +} diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html new file mode 100644 index 000000000..3b00ea5cd --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html @@ -0,0 +1,96 @@ + + + + + + + + + + + + +
+ +
+ +
+
+
+ + +
+
+ + + +
+ +
+
+ +
+
+
+
+ +
+
+
+
{{message}}
+
+ +
+
+
+
+ +
+ + + + + +
+ + + + +
+ +
+ +
+
+ +
+ + + +
+ +
+
+ +
+
+
+ + + + +
+ \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss new file mode 100644 index 000000000..ded3d2c82 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss @@ -0,0 +1,117 @@ +@import "./../../../../assets/styles/scss/components/messages"; +:host { + margin-left: -5px; + margin-right: -5px; + margin-top: -5px; + display: block; +} +:host /deep/ { + mat-sidenav { + max-width: 300px; + } + .mat-sidenav-content { + padding: 0; + + } + @media (min-width: 959px) { + .mat-sidenav-side { + background-color: transparent; + box-shadow: none!important; + } + + } +} +.mat-menu-item-active { + color: red !important; +} +.mat-expansion-panel-header-description { + color: rgba(0, 0, 0, 87); +} +.mat-card-content { + background-color: white; +} +.mat-card-actions { + background-color: white; +} + +.text-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.custm-list-item { + cursor: pointer; +} + + +$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; +$product-bg-color-hover: rgba(103, 58, 183, 0.7); +.p-list-main { + background: white; + margin: auto; + position: relative; + overflow: hidden !important; + border-radius: 10px 10px 10px 10px; + box-shadow: $base-card-box-shadow; + transform: scale(0.95); + transition: box-shadow 0.5s, transform 0.5s; + &:hover { + transform: scale(1); + box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); + } + .p-list { + position: relative; + .top { + height: 100%; + width: 100%; + // background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center; + -webkit-background-size: 100%; + -moz-background-size: 100%; + -o-background-size: 100%; + background-size: 100%; + } + .bottom { + width: 200%; + height: 15%; + transition: transform 0.5s; + h1 { + margin: 0; + padding: 0; + } + p { + margin: 0; + padding: 0; + } + .left { + height: 100%; + width: 50%; + background: #f4f4f4; + position: relative; + float: left; + .details { + padding: 5px; + float: left; + // width: calc(70% - 40px); + } + + } + .right { + width: 50%; + background: #A6CDDE; + color: white; + float: right; + height: 200%; + overflow: hidden; + .details { + padding: 20px; + float: right; + width: calc(70% - 40px); + } + + + } + } + } + +} \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.spec.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.spec.ts new file mode 100644 index 000000000..c6d26d2b5 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcPdReportComponent } from './qc-pd-report.component'; + +describe('QcPdReportComponent', () => { + let component: QcPdReportComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcPdReportComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcPdReportComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts new file mode 100644 index 000000000..d2aa1e577 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts @@ -0,0 +1,320 @@ +import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser'; +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 { QcListComponent } from './../qc-list.component'; + +import { saveAs as importedSaveAs } from "file-saver"; + +import { QcService } from './../../qc-service/qc.service'; +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from "@angular/material"; +import { ModelEditPdReportComponent } from './model-edit-pd-report/model-edit-pd-report.component'; +import { QcReviewComponent } from './qc-review/qc-review.component'; +import { HttpResponse } from "@angular/common/http"; + +@Component({ + selector: 'app-qc-pd-report', + templateUrl: './qc-pd-report.component.html', + styleUrls: ['./qc-pd-report.component.scss'] +}) +export class QcPdReportComponent 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%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; + message: any; + + private notifier: NotifierService; + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, + private router: Router, public pdTrigerService: QcService, private listPDComponent: QcListComponent, + 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"); + } + + ngOnInit() { + this.listPDComponent.showListView(false); + this.getPdReportDetails(); + this.getPdReportVersionList(); + // start + + // end + const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); + const elemContent = document.querySelector('.app-inner .main-content'); + + if (window.matchMedia(`(min-width: 1560px)`).matches && !this.isMac()) { + // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); + // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); + } + + // this.loadTemplates(this.startPD); + // this.next = 1; + // this.previous = 2; + } + + + isMac(): boolean { + let bool = false; + if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { + bool = true; + } + return bool; + } + + + + + isOver(): boolean { + return window.matchMedia(`(max-width: 1560px)`).matches; + } + + 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.!'); + }) + } + + public qcStatus: string = ''; + getPdReportVersionList() { + this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { + if (data.status == 200 && data.dataStatus) { + this.pdReportVersionList = [...data.records.reports_urls].reverse(); + let datas = this.pdReportVersionList.filter((a) => { return a.is_latest == 1; }) + this.latestPDDetails = datas[0]; + this.qcStatus = data.records.pdstatus; + // alert(JSON.stringify(this.latestPDDetails)); + this.reGenerateBtn = true; + } else { + // this.reGenerateBtn = true; + this.generateBtn = true; + this.message = data.msg; + } + }, err => { + + }) + } + + getPdReportDetails() { + this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => { + if (data.status == 200) { + // this.pdReportRecords = data.records.question_answers; + this.pdReportRecords = data.records; + // this.pdReportRecords = data.records.qu; + } + }, err => { + + }) + } + + + + // load pd view component + loadPdViewCompoent() { + 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, version_id: this.latestPDDetails.doc_name }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + + changeVersion(pd: any): void { + this.latestPDDetails = pd; + console.log(this.latestPDDetails); + } + + + + reportReview(status): void { + const dialogRef = this.dialog.open(QcReviewComponent, { + data: { startId: this.startPD, data_status: status }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + + 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 + // }) + } + + export() { + this.pdTrigerService.pdReportExportExcel().subscribe((blob: HttpResponse) => { + if (blob) { + console.log(blob); + let datass = blob.headers.get('content-disposition'); + let fileName = datass.split(/"/)[1]; + // this.notifier.notify('success', 'Your Changes Updated.!'); + const blobs = new Blob([blob.body], + { type: 'application/vnd.ms-excel' }); + const file = new File([blobs], fileName, + { type: 'application/vnd.ms-excel' }); + console.log(file); + importedSaveAs(file); + } else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } +} + + + +@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/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.html new file mode 100755 index 000000000..bda833b4f --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.html @@ -0,0 +1,49 @@ +
+

QC Complete

+ + +
+

+ Once QC is Completed further edit will not be possible on this document. +

+
+
+
+
+ +
+
+ + Remarks + + +
+
+
+
+ + + + + +
+ +
+

QC Notes

+ +
+
+
+ + Remarks + + +
+
+
+
+ + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.scss new file mode 100755 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.spec.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.spec.ts new file mode 100755 index 000000000..0d0b84d1e --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcReviewComponent } from './qc-review.component'; + +describe('QcReviewComponent', () => { + let component: QcReviewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcReviewComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcReviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts new file mode 100755 index 000000000..c5c4df00f --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { QcService } from './../../../qc-service/qc.service'; +import { NotifierService } from "angular-notifier"; + + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; + +@Component({ + selector: 'app-qc-review', + templateUrl: './qc-review.component.html', + styleUrls: ['./qc-review.component.scss'] +}) +export class QcReviewComponent implements OnInit { + + conformation: Boolean = false; + @Input() questionId: number; + ngForm: FormGroup; + recordData: any; + showForm: Boolean; + showStatus : any; +/** + * Notifier service + */ + private notifier: NotifierService; + constructor( private _formBuilder: FormBuilder, + private pdTrigerService: QcService, + notifier: NotifierService , + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier = notifier; + this.showStatus = this.data.data_status; + // this.mycontent = `

My html content

`; + } + + ngOnInit() { + this.getQcCompleteReviewStatus(); + } + + getQcCompleteReviewStatus() { + let type ; ''; + if( this.showStatus === 'REMARKS'){ + type = 'QC_REMARKS'; + this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, type).subscribe(data => { + if(data['dataStatus']){ + this.recordData = data.records[0]; + this.ngForm = this._formBuilder.group({ + qc_remarks: [this.recordData.qc_remarks], + pd_status: [this.recordData.pd_status] + }) + this.showForm = true; + } + },err => { + + }); + } else if(this.showStatus === 'COMPLETE') { + type = 'QC'; + this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, type).subscribe(data => { + if(data['dataStatus']){ + this.recordData = data.records[0]; + this.ngForm = this._formBuilder.group({ + qc_feedback: [this.recordData.qc_feedback], + qc_rating: [Number(this.recordData.qc_rating)], + pd_status: ["QC_COMPLETED"], + }) + this.showForm = true; + } + },err => { + + }); + } else { + } + + } + + onChange($event: any): void { + console.log('onChange'); + // this.log += new Date() + "
"; + } + + myClick(): void { + let template = this.ngForm.value; + template.pd_id = this.data.startId; + console.log(JSON.stringify(template)); + this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.dialogRef.close(); + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + }) + } + + + + // ============================= + + ratingClicked: number; + itemIdRatingClicked: string; + rating : number = 1; + + ratingComponentClick(e){ + this.ngForm.controls.qc_rating.setValue(e.rating); + } +} diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html index a7fb22324..d4e61dc9e 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.html @@ -1,389 +1,36 @@ - - -
- -
- - - - - - - - {{category.category_name}} - - - - - - - {{ (questions.question.length>15)? (questions.question | slice:0:15)+'..':(questions.question) }} - - - - - - - - {{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }} - - - - - - - - - Category - -
-
- - -
- -
-

{{mainApplicantName}}

- {{pdMasterList.customer_segment_name}} -
-
-

{{pdMasterList.product_name}}/{{pdMasterList.subproduct_name}}

- {{pdMasterList.lender_full_name}}/{{pdMasterList.lender_applicant_id}} - -
- -
-
-
-
- - -

No Records Found..

-
- - - - - - - - -
- - {{optionsForm.controls.pd_question.value}} -
-
- - - - - - - {{option.pd_answer}} - - - - - - - -
-
- - - -
-
-
-
- -
-
-
-
- {{docs.pd_document_title}} - -
- -
-
-
-
-
- -
-
- -
-
- -
- -
- -
-
- - Remarks - - - -
- -
- - skip_previous - chevron_left - chevron_right - skip_next - - -
- -
- -
-
- - - - {{selectedCategory.question}} - - - -
- -
- - chevron_left - chevron_right - - -
-
- -
-
- - -
- - - - -
- - {{textBoxForm.controls.pd_question.value}} -
-
- - - - - - Answers - - - - - - -
-
- - - -
- -
-
-
- -
-
-
-
- {{docs.pd_document_title}} - -
- -
-
-
-
-
- -
-
- -
-
- -
- -
- -
-
- - Remarks - - - -
- -
- - skip_previous - chevron_left - chevron_right - skip_next - - -
- -
- -
-
- - - {{selectedCategory.question}} - - - -
- -
- - chevron_left - chevron_right - - -
-
- -
-
-
- - - - -
- - {{checkBoxForm.controls.pd_question.value}} -
-
- - - - - {{ control.controls.pd_answer.value }} - - - - -
-
- - - -
-
-
-
- -
-
-
-
- {{docs.pd_document_title}} - -
- -
-
-
-
-
- -
-
- -
-
- -
- -
- -
-
- - Remarks - - - -
- -
- - skip_previous - chevron_left - chevron_right - skip_next - - -
- -
- -
-
- - - {{selectedCategory.question}} - - - -
- -
- - chevron_left - chevron_right - - -
-
- -
-
-
- -
-
- - -
-
- -
-
-
- -
-
- - - - - \ No newline at end of file + + + +
+

{{mainApplicantName}}

+ {{pdMasterList.customer_segment_name}} +
+
+

{{pdMasterList.product_name}}/{{pdMasterList.subproduct_name}} + +

+ {{pdMasterList.lender_full_name}}/{{pdMasterList.lender_applicant_id}} +
+
+
+ +
+ + + {{quesIndex+1}} +
+ {{ formButton.form_name }} +
+ +
+
+
+
+ + + +
+ diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.scss index 9db46e8db..f89b4ea23 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.scss +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.scss @@ -1,136 +1,83 @@ -@import "./../../../../assets/styles/scss/components/messages"; -:host { - margin-left: -5px; - margin-right: -5px; - margin-top: -5px; - display: block; - } - :host /deep/ { - mat-sidenav { - width: 250px; - } - .mat-sidenav-content { - padding: 0; - - } - @media (min-width: 959px) { - .mat-sidenav-side { - background-color: transparent; - box-shadow: none!important; - } - - } - } +// .child_mat_card mat-card { +// margin: 2 0%; +// } +::ng-deep .mat-dialog-container{ + overflow: hidden !important; +} + ::ng-deep .mat-card-header-text{ + margin:0px !important; + } + .mat-purple{ + background-color: gray !important; + } + .cdk-global-overlay-wrapper{ + justify-content: center !important; +} +mat-card.parent_mat_card > { + mat-card-header { + display: flex; + flex-direction: column; + } + mat-card-content { + min-height:auto; + max-height:52vh; + overflow:auto; + } - .mat-expansion-panel-header-description { - color: rgba(0, 0, 0, 87); - } - .mat-card-content { - background-color: white; - } - .mat-card-actions { - background-color: white; - } - - .text-ellipsis { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .custm-list-item { - cursor: pointer; - } - - - $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; - $product-bg-color-hover: rgba(103, 58, 183, 0.7); - .p-list-main { - background: white; - margin: auto; - position: relative; - overflow: hidden !important; - border-radius: 10px 10px 10px 10px; - box-shadow: $base-card-box-shadow; - transform: scale(0.95); - transition: box-shadow 0.5s, transform 0.5s; - &:hover { - transform: scale(1); - box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); - } - .p-list { - position: relative; - .top { - height: 100%; - width: 100%; - // background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center; - -webkit-background-size: 100%; - -moz-background-size: 100%; - -o-background-size: 100%; - background-size: 100%; - } - .bottom { - width: 200%; - height: 15%; - transition: transform 0.5s; - h1 { - margin: 0; - padding: 0; - } - p { - margin: 0; - padding: 0; - } - .left { - height: 100%; - width: 50%; - background: #f4f4f4; - position: relative; - float: left; - .details { - padding: 5px; - float: left; - // width: calc(70% - 40px); - } - - } - .right { - width: 50%; - background: #A6CDDE; - color: white; - float: right; - height: 200%; - overflow: hidden; - .details { - padding: 20px; - float: right; - width: calc(70% - 40px); - } - - - } - } - } - - } - mat-icon{ - color: #ff3636; - } - .address { - display: flex; - padding: 0 2%; - flex-direction: column; - } - - .address > * { - width: 100%; - } - .matcard mat-form-field { - margin: 0 2%; - } - .address .button { - float: right; - width: 10px; - background: #62B013; - color: white; - } + + .user-thumb { + position: absolute; + bottom: -35%; + // img { + // border: 5px solid $white; + // border-radius: 100%; + // height: 75px; + // width: 75px; + // } +} + // @media only screen and (max-width:319px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:320px) and (max-width:767px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:768px) and (max-width:1023px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:1024px) and (max-width:1899px) { + // mat-card-content { + // max-height: 400px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:1900px) { + // mat-card-content { + // max-height: 500px; + // overflow: auto; + // } + // } +} +$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; +mat-card .child_mat_card > mat-card { + border-radius: 0px 0px 0px 15px; + box-shadow: $base-card-box-shadow; + transform: scale(0.95); + transition: box-shadow 0.5s, transform 0.5s; + &:hover { + cursor: pointer; + // background-color: #e00201 !important; + transform: scale(1); + box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); + } + + } + diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts index 296a97fe3..3c6f80f71 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts @@ -1,9 +1,34 @@ -import { Component, ViewChild ,OnInit,ViewEncapsulation, OnDestroy } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NotifierService } from 'angular-notifier'; +import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core'; +import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms'; +import {ActivatedRoute, Router} from '@angular/router'; +import {MatDialog } from '@angular/material'; +import {NotifierService} from 'angular-notifier'; import { QcListComponent } from './../qc-list.component'; -import { QcService } from './../../qc-service/qc.service'; +import {QcService} from './../../qc-service/qc.service'; + +// import {PersonalInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component'; +// import {AddressComponent } from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component'; +// import {OtherIncomeComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component'; +// import {SupplierInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component'; +// import {ClientInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component'; +// import {FamilyDetailsComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component'; +// import {EmploymentInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component'; +// import {StockComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component'; +// import {CurrentLoanComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component'; +// import {FinancialInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component'; +// import {AssetsInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component'; +// import {AssessedIncomeComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component'; +// import {BankingDetailsComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component'; +// import {BusinessInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component'; +// import {LenderRepresentativeComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component'; +// import {LoanDetailsComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component'; +// import {GeneralInfoComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component'; +// import {NeighbourHoodComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component'; +// import {FinalRemarksComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component'; +// import { BusinessInfoGroupComponent } from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component'; +// import { BusinessAssetsInfoComponent } from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component'; +// import { PdStatusChangeDialogueComponent } from './../../../personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component'; +// import {RentalVerificationComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component'; @Component({ selector: 'app-qc-start', @@ -12,440 +37,415 @@ import { QcService } from './../../qc-service/qc.service'; }) export class QcStartComponent implements OnInit, OnDestroy { -private notifier: NotifierService; -public startPD:string; -public mainApplicantName:string; + public startPD: string; + public mainApplicantName: string; //public remarks: string; -errorMessage:any; -selectedCategory:any=[]; -categoryList: any=[]; -pdMasterList: any=[]; -optionsForm: FormGroup; -checkBoxForm:FormGroup; -textBoxForm:FormGroup; -next:number; -previous:number; -selectedCategoryIndex:number; -selectedQuestionIndex:number; -getQuestionsLength:number; -answerList:any=[]; -ansPDList:any=[]; + errorMessage: any; + selectedCategory: any = []; + categoryList: any = []; + pdMasterList: any = []; + pdFullDetails:any=[]; -// forms details -pdFullDetails:any=[]; -categoryFormButtons: any; -formsCategoryEnable: boolean = false; -selectedFormsCategory: any; +// category static form buttons + categoryFormButtons: any; + formsCategoryEnable: boolean = false; + selectedFormsCategory: any; // create values for status check -pdStatusCheck :any={ - "DRAFT" :'DRAFT', - "TRIGGERED" :'TRIGGERED', - "ALLOCATED" :'ALLOCATED', - "SCHEDULED" :'SCHEDULED', - "INPROGRESS" :'INPROGRESS', - "COMPLETED" :'COMPLETED', - "QC_COMPLETED" :'QC_COMPLETED', -}; -currentPDStatus: string; -actualQuestions:number; -answeredQuestions :number; + pdStatusCheck: any = { + "DRAFT": 'DRAFT', + "TRIGGERED": 'TRIGGERED', + "ALLOCATED": 'ALLOCATED', + "SCHEDULED": 'SCHEDULED', + "INPROGRESS": 'INPROGRESS', + "COMPLETED": 'COMPLETED', + "QC_COMPLETED": 'QC_COMPLETED', + }; + currentPDStatus: boolean; + actualQuestions: number; + answeredQuestions: number; + private notifier: NotifierService; -constructor(notifier: NotifierService, private fb: FormBuilder,private route: ActivatedRoute, - private router: Router, - private QcListComponent : QcListComponent, private _qc: QcService,) { + constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, + private router: Router, + private listPDComponent: QcListComponent, private _pd: QcService,) { this.startPD = this.route.snapshot.params['pdid']; this.notifier = notifier; - + this.currentPDStatus = false; } ngOnInit() { - this.QcListComponent.showListView(false); - const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); - const elemContent = document.querySelector('.app-inner .main-content'); + // start - if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) { - // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); - // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); - } + // end + this.listPDComponent.showListView(false); + const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); + const elemContent = document.querySelector('.app-inner .main-content'); - this.loadTemplates(this.startPD); - this.next=1; - this.previous=2; + if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) { + // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); + // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); + } + this.loadTemplates(this.startPD,1); } - isMac(): boolean { - let bool = false; - if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { - bool = true; - } - return bool; - } -// load pd template details -loadTemplates(startID:string){ - this._qc.loadPDTemplates(startID).subscribe( - data => { - if (data.status == 200) { - this.pdMasterList=data.records.pdmaster_details; - this.categoryList=data.records.question_answers; - let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); - this.mainApplicantName = filterApplicantName[0].applicant_name; - this.currentPDStatus = data.records.pdmaster_details.pd_status; - this.actualQuestions = data.records.counts.overall_question_count; - this.answeredQuestions = data.records.counts.overall_answered_count; - this.categoryFormButtons = data.records.template_forms; - this.pdFullDetails = data.records - } - else{ - this.pdMasterList=""; - this.mainApplicantName=""; - this.categoryList=[]; - } - }, error => this.errorMessage = error); - } - - ngOnDestroy(): void { - this.QcListComponent.showListView(true); - } - + isMac(): boolean { + let bool = false; + if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { + bool = true; + } + return bool; + } isOver(): boolean { - return window.matchMedia(`(max-width: 960px)`).matches; + return window.matchMedia(`(max-width: 960px)`).matches; } - OnSelectDirectQuestions(selectedQuestions: any, categoryIndex:number,questionsIndex:number){ - this.formsCategoryEnable = false; - this.selectedCategory=selectedQuestions; - this.selectedCategoryIndex=categoryIndex; - this.selectedQuestionIndex=questionsIndex; - - let serachQuestions = { - "question_id":selectedQuestions.fk_question_id, - "pd_id":this.startPD, - "template_id":selectedQuestions.fk_template_id, - "category_id":selectedQuestions.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - - } - - // load question based answer list - getAnswers(serachList:any){ - this.answerList=[]; - - this._qc.getAnswersForPD(serachList).subscribe( - data => { - if (data.status == 200) { - this.answerList=data.records.answers; - this.ansPDList=data.records; - this.actualQuestions = data.records.counts.overall_question_count; - this.answeredQuestions = data.records.counts.overall_answered_count; - // this for options type questions - if(this.selectedCategory.fk_question_answertype==1){ - this.loadOtionsForm(this.selectedCategory, this.answerList); + // load templates details + loadTemplates(startID:string,type:number){ + this._pd.loadPDTemplates(startID).subscribe( + data => { + if (data.status == 200) { + this.pdMasterList=data.records.pdmaster_details; + // this.categoryList=data.records.question_answers; + let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); + this.mainApplicantName = filterApplicantName[0].applicant_name; + this.currentPDStatus = data.records.pdmaster_details.pd_status=='INPROGRESS' ? false : data.records.pdmaster_details.pd_status=='false' ? true :data.records.pdmaster_details.pd_status=='ALLOCATED' ? false : data.records.pdmaster_details.pd_status=='COMPLETED' ? true : false; + this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true); + // this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true); + this.actualQuestions = this.categoryFormButtons.length; + let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true); + this.answeredQuestions = getAnsweredFormsCount.length; + this.pdFullDetails = data.records; + if(type==1 && data.records.pdmaster_details.pd_status=='SCHEDULED') { + this.pdStatusDialogue(this.pdStatusCheck.INPROGRESS) + } + } + else{ + this.pdMasterList = ""; + this.mainApplicantName = ""; + this.categoryList = []; + this.currentPDStatus = false; + } + // this.getAnswers(serachQuestions); + + }); } - //this for text box type questions - else if(this.selectedCategory.fk_question_answertype==2){ - - this.loadTextBoxForm(this.selectedCategory,this.answerList); + + // load pd status change dialogue + pdStatusDialogue(status: string): void { + // const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + // data: { pdid: this.startPD, pd_status: status }, + // disableClose: true, + // minWidth:'30%', + // maxWidth:'40%', + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // if(dataresult.update_status==true){ + // this.loadTemplates(this.startPD,2); + // } + // }); } -//this for check box type questions - else if(this.selectedCategory.fk_question_answertype==3){ - - this.loadCheckBoxForm(this.selectedCategory,this.answerList); - } - } - }, error => this.errorMessage = error); - - - - } - - // load check box form - - loadCheckBoxForm(selectedCategory: any, ansItem: any){ - // create checkbox group - let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id:new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.answer), - pd_answer_weightage:new FormControl(item.template_answer_weightage), - checkbox: new FormControl(item.isactive==null ? false: true) - }))); - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title:new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - // create a hidden reuired formControl to keep status of checkbox group - let hiddenControl = new FormControl(this.mapItems(checkboxGroup.value), Validators.required); - // update checkbox group's value to hidden formcontrol - checkboxGroup.valueChanges.subscribe((v) => { - hiddenControl.setValue(this.mapItems(v)); - }); - - - this.checkBoxForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark:new FormControl(this.ansPDList.question_remark), - items: checkboxGroup, - selectedItems: hiddenControl, - documents: documentsGroup - }); - } - - // map options form group values - mapItems(items) { - let selectedItems = items.filter((item) => item.checkbox).map((item) => item); - return selectedItems.length ? selectedItems : null; - } - - // load Options form - loadOtionsForm(selectedCategory: any, ansItem: any){ - // create options type group - let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id:new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.answer), - pd_answer_weightage:new FormControl(item.template_answer_weightage), - options: new FormControl(item.isactive==null ? false: true) - }))); - - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title:new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - - // create a hidden reuired formControl to keep status of checkbox group - let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required); - let checkedItem = hiddenControl.value!=null ? new FormControl(hiddenControl.value[0].pd_answer_id) :new FormControl(null); - - this.optionsForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark:new FormControl(this.ansPDList.question_remark), - items: optionsGroup, - selectedItems: hiddenControl, - modelValue : checkedItem, - documents: documentsGroup - - }); - this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => { - hiddenControl.setValue(this.updateOptionsMapItems(v,optionsGroup.value)); - }); - -} - -// map option type group values -optionsMapItems(items) { - - let optionSelectedItems = items.filter((item) => item.options==true).map((item) => item); - return optionSelectedItems.length ? optionSelectedItems : null; - } - // map options type while change options - updateOptionsMapItems(key,items) { - - let updateSelectedItems = items.filter((item) => item.pd_answer_id==key).map((item) => item); - return updateSelectedItems.length ? updateSelectedItems : null; - } - - // load text box form - loadTextBoxForm(selectedCategory: any, ansItem: any){ - // create text box type group - let textGroup = new FormArray(ansItem.map(item => new FormGroup({ - fk_pd_id:new FormControl(this.startPD), - pd_detail_answer_id: new FormControl(item.pd_detail_answer_id), - pd_answer_id: new FormControl(item.question_answer_id), - pd_answer: new FormControl(item.pd_answer), - pd_answer_weightage:new FormControl(item.template_answer_weightage), - text: new FormControl(item.pd_detail_answer_id==null ? false: true) - }))); - - // create documents group - let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({ - pd_document_title:new FormControl(item.pd_document_title), - pd_document_url: new FormControl(item.pd_document_name), - - }))); - - this.textBoxForm = new FormGroup({ - pd_detail_id: new FormControl(this.ansPDList.pd_detail_id), - fk_pd_id: new FormControl(this.startPD), - fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id), - fk_question_id: new FormControl(this.selectedCategory.fk_question_id), - pd_question: new FormControl(this.selectedCategory.question), - pd_question_weightage: new FormControl(this.selectedCategory.question_weightage), - pd_answer_remark:new FormControl(this.ansPDList.question_remark), - items: textGroup, - documents: documentsGroup - }); - } - - // next save and previous save for options and check box type questions - saveNextPrevious(details:any, type:number){ - - let fetchAns =[]; - details.selectedItems.value.forEach((itemElement, itemIndex) => { - let obj1 = { - fk_pd_detail_id:details.pd_detail_id.value, - fk_pd_id:itemElement.fk_pd_id, - pd_detail_answer_id: itemElement.pd_detail_answer_id, - pd_answer_id: itemElement.pd_answer_id, - pd_answer: itemElement.pd_answer, - pd_answer_weightage:itemElement.pd_answer_weightage, - } - fetchAns.push(obj1) - }); - - let pd_details:any=[{ - "pd_detail_id":details.pd_detail_id.value, - "fk_pd_id":details.fk_pd_id.value, - "fk_category_id":details.fk_category_id.value, - "fk_question_id":details.fk_question_id.value, - "pd_question":details.pd_question.value, - "pd_question_weightage":details.pd_question_weightage.value, - "question_remark":details.pd_answer_remark.value, - "answers":fetchAns, - "images":[] - }]; - this._qc.savePDQuestions(pd_details).subscribe(result => { - if (result.status == 200) { - if(type==1){ - this.skipNextPrevious(this.next); - } - else{ - this.skipNextPrevious(this.previous); - } - } - }, error => { - }); - } - // next save and previous save for text type questions - saveNextPreviousText(details:any, type:number){ - let fetchAns =[]; - details.items.value.forEach((itemElement, itemIndex) => { - let obj1 = { - fk_pd_detail_id:details.pd_detail_id.value, - fk_pd_id:itemElement.fk_pd_id, - pd_detail_answer_id: itemElement.pd_detail_answer_id, - pd_answer_id: itemElement.pd_answer_id, - pd_answer: itemElement.pd_answer, - pd_answer_weightage:itemElement.pd_answer_weightage, - } - fetchAns.push(obj1) - }); - let pd_details:any=[{ - "pd_detail_id":details.pd_detail_id.value, - "fk_pd_id":details.fk_pd_id.value, - "fk_category_id":details.fk_category_id.value, - "fk_question_id":details.fk_question_id.value, - "pd_question":details.pd_question.value, - "pd_question_weightage":details.pd_question_weightage.value, - "question_remark":details.pd_answer_remark.value, - "answers":fetchAns, - "images":[] - }]; - this._qc.savePDQuestions(pd_details).subscribe(result => { - if (result.status == 200) { - if(type==1){ - this.skipNextPrevious(this.next); - } - else{ - this.skipNextPrevious(this.previous); - } - } - }, error => { - }); - } - - // skip to previous and next questions - - skipNextPrevious(type:number){ - // for skip to next - if(type==1){ - if(this.categoryList.length > this.selectedCategoryIndex ){ - let nextCatList = this.categoryList[this.selectedCategoryIndex]; - this.selectedQuestionIndex=this.selectedQuestionIndex < nextCatList.questions.length-1 ? this.selectedQuestionIndex+1 : this.selectedQuestionIndex; - let nextQuesList = nextCatList.questions[this.selectedQuestionIndex]; - this.selectedCategory=nextQuesList; - this.selectedCategoryIndex=this.selectedCategoryIndex; - this.selectedQuestionIndex=this.selectedQuestionIndex; - let serachQuestions = { - "question_id":nextQuesList.fk_question_id, - "pd_id":this.startPD, - "template_id":nextQuesList.fk_template_id, - "category_id":nextQuesList.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - } - } - // for skip to previous - else if(type==2){ - if(this.categoryList.length > this.selectedCategoryIndex ){ - let preCatList = this.categoryList[this.selectedCategoryIndex]; - this.selectedQuestionIndex=this.selectedQuestionIndex ==0 ? this.selectedQuestionIndex : this.selectedQuestionIndex-1; - let preQuesList = preCatList.questions[this.selectedQuestionIndex]; - this.selectedCategory=preQuesList; - this.selectedCategoryIndex=this.selectedCategoryIndex; - this.selectedQuestionIndex=this.selectedQuestionIndex; - let serachQuestions = { - "question_id":preQuesList.fk_question_id, - "pd_id":this.startPD, - "template_id":preQuesList.fk_template_id, - "category_id":preQuesList.fk_template_question_category_id - } - this.getAnswers(serachQuestions); - } - - } - } - - //change pd status - changePDStatus(status:string){ - - let update_array = { - "pd_id": this.startPD - } - this._qc.editPdMasterDetails(update_array, status).subscribe(result => { - if (result.status == 200) { - this.notifier.notify('success', 'QC Completed.'); - this.currentPDStatus = "QC_COMPLETED"; - - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }); - } - - // direct form based questions + // start + // direct form based questions OnSelectDirectForms(details: any) { - this.formsCategoryEnable = true; - this.selectedFormsCategory = details; - -} + // this.selectedFormsCategory = details; + + // if(this.selectedFormsCategory.form_id==1){ + // const dialogRef = this.dialog.open(SupplierInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==2){ + // const dialogRef = this.dialog.open(ClientInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==3){ + // const dialogRef = this.dialog.open(PersonalInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==4){ + // const dialogRef = this.dialog.open(AssetsInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==5){ + // const dialogRef = this.dialog.open(AddressComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==6){ + // const dialogRef = this.dialog.open(FamilyDetailsComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==7){ + // const dialogRef = this.dialog.open(BankingDetailsComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==8){ + // const dialogRef = this.dialog.open(CurrentLoanComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==9){ + // const dialogRef = this.dialog.open(OtherIncomeComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==10){ + // const dialogRef = this.dialog.open(LoanDetailsComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==11){ + // const dialogRef = this.dialog.open(StockComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==12){ + // const dialogRef = this.dialog.open(EmploymentInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // // this.notifier.notify('success', 'Successfully allocated.!'); + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==13){ + // const dialogRef = this.dialog.open(BusinessInfoGroupComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==14){ + // const dialogRef = this.dialog.open(FinancialInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==15){ + // const dialogRef = this.dialog.open(LenderRepresentativeComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==17){ + // const dialogRef = this.dialog.open(RentalVerificationComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + // else if(this.selectedFormsCategory.form_id==18){ + // const generaldialogRef = this.dialog.open(GeneralInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + // else if(this.selectedFormsCategory.form_id==19){ + // const generaldialogRef = this.dialog.open(NeighbourHoodComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else if(this.selectedFormsCategory.form_id==20){ + // const generaldialogRef = this.dialog.open(FinalRemarksComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // }else + // if(this.selectedFormsCategory.form_id==22){ + // const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2); + // }); + // } + + + } + ngOnDestroy(): void { + this.listPDComponent.showListView(true); + } // load pd view component - loadPdViewCompoent(){ - this.router.navigate([ '../../viewpd',this.startPD], { relativeTo: this.route }); - + loadPdViewCompoent() { + this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route}); } diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index fd3aa26fb..5e61a209e 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -1,160 +1,299 @@ + - -
- - -
-
-

{{master.lender_full_name}}

- {{master.lender_applicant_id}} - {{master.pd_date_of_initiation}} -
-
- - - - -
- person{{master.pd_allocated_to | titlecase}}    - {{master.pd_status | titlecase}}  On {{master.scheduled_on}} - {{master.pd_status | titlecase}} - QC Completed -
- -
-
-
- -
-
- - -
- - - -
- - -  {{master.city_name}} / {{master.state_name}}-{{master.pincode}} - - - -

{{master.pd_contact_person}}   {{master.pd_contact_mobileno}} (Lender Contact Details)

+ + + +
+
+ + +
+

{{master.lender_short_name}}

+ {{master.branch_name}} +
+ {{master.lender_applicant_id}}
+ {{master.pd_date_of_initiation}}
+
+    + + +
+ {{master.pd_allocated_to | titlecase}} + {{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}} + {{master.centralofficer | titlecase}}
+ + {{master.scheduled_on}} -

{{master.product_name}} / {{master.subproduct_name}}

-

{{master.pd_type_name}} /  {{master.loan_amount}}

-

{{master.addressline1}},{{master.addressline2}} ,{{master.addressline3}}

-

Remarks : {{master.remarks}}

- - - - - -
-
- - -
- -
- - Applicants - - - - -

- -  {{applicant.applicant_name}}     - -  {{applicant.mobile_no}}
Main Applicant - {{applicant.relation_name}} -

-
-
-
-

No Applicant

-
+
+
+
+
-
- - -
- -
- - Additional Requirements - - - - - -

{{requirement.add_requirement}}

-
-
-
-

No Additional Requirements

-
+
+
+ + +
+
+ + + + + + - - - -
-
- - - - -
Documents
-
- -
- - -

- {{documents.pd_document_title}} - -

-
-
-
-

No Document

-
-
- - - - -
PD History
-
+ + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+ {{master.product_name}} / {{master.subproduct_name}} +
+
+
+
+
+
+ +
+
+ {{master.loan_amount}} +
+
+
+
+
+
+ +
+
+ {{master.pd_type_name}} +
+
+
+
+
+
+ + +
+
+ {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode_id == 1 ? master.other_pincode : master.pincode }}
+
+
+
+ +
+
+
+

Lender Contact Details

+ +
+
+   {{master.pd_contact_person}} +
+
+
+
+   {{master.pd_contact_mobileno}} +
+
+
+
+
+
+

Remarks

- - - - {{master.time}}       {{master.user}}
{{master.log}}
+ {{master.remarks}} +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + +

PD Details

+ + + Applicants + + +
+ Applicants +
+
+ +
+
- - - - - - - - -

No History

-
-
- -
-
- -
-
- - - + + + +

+ +  {{applicant.applicant_name}} +     + + +  {{applicant.mobile_no}} +     + + +  {{applicant.landline}} + + ( Applicant ) + {{applicant.relation_name}} +

+
+
+
+ + +

No Applicant

+
+
+ + + Additional Requirements + + + +
+ Additional Requirements +
+
+ +
+
+ + + +

{{requirement.add_requirement}}

+
+
+
+ + +

No Additional Requirements

+
+
+
+ + Documents + + + +

No Document

+
+
+
+ + QC Notes +
+
QC Notes
+
+

+ {{ pdMasterData[0]?.qc_remarks}}

+ +
+ + QC Feedback +
+
+
QC Feedback
+
+
+
+
+ {{ pdMasterData[0]?.qc_rating}} +
+
+ +
+
+
+
+
+ {{ pdMasterData[0]?.qc_feedback}} +
+
+ + +

No Feedback

+
+
+
+ + PD History +
+ + + {{master.time}}  + {{master.user}}
{{master.log}}
+
+ +
+
+ + +

No History

+
+
+
+ + + + \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index 0dcaefe8e..aeb57bd01 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -46,6 +46,7 @@ export class QcViewComponent implements OnInit, OnDestroy { "QC_COMPLETED" :'QC_COMPLETED', }; public _EditPDtriggerForm:FormGroup; + pd_QC_Rating: Number; constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) { this.notifier=notifier @@ -61,36 +62,39 @@ export class QcViewComponent implements OnInit, OnDestroy { this.viewPdDetails(this.viewID); } viewPdDetails(editID:string){ - this._qc.editPdDetails(editID).subscribe( - data => { - if (data.status == 200) { - this.pdMasterData=data.records.pd_master_details; - this.pdApplicantData= data.records.applicants_details; - this.pdDocumentsData=data.records.pd_documnets; - this.masterPdLogsData=data.records.pd_logs.master; - this.pdAdditionalReqData = data.records.pd_additional_requirements; - //this.applicantPDLogsData= data.records.pd_logs.master; - this.currentPDStatus = data.records.pd_master_details[0].pd_status; - // enable pd start time - if(data.records.pd_master_details[0].scheduled_on_for_validation){ - let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm'); - let scheduledDateTime: string=data.records.pd_master_details[0].scheduled_on_for_validation; - let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime); - let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60); - if(diffInHours>=-4){ - this.enableStartPD=true; - } - else { - this.enableStartPD=false; - } - } - else { - this.enableStartPD=false; - } - - } -}, error => this.errorMessage = error); - } + this.pdMasterData = []; + this._qc.editPdDetails(editID).subscribe( + data => { + if (data.status == 200) { + let masterData: any = data.records.pd_master_details; + this.pdMasterData.push(masterData[0]); + this.pd_QC_Rating = Number(this.pdMasterData.qc_rating); + this.pdApplicantData= data.records.applicants_details; + this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2); + this.pdDocumentsData=data.records.pd_documnets; + this.masterPdLogsData=data.records.pd_logs.master; + //this.applicantPDLogsData= data.records.pd_logs.master; + this.currentPDStatus = data.records.pd_master_details[0].pd_status; + this.pdAdditionalReqData = data.records.pd_additional_requirements; + // enable pd start time + if(data.records.pd_master_details[0].scheduled_on_for_validation){ + let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm'); + let scheduledDateTime: string=data.records.pd_master_details[0].scheduled_on_for_validation; + let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime); + let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60); + if(diffInHours>=-4){ + this.enableStartPD=true; + } + else { + this.enableStartPD=false; + } + } + else { + this.enableStartPD=false; + } + } + }, error => this.errorMessage = error); + } loadPdListCompoent() { this.destroyType=2; @@ -216,6 +220,11 @@ export class QcViewComponent implements OnInit, OnDestroy { this.destroyType=3; this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route }); } + // pd report + getPDIDReport(pdID:any) { + this.destroyType=3; + this.router.navigate([ '../../pd_report',pdID], { relativeTo: this.route }); + } ngOnDestroy(): void { if(this.destroyType==1){ this.QcListComponent.pdListLoad(true); diff --git a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts index 8103d42fe..c57621a8a 100755 --- a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts +++ b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts @@ -1,15 +1,19 @@ /** Common Import Section */ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs';//for Datatables -import { HttpClient,HttpParams } from '@angular/common/http'; +import { Observable, of, forkJoin } from 'rxjs'; +import { HttpClient, HttpParams } from '@angular/common/http'; import { catchError, map } from 'rxjs/operators'; -import { of } from 'rxjs'; /** Imported Service Files Are., */ import { AwsService } from '../../AwsService/aws.service'; -/** Environment */ -import { environment } from 'environments/environment'; +/** Environment */ +import { environment } from 'environments/environment' +import { RequestOptions } from "@angular/http"; +import { ResponseContentType } from "@angular/http"; +import { ResponseOptions } from "@angular/http"; +import { HttpResponse } from "@angular/common/http"; +import { tap } from "rxjs/internal/operators/tap"; const currentdate = new Date().toJSON().slice(0,19).replace('T',' '); /** Master Interface */ @@ -18,6 +22,7 @@ export interface Master { master_name:string; constant_name:string; } + @Injectable( { providedIn: 'root' @@ -27,78 +32,552 @@ export interface Master { export class QcService { - //private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; - //private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/"; - //private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; - private apiUrl = environment.apiEndpoint; - - MAP_API_KEY: string; - MAP_API_URL: string; - constructor(private _http: HttpClient, - private _aws:AwsService) { - this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk' - this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`; - } - - // get edit row pd details - editPdDetails(editId:string):Observable{ - let httpParams = new HttpParams().set('pdid', editId); - return this._http.post(this.apiUrl+"getFullPDDetails",httpParams) - .pipe( + // private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; + // private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/"; + MAP_API_KEY: string; + MAP_API_URL: string; + // private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; + private apiUrl = environment.apiEndpoint; + + constructor(private _http: HttpClient, + private _aws: AwsService) { + this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk' + this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`; + } + + // get add pd master details + getAllMasterDatas(TableName: string): Observable { + return this._http.post(this.apiUrl + 'getListOfMaster', { "master_name": TableName }) + .pipe( + catchError(this.handleError('role', [])) + ) + } + saveForm(records: any): Observable { + records.fk_createdby = this._aws.getlocale(); + let params = { records } + return this._http.post(this.apiUrl + 'savePDFormDetails', params) + .pipe( + catchError(this.handleError('role', [])) + ) + } + retriveForm(params): Observable { + return this._http.post(this.apiUrl + 'getPDFormDetails', params) + .pipe( + catchError(this.handleError('role', [])) + ) + } + + //get product and subproduct master details + getProductsDetails(): Observable { + return this._http.get(this.apiUrl + 'getListOfProducts') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // get lenders list + getLenderDetails(): Observable { + return this._http.get(this.apiUrl + 'getListOfLenders') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // get customers list + getCustomersDetails(): Observable { + return this._http.get(this.apiUrl + 'getListOfCustomerSegments') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // get Pd Allocation type details list + getPDAllocationDetails(): Observable { + return this._http.get(this.apiUrl + 'getListOfPDAllocationTypes') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // get state and city details + getStateCityDetails(): Observable { + return this._http.post(this.apiUrl + 'getListOfStatesCities','') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // get pd type and allocation type details + getPDTypeDetails(): Observable { + return this._http.get(this.apiUrl + 'getListOfPDAllocationTypes') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // add pd details + addPdDetails(pdForm: any): Observable { + return this._http.post(this.apiUrl + "triggerNewPD", pdForm) + .pipe( catchError(this.handleError('operation', [])) - ) - } - // update pd master details - editPdMasterDetails(editData:any,status:string):Observable{ + ) + } + + // get pd details + getPdDetails(): Observable { + return this._http.get(this.apiUrl + "listLessPDDetails/get") + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // get status based pd list + getTabStatusPdDetails(status: string): Observable { + const tabStatus = status ? + { params: new HttpParams().set('status', status) } : {}; + return this._http.get(this.apiUrl + "listLessPDDetails/get", tabStatus) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // get edit row pd details + editPdDetails(editId: string): Observable { + let httpParams = new HttpParams().set('pdid', editId); + return this._http.post(this.apiUrl + "getFullPDDetails", httpParams) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // update pd master details + editPdMasterDetails(editData: any, status: string): Observable { editData.pd_status = status; editData.fk_updatedby = this._aws.getlocale(); - // editData.updatedon = currentdate; - return this._http.post(this.apiUrl+"updatePDMaster",{records:editData}) + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // update pd applicant + updatePdApplicant(editData: any): Observable { + // editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDApplicants", { "pd_applicant_details": editData }) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // get pd allocation to details + getPdOfficerList(pdID: string): Observable { + return this._http.post(this.apiUrl + "getListPDOfficers", { "pdid": pdID }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // update pd officer + updatePdOfficer(updateData: any): Observable { + updateData.fk_updatedby = this._aws.getlocale(); + // updateData.updatedon = currentdate; + return this._http.post(this.apiUrl + "allocatePD", { "records": updateData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // update pd schedule + updateSchedule(updateData: any): Observable { + updateData.fk_scheduled_by = this._aws.getlocale(); + // updateData.createdon = currentdate; + return this._http.post(this.apiUrl + "schdulePD", { "records": updateData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } - .pipe( - catchError(this.handleError('operation', [])) - ) - } //load pd template details - loadPDTemplates(pdId: string):Observable{ - const options = pdId ? - { params: new HttpParams().set('pd_id', pdId) } : {}; - return this._http.get(this.apiUrl + "loadFullTemplate",options) - .pipe( - catchError(this.handleError('operation', [])) - ) - } + loadPDTemplates(pdId: string): Observable { + const options = pdId ? + { params: new HttpParams().set('pd_id', pdId) } : {}; + return this._http.get(this.apiUrl + "loadFullTemplate", options) + .pipe( + catchError(this.handleError('operation', [])) + ) + } - // load PD question answers - getAnswersForPD(list: any):Observable{ - let httpParams = new HttpParams(); - httpParams = httpParams.append("category_id", list.category_id); - httpParams = httpParams.append("pd_id", list.pd_id); - httpParams = httpParams.append("question_id", list.question_id); - httpParams = httpParams.append("template_id", list.template_id); + // load PD question answers + getAnswersForPD(list: any): Observable { + let httpParams = new HttpParams(); + httpParams = httpParams.append("category_id", list.category_id); + httpParams = httpParams.append("pd_id", list.pd_id); + httpParams = httpParams.append("question_id", list.question_id); + httpParams = httpParams.append("template_id", list.template_id); - return this._http.post(this.apiUrl + "getAnswersForPD",httpParams) - .pipe( - catchError(this.handleError('operation', [])) -) + return this._http.post(this.apiUrl + "getAnswersForPD", httpParams) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // save pd answers + // savePDQuestions(saveData: any): Observable { + // saveData.createdby = this._aws.getlocale(); + // saveData.fk_createdon = currentdate; + // // saveData[0].fk_updatedby = this._aws.getlocale(); + // // saveData[0].updatedon = currentdate; + // + // return this._http.post(this.apiUrl + "savePDQuestions", {"records": saveData}) + // .pipe( + // catchError(this.handleError('operation', [])) + // ) + // } + // get assessed income form details + getAssessedIncomeFormDetails(formDetails): Observable { + return this._http.post(this.apiUrl + "getAssessedIncome", formDetails) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + private handleError(operation = 'operation', result?: T) { + return (error: any): Observable => { + return of(result as T); + }; + } + // common Pd form details get for the Pd Process + getPDFormDetailsWithID(pdID, formID): Observable { + return this._http.post(this.apiUrl + "getPDFormDetails", { "pd_id": pdID, "pd_form_id": formID }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // common Pd form details get for the Pd Process + getPDFormDetailsWithCompanyID(pdID, formID,companyID): Observable { + return this._http.post(this.apiUrl + "getPDFormDetails", { "pd_id": pdID, "pd_form_id": formID,"company_id": companyID}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // save Pd form details + savePDFormDetailsWithID(saveData: any): Observable { + saveData.fk_createdby = this._aws.getlocale(); + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; + + return this._http.post(this.apiUrl + "savePDFormDetails", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // save pd answers + savePDQuestions(saveData: any): Observable { + saveData.createdby = this._aws.getlocale(); + //saveData.fk_createdon = currentdate; + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; + + return this._http.post(this.apiUrl + "savePDQuestions", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + + // get Pd Final report Question Answer + + getPdFinalReportDetails(pdId: number): Observable { + return this._http.post(this.apiUrl + "getFinalPDReportQuestions", { "pd_id": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getPDReportFinalDocument(pdId: any): Observable { + pdId.fk_createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + "generatePDReport", { "records": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getActualPDReportModelTemplate(pdId: any): Observable { + return this._http.post(this.apiUrl + "getLatestPDReportBlob ", { "records": { "pd_id": pdId } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + updatePDReportDetails(records: any): Observable { + return this._http.post(this.apiUrl + "saveNewVersionOfPDReport ", { "records": records }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getPdDocVersionList(pdId: number): Observable { + return this._http.post(this.apiUrl + "getListOfPDReportVersions", { "records": { "pd_id": pdId } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + swapOlderPDReportToLatest(pdId: any): Observable { + pdId.fk_createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getTypeofActivityForSuppliedInfoForm(pd_id: any,company_id:any): Observable { + return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id,"company_id":company_id } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + getQCReportFinalReviewDetails(pd_id: any, flag: string): Observable { + return this._http.post(this.apiUrl + "getQCLenderRemarks", { "records": { "pd_id": pd_id, "flag": flag } }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // pd review status update details + pdReviewStatusUpdate(editData: any): Observable { + editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + //pd report export excel + pdReportExportExcel(): Observable> { + // const options: any = { + // observe: 'response', + // responseType: 'blob' as 'json' + // }; + return this._http.get>(this.apiUrl + "downloadExcel", { + observe: 'response', + responseType: 'blob' as 'json' + }) + .pipe( + tap>( + res => res, + err => { + catchError(this.handleError('operation', [])) + } + ) + // 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 ']; + // let b : any = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety']; + // if ((num = num.toString()).length > 9) return 'overflow'; + // let n : any = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/); + // if (!n) return; var str = ''; + // str += (n[1] != 0) ? (a[Number(n[1])] || b[n[1][0]] + ' ' + a[n[1][1]]) + 'crore ' : ''; + // str += (n[2] != 0) ? (a[Number(n[2])] || b[n[2][0]] + ' ' + a[n[2][1]]) + 'lakh ' : ''; + // str += (n[3] != 0) ? (a[Number(n[3])] || b[n[3][0]] + ' ' + a[n[3][1]]) + 'thousand ' : ''; + // str += (n[4] != 0) ? (a[Number(n[4])] || b[n[4][0]] + ' ' + a[n[4][1]]) + 'hundred ' : ''; + // str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : ''; + // return str; + // } + + convertNumberToWords(amount) { + //let words : any = new Array(); + let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; + words[30] = 'Thirty'; + words[40] = 'Forty'; + words[50] = 'Fifty'; + words[60] = 'Sixty'; + words[70] = 'Seventy'; + words[80] = 'Eighty'; + words[90] = 'Ninety'; + amount = amount.toString(); + let atemp = amount.split("."); + let number = atemp[0].split(",").join(""); + let n_length = number.length; + let words_string = ""; + let value: any; + if (n_length <= 9) { + var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + var received_n_array = new Array(); + for (var i = 0; i < n_length; i++) { + received_n_array[i] = number.substr(i, 1); + } + for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { + n_array[i] = received_n_array[j]; + } + for (var i = 0, j = 1; i < 9; i++ , j++) { + if (i == 0 || i == 2 || i == 4 || i == 7) { + if (n_array[i] == 1) { + n_array[j] = 10 + (+n_array[j]); + n_array[i] = 0; + } + } + } + value = ""; + for (var i = 0; i < 9; i++) { + if (i == 0 || i == 2 || i == 4 || i == 7) { + value = n_array[i] * 10; + } else { + value = n_array[i]; + } + if (value != 0) { + words_string += words[value] + " "; + } + if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Crores "; + } + if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Lakhs "; + } + if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { + words_string += "Thousand "; + } + if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { + words_string += "Hundred and "; + } else if (i == 6 && value != 0) { + words_string += "Hundred "; + } + } + words_string = words_string.split(" ").join(" "); + } + return words_string; + } + + // save additional requirements + saveAdditionalRequirements(saveData: any): Observable { + saveData.createdby = this._aws.getlocale(); + + return this._http.post(this.apiUrl + "savePDAdditionalRequiremets", { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + /** For Stock Details + * To Get The Products With TypeofActivity From Business + **/ + stockFormAccess(pdid: any,companyid: any): Observable { + // { "pd_id":"104","company_id":"1"} + return this._http.post(this.apiUrl + "getProductsFromBusiness", { "pd_id" : pdid , "company_id":companyid }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + + getCompaniesListsForBusiness(pdid: any): Observable { + return this._http.post(this.apiUrl + "getCompaniesListsForBusiness", { "records":{ "pd_id" : pdid}}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + /** To get StateWise City List For + * 1) Family Form + * 2) add PD + */ + getStateWiseCities(stateid:any): Observable { + return this._http.post(this.apiUrl + "getListOfStatesAndCities", { "records":{ "state_id" : stateid}}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + /** To get Family Member Name For + * 1) Family Form + */ + getFamilyDetails(pdid:any): Observable { + return this._http.post(this.apiUrl + "getFamilyDetails", { "pd_id" : pdid}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + /** To get Family Member Name For + * 1) other income form - (income earned field) + * 2) bussiness form - (partner_name field) + */ + getAllPersonsName(pdid:any): Observable { + return this._http.post(this.apiUrl + "getAllPersonsName", { "pd_id" : pdid}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + /** To get Business Asset For + * 1) Current Loan Form(where Business Asset loan Details is 'Yes' means name is displayed) + */ + getAssetsWithLoanFromBusiness(pdid:any): Observable { + return this._http.post(this.apiUrl + "getAssetsWithLoanFromBusiness",{ "pd_id" : pdid}) + .pipe(catchError(this.handleError('operation', []))) + } + + getEndUseForLoan(pdid: any): Observable { + return this._http.post(this.apiUrl + "getEndUseOfLoan",{ "records":{ "pd_id" : pdid}}) + .pipe( + catchError(this.handleError('operation', [])) + ) } - // save pd answers - savePDQuestions(saveData: any): Observable { - saveData.createdby = this._aws.getlocale(); - // saveData.fk_createdon = currentdate; - // saveData[0].fk_updatedby = this._aws.getlocale(); - // saveData[0].updatedon = currentdate; + // private handleError(operation = 'operation', result?: T) { + // return (error: any): Observable => { + // return of(result as T); + // }; + // } - return this._http.post(this.apiUrl+"savePDQuestions",{"records":saveData}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } + /**Search Filter + * Sriram + */ - private handleError(operation = 'operation', result?: T) { - return (error: any): Observable => { - return of(result as T); - }; - } + overAllSearchFormDetails(searchItem) { + let records = { 'records': searchItem }; + return this._http.post(this.apiUrl + 'filterPDList', records).pipe( + catchError(this.handleError('operation', [])) + ); + } + + // get list of cities for p serach options + getListOfCities() { + return this._http.get(this.apiUrl + 'getListOfCities') + .pipe( + catchError(this.handleError('role', [])) + ) + } + + // save assessed sales item wise + saveAssessedDetails(methodURl: string,saveData:any){ + //saveData.createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + methodURl, { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // this is for pd map details only for triggered/ allocated status + getPdMapList(triggeredStatus, allocatedStatus): Observable { + const firstStatus = triggeredStatus ? + { params: new HttpParams().set('status', triggeredStatus) } : {}; + let response1 = this._http.get(this.apiUrl + "listLessPDDetails/get", firstStatus); + const secondStatus = allocatedStatus ? + { params: new HttpParams().set('status', allocatedStatus) } : {}; + let response2 = this._http.get(this.apiUrl + "listLessPDDetails/get", secondStatus); + return forkJoin([response1, response2]); + } } diff --git a/ng6-seed/src/app/quality-check/quality-check-routing.module.ts b/ng6-seed/src/app/quality-check/quality-check-routing.module.ts index 4254ee92b..2503be06b 100755 --- a/ng6-seed/src/app/quality-check/quality-check-routing.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check-routing.module.ts @@ -4,6 +4,7 @@ import { QualityCheckComponent } from './quality-check.component'; import { QcListComponent } from './qc-list/qc-list.component'; import { QcViewComponent } from './qc-list/qc-view/qc-view.component'; import { QcStartComponent } from './qc-list/qc-start/qc-start.component'; +import { QcPdReportComponent } from './qc-list/qc-pd-report/qc-pd-report.component'; const routes: Routes =[ { @@ -25,7 +26,11 @@ const routes: Routes =[ { path: 'startpd/:pdid', component: QcStartComponent, - } + }, + { + path: 'pd_report/:pdid', + component: QcPdReportComponent, + }, ] } ] diff --git a/ng6-seed/src/app/quality-check/quality-check.module.ts b/ng6-seed/src/app/quality-check/quality-check.module.ts index 4499fb516..f55a9a249 100755 --- a/ng6-seed/src/app/quality-check/quality-check.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check.module.ts @@ -18,6 +18,11 @@ import { import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { AgmCoreModule } from '@agm/core'; +import { CKEditorModule } from 'ng2-ckeditor'; +import { PdfViewerModule } from 'ng2-pdf-viewer'; +import {MAT_MOMENT_DATE_FORMATS, MomentDateAdapter} from '@angular/material-moment-adapter'; +import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; +import { SharedModule } from "app/shared/shared.module"; // import completed pd components from personal discussion module import { ManagePdModule } from './../personal-discussion/manage-pd/manage-pd.module'; //import qu routing ,and its components @@ -32,6 +37,9 @@ import { EditPdApplicantComponent } from './../personal-discussion/manage-pd/lis import { EditPdMasterComponent } from './../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component'; import { QcService } from './qc-service/qc.service'; import { QcStartComponent } from './qc-list/qc-start/qc-start.component'; +import { QcPdReportComponent, DialogChangeCurrentVenrsion } from './qc-list/qc-pd-report/qc-pd-report.component'; +import { QcReviewComponent } from './qc-list/qc-pd-report/qc-review/qc-review.component'; +import { ModelEditPdReportComponent } from './qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component'; /** * Custom angular notifier options @@ -95,13 +103,18 @@ const customNotifierOptions: NotifierOptions = { MatStepperModule, MatTabsModule, MatCheckboxModule,MatSidenavModule, MatButtonToggleModule, MatBadgeModule,MatTooltipModule, + SharedModule, FormsModule, ReactiveFormsModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), + CKEditorModule, + PdfViewerModule, ManagePdModule, ], - declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent], - entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent], - providers : [QcService] + declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent], + entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent], + providers : [QcService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}] }) export class QualityCheckModule { } From 2cf2c0d6e8712a8aa777a107e002f558ac7b2daf Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 28 Feb 2019 12:32:55 +0530 Subject: [PATCH 2/2] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 256 ++-- .../list-pd/add-pd/add-pd.component.ts | 247 ++-- .../current-loan/current-loan.component.ts | 59 +- .../financial-info.component.html | 1143 ++++++++--------- .../financial-info.component.ts | 19 +- .../neighbour-hood.component.ts | 2 +- .../list-pd/view-pd/view-pd.component.html | 4 +- .../pd-service/pd-triger.service.ts | 4 +- 8 files changed, 854 insertions(+), 880 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index c435cd69f..a318ff1b6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -128,53 +128,61 @@ Address Details - - +
+ - + - + - - - Select - + + Select {{SL.name}} - - + Select - - {{CL.city_name}} - - + + {{CL.city_name}} + - + - + - + Select - {{PL.pincode}} + {{PL.pincode}} - + + - Enter Valid Pincode. + - - - +
+ +
+ + + +
+ + + + @@ -182,6 +190,7 @@ Applicant Details +
Applicant 1
@@ -212,70 +221,63 @@ Enter Valid LandLine Number. + +
+ +
+ + +
{{coDetails.controls.label.value}} {{i+2}}
+ +
+ + + + {{tl.name}} + + + + + + + + - - + + + + + + + + + Enter Valid Mobile Number. + + + + + Enter Valid STD Code. +   -   + + + Enter Valid Landline Number. + + + + +
+
+
+
- - - + + + +
- - Additional Requirements @@ -352,90 +354,4 @@
- - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 0b550386e..679d7d3a7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -23,15 +23,18 @@ export class AddPdComponent implements OnInit, OnDestroy { PDTriggerStatus: string; private notifier: NotifierService; public _PDtriggerForm: FormGroup; - items: FormArray; + + addresses: FormArray; + coapplicants: FormArray; addtional_requirements: FormArray; + productList: any; subProductList: any; lenderList: any; lenderBranchList: any; customerSegmentList: any; - stateList: any; - cityList: any; + stateList: any = []; + cityList: any = []; pdTypeList: any; billingList: any; relationShipList: any; @@ -43,6 +46,7 @@ export class AddPdComponent implements OnInit, OnDestroy { createWithLongContent = false; dynamicCoApplicant = []; disableAfterSubmit: boolean; + pincodeflag : any = []; constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent) { this.notifier = notifier; @@ -92,26 +96,21 @@ export class AddPdComponent implements OnInit, OnDestroy { applicant_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])], applicant_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])], company_name: [null], - addressline1: [null], - fk_city: [null], - fk_state: [null], - pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ - other_pincode: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], remarks: [null], // allocation_type: [null], // sub_allocation_type: [null], - items: this._fb.array([]), + coapplicants: this._fb.array([]), + addresses: this._fb.array([this.createAddresses()]), documents: this._fb.array([]), addtional_requirements: this._fb.array([this.createRequiremnt()]) }); } + + /** FOR Dropdowns */ selectedLender(lender) { - // console.log(JSON.stringify(lender)); - // alert(JSON.stringify(lender['branches '])); this.lenderBranchList = lender['branches']; this._PDtriggerForm.controls.pd_branch_id.setValue(null); - } getLenderList() { @@ -122,6 +121,7 @@ export class AddPdComponent implements OnInit, OnDestroy { } }, error => this.errorMessage = error); } + getProductsList() { this._pd.getProductsDetails().subscribe( data => { @@ -131,6 +131,7 @@ export class AddPdComponent implements OnInit, OnDestroy { } }, error => this.errorMessage = error); } + getCustomerSegmentList() { this._pd.getCustomersDetails().subscribe( data => { @@ -139,14 +140,8 @@ export class AddPdComponent implements OnInit, OnDestroy { } }, error => this.errorMessage = error); } - // getStateCityList(){ - // this._pd.getStateCityDetails().subscribe( - // data => { - // if (data.status == 200) { - // this.stateList=data.records - // } - // }, error => this.errorMessage = error); - // } + + //get State getStateCityList() { this._pd.getAllMasterDatas('STATE').subscribe( data => { @@ -155,6 +150,8 @@ export class AddPdComponent implements OnInit, OnDestroy { } }); } + + //get PDType List getPDTypeList() { this._pd.getPDTypeDetails().subscribe( data => { @@ -164,31 +161,21 @@ export class AddPdComponent implements OnInit, OnDestroy { } }, error => this.errorMessage = error); } + //get sub product list based on prokduct id getSubproductList(productID: string) { - this.subProductList = this.productList.filter(item => item.product_id == productID); this.subProductList = this.subProductList[0].subproducts; this.subProductList = this.subProductList.filter(item => item.is_others == 0); } - // get city list details based on state id - // getCityList(stateID:string){ - // console.log(this.cityList); - // this.cityList= this.stateList.filter(item => item.state_id == stateID); - // console.log(this.cityList); - // this.cityList=this.cityList[0].cities; - // console.log(this.cityList); - // } //get city list details based on state id - getCityList(stateID: string) { - // console.log('getCityList',stateID); + getCityList(stateID: string,index) { this._pd.getStateWiseCities(stateID).subscribe(data => { if (data.status == 200) { - // console.log(data); - this.cityList = data.records.cities; - this.pincodeList = data.records.pincode; + this.cityList[index] = data.records.cities; + this.pincodeList[index] = data.records.pincode; } }); } @@ -200,10 +187,10 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.relationShipList = data.records; - } }, error => this.errorMessage = error); } + // get title master getTitleMaster() { let relation = "TITLES"; @@ -211,31 +198,11 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.titleList = data.records.filter(val => val.isactive == 1); - // console.log(this.titleList); - // let index1 = this.titleList.map(data => data.name).indexOf("Master"); - // this.titleList.splice(index1, 1); } }, error => this.errorMessage = error); - - } - createItem(): FormGroup { - return this._fb.group({ - - coapplicantName: [null, Validators.compose([Validators.required])], - // coapplicantTitleName: [null], - // companyName: [null], - // applicantType: 0, - // coapplicant_mobile_no: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(10), Validators.required])], - // coapplicant_landline: [null, Validators.compose([Validators.minLength(12), Validators.maxLength(13)])], - // relationship: [null], - }); - }; - - addCoApplicant() { - this.items = this._PDtriggerForm.get('items') as FormArray; - this.items.push(this.createItem()); } + /** FOR Documents */ addMoreDocs() { if (this.totalfiles.length != 0) { if (this.documents.value[0].doc_name != "" && ((this.lengthCheckToaddMore) === (this.totalfiles.length))) { @@ -259,15 +226,11 @@ export class AddPdComponent implements OnInit, OnDestroy { get documents(): FormArray { return this._PDtriggerForm.get('documents') as FormArray; }; + get pdMain() { return this._PDtriggerForm.controls; } - // get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; } - removeCoApplicant(i: number) { - const control = this._PDtriggerForm.controls['items']; - control.removeAt(i); - } removeItem(index: number) { this.totalfiles.splice(index, 1); this.totalFileName.splice(index, 1); @@ -275,6 +238,53 @@ export class AddPdComponent implements OnInit, OnDestroy { this.lengthCheckToaddMore = this.lengthCheckToaddMore - 1; } + /** FOR Coapplicant */ + get pdCoApplicant() { return this._PDtriggerForm.get('coapplicants') as FormArray; } + + addCoApplicant() { + this.coapplicants = this._PDtriggerForm.get('coapplicants') as FormArray; + this.coapplicants.push(this.createCoApplicant()); + } + + createCoApplicant(): FormGroup { + return this._fb.group({ + label: ['Applicant'], + applicant_title_name:[null], + coapplicant_name: [null, Validators.compose([Validators.required])], + coapplicant_mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10),Validators.required])], + coapplicant_stdcode:[null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])], + coapplicant_landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])], + company_name:[null], + relationship: [null], + }); + }; + + removeCoApplicant(i: number) { + const control = this._PDtriggerForm.controls['coapplicants']; + control.removeAt(i); + } + + /** FOr Adress */ + get pdAddresses() { return this._PDtriggerForm.get('addresses') as FormArray; } + createAddresses(): FormGroup { + return this._fb.group({ + addressline: [null], + fk_city: [null], + fk_state: [null], + pincode: [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ + other_pincode: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], + }); + }; + addAddresses() { + this.addresses = this._PDtriggerForm.get('addresses') as FormArray; + this.addresses.push(this.createAddresses()); + } + + removeAddresses(index: number) { + const address_control = this._PDtriggerForm.controls['addresses']; + address_control.removeAt(index); + } + get pdRequirements() { return this._PDtriggerForm.get('addtional_requirements') as FormArray; } createRequiremnt(): FormGroup { return this._fb.group({ @@ -317,7 +327,8 @@ export class AddPdComponent implements OnInit, OnDestroy { this.lengthCheckToaddMore = 1; } } - + getPincode(e,i){ this.pincodeflag[i] = e == 1 ? true : false; + } // save pd in draft saveDraftPD(formValue: any, status: string) { //alert('Inside The Draft PD'); @@ -351,17 +362,17 @@ export class AddPdComponent implements OnInit, OnDestroy { this._PDtriggerForm.controls['mobile_no'].setValidators([Validators.required]); this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity(); - this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]); - this._PDtriggerForm.controls['addressline1'].updateValueAndValidity(); + // this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]); + // this._PDtriggerForm.controls['addressline1'].updateValueAndValidity(); - this._PDtriggerForm.controls['fk_city'].setValidators([Validators.required]); - this._PDtriggerForm.controls['fk_city'].updateValueAndValidity(); + // this._PDtriggerForm.controls['fk_city'].setValidators([Validators.required]); + // this._PDtriggerForm.controls['fk_city'].updateValueAndValidity(); - this._PDtriggerForm.controls['fk_state'].setValidators([Validators.required]); - this._PDtriggerForm.controls['fk_state'].updateValueAndValidity(); + // this._PDtriggerForm.controls['fk_state'].setValidators([Validators.required]); + // this._PDtriggerForm.controls['fk_state'].updateValueAndValidity(); - this._PDtriggerForm.controls['pincode'].setValidators([Validators.required]); - this._PDtriggerForm.controls['pincode'].updateValueAndValidity(); + // this._PDtriggerForm.controls['pincode'].setValidators([Validators.required]); + // this._PDtriggerForm.controls['pincode'].updateValueAndValidity(); setTimeout(() => { this.clearCustomValidatorFields(); }, 10000); @@ -397,23 +408,24 @@ export class AddPdComponent implements OnInit, OnDestroy { this._PDtriggerForm.controls['mobile_no'].clearValidators(); this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity(); - this._PDtriggerForm.controls['addressline1'].clearValidators(); - this._PDtriggerForm.controls['addressline1'].updateValueAndValidity(); + // this._PDtriggerForm.controls['addressline1'].clearValidators(); + // this._PDtriggerForm.controls['addressline1'].updateValueAndValidity(); - this._PDtriggerForm.controls['fk_city'].clearValidators(); - this._PDtriggerForm.controls['fk_city'].updateValueAndValidity(); + // this._PDtriggerForm.controls['fk_city'].clearValidators(); + // this._PDtriggerForm.controls['fk_city'].updateValueAndValidity(); - this._PDtriggerForm.controls['fk_state'].clearValidators(); - this._PDtriggerForm.controls['fk_state'].updateValueAndValidity(); + // this._PDtriggerForm.controls['fk_state'].clearValidators(); + // this._PDtriggerForm.controls['fk_state'].updateValueAndValidity(); - this._PDtriggerForm.controls['pincode'].clearValidators(); - this._PDtriggerForm.controls['pincode'].updateValueAndValidity(); + // this._PDtriggerForm.controls['pincode'].clearValidators(); + // this._PDtriggerForm.controls['pincode'].updateValueAndValidity(); this.validateAllFormFields(this._PDtriggerForm); } // common function for both draft and process pd submitPdDetails(formValue: any, status: string) { + if (this._PDtriggerForm.invalid) { this.validateAllFormFields(this._PDtriggerForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -426,30 +438,32 @@ export class AddPdComponent implements OnInit, OnDestroy { } else { this.disableAfterSubmit = true; - let concat_landline - let concat_landline1 + + let lender_landline_no; + let applicant_landline_no; + if (formValue.lender_stdcode != null || formValue.lender_landline != null) { if (formValue.lender_stdcode != '' && formValue.lender_landline != '') { - concat_landline = formValue.lender_stdcode + '-' + formValue.lender_landline; + lender_landline_no = formValue.lender_stdcode + '-' + formValue.lender_landline; } else { - concat_landline = null; + lender_landline_no = null; } } else { - concat_landline = null; + lender_landline_no = null; } if (formValue.applicant_stdcode != null || formValue.applicant_landline != null) { if (formValue.applicant_stdcode != '' && formValue.applicant_landline != '') { - concat_landline1 = formValue.applicant_stdcode + '-' + formValue.applicant_landline; + applicant_landline_no = formValue.applicant_stdcode + '-' + formValue.applicant_landline; } else { - concat_landline1 = null; + applicant_landline_no = null; } } else { - concat_landline1 = null; + applicant_landline_no = null; } let pd_details: any = { @@ -458,21 +472,23 @@ export class AddPdComponent implements OnInit, OnDestroy { "pd_branch_id": formValue.pd_branch_id, "pd_contact_person": formValue.lender_contact_person, "pd_contact_mobileno": formValue.lender_contact_mobile, - "pd_contact_landline": concat_landline, + "pd_contact_landline": lender_landline_no, "fk_product_id": formValue.fk_product_id, "fk_subproduct_id": formValue.fk_subproduct_id, "fk_pd_type": formValue.fk_pd_type, "fk_customer_segment": formValue.fk_customer_segment, "loan_amount": formValue.loan_amount, - "addressline1": formValue.addressline1.toUpperCase(), - "fk_city": formValue.fk_city, - "fk_state": formValue.fk_state, - "pincode": formValue.pincode, - "other_pincode": formValue.other_pincode, + "addressline1": formValue.addresses[0].addressline.toUpperCase(), + "fk_city": formValue.addresses[0].fk_city, + "fk_state": formValue.addresses[0].fk_state, + "pincode": formValue.addresses[0].pincode, + "other_pincode": formValue.addresses[0].other_pincode, "remarks": formValue.remarks, "pd_status": status, "fk_createdby": this._aws.getlocale(), }; + + var pd_applicant_details: any = []; if (formValue.applicant_name) { pd_applicant_details.push({ @@ -480,20 +496,35 @@ export class AddPdComponent implements OnInit, OnDestroy { "applicant_title_name": formValue.applicant_title_name, "company_name": formValue.company_name, "mobile_no": formValue.mobile_no, - "landline": concat_landline1, + "landline": applicant_landline_no, "applicant_type": 1, "relation": "", }); } - formValue.items.forEach((itemElement, itemIndex) => { + formValue.coapplicants.forEach((itemElement, itemIndex) => { + + let coapplicant_landline_no; + + if (itemElement.coapplicant_stdcode != null || itemElement.coapplicant_landline != null) { + if (itemElement.coapplicant_stdcode != '' && itemElement.coapplicant_landline != '') { + coapplicant_landline_no = formValue.coapplicant_stdcode + '-' + itemElement.applicant_landline; + } + else { + coapplicant_landline_no = null; + } + } + else { + coapplicant_landline_no = null; + } + let obj1 = { - "applicant_name": itemElement.coapplicantName, + "applicant_name":itemElement.coapplicant_name, "applicant_title_name": itemElement.applicant_title_name, "company_name": itemElement.company_name, - "mobile_no": itemElement.coapplicant_mobile_no, - "landline": itemElement.coapplicant_landline, - "applicant_type": 0, + "mobile_no":itemElement.coapplicant_mobile_no, + "landline": coapplicant_landline_no, + "applicant_type":0, "relation": "", } pd_applicant_details.push(obj1) @@ -519,12 +550,26 @@ export class AddPdComponent implements OnInit, OnDestroy { } pd_form.append("pd_document_titles", JSON.stringify(AllFilesObj)) + if (formValue.addtional_requirements.length > 0) { pd_form.append("addtional_requirements", JSON.stringify(formValue.addtional_requirements)) - } - // console.log('pd_form',pd_form); - // console.log('pd_details',pd_details); + + // formValue.addresses.forEach((addressElement, itemIndex) => { + // let addressobj = { + // "addressline": addressElement.addressline.toUpperCase(), + // "fk_city": addressElement.fk_city, + // "fk_state": addressElement.fk_state, + // "pincode": addressElement.pincode, + // "other_pincode": addressElement.other_pincode, + // } + + // }); + + if (formValue.addresses.length > 0) { + pd_form.append("addresses", JSON.stringify(formValue.addresses)) + } + this._pd.addPdDetails(pd_form).subscribe(result => { if (result.status == 200) { this.disableAfterSubmit = false; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 2f75c964a..314a966f4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -136,22 +136,47 @@ export class CurrentLoanComponent implements OnInit { const control = this.currentLoanForm.controls['loan_details']; if (value.status == 200) { - + console.log('value.records',value.records); this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan); this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks); if (value.records.existing_loan == 'Yes') { - var result = Object.keys(value.records.loan_details).map(function (key) { - return value.records.loan_details[key]; + console.log('value.records.loan_details',); + let loandetails = value.records.loan_details + + var result = Object.keys(loandetails).map(function (key) { + return loandetails[key]; }); + + const control = this.currentLoanForm.controls['loan_details']; if (result.length > 0) { result.forEach((val,index) => { this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount); this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); this.selectedfrequency(val.frequency,index); //this.selectedLoanTakenBy(val.loan_taken_by,index); + + let objs = { + 'label': val.loan_amount, + 'loan_amount': val.loan_amount, + 'frequency':val.frequency, + 'other_frequency':val.other_frequency, + 'emi': val.emi, + 'loan_type': val.loan_type, + 'others_loan_type': val.others_loan_type, + 'loan_taken_by':val.loan_taken_by, + 'others_loan_taken':val.others_loan_taken, + 'lender': val.lender, + 'others_lender':val.others_lender, + 'original_tenure': val.original_tenure, + 'current_balance_tenure': val.current_balance_tenure, + 'elapsed_tenure':val.elapsed_tenure + } + control.push(this.createLoanDetail(objs)); + }); - this.currentLoanForm.controls['loan_details'].setValue(result); + + // this.currentLoanForm.controls['loan_details'].setValue(result_data); } else { // control.push(this.createLoanDetail()); } @@ -424,19 +449,19 @@ export class CurrentLoanComponent implements OnInit { createLoanDetail(data) { return this.fb.group({ label: data == null ? [''] : [data.label], - loan_amount: [''], - frequency:[''], - other_frequency:[''], - emi: [''], - loan_type: [''], - others_loan_type: [''], - loan_taken_by:[''], - others_loan_taken:[''], - lender: [''], - others_lender:[''], - original_tenure: [''], - current_balance_tenure: [''], - elapsed_tenure:[''] + loan_amount: null ? [''] : [data.loan_amount], + frequency:null ? [''] : [data.frequency], + other_frequency:null ? [''] : [data.other_frequency], + emi: null ? [''] : [data.emi], + loan_type: null ? [''] : [data.loan_type], + others_loan_type: null ? [''] : [data.others_loan_type], + loan_taken_by:null ? [''] : [data.loan_taken_by], + others_loan_taken:null ? [''] : [data.others_loan_taken], + lender: null ? [''] : [data.lender], + others_lender:null ? [''] : [data.others_lender], + original_tenure: null ? [''] : [data.original_tenure], + current_balance_tenure: null ? [''] : [data.current_balance_tenure], + elapsed_tenure:null ? [''] : [data.elapsed_tenure] }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 9073a7e12..555a7e7d0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -1,20 +1,18 @@ -
-

-
- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
- {{pageTitle}} -
-
- - -
+
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{pageTitle}} +
+
+ +

- - - +
@@ -22,596 +20,579 @@ -

Data as Per Financial Statements

-
- - - - Yes - No - - - + + + Yes + No + +
-
Enter year from which financials provided - - Invalid year format - - - + + Invalid year format + - +
- - -
- -
- - - Financial Year : {{details.get('financial_year').value}} +
+
+ + Financial Year : + {{details.get('financial_year').value}}
- -
+

- - - - - {{"₹"}} {{FY_annualSalesInwords[i]}} Only - - - - - - - - No difference in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} - - - Increase in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{details.get('financial_annualsales_variation').value}} % - - - Decrease in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{(details.get('financial_annualsales_variation').value).replace('-', '')}} % - - - - - -
- -
- - - - Net Profit - Net Loss - - - - - - - {{"₹"}} {{FY_netProfitAmtInwords[i]}} Only - - - - - - - - - - {{"₹"}} {{FY_netLossAmtInwords[i]}} Only - - - - - -
- + + + {{"₹"}} + {{FY_annualSalesInwords[i]}} Only + - - - - - No difference in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + + + + No difference in Sales in FY + {{details.get('financial_year').value}} over + Sales in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + - - Increase in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{details.get('financial_variation').value}} % + + Increase in Sales in FY + {{details.get('financial_year').value}} over + Sales in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + {{details.get('financial_annualsales_variation').value}} + % - - Decrease in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{(details.get('financial_variation').value).replace('-', '')}} % + + Decrease in Sales in FY + {{details.get('financial_year').value}} over + Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + {{(details.get('financial_annualsales_variation').value).replace('-', + '')}} % - - - - - - - - No difference in Profit sales % in FY {{details.get('financial_year').value}} over Profit sales % in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} - - - Increase in Profit sales % in FY {{details.get('financial_year').value}} over Profit sales % in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{details.get('financial_profit_to_sale_variation').value}} % - - - Decrease in Profit sales % in FY {{details.get('financial_year').value}} over Profit sales % in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{(details.get('financial_profit_to_sale_variation').value).replace('-', '')}} % - - - - - - - -
+ +
+
+ + + + Net Profit + Net Loss + + + + + + {{"₹"}} + {{FY_netProfitAmtInwords[i]}} Only + + + + + + + + + {{"₹"}} + {{FY_netLossAmtInwords[i]}} Only + + + + + +
+ + + + + + No difference in Profit in FY + {{details.get('financial_year').value}} over + Profit in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + + + Increase in Profit in FY + {{details.get('financial_year').value}} over + Profit in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + {{details.get('financial_variation').value}} % + + + Decrease in Profit in FY + {{details.get('financial_year').value}} over + Profit in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + {{(details.get('financial_variation').value).replace('-', + '')}} % + + + + + + + + + No difference in Profit sales % in FY + {{details.get('financial_year').value}} over + Profit sales % in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + + + Increase in Profit sales % in FY + {{details.get('financial_year').value}} over + Profit sales % in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + {{details.get('financial_profit_to_sale_variation').value}} + % + + + Decrease in Profit sales % in FY + {{details.get('financial_year').value}} over + Profit sales % in FY + {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + {{(details.get('financial_profit_to_sale_variation').value).replace('-', + '')}} % + + + + +
- - - - - - - -
-
-
-
- - - -

Financial as per Customer

-
- - - - Yes - No - - - -
-
- - - - - - -
- - - - - {{"₹"}} {{AV_SalesFrmInwords[i]}} Only - - - - - {{"₹"}} {{AV_SalesToInwords[i]}} Only - - - - - {{"₹"}} {{AV_SalesInwords[i]}} Only - - -
- - -
- - - - - Net Profit - Net Loss - - - - - - Yes - No - - - - - - -
- - - - - - - - - - - - - {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only - -
-
- - - {{"₹"}} {{AV_netProfitAmtFrmInwords[i]}} Only - - - - {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only - - - - - - - {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only - - -
- -
- Working Capital Details - - - - - - - - - - - - Yes - No - - - - - {{a.name}} - - - - - -
- - -
- - - - - - - - - - - - - - {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only - -
-
- - - {{"₹"}} {{AV_netLossAmtFrmInwords[i]}} Only - - - - {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only - - - - - - - {{"₹"}} {{AV_netLossAmtInwords[i]}} Only - - - -
-
- - - -
- - -
- - - - - - -
-
-
-
- -
-
- - - - - - - - - - + + + + + +
+
+
+
+
+ + + +

Financial as per Customer

+
+
+ + + Yes + No + + +
+
+ +
+ + + {{"₹"}} + {{AV_SalesFrmInwords[i]}} Only + + + + {{"₹"}} + {{AV_SalesToInwords[i]}} Only + + + + {{"₹"}} + {{AV_SalesInwords[i]}} Only + +
+
+ + + Net Profit + Net Loss + + + + + Yes + No + + +
+ + + + + + + + + + + + + + {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only + + +
+
+ + + {{"₹"}} + {{AV_netProfitAmtFrmInwords[i]}} Only + + + + {{"₹"}} + {{AV_netProfitAmtToInwords[i]}} Only + + + + + + + {{"₹"}} + {{AV_netProfitAmtInwords[i]}} Only + +
+
+ + + + + + + + + + + + {{"₹"}} + {{AV_marginLossAmtInwords[i]}} Only + +
+
+ + + {{"₹"}} + {{AV_netLossAmtFrmInwords[i]}} Only + + + + {{"₹"}} + {{AV_netLossAmtToInwords[i]}} Only + + + + + + + {{"₹"}} + {{AV_netLossAmtInwords[i]}} Only + +
+
+ + + +
+
+
+
+
+
+
+
+
+
+ + + +

Working Capital Details

+
+
+ + + + + + + + + + + + + + Yes + No + + + + + + {{a.name}} + + + + + + +
+
+
+ + + + + + + + -
- - Remarks - - -
-
- +
+ + Remarks + + +
+
+
- - - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 79d3f45d4..56682ff74 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -211,6 +211,18 @@ export class FinancialInfoComponent implements OnInit { financial_no_of_year : [''], financial_reason: [''], financial_customer:[''], + // estimate_receive_the_money_in_days:[value.estimate_receive_the_money_in_days], + // estimate_pay_the_money_in_days:[value.estimate_pay_the_money_in_days], + // estimate_unsold_stock_lies_in_days:[value.estimate_unsold_stock_lies_in_days], + // is_there_working_capital_available:[value.is_there_working_capital_available], + // estimate_working_capital_facilities_availed:[value.estimate_working_capital_facilities_availed], + // reason_for_working_capital_facilities_availed:[value.reason_for_working_capital_facilities_availed] + receive_the_money_in_days:[''], + pay_the_money_in_days:[''], + unsold_stock_lies_in_days:[''], + is_there_working_capital_available:[''], + working_capital_facilities_availed:[''], + reason_for_working_capital_facilities_availed:[''], // same_as_financial_statements:[''], date_per_financial: this.fb.array([]), estimated_value: this.fb.array([]) @@ -310,12 +322,6 @@ export class FinancialInfoComponent implements OnInit { estimate_net_loss_percent:[value.estimate_net_loss_percent], estimate_net_loss:[value.estimate_net_loss], estimate_reason_for_loss:[value.estimate_reason_for_loss], - estimate_receive_the_money_in_days:[value.estimate_receive_the_money_in_days], - estimate_pay_the_money_in_days:[value.estimate_pay_the_money_in_days], - estimate_unsold_stock_lies_in_days:[value.estimate_unsold_stock_lies_in_days], - is_there_working_capital_available:[value.is_there_working_capital_available], - estimate_working_capital_facilities_availed:[value.estimate_working_capital_facilities_availed], - reason_for_working_capital_facilities_availed:[value.reason_for_working_capital_facilities_availed] }); } @@ -388,7 +394,6 @@ export class FinancialInfoComponent implements OnInit { this.isDisplay = false; this.financialForm.controls['is_financial_customer'].setValue('no'); - this.selectedFinancialCustomer('no'); const statementControl = this.financialForm.controls['date_per_financial']; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 284274ae3..bfe71ce2f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -249,7 +249,7 @@ export class NeighbourHoodComponent implements OnInit { // neighbourhoodControl.controls['do_know'].setValidators([Validators.required]); // neighbourhoodControl.controls['do_know'].updateValueAndValidity(); - return; + // return; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index dd6f5be88..b8d292d2f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -172,11 +172,11 @@  {{applicant.applicant_name}}     - +  {{applicant.mobile_no}}     - +  {{applicant.landline}} diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 18cdb2a84..7d3525aee 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -96,7 +96,9 @@ export class PdTrigerService { ) } - // get state and city details + /* get state and city details + This Api OnlyFor Bussiness info Details This Will Have 'Throughout state' option + */ getStateCityDetails(): Observable { return this._http.post(this.apiUrl + 'getListOfStatesCities','') .pipe(