diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 23fae016e..fba034b3c 100755 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -4344,12 +4344,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4364,17 +4366,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4491,7 +4496,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4503,6 +4509,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4517,6 +4524,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4524,12 +4532,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -4548,6 +4558,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4628,7 +4639,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4640,6 +4652,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4761,6 +4774,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7313,6 +7327,14 @@ } } }, + "ngx-viewer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ngx-viewer/-/ngx-viewer-1.0.1.tgz", + "integrity": "sha512-9nYfxsxco/x8zLjdVOAhi4SFMZhSgtHBGTmcns9ebQn5nCBwHbk9O62K5ZIWkfOElr9ey1KA+DmppH32YGkXEA==", + "requires": { + "tslib": "^1.9.0" + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -10695,6 +10717,11 @@ "extsprintf": "^1.2.0" } }, + "viewerjs": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.3.1.tgz", + "integrity": "sha512-FBO2pN5XKx2yYpfZpQFSI89GhN4PvIhI2gCyahTsLzIUQzKIIRTQyAOMG5Dey7rgMMGU+JsmpfL2q/eARiB7Dg==" + }, "vm-browserify": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", 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 bc3b23a62..66a483b14 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 @@ -1,58 +1,135 @@ - - - - + + + + +
+ filter_list Filter
+
- - -
{{(details.pd_type_name | slice:0:1)}}
- -
-
- - - {{details.applicat_details[0].applicant_name}}
- {{details.lender_applicant_id}} -({{details.customer_segment_abbr}} ) -
-
- - - {{details.lender_full_name}}
- {{details.product_abbr}}/{{details.subproduct_abbr}}
- {{details.loan_amount}} -
-
- - - {{details.pd_date_of_initiation}}
- {{details.city_name}}-{{details.pincode}} -
-
- - - {{details.pd_status}} - QC COMPLETED
- {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }} - - {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }} - - {{details.scheduled_on}} - -
-
- - - - - - - -
- -
+ + +
+ + + {{type.type_name}} + +     + + + {{status.pd_status_name}} + + + + + + +     + + + + + + + + {{pro.name}} + +     + + + {{city.name}} + +     + + + {{ent.full_name}} + + + + +     + + + +
+ +
+
- - + +
+ + + + + + +
+ {{(details.pd_type_name | slice:0:1)}} +
+ +
+
+ + + + {{details.applicat_details[0].applicant_name}} + +
+ {{details.lender_applicant_id}} + -({{details.customer_segment_abbr}} ) +
+
+ + + {{details.lender_full_name}} +
+ {{details.product_abbr}}/{{details.subproduct_abbr}} +
+ + {{details.loan_amount}} +
+
+ + + {{details.pd_date_of_initiation}} +
+ + {{details.city_name}}-{{details.pincode}} +
+
+ + + {{details.pd_status}} + QC COMPLETED +
+ {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }} + + {{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }} + + {{details.scheduled_on}} + +
+
+ + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts index 28ace0589..797aaf8e5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts @@ -1,6 +1,9 @@ import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; import { PdTrigerService } from './../../../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { FormGroup, FormBuilder } from '@angular/forms'; +import { DatePipe } from '@angular/common'; +import { NotifierService } from 'angular-notifier'; @Component({ selector: 'app-all-pd', @@ -11,6 +14,16 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m }) export class AllPdComponent implements OnInit, OnChanges { + xpandStatus: boolean = false; + PRODUCTS: any; + ENTITY: any; + CITY: any; + tempStore = new MatTableDataSource(); + PDType: any; + pdStatus: any; + searchForm:FormGroup; + pipe = new DatePipe('en-US'); + public notifier : NotifierService; recordStatus: boolean; errorMessage:any[]=[]; tabStatus:string="ALL"; @@ -34,12 +47,26 @@ export class AllPdComponent implements OnInit, OnChanges { pageSize = 10; pageEvent: PageEvent; - constructor(private _pd: PdTrigerService) { + constructor(private _pd: PdTrigerService,private _fb:FormBuilder) { + + this.searchForm = this._fb.group( + { + pd_type:[null], + pd_status:[null], + pd_from_date:[null], + pd_to_date:[null], + pd_city:[null], + pd_products:[null], + pd_lender:[null], + pd_name:[null], + pd_applicant_id:[null], + }); } ngOnInit() { this.recordStatus=false; // this.loadPDDetails(); + this.getcommonDropDown(); } ngAfterViewInit() { this.dataSourceTab1.paginator = this.paginator; @@ -65,7 +92,7 @@ export class AllPdComponent implements OnInit, OnChanges { this.PdListData = data.records; this.dataLengthTab1 = data.records.length; this.dataSourceTab1.data = this.PdListData; - + this.tempStore.data = this.PdListData; } else{ this.PdListData=[]; @@ -87,4 +114,89 @@ export class AllPdComponent implements OnInit, OnChanges { return word[0].toUpperCase() + word.substr(1).toLowerCase(); } + /** + * Common Search + * sriram + */ + + getcommonDropDown() + { + this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.pdStatus = res.records.filter(status=>status.isactive==1); + } + }); + + this._pd.getAllMasterDatas('PDTYPE').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PDType = res.records.filter(type=>type.isactive==1); + } + }); + + this._pd.getAllMasterDatas('CITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.CITY = res.records.filter(city=>city.isactive==1); + } + }); + this._pd.getAllMasterDatas('ENTITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.ENTITY = res.records.filter(ent=>ent.isactive==1); + } + }); + this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PRODUCTS = res.records.filter(pro=>pro.isactive==1); + } + }); + + } + checkDate(e) + { + console.log(e); + } + searchItem() + { + + if(this.searchForm.value.pd_type !=null) + { + + }else + { + this.searchForm.value.pd_type = []; + } + + if(this.searchForm.value.pd_status !=null) + { + + }else + { + this.searchForm.value.pd_status = []; + } + + this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd'); + this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd'); + console.log(JSON.stringify(this.searchForm.value)); + this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=> + { + this.xpandStatus = false; + if(res['dataStatus']==true) + { + this.dataSourceTab1 = res['records']; + }else{ + // this.notifier.notify('warning', 'No Records Found'); + this.dataSourceTab1 = this.tempStore; + } + }) + } + } 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 037c35c73..636d06a12 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 @@ -1,4 +1,66 @@ + + + + +
filter_list Filter
+
+ +
+ +
+ + + {{type.type_name}} + +     + + + {{status.pd_status_name}} + + + + + + +     + + + + + + + + {{pro.name}} + +     + + + {{city.name}} + +     + + + {{ent.full_name}} + + + + +     + + + +
+ +
+
+ +
+
+ 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 9111f5670..cdb1fc207 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 @@ -1,6 +1,8 @@ import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; import { PdTrigerService } from './../../../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { FormGroup, FormBuilder } from '@angular/forms'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-completed-pd', @@ -11,11 +13,23 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m }) export class CompletedPdComponent implements OnInit, OnChanges { + xpandStatus: boolean = false; + PRODUCTS: any; + CITY: any; + ENTITY: any; + PDType: any; + pdStatus: any; recordStatus: boolean; errorMessage:any[]=[]; tabStatus:string="COMPLETED"; + pipe = new DatePipe('en-US'); + public dataLengthTab4: number; public dataSourceTab4 = new MatTableDataSource(); + tempStore = new MatTableDataSource(); + + searchForm:FormGroup; + displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action']; @ViewChild(MatPaginator) paginator: MatPaginator; @@ -33,12 +47,26 @@ export class CompletedPdComponent implements OnInit, OnChanges { pageSize = 10; pageEvent: PageEvent; - constructor(private _pd: PdTrigerService) { + constructor(private _pd: PdTrigerService,public _fb:FormBuilder) { + + this.searchForm = this._fb.group( + { + pd_type:[null], + pd_status:[null], + pd_from_date:[null], + pd_to_date:[null], + pd_city:[null], + pd_products:[null], + pd_lender:[null], + pd_name:[null], + pd_applicant_id:[null], + }); } ngOnInit() { this.recordStatus=false; // this.loadPDDetails(); + this.getcommonDropDown(); } ngAfterViewInit() { this.dataSourceTab4.paginator = this.paginator; @@ -63,7 +91,7 @@ export class CompletedPdComponent implements OnInit, OnChanges { this.completedPdListData = data.records; this.dataLengthTab4 = data.records.length; this.dataSourceTab4.data = this.completedPdListData; - + this.tempStore.data } else{ this.completedPdListData=[]; @@ -85,6 +113,94 @@ export class CompletedPdComponent implements OnInit, OnChanges { return word[0].toUpperCase() + word.substr(1).toLowerCase(); } + + /** + * Common Search + * sriram + */ + + getcommonDropDown() + { + this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.pdStatus = res.records.filter(status=>status.isactive==1 && status.pd_status_name==this.tabStatus); + // this.searchForm.controls['pd_status'].setValue(this.pdStatus[0]); + } + }); + + this._pd.getAllMasterDatas('PDTYPE').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PDType = res.records.filter(type=>type.isactive==1); + } + }); + + this._pd.getAllMasterDatas('CITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.CITY = res.records.filter(city=>city.isactive==1); + } + }); + this._pd.getAllMasterDatas('ENTITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.ENTITY = res.records.filter(ent=>ent.isactive==1); + } + }); + this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PRODUCTS = res.records.filter(pro=>pro.isactive==1); + } + }); + } + + checkDate(e) + { + console.log(e); + } + searchItem() + { + + if(this.searchForm.value.pd_type !=null) + { + + }else + { + this.searchForm.value.pd_type = []; + } + + if(this.searchForm.value.pd_status !=null) + { + + }else + { + this.searchForm.value.pd_status = []; + } + + this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd'); + this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd'); + + this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=> + { + this.xpandStatus = false; + + if(res['dataStatus']==true) + { + this.dataSourceTab4 = res['records']; + }else{ + // this.notifier.notify('warning', 'No Records Found'); + this.dataSourceTab4 = this.tempStore; + } + }) + } + } 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 b4ecb5c24..c5ee76270 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 @@ -1,4 +1,64 @@ + + + +
filter_list Filter
+
+ +
+ +
+ + + {{type.type_name}} + +     + + + {{status.pd_status_name}} + + + + + + +     + + + + + + + + {{pro.name}} + +     + + + {{city.name}} + +     + + + {{ent.full_name}} + + + + +     + + + +
+ +
+
+ +
+
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 e58bf5688..fd001d504 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 @@ -1,6 +1,8 @@ import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; import { PdTrigerService } from './../../../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-inprogress-pd', @@ -9,11 +11,19 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m encapsulation: ViewEncapsulation.None }) export class InprogressPdComponent implements OnInit, OnChanges { + xpandStatus: boolean = false; + PRODUCTS: any; + ENTITY: any; + CITY: any; + PDType: any; + pdStatus: any; recordStatus: boolean; errorMessage:any[]=[]; tabStatus:string="INPROGRESS"; + pipe = new DatePipe('en-US'); public dataLengthTab2: number; public dataSourceTab2 = new MatTableDataSource(); + tempStore = new MatTableDataSource(); displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action']; @ViewChild(MatPaginator) paginator: MatPaginator; @@ -30,13 +40,27 @@ export class InprogressPdComponent implements OnInit, OnChanges { pageIndex = 0; pageSize = 10; pageEvent: PageEvent; + searchForm:FormGroup; + constructor(private _pd: PdTrigerService,public _fb:FormBuilder) { - constructor(private _pd: PdTrigerService) { + this.searchForm = this._fb.group( + { + pd_type:[null], + pd_status:[null], + pd_from_date:[null], + pd_to_date:[null], + pd_city:[null], + pd_products:[null], + pd_lender:[null], + pd_name:[null], + pd_applicant_id:[null], + }); } ngOnInit() { this.recordStatus=false; // this.loadPDDetails(); + this.getcommonDropDown(); } ngAfterViewInit() { this.dataSourceTab2.paginator = this.paginator; @@ -61,7 +85,7 @@ export class InprogressPdComponent implements OnInit, OnChanges { this.progressPdListData = data.records; this.dataLengthTab2 = data.records.length; this.dataSourceTab2.data = this.progressPdListData; - + this.tempStore.data = this.progressPdListData; } else{ this.progressPdListData=[]; @@ -82,4 +106,89 @@ export class InprogressPdComponent implements OnInit, OnChanges { return word[0].toUpperCase() + word.substr(1).toLowerCase(); } + + /** + * Common Search + * sriram + */ + + getcommonDropDown() + { + this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.pdStatus = res.records.filter(status=>status.isactive==1 && status.pd_status_name == this.tabStatus); + } + // this.searchForm.controls['pd_status'].setValue(this.pdStatus[0]); + }); + + this._pd.getAllMasterDatas('PDTYPE').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PDType = res.records.filter(type=>type.isactive==1); + } + }); + + this._pd.getAllMasterDatas('CITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.CITY = res.records.filter(city=>city.isactive==1); + } + }); + this._pd.getAllMasterDatas('ENTITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.ENTITY = res.records.filter(ent=>ent.isactive==1); + } + }); + this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PRODUCTS = res.records.filter(pro=>pro.isactive==1); + } + }); + } + checkDate(e) + { + console.log(e); + } + searchItem() + { + + if(this.searchForm.value.pd_type !=null) + { + + }else + { + this.searchForm.value.pd_type = []; + } + + if(this.searchForm.value.pd_status !=null) + { + + }else + { + this.searchForm.value.pd_status = []; + } + + this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd'); + this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd'); + + this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=> + { + this.xpandStatus = false; + if(res['dataStatus']==true) + { + this.dataSourceTab2 = res['records']; + }else{ + // this.notifier.notify('warning', 'No Records Found'); + this.dataSourceTab2 = this.tempStore; + } + }) + } } 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 0153e37cc..869792c14 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 @@ -1,4 +1,64 @@ + + + +
filter_list Filter
+
+ +
+ +
+ + + {{type.type_name}} + +     + + + {{status.pd_status_name}} + + + + + + +     + + + + + + + + {{pro.name}} + +     + + + {{city.name}} + +     + + + {{ent.full_name}} + + + + +     + + + +
+ +
+
+ +
+
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 360ca9a6f..b2de54cbf 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 @@ -1,6 +1,8 @@ -import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; import { PdTrigerService } from './../../../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-qc-completed-pd', @@ -11,21 +13,31 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m }) export class QcCompletedPdComponent implements OnInit, OnChanges { + xpandStatus: boolean = false; + PRODUCTS: any; + ENTITY: any; + CITY: any; + PDType: any; + pdStatus: any; recordStatus: boolean; - errorMessage:any[]=[]; - tabStatus:string="QC_COMPLETED"; + errorMessage: any[] = []; + tabStatus: string = "QC_COMPLETED"; + pipe = new DatePipe('en-US'); + public dataLengthTab5: number; public dataSourceTab5 = new MatTableDataSource(); - displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action']; + tempStore = new MatTableDataSource(); + searchForm: FormGroup; + displayedColumns = ['PDType', 'Name', 'Lenderid', 'Address', 'Status', 'Action']; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; - + @Input() bindFilterValue: string; @Output() loadPdView = new EventEmitter(); // data source variable details - qcCompletedPdListData:any[] = []; + qcCompletedPdListData: any[] = []; // pagination variable details length = 50; @@ -33,12 +45,26 @@ export class QcCompletedPdComponent implements OnInit, OnChanges { pageSize = 10; pageEvent: PageEvent; - constructor(private _pd: PdTrigerService) { - } + constructor(private _pd: PdTrigerService, public _fb: FormBuilder) { + + this.searchForm = this._fb.group( + { + pd_type: [null], + pd_status: [null], + pd_from_date: [null], + pd_to_date: [null], + pd_city: [null], + pd_products: [null], + pd_lender: [null], + pd_name: [null], + pd_applicant_id: [null], + }); + } ngOnInit() { - this.recordStatus=false; - // this.loadPDDetails(); + this.recordStatus = false; + // this.loadPDDetails(); + this.getcommonDropDown(); } ngAfterViewInit() { this.dataSourceTab5.paginator = this.paginator; @@ -51,39 +77,105 @@ export class QcCompletedPdComponent implements OnInit, OnChanges { filteredText = filteredText ? filteredText.trim() : filteredText; filteredText = filteredText ? filteredText.toLowerCase() : filteredText; this.dataSourceTab5.filter = filteredText; -} + } -// load inprogress pd list + // load inprogress pd list loadPDDetails() { this._pd.getTabStatusPdDetails(this.tabStatus) - .subscribe( + .subscribe( data => { if (data.status == 200) { this.qcCompletedPdListData = data.records; this.dataLengthTab5 = data.records.length; this.dataSourceTab5.data = this.qcCompletedPdListData; - + this.tempStore.data = this.qcCompletedPdListData; } - else{ - this.qcCompletedPdListData=[]; - this.dataLengthTab5= null; - this.recordStatus=true; + else { + this.qcCompletedPdListData = []; + this.dataLengthTab5 = null; + this.recordStatus = true; } - }, error => this.errorMessage = error); + }, error => this.errorMessage = error); } pageChange(e) { console.log(e); } - viewPD(pdid:string){ + viewPD(pdid: string) { this.loadPdView.next(pdid); } - titleCaseWord(word:string) { + titleCaseWord(word: string) { if (!word) return word; return word[0].toUpperCase() + word.substr(1).toLowerCase(); } + /** + * Common Search + * sriram + */ + + getcommonDropDown() { + this._pd.getAllMasterDatas('PDSTATUS').subscribe(res => { + if (res.dataStatus == true) { + this.pdStatus = res.records.filter(status => status.isactive == 1 && status.pd_status_name == this.tabStatus); + // this.searchForm.controls['pd_status'].setValue(this.pdStatus[0]); + } + }); + + this._pd.getAllMasterDatas('PDTYPE').subscribe(res => { + if (res.dataStatus == true) { + this.PDType = res.records.filter(type => type.isactive == 1); + } + }); + this._pd.getAllMasterDatas('CITY').subscribe(res => { + if (res.dataStatus == true) { + this.CITY = res.records.filter(city => city.isactive == 1); + } + }); + this._pd.getAllMasterDatas('ENTITY').subscribe(res => { + if (res.dataStatus == true) { + this.ENTITY = res.records.filter(ent => ent.isactive == 1); + } + }); + this._pd.getAllMasterDatas('PRODUCTS').subscribe(res => { + if (res.dataStatus == true) { + this.PRODUCTS = res.records.filter(pro => pro.isactive == 1); + } + }); + } + checkDate(e) { + console.log(e); + } + searchItem() { + + if (this.searchForm.value.pd_type != null) { + + } else { + this.searchForm.value.pd_type = []; + } + + if (this.searchForm.value.pd_status != null) { + + } else { + this.searchForm.value.pd_status = []; + } + + this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date, 'yyyy-MM-dd'); + this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date, 'yyyy-MM-dd'); + + this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res => { + this.xpandStatus = false; + if (res['dataStatus'] == true) { + this.dataSourceTab5 = res['records']; + } else { + console.log('else'); + // this.notifier.notify('warning', 'No Records Found'); + this.dataSourceTab5 = this.tempStore; + } + }) + } + } 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 186a64ad6..776b9a9c0 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 @@ -1,4 +1,64 @@ + + + +
filter_list Filter
+
+ +
+ +
+ + + {{type.type_name}} + +     + + + {{status.pd_status_name}} + + + + + + +     + + + + + + + + {{pro.name}} + +     + + + {{city.name}} + +     + + + {{ent.full_name}} + + + + +     + + + +
+ +
+
+ +
+
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 d6c030214..299a747e5 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 @@ -1,6 +1,8 @@ import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core'; import { PdTrigerService } from './../../../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-scheduled-pd', @@ -9,11 +11,20 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m encapsulation: ViewEncapsulation.None }) export class ScheduledPdComponent implements OnInit, OnChanges { + xpandStatus: boolean = false; + PRODUCTS: any; + ENTITY: any; + CITY: any; + PDType: any; + pdStatus: any; recordStatus: boolean; errorMessage:any[]=[]; tabStatus:string="SCHEDULED"; + pipe = new DatePipe('en-US'); + searchForm:FormGroup; public dataLengthTab3: number; public dataSourceTab3 = new MatTableDataSource(); + tempStore = new MatTableDataSource(); displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action']; @ViewChild(MatPaginator) paginator: MatPaginator; @@ -31,12 +42,26 @@ export class ScheduledPdComponent implements OnInit, OnChanges { pageSize = 10; pageEvent: PageEvent; - constructor(private _pd: PdTrigerService) { + constructor(private _pd: PdTrigerService,public _fb:FormBuilder) { + + this.searchForm = this._fb.group( + { + pd_type:[null], + pd_status:[null], + pd_from_date:[null], + pd_to_date:[null], + pd_city:[null], + pd_products:[null], + pd_lender:[null], + pd_name:[null], + pd_applicant_id:[null], + }); } ngOnInit() { this.recordStatus=false; // this.loadPDDetails(); + this.getcommonDropDown(); } ngAfterViewInit() { this.dataSourceTab3.paginator = this.paginator; @@ -61,6 +86,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges { this.scheduledPdListData = data.records; this.dataLengthTab3 = data.records.length; this.dataSourceTab3.data = this.scheduledPdListData; + this.tempStore.data = this.scheduledPdListData } else{ @@ -81,7 +107,89 @@ export class ScheduledPdComponent implements OnInit, OnChanges { if (!word) return word; return word[0].toUpperCase() + word.substr(1).toLowerCase(); } +/** + * Common Search + * sriram + */ + getcommonDropDown() + { + this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.pdStatus = res.records.filter(status=>status.isactive==1 && status.pd_status_name==this.tabStatus); + // this.searchForm.controls['pd_status'].setValue(this.pdStatus[0]); + } + }); + + this._pd.getAllMasterDatas('PDTYPE').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PDType = res.records.filter(type=>type.isactive==1); + } + }); + this._pd.getAllMasterDatas('CITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.CITY = res.records.filter(city=>city.isactive==1); + } + }); + this._pd.getAllMasterDatas('ENTITY').subscribe(res=> + { + if(res.dataStatus==true) + { + this.ENTITY = res.records.filter(ent=>ent.isactive==1); + } + }); + this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=> + { + if(res.dataStatus==true) + { + this.PRODUCTS = res.records.filter(pro=>pro.isactive==1); + } + }); + } + checkDate(e) + { + console.log(e); + } + searchItem() + { + + if(this.searchForm.value.pd_type !=null) + { + + }else + { + this.searchForm.value.pd_type = []; + } + + if(this.searchForm.value.pd_status !=null) + { + + }else + { + this.searchForm.value.pd_status = []; + } + + this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd'); + this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd'); + + this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=> + { + this.xpandStatus = false; + if(res['dataStatus']==true) + { + this.dataSourceTab3 = res['records']; + }else{ + // this.notifier.notify('warning', 'No Records Found'); + this.dataSourceTab3 = this.tempStore; + } + }) + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 17dce719b..342fb2374 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -15,7 +15,7 @@ import { MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule, - MatMenuModule, MatButtonToggleModule, + MatMenuModule, MatButtonToggleModule,MatChipsModule, MatAutocompleteModule, MatDatepickerModule } from '@angular/material'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; @@ -273,6 +273,7 @@ const pdCustomNotifierOptions: NotifierOptions = { PdfViewerModule, MatCardModule, MatIconModule, + MatAutocompleteModule, MatInputModule, MatRadioModule, MatTableModule, @@ -282,6 +283,7 @@ const pdCustomNotifierOptions: NotifierOptions = { MatToolbarModule, FlexLayoutModule, NgxDatatableModule, + MatChipsModule, FormsModule,MatSlideToggleModule, MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule, ReactiveFormsModule, 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 f281ec28c..9f45d2ea7 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 @@ -422,4 +422,17 @@ convertNumberToWords(amount) { // return of(result as T); // }; // } + + /**Search Filter + * Sriram + */ + + overAllSearchFormDetails(searchItem) + { + let records = {'records':searchItem}; + return this._http.post(this.apiUrl+'filterPDList',records).pipe( + catchError(this.handleError('operation', [])) + ); + } + } diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.html old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.scss old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.ts old mode 100644 new mode 100755