From bc74e60d956eab7125f84b81180c50da7e38ad1b Mon Sep 17 00:00:00 2001 From: sriram-at-840620226347 Date: Sat, 17 Oct 2020 15:34:13 +0530 Subject: [PATCH] common question validation --- .../common-ques/common-ques.component.html | 10 +++-- .../common-ques/common-ques.component.ts | 17 ++++++++ .../dynamic-docs-form.component.html | 1 + .../employer-info/employer-info.component.ts | 42 +++++++++---------- .../pd-service/pd-triger.service.ts | 10 ++--- 5 files changed, 51 insertions(+), 29 deletions(-) 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 8ead091..32796f7 100755 --- 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 @@ -74,6 +74,7 @@ (click)="saveApplicantInfo(applicant,'is_person_met_id_proof')" fill="clear" >
--> ID Proof of the person + @@ -418,7 +419,7 @@ padding: 0px; margin: 0px;">* --> - Approach to pd location pic is Required + Required
@@ -482,7 +483,8 @@ padding: 0px; margin: 0px;">*
--> -
+ Required +
@@ -524,7 +526,8 @@ -
+ Required +
@@ -583,6 +586,7 @@ + Required diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.ts index 8fbb3d9..6feede3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/common-ques/common-ques.component.ts @@ -1110,6 +1110,9 @@ capturePic(event,controls,img_name?:String,form_id?) { console.log("params savePDImage", records) this.quesService.savePDImages(records).subscribe(result => { if(result['dataStatus']) { + if(img_name == 'Person Met Pic') { + this.sendGeoCords(geoCoordinates) + } controls.setValue(result['uri']) } else { @@ -1128,6 +1131,13 @@ capturePic(event,controls,img_name?:String,form_id?) { )} } +sendGeoCords(location) { + let params = {"pd_id":this.pdDetails.pd_id,"geo_location":location,"comment":"","fk_updatedby":this.users} + this.quesService.renewSatellite(params).subscribe(rr=>{ + + }) + } + compareObjects(o1: any, o2: any) { if(o1.id == o2.id && o1.group_id == o2.group_id) return true; @@ -1212,6 +1222,7 @@ saveApplicantInfo(event,applicant_obj,image_key) { this.quesService.saveApplicantImgFromVendorForm(params).subscribe(result=>{ if(result['dataStatus']) { + this.sendGeoCords(geoCoordinates) applicant_obj.controls[image_key].setValue(result['uri']); } else { @@ -1268,6 +1279,9 @@ public findInvalidControls() { // this.myStepper.selectedIndex = 0; } + else { + msg = this.stepperInfo[index].form_name+" images are not taken" + } console.log("kkdd",group['controls'][name],firstInvalidField) @@ -1567,6 +1581,7 @@ if(applicant_arr && applicant_arr.length > 0) { this.getQuestionControl().at(0)['controls'].relation_entered.setValidators(Validators.required) this.getQuestionControl().at(0)['controls'].relation_to.setValidators(Validators.required) // return true this.getQuestionControl().at(0)['controls'].person_met_entered_pic.setValidators(Validators.required) + this.getQuestionControl().at(0)['controls'].person_met_entered_id_proof.setValidators(Validators.required) returnVal = true } else { @@ -1582,6 +1597,7 @@ if(applicant_arr && applicant_arr.length > 0) { this.getQuestionControl().at(0)['controls'].relation_entered.clearValidators(); this.getQuestionControl().at(0)['controls'].relation_to.clearValidators(); this.getQuestionControl().at(0)['controls'].person_met_entered_pic.clearValidators() + this.getQuestionControl().at(0)['controls'].person_met_entered_id_proof.clearValidators() // return false returnVal = false } @@ -1590,6 +1606,7 @@ if(applicant_arr && applicant_arr.length > 0) { this.getQuestionControl().at(0)['controls'].relation_to.updateValueAndValidity(); this.getQuestionControl().at(0)['controls'].relation_entered.updateValueAndValidity(); this.getQuestionControl().at(0)['controls'].person_met_entered_pic.updateValueAndValidity(); + this.getQuestionControl().at(0)['controls'].person_met_entered_id_proof.updateValueAndValidity(); return returnVal } // debugger; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html index d3e31bc..6752aab 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html @@ -24,6 +24,7 @@ +

Required

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 33cfb4d..e0ea90a 100755 --- 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 @@ -1444,28 +1444,28 @@ export class EmployerInfoComponent implements OnInit { // return; let records= this.employerForm.getRawValue() - // FOR VERFYING THE IMAGE ARE CAPTURED - // if(flag != 'go_back') { - // let photCheck=records.questions[2] - // let index = this.stepperInfo.findIndex(vv=>vv.form_id == photCheck.form_id); - // console.log("Index",index); + // FOR VERFYING THE IMAGE ARE CAPTURED + if(flag != 'go_back') { + let photCheck=records.questions[2] + let index = this.stepperInfo.findIndex(vv=>vv.form_id == photCheck.form_id); + console.log("Index",index); - // if(photCheck.hasOwnProperty('nameboard_photographs') && photCheck.nameboard_photographs.length <1) { - // if(index != -1) { - // this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index - // } - // console.log("asdf"); - // this.notifier.notify("info","Minimum 1 photo required on Name Board") - // return - // } - // if(photCheck.hasOwnProperty('office_photographs') && photCheck.office_photographs.length <3) { - // if(index != -1) { - // this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index - // } - // this.notifier.notify("info","Minimum 3 photos required on Office Setup") - // return - // } - // } + if(photCheck.hasOwnProperty('nameboard_photographs') && photCheck.nameboard_photographs.length <1) { + if(index != -1) { + this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index + } + console.log("asdf"); + this.notifier.notify("info","Minimum 1 photo required on Name Board") + return + } + if(photCheck.hasOwnProperty('office_photographs') && photCheck.office_photographs.length <3) { + if(index != -1) { + this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index + } + this.notifier.notify("info","Minimum 3 photos required on Office Setup") + return + } + } // FOR MERGING EMPLOYMENT SECTION,DOCS SIGHTED,OFFICE AND NAME BOARD PHOTOGRAPH INTO SINGLE OBJ if(this.getQuestionControl().at(7).get('docs_sighted')) { diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 628b70e..39e8fc1 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -318,11 +318,11 @@ export class PdTrigerService { catchError(this.handleError('operation', [])) ) } - saveApplicantImgFromVendorForm(params) { - let userId= this._aws.getlocale(); - params.fk_createdby= userId - return this._http.post(this.apiUrl+'saveApplicantImgFromVendorForm',params) - } + // saveApplicantImgFromVendorForm(params) { + // let userId= this._aws.getlocale(); + // params.fk_createdby= userId + // return this._http.post(this.apiUrl+'saveApplicantImgFromVendorForm',params) + // } // load PD question answers // getAnswersForPD(list: any): Observable {