This commit is contained in:
venbatechnologies@gmail.com 2019-01-02 17:38:09 +05:30
commit a94c457a34
47 changed files with 539 additions and 413 deletions

View File

@ -61,6 +61,7 @@
"ngx-mat-select-search": "^1.3.1",
"ngx-perfect-scrollbar": "5.0.0-7",
"ngx-viewer": "^1.0.1",
"node-sass": "^4.11.0",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.2.0",
"rxjs": "^6.3.1",

View File

@ -121,7 +121,8 @@
</div>
<div fxFlex="100">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Is there any other premises from which business activity is being run?"
<!-- <mat-select placeholder="Is there any other premises from which business activity is being run?"-->
<mat-select placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"
formControlName="bussiness_activity" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>

View File

@ -12,7 +12,7 @@
mat-form-field {
margin: 0 2%;
}
.cdk-global-overlay-wrapper{
::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;

View File

@ -15,6 +15,9 @@ tr.mat-footer-row {
border-top: 1px solid #e0e0e0;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.mat-form-field {
width: 100%;
}

View File

@ -8,6 +8,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;

View File

@ -9,7 +9,9 @@
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -30,7 +30,9 @@
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;

View File

@ -94,6 +94,7 @@ export class BusinessInfoComponent implements OnInit {
this.getStateCityList();
this.initBusinessForm();
this.getCompanyRelation();
this.getCompanyListForBusiness();
// const Desgn = <FormArray>this.businessForm.controls['designation'];
// const Partnr = <FormArray>this.businessForm.controls['partners'];
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
@ -516,7 +517,7 @@ export class BusinessInfoComponent implements OnInit {
// otherDoc.push(this.createDocument());
// load exist company list from master
this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name);
// this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name);
this.businessForm.controls['profession_name'].valueChanges.subscribe(val => {
val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('profession_name_other');
@ -1261,4 +1262,12 @@ export class BusinessInfoComponent implements OnInit {
return merged.length > 0 ? merged : [];
}
}
getCompanyListForBusiness(): void{
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records;
}
})
}
}

View File

@ -8,6 +8,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;

View File

@ -28,7 +28,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;
}

View File

@ -6,4 +6,7 @@ mat-form-field {
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -11,4 +11,7 @@
.example-margin {
margin: 0 10px;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -19,7 +19,9 @@
background: #62B013;
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -1,4 +1,4 @@
<form class="address" [formGroup]="familyForm">
<!--<form class="address" [formGroup]="familyForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
@ -255,11 +255,11 @@
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>
<notifier-container></notifier-container>-->
<!--<h2 mat-dialog-title class="paragraph_change">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
@ -532,4 +532,4 @@
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>-->
<notifier-container></notifier-container>

View File

@ -21,7 +21,9 @@
// background: #62B013;
// color: white;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;

View File

@ -1,269 +1,3 @@
import {
Component,
OnInit,
Inject,
Input, Output
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
@Component({
selector: 'app-family-details',
templateUrl: './family-details.component.html',
styleUrls: ['./family-details.component.scss']
})
export class FamilyDetailsComponent implements OnInit {
//@Input() pdid: number;
pageTitle: string ="Other Family Details";
pdid : string;
form_id : number;
private notifier: NotifierService;
public familyForm: FormGroup;
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
id: 1
}, {
type: 'Non Earning',
id: 2
}]
relationData: any = [];
occupationData: any = [];
//personMetData: any = [];
ownerShipData: any = [];
customerSegData: any = [];
// earnMemberArrCount :any ;
// nonEarnMemberArrCount :any ;
count : number;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
}
ngOnInit() {
this.getMasterDetails('RELATIONSHIPS',1);
this.getMasterDetails('OCCUPATIONMEMBERS',2);
//this.getMasterDetails('PERSONSMET',3);
this.getMasterDetails('RESIDENCEOWNERSHIP',4);
this.getMasterDetails('CUSTOMERSEGMENT',5);
this.initFamilyForm();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '6';
this._pd.retriveForm(params).subscribe(data => {
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
const value = <FormArray>this.familyForm.controls['earningMembers'];
if (data.status == 200) {
this.familyForm.controls.selected_person.setValue(data.records.selected_person);
this.familyForm.controls.residence_place.setValue(data.records.residence_place);
this.familyForm.controls.residence_city.setValue(data.records.residence_city);
this.familyForm.controls.residence_state.setValue(data.records.residence_state);
this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
this.familyForm.controls.rent.setValue(data.records.rent);
this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
} else {
// value.push(this.createMembers());
// control.push(this.createNonMembers());
}
});
}
initgenerateFamilyMembersDetailsGet(val): FormGroup {
return this.fb.group({
family_member_name : [val.family_member_name, Validators.compose([])],
family_member_relationship : [val.family_member_relationship, Validators.compose([])],
family_member_age : [val.family_member_age, Validators.compose([])],
family_member_earning_status : [val.family_member_earning_status, Validators.compose([])],
earning_segment: [val.earning_segment, Validators.compose([])],
earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
})
}
generateFamilyMembersDetailsGetData(data) {
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
for (let val of result) {
const control = <FormArray>this.familyForm.controls['family_members_details'];
control.push(this.initgenerateFamilyMembersDetailsGet(val));
}
}
}
onSearchChange(e):void {
e.preventDefault();
}
public initFamilyForm(): void {
this.familyForm = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
residence_pin: ['', Validators.compose([])],
residence_No_of_years: ['', Validators.compose([])],
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
family_details_form_remark: ['']
});
}
getNumberOfFamilyMemberDetails(){
// alert(this.familyForm.controls.total_number_of_family_members.valid);
if(this.familyForm.controls.total_number_of_family_members.valid){
let totalMem = this.familyForm.get('total_number_of_family_members').value;
const control = <FormArray>this.familyForm.controls.family_members_details;
if(totalMem > control.length) {
let len = totalMem - control.length;
for(let i = 0; i < len; i++){
control.push(this.generateFamilyMembersDetailsGet());
}
} else if (totalMem < control.length) {
// control.controls.slice(0, totalMem);
control.controls = [];
for(let i = 0; i < totalMem; i++){
control.push(this.generateFamilyMembersDetailsGet());
}
}
} else {
}
}
generateFamilyMembersDetailsGet(): FormGroup {
return this.fb.group({
family_member_name : ['', Validators.compose([])],
family_member_relationship : ['', Validators.compose([])],
family_member_age : ['', Validators.compose([])],
family_member_earning_status : ['', Validators.compose([])],
earning_segment: ['', Validators.compose([])],
earning_gross_income_per_month: ['', Validators.compose([])],
earning_name_of_the_employer_or_business: ['', Validators.compose([])],
earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
non_earning_occupation: ['', Validators.compose([])],
non_earning_if_others: ['', Validators.compose([])],
non_earning_if_retired_from: ['', Validators.compose([])],
})
}
// get all master details
getMasterDetails(table:string,type:number){
this._pd.getAllMasterDatas(table).subscribe(
data => {
if (data.status == 200) {
if(type==1){
this.relationData=data.records.filter(item => item.isactive == 1);
}
else if(type==2){
this.occupationData=data.records.filter(item => item.isactive == 1);
}
// else if(type==3){
// this.personMetData=data.records.filter(item => item.isactive == 1);
// }
else if(type==4){
this.ownerShipData=data.records.filter(item => item.isactive == 1);
}
else if(type==5){
this.customerSegData=data.records.filter(item => item.isactive == 1);
}
}
});
}
submitFamily() {
if (!this.familyForm.valid) {
return;
}
var records = this.familyForm.value;
//To Remove The "Null" With Key also
Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
// records.other_family_details = answerFormValues;
records.pdid = this.pdid;
records.formid = '6';
// records.fk_createdby = '251';
this._pd.saveForm(records).subscribe(data => {
this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// validateAllFormFields(formGroup: FormGroup) {
// Object.keys(formGroup.controls).forEach(field => {
// const control = formGroup.get(field);
// if (control instanceof FormControl) {
// control.markAsTouched({onlySelf: true});
// } else if (control instanceof FormGroup) {
// this.validateAllFormFields(control);
// }
// });
// }
// /** On Key Press Event For Age */
// keyPress(event: any) {
// const pattern = /[0-9]/;
// let inputChar = String.fromCharCode(event.charCode);
// if (event.keyCode != 8 && !pattern.test(inputChar)) {
// event.preventDefault();
// }
// }
}
// =================== other family details multiple add
// import {
// Component,
// OnInit,
@ -343,7 +77,7 @@ export class FamilyDetailsComponent implements OnInit {
// //this.getMasterDetails('PERSONSMET',3);
// this.getMasterDetails('RESIDENCEOWNERSHIP',4);
// this.getMasterDetails('CUSTOMERSEGMENT',5);
// this.initFamilyFormDetails();
// this.initFamilyForm();
// let params: any = {};
// params.pd_id = this.pdid;
// params.pd_form_id = '6';
@ -351,19 +85,18 @@ export class FamilyDetailsComponent implements OnInit {
// const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
// const value = <FormArray>this.familyForm.controls['earningMembers'];
// if (data.status == 200) {
// this.initFamilyForm(data.records);
// // this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// // this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// // this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// // this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// // this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// // this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// // this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// // this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// // this.familyForm.controls.rent.setValue(data.records.rent);
// // this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
// // this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// // this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
// this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// this.familyForm.controls.rent.setValue(data.records.rent);
// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
// this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
// } else {
// // value.push(this.createMembers());
// // control.push(this.createNonMembers());
@ -402,111 +135,29 @@ export class FamilyDetailsComponent implements OnInit {
// onSearchChange(e):void {
// e.preventDefault();
// }
// public initFamilyFormDetails(): void {
// public initFamilyForm(): void {
// this.familyForm = this.fb.group({
// family_details: this.fb.array([]),
// family_details_form_remark: ['']
// })
// }
// public noRecordsFound: Boolean = false;
// public initFamilyForm(records): void {
// // let data = [...records];
// let recordss = {
// "selected_person":"95",
// "residence_place":"check ",
// "residence_city":"check ",
// "residence_state":"check ",
// "residence_pin":"123456",
// "residence_No_of_years":"2",
// "residence_ownership":"1",
// "ownershipOther":"",
// "rent":"",
// "total_number_of_family_members":"2",
// "family_members_details":{
// "1":{
// "family_member_name":"name",
// "family_member_relationship":"1",
// "family_member_age":"21",
// "family_member_earning_status":"1",
// "earning_segment":"1",
// "earning_gross_income_per_month":"12000",
// "earning_name_of_the_employer_or_business":"check",
// "earning_number_of_years_in_employment_or_business":"2",
// "non_earning_occupation":"",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// },
// "2":{
// "family_member_name":"chekc ",
// "family_member_relationship":"2",
// "family_member_age":"31",
// "family_member_earning_status":"2",
// "earning_segment":"",
// "earning_gross_income_per_month":"",
// "earning_name_of_the_employer_or_business":"",
// "earning_number_of_years_in_employment_or_business":"",
// "non_earning_occupation":"9",
// "non_earning_if_others":"others check ",
// "non_earning_if_retired_from":""
// }
// },
// "family_details_form_remark":"check remark"
// };
// if(recordss === null) {
// this.fb.group({
// selected_person: ['', Validators.compose([Validators.required])],
// residence_place: ['', Validators.compose([])],
// residence_city: ['', Validators.compose([])],
// residence_state: ['', Validators.compose([])],
// residence_pin: ['', Validators.compose([])],
// residence_No_of_years: ['', Validators.compose([])],
// residence_ownership: ['', Validators.compose([])],
// ownershipOther: [''],
// rent: [''],
// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
// family_members_details: this.fb.array([this.addFamilyMemberDetails()]),
// });
// } else {
// let formData: FormGroup = this.fb.group({
// selected_person: ['1', Validators.compose([Validators.required])],
// residence_place: ['as', Validators.compose([])],
// residence_city: ['as', Validators.compose([])],
// residence_state: ['sa', Validators.compose([])],
// residence_pin: ['sa', Validators.compose([])],
// residence_No_of_years: ['sa', Validators.compose([])],
// residence_ownership: ['s', Validators.compose([])],
// ownershipOther: ['s'],
// rent: ['as'],
// total_number_of_family_members: ['1', Validators.compose([Validators.min(1), Validators.max(20)])],
// selected_person: ['', Validators.compose([Validators.required])],
// residence_place: ['', Validators.compose([])],
// residence_city: ['', Validators.compose([])],
// residence_state: ['', Validators.compose([])],
// residence_pin: ['', Validators.compose([])],
// residence_No_of_years: ['', Validators.compose([])],
// residence_ownership: ['', Validators.compose([])],
// ownershipOther: [''],
// rent: [''],
// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
// family_members_details: this.fb.array([]),
// family_details_form_remark: ['']
// });
// const control = <FormArray>this.familyForm.controls['family_details'];
// control.push(formData);
// console.log(this.familyForm.value);
// }
// this.noRecordsFound = true;
// }
// addFamilyMemberDetails(): void {
// }
// addMoreApplicantFamilyDetails(e): void {
// e.stopPropagation();
// this.initFamilyForm('chck');
// }
// getNumberOfFamilyMemberDetails(inx){
// // alert(inx);
// let formData = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls;
// // alert(formData['total_number_of_family_members'].value);
// getNumberOfFamilyMemberDetails(){
// // alert(this.familyForm.controls.total_number_of_family_members.valid);
// if(formData['total_number_of_family_members'].valid){
// let totalMem = formData['total_number_of_family_members'].value;
// const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
// if(this.familyForm.controls.total_number_of_family_members.valid){
// let totalMem = this.familyForm.get('total_number_of_family_members').value;
// const control = <FormArray>this.familyForm.controls.family_members_details;
// if(totalMem > control.length) {
// let len = totalMem - control.length;
// for(let i = 0; i < len; i++){
@ -523,7 +174,7 @@ export class FamilyDetailsComponent implements OnInit {
// }
// }
// generateFamilyMembersDetailsGet(): FormGroup {
// return this.fb.group({
// family_member_name : ['', Validators.compose([])],
@ -560,7 +211,7 @@ export class FamilyDetailsComponent implements OnInit {
// else if(type==5){
// this.customerSegData=data.records.filter(item => item.isactive == 1);
// }
// }
// });
// }
@ -576,12 +227,11 @@ export class FamilyDetailsComponent implements OnInit {
// records.pdid = this.pdid;
// records.formid = '6';
// // records.fk_createdby = '251';
// console.log(JSON.stringify(records));
// // this._pd.saveForm(records).subscribe(data => {
// // this.notifier.notify('success', 'Saved Successfully.');
// // }, error => {
// // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// // });
// this._pd.saveForm(records).subscribe(data => {
// this.notifier.notify('success', 'Saved Successfully.');
// }, error => {
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// });
// }
// // validateAllFormFields(formGroup: FormGroup) {
// // Object.keys(formGroup.controls).forEach(field => {
@ -597,11 +247,416 @@ export class FamilyDetailsComponent implements OnInit {
// // /** On Key Press Event For Age */
// // keyPress(event: any) {
// // const pattern = /[0-9]/;
// // let inputChar = String.fromCharCode(event.charCode);
// // if (event.keyCode != 8 && !pattern.test(inputChar)) {
// // event.preventDefault();
// // }
// // }
// }
// }
// =================== other family details multiple add
import {
Component,
OnInit,
Inject,
Input, Output
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: 'app-family-details',
templateUrl: './family-details.component.html',
styleUrls: ['./family-details.component.scss']
})
export class FamilyDetailsComponent implements OnInit {
//@Input() pdid: number;
pageTitle: string = "Other Family Details";
pdid: string;
form_id: number;
private notifier: NotifierService;
public familyForm: FormGroup;
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
id: 1
}, {
type: 'Non Earning',
id: 2
}]
relationData: any = [];
occupationData: any = [];
//personMetData: any = [];
ownerShipData: any = [];
customerSegData: any = [];
// earnMemberArrCount :any ;
// nonEarnMemberArrCount :any ;
count: number;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
}
ngOnInit() {
this.getMasterDetails('RELATIONSHIPS', 1);
this.getMasterDetails('OCCUPATIONMEMBERS', 2);
//this.getMasterDetails('PERSONSMET',3);
this.getMasterDetails('RESIDENCEOWNERSHIP', 4);
this.getMasterDetails('CUSTOMERSEGMENT', 5);
this.initFamilyFormDetails();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '6';
this._pd.retriveForm(params).subscribe(data => {
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
const value = <FormArray>this.familyForm.controls['earningMembers'];
if (data.status == 200) {
this.initFamilyForm(data.records.family_details);
// this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// this.familyForm.controls.rent.setValue(data.records.rent);
// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
} else {
// value.push(this.createMembers());
// control.push(this.createNonMembers());
this.initFamilyForm(null);
}
});
}
initgenerateFamilyMembersDetailsGet(val): FormGroup {
return this.fb.group({
family_member_name: [val.family_member_name, Validators.compose([])],
family_member_relationship: [val.family_member_relationship, Validators.compose([])],
family_member_age: [val.family_member_age, Validators.compose([])],
family_member_earning_status: [val.family_member_earning_status, Validators.compose([])],
earning_segment: [val.earning_segment, Validators.compose([])],
earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
})
}
generateFamilyMembersDetailsGetData(data) {
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
for (let val of result) {
const control = <FormArray>this.familyForm.controls['family_members_details'];
control.push(this.initgenerateFamilyMembersDetailsGet(val));
}
}
}
onSearchChange(e): void {
e.preventDefault();
}
public initFamilyFormDetails(): void {
this.familyForm = this.fb.group({
family_details: this.fb.array([]),
family_details_form_remark: ['']
})
}
public noRecordsFound: Boolean = false;
public initFamilyForm(records): void {
// let data = [...records];
// let recordss = [
// {
// "selected_person":"51",
// "residence_place":"as",
// "residence_city":"as",
// "residence_state":"sa",
// "residence_pin":"sa",
// "residence_No_of_years":12,
// "residence_ownership":"1",
// "ownershipOther":"s",
// "rent":"as",
// "total_number_of_family_members":2,
// "family_members_details":[
// {
// "family_member_name":"ce",
// "family_member_relationship":"2",
// "family_member_age":"12",
// "family_member_earning_status":"1",
// "earning_segment":"6",
// "earning_gross_income_per_month":"12",
// "earning_name_of_the_employer_or_business":"21",
// "earning_number_of_years_in_employment_or_business":"12",
// "non_earning_occupation":null,
// "non_earning_if_others":null,
// "non_earning_if_retired_from":null
// },
// {
// "family_member_name":"csdcs",
// "family_member_relationship":"2",
// "family_member_age":"21",
// "family_member_earning_status":"1",
// "earning_segment":"4",
// "earning_gross_income_per_month":"as",
// "earning_name_of_the_employer_or_business":"as",
// "earning_number_of_years_in_employment_or_business":"sa",
// "non_earning_occupation":"",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// }
// ]
// },
// {
// "selected_person":"51",
// "residence_place":"as",
// "residence_city":"as",
// "residence_state":"sa",
// "residence_pin":"sa",
// "residence_No_of_years":13,
// "residence_ownership":"2",
// "ownershipOther":"s",
// "rent":"as",
// "total_number_of_family_members":"1",
// "family_members_details":[
// {
// "family_member_name":"dinesh",
// "family_member_relationship":"4",
// "family_member_age":"26",
// "family_member_earning_status":"2",
// "earning_segment":"",
// "earning_gross_income_per_month":"",
// "earning_name_of_the_employer_or_business":"",
// "earning_number_of_years_in_employment_or_business":"",
// "non_earning_occupation":"2",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// }
// ]
// }
// ];
if (records === null) {
let formData: FormGroup = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
residence_pin: ['', Validators.compose([])],
residence_No_of_years: ['', Validators.compose([])],
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
});
const control = <FormArray>this.familyForm.controls['family_details'];
control.push(formData);
} else {
for (let val of records) {
let formData: FormGroup = this.fb.group({
selected_person: [val.selected_person, Validators.compose([Validators.required])],
residence_place: [val.residence_place, Validators.compose([])],
residence_city: [val.residence_city, Validators.compose([])],
residence_state: [val.residence_state, Validators.compose([])],
residence_pin: [val.residence_pin, Validators.compose([])],
residence_No_of_years: [val.residence_No_of_years, Validators.compose([])],
residence_ownership: [val.residence_ownership, Validators.compose([])],
ownershipOther: [val.ownershipOther || null],
rent: [val.rent || null],
total_number_of_family_members: [val.total_number_of_family_members, Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
});
const control = <FormArray>this.familyForm.controls['family_details'];
control.push(formData);
let inx = control.length - 1;
this.addFamilyMemberDetailsWithData(inx, val.family_members_details);
console.log(control);
}
}
this.noRecordsFound = true;
}
addFamilyMemberDetailsWithData(inx, val): void {
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
for (let vals of val) {
let datas = this.fb.group({
family_member_name: [vals.family_member_name || null, Validators.compose([])],
family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])],
family_member_age: [vals.family_member_age || null, Validators.compose([])],
family_member_earning_status: [vals.family_member_earning_status || null, Validators.compose([])],
earning_segment: [vals.earning_segment || null, Validators.compose([])],
earning_gross_income_per_month: [vals.earning_gross_income_per_month || null, Validators.compose([])],
earning_name_of_the_employer_or_business: [vals.earning_name_of_the_employer_or_business || null, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [vals.earning_number_of_years_in_employment_or_business || null, Validators.compose([])],
non_earning_occupation: [vals.non_earning_occupation || null, Validators.compose([])],
non_earning_if_others: [vals.non_earning_if_others || null, Validators.compose([])],
non_earning_if_retired_from: [vals.non_earning_if_retired_from || null, Validators.compose([])],
});
control.push(datas);
}
}
addFamilyMemberDetails() {
}
addMoreApplicantFamilyDetails(e): void {
e.stopPropagation();
this.initFamilyForm('chck');
}
getNumberOfFamilyMemberDetails(inx) {
// alert(inx);
let formData = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls;
// alert(formData['total_number_of_family_members'].value);
// alert(this.familyForm.controls.total_number_of_family_members.valid);
if (formData['total_number_of_family_members'].valid) {
let totalMem = formData['total_number_of_family_members'].value;
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
if (totalMem > control.length) {
let len = totalMem - control.length;
for (let i = 0; i < len; i++) {
control.push(this.generateFamilyMembersDetailsGet());
}
} else if (totalMem < control.length) {
// control.controls.slice(0, totalMem);
control.controls = [];
for (let i = 0; i < totalMem; i++) {
control.push(this.generateFamilyMembersDetailsGet());
}
}
} else {
}
}
generateFamilyMembersDetailsGet(): FormGroup {
return this.fb.group({
family_member_name: ['', Validators.compose([])],
family_member_relationship: ['', Validators.compose([])],
family_member_age: ['', Validators.compose([])],
family_member_earning_status: ['', Validators.compose([])],
earning_segment: ['', Validators.compose([])],
earning_gross_income_per_month: ['', Validators.compose([])],
earning_name_of_the_employer_or_business: ['', Validators.compose([])],
earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
non_earning_occupation: ['', Validators.compose([])],
non_earning_if_others: ['', Validators.compose([])],
non_earning_if_retired_from: ['', Validators.compose([])],
})
}
// get all master details
getMasterDetails(table: string, type: number) {
this._pd.getAllMasterDatas(table).subscribe(
data => {
if (data.status == 200) {
if (type == 1) {
this.relationData = data.records.filter(item => item.isactive == 1);
}
else if (type == 2) {
this.occupationData = data.records.filter(item => item.isactive == 1);
}
// else if(type==3){
// this.personMetData=data.records.filter(item => item.isactive == 1);
// }
else if (type == 4) {
this.ownerShipData = data.records.filter(item => item.isactive == 1);
}
else if (type == 5) {
this.customerSegData = data.records.filter(item => item.isactive == 1);
}
}
});
}
submitFamily() {
if (!this.familyForm.valid) {
return;
}
var records = this.familyForm.value;
//To Remove The "Null" With Key also
Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
// records.other_family_details = answerFormValues;
records.pdid = this.pdid;
records.formid = '6';
// records.fk_createdby = '251';
console.log(JSON.stringify(records));
this._pd.saveForm(records).subscribe(data => {
this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// validateAllFormFields(formGroup: FormGroup) {
// Object.keys(formGroup.controls).forEach(field => {
// const control = formGroup.get(field);
// if (control instanceof FormControl) {
// control.markAsTouched({onlySelf: true});
// } else if (control instanceof FormGroup) {
// this.validateAllFormFields(control);
// }
// });
// }
// /** On Key Press Event For Age */
// keyPress(event: any) {
// const pattern = /[0-9]/;
// let inputChar = String.fromCharCode(event.charCode);
// if (event.keyCode != 8 && !pattern.test(inputChar)) {
// event.preventDefault();
// }
// }
}

View File

@ -6,6 +6,9 @@
color: #fff !important;
background-color: #e00201 !important;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
// ::ng-deep .cdk-overlay-pane{
// max-width: 100vw !important;
// width: 100% !important;

View File

@ -21,7 +21,9 @@
.underline input {
border: none;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.greenhighlight {
color: green;
}

View File

@ -23,4 +23,7 @@
.p-text {
color:#e00201 !important;
font-weight: bold;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -9,7 +9,9 @@
// margin: 0 2%;
// width:100%;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -21,7 +21,9 @@
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -26,8 +26,7 @@
</div>
</mat-card-header>
<mat-card-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0">
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
<mat-card-content>
<mat-card-content *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
<mat-form-field style="width: 42%">
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text">
</mat-form-field>
@ -51,7 +50,7 @@
matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0">
<mat-icon>delete</mat-icon></button>
</mat-card-content>
</mat-card>
</mat-card-content>
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;" [formGroupName]="r">

View File

@ -18,4 +18,7 @@
.example-radio-button {
margin: 0 4%;
color: #000 !important
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -16,7 +16,9 @@
// background: #62B013;
// color: white;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -12,7 +12,9 @@
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 {

View File

@ -25,7 +25,9 @@
// width: 45%;
// margin: 0 2%;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -26,6 +26,9 @@
.mat-card-content {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.mat-card-actions {
background-color: white;
}

View File

@ -7,6 +7,9 @@
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-card.parent_mat_card > {
mat-card-header {
display: flex;

View File

@ -469,6 +469,15 @@ export class PdTrigerService {
catchError(this.handleError('operation', []))
)
}
getCompaniesListsForBusiness(pdid: any): Observable<any> {
return this._http.post<any>(this.apiUrl + "getCompaniesListsForBusiness", { "records":{ "pd_id" : pdid}})
.pipe(
catchError(this.handleError('operation', []))
)
}
// private handleError<T>(operation = 'operation', result?: T) {
// return (error: any): Observable<T> => {
// return of(result as T);

0
ng6-seed/src/app/shared/rating/rating.component.html Normal file → Executable file
View File

0
ng6-seed/src/app/shared/rating/rating.component.scss Normal file → Executable file
View File

View File

0
ng6-seed/src/app/shared/rating/rating.component.ts Normal file → Executable file
View File