+
+
+
+
+
+
+
+
-
-
-
-
-
-
- Remarks
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Remarks
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
index 67c721c9e..c0d355453 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
@@ -4,11 +4,13 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import { parse } from 'url';
+
@Component({
selector: 'app-neighbour-hood',
templateUrl: './neighbour-hood.component.html',
styleUrls: ['./neighbour-hood.component.scss']
})
+
export class NeighbourHoodComponent implements OnInit {
customer_segment_abbr: any;
subproduct_abbr: any;
@@ -22,7 +24,7 @@ export class NeighbourHoodComponent implements OnInit {
form_id:number;
private notifier: NotifierService;
- check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}]
+ check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference'}]
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''};
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''};
@@ -33,25 +35,24 @@ export class NeighbourHoodComponent implements OnInit {
finalRemarksList : any = [{'id': 1,'name': "Positive"},
{'id': 2,'name': "Negative"},
{'id': 3,'name': "Insufficient information provided"}];
-existCompanyList: any =[];
-mergeCompanyApplicant: any=[];
-isOrganisationOwner: any=[];
-amtInwords : any = [];
+ existCompanyList: any =[];
+ mergeCompanyApplicant: any=[];
+ isOrganisationOwner: any=[];
+ amtInwords : any = [];
// isOtherApplicant: any = [];
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef
) {
this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier;
this.form_id = 19;
- this.main_applicant = this.data.pdmaster_details.main_applicant;
- this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
- this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
- this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
- this.applicants = this.data.pdapplicants_detials;
- this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
- this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
-
- }
+ this.main_applicant = this.data.pdmaster_details.main_applicant;
+ this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
+ this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
+ this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
+ this.applicants = this.data.pdapplicants_detials;
+ this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
+ this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
+ }
ngOnInit() {
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
@@ -78,28 +79,29 @@ amtInwords : any = [];
}
})
+
this.initFormDetails();
// call neghbourhhod / reference check changes
- this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => {
- const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list'];
- const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list'];
- if(value==0){
- referencecheckControl.controls = [];
- referencecheckControl.setValue([]);
- if(neighbourhoodControl.value.length==0){
- neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
- }
- }
- else {
- neighbourhoodControl.controls = [];
- neighbourhoodControl.setValue([]);
- if(referencecheckControl.value.length==0){
- referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
- }
+ // this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => {
+ // const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list'];
+ // const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list'];
+ // if(value==0){
+ // referencecheckControl.controls = [];
+ // referencecheckControl.setValue([]);
+ // if(neighbourhoodControl.value.length==0){
+ // neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
+ // }
+ // }
+ // else {
+ // neighbourhoodControl.controls = [];
+ // neighbourhoodControl.setValue([]);
+ // if(referencecheckControl.value.length==0){
+ // referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
+ // }
- }
- });
+ // }
+ // });
}
@@ -108,7 +110,7 @@ amtInwords : any = [];
this._neighbourhoodForm = this._fb.group({
pdid:this.pdid,
formid:this.form_id,
- check_type:0,
+ // check_type:0,
neighbourhood_list: this._fb.array([]),
neighbourhood_status:'',
referencecheck_list: this._fb.array([]),
@@ -127,15 +129,15 @@ amtInwords : any = [];
params.pd_id = this.pdid;
params.pd_form_id = '19';
let referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list'];
- referencecheckControl.controls = [];
+ referencecheckControl.controls = [];
const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list'];
- neighbourhoodControl.controls=[];
+ neighbourhoodControl.controls=[];
this._pd.retriveForm(params).subscribe(data => {
if(data.dataStatus) {
let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : [];
let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : [];
- if(exist_neighbourhood_details.length>0 && data.records.check_type==0){
- exist_neighbourhood_details.forEach((element,index) => {
+ if(exist_neighbourhood_details.length>0){ /** && data.records.check_type==0 */
+ exist_neighbourhood_details.forEach((element,index) => {
this.toggleVisibility(element.did_not_know_the_business_operation,index,1);
this.toggleVisibility(element.did_not_know_the_owner,index,2);
// this.selectedApplicants(referencecheckControl,element.organisation_owner,index);
@@ -143,23 +145,24 @@ amtInwords : any = [];
this.getOtherOrganisationOwner(element.organisation_owner,index);
});
}
- else if(exist_ref_details.length>0 && data.records.check_type==1){
+ if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */
exist_ref_details.forEach((element,index) => {
- this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
-
+ this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
referencecheckControl.push(this.createReerenceCheck(element));
});
}
this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : '');
this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : '');
- this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : '');
+ // this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : '');
}
else {
- neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
-
- }
+ console.log('else',data.dataStatus);
+ console.log('else',data);
+ neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
+ referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
+ }
}, error => this.errorMessage = error);
}
@@ -251,51 +254,79 @@ amtInwords : any = [];
}
//save heighbourhood forms
+ tempCount : number = 0;
+
saveNeighbourhood(formData:any){
- let resultMessage:string='';
-
-
+ // console.log('formData',formData);
+
+ // let resultMessage:string='';
// const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list'];
- // const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl;
+ const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl;
+ // let RefCtrlLength : any = referencecheckControl.controls.length;
const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
+ let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
- if(formData.check_type==0){
- // neighbourhoodControl.contdols['neighbourhood_name'].setValidators([Validators.required]);
- // neighbourhoodControl.controls['neighbourhood_name'].updateValueAndValidity();
+ if (NbhdCtrlLength > 0) {
+ let Ncnt = 0;
+ while(Ncnt < NbhdCtrlLength){
- // neighbourhoodControl.controls['do_know'].setValidators([Validators.required]);
- // neighbourhoodControl.controls['do_know'].updateValueAndValidity();
- // return;
+ let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
+
+ nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
+ nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
+
+ nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
+ nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
+ // console.log('nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
+ if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
+ // console.log('IF nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
+ nbhdChildCtrl.controls['how_long_do_know_in_month'].setValidators([Validators.required]);
+ nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
+ nbhdChildCtrl.controls['how_long_do_know_in_year'].setValidators([Validators.required]);
+ nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
+ }
+ else if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == true){
+ // console.log('ELSE nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
+ nbhdChildCtrl.controls['how_long_do_know_in_month'].setValue('');
+ nbhdChildCtrl.controls['how_long_do_know_in_month'].clearValidators();
+ nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
+ nbhdChildCtrl.controls['how_long_do_know_in_year'].setValue('');
+ nbhdChildCtrl.controls['how_long_do_know_in_year'].clearValidators();
+ nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
+ }
+
+ if(nbhdChildCtrl.controls.did_not_know_the_owner.value == '' || nbhdChildCtrl.controls.did_not_know_the_owner.value == false){
+ nbhdChildCtrl.controls['organisation_owner'].setValidators([Validators.required]);
+ nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
+ }
+ else if(nbhdChildCtrl.controls.did_not_know_the_owner.value == true){
+ nbhdChildCtrl.controls['organisation_owner'].setValue('');
+ nbhdChildCtrl.controls['organisation_owner'].clearValidators();
+ nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
+ }
+ Ncnt++;
+ }
}
-
-
+ // }
+
// if(formData.check_type==1){
// referencecheckControl.controls['reference_name'].setValidators([Validators.required]);
// referencecheckControl.controls['reference_name'].updateValueAndValidity();
-
// referencecheckControl.controls['location'].setValidators([Validators.required]);
// referencecheckControl.controls['location'].updateValueAndValidity();
-
// referencecheckControl.controls['mobile'].setValidators([Validators.required]);
// referencecheckControl.controls['mobile'].updateValueAndValidity();
-
// referencecheckControl.controls['relationship_with'].setValidators([Validators.required]);
// referencecheckControl.controls['relationship_with'].updateValueAndValidity();
-
// referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]);
// referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity();
-
// referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]);
// referencecheckControl.controls['business_volume_amount'].updateValueAndValidity();
-
// referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]);
// referencecheckControl.controls['business_volume_unit'].updateValueAndValidity();
-
// referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]);
- // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity();
-
+ // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity()
// }
-
if (this._neighbourhoodForm.invalid) {
this.validateAllFormFields(this._neighbourhoodForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
@@ -305,7 +336,7 @@ amtInwords : any = [];
let saveRecords:any = {}
let referencecheck_list:any=[];
let neighbourhood_list:any=[];
- if(formData.check_type==0){
+ // if(formData.check_type==0){
formData.neighbourhood_list.forEach((element,key) => {
neighbourhood_list.push({
"neighbourhood_name":element.neighbourhood_name,
@@ -320,9 +351,9 @@ amtInwords : any = [];
})
});
saveRecords.neighbourhood_list=neighbourhood_list;
- resultMessage='Neihbourhood Updated.!'
- }
- else{
+ // resultMessage='Neihbourhood Updated.!'
+ // }
+ // else{
// this for referencecheck_list for selected
formData.referencecheck_list.forEach((element,key) => {
referencecheck_list.push({
@@ -345,10 +376,10 @@ amtInwords : any = [];
})
});
saveRecords.referencecheck_list=referencecheck_list;
- resultMessage='Reference Check Updated.!'
- }
+ // resultMessage='Reference Check Updated.!'
+ // }
- saveRecords.check_type=formData.check_type;
+ // saveRecords.check_type=formData.check_type;
saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid;
saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : '';
@@ -452,38 +483,36 @@ compareObjects(o1: any, o2: any) {
}
getOtherOrganisationOwner(value,i) {
- console.log('value',value,'I',i);
-let Ctrls = this._neighbourhoodForm.controls['neighbourhood_list'];
- console.log('ParCtrls',Ctrls);
-let ChdCtrls:any = Ctrls.controls[i];
- console.log('ChdCtrls',ChdCtrls);
- // return;
-
-
-let Avaliablity = 1;
-console.log('val',value);
-if(value.length>0){
- value.forEach(option => {
- if(option.id == 0 && option.group_id == 2){
- Avaliablity = option.id;
+ // console.log('value',value,'I',i);
+ let Ctrls = this._neighbourhoodForm.controls['neighbourhood_list'];
+ // console.log('ParCtrls',Ctrls);
+ let ChdCtrls:any = Ctrls.controls[i];
+ // console.log('ChdCtrls',ChdCtrls);
+ // return;
+ let Avaliablity = 1;
+ // console.log('val',value);
+ if(value.length>0){
+ value.forEach(option => {
+ if(option.id == 0 && option.group_id == 2){
+ Avaliablity = option.id;
+ }
+ });
}
- });
-}
-if(Avaliablity == 0){
-// console.log('if Avaliablity',Avaliablity);
+ if(Avaliablity == 0){
+ // console.log('if Avaliablity',Avaliablity);
- ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]);
- this.isOrganisationOwner[i] = true;
-}else if(Avaliablity == 1){
-// console.log('else Avaliablity',Avaliablity);
-// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
- ChdCtrls.controls.other_organisation_owner.setValue('');
- ChdCtrls.controls.other_organisation_owner.clearValidators();
- this.isOrganisationOwner[i] = false;
-// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
-}
+ ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]);
+ this.isOrganisationOwner[i] = true;
+ }else if(Avaliablity == 1){
+ // console.log('else Avaliablity',Avaliablity);
+ // console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
+ ChdCtrls.controls.other_organisation_owner.setValue('');
+ ChdCtrls.controls.other_organisation_owner.clearValidators();
+ this.isOrganisationOwner[i] = false;
+ // console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
+ }
-ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
-}
+ ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
+ }
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html
index e3adb2011..ccb40fa53 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html
@@ -275,7 +275,7 @@
Area Covered by the Property
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
index d9bfc9e7e..2cea54fae 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
@@ -63,7 +63,7 @@ export class RentalVerificationComponent implements OnInit {
this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier;
this.form_id = 17;
- this.main_applicant = this.data.pdmaster_details.main_applicant;
+ this.main_applicant = this.data.pdmaster_details.main_applicant;
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
@@ -743,6 +743,11 @@ validateAllFormFields(formGroup: any) {
});
}
+ngOnDestroy() {
+ // console.log('Component Destoryed');
+ const index = this.data.pdapplicants_detials.findIndex(name => name.applicant_name === 'Others');
+ this.data.pdapplicants_detials.splice(index, 1);
+}
}