diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index 295b4eafe..bd5540dae 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -582,13 +582,36 @@ export class FamilyDetailsComponent implements OnInit { Ctrls.controls['earning_number_of_years_in_employment_or_business'].clearValidators(); - if(Ctrls.controls['non_earning_occupation'].value==1){ - Ctrls.controls['non_earning_if_others'].setValidators([Validators.required]); - } + if(Ctrls.controls['non_earning_occupation'].value==1) + { + Ctrls.controls['non_earning_if_others'].setValidators([Validators.required]) + + Ctrls.controls['non_earning_if_schoolorcollege'].setValue(''); + Ctrls.controls['non_earning_if_schoolorcollege'].clearValidators(); + + Ctrls.controls['non_earning_if_retired_from'].setValue(''); + Ctrls.controls['non_earning_if_retired_from'].clearValidators(); + } + + if(Ctrls.controls['non_earning_occupation'].value==2){ + + Ctrls.controls['non_earning_if_others'].setValue(''); + Ctrls.controls['non_earning_if_others'].clearValidators(); + Ctrls.controls['non_earning_if_schoolorcollege'].setValidators([Validators.required]); + + Ctrls.controls['non_earning_if_retired_from'].setValue(''); + Ctrls.controls['non_earning_if_retired_from'].clearValidators(); } if(Ctrls.controls['non_earning_occupation'].value==3){ + + Ctrls.controls['non_earning_if_others'].setValue(''); + Ctrls.controls['non_earning_if_others'].clearValidators(); + + Ctrls.controls['non_earning_if_schoolorcollege'].setValue(''); + Ctrls.controls['non_earning_if_schoolorcollege'].clearValidators(); + Ctrls.controls['non_earning_if_retired_from'].setValidators([Validators.required]); } } 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 9a7c908ff..0e272530a 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 @@ -167,7 +167,7 @@ + formControlName="business_volume_amount" type="text" OnlyNumber type="text" (keyup)="inWords($event.target.value,r)"> {{"₹"}} {{amtInwords[r]}} Only 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 73fcba573..090d17c51 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 @@ -147,19 +147,22 @@ export class NeighbourHoodComponent implements OnInit { } 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); + if(element.business_volume_amount != null){ + this.inWords(element.business_volume_amount,index); + } + // 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['neighbourhood_status'].setValue(data.records.neighbourhood_status!='' ? 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 : ''); } else { - 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)); } @@ -257,7 +260,6 @@ export class NeighbourHoodComponent implements OnInit { tempCount : number = 0; saveNeighbourhood(formData:any){ - // console.log('formData',formData); // let resultMessage:string=''; // const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; @@ -276,16 +278,16 @@ export class NeighbourHoodComponent implements OnInit { 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(); @@ -476,7 +478,7 @@ checkOthers(values){ /** Amount InWords */ inWords(e,i){ - this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); + this.amtInwords[i] = this._pd.convertNumberToWords(e); } compareObjects(o1: any, o2: any) { @@ -486,14 +488,14 @@ 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){ @@ -502,17 +504,17 @@ getOtherOrganisationOwner(value,i) { }); } 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.updateValueAndValidity();