diff --git a/ng6-seed/angular.json b/ng6-seed/angular.json index 65f5ce4..d9ae0d7 100755 --- a/ng6-seed/angular.json +++ b/ng6-seed/angular.json @@ -86,7 +86,7 @@ "fileReplacements": [ { "replace": "src/environments/environment.ts", - "with": "src/environments/environment.stage.ts" + "with": "src/environments/environment.prod.ts" }] } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.html index 1f57c76..db03c25 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.html @@ -135,7 +135,7 @@ - Designation + Designation in company Designation required - Relation + Relation with applicant - - {{dynamicStepperHeadingForEmp}} + + Employment Information
@@ -380,93 +380,104 @@
- -
-
{{dynamicStepperHeadingForEmp}}
-


-
-
- - Salary register - - Select - Yes - No - - Salary register seen Required - -
-
-
- - -
- - -
-
+
+ + +
+ + +
+ + Documents Sighted of applicant employment During FI + +
+
-
- - Attendance Register - - Select - Yes - No - - Attendance register Required - +
+ + Salary register + + Select + Yes + No + + Salary register seen Required + +
+
+
+ +
-
-
- - -
- - + +
-
+
- Cash voucher + Attendance Register + + Select + Yes + No + +Attendance register Required + +
+
+
+ - - Select - Yes - No - - Cash Voucher Required +
+ + + +
+
+ +
+
+ +Cash voucher + + +Select +Yes +No + +Cash Voucher Required
+*ngIf="getDocsSightedGroup['value'].cash_voucher_pic != ''" +src="{{getDocsSightedGroup['value'].cash_voucher_pic}}" style="max-width: 80px;max-height: 80px">
@@ -482,24 +493,24 @@ Image -->
-
+
- Salary Certificate +Salary Certificate - - Select - Yes - No - - Salary Certificate Required + +Select +Yes +No + +Salary Certificate Required
+*ngIf="getDocsSightedGroup['value'].sal_certificate_pic != ''" +src="{{getDocsSightedGroup['value'].sal_certificate_pic}}" style="max-width: 80px;max-height: 80px">
@@ -515,24 +526,24 @@ Image -->
-
+
- Salary Slip +Salary Slip - - Select - Yes - No - - Salary slip Required + +Select +Yes +No + +Salary slip Required
+*ngIf="getDocsSightedGroup['value'].sal_slip_pic != ''" +src="{{getDocsSightedGroup['value'].sal_slip_pic}}" style="max-width: 80px;max-height: 80px">
- Others please specify +Others please specify - - Select - Yes - No + +Select +Yes +No Other Document Required
-
- - Specify the Document - - Required +
+ +Specify the Document + +Required
- - + +
+Image -->
- Why Documents are not available? - - {{item}} - - Required +Why Documents are not available? + +{{item}} + +Required - Specify the reason - +Specify the reason +
-
- - - -
-
-
{{dynamicStepperHeadingForEmp}}
-


-
-
- -
-
-
- -
- Office Photograph {{i+1}} -
-
-
- No Photographs Found
-
- - -
-


+
+ +
+ + +
+
- - -
+ + Office Setup Photographs + +
+
+ +
+
+ +
+
+
+ +
+ Office Photograph {{i+1}} +
+
+
+ No Photographs Found
+
+ + +
+


+
+ +
+ + +
+
+ + + Name board/Entrance photograph + +

-
{{dynamicStepperHeadingForEmp}}
-


+
-
+

@@ -645,7 +671,7 @@ Image --> Name Board {{i+1}}
-
+
No Photographs Found
@@ -657,11 +683,10 @@ Image -->
- - -
- - + + +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts index cc628c8..d5a9eab 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts @@ -16,38 +16,39 @@ import { takeUntil } from 'rxjs/operators'; styleUrls: ['./employer-info.component.scss'] }) export class EmployerInfoComponent implements OnInit { - stepperInfo= [{ + raw_stepper_info = [{ form_name:'General Section', form_id:18, stepper_index:0, }, - { - form_name:'Employer information', - form_id:"12", - stepper_index:1 - }, + // { + // form_name:'Employer information', + // form_id:"12", + // stepper_index:1 + // }, { form_name:'Credit Manager Queries', form_id:24, - stepper_index:2, + stepper_index:1, is_dynamic:true }, { form_name:'Address Information', form_id:5, - stepper_index:3, + stepper_index:2, is_dynamic:true },{ form_name:'Final Remarks', form_id:20, - stepper_index:4, + stepper_index:3, is_dynamic:true },{ form_name:'Submit', form_id:'COMMENTS', - stepper_index:4, + stepper_index:3, is_dynamic:true },] + stepperInfo:any = [] // public person_met_entered:FormControl= new FormControl('') // public designation_entered:FormControl= new FormControl('') // public relation_entered:FormControl= new FormControl('') @@ -107,7 +108,7 @@ export class EmployerInfoComponent implements OnInit { notifier: NotifierService; get questions() { return this.employerForm.get('questions');} get getEmployer_details() {return this.questions.get([2]).get('employer_details')} - get getDocsSightedGroup() {return this.questions.get([2]).get('docs_sighted')} + get getDocsSightedGroup() {return this.questions.get([7]).get('docs_sighted')} employerform_pdinfo:any; @@ -132,12 +133,12 @@ export class EmployerInfoComponent implements OnInit { console.log("constr",this.pdDetails,this.docs_tobe_collect) if(this.pdDetails.lender_short_name == 'CLIX' || this.pdDetails.lender_short_name == 'MWISE' || this.pdDetails.prod_catagory == 'LAEP') { - let Index = this.stepperInfo.findIndex(vv=>vv.form_id == 'COMMENTS') - this.stepperInfo[Index].stepper_index+=1 + let Index = this.raw_stepper_info.findIndex(vv=>vv.form_id == 'COMMENTS') + this.raw_stepper_info[Index].stepper_index+=1 } if(this.docs_tobe_collect == null || this.docs_tobe_collect == undefined || this.docs_tobe_collect.length == 0) { // this.stepperInfo - for(let value of this.stepperInfo) { + for(let value of this.raw_stepper_info) { if(value.is_dynamic) { value.stepper_index-=1 } @@ -152,7 +153,7 @@ export class EmployerInfoComponent implements OnInit { // this.loadingProvider.dataLoader() this.employerForm=this._formBuilder.group({ questions:this._formBuilder.array([this.addGeneralControls(),this.addAddressControls(), - this.addEmployerInfoForm(),this.addNeighbourhoodControls(),this.addFinalRemarksControls(), + this.addEmployerInfoForm('Employment Information','12'),this.addNeighbourhoodControls(),this.addFinalRemarksControls(), this._formBuilder.group({ final_comments:['',Validators.required], final_visit_status:['',Validators.compose([Validators.required])], @@ -161,7 +162,7 @@ export class EmployerInfoComponent implements OnInit { company_existence_months:[''], form_id:["COMMENTS"], form_name:["Comments"] - }), this.addCreditManagerQueries()]) + }), this.addCreditManagerQueries(),this.addEmployerInfoForm('Documents Sighted','12.1'),this.addEmployerInfoForm('Office Setup Photographs','12.2'),this.addEmployerInfoForm('Name Board Photographs','12.3')]) }) @@ -512,35 +513,41 @@ export class EmployerInfoComponent implements OnInit { // }) // } // } - if(group_obj.hasOwnProperty('office_photographs') && group_obj.office_photographs && this.getQuestionControl().at(2).get('office_photographs')) { - group_obj.office_photographs.forEach(()=>{ - this.addMoreImage('office_photographs') - }) + // For Documents Sighted + if(group_obj.hasOwnProperty('docs_sighted') && group_obj.docs_sighted && this.getQuestionControl().at(7)) { + datas.push({docs_sighted:group_obj.docs_sighted}) } - // name board photo handling - if(group_obj.hasOwnProperty('nameboard_photographs') && group_obj.nameboard_photographs && this.getQuestionControl().at(2).get('nameboard_photographs')) { - group_obj.nameboard_photographs.forEach(()=>{ - this.addMoreImage('nameboard_photographs') + else { + datas.push({dummy:1}) + } + if(group_obj.hasOwnProperty('office_photographs') && group_obj.office_photographs && this.getQuestionControl().at(8)) { + // datas[8].office_photographs = group_obj.office_photograph + datas.push({office_photographs:group_obj.office_photographs}) + group_obj.office_photographs.forEach(()=>{ + this.addMoreImage('office_photographs','',8) }) } - // // For Other Documents images - // if(group_obj.form_id == "13" && group_obj.hasOwnProperty('other_documents') && group_obj.other_documents == 'yes') { - // if(group_obj.other_documents_info) { - // group_obj.other_documents_info.forEach(doc=>{ - // this.addOtherDocumentsGroup() - // }) - // } - // } - // // FOR STOCK IMAGES - // if(group_obj.form_id == "11" && group_obj.hasOwnProperty('images') && group_obj.images) { - // group_obj.images.forEach(()=>{ - // this.addMoreStockImage() - // }) - // } + else { + datas.push({dummy:1}) + } + // name board photo handling + if(group_obj.hasOwnProperty('nameboard_photographs') && group_obj.nameboard_photographs && this.getQuestionControl().at(9)) { + // datas[9].nameboard_photographs = group_obj.nameboard_photographs + datas.push({nameboard_photographs:group_obj.nameboard_photographs}) + group_obj.nameboard_photographs.forEach(()=>{ + this.addMoreImage('nameboard_photographs','',9) + }) + } + else { + datas.push({dummy:1}) + } } } this.getQuestionControl().at(2).patchValue(datas[employer_group_index]) + this.getQuestionControl().at(7).patchValue(datas[7]) + this.getQuestionControl().at(8).patchValue(datas[8]) + this.getQuestionControl().at(9).patchValue(datas[9]) },200) console.log("final output",this.employerForm.value) } @@ -674,17 +681,17 @@ export class EmployerInfoComponent implements OnInit { docs_to_be_sighted:this._formBuilder.array([]) }) } - addEmployerInfoForm() { - return this._formBuilder.group({ - form_name:"Employer Information", - form_id:["12"], - // employer_details:this.getEmployerDetailsControls(), - // docs_sighted:this.getDocsSightedDetailsControls(), - // office_photographs:this._formBuilder.array([]), - // nameboard_photographs:this._formBuilder.array([]) - // docs_to_be_sighted:this._formBuilder.array([]) - }) - } + addEmployerInfoForm(form_name,form_id) { + return this._formBuilder.group({ + form_name:[form_name], + form_id:[form_id], + // employer_details:this.getEmployerDetailsControls(), + // docs_sighted:this.getDocsSightedDetailsControls(), + // office_photographs:this._formBuilder.array([]), + // nameboard_photographs:this._formBuilder.array([]) + // docs_to_be_sighted:this._formBuilder.array([]) + }) + } // START OF EMPLOYER FORM GROUP getDocsSightedDetailsControls() { return this._formBuilder.group({ @@ -827,16 +834,16 @@ export class EmployerInfoComponent implements OnInit { // return stockCtrl.controls // } - getPhotoControls(formArrayName) { - let formArray = this.employerForm.get('questions') as FormArray; - // console.log(formArray); - let officeControl = formArray.at(2).get(formArrayName) as FormArray - // console.log(business_group_ctrl); - // let stockCtrl = business_group_ctrl.at(0).get('office_photographs') as FormArray - // console.log("stock",stockCtrl); - // console.log(this.employerForm.value); - return officeControl.controls - } + getPhotoControls(formArrayName,groupIndex) { + let formArray = this.employerForm.get('questions') as FormArray; + // console.log(formArray); + let officeControl = formArray.at(groupIndex).get(formArrayName) as FormArray + // console.log(business_group_ctrl); + // let stockCtrl = business_group_ctrl.at(0).get('office_photographs') as FormArray + // console.log("stock",stockCtrl); + // console.log(this.employerForm.value); + return officeControl.controls + } // getBusinessAssetSightImage() { // let formArray = this.employerForm.get('questions') as FormArray; @@ -907,10 +914,10 @@ export class EmployerInfoComponent implements OnInit { // } // // console.log(this.employerForm.value); // } - addMoreImage(formArrayName,form_id?) { + addMoreImage(formArrayName,form_id?,formGroupIndex?) { let formArray = this.employerForm.get('questions') as FormArray; // console.log(formArray); - let officeControl = formArray.at(2).get(formArrayName) as FormArray + let officeControl = formArray.at(formGroupIndex).get(formArrayName) as FormArray // console.log(business_group_ctrl); // let officeControl = business_group_ctrl.at(0).get('office_photographs') as FormArray // console.log("stock",stockCtrl); @@ -1303,6 +1310,64 @@ export class EmployerInfoComponent implements OnInit { // } // // return invalid; // } + + checkingStepperIndex() { + let whole_emp_sections = [{ + form_name:'Employment information', + form_id:"12", + stepper_index:1 + },{ + form_name:'Document Sighted', + form_id:"12.1", + stepper_index:2 + }, + { + form_name:'Officer Setup Photographs', + form_id:"12.2", + stepper_index:3 + }, + { + form_name:'Name Board Photographs', + form_id:"12.3", + stepper_index:4 + }] + // FOR ADDING THE STEPPER INDEX DYNAMICALLY + this.stepperInfo = JSON.parse(JSON.stringify(this.raw_stepper_info)) + let count =0 + if(this.getQuestionControl().at(2).get('employer_details')) { + count=4 + this.stepperInfo.push(...whole_emp_sections) + } + else if(this.getQuestionControl().at(7).get('docs_sighted')) { + count=3 + let temp = whole_emp_sections.filter(v=>v.form_id != '12').map(ve=>{return {form_name:ve.form_name,form_id:ve.form_id,stepper_index:ve.stepper_index -=1}}) + this.stepperInfo.push(...temp) + // console.log("asdffffffffff",temp) + // debugger; + // this.stepperInfo.push() + } + else if(this.getQuestionControl().at(8).get('office_photographs')) { + count=2 + let temp = whole_emp_sections.filter(v=>v.form_id != '12' && v.form_id != '12.1').map(ve=>{return {form_name:ve.form_name,form_id:ve.form_id,stepper_index:ve.stepper_index -=2}}) + this.stepperInfo.push(...temp) + } + else if(this.getQuestionControl().at(9).get('nameboard_photographs')) { + let temp = whole_emp_sections.filter(v=>v.form_id != '12' && v.form_id != '12.1' && v.form_id != '12.2').map(ve=>{return {form_name:ve.form_name,form_id:ve.form_id,stepper_index:ve.stepper_index -=3}}) + this.stepperInfo.push(...temp) + count=1 + } + if(count != 0) { + for(let value of this.stepperInfo) { + if(value.is_dynamic) { + value.stepper_index+=count + } + } + // this.changeDetRef.detectChanges() + console.log("Modified stepper index value",this.stepperInfo,this.myStepper) + } + } + + onSubmit(flag?) { if(this.spinner_access) { this.notifier.notify("info","Form processing please wait..."); @@ -1310,6 +1375,7 @@ export class EmployerInfoComponent implements OnInit { } if(this.employerForm.invalid && flag != 'go_back') { console.log('form value',this.employerForm.getRawValue()) + this.checkingStepperIndex() let invalidMsg = "Please Fill all the required fields and capture the image" let tempMsg = this.findInvalidControls() if(tempMsg != '') { @@ -1344,6 +1410,21 @@ export class EmployerInfoComponent implements OnInit { // return // } // } + + // FOR MERGING EMPLOYMENT SECTION,DOCS SIGHTED,OFFICE AND NAME BOARD PHOTOGRAPH INTO SINGLE OBJ +if(this.getQuestionControl().at(7).get('docs_sighted')) { + records.questions[2].docs_sighted = records.questions[7].docs_sighted +} +if(this.getQuestionControl().at(8).get('office_photographs')) { + records.questions[2].office_photographs = records.questions[8].office_photographs +} +if(this.getQuestionControl().at(9).get('nameboard_photographs')) { + records.questions[2].nameboard_photographs = records.questions[9].nameboard_photographs +} +records.questions = records.questions.filter(v=>v.form_id != '12.1' && v.form_id != '12.2' && v.form_id != '12.3') + + + this.spinner_access = true; console.log(records); records.pdid = this.pdDetails.pd_id; @@ -1532,6 +1613,9 @@ export class EmployerInfoComponent implements OnInit { checkPartEnable(flag) { let general_controls = this.getQuestionControl().at(0)['controls'] let employement_controls:any = this.getQuestionControl().at(2) + let name_board_controls:any = this.getQuestionControl().at(9) + let office_photo_controls:any = this.getQuestionControl().at(8) + let docs_sighted_controls:any = this.getQuestionControl().at(7) let applicant_arr = this.getQuestionControl().at(0).get('individuals').value let return_value = '' switch (flag) { @@ -1551,18 +1635,20 @@ export class EmployerInfoComponent implements OnInit { general_controls.person_met_entered.setValidators(Validators.required); // general_controls.person_met_entered_pic.setValidators(Validators.required); // FOR ADDING OFFICE PHOTO - employement_controls.addControl('office_photographs',this._formBuilder.array([])) + office_photo_controls.addControl('office_photographs', this._formBuilder.array([])) + name_board_controls.addControl('nameboard_photographs', this._formBuilder.array([])) + // employement_controls.addControl('office_photographs',this._formBuilder.array([])) this.dynamicStepperHeadingForEmp = "Office Setup Photographs" // FOR REMOVING NAME BOARD PHOTO - employement_controls.removeControl('nameboard_photographs') + // employement_controls.removeControl('nameboard_photographs') return true } else if(general_controls.is_met_during_visit.value == 'no'){ // FOR ADDING NAME BOARD PHOTO - employement_controls.addControl('nameboard_photographs',this._formBuilder.array([])) + name_board_controls.addControl('nameboard_photographs', this._formBuilder.array([])) this.dynamicStepperHeadingForEmp = "Name board/Entrance photograph" // FOR REMOVING OFFICE PHOTO - employement_controls.removeControl('office_photographs') + office_photo_controls.removeControl('office_photographs') return false } @@ -1598,7 +1684,10 @@ export class EmployerInfoComponent implements OnInit { // FOR ENABLING EMPLOYMENT INFOMATION SECTIONS case 4: if (general_controls.is_employer_available.value == 'yes') { - employement_controls.addControl('employer_details',this.getEmployerDetailsControls()) + employement_controls.addControl('employer_details', this.getEmployerDetailsControls()) + docs_sighted_controls.addControl('docs_sighted', this.getDocsSightedDetailsControls()) + name_board_controls.addControl('nameboard_photographs', this._formBuilder.array([])) + office_photo_controls.addControl('office_photographs', this._formBuilder.array([])) this.dynamicStepperHeadingForEmp = "Employment Information" return true; } @@ -1611,13 +1700,15 @@ export class EmployerInfoComponent implements OnInit { // let applicant_arr = this.getQuestionControl().at(0).get('individuals').value // console.log(applicant_arr) if(applicant_arr && applicant_arr.length > 0) { - if(general_controls.is_employer_available.value == 'no' && applicant_arr.filter(vv=>vv.is_person_met == true).length != 0 ){ - employement_controls.addControl('docs_sighted',this.getDocsSightedDetailsControls()) + if ((general_controls.is_employer_available.value == 'no' && applicant_arr.filter(vv => vv.is_person_met == true).length != 0) || (general_controls.is_employer_available.value == 'yes')) { + docs_sighted_controls.addControl('docs_sighted', this.getDocsSightedDetailsControls()) + name_board_controls.addControl('nameboard_photographs', this._formBuilder.array([])) + office_photo_controls.addControl('office_photographs', this._formBuilder.array([])) this.dynamicStepperHeadingForEmp = "Documents Sighted of applicant employment During FI" return true; } else{ - employement_controls.removeControl('docs_sighted') + docs_sighted_controls.removeControl('docs_sighted') return false } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 67ac373..561d371 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -19,10 +19,11 @@
-
- {{master.lender_short_name}} +
+ {{master.lender_short_name}}
+ {{master.fin_institute_name}}
-
+
{{master.branch_name}}
@@ -152,7 +153,7 @@ - +
@@ -193,7 +194,7 @@
- +
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index fc50bc5..1d53d3e 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -23,6 +23,7 @@
{{master.lender_short_name}} + {{master.fin_institute_name}}
{{master.branch_name}} diff --git a/ng6-seed/src/environments/environment.prod.ts b/ng6-seed/src/environments/environment.prod.ts index a480177..203902a 100755 --- a/ng6-seed/src/environments/environment.prod.ts +++ b/ng6-seed/src/environments/environment.prod.ts @@ -16,8 +16,8 @@ export const environment = { // For Vendor // venIdentityPoolId: "ap-south-1:5ad3ce43-4260-4273-87b2-e6a377b8e874", - venUserPoolId: "ap-south-1_K57yPaWxV", // Username - venClientId: "5sntllm6nbqo120mteqqd8b9nq", // ClientName + venUserPoolId: "ap-south-1_7Xvnpr2At", // Username + venClientId: "5dvpr90r2na4te5k0qrint0m5i", // ClientName firebase: { apiKey: "AIzaSyCk86rasBR2-sXlVu6ACUO406EM_1mcwgo",