From e223ae4acfd693f30aec8e723f75fc5b1eb62ce9 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 30 Nov 2018 18:57:46 +0530 Subject: [PATCH 1/3] personal form changes --- .../personal-info.component.html | 230 +++++----- .../personal-info.component.scss | 7 +- .../personal-info/personal-info.component.ts | 401 ++++++++++-------- 3 files changed, 343 insertions(+), 295 deletions(-) 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 883feab00..62e80b5f4 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 @@ -1,138 +1,142 @@

Personal Details

+ + + Main Applicant + +
- - - -
- -
- - - Main Applicant - -
-
- - - + + - - + + + + + Enter Valid Age. + + + + + + + + + + {{earning.earning_member_status}} + + + + + + + + {{education.qualification_name}} + + + + + + +
- - Enter Valid Age. + + + + + + Co Applicant + + + + + + + + + + + + Enter Valid Age. + + + + + + + + + + + + {{earning.earning_member_status}} + + - - - - - - - - - {{education.qualification_name}} - - - - - - - - {{earning.earning_member_status}} - - - -
-
- - - - - -
- + + - - - -
- - - Co Applicant - -
-
- - - - - - - - - Enter Valid Age. - - - - - - - - - - - - - {{education.qualification_name}} - - + + + {{education.qualification_name}} + + + + + + + + + + + {{rel.name}} + + + + - - - - - - {{earning.earning_member_status}} - - - - - - - - {{rel.name}} - - - -
-
- - -
- +
- -
- -
+ +
+ + -
+ + + + + + + + - + -
+
+ + Remarks + + +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss index 776d000ca..5ebd7c76e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss @@ -3,4 +3,9 @@ } .mat-card-actions { background-color: white; - } \ No newline at end of file + } + + mat-form-field { + margin: 0 2%; + } + \ No newline at end of file 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 0302aca2d..a6618c718 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 @@ -13,6 +13,7 @@ export class PersonalInfoComponent implements OnInit { //qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"]; //earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"]; + loadDataStatus: boolean=true; earningStatus:any=[]; qualifications:any=[]; relationShipList:any=[]; @@ -25,15 +26,26 @@ export class PersonalInfoComponent implements OnInit { public mainApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status"]; public coApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status","Relationship"]; - + public const_main_applicant : any = { + "name_ans": '', + "age_ans":'', + "earning_ans": '', + "entity_ans": '', + "qualification_ans": '', + "current_added_status":1 + }; + public const_co_applicant : any = { + "name_ans": '', + "age_ans":'', + "earning_ans": '', + "entity_ans": '', + "qualification_ans": '', + "relation_ans": '', + "current_added_status":1 + }; public mainApplicantDetails :any=[]; public coApplicantDetails :any=[]; - errorMessage:any; - //coItem:any; - //mainItem:any; - - repeat:number=3; constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService) { this.notifier = notifier; @@ -41,7 +53,8 @@ export class PersonalInfoComponent implements OnInit { } ngOnInit() { - this.loadPDDetails(this.pdid,this.form_id); + this.initFormDetails() + this.loadPDDetails(); this.getMasterDetails('RELATIONSHIPS',1); this.getMasterDetails('EARNINGMEMBERSSTATUS',2); this.getMasterDetails('EDUQUALIFICATION',3); @@ -51,155 +64,71 @@ export class PersonalInfoComponent implements OnInit { } // load form pd details - loadPDDetails(pd:string,form:number){ - + loadPDDetails(){ this._pd.getPDFormDetailsWithID(this.pdid,this.form_id).subscribe( data => { - if (data.status == 200) { - this.loadFormWithIDData(data.records); + const mainValue = this._personalForm.controls['main_applicant_details']; + const coValue = this._personalForm.controls['co_applicant_details']; + mainValue.controls = []; + coValue.controls = []; + if (data.dataStatus == true) { + let retriveData = data.records; + this._personalForm.controls['personal_info_form_remark'].setValue(data.records.personal_info_form_remark ? data.records.personal_info_form_remark : ''); + let pullMainApplicant = Object.keys(data.records.main_applicant_details).map(function(key) { + return data.records.main_applicant_details[key]; + }); + + if (pullMainApplicant.length > 0) { + pullMainApplicant.forEach(val => { + val.current_added_status=0 + mainValue.push(this.loadMainApplicant(val)); + }); + // retriveData.main_applicant_details = pullMainApplicant; + } else { + mainValue.push(this.loadMainApplicant(this.const_main_applicant)); + } + + if(data.records.co_applicant_details){ + let pullCoApplicant = Object.keys(data.records.co_applicant_details).map(function(key) { + return data.records.co_applicant_details[key]; + }); + if (pullCoApplicant.length > 0) { + pullCoApplicant.forEach(val => { + val.current_added_status=0 + coValue.push(this.loadCoApplicant(val)); + }); + // retriveData.co_applicant_details = pullCoApplicant; + } else { + coValue.push(this.loadCoApplicant(this.const_co_applicant)); + } + } + else { + coValue.push(this.loadCoApplicant(this.const_co_applicant)); + } } - else if(data.status == 204){ - - this.loadFormData(); + else if(data.dataStatus == false){ + this.mainApplicantDetails.forEach(item => { + item.current_added_status=0 + mainValue.push(this.loadDefaultMainApplicant(item)) + }); - - } + // check co applicant + if(this.coApplicantDetails.length > 0){ + this.coApplicantDetails.forEach(coItem => { + coItem.current_added_status=0 + coValue.push(this.loadDefaultCoApplicant(coItem) + ) + }); + } + else { + coValue.push(this.loadCoApplicant(this.const_co_applicant)) + } + + } }, error => this.errorMessage = error); } -loadDataStatus: boolean; - -loadFormWithIDData(data) { - // main applicant - var main_result = Object.keys(data.main_applicant_details).map(function(key) { - return data.main_applicant_details[key]; - }); - - let mainApplicantGroup = new FormArray(main_result.map((item,key) => new FormGroup({ - name_ans:new FormControl(item.name_ans, Validators.required), - age_ans:new FormControl(item.age_ans, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])), - entity_ans:new FormControl(item.entity_ans, Validators.required), - qualification_ans:new FormControl(item.qualification_ans, Validators.required), - earning_ans:new FormControl(item.earning_ans, Validators.required), - }))); - // co applicant - let coApplicantGroup; - if(data.co_applicant_details!=undefined){ - var co_result = Object.keys(data.co_applicant_details).map(function(key) { - return data.co_applicant_details[key]; - }); - - coApplicantGroup = new FormArray(co_result.map((item,key) => new FormGroup({ - name_ans:new FormControl(item.name_ans, Validators.required), - age_ans:new FormControl(item.age_ans, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])), - entity_ans:new FormControl(item.entity_ans, Validators.required), - qualification_ans:new FormControl(item.qualification_ans, Validators.required), - earning_ans:new FormControl(item.earning_ans, Validators.required), - relation_ans:new FormControl(item.relation_ans, Validators.required), - - }))); - } - else{ - coApplicantGroup = new FormArray(this.coApplicantDetails.map((item,key) => new FormGroup({ - name_ques:new FormControl(this.coApplicantQuestions[0]), - name_ans:new FormControl(item.applicant_name, Validators.required), - name_id:new FormControl(0), - age_ques:new FormControl(this.coApplicantQuestions[1]), - age_id:new FormControl(1), - age_ans:new FormControl(null, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])), - entity_ques: new FormControl(this.coApplicantQuestions[2]), - entity_id: new FormControl(2), - entity_ans:new FormControl(this.pd_all_details.pdmaster_details.customer_segment_abbr.substring(0,3).toUpperCase()==='SAL' ? 'Individual' : '', Validators.required), - qualification_ques: new FormControl(this.coApplicantQuestions[3]), - qualification_id: new FormControl(3), - qualification_ans:new FormControl(null, Validators.required), - earningStatus_ques:new FormControl(this.coApplicantQuestions[4]), - earning_id: new FormControl(4), - earning_ans:new FormControl(null, Validators.required), - relationShip_ques:new FormControl(this.coApplicantQuestions[5]), - relation_id:new FormControl(5), - relation_ans:new FormControl(null, Validators.required), - - }))); - } - - - - this._personalForm = this._fb.group({ - pdid:null, - form_id:null, - mainItem: mainApplicantGroup, - coItem: coApplicantGroup, - personal_info_form_remark: [data.personal_info_form_remark] - }); - //console.log(this._personalForm); - this.loadDataStatus = true; - -} - - loadFormData(){ - - // main applicant - let mainApplicantGroup = new FormArray(this.mainApplicantDetails.map((item,key) => new FormGroup({ - name_ques:new FormControl(this.mainApplicantQuestions[0]), - name_ans:new FormControl(item.applicant_name, Validators.required), - name_id:new FormControl(0), - age_ques:new FormControl(this.mainApplicantQuestions[1]), - age_id:new FormControl(1), - age_ans:new FormControl(null, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])), - entity_ques: new FormControl(this.mainApplicantQuestions[2]), - entity_id: new FormControl(2), - entity_ans:new FormControl(this.pd_all_details.pdmaster_details.customer_segment_abbr.substring(0,3).toUpperCase()==='SAL' ? 'Individual' : '', Validators.required), - qualification_ques: new FormControl(this.mainApplicantQuestions[3]), - qualification_id: new FormControl(3), - qualification_ans:new FormControl(null, Validators.required), - earningStatus_ques:new FormControl(this.mainApplicantQuestions[4]), - earning_id: new FormControl(4), - earning_ans:new FormControl(null, Validators.required), - - }))); - // co applicant - let coApplicantGroup = new FormArray(this.coApplicantDetails.map((item,key) => new FormGroup({ - name_ques:new FormControl(this.coApplicantQuestions[0]), - name_ans:new FormControl(item.applicant_name, Validators.required), - name_id:new FormControl(0), - age_ques:new FormControl(this.coApplicantQuestions[1]), - age_id:new FormControl(1), - age_ans:new FormControl(null, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])), - entity_ques: new FormControl(this.coApplicantQuestions[2]), - entity_id: new FormControl(2), - entity_ans:new FormControl(this.pd_all_details.pdmaster_details.customer_segment_abbr.substring(0,3).toUpperCase()==='SAL' ? 'Individual' : '', Validators.required), - qualification_ques: new FormControl(this.coApplicantQuestions[3]), - qualification_id: new FormControl(3), - qualification_ans:new FormControl(null, Validators.required), - earningStatus_ques:new FormControl(this.coApplicantQuestions[4]), - earning_id: new FormControl(4), - earning_ans:new FormControl(null, Validators.required), - relationShip_ques:new FormControl(this.coApplicantQuestions[5]), - relation_id:new FormControl(5), - relation_ans:new FormControl(null, Validators.required), - - }))); - - this._personalForm = this._fb.group({ - pdid:null, - form_id:null, - mainItem: mainApplicantGroup, - coItem: coApplicantGroup, - personal_info_form_remark:null - }); - //console.log(this._personalForm); -this.loadDataStatus = true; - - } - - //get pd main applicant array values - get pdMainapplicant() { return this._personalForm.get('mainItem') as FormArray; } - - // get pd co applicant array values - get pdCoapplicant() {return this._personalForm.get('coItem') as FormArray;} - // get all master details getMasterDetails(table:string,type:number){ this._pd.getAllMasterDatas(table).subscribe( @@ -219,7 +148,92 @@ this.loadDataStatus = true; } }, error => this.errorMessage = error); } -// submit forms details + + +/** On Key Press Event For Mobile Number */ +keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } +} + +// init form details +public initFormDetails(): void { + this._personalForm = this._fb.group({ + pdid:this.pdid, + formid:this.form_id, + main_applicant_details: this._fb.array([]), + co_applicant_details: this._fb.array([]), + personal_info_form_remark:null + }); +} + +// add more co applicant details +addCoApplicant() { + const control = this._personalForm.controls['co_applicant_details']; + control.push(this.loadCoApplicant(this.const_co_applicant)); + +} + +// remove co applicant details +removeCoApplicant(renoveIndex) { + const remove_control = this._personalForm.controls['co_applicant_details']; + remove_control.removeAt(renoveIndex) +} + +// load main applicant +loadMainApplicant(applicant:any) { + return this._fb.group({ + name_ans: [applicant.name_ans, Validators.required], + age_ans: [applicant.age_ans, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])], + entity_ans: [applicant.entity_ans, Validators.required], + qualification_ans: [applicant.qualification_ans, Validators.required], + earning_ans: [applicant.earning_ans, Validators.required], + current_added_status: [applicant.current_added_status], +}); + +} +// load co applicant +loadCoApplicant(applicant:any) { + return this._fb.group({ + name_ans: [applicant.name_ans, Validators.required], + age_ans: [applicant.age_ans, Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])], + entity_ans: [applicant.entity_ans, Validators.required], + qualification_ans: [applicant.qualification_ans, Validators.required], + earning_ans: [applicant.earning_ans, Validators.required], + relation_ans: [applicant.relation_ans, Validators.required], + current_added_status: [applicant.current_added_status], +}); + +} +// load default main applicant form data +loadDefaultMainApplicant(applicant:any){ + return this._fb.group({ + name_ans: [applicant.applicant_name, Validators.required], + age_ans: ['', Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])], + entity_ans: [this.pd_all_details.pdmaster_details.customer_segment_abbr.substring(0,3).toUpperCase()==='SAL' ? 'Individual' : '', Validators.required], + qualification_ans: ['', Validators.required], + earning_ans: ['', Validators.required], + current_added_status: [applicant.current_added_status], + }); + } + + // load co applicant details + loadDefaultCoApplicant(applicant:any){ + return this._fb.group({ + name_ans: [applicant.applicant_name, Validators.required], + age_ans: ['', Validators.compose([Validators.required,Validators.minLength(1),Validators.maxLength(3),Validators.required,Validators.pattern('^[0-9]*$')])], + entity_ans: [this.pd_all_details.pdmaster_details.customer_segment_abbr.substring(0,3).toUpperCase()==='SAL' ? 'Individual' : '', Validators.required], + qualification_ans: ['', Validators.required], + earning_ans: ['', Validators.required], + relation_ans: ['', Validators.required], + current_added_status: [applicant.current_added_status], + }); + } + // submit forms details submitPersonalForm(formData:any) { if (this._personalForm.invalid) { this.validateAllFormFields(this._personalForm); @@ -231,8 +245,8 @@ submitPersonalForm(formData:any) { else{ let main_applicantDetails:any=[]; let co_applicantDetails:any=[]; - - formData.mainItem.forEach((element,key) => { + let new_co_applicant:any=[]; + formData.main_applicant_details.forEach((element,key) => { if(key==0){ main_applicantDetails.push({ "name_ans":element.name_ans, @@ -244,9 +258,8 @@ submitPersonalForm(formData:any) { } }); - formData.coItem.forEach((Coelement,Cokey) => { + formData.co_applicant_details.forEach((Coelement,Cokey) => { co_applicantDetails.push({ - "name_ans":Coelement.name_ans, "age_ans":Coelement.age_ans, "qualification_ans":Coelement.qualification_ans, @@ -254,29 +267,64 @@ submitPersonalForm(formData:any) { "earning_ans":Coelement.earning_ans, "relation_ans":Coelement.relation_ans, }) + // get new co applicant list for applicant table + if(Coelement.current_added_status==1){ + new_co_applicant.push({ + "fk_pd_id": this.pdid, + "pd_co_applicant_id": '', + "applicant_name":Coelement.name_ans, + "relation":Coelement.relation_ans, + "email":'', + "mobile_no":'', + "landline":'', + "applicant_type":0, + "isactive":1 + }); + } }); - - let save_details:any={ - "pdid": this.pdid, - "formid": this.form_id, - "main_applicant_details":main_applicantDetails, - "co_applicant_details":co_applicantDetails, - "personal_info_form_remark": this._personalForm.get('personal_info_form_remark').value - }; - this._pd.savePDFormDetailsWithID(save_details).subscribe(result => { - if (result.status == 200) { - this.notifier.notify('success', 'Success.'); - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }); + let save_details:any={ + "pdid": this.pdid, + "formid": this.form_id, + "main_applicant_details":main_applicantDetails, + "co_applicant_details":co_applicantDetails, + "personal_info_form_remark": this._personalForm.get('personal_info_form_remark').value + }; + if(new_co_applicant.length > 0){ + this._pd.updatePdApplicant(new_co_applicant).subscribe(result => { + if (result.status == 200) { + this.questionsSubmitCheck(save_details); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + else{ + this.questionsSubmitCheck(save_details); + } + } } +// submit and check all questions + questionsSubmitCheck(questionAns: any) { + this._pd.savePDFormDetailsWithID(questionAns).subscribe(result => { + if (result.status == 200) { + this.notifier.notify('success', 'Success.'); + this.loadPDDetails(); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + return; + } + // validate all form group and form array fields validateAllFormFields(formGroup: any) { Object.keys(formGroup.controls).forEach(field => { @@ -290,16 +338,7 @@ validateAllFormFields(formGroup: any) { this.validateAllFormFields(control); } }); -} +} -/** On Key Press Event For Mobile Number */ -keyPress(event: any) { - const pattern = /[0-9]/; - - let inputChar = String.fromCharCode(event.charCode); - if (event.keyCode != 8 && !pattern.test(inputChar)) { - event.preventDefault(); - } -} } From 0997fc3e6a55c42fc8feb4c8a17dfca12622a62c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 30 Nov 2018 18:58:20 +0530 Subject: [PATCH 2/3] merge : kms --- .../forms/address/address.component.html | 18 +- .../forms/address/address.component.ts | 76 ++++---- .../banking-details.component.html | 35 +++- .../banking-details.component.ts | 42 ++++- .../business-info.component.html | 116 +++++++++--- .../business-info/business-info.component.ts | 93 +++++----- .../current-loan/current-loan.component.html | 38 +++- .../current-loan/current-loan.component.ts | 46 +++++ .../family-details.component.html | 66 ++++--- .../family-details.component.ts | 91 ++++++--- .../loan-details/loan-details.component.html | 49 +++-- .../loan-details/loan-details.component.ts | 74 +++++++- .../other-income/other-income.component.html | 15 +- .../other-income/other-income.component.ts | 3 + .../list-pd/start-pd/start-pd.component.html | 4 +- .../list-pd/start-pd/start-pd.component.ts | 1 + .../pd-service/pd-triger.service.ts | 78 ++++++++ .../service/templates/templates.service.ts | 16 +- .../category-question-answer.component.html | 15 +- .../category-question-answer.component.ts | 172 +++++++++++++----- .../dialog-category-question-list.html | 30 ++- 21 files changed, 820 insertions(+), 258 deletions(-) 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 0782fddcf..0853db580 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 @@ -15,19 +15,18 @@ - - - + {{m_locality.locality_name}} - + + @@ -46,14 +45,15 @@ - + - + + ->-

@@ -148,6 +149,7 @@
+ End of Neighbourhood Check-->
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 6e5dfb0f7..d5bb9f5fb 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 @@ -33,13 +33,13 @@ export class AddressComponent implements OnInit { locationdata: any = []; commentData: any = []; - customerData: any = []; + //customerData: any = []; 221118 review doc s.no 3.e addressData:any = []; localityData:any = []; ownerShipData:any = []; - neighbourStatusData:any=["Yes","No"]; - applicantOwnerData:any=["Yes","No","Dont Know"]; + //neighbourStatusData:any=["Yes","No"]; + //applicantOwnerData:any=["Yes","No","Dont Know"]; public currentLoanForm: FormGroup; private notifier: NotifierService; @@ -65,7 +65,7 @@ export class AddressComponent implements OnInit { console.clear(); this.getMasterDetails('PDLOCATIONAPPROACH',1); this.getMasterDetails('COMMENTSONLOCALITY',2); - this.getMasterDetails('CUSTOMERBEHAVIOUR',3); + //this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e this.getMasterDetails('LOCALITY',4); this.getMasterDetails('ADDRESSTYPE',5); this.getMasterDetails('RESIDENCEOWNERSHIP',6); @@ -75,11 +75,11 @@ export class AddressComponent implements OnInit { 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['neighbourhood']; if(data.status == 200) { - var result = Object.keys(data.records.neighbourhood).map(function (key) { - return data.records.neighbourhood[key]; - }); + // var result = Object.keys(data.records.neighbourhood).map(function (key) { + // return data.records.neighbourhood[key]; + // }); 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); @@ -87,7 +87,7 @@ export class AddressComponent implements OnInit { 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); @@ -101,16 +101,16 @@ export class AddressComponent implements OnInit { if (data.records.locality_others) { this.addressForm.controls.locality_others.setValue(data.records.locality_others); } - if (result.length == 0) { - control.push(this.createNeighbour()); - } else { - result.forEach(datas => { - control.push(this.createNeighbour()); - }); - this.addressForm.controls.neighbourhood.setValue(result); - } + // if (result.length == 0) { + // control.push(this.createNeighbour()); + // } else { + // result.forEach(datas => { + // control.push(this.createNeighbour()); + // }); + // this.addressForm.controls.neighbourhood.setValue(result); + // } } else { - control.push(this.createNeighbour()); + //control.push(this.createNeighbour()); } }); } @@ -123,8 +123,8 @@ export class AddressComponent implements OnInit { locality_others: [''], pd_location: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])], - customer_behaviour: ['', Validators.compose([Validators.required])], - neighbourhood: this.fb.array([]), + //customer_behaviour: ['', Validators.compose([Validators.required])], + //neighbourhood: this.fb.array([]), address_form_remark:[''], address_ownership:[''], bussiness_activity:[''], @@ -136,20 +136,20 @@ export class AddressComponent implements OnInit { this.locality = this.addressForm.controls['locality']; this.pdLocation = this.addressForm.controls['pd_location']; this.commentlocality = this.addressForm.controls['comment_locality']; - this.customerBehaviour = this.addressForm.controls['customer_behaviour']; + //this.customerBehaviour = this.addressForm.controls['customer_behaviour']; this.ownership = this.addressForm.controls['address_ownership']; this.bussinessActivity = this.addressForm.controls['bussiness_activity']; // this.bussiessAddressType = this.addressForm.controls['bussiness_address_type']; } - createNeighbour(): FormGroup { - return this.fb.group({ - name: ['', Validators.compose([Validators.required])], - do_you_know: ['', Validators.compose([Validators.required])], - how_long_year: ['', Validators.compose([Validators.required])], - how_long_month: ['', Validators.compose([Validators.required])], - is_owner: ['', Validators.compose([Validators.required])], - }); - } + // createNeighbour(): FormGroup { + // return this.fb.group({ + // name: ['', Validators.compose([Validators.required])], + // do_you_know: ['', Validators.compose([Validators.required])], + // how_long_year: ['', Validators.compose([Validators.required])], + // how_long_month: ['', Validators.compose([Validators.required])], + // is_owner: ['', Validators.compose([Validators.required])], + // }); + // } getMasterDetails(table:string,type:number){ this._pd.getAllMasterDatas(table).subscribe(data => { data.records.forEach(val => { @@ -159,9 +159,9 @@ export class AddressComponent implements OnInit { else if(type==2 && val.isactive == 1){ this.commentData.push(val); } - else if(type==3 && val.isactive == 1){ - this.customerData.push(val); - } + /* else if(type==3 && val.isactive == 1){ + this.customerData.push(val); + } //221118 review doc s.no 3.e */ else if(type==4 && val.isactive == 1){ this.localityData.push(val); } @@ -174,6 +174,7 @@ export class AddressComponent implements OnInit { }) }); } + /*221118 review doc s.no 3.f addNeighbour() { const control = this.addressForm.controls['neighbourhood']; if (control.length <= 1) { @@ -183,12 +184,13 @@ export class AddressComponent implements OnInit { removeNeighbour(index) { const control = this.addressForm.controls['neighbourhood']; control.removeAt(index); - } + }*/ onSubmit() { + console.log('form data', this.addressForm.value); if (!this.addressForm.valid) { return; } - console.log('form', this.addressForm.value); + let records: any = {}; records.address = this.address.value; records.address_type = this.addressType.value; @@ -201,8 +203,8 @@ export class AddressComponent implements OnInit { } records.pd_location = this.pdLocation.value; records.comment_locality = this.commentlocality.value; - records.customer_behaviour = this.commentlocality.value; - records.neighbourhood = this.addressForm.controls.neighbourhood.value; + //records.customer_behaviour = this.commentlocality.value; + //records.neighbourhood = this.addressForm.controls.neighbourhood.value; records.address_form_remark = this.addressForm.controls.address_form_remark.value; records.address_ownership = this.ownership.value; records.bussiness_activity = this.bussinessActivity.value; 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 c74ef8afa..adf960547 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 @@ -71,7 +71,7 @@

Banking Information

-
+
@@ -84,15 +84,39 @@ + + + {{owner.applicant_name}} + Others + + + + + + + + + + + + {{ btLen.lender_name }} + + + + + - + {{ prop.name }} + + Yes + No + + + + + + + + + + January + February + March + April + May + June + July + August + September + October + November + December + + + + + - Started by Applicant + Started by Applicants Family Business + Others + + + - One of the applicants + + {{owner.applicant_name}} Relative of an applicant Others @@ -75,9 +121,18 @@ - --> + + Yes + No + + + + @@ -96,13 +151,21 @@ formControlName="partner_name" required> - - - - +
+ +
+
+ + + + + + +
+
@@ -141,7 +204,7 @@ -

As per PD Officer +

No of Employees sighted by PD officer during his visit

@@ -149,19 +212,19 @@
- + + -

Investments +

Investment in business by Applicants

@@ -169,10 +232,10 @@
- + @@ -192,7 +255,7 @@ - + -

Is the below documents seen and photo captured ? +

Documents Sighted

@@ -277,6 +340,7 @@ formControlName="other_documents" required> Yes No + Not Applicable
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 b24341aea..e5ae10d50 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 @@ -31,10 +31,12 @@ import {ActivatedRoute, Router} from "@angular/router"; export class BusinessInfoComponent implements OnInit { @Input() pdid: number; @Input() form_id: number; + @Input() applicant_details: any; relationData: any = []; industryData: any = []; activityData: any = []; relativeNames: any; + applicants: any; public businessForm: FormGroup; private notifier: NotifierService; @@ -44,6 +46,7 @@ export class BusinessInfoComponent implements OnInit { this.notifier = notifier; } ngOnInit() { + this.applicants = this.applicant_details.pdapplicants_detials; this.getRelation(); this.getIndustry(); this.getActivity(); @@ -58,15 +61,14 @@ export class BusinessInfoComponent implements OnInit { let businessVal = data.records; console.log('data', businessVal); let constVal: any; - const Desgn = this.businessForm.controls['designation']; + //const Desgn = this.businessForm.controls['designation']; const Partnr = this.businessForm.controls['partners']; const otherDoc = this.businessForm.controls['documents']; - if (data.status == 200) { let DocArray: any; - let DesgnArray = Object.keys(data.records.designation).map(function (key) { - return data.records.designation[key]; - }); + // let DesgnArray = Object.keys(data.records.designation).map(function (key) { + // return data.records.designation[key]; + // }); let PartnrArray = Object.keys(data.records.partners).map(function (key) { return data.records.partners[key]; }); @@ -81,14 +83,14 @@ export class BusinessInfoComponent implements OnInit { existRelative.push(val); }); this.relativeNames = existRelative; - if (DesgnArray.length == 0) { - Desgn.push(this.createDesignation()); - } else { - DesgnArray.forEach(datas => { - Desgn.push(this.createDesignation()); - }); + // if (DesgnArray.length == 0) { + // Desgn.push(this.createDesignation()); + // } else { + // DesgnArray.forEach(datas => { + // Desgn.push(this.createDesignation()); + // }); - } + // } if (PartnrArray.length == 0) { Partnr.push(this.createPartners()); } else { @@ -107,23 +109,23 @@ export class BusinessInfoComponent implements OnInit { DocArray = [{document: ''}]; otherDoc.push(this.createDocument()); } - if (data.records.ownership_setup != 'others') { - businessVal.ownership_others = ''; - } - if (data.records.ownership_setup != 'rented') { - businessVal.rent_paid = ''; - } + // if (data.records.ownership_setup != 'others') { + // businessVal.ownership_others = ''; + // } + // if (data.records.ownership_setup != 'rented') { + // businessVal.rent_paid = ''; + // } businessVal.family_members_involved = enduse; businessVal.pdid = this.pdid; businessVal.formid = this.form_id; businessVal.fk_createdby = this.pdid; - businessVal.designation = DesgnArray; + //businessVal.designation = DesgnArray; businessVal.partners = PartnrArray; businessVal.documents = DocArray; this.businessForm.setValue(businessVal); } else { - Desgn.push(this.createDesignation()); + //Desgn.push(this.createDesignation()); Partnr.push(this.createPartners()); otherDoc.push(this.createDocument()); } @@ -140,23 +142,27 @@ export class BusinessInfoComponent implements OnInit { fk_createdby: this.pdid, profession_name: ['', Validators.compose([Validators.required])], business_years: ['', Validators.compose([Validators.required])], + business_month: ['', Validators.compose([Validators.required])], industry: ['', Validators.compose([Validators.required])], type_of_activity: ['', Validators.compose([Validators.required])], + other_activity_type : [''], seasonality: ['', Validators.compose([Validators.required])], - designation: this.fb.array([]), + month_of_business_run : [''], + peak_period_of_business : [''], + //designation: this.fb.array([]), partners: this.fb.array([]), employees_total: ['', Validators.compose([Validators.required])], employees_permanent: ['', Validators.compose([Validators.required])], employees_temporary: ['', Validators.compose([Validators.required])], officer_total: ['', Validators.compose([Validators.required])], - officer_permanent: ['', Validators.compose([Validators.required])], - officer_temporary: ['', Validators.compose([Validators.required])], + // officer_permanent: ['', Validators.compose([Validators.required])], + // officer_temporary: ['', Validators.compose([Validators.required])], invested_amount: ['', Validators.compose([Validators.required])], - working_capital: ['', Validators.compose([Validators.required])], + //working_capital: ['', Validators.compose([Validators.required])], is_service_provided: ['', Validators.compose([Validators.required])], - ownership_setup: ['', Validators.compose([Validators.required])], - ownership_others: [''], - rent_paid: [''], + // ownership_setup: ['', Validators.compose([Validators.required])], + // ownership_others: [''], + // rent_paid: [''], shop_eat_act_cert: ['', Validators.compose([Validators.required])], gst_Regn_cert: ['', Validators.compose([Validators.required])], export_import_cert: ['', Validators.compose([Validators.required])], @@ -168,24 +174,27 @@ export class BusinessInfoComponent implements OnInit { documents: this.fb.array([]), business_remarks: ['', Validators.compose([Validators.required])], who_started: ['', Validators.compose([Validators.required])], + other_bussiness_who_started : [''], main_person: ['', Validators.compose([Validators.required])], other_main_person: [''], family_members_involved: ['', Validators.compose([Validators.required])], before_business: ['', Validators.compose([Validators.required])], + before_business_description: [''], any_delays: ['', Validators.compose([Validators.required])], }); } - createDesignation(): FormGroup { - return this.fb.group({ - sec_name: ['', Validators.compose([Validators.required])], - sec_designation: ['', Validators.compose([Validators.required])], - }); - } + // createDesignation(): FormGroup { + // return this.fb.group({ + // sec_name: ['', Validators.compose([Validators.required])], + // sec_designation: ['', Validators.compose([Validators.required])], + // }); + // } createPartners(): FormGroup { return this.fb.group({ partner_name: ['', Validators.compose([Validators.required])], shareholding: ['', Validators.compose([Validators.required])], - current_business_experiance: ['', Validators.compose([Validators.required])], + current_business_experiance_year: ['', Validators.compose([Validators.required])], + current_business_experiance_month: ['', Validators.compose([Validators.required])], total_business_experiance: ['', Validators.compose([Validators.required])], }); } @@ -194,14 +203,14 @@ export class BusinessInfoComponent implements OnInit { document: [''] }); } - addDesignation() { - const control = this.businessForm.controls['designation']; - control.push(this.createDesignation()); - } - deleteDesignation(index) { - const control = this.businessForm.controls['designation']; - control.removeAt(index); - } + // addDesignation() { + // const control = this.businessForm.controls['designation']; + // control.push(this.createDesignation()); + // } + // deleteDesignation(index) { + // const control = this.businessForm.controls['designation']; + // control.removeAt(index); + // } addPartnerDetails() { const control = this.businessForm.controls['partners']; control.push(this.createPartners()); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index d3ce744d2..20416eb11 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -1,14 +1,20 @@ -

Current Loan Details

+

Existing Loan Obligations

- + + Yes No + + +

Loan Details

@@ -16,19 +22,43 @@

+ - + + {{freq.name}} + + + + - + + {{owner.applicant_name}} + Others + + + + + + + {{ btLen.lender_name }} + + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 78dd06331..e493001ef 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -33,6 +33,13 @@ export class CurrentLoanComponent implements OnInit { private notifier: NotifierService; @Input() pdid: number; @Input() form_id: number; + @Input() applicant_details: any; + lenderData: any = []; + frequencyData: any = []; + applicants: any; + placeholderName : any; + holder: any = 'amount'; + IDXval : any; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -41,10 +48,13 @@ export class CurrentLoanComponent implements OnInit { } ngOnInit() { + this.getMasterDetails('BTLENDERLIST',1); + this.getMasterDetails('FREQUENCY',2); this.initCurrentloanForm(); let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; + this.applicants = this.applicant_details.pdapplicants_detials; this._pd.retriveForm(params).subscribe(value => { console.log('value', value); const control = this.currentLoanForm.controls['loan_details']; @@ -88,12 +98,36 @@ export class CurrentLoanComponent implements OnInit { arr.removeAt(0); } } + + selectedfrequency(e,i){ + // console.log(+e.value); + // console.log(i); + + + this.IDXval = i; + + switch(+e.value){ + case 1: this.placeholderName = 'Weekly Installment Amount'; break; + case 2: this.placeholderName = 'Daily Installment Amount'; break; + case 3: this.placeholderName = 'Annual Installment Amount'; break; + case 4: this.placeholderName = 'Hourly Installment Amount'; break; + case 5: this.placeholderName = 'EMI Amount'; break; + case 6: this.placeholderName = 'Quarterly Installment Amount'; break; + case 7: this.placeholderName = 'HalfYearly Installment Amount'; break; + default : this.placeholderName = ''; break; + } + } + createLoanDetail() { return this.fb.group({ loan_amount: ['', Validators.compose([Validators.required])], + frequency:['', Validators.compose([Validators.required])], emi: ['', Validators.compose([Validators.required])], loan_type: ['', Validators.compose([Validators.required])], + loan_taken_by:[''], + others_loan_taken:[''], lender: ['', Validators.compose([Validators.required])], + others_lender:[''], original_tenure: ['', Validators.compose([Validators.required])], current_balance_tenure: ['', Validators.compose([Validators.required])], }); @@ -138,6 +172,18 @@ export class CurrentLoanComponent implements OnInit { } }); } + getMasterDetails(table:string,type:number){ + this._pd.getAllMasterDatas(table).subscribe(data => { + data.records.forEach(val => { + if (type==1 && val.isactive == 1) { + this.lenderData.push(val); + } + else if(type==2 && val.isactive == 1){ + this.frequencyData.push(val); + } + }) + }); + } /** On Key Press Event For Amount */ keyPress(event: any) { const pattern = /[0-9]/; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 5053fbe6c..2142bd66d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -3,7 +3,7 @@

Family Details

- + - + @@ -25,8 +25,16 @@
+ + + + + + - + {{relations.name}} @@ -34,7 +42,7 @@ - + {{cusSeg.name}} @@ -44,11 +52,11 @@ + formControlName="income" required> + formControlName="employer_name" required>