diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json
index 84421458a..20045553b 100755
--- a/ng6-seed/package-lock.json
+++ b/ng6-seed/package-lock.json
@@ -4352,12 +4352,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"
@@ -4372,17 +4374,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",
@@ -4499,7 +4504,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -4511,6 +4517,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "1.0.1"
}
@@ -4525,6 +4532,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "1.1.11"
}
@@ -4532,12 +4540,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.2"
@@ -4556,6 +4566,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -4636,7 +4647,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -4648,6 +4660,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1.0.2"
}
@@ -4769,6 +4782,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
@@ -7321,6 +7335,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",
@@ -10703,6 +10725,11 @@
"extsprintf": "1.3.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/package.json b/ng6-seed/package.json
index 3133d2be8..8ebe4b5c7 100755
--- a/ng6-seed/package.json
+++ b/ng6-seed/package.json
@@ -58,6 +58,7 @@
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mat-select-search": "^1.3.1",
"ngx-perfect-scrollbar": "5.0.0-7",
+ "ngx-viewer": "^1.0.1",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.2.0",
"rxjs": "^6.3.1",
@@ -67,6 +68,7 @@
"sortablejs": "^1.6.0",
"sweetalert2": "^7.28.4",
"tether": "^1.4.0",
+ "viewerjs": "^1.3.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html
index c77268923..32e8a812f 100755
--- a/ng6-seed/src/app/dashboard/dashboard.component.html
+++ b/ng6-seed/src/app/dashboard/dashboard.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/ng6-seed/src/app/dashboard/dashboard.component.scss b/ng6-seed/src/app/dashboard/dashboard.component.scss
index b76a73e1f..540704696 100755
--- a/ng6-seed/src/app/dashboard/dashboard.component.scss
+++ b/ng6-seed/src/app/dashboard/dashboard.component.scss
@@ -19,6 +19,7 @@ li
display:inline-block;
//float:left;
}
+
.example-full-width {
width: 95%;
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 fdccd4b38..43e2b6a27 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
@@ -16,18 +16,27 @@
-
-
-
- Select
-
-
- {{LL.full_name}}
-
-
-
-
-
+
+
+
+ Select
+
+
+ {{LL.full_name}}
+
+
+
+
+
+
+
+ Select
+
+
+ {{LB.branch_name}}
+
+
+
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 26eef3002..8db401982 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
@@ -25,6 +25,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
productList:any;
subProductList:any;
lenderList:any;
+ lenderBranchList: any;
customerSegmentList:any;
stateList:any;
cityList:any;
@@ -62,6 +63,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
loadFormData(){
this._PDtriggerForm = this._fb.group({
fk_lender_id: [null],
+ pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [null, Validators.compose([Validators.required])],
lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])],
@@ -92,6 +94,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
});
}
+ 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(){
this._pd.getLenderDetails().subscribe(
data => {
@@ -358,6 +368,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
let pd_details:any={
"fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id,
+ "pd_branch_id":formValue.pd_branch_id,
"pd_contact_person":formValue.lender_contact_person,
"pd_contact_mobileno":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id,
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 @@
-
- 0" >
-
-
+
+
+
+
+
+ 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}}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+ 0">
+
+
+
+
+
+
+ {{(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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0" >
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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0" >
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/list-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
index 718444dc0..4d90d020c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss
index 123db6e6c..fda61348d 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss
@@ -20,4 +20,8 @@
}
.mat-tab-label-active{
color: red !important;
- }
\ No newline at end of file
+ }
+ .mat-fab.mat-accent{
+ color:red !important;
+ background-color: #fff !important;
+ }
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html
index 8a6caf518..f8b2e10b0 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html
@@ -1,5 +1,5 @@
-
+
@@ -10,7 +10,7 @@
-
+
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 a82a775da..946913656 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
@@ -43,20 +43,35 @@
-
-
-
-
-
-
-
-
- --
-
- {{ pd.doc_name }} ( Current Version )
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{message}}
+
+
+
+
+
+
-
+
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 e69de29bb..7f50479c8 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
@@ -0,0 +1,119 @@
+@import "./../../../../../assets/styles/scss/components/messages";
+:host {
+ margin-left: -5px;
+ margin-right: -5px;
+ margin-top: -5px;
+ display: block;
+}
+:host /deep/ {
+ mat-sidenav {
+ width: 267px;
+ }
+ .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);
+ }
+
+
+ }
+ }
+ }
+
+}
+
+
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 f773a14ba..83f222a13 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
@@ -32,6 +32,7 @@ export class PdReportComponent implements OnInit {
// public src;
pdReportRecords:any;
latestPDDetails: any;
+ message:any;
private notifier: NotifierService;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
@@ -52,8 +53,38 @@ export class PdReportComponent implements OnInit {
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,
@@ -97,6 +128,7 @@ export class PdReportComponent implements OnInit {
} else {
// this.reGenerateBtn = true;
this.generateBtn = true;
+ this.message= data.msg;
}
}, err=> {
@@ -139,6 +171,7 @@ export class PdReportComponent implements OnInit {
changeVersion(pd : any): void {
this.latestPDDetails = pd;
+ console.log(this.latestPDDetails);
}
changeDocumentEdit() : void{
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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0" >
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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0" >
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/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html
index 4ebefbf78..78a36ac59 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html
@@ -22,7 +22,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
@@ -48,7 +48,7 @@
+ formControlName="locality_others" autocomplete="off">
@@ -87,11 +87,11 @@
-
+
-
+
@@ -102,35 +102,39 @@
-
+
-
+
+ Type of Premises
+
+
+ {{at.address_type}}
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts
index 012c0ad57..0db065a3e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts
@@ -25,7 +25,7 @@ import {ActivatedRoute, Router} from "@angular/router";
selector: 'app-address',
templateUrl: './address.component.html',
styleUrls: ['./address.component.scss'],
- encapsulation: ViewEncapsulation.None
+ encapsulation: ViewEncapsulation.None
})
@@ -50,12 +50,13 @@ export class AddressComponent implements OnInit {
ownerShipData:any = [];
cityData:any = [];
-
-
z = 0;
formPremisesArray: any = [];
- relativeNames2: any = [];
+ formPremisesCityArray: any = [];
+ additional_premises: any=[];
+ bussiness_address_type: any=[];
+ tempArr: any[];
//neighbourStatusData:any=["Yes","No"];
//applicantOwnerData:any=["Yes","No","Dont Know"];
@@ -96,13 +97,15 @@ export class AddressComponent implements OnInit {
this.getMasterDetails('RESIDENCEOWNERSHIP',6);
this.getMasterDetails('CITY',7);
this.initAddressForm();
+
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '5';
+
this._pd.retriveForm(params).subscribe(data => {
console.log('data', data);
//const control = this.addressForm.controls['neighbourhood'];
- const control = this.addressForm.controls['premises'];
+ const additionalPremisesControl = this.addressForm.controls['additional_premises'];
if(data.status == 200) {
// var result = Object.keys(data.records.neighbourhood).map(function (key) {
// return data.records.neighbourhood[key];
@@ -111,55 +114,91 @@ export class AddressComponent implements OnInit {
this.addressForm.controls.address.setValue(data.records.address);
this.addressForm.controls.pd_location.setValue(data.records.pd_location);
this.addressForm.controls.address_type.setValue(data.records.address_type);
+
if(data.records.address_type == 12) {
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
}
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
- // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
+ // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
this.addressForm.controls.locality.setValue(data.records.locality);
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
this.addressForm.controls.address_ownership.setValue(data.records.address_ownership);
this.addressForm.controls.other_ownership.setValue(data.records.other_ownership);
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
- if(data.records.bussiness_activity == 'yes') {
- let selectedMembers = Object.keys(data.records.bussiness_address_type).map(function (key) {
- return data.records.bussiness_address_type[key];
- });
+
+ // if(data.records.bussiness_activity == 'yes') {
+
+ // this.bussiness_address_type = [];
- let enduse: any = [];
- let existPremises: any =[];
+ // this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
+ // {
+ // return data.records.bussiness_address_type[key].premises_types;
+ // }))
- selectedMembers.forEach(val => {
- enduse.push(val.premises);
- existPremises.push(val);
- });
+ // // console.log(bussiness_address_type);
+
- this.formPremisesArray = existPremises;
+ // let selectedPremisesDBData = Object.keys(data.records.bussiness_address_type).map(function (key) {
+ // return data.records.bussiness_address_type[key];
+ // });
- this.addressForm.controls.bussiness_address_type.setValue(enduse);
+ // let enduse: any = [];
+ // let existPremises: any =[];
+
+ // selectedPremisesDBData.forEach(val => {
+ // enduse.push(val.premises_types);
+ // existPremises.push(val);
+ // });
+
+ // this.formPremisesArray = existPremises;
+
+
+ // this.addressForm.controls.bussiness_address_type.setValue(enduse);
- var result = Object.keys(data.records.premises).map(function (key) {
- return data.records.premises[key];
- });
+ // var additionalPremisesResult = Object.keys(data.records.additional_premises).map(function (key) {
+ // return data.records.additional_premises[key];
+ // });
- if (result.length == 0) {
- control.push(this.createPremises());
- } else {
- result.forEach(datas => {
- control.push(this.createPremises());
- });
- }
+ // this.additional_premises = additionalPremisesResult;
- this.addressForm.controls['premises'].setValue(result);
+ // if (additionalPremisesResult.length == 0) {
+ // additionalPremisesControl.push(this.createPremises());
+ // } else {
+ // additionalPremisesResult.forEach(datas => {
+ // additionalPremisesControl.push(this.createPremises());
+ // });
+ // }
+
+
+ // if(data.records.bussiness_address_type == 12) {
+ // this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others);
+ // }
+ // }
+
+ if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
+ let that = this;
+ this.bussiness_address_type = [];
+
+ this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
+ {
+ return data.records.bussiness_address_type[key].premises_types;
+ }))
- if(data.records.bussiness_address_type == 12) {
- this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others);
- }
+ this.additional_premises = Object.keys(data.records.additional_premises).map(function(key)
+ {
+ return data.records.additional_premises[key];
+ })
+
}
+ console.log(this.bussiness_address_type);
+ console.log(this.additional_premises);
+
+ this.selectedValue(this.bussiness_address_type,this.additional_premises);
if (data.records.locality_others) {
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
}
+
// if (result.length == 0) {
// control.push(this.createNeighbour());
// } else {
@@ -173,6 +212,7 @@ export class AddressComponent implements OnInit {
}
});
}
+
public initAddressForm(): void {
this.addressForm = this.fb.group({
address: ['', Validators.compose([Validators.required])],
@@ -191,7 +231,7 @@ export class AddressComponent implements OnInit {
bussiness_activity:[''],
bussiness_address_type:[''],
bussiness_address_type_others: [''],
- premises: this.fb.array([])
+ additional_premises: this.fb.array([])
});
this.address = this.addressForm.controls['address'];
this.addressType = this.addressForm.controls['address_type'];
@@ -251,6 +291,25 @@ export class AddressComponent implements OnInit {
})
});
}
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
/*221118 review doc s.no 3.f
addNeighbour() {
const control = this.addressForm.controls['neighbourhood'];
@@ -297,82 +356,236 @@ export class AddressComponent implements OnInit {
records.bussiness_address_type_others = this.addressForm.controls.bussiness_address_type_others.value;
}
}
-
- records.premises = this.addressForm.controls.premises.value;
-
- console.log(this.addressForm.controls.premises.value);
+ this.addressForm.controls.additional_premises.value.forEach((val,index)=>
+ {
+ console.log(val);
+ if(val.premises_city != ''){
+ this.formPremisesCityArray = [];
+ val.premises_city.forEach(option => {
+ this.formPremisesCityArray.push({additional_premises_city: option});
+ this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray;
+ // console.log(val);
+ });
+ }
+ else{
+ this.formPremisesCityArray = [];
+
+ this.addressForm.controls.additional_premises.value[index].premises_city = null;
+
+ }
+ });
+
+ records.additional_premises = this.addressForm.controls.additional_premises.value;
+ // console.log(this.formPremisesCityArray);
+ // console.log(this.addressForm.controls.premises.value);
records.pdid = this.pdid;
records.formid = '5';
// records.fk_createdby = '250';
console.log('params', records);
+
this._pd.saveForm(records).subscribe(data => {
console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.');
-
- }, error => {
+ }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
- });
- }
-
- relationChanged(event) {
- this.relativeNames2 = [];
- event.value.forEach(option => {
- this.relativeNames2.push({city: option});
});
}
+ // relationChanged(event) {
+ // this.formPremisesCityArray = [];
+ // event.value.forEach(option => {
+ // this.formPremisesCityArray.push({city: option});
+ // });
+ // }
SelectedPremises($event){
let premisesData = $event.source.value;
-
-
- if($event.source._selected === true ){
-
+ console.log(premisesData);
+
+ if($event.checked === true ){
+
//this.formPremisesArray.push({member: $event.source.value});
//this.selectedSegmentDatas.push(CustomerSegmentName.name);
//console.log('true',premisesData);
-
+
//console.log(this.formPremisesArray);
-
- this.formPremisesArray.push({premises: $event.source.value});
-
- //console.log(this.formPremisesArray);
-
- let array = this.addressData.filter(data => data.address_type_id == premisesData);
-
+
+ this.formPremisesArray.push({premises_types: $event.source.value});
+
+ console.log(this.formPremisesArray);
+ const control = this.addressForm.controls['additional_premises'];
+ let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
+ console.log(array);
if(premisesData == 12){
this.PremisesOtherFlag = true;
- this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value;
+ // this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
+ control.push(this.createPremises());
+
}
else{
- this.PremisesLabel[this.z] = array[0].address_type;
- }
- this.z++;
-
-
- const control = this.addressForm.controls['premises'];
+ this.PremisesLabel[this.z] = array.address_type;
control.push(this.createPremises());
-
-
+
+ }
+ console.log(this.PremisesLabel);
+ this.z++;
+
+
+
+
+
}
- else if($event.source._selected === false ){
-
- console.log('false',premisesData);
-
+ else if($event.checked === false ){
if(premisesData == 12){
this.PremisesOtherFlag = false;
}
-
- const control = this.addressForm.controls['neighbourhood'];
- control.removeAt(this.z);
+ console.log(this.formPremisesArray);
+ let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
+ console.log(index);
+ const control = this.addressForm.controls['additional_premises'];
+ control.removeAt(index);
+ this.PremisesLabel.splice(index,1);
+ console.log(this.z);
this.z--;
- //let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
- //this.selectedSegmentDatas.splice(index,1);
}
+
+ }
+
+ getCity(e)
+ {
+ this.cityData = [];
+ e.forEach(val=>
+ {
+ this.cityData.push({additional_premises_city:val});
+ });
+ console.log(this.cityData);
+ }
+ otherValueset()
+ {
+ let z = this.z;
+ this.PremisesLabel[z-1] = this.addressForm.get('bussiness_address_type_others').value;
+ }
+// checkaddress(value)
+// {
+// // console.log(value);
+// if(value=="OTHERS")
+// {
+// this.addressRemarksAccess = true;
+// }else
+// {
+// this.addressRemarksAccess = false;
+// }
+// }
+
+
+ // SelectedPremises($event){
+ // console.log('event',$event);
+
+ // let premisesData = $event.source.value;
+
+
+ // if($event.source._selected === true ){
+
+ // //this.formPremisesArray.push({member: $event.source.value});
+ // //this.selectedSegmentDatas.push(CustomerSegmentName.name);
+ // //console.log('true',premisesData);
+
+ // //console.log(this.formPremisesArray);
+
+ // this.formPremisesArray.push({premises_types: $event.source.value});
+
+ // //console.log(this.formPremisesArray);
+
+ // let array = this.addressData.filter(data => data.address_type_id == premisesData);
+ // if(premisesData == 12){
+ // this.PremisesOtherFlag = true;
+ // this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value;
+ // }
+ // else{
+ // this.PremisesLabel[this.z] = array[0].address_type;
+ // }
+ // this.z++;
+
+
+ // const control = this.addressForm.controls['additional_premises'];
+ // control.push(this.createPremises());
+
+
+
+ // }
+ // else if($event.source._selected === false ){
+
+ // console.log('false',premisesData);
+
+
+ // if(premisesData == 12){
+ // this.PremisesOtherFlag = false;
+ // }
+
+ // const control = this.addressForm.controls['additional_premises'];
+ // control.removeAt(this.z);
+ // this.z--;
+ // //let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
+ // //this.selectedSegmentDatas.splice(index,1);
+ // }
+
+ // }
+
+ selectedValue(e,data)
+ {
+ console.log('501 function',);
+ console.log('inside function in bussiness_address_type,',e);
+ console.log('inside function in this.additional_premises,',data);
+
+ let premisesData = e ;
+ this.tempArr = [];
+ let that = this;
+ this.addressData = Object.keys(this.addressData).map(function(key)
+ {
+ that.addressData[key].status = 0;
+ return that.addressData[key];
+ })
+ console.log(this.addressData);
+ premisesData.forEach((val,index)=>
+ {
+ console.log(val);
+ this.z++;
+ // console.log(this.addressTypes);
+ this.formPremisesArray.push({premises_types: val});
+
+ this.tempArr.push(this.addressData.filter(add=>add.address_type_id==val)[0]);
+
+ this.PremisesLabel[index] = this.tempArr[index].address_type;
+
+ if(data[index] !==undefined && data[index].premises_ownership < 2 ){
+ data[index].premises_city = Object.keys(data[index].premises_city).map(function(key)
+ {
+ return data[index].premises_city[key].additional_premises_city;
+ });
+ }
+ this.addressData.forEach(data=>
+ {
+ if(data.address_type_id == val)
+ {
+ data.status = 1;
+ }
+ });
+
+ });
+
+ const control = this.addressForm.controls['additional_premises'] as FormArray;
+
+ // control.removeAt(0);
+ this.tempArr.forEach((item,index)=>
+ {
+ control.push(this.createPremises());
+ });
+
+ this.addressForm.controls['additional_premises'].setValue(data);
}
validateAllFormFields(formGroup: FormGroup) {
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html
index 91eced0f1..206bbfe1e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html
@@ -280,112 +280,98 @@
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
index ab69d07d0..a7befa72d 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
@@ -48,6 +48,9 @@ tr.mat-footer-row {
mat-form-field {
margin: 0 2%;
}
+ ::ng-deep .cdk-global-overlay-wrapper{
+ justify-content: center !important;
+}
$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 {
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
index d65a250c7..f8a6e5b87 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
@@ -53,7 +53,25 @@ salesMonthWiseExpandedItems: any=[]
this.notifier = notifier;
this.form_id = 16;
}
-
+public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
this.initAssessedIncomeForm();
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
index 092096a10..0571707b9 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
@@ -14,7 +14,307 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ asset.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ prop.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ freqn.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1" (click)="removeLanguage(i,2)">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -29,7 +329,7 @@
@@ -64,7 +364,7 @@
@@ -78,7 +378,7 @@
@@ -92,7 +392,7 @@
@@ -128,7 +428,7 @@
-->
-
+
@@ -140,14 +440,14 @@
-
+
@@ -161,7 +461,7 @@
-
+
{{ ins_type.name }}
@@ -169,18 +469,22 @@
-
-
-
-
-
+
-
+
+
+
+
+
+
+
-
+
+
@@ -195,10 +499,10 @@
@@ -221,23 +527,49 @@
-
+
-
+
+
+
+
+
+ {{owner.applicant_name}}
+
+
+
-
+
+
+
+
+
+
+
+
+
+ {{relations.name}}
+
+
+
+
+
+
+
+
- 1" (click)="removeLanguage(i)">
+ 1" (click)="removeLanguage(i,1)">
@@ -292,10 +630,7 @@
-
-
-
+ class="mr-1 mb-1 hover-icon" (click)="addSupplierDetails($event,1); false">add
@@ -306,125 +641,111 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
Remarks
-
+
@@ -432,4 +753,7 @@
-
\ 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/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
index 47119531b..4304d3314 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
@@ -35,6 +35,9 @@ export class AssetsInfoComponent implements OnInit {
public _assetsQuesFrom: FormGroup;
public submitted = false;
public m_assets_type = [];
+ public m_relation = [];
+ public applicants: any;
+
// public m_assets_type = [
// {
// 'id': "1",
@@ -167,10 +170,30 @@ public m_investmentType = [];
private pdTrigerService: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.applicants = this.pd_all_details.pdapplicants_detials;
+ this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier;
}
-
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
@@ -180,6 +203,7 @@ public m_investmentType = [];
this.getM_PropertyType();
this.getM_InvestmentType();
this.getM_FreqOfPurchase();
+ this.getM_Relation();
//this.getM_InsuranceType();
}
@@ -221,7 +245,18 @@ public m_investmentType = [];
)
}
- getM_FreqOfPurchase() {
+ getM_Relation() {
+ this.pdTrigerService.getAllMasterDatas('RELATIONSHIPS').subscribe(
+ data => {
+ this.m_relation = data.records.filter(data => data.isactive == 1);
+ },
+ error => {
+ this.notifier.notify('warning', 'No Category Records Found.!');
+ }
+ )
+ }
+
+ getM_FreqOfPurchase() {
this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
data => {
this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1);
@@ -274,9 +309,11 @@ public m_investmentType = [];
assets_details: this._formBuilder.array([
// this.initDetails(),
]),
+ business_assets_details : this._formBuilder.array([]),
assets_form_remark:[value.assets_form_remark || 'check']
});
this.addAssetsDetailsWithData(value.assets_details);
+ this.addBusinessAssetsDetailsWithData(value.business_assets_details);
} else {
this._assetsQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
@@ -284,6 +321,9 @@ public m_investmentType = [];
assets_details: this._formBuilder.array([
this.initDetails(),
]),
+ business_assets_details : this._formBuilder.array([
+ this.initBusinessDetails(),
+ ]),
assets_form_remark:['']
});
}
@@ -304,60 +344,98 @@ public m_investmentType = [];
details: this._formBuilder.array([]),
approximate_market_value: ['', Validators.compose([])],
name_of_the_owner: ['', Validators.compose([])],
+ other_owner:[''],
+ relation: [''],
// purchase_year: ['', Validators.compose([])],
//purchase_month: ['', Validators.compose([])],
emi: [''],
emi_paid: [''],
+ original_loan_tenure: [''],
+ balance_tenure: [''],
elapsed_tenure: [''],
- balance_tenure: ['']
});
}
+ initBusinessDetails() {
+ return this._formBuilder.group({
+ business_assets_mode: ['', Validators.compose([Validators.required])],
+ business_details: this._formBuilder.array([]),
+ business_approximate_market_value: ['', Validators.compose([])],
+ business_name_of_the_owner: ['', Validators.compose([])],
+ // other_owner:[''],
+ // relation:[''],
+ // purchase_year: ['', Validators.compose([])],
+ //purchase_month: ['', Validators.compose([])],
+ business_emi: [''],
+ business_emi_paid: [''],
+ business_original_loan_tenure: [''],
+ business_balance_tenure: [''],
+ business_elapsed_tenure: [''],
+ });
+ }
show: boolean;
- selectedAssetsType(e: any, i: any): void {
+ selectedAssetsType(e: any, i: any,flag : any): void {
+ console.log(e);
+ console.log(i);
+ console.log(flag);
let val = i;
- const arr = (
this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- arr.controls.splice(0);
+ if(flag == 1){
+ const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ arr.controls.splice(0);
+ }
+ else if(flag == 2){
+ const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
+ arr.controls.splice(0);
+ }
+
switch (e.value) {
case '1': {
let val = i;
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadProperty());
break;
}
case '2': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.load_Four_Weeler());
break;
}
case '3': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.load_Two_Weeler());
break;
}
case '4': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
//control.push(this.loadJwellDescription());
break;
}
case '5': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadConsumerDurableDescription());
break;
}
case '6': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInsuranceDescription());
break;
}
case '7': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInvestDescription());
break;
}
case '8': {
- const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
+ const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
+ : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('details') as FormArray ;
control.push(this.otherAssetsDescription());
break;
}
@@ -400,25 +478,25 @@ public m_investmentType = [];
loadInsuranceDescription() {
return this._formBuilder.group({
//insurance_type: ['', Validators.compose([Validators.required])],
- premium_paid: ['', Validators.compose([Validators.required])],
- frequency_mode: ['', Validators.compose([Validators.required])],
- sum_assured: ['', Validators.compose([Validators.required])],
- members_coverd: ['', Validators.compose([Validators.required])]
+ premium_paid: ['', Validators.compose([])],
+ frequency_mode: ['', Validators.compose([])],
+ sum_assured: ['', Validators.compose([])],
+ members_coverd: ['', Validators.compose([])]
});
}
loadInvestDescription() {
return this._formBuilder.group({
- investments_type: ['', Validators.compose([Validators.required])],
- other_investment_type:[''],
- amount_of_invest: ['', Validators.compose([Validators.required])],
- bank_name: ['', Validators.compose([Validators.required])]
+ investments_type: ['', Validators.compose([])],
+ other_investments_type:[''],
+ amount_of_invest: ['', Validators.compose([])],
+ bank_name: ['', Validators.compose([])]
});
}
load_Four_Weeler() {
return this._formBuilder.group({
- manufacturer_model_four_weeler: ['', Validators.compose([Validators.required])]
+ manufacturer_model_four_weeler: ['', Validators.compose([])]
});
}
@@ -433,6 +511,14 @@ public m_investmentType = [];
loadPropertyWithData(data) {
return this._formBuilder.group({
property_type: [data.property_type, Validators.compose([Validators.required])]
+ //property_type:['']
+ });
+ }
+
+ loadPropertyWithData2(data) {
+ return this._formBuilder.group({
+ property_type: [data.property_type, Validators.compose([Validators.required])]
+ //property_type:['']
});
}
@@ -496,16 +582,37 @@ public m_investmentType = [];
details: this._formBuilder.array([]),
approximate_market_value: [data.approximate_market_value, Validators.compose([])],
name_of_the_owner: [data.name_of_the_owner, Validators.compose([])],
+ other_owner:[data.other_owner || ''],
+ relation: [data.relation || ''],
// purchase_year: [data.purchase_year, Validators.compose([])],
// purchase_month: [data.purchase_month, Validators.compose([])],
emi: [data.emi || 0],
emi_paid: [data.emi_paid || ''],
- elapsed_tenure: [data.elapsed_tenure || ''],
- balance_tenure: [data.balance_tenure || '']
+ original_loan_tenure: [data.original_loan_tenure || ''],
+ balance_tenure: [data.balance_tenure || ''],
+ elapsed_tenure: [data.elapsed_tenure || '']
+ });
+ }
+ initBusinessDetailsWithdata(data) {
+ return this._formBuilder.group({
+ business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])],
+ business_details: this._formBuilder.array([]),
+ business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])],
+ business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])],
+ // other_owner:[data.other_owner || ''],
+ // relation: [data.relation || ''],
+ // purchase_year: [data.purchase_year, Validators.compose([])],
+ // purchase_month: [data.purchase_month, Validators.compose([])],
+ business_emi: [data.business_emi || 0],
+ business_emi_paid: [data.business_emi_paid || ''],
+ business_original_loan_tenure: [data.business_original_loan_tenure || ''],
+ business_balance_tenure: [data.business_balance_tenure || ''],
+ business_elapsed_tenure: [data.business_elapsed_tenure || '']
});
}
loadDetails: boolean;
addAssetsDetailsWithData(supp_data) {
+ console.log(supp_data);
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
@@ -515,10 +622,13 @@ public m_investmentType = [];
assets_mode: val.assets_mode,
approximate_market_value: val.approximate_market_value,
name_of_the_owner: val.name_of_the_owner,
+ other_owner:val.other_owner,
+ relation: val.relation,
// purchase_year: val.purchase_year,
// purchase_month: val.purchase_month,
emi: val.emi,
emi_paid: val.emi_paid,
+ original_loan_tenure: val.original_loan_tenure,
elapsed_tenure: val.elapsed_tenure,
balance_tenure: val.balance_tenure
};
@@ -530,6 +640,41 @@ public m_investmentType = [];
this.loadDetails = true;
}
+ addBusinessAssetsDetailsWithData(supp_data) {
+
+ console.log(supp_data);
+
+ var result = Object.keys(supp_data).map(function (key) {
+ return supp_data[key];
+ });
+ if (result.length > 0) {
+ for (let val of result) {
+ let vals = {
+ business_assets_mode: val.business_assets_mode,
+ business_approximate_market_value: val.business_approximate_market_value,
+ business_name_of_the_owner: val.business_name_of_the_owner,
+ // other_owner: val.other_owner,
+ // relation : val.relation,
+ // purchase_year: val.purchase_year,
+ // purchase_month: val.purchase_month,
+ business_emi: val.business_emi,
+ business_emi_paid: val.business_emi_paid,
+ business_original_loan_tenure: val.business_original_loan_tenure,
+ business_elapsed_tenure: val.business_elapsed_tenure,
+ business_balance_tenure: val.business_balance_tenure
+ };
+ // const control = this._assetsQuesFrom.controls['assets_details'];
+ // control.push(this.initDetailsWithdata(vals));
+ // this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1)
+
+ const control = this._assetsQuesFrom.controls['business_assets_details'];
+ control.push(this.initBusinessDetailsWithdata(vals));
+ this.setAssetsDetailsWithData2(vals.business_assets_mode, val.business_details, control.length - 1)
+ }
+ }
+ //this.loadDetails = true;
+ }
+
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i;
// var data = Object.keys(datas).map(function (key) {
@@ -539,6 +684,7 @@ public m_investmentType = [];
let data = datas;
const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
arr.controls.splice(0);
+
switch (assets_details_mode) {
case '1': {
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@@ -586,13 +732,76 @@ public m_investmentType = [];
}
}
- addSupplierDetails(e) {
+ setAssetsDetailsWithData2(assets_details_mode: any, datas: any, i: any): void {
+ let val = i;
+ let data = datas;
+ const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ arr.controls.splice(0);
+
+ switch (assets_details_mode) {
+ case '1': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.loadPropertyWithData2(data));
+ break;
+ }
+ case '2': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.load_Four_WeelerWithData(data));
+ break;
+ }
+ case '3': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.load_Two_WeelerWithData(data));
+ break;
+ }
+ case '4': {
+ break;
+ }
+ case '5': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.loadConsumerDurableDescriptionWithData(data));
+ break;
+ }
+ case '6': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.loadInsuranceDescriptionWithData(data));
+ break;
+ }
+ case '7': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.loadInvestDescriptionWithData(data));
+ break;
+ }
+ case '8': {
+ const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
+ control.push(this.otherAssetsDescriptionWithData(data));
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ addSupplierDetails(e,flag) {
+ console.log(flag);
+ console.log(e);
+ if(flag == 1){
const control = this._assetsQuesFrom.controls['assets_details'];
control.push(this.initDetails());
+ }else if(flag == 2){
+ const control = this._assetsQuesFrom.controls['business_assets_details'];
+ control.push(this.initBusinessDetails());
+ }
}
- removeLanguage(i: number) {
+ removeLanguage(i: number,flag) {
+ if(flag == 1){
const control = this._assetsQuesFrom.controls['assets_details'];
control.removeAt(i);
+ }else if(flag == 2){
+ const control = this._assetsQuesFrom.controls['business_assets_details'];
+ control.removeAt(i);
+ }
}
public paymentModeTextBox: number;
@@ -621,8 +830,19 @@ public m_investmentType = [];
answerFormValues.assets_details.map(val => {
if (val.emi == '0') {
val.emi_paid = '';
- val.elapsed_tenure = '';
+ val.original_loan_tenure = '';
val.balance_tenure = '';
+ val.elapsed_tenure = '';
+ }
+ });
+
+ //To Remove The "Null" With Key also
+ answerFormValues.business_assets_details.map(val => {
+ if (val.business_emi == '0') {
+ val.business_emi_paid = '';
+ val.business_original_loan_tenure = '';
+ val.business_balance_tenure = '';
+ val.business_elapsed_tenure = '';
}
});
@@ -664,6 +884,29 @@ public m_investmentType = [];
event.preventDefault();
}
}
+
+ loanCalc(details ,flag)
+ {
+ if(flag == 1){
+ //console.log(details.value);
+ let ElapsedValues;
+
+ if(details.value.original_loan_tenure != null && details.value.original_loan_tenure != '' && details.value.balance_tenure != null && details.value.balance_tenure != ''){
+ ElapsedValues = details.value.original_loan_tenure - details.value.balance_tenure ;
+ details.controls['elapsed_tenure'].setValue(ElapsedValues);
+ }
+ }
+ else if(flag == 2){
+ let BusinessElapsedValues;
+
+ if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
+ BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
+ details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
+ }
+ }
+
+ }
+
// {
// 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html
index bcdace6ad..7da90f6ca 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html
@@ -99,12 +99,12 @@
formControlName="applicant_name" required>
{{owner.applicant_name}}
- Others
+
-
+
+ formControlName="other_applicant" autocomplete="off">
-
+
Yes
@@ -151,7 +151,7 @@
+ formControlName="limit" (keypress)="keyPress($event)" required autocomplete="off">
-
+
-
+
@@ -192,116 +192,98 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts
index 885aba086..d80b9fcfd 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts
@@ -37,6 +37,7 @@ export class BankingDetailsComponent implements OnInit {
public applicants: any;
m_accountType= [];
m_btLenderList = [];
+ salaryField : boolean;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@@ -46,17 +47,38 @@ export class BankingDetailsComponent implements OnInit {
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
this.applicants = this.pd_all_details.pdapplicants_detials;
+ this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier;
}
-
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
this.step = 0;
this.initBankingForm();
this.getM_AccountType();
this.getM_BTLenderList();
+
+ this.salaryField = this.pd_cus_segment.substring(0,2) == 'SE' ? false : true ;
// this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
// // console.log("(0,3): " + this.pd_cus_segment.substring(0,3));
// // console.log(this.pd_all_details.pdmaster_details);
@@ -123,7 +145,8 @@ export class BankingDetailsComponent implements OnInit {
bank_name: ['', Validators.compose([Validators.required])],
other_bank: [''],
account_type: ['', Validators.compose([Validators.required])],
- salary: ['', Validators.compose([Validators.required])],
+ //salary: ['', Validators.compose([Validators.required])],
+ salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : ['', Validators.compose([Validators.required])],
limit: ['', Validators.compose([Validators.required])],
//is_main: ['', Validators.compose([Validators.required])],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : '', Validators.compose([Validators.required])],
@@ -188,13 +211,13 @@ export class BankingDetailsComponent implements OnInit {
}
selectedAccTypeChanges(event: any){
- console.log('First Time',event);
- console.log('First Time Value',event.value);
+ // console.log('First Time',event);
+ // console.log('First Time Value',event.value);
if(event.value == 2) {
const control =
this.bankingForm.controls['itemRows'];
- console.log('Inside If Condition');
- console.log(control);
- console.log(control.controls);
+ // console.log('Inside If Condition');
+ // console.log(control);
+ // console.log(control.controls);
control.controls[0].get('limit').clearValidators();
control.controls[0].get('limit').updateValueAndValidity();
@@ -208,7 +231,7 @@ export class BankingDetailsComponent implements OnInit {
}
else{
- alert('sd');
+ //alert('sd');
}
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
index 8b2f03acb..907f84964 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
@@ -873,116 +873,98 @@
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
index 255c0fb34..57cf18d9e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
@@ -62,7 +62,25 @@ export class BusinessInfoComponent implements OnInit {
this.form_id = 13;
this.notifier = notifier;
}
-
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
let get_max_date = this.pd_all_details.pdmaster_details.pd_date_of_initiation.split('/').reverse().join("/");
this.maxDate = new Date(get_max_date);
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html
index 1c5b4410b..f1a738b42 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html
@@ -1,332 +1,203 @@
-
-
-
-
+
+
+
-
-
+
@@ -283,22 +252,22 @@
-
-
- Remarks
-
-
-
-
+
+
+ Remarks
+
+
+
+
-
+
-
+
-
+
@@ -311,7 +280,7 @@
Family Details
-
-
-
-
-
-
-
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
index eade414cb..0b227700e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
@@ -38,6 +38,7 @@ export class LoanDetailsComponent implements OnInit {
applicants: any;
productAbbr: any;
+ productID: any;
subProductName: any;
isOtherPurpose: boolean = false;
@@ -70,8 +71,10 @@ export class LoanDetailsComponent implements OnInit {
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
+
this.applicants = this.pd_all_details.pdapplicants_detials;
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
+ this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount :'';
this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
@@ -79,9 +82,28 @@ export class LoanDetailsComponent implements OnInit {
this.pdid= this.pd_all_details.pdmaster_details.pd_id;
this.notifier = notifier;
}
-
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
-
+ console.clear();
+ console.log(this.pd_all_details);
this.initloanDetailsForm();
this.getM_EndUseofLoad();
this.getM_sourceofamount();
@@ -123,6 +145,7 @@ export class LoanDetailsComponent implements OnInit {
if(value.records.loan_amount){ this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); }
this.loanDetailsForm.controls['end_use'].setValue(enduse);
+ this.endUserChange(enduse);
if (value.records.end_use_other) {
this.loanDetailsForm.controls['end_use_other'].setValue(value.records.end_use_other);
}
@@ -187,9 +210,10 @@ export class LoanDetailsComponent implements OnInit {
// =============
getM_EndUseofLoad() {
- this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe(
+ //this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe(
+ this._pd.getAllMasterDatas('SUBPRODUCTS').subscribe(
data => {
- this.m_endUseofLoad = data.records.filter(data => data.isactive == 1);
+ this.m_endUseofLoad = data.records.filter(data => data.isactive == 1 && data.fk_product_id == this.productID);
},
error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
@@ -307,15 +331,33 @@ getM_sourceofamount() {
loandetails_remarks: ['', Validators.compose([Validators.required])],
});
}
+ // endUserChange(event) {
+ // this.endUserList = [];
+ // event.value.forEach(option => {
+ // this.endUserList.push({end_use: option});
+ // if (option == 'other') {
+ // this.isOtherPurpose = true;
+ // }
+ // });
+ // }
+
endUserChange(event) {
this.endUserList = [];
- event.value.forEach(option => {
- this.endUserList.push({end_use: option});
- if (option == 'other') {
- this.isOtherPurpose = true;
+ event.forEach(option => {
+ let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
+ othersData = othersData.name.substr(0,6).toLowerCase();
+
+ this.endUserList.push({ end_use: option });
+ if (othersData == 'others') {
+ this.isOtherPurpose = true;
+ return ;
+ }else
+ {
+ this.isOtherPurpose = false;
}
- });
+ });
}
+
ownerNameChange(event) {
let EventValue;
@@ -508,4 +550,4 @@ getM_sourceofamount() {
this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
}
-}
+}
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
index ce783b7b2..cfa8d8f4b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
@@ -1,7 +1,6 @@
-
-
-
+
+
{{pageTitle}}
@@ -10,126 +9,122 @@
-
+
-
-
-
- {{types.type_name}}
-
-
-
-
-
-
-
-
-
-
-
-
- Yes
- No
-
-
-
-
-
-
-
-
- Yes
- No
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{types.type_name}}
+
+
+
+
+
-
-
-
-
-
- Enter Valid Mobile Number.
-
-
-
- Enter Valid Landline Number.
-
-
-
-
-
-
-
- Select
-
- {{relationship.relation_with_business_name | titlecase}}
-
-
-
-
-
-
- Period of Relationship
-
-
+
+
-
-
+
+
+ Yes
+ No
+
-
-
-
-
-
- Select
-
- {{volume.name | titlecase}}
-
-
-
-
-
-
- add
-
-
-
+
+
+
+
+
+
+
+
+
+ Enter Valid Mobile Number.
+
+
+
+ Enter Valid Landline Number.
+
+
+
+
+
-
-
-
-
- Remarks
-
-
+
+ Select
+
+ {{relationship.relation_with_business_name | titlecase}}
+
+
+
+
+
+
+
Period of Relationship
+
+
+
+
+
+
+
+
+
+
+
+ Select
+
+ {{volume.name | titlecase}}
+
+
+
+
+ delete
+
+
+
+
+
+ add
+
+
+
+
+
+
+
+
+
+
+ Remarks
+
+
+
+
+ save
-
- save
-
-
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
index 45b0df9b9..14f8677f1 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
@@ -93,107 +93,97 @@
-
-
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
index 53760597b..1e7bb0909 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
@@ -55,7 +55,25 @@ export class OtherIncomeComponent implements OnInit {
this.form_id = 9;
this.notifier = notifier;
}
-
+public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
console.clear();
this.getFrequency();
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html
index a1c0fc84f..2571dd94a 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html
@@ -209,112 +209,98 @@
-
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts
index b41f5119f..24e4c76cf 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts
@@ -66,7 +66,25 @@ export class PersonalInfoComponent implements OnInit {
this.notifier = notifier;
this.form_id = 3;
}
-
+public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
this.initFormDetails()
this.loadPDDetails();
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html
index e6a766540..c419c40d6 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html
@@ -204,111 +204,98 @@
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts
index 4de812beb..72ba6052e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts
@@ -36,7 +36,25 @@ export class RentalInfoComponent implements OnInit {
this.notifier = notifier;
this.form_id = 17;
}
-
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
this.step = 0;
this.inintRentalForm();
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
index 1df3ba854..450d5378e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
@@ -18,7 +18,7 @@
-
+
Raw Materials
@@ -26,39 +26,50 @@
-
+
-
+
+ formControlName="stock_observed" required
+ (selectionChange)="RawMaterialValidation($event)">
Yes
No
-
-
+
+
-
+
{{uom.name}}
-
+
-
-
+
+
+ {{"₹"}} {{rawValueInWords}} Only
-
-
+
+
+
+ Yes
+ No
+
-
+
+ Please comment on the stock level observed?
+
+
+
+
@@ -79,7 +90,7 @@
+
+
+
+
+
+ Stock of Goods Traded
+
+
+
+
+
+
+
-
-
+
@@ -238,7 +316,7 @@
- Please comment on the stock level observed?
+ Remarks
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
index 852581817..619b4856b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
@@ -38,8 +38,15 @@ export class StockComponent implements OnInit {
public stockForm: FormGroup;
private notifier: NotifierService;
public uomData : any = [];
- rawmaterial : any;
+ rawmaterial : any;
+ goodsValueInWords : any;
+ rawValueInWords : any;
+ tradedGoodsValueInWords : any;
+ rawMaterialAccess: boolean;
+ finishedGoodsAccess: boolean;
+ tradeConcernAccess: boolean;
+
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
@@ -47,93 +54,207 @@ export class StockComponent implements OnInit {
this.form_id = 11;
this.notifier = notifier;
}
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+};
ngOnInit() {
this.initstockForm();
this.getUOM();
- this.setSku('data',0);
+ //this.setSku('data',0);
let params: any = {};
+ let activityArray : any = [];
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(value => {
+ console.log(value);
+ const rawMaterial = this.stockForm.controls['raw_materials'];
+ const finishedGoods = this.stockForm.controls['finished_goods'];
+ const tradedGoods = this.stockForm.controls['traded_goods'];
+
+ if (value.status == 200) {
+ console.log('value.records',value.records);
+ value.records.type_of_activity.forEach(val => {
+ //console.log(val);
+ //console.log(val.type_of_activity_id);
+ this.rawMaterialAccess = true;
+ this.finishedGoodsAccess = true;
+ this.tradeConcernAccess = true;
+ if(val.type_of_activity_id == 1){
+ rawMaterial.push(this.createRawmaterial());
+ finishedGoods.push(this.createGoods());
+ tradedGoods.push(this.createTradedGoods());
+ }
+ else if(val.type_of_activity_id == 2){
+ rawMaterial.push(this.createRawmaterial());
+ finishedGoods.push(this.createGoods());
+ }
+ else if(val.type_of_activity_id == 3){
+ rawMaterial.push(this.createRawmaterial());
+ finishedGoods.push(this.createGoods());
+ }
+ // else if(val.type_of_activity_id == 4){
+ // }
+
+ });
+
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:'1'}).subscribe(value => {
- console.log('Raw material Name',value.records.main_raw_materials);
-
-
+ //console.log('Raw material Name',value.records.main_raw_materials);
+
// const faControl = (this.stockForm.controls['raw_materials']).at(1);
- const control = (this.stockForm.controls['raw_materials']).at(0);
- console.log(control);
+ //const control = (this.stockForm.controls['raw_materials']).at(0);
+ //console.log(control);
// this.stockForm.controls['raw_materials'].setValue(value.records.main_raw_materials);
- if (value.status == 200) {
- this.rawmaterial = value.records.main_raw_materials;
- }else{ this.rawmaterial = ''; }
+ // if (value.status == 200) {
+ // this.rawmaterial = value.records.main_raw_materials;
+ // }else{ this.rawmaterial = ''; }
})
+
this._pd.retriveForm(params).subscribe(value => {
- console.log('value', value);
- const rawMaterial = this.stockForm.controls['raw_materials'];
- const finishedGoods = this.stockForm.controls['finished_goods'];
+ //console.log('value', value);
+
if (value.status == 200) {
- let result = Object.keys(value.records.raw_materials).map(function(key) {
- return value.records.raw_materials[key];
- });
- let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
- return value.records.finished_goods[key];
- });
+ console.log('data',value);
+ // Raw Material Access is True means., Data have to load,
+ if(this.rawMaterialAccess == true){
+
+ let result = Object.keys(value.records.raw_materials).map(function(key) {
+ return value.records.raw_materials[key];
+ });
+
+ if (result.length > 0) {
+
+ result.forEach(val => {
+
+ //this.RawMaterialValidation(val.stock_observed);
+ rawMaterial.push(this.createRawmaterial());
+ if(val.raw_value != '' && val.raw_value != null ){ this.rawValueInWords = this._pd.convertNumberToWords(val.raw_value); }
+ });
+ this.stockForm.controls['raw_materials'].setValue(result);
+ } else {
+ rawMaterial.push(this.createRawmaterial());
+ }
+ }
+
+ // Finished Goods Access is TRUE Means., data have to load.,
+ if(this.finishedGoodsAccess == true){
+ let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
+ return value.records.finished_goods[key];
+ });
+
+ if (result_Goods.length > 0) {
+
+ result_Goods.forEach(val => {
+
+ //this.GoodsValidation(val.goods_observed);
+ finishedGoods.push(this.createGoods());
+ if(val.goods_value != '' && val.goods_value != null ){ this.goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); }
+ });
+ this.stockForm.controls['finished_goods'].setValue(result_Goods);
+ } else {
+ finishedGoods.push(this.createGoods());
+ }
+ }
+
+ //TradeConcern Access is TRUE Means., data have to load.,
+ if(this.tradeConcernAccess == true){
+ let result_Traded_Goods = Object.keys(value.records.finished_goods).map(function(key) {
+ return value.records.traded_goods[key];
+ });
+
+ if (result_Traded_Goods.length > 0) {
+
+ result_Traded_Goods.forEach(val => {
+
+
+ tradedGoods.push(this.createTradedGoods());
+ if(val.traded_goods_value != '' && val.traded_goods_value != null )
+ { this.tradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value); }
+ });
+ this.stockForm.controls['traded_goods'].setValue(result_Traded_Goods);
+ } else {
+ tradedGoods.push(this.createTradedGoods());
+ }
+ }
+
+
this.stockForm.controls['stock_remarks'].setValue(value.records.stock_remarks);
- if (result.length > 0) {
- result.forEach(val => {
- rawMaterial.push(this.createRawmaterial());
- });
- this.stockForm.controls['raw_materials'].setValue(result);
- } else {
- rawMaterial.push(this.createRawmaterial());
- }
- if (result_Goods.length > 0) {
- result_Goods.forEach(val => {
- finishedGoods.push(this.createGoods());
- });
- this.stockForm.controls['finished_goods'].setValue(result_Goods);
- } else {
- finishedGoods.push(this.createGoods());
- }
+
} else {
- rawMaterial.push(this.createRawmaterial());
- finishedGoods.push(this.createGoods());
+ // rawMaterial.push(this.createRawmaterial());
+ // finishedGoods.push(this.createGoods());
+ // tradedGoods.push(this.createTradedGoods());
}
})
}
+});
+}
+
public initstockForm(): void {
this.stockForm = this.fb.group({
stock_remarks: ['', Validators.compose([Validators.required])],
raw_materials: this.fb.array([]),
- finished_goods: this.fb.array([])
+ finished_goods: this.fb.array([]),
+ traded_goods: this.fb.array([])
});
}
- setSku(sku: string, index: number) {
+ //setSku(sku: string, index: number) {
// const faControl =
// (this.stockForm.controls['raw_materials']).at(index);
// faControl['controls'].raw_name.setValue(sku);
- }
+ // }
createRawmaterial() {
return this.fb.group({
raw_name: ['', Validators.compose([Validators.required])],
stock_observed:['', Validators.compose([Validators.required])],
- raw_quantity: ['', Validators.compose([Validators.required])],
- raw_uom: ['', Validators.compose([Validators.required])],
+ raw_quantity: [''],
+ raw_uom: [''],
other_uom : [''],
- raw_value: ['', Validators.compose([Validators.required])],
- rawmaterial_value: ['', Validators.compose([Validators.required])],
- is_sufficiant_raw: ['', Validators.compose([Validators.required])],
+ raw_value: [''],
+ rawmaterial_value: [''],
+ is_sufficiant_raw: [''],
+ rawmaterial_remarks:['']
});
}
createGoods() {
return this.fb.group({
goods_name: ['', Validators.compose([Validators.required])],
- goods_quantity: ['', Validators.compose([Validators.required])],
- goods_value: ['', Validators.compose([Validators.required])],
- finished_goods_value: ['', Validators.compose([Validators.required])],
- is_sufficiant_goods: ['', Validators.compose([Validators.required])],
+ goods_observed: ['', Validators.compose([Validators.required])],
+ goods_quantity: [''],
+ goods_value: [''],
+ finished_goods_value: [''],
+ is_sufficiant_goods: [''],
+ finishedgoods_remarks:['']
+ });
+ }
+
+ createTradedGoods() {
+ return this.fb.group({
+ traded_goods_name: ['', Validators.compose([Validators.required])],
+ traded_goods_observed: ['', Validators.compose([Validators.required])],
+ traded_goods_quantity: [''],
+ estimated_traded_goods_value: [''],
+ traded_goods_value: [''],
+ is_sufficiant_traded_goods: [''],
+ traded_goods_remarks:['']
});
}
addRawMaterials() {
@@ -152,6 +273,15 @@ export class StockComponent implements OnInit {
const control = this.stockForm.controls['finished_goods'];
control.removeAt(index);
}
+ addTradedGoods() {
+ const control = this.stockForm.controls['traded_goods'];
+ control.push(this.createTradedGoods());
+ }
+ deleteTradedGoods(index) {
+ const control = this.stockForm.controls['traded_goods'];
+ control.removeAt(index);
+ }
+
submitDetails() {
if (!this.stockForm.valid) {
return;
@@ -160,12 +290,16 @@ export class StockComponent implements OnInit {
records.pdid = this.pdid;
records.formid = this.form_id;
records.fk_createdby = this.pdid;
- records.raw_materials = this.stockForm.controls['raw_materials'].value;
+ if(this.rawMaterialAccess == true){
+ records.raw_materials = this.stockForm.controls['raw_materials'].value; }
+ if(this.finishedGoodsAccess == true){
+ records.finished_goods = this.stockForm.controls['finished_goods'].value;}
+ if(this.tradeConcernAccess == true){
+ records.traded_goods = this.stockForm.controls['traded_goods'].value; }
records.stock_remarks = this.stockForm.controls['stock_remarks'].value;
- records.finished_goods = this.stockForm.controls['finished_goods'].value;
- console.log('data', records);
+ //console.log('data', records);
this._pd.saveForm(records).subscribe(data => {
- console.log('data', data);
+ //console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@@ -201,4 +335,151 @@ export class StockComponent implements OnInit {
event.preventDefault();
}
}
+
+ /** To Convert Amount into Words */
+ inWords(e,flag:number){
+ switch(flag){
+ case 1 :
+ this.rawValueInWords = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 2 :
+ this.goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 3 :
+ this.tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Validation Dynamically Add And Remove
+ GoodsValidation(event: any){
+ // console.log('First Time',event);
+ // console.log('First Time Value',event.value);
+
+ const control = this.stockForm.controls['finished_goods'];
+
+ if(event.value == 'no') {
+
+ control.controls[0].get('goods_quantity').setValidators([Validators.required]);
+ control.controls[0].get('goods_quantity').updateValueAndValidity();
+
+ control.controls[0].get('goods_value').setValidators([Validators.required]);
+ control.controls[0].get('goods_value').updateValueAndValidity();
+
+ control.controls[0].get('finished_goods_value').setValidators([Validators.required]);
+ control.controls[0].get('finished_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_goods').setValidators([Validators.required]);
+ control.controls[0].get('is_sufficiant_goods').updateValueAndValidity();
+
+
+ }
+ else
+ if(event.value == 'yes') {
+
+ control.controls[0].get('goods_quantity').clearValidators();
+ control.controls[0].get('goods_quantity').updateValueAndValidity();
+
+ control.controls[0].get('goods_value').clearValidators();
+ control.controls[0].get('goods_value').updateValueAndValidity();
+
+ control.controls[0].get('finished_goods_value').clearValidators();
+ control.controls[0].get('finished_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_goods').clearValidators();
+ control.controls[0].get('is_sufficiant_goods').updateValueAndValidity();
+
+
+
+ }
+
+ }
+
+ RawMaterialValidation(event: any){
+ // console.log('First Time',event);
+ // console.log('First Time Value',event.value);
+
+ const control = this.stockForm.controls['raw_materials'];
+
+ if(event.value == 'no') {
+
+ control.controls[0].get('raw_quantity').setValidators([Validators.required]);
+ control.controls[0].get('raw_quantity').updateValueAndValidity();
+
+ control.controls[0].get('raw_uom').setValidators([Validators.required]);
+ control.controls[0].get('raw_uom').updateValueAndValidity();
+
+ control.controls[0].get('raw_value').setValidators([Validators.required]);
+ control.controls[0].get('raw_value').updateValueAndValidity();
+
+ control.controls[0].get('rawmaterial_value').setValidators([Validators.required]);
+ control.controls[0].get('rawmaterial_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_raw').setValidators([Validators.required]);
+ control.controls[0].get('is_sufficiant_raw').updateValueAndValidity();
+
+
+ }
+ else
+ if(event.value == 'yes') {
+
+ control.controls[0].get('raw_quantity').clearValidators();
+ control.controls[0].get('raw_quantity').updateValueAndValidity();
+
+ control.controls[0].get('raw_uom').clearValidators();
+ control.controls[0].get('raw_uom').updateValueAndValidity();
+
+ control.controls[0].get('raw_value').clearValidators();
+ control.controls[0].get('raw_value').updateValueAndValidity();
+
+ control.controls[0].get('rawmaterial_value').clearValidators();
+ control.controls[0].get('rawmaterial_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_raw').clearValidators();
+ control.controls[0].get('is_sufficiant_raw').updateValueAndValidity();
+ }
+
+ }
+
+ TradedGoodsValidation(event: any){
+ console.log('First Time',event);
+ console.log('First Time Value',event.value);
+
+ const control = this.stockForm.controls['tradeded_goods'];
+
+ if(event.value == 'no') {
+
+ control.controls[0].get('traded_goods_quantity').setValidators([Validators.required]);
+ control.controls[0].get('traded_goods_quantity').updateValueAndValidity();
+
+ control.controls[0].get('estimated_traded_goods_value').setValidators([Validators.required]);
+ control.controls[0].get('estimated_traded_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('traded_goods_value').setValidators([Validators.required]);
+ control.controls[0].get('traded_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_traded_goods').setValidators([Validators.required]);
+ control.controls[0].get('is_sufficiant_traded_goods').updateValueAndValidity();
+ }
+ else
+ if(event.value == 'yes') {
+
+ control.controls[0].get('traded_goods_quantity').clearValidators();
+ control.controls[0].get('traded_goods_quantity').updateValueAndValidity();
+
+ control.controls[0].get('estimated_traded_goods_value').clearValidators();
+ control.controls[0].get('estimated_traded_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('traded_goods_value').clearValidators();
+ control.controls[0].get('traded_goods_value').updateValueAndValidity();
+
+ control.controls[0].get('is_sufficiant_traded_goods').clearValidators();
+ control.controls[0].get('is_sufficiant_traded_goods').updateValueAndValidity();
+
+ }
+
+ }
+
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
index 01198a3f5..bea4ae748 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
@@ -1,260 +1,134 @@
-
-
-
-
-
{{pageTitle}}
-
- close
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- You must Include Raw Material Details.
-
-
-
-
+
+
{{pageTitle}}
+
+ close
+
+
+
+
+
+
+ Manufacturing Product Details
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ pm.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1" (click)="removeLanguage(i)">
- delete
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
- add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Service Provider Product Details
+ Service Provider Details Not applicable here !!
+
+
+
-
-
-
-
- save
-
-
-
-
-
-
-
\ No newline at end of file
+
+ Remarks
+
+
+
+
+ save
+
+
+
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss
index 2ee011993..411bc5979 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss
@@ -17,6 +17,9 @@
.mat-card-actions {
background-color: white;
}
+ ::ng-deep .cdk-global-overlay-wrapper{
+ justify-content: center !important;
+}
mat-form-field {
margin: 0 2%;
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
index 6fe83ad3f..0e9ab8f5b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
@@ -3,7 +3,7 @@ import {
Component,
OnInit,
Inject,
- Output,Input
+ Output, Input
} from '@angular/core';
import {
@@ -31,50 +31,315 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
})
export class SupplierInfoComponent implements OnInit {
-
- pageTitle: string ="Supplier Details";
-
+
+ pageTitle: string = "Supplier Details";
+
//@Input() pdid: number;
- pdid : string;
- form_id:number;
+ pdid: string;
+ form_id: number;
public _supplierQuesFrom: FormGroup;
public submitted = false;
- public m_paymentModeType= [];
+ public m_paymentModeType = [];
private notifier: NotifierService;
constructor(
- notifier: NotifierService,
- private _formBuilder: FormBuilder,
- private pdTrigerService: PdTrigerService,
- @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
- this.pdid = this.pd_all_details.pdmaster_details.pd_id;
- this.form_id = 1;
- this.notifier = notifier;
+ notifier: NotifierService,
+ private _formBuilder: FormBuilder,
+ private pdTrigerService: PdTrigerService,
+ @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
+ this.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.form_id = 1;
+ this.notifier = notifier;
}
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+ };
+ noRecordsFound: Boolean = false;
ngOnInit() {
- // this.getM_FreqOfPurchase();
+
+ this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
+ if(data.dataStatus){
+ // let datas = {
+ // "profession_name": "Others",
+ // "type_of_activity": [
+ // {
+ // "type_of_activity_id": 1,
+ // "name": "Manufacturing Details"
+ // },
+ // {
+ // "type_of_activity_id": 2,
+ // "name": "Retail trading"
+ // },
+ // {
+ // "type_of_activity_id": 4,
+ // "name": "Service Provider"
+ // }
+ // ]
+ // };
+ let datas = data.records;
+ this.initFormLoadDetails(datas.type_of_activity);
+ }else {
+ this.notifier.notify('warning', 'No Category Records Found.!');
+ this.noRecordsFound = false;
+ }
+ }, err => {
+ this.notifier.notify('warning', 'No Category Records Found.!');
+ this.noRecordsFound = false;
+ })
+
+ // this.getM_FreqOfPurchase();
this.getM_PaymentModeType();
- this.getPdSupplierFormDetails();
+ // this.getPdSupplierFormDetails();
}
-// ==================
+
+ serviceProviderForm: Boolean = false;
+ initFormLoadDetails(record) {
+ // alert(JSON.stringify(record));
+ this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
+ data => {
+ if(data.dataStatus){
+ let dataForm = data.records;
+ if(dataForm !== undefined) {
+ this._supplierQuesFrom = this._formBuilder.group({
+ pdid: [this.pdid],
+ formid: ['1'],
+ manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
+ trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
+ // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ });
+ let arr = record.filter(data => data.type_of_activity_id == 1);
+ if(arr.length > 0) {
+ let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
+ return dataForm.main_raw_materials[key];
+ });
+ this.initManufacturingProductsDetails(api_main_raw_materials);
+ this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.main_raw_materials_total_payments_percent_on_credit || null);
+ }
+ let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
+ if(arr1.length > 0) {
+ let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
+ return dataForm.trading_products[key];
+ });
+ this.initTradingProductsDetails(api_trading_products);
+ this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
+ }
+ this.noRecordsFound = true;
+ } else {
+ this._supplierQuesFrom = this._formBuilder.group({
+ pdid: [this.pdid],
+ formid: ['1'],
+ manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
+ trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
+ // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ });
+ let arr = record.filter(data => data.type_of_activity_id == 1);
+ if(arr.length > 0) {
+ this.initManufacturingProductsDetails(null);
+ this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
+ }
+ let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
+ if(arr1.length > 0) {
+ this.initTradingProductsDetails(null);
+ this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
+ }
+ this.noRecordsFound = true;
+ }
+ let arr2 = record.filter(data => data.type_of_activity_id == 4);
+ if(arr2.length > 0) {
+ this.serviceProviderForm = true;
+ }
+ } else {
+ this._supplierQuesFrom = this._formBuilder.group({
+ pdid: [this.pdid],
+ formid: ['1'],
+ manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
+ trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ supplier_info_form_remark: []
+ // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
+ });
+ let arr = record.filter(data => data.type_of_activity_id == 1);
+ if(arr.length > 0) {
+ this.initManufacturingProductsDetails(null);
+ this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
+ }
+ let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
+ if(arr1.length > 0) {
+ this.initTradingProductsDetails(null);
+ this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
+ }
+ let arr2 = record.filter(data => data.type_of_activity_id == 4);
+ if(arr2.length > 0) {
+ this.serviceProviderForm = true;
+ }
+ this.noRecordsFound = true;
+ }
+ }, err => {
+
+ }
+ );
+ }
+
+
+ manufacturingForm: Boolean = false;
+ manufacturingFormCreation(val) {
+ let arr = val.filter(data => data.type_of_activity_id == 1);
+ if (arr.length > 0) {
+ this.manufacturingForm = true;
+ return this._formBuilder.group({
+ main_raw_materials: this._formBuilder.array([]),
+ main_raw_materials_total_payments_percent_on_credit: []
+ })
+ // }
+ } else {
+ return;
+ }
+ }
+
+ tradingForm: Boolean = false;
+ tradingFormCreation(val) {
+ let arr = val.filter(data => data.type_of_activity_id == 2 || 3);
+ if (arr.length > 0) {
+ this.tradingForm = true;
+ return this._formBuilder.group({
+ trading_products: this._formBuilder.array([]),
+ trading_products_total_payments_percent_on_credit: []
+ });
+ } else {
+ return;
+ }
+ }
+
+ initManufacturingProductsDetails(datas) {
+ const control = this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
+ if(datas === null){
+ control.push(this.initManufacturingProducts(null));
+ } else {
+ for (let val of datas) {
+ control.push(this.initManufacturingProducts(val));
+ }
+ }
+ }
+
+ initManufacturingProducts(records) {
+ if(records === null) {
+ return this._formBuilder.group({
+ manufacturing_raw_material_name: [''],
+ manufacturing_supplier_name: [''],
+ manufacturing_contact_person_name: [''],
+ manufacturing_contact_person_mobile_number: [''],
+ manufacturing_payment_type: [''],
+ manufacturing_credit_days: [''],
+ manufacturing_frequency_of_purchase: [''],
+ })
+ } else {
+ return this._formBuilder.group({
+ manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null],
+ manufacturing_supplier_name: [records.manufacturing_supplier_name || null],
+ manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
+ manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null],
+ manufacturing_payment_type: [records.manufacturing_payment_type || null],
+ manufacturing_credit_days: [records.manufacturing_credit_days || null],
+ manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null],
+ })
+ }
+ }
+
+ initTradingProductsDetails(datas) {
+ const control = this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products'];
+ if(datas === null){
+ control.push(this.initTradingProducts(null));
+ } else {
+ for (let val of datas) {
+ control.push(this.initTradingProducts(val));
+ }
+ }
+ }
+
+ initTradingProducts(records) {
+ if(records === null) {
+ return this._formBuilder.group({
+ trade_product_name: [''],
+ trade_supplier_name: [''],
+ trade_product_contact_person_name: [''],
+ trade_product_contact_person_mobile_number: [''],
+ trade_product_payment_type: [''],
+ trade_product_frequency_of_purchase: [''],
+ trade_product_credit_days: [''],
+ })
+ } else {
+ return this._formBuilder.group({
+ trade_product_name: [records.trade_product_name],
+ trade_supplier_name: [records.trade_supplier_name],
+ trade_product_contact_person_name: [records.trade_product_contact_person_name],
+ trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number],
+ trade_product_payment_type: [records.trade_product_payment_type],
+ trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
+ trade_product_credit_days: [records.trade_product_credit_days],
+ })
+ }
+ }
+
+ addMoreRawMaterials(e): void {
+ // e.stropPropagation();
+ const control = this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
+ // console.log(control);
+ control.push(this.initManufacturingProducts(null));
+ }
+
+ removeRawMaterials(inx): void {
+ const control = this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
+ control.removeAt(inx);
+ }
+
+ addMoretradeProduct(e): void {
+ // e.stropPropagation();
+ const control = this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products'];
+ // console.log(control);
+ control.push(this.initTradingProducts(null));
+ }
+
+ removeTradingProduct(inx): void {
+ const control = this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products'];
+ control.removeAt(inx);
+ }
+
+ // ==================
//getM_FreqOfPurchase() {
- // this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
- // data => {
- // this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1);
- // },
- // error => {
- // this.notifier.notify('warning', 'No Category Records Found.!');
- // this.m_assets_type = "No Category Records Found.";
- /// }
- // )
- // }
+ // this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
+ // data => {
+ // this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1);
+ // },
+ // error => {
+ // this.notifier.notify('warning', 'No Category Records Found.!');
+ // this.m_assets_type = "No Category Records Found.";
+ /// }
+ // )
+ // }
- getM_PaymentModeType() {
+ getM_PaymentModeType() {
this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe(
data => {
this.m_paymentModeType = data.records.filter(data => data.isactive == 1);
@@ -87,123 +352,8 @@ export class SupplierInfoComponent implements OnInit {
}
-// ==================
+ // ==================
-apiLoadFinish: boolean = false;
- getPdSupplierFormDetails() {
- this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
- data => {
- if (data) {
- if(data.dataStatus){
- this.formLoadData(data.records)
- } else {
- this.formLoadData(null)
- }
- this.apiLoadFinish = true;
- } else {
- // this.noRecordFound = true;
- }
- }
- );
- }
-
- formLoadData(val) {
- if(val !== null) {
- let value = val;
- this._supplierQuesFrom = this._formBuilder.group({
- pdid: [this.pdid],
- formid: ['1'],
- main_raw_materials: [value.main_raw_materials, Validators.compose([Validators.required])],
- supplier_details: this._formBuilder.array([
- // this.initDetails(),
- ])
- });
- this.addSupplierDetailsWithData(value.supplier_details);
- } else {
- this._supplierQuesFrom = this._formBuilder.group({
- pdid: [this.pdid],
- formid: ['1'],
- main_raw_materials: [null, Validators.compose([Validators.required])],
- supplier_details: this._formBuilder.array([
- this.initDetails(),
- ])
- });
- }
- }
-
- // convenience getter for easy access to form fields
- get f() { return this._supplierQuesFrom.controls; }
-
- // Dynamic Form field creation Functionality : START ===>
- initDetails() {
- return this._formBuilder.group({
- supplier_name: ['', Validators.compose([Validators.required])],
- contact_person: ['', Validators.compose([Validators.required])],
- mobile_number: ['', Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])],
- payment_mode: ['', Validators.compose([Validators.required])],
- per_of_immediate_advance_payment:[''],
- credit_period:[''],
- // frequency_of_purchase: ['', Validators.compose([Validators.required])],
- // freq_purchase_others_text_value: ['']
- });
- }
-
- initDetailsWithdata(data) {
- return this._formBuilder.group({
- supplier_name: [data.supplier_name, Validators.compose([Validators.required])],
- contact_person: [data.contact_person, Validators.compose([Validators.required])],
- mobile_number: [data.mobile_number, Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])],
- payment_mode: [data.payment_mode, Validators.compose([Validators.required])],
- per_of_immediate_advance_payment:[data.per_of_immediate_advance_payment || ''],
- credit_period:[data.credit_period || ''],
- //frequency_of_purchase: [data.frequency_of_purchase, Validators.compose([Validators.required])],
- //freq_purchase_others_text_value: [data.freq_purchase_others_text_value || '']
- });
- }
-
- addSupplierDetailsWithData(supp_data) {
- var result = Object.keys(supp_data).map(function(key) {
- return supp_data[key];
- });
- if (result.length > 0) {
- for (let val of result) {
- let vals = {
- supplier_name: val.supplier_name,
- contact_person: val.contact_person,
- mobile_number: val.mobile_number,
- payment_mode: val.payment_mode,
- per_of_immediate_advance_payment: val.per_of_immediate_advance_payment,
- credit_period: val.credit_period
- // frequency_of_purchase: val.frequency_of_purchase,
- // freq_purchase_others_text_value: val.freq_purchase_others_text_value
- };
- const control = this._supplierQuesFrom.controls['supplier_details'];
- control.push(this.initDetailsWithdata(vals));
- }
- }
- }
-
- addSupplierDetails(e) {
- const control = this._supplierQuesFrom.controls['supplier_details'];
- control.push(this.initDetails());
- }
- removeLanguage(i: number) {
- const control = this._supplierQuesFrom.controls['supplier_details'];
- control.removeAt(i);
- }
-
- public paymentModeTextBox: number;
- selectedPM(e) {
- this.paymentModeTextBox = e.value;
- // this.f.supplier_details.controls.get('payment_mode_value');
- }
-
- public freqPurchaseTextBox: number;
- selectedFreqPurchase(e){
- this.freqPurchaseTextBox = e.value;
- }
-
-
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
@@ -215,7 +365,7 @@ apiLoadFinish: boolean = false;
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
- // alert(JSON.stringify(answerFormValues));
+ console.log(JSON.stringify(answerFormValues));
//Add BRANCH data with help Service File
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
@@ -234,8 +384,8 @@ apiLoadFinish: boolean = false;
// this.errorMessage = "Something Wents Wrong Try Again !";
// this.dialogRef.close();
});
- //After Saving the BRANCH data then popup close
- // this.dialogRef.close();
+ // //After Saving the BRANCH data then popup close
+ // // this.dialogRef.close();
}
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
index 1be646df3..3c40f3481 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
@@ -14,11 +14,16 @@
-
+
-
+
- {{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }}
+
+ {{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }}
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss
index 1c43c6bb5..38778876d 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss
@@ -11,6 +11,16 @@ mat-card.parent_mat_card > {
max-height:52vh;
overflow:auto;
}
+ .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;
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
index f529d2abf..d1a7e83ec 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
@@ -25,6 +25,8 @@ import {LenderRepresentativeComponent} from './forms/lender-representative/lende
import {LoanDetailsComponent} from './forms/loan-details/loan-details.component';
import {GeneralInfoComponent} from './forms/general-info/general-info.component';
import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component';
+import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component';
+
@Component({
selector: 'app-start-pd',
templateUrl: './start-pd.component.html',
@@ -897,6 +899,18 @@ pdFullDetails:any=[];
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD);
});
+ }else if(this.selectedFormsCategory.form_id==20){
+ const generaldialogRef = this.dialog.open(FinalRemarksComponent, {
+ data: this.pdFullDetails,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ generaldialogRef.afterClosed()
+ .subscribe(dataresult => {
+ // this.notifier.notify('success', 'Successfully allocated.!');
+ this.loadTemplates(this.startPD);
+ });
}
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 26ce99179..8697b5004 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
@@ -5,7 +5,7 @@
- Additional Requirements
+ Additional Requirements
0; else noRequirement">
@@ -123,7 +123,7 @@
0; else nodocument">
-
+
Documents
@@ -145,7 +145,7 @@
0; else nohistory">
-
+
PD History
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss
index 85e145279..bdf8de1d6 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss
@@ -5,4 +5,7 @@
}
.minheight {
min-height: 100%;
+}
+::ng-deep .body-container{
+ padding: 0rem !important;
}
\ No newline at end of file
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 25ce4b54e..ee118b064 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';
@@ -80,6 +80,9 @@ import { ModelEditPdReportComponent } from './list-pd/pd-report/model-edit-pd-re
import { OtherApplicantDetailsComponent } from './list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component';
import { NeighbourHoodComponent } from './list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component';
+// import ngx-viewer module
+import { NgxViewerModule } from 'ngx-viewer';
+import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/final-remarks.component';
/**
* Custom angular notifier options
@@ -257,7 +260,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
- declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion],
+ declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@@ -265,11 +268,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
imports: [
CommonModule,
ManagePdRoutingModule,
+ NgxViewerModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
CKEditorModule,
PdfViewerModule,
MatCardModule,
MatIconModule,
+ MatAutocompleteModule,
MatInputModule,
MatRadioModule,
MatTableModule,
@@ -279,6 +284,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatToolbarModule,
FlexLayoutModule,
NgxDatatableModule,
+ MatChipsModule,
FormsModule,MatSlideToggleModule,
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
@@ -295,7 +301,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
- ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion],
+ ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
})
export class ManagePdModule {
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..e45388092 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
@@ -282,14 +282,14 @@ getPDFormDetailsWithID(pdID, formID ):Observable {
// get Pd Final report Question Answer
- getPdFinalReportDetails(pdId: number) {
+ getPdFinalReportDetails(pdId: number): Observable {
return this._http.post(this.apiUrl+"getFinalPDReportQuestions",{"pd_id":pdId})
.pipe(
catchError(this.handleError('operation', []))
)
}
- getPDReportFinalDocument(pdId: any){
+ getPDReportFinalDocument(pdId: any): Observable{
pdId.fk_createdby = this._aws.getlocale();
return this._http.post(this.apiUrl+"generatePDReport",{"records": pdId})
.pipe(
@@ -297,28 +297,28 @@ getPDFormDetailsWithID(pdID, formID ):Observable {
)
}
- getActualPDReportModelTemplate(pdId: any) {
+ getActualPDReportModelTemplate(pdId: any) : Observable{
return this._http.post(this.apiUrl+"getLatestPDReportBlob ",{"records":{"pd_id":pdId}})
.pipe(
catchError(this.handleError('operation', []))
)
}
- updatePDReportDetails(records: any){
+ updatePDReportDetails(records: any): Observable{
return this._http.post(this.apiUrl+"saveNewVersionOfPDReport ",{"records": records})
.pipe(
catchError(this.handleError('operation', []))
)
}
- getPdDocVersionList(pdId: number){
+ getPdDocVersionList(pdId: number): Observable{
return this._http.post(this.apiUrl+"getListOfPDReportVersions",{"records":{"pd_id":pdId}})
.pipe(
catchError(this.handleError('operation', []))
)
}
- swapOlderPDReportToLatest(pdId: any){
+ swapOlderPDReportToLatest(pdId: any): Observable{
pdId.fk_createdby = this._aws.getlocale();
alert(JSON.stringify(pdId));
return this._http.post(this.apiUrl+"swapOlderPDReportToLatest",{"records": pdId})
@@ -327,6 +327,12 @@ getPDFormDetailsWithID(pdID, formID ):Observable {
)
}
+getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable{
+ return this._http.post(this.apiUrl+"getTypeOfActivetyFromBusinessForm", {"records": { "pd_id" : pd_id }})
+ .pipe(
+ catchError(this.handleError('operation', []))
+ )
+ }
@@ -417,9 +423,29 @@ convertNumberToWords(amount) {
)
}
+ stockFormAccess(pdid: any): Observable {
+
+ return this._http.post(this.apiUrl+"getTypeOfActivetyFromBusinessForm",{"records":pdid})
+ .pipe(
+ catchError(this.handleError('operation', []))
+ )
+ }
// private handleError(operation = 'operation', result?: T) {
// return (error: any): Observable => {
// 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
new file mode 100755
index 000000000..b93b0a92e
--- /dev/null
+++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+ Branch Name Required.!
+
+
+
+
+ {{ city.name }}
+
+ City Required.!
+
+
+
+ delete
+
+
+
+
+
+
+
+
+ add
+
+ settings_backup_restore
+ save
+
+
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
new file mode 100755
index 000000000..53f8de38e
--- /dev/null
+++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.scss
@@ -0,0 +1,14 @@
+.inlist{
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.inlist > * {
+ width: 350px;
+}
+
+.list-item {
+ border: 1px solid gray;
+ margin: 2px;
+ border-radius: 6px;
+}
\ No newline at end of file
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
new file mode 100755
index 000000000..205a0c98f
--- /dev/null
+++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { EntityBranchAddComponent } from './entity-branch-add.component';
+
+describe('EntityBranchAddComponent', () => {
+ let component: EntityBranchAddComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ EntityBranchAddComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(EntityBranchAddComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
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
new file mode 100755
index 000000000..517aad7ac
--- /dev/null
+++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-branch-add/entity-branch-add.component.ts
@@ -0,0 +1,245 @@
+import { Component, ViewChild, OnInit, OnDestroy, Input, Inject } from '@angular/core';
+import { MatPaginator, MatSort, MatTableDataSource, MatDialog, MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
+import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
+import { ActivatedRoute, Router } from '@angular/router';
+import { DataSource } from '@angular/cdk/table';
+import { Observable } from 'rxjs/Observable';
+
+import { NotifierService } from 'angular-notifier';
+
+import { MastersService } from './../../../service/masters/masters.service';
+import { EntityService } from './../../../service/entity/entity.service';
+
+@Component({
+ selector: 'app-entity-branch-add',
+ templateUrl: './entity-branch-add.component.html',
+ styleUrls: ['./entity-branch-add.component.scss']
+})
+export class EntityBranchAddComponent implements OnInit {
+
+ @Input() public entityId: number;
+ public newElement: any= {};
+ public listofCity = [];
+ public listOfBranch = [];
+
+ public m_city: any = [];
+
+ public _addEntityBranchFrom: FormGroup;
+ public submitted = false;
+
+ /**
+* Notifier service
+*/
+ private notifier: NotifierService;
+
+ constructor(
+ notifier: NotifierService,
+ private entityService: EntityService,
+ private mastersService: MastersService,
+ private _formBuilder: FormBuilder) {
+ this.notifier = notifier;
+ this._addEntityBranchFrom = this._formBuilder.group({
+ branch_details: this._formBuilder.array([
+ // this.addRegionFormData(null, null),
+ ])
+ })
+ }
+
+ ngOnInit() {
+ this.entityService.getEntityBranchList(this.entityId).subscribe(data => {
+ if (data.dataStatus) {
+ this.listofCity = data.records;
+ this.m_city = data.records.city_master;
+ // this.listOfBranch = data.records;
+ this.setFormDatas(data.records.branch_details);
+ }
+ }, err => {
+ })
+ }
+
+ setFormDatas(record) {
+ if (record.length > 0) {
+ for (let val of record) {
+ let vals = {
+ entity_lender_branch_id: val.entity_lender_branch_id,
+ branch_name: val.branch_name,
+ fk_entity_id: val.fk_entity_id,
+ fk_region_id: val.fk_region_id,
+ fk_city_id: val.fk_city_id,
+ fk_updatedby: val.fk_updatedby,
+ fk_createdby: val.fk_createdby,
+ isactive: val.isactive,
+ };
+ this.addRegionFormData(vals, null);
+ }
+ }
+ }
+
+ // convenience getter for easy access to form fields
+ get f() { return this._addEntityBranchFrom.controls; }
+
+ // Dynamic Form field creation Functionality : START ===>
+ initRegionFormLoad(data) {
+ return this._formBuilder.group({
+ entity_lender_branch_id: [data.entity_lender_branch_id],
+ branch_name: [data.branch_name, Validators.compose([Validators.required])],
+ fk_city_id: [data.fk_city_id, Validators.compose([Validators.required])],
+ fk_entity_id: [data.fk_entity_id],
+ fk_updatedby: [data.fk_updatedby],
+ fk_createdby: [data.fk_createdby],
+ isactive: [data.isactive],
+ });
+ }
+ addRegionFormData(data, e) {
+ if (data == null) {
+ let newDate = {
+ entity_lender_branch_id: null,
+ branch_name:null,
+ fk_entity_id: this.entityId,
+ fk_createdby: null,
+ fk_updatedby: null,
+ fk_city_id: null,
+ isactive: 1,
+ }
+ const control = this._addEntityBranchFrom.controls['branch_details'];
+ control.push(this.initRegionFormLoad(newDate));
+ } else {
+ const control = this._addEntityBranchFrom.controls['branch_details'];
+ control.push(this.initRegionFormLoad(data));
+ }
+ }
+
+ deleteEntityBranch(inx, e) {
+ e.stopPropagation();
+ const control = this._addEntityBranchFrom.controls['branch_details'];
+ // let dataS = control.controls[inx].value;
+ if(control.controls[inx].value['entity_lender_branch_id'] !== null){
+ console.log( this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive);
+ this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive.setValue("0");
+ console.log( this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive.value);
+ } else {
+ control.removeAt(inx);
+ }
+ }
+
+ // public listOfBranch = [
+ // {
+ // "entity_lender_branch_id": 1,
+ // "branch_name": "Dev Test Branch 1",
+ // "isactive": "1",
+ // "fk_createdby": "1",
+ // "fk_updatedby": "1",
+ // "fk_entity_id": "1"
+ // },
+ // {
+ // "entity_lender_branch_id": 2,
+ // "branch_name": "Dev Test Branch 2",
+ // "isactive": "1",
+ // "fk_createdby": "1",
+ // "fk_updatedby": "1",
+ // "fk_entity_id": "1"
+ // },
+ // {
+ // "entity_lender_branch_id": 3,
+ // "branch_name": "Dev Test Branch 3",
+ // "isactive": "1",
+ // "fk_createdby": "1",
+ // "fk_updatedby": "1",
+ // "fk_entity_id": "1"
+ // }
+ // ];
+
+ addItem(prop): void {
+ // let data = {
+ // "entity_lender_branch_id": null,
+ // "branch_name": this.newElement.name,
+ // "isactive": "1",
+ // "fk_createdby": null,
+ // "fk_updatedby": null,
+ // "fk_entity_id": this.entityId.toString()
+ // }
+ // this.listOfBranch.push(data);
+ // this.newElement.name = '';
+ }
+
+ public currentElement = -1;
+ editItem(i): void {
+ this.currentElement = i;
+ }
+
+ deleteItem(obj, i): void {
+ if (obj.entity_lender_branch_id !== null) {
+ obj.isactive = 0;
+ } else {
+ this.listOfBranch.splice(i, 1);
+ }
+ }
+
+ /** To Save/Edited Popup Data */
+ onSubmit() {
+ alert();
+ this.submitted = true;
+ // stop here if form is invalid
+ if (this._addEntityBranchFrom.invalid) {
+ // this.errorMessage = "Please Fill All Mandate Fields.";
+ return;
+ } else {
+ var formValues = this._addEntityBranchFrom.value;
+ //To Remove The "Null" With Key also
+ Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
+ alert(JSON.stringify(formValues.branch_details));
+ // this.entityService.updateEntityIdRegionInfoDetails(formValues.region_lender).subscribe(
+ // dataresult => {
+ // if (dataresult.status == 200) {
+ // console.log(dataresult);
+ // this.notifier.notify('success', 'Your Changes Updated.!');
+ // const arr = this._editEntityRegionFrom.controls.region_lender;
+ // arr.controls.splice(0);
+ // // this.getEntityIDRegionInfoDetails();
+ // }
+ // else {
+ // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ // // this.errorMessage = "Something Wents Wrong Try Again.!";
+ // }
+ // }, error => {
+ // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ // // this.errorMessage = "Some Thing Wents Wrong Try Again.!";
+ // });
+ }
+ }
+
+
+ saveBranch(): void {
+// alert();
+ var formValues = this._addEntityBranchFrom.value;
+ //To Remove The "Null" With Key also
+ Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
+ // alert(JSON.stringify(formValues.branch_details));
+
+ this.entityService.updateEntityIdBranchInfoDetails(formValues.branch_details).subscribe(data => {
+ if (data.dataStatus) {
+ this.notifier.notify('success', 'Your Changes Updated.!');
+ } else {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ }
+ }, err => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ })
+ }
+
+ reset(): void {
+ this.listOfBranch = [];
+ this.ngOnInit();
+ }
+}
+
+// "records": [
+// {
+// "entity_lender_branch_id": null,
+// "branch_name": "Dev Test Branch",
+// "isactive": "1",
+// "fk_createdby": "1",
+// "fk_updatedby": "1",
+// "fk_entity_id": "1"
+// }
+// ]
\ No newline at end of file
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html
index a94cc5b09..17b31563b 100755
--- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html
+++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html
@@ -234,6 +234,12 @@
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/settings/entity/entity.module.ts b/ng6-seed/src/app/settings/entity/entity.module.ts
index a6a5d04e7..74a14169f 100755
--- a/ng6-seed/src/app/settings/entity/entity.module.ts
+++ b/ng6-seed/src/app/settings/entity/entity.module.ts
@@ -38,6 +38,7 @@ import { EntityEditBillingInfoComponent } from './entity-edit/entity-edit-billin
import { DialogAddEditBillingInfo } from './entity-edit/entity-edit-billing-info/entity-edit-billing-info.component';
import { EntityEditVendorCityInfoComponent } from './entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component';
+import { EntityBranchAddComponent } from './entity-edit/entity-branch-add/entity-branch-add.component';
// import { MatTooltipModule } from '@angular/material/tooltip';
/**
* Custom angular notifier options
@@ -115,7 +116,8 @@ const customNotifierOptions: NotifierOptions = {
EntityEditPriceComponent,
EntityEditBillingInfoComponent,
DialogAddEditBillingInfo,
- EntityEditVendorCityInfoComponent
+ EntityEditVendorCityInfoComponent,
+ EntityBranchAddComponent
],
entryComponents: [
EntityEditComponent,
diff --git a/ng6-seed/src/app/settings/service/entity/entity.service.ts b/ng6-seed/src/app/settings/service/entity/entity.service.ts
index eb5ca70f8..1a859a99f 100755
--- a/ng6-seed/src/app/settings/service/entity/entity.service.ts
+++ b/ng6-seed/src/app/settings/service/entity/entity.service.ts
@@ -164,6 +164,22 @@ export class EntityService {
return this._http.post(this.apiUrl + "saveVendorCityMapping", {'records': Records });
}
+
+ getEntityBranchList(entity_id: any): Observable {
+// Add safe, URL encoded search parameter if there is a search term
+ const options = entity_id ?
+ { params: new HttpParams().set('entityid', entity_id) } : {};
+
+ return this._http.get(this.apiUrl + "listLenderBranches", options);
+ }
+
+ updateEntityIdBranchInfoDetails(Records: any): Observable{
+ Records.map(data=>{
+ data.fk_updatedby = data.fk_createdby == null ? null : this._aws.getlocale();
+ data.fk_createdby = data.fk_createdby == null ? this._aws.getlocale() : data.fk_createdby;
+ })
+ return this._http.post(this.apiUrl + "saveLenderBranches", {'records': Records });
+ }
/**
diff --git a/ng6-seed/src/assets/styles/app.scss b/ng6-seed/src/assets/styles/app.scss
index b8044770c..e6edd5b3e 100755
--- a/ng6-seed/src/assets/styles/app.scss
+++ b/ng6-seed/src/assets/styles/app.scss
@@ -44,6 +44,7 @@ Author: TrendSetter Themes
@import "scss/core";
@import "scss/material";
@import "scss/utilities/utilities";
+@import '~viewerjs/dist/viewer.css';
/* Add application styles & imports to this file! */