common question img validation

This commit is contained in:
sriram-at-840620226347 2020-10-17 13:03:13 +05:30
parent 26366f71f7
commit f404e0d67b
9 changed files with 205 additions and 92 deletions

View File

@ -1,6 +1,6 @@
<button (click)="capture($event)" mat-button mat-raised-button>
<mat-icon name="camera" *ngIf="!addMoreBtn" style="color: #fff !important;font-size: 20px !important;">camera_alt</mat-icon>
<mat-icon name="camera" *ngIf="addMoreBtn" style="color: #fff !important;font-size: 20px !important;">add_a_photo</mat-icon>
<mat-icon name="camera" *ngIf="addMoreBtn" style="color: #fff !important;font-size: 20px !important;">camera_alt</mat-icon>
<!-- <mat-icon name="camera" *ngIf="!addMoreBtn" style="color: #fff !important;font-size: 20px !important;">camera_alt</mat-icon> -->
</button>
<input type="file" (change)="capturedImage($event)" id="input-file" name="file" accept="image/*" capture="user" style="display: none">
<!-- document.querySelector('#input-file').click() -->

View File

@ -39,25 +39,24 @@
<div fxLayout="column" align="end">
<!-- <mat-label>Is Person Met</mat-label>&nbsp;&nbsp;&nbsp;&nbsp; -->
<div> <span style="font-size: 13px;margin-right: 2px">Not Met</span>
<mat-slide-toggle
<mat-slide-toggle (change)="dynamicOnChangeValidations($event.checked,[applicant.controls['is_person_met_pic'],applicant.controls['is_person_met_id_proof']],true)"
class="example-margin"
formControlName="is_person_met">
</mat-slide-toggle>
formControlName="is_person_met">
</mat-slide-toggle><br>
<span style="font-size: 13px;margin-left: 2px">Met</span> </div>
</div>
</div><br/>
<div *ngIf="applicant.value.is_person_met == true">
<div fxLayout="row" fxLayoutAlign="space-evenly">
<div fxLayout="column" align="center" >
<div fxLayout="column" align="center" fxLayoutAlign="center">
<!-- <ion-thumbnail slot="center"> -->
<div fxLayout="row" align="center">
<div fxLayout="row" fxLayoutAlign="center center">
<img ngxViewer text="PD Photos" title="Person Met Pic" class="ion-text-center" *ngIf="applicant.value.is_person_met_pic != ''"
src="{{applicant.value.is_person_met_pic}}" style="max-width: 70px;max-height: 70px" >
</div>
<!-- </ion-thumbnail> -->
<span>
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="saveApplicantInfo($event,applicant,'is_person_met_pic')"></app-capture-btn>
<span (click)="captureControls(applicant, 'is_person_met_pic','','saveApplicantInfo')">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,'','is_person_met_pic')"></app-capture-btn>
</span>
<!-- <ion-button (click)="saveApplicantInfo(applicant,'is_person_met_pic')"
fill="clear" ><ion-icon style="font-size: 30px" name="camera"></ion-icon></ion-button><br/> -->
@ -68,8 +67,8 @@
<img ngxViewer text="PD Photos" title="ID Proof" class="ion-text-center" *ngIf="applicant.value.is_person_met_id_proof != ''"
src="{{applicant.value.is_person_met_id_proof}}" style="max-width: 70px;max-height: 70px" >
</div>
<span>
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="saveApplicantInfo($event,applicant,'is_person_met_id_proof')"></app-capture-btn>
<span (click)="captureControls(applicant, 'is_person_met_id_proof','','saveApplicantInfo')">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,applicant,'is_person_met_id_proof')"></app-capture-btn>
</span>
<!-- <ion-button
(click)="saveApplicantInfo(applicant,'is_person_met_id_proof')"
@ -87,27 +86,27 @@
</div>
<div *ngIf="remarksEnableFun()">
<div fxLayout="row">
<div fxLayout="column">
<!-- <div fxLayout="column"> -->
<mat-form-field appearance="fill" style="margin-top: 1%;justify-content: center">
<mat-label>Name of Person Met</mat-label>
<input matInput type="text" formControlName="person_met_entered" />
<mat-error align="end" style="font-size:13px" *ngIf="getQuestionControl().at(0)['controls']['person_met_entered'].errors?.required || getQuestionControl().at(0)['controls']['person_met_entered'].touched">Person Name required</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" size="3" align="center" *ngIf="getQuestionControl().at(0).value.person_met_entered != ''">
<!-- </div> -->
<!-- <div fxLayout="column" size="3" align="center" *ngIf="getQuestionControl().at(0).value.person_met_entered != ''">
<div fxLayout="row" fxLayoutAlign="center center">
<img ngxViewer text="PD Photos" title="Person Met Image" *ngIf="getQuestionControl().at(0).value.person_met_entered_pic != ''"
src="{{getQuestionControl().at(0).value.person_met_entered_pic}}" style="max-width: 80px;max-height: 80px">
</div>
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)"></app-capture-btn>
</div> -->
<!-- <app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)"></app-capture-btn> -->
<!-- <ion-button (click)="capturePic(getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)"
fill="clear" ><ion-icon style="font-size: 20px" name="camera"></ion-icon><span style="color: red;
font-size: 18px;
padding: 0px;
margin: 0px;">*</span></ion-button> -->
<!-- <mat-label *ngIf="getQuestionControl().at(0).value.person_met_entered_pic == ''" style="font-size: 11px">Capture the Image </mat-label> -->
<mat-error align="end" style="font-size:12px" *ngIf="getQuestionControl().at(0)['controls']['person_met_entered_pic'].errors?.required || getQuestionControl().at(0)['controls']['person_met_entered_pic'].touched">Person Met pic is Required</mat-error>
</div>
<!-- <mat-error align="end" style="font-size:12px" *ngIf="getQuestionControl().at(0)['controls']['person_met_entered_pic'].errors?.required || getQuestionControl().at(0)['controls']['person_met_entered_pic'].touched">Person Met pic is Required</mat-error> -->
<!-- </div> -->
</div>
<div *ngIf="getQuestionControl().at(0).value.person_met_entered != ''">
<div fxLayout="row" fxLayoutAlign="space-evenly">
@ -118,7 +117,7 @@
src="{{getQuestionControl().at(0).value.person_met_entered_pic}}" style="max-width: 70px;max-height: 70px" >
</div>
<!-- </ion-thumbnail> -->
<span>
<span (click)="captureControls(getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)"></app-capture-btn>
</span>
<!-- <ion-button (click)="capturePic(getQuestionControl().at(0)['controls'].person_met_entered_pic, 'Person Met Pic',getQuestionControl().at(0).value.form_id)"
@ -134,13 +133,14 @@
<img ngxViewer text="PD Photos" title="ID Proof" class="ion-text-center" *ngIf="getQuestionControl().at(0).value.person_met_entered_id_proof != ''"
src="{{getQuestionControl().at(0).value.person_met_entered_id_proof}}" style="max-width: 70px;max-height: 70px" >
</div>
<span>
<span (click)="captureControls(getQuestionControl().at(0)['controls'].person_met_entered_id_proof, 'Id Proof Pic',getQuestionControl().at(0).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getQuestionControl().at(0)['controls'].person_met_entered_id_proof, 'Id Proof Pic',getQuestionControl().at(0).value.form_id)"></app-capture-btn>
</span>
<!-- <ion-button
(click)="capturePic(getQuestionControl().at(0)['controls'].person_met_entered_id_proof, 'Id Proof Pic',getQuestionControl().at(0).value.form_id)"
fill="clear" ><ion-icon style="font-size: 30px" name="camera"></ion-icon></ion-button><br/> -->
<mat-label>ID Proof of the person</mat-label>
<mat-error align="end" style="font-size:12px" *ngIf="getQuestionControl().at(0)['controls']['person_met_entered_id_proof'].errors?.required ">Required</mat-error>
</div>
</div>
</div>
@ -409,8 +409,10 @@
<img ngxViewer text="PD Photos" title="Approach to FI Location" *ngIf="getQuestionControl().at(1).value.pd_location_pic != ''"
src="{{getQuestionControl().at(1).value.pd_location_pic}}" style="max-width: 80px;max-height: 80px;font-size: 13px !important;">
</div>
<span (click)="captureControls(getQuestionControl().at(1)['controls'].pd_location_pic, 'Approach to PD Location ( ' + currentDate + ' )',getQuestionControl().at(1).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getQuestionControl().at(1)['controls'].pd_location_pic, 'Approach to PD Location ( ' + currentDate + ' )',getQuestionControl().at(1).value.form_id)"></app-capture-btn>
<!-- <ion-button (click)="capturePic(getQuestionControl().at(1)['controls'].pd_location_pic, 'Approach to PD Location ( ' + currentDate + ' )',getQuestionControl().at(1).value.form_id)"
</span>
<!-- <ion-button (click)="capturePic(getQuestionControl().at(1)['controls'].pd_location_pic, 'Approach to PD Location ( ' + currentDate + ' )',getQuestionControl().at(1).value.form_id)"
fill="clear" ><ion-icon style="font-size: 20px" name="camera"></ion-icon><span style="color: red;
font-size: 18px;
padding: 0px;
@ -471,8 +473,10 @@
<img ngxViewer text="PD Photos" title="Name Board" *ngIf="getBusinessInfoControls().at(0).value.name_board_sighted_pic != ''"
src="{{getBusinessInfoControls().at(0).value.name_board_sighted_pic}}" style="max-width: 80px;max-height: 80px;font-size:13px !important;">
</div>
<span (click)="captureControls(getBusinessInfoControls().at(0)['controls'].name_board_sighted_pic,'Name Board Seen',getBusinessInfoControls().at(0).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getBusinessInfoControls().at(0)['controls'].name_board_sighted_pic,'Name Board Seen',getBusinessInfoControls().at(0).value.form_id)"></app-capture-btn>
<!-- <ion-button (click)="capturePic(getBusinessInfoControls().at(0)['controls'].name_board_sighted_pic,'Name Board Seen',getBusinessInfoControls().at(0).value.form_id)"
</span>
<!-- <ion-button (click)="capturePic(getBusinessInfoControls().at(0)['controls'].name_board_sighted_pic,'Name Board Seen',getBusinessInfoControls().at(0).value.form_id)"
fill="clear" ><ion-icon name="camera"></ion-icon><span style="color: red;
font-size: 18px;
padding: 0px;
@ -514,7 +518,9 @@
<img ngxViewer text="PD Photos" title="{{documents.value.document_name}}" *ngIf="documents.value.document_image != ''"
src = "{{documents.value.document_image}}" style="max-width: 80px;max-height: 80px;font-size:13px !important;">
</div>
<span (click)="captureControls(documents['controls'].document_image,documents.value.document_name,getBusinessInfoControls().at(0).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,documents['controls'].document_image,documents.value.document_name,getBusinessInfoControls().at(0).value.form_id)"></app-capture-btn>
</span>
<!-- <ion-button (click)="capturePic(documents['controls'].document_image,documents.value.document_name,getBusinessInfoControls().at(0).value.form_id)"
fill="clear" ><ion-icon name="camera"></ion-icon></ion-button><br/> -->
<!-- <mat-label *ngIf="documents.value.document_image == ''" style="font-size: 11px">Capture the Image</mat-label> -->
@ -574,7 +580,9 @@
<img ngxViewer text="PD Photos" title="{{documents.value.document}}" *ngIf="documents.value.document_pic != ''"
src = "{{documents.value.document_pic}}" style="max-width: 80px;max-height: 80px;font-size:13px !important;">
</div>
<span (click)="captureControls(documents['controls'].document_pic,documents.value.document,getBusinessInfoControls().at(0).value.form_id)">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,documents['controls'].document_pic,documents.value.document,getBusinessInfoControls().at(0).value.form_id)"></app-capture-btn>
</span>
<!-- <ion-button (click)="capturePic(documents['controls'].document_pic,documents.value.document,getBusinessInfoControls().at(0).value.form_id)"
fill="clear" ><ion-icon name="camera"></ion-icon></ion-button><br/>
<mat-label *ngIf="documents.value.document_pic == ''" style="font-size: 11px">Capture the Image</mat-label> -->
@ -624,8 +632,12 @@
</div>
<div *ngIf="getBusinessInfoOfficePhotControls().length == 0" style="text-align: center;margin-top: 15px;">
No Photographs Found</div>
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="addMoreBusinessOfficeImage($event,getBusinessInfoControls().at(0).value.form_id)"></app-capture-btn>
<div fxLayout="column" align="center" fxLayoutAlign="center center">
<span (click)="captureControls('','',getBusinessInfoControls().at(0).value.form_id,'addMoreBusinessOfficeImage')">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getBusinessInfoControls().at(0).value.form_id)"></app-capture-btn>
</span>
<mat-label>Add More</mat-label>
</div>
<!-- <div fxLayout="column" align="center" fxLayoutAlign="center center"> -->
<!-- <img src="https://lh3.googleusercontent.com/proxy/euOnni6JKoCJKwXq9Hq8c6fkRaxI5SYQVsHUwx_w_Wt_9zGXsABxnFsjRv7_E3Xer35VR1oalGBRKWdlwQPMo9SoDqOrmx9h7zqmAXMG37rcrpaU_jPXMXAdffKjB0M_zy3yQNJRpOKvqUlx2JmvB68r8cDCGbVUQvW8Zk2yoR4I23i4ZM7U" style="max-width: 80px;max-height: 80px"/><br/> -->
<!-- <ion-button (click)="addMoreBusinessOfficeImage(getBusinessInfoControls().at(0).value.form_id)"
@ -688,8 +700,10 @@
</div>
<div *ngIf="getBusinessAssetSightImage().length == 0" style="text-align: center;margin-top: 15px;">
No Photographs Found</div>
<div fxLayout="column" align="center" fxLayoutAlign="center center">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="addMoreBusinessAssetSightImage($event,getBusinessInfoControls().at(1).value.form_id)"></app-capture-btn>
<div fxLayout="column" align="center" fxLayoutAlign="center center">
<span (click)="captureControls('','',getBusinessInfoControls().at(1).value.form_id,'addMoreBusinessAssetSightImage')">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getBusinessInfoControls().at(1).value.form_id)"></app-capture-btn>
</span>
<mat-label>Add More</mat-label>
<!-- <img src="https://lh3.googleusercontent.com/proxy/euOnni6JKoCJKwXq9Hq8c6fkRaxI5SYQVsHUwx_w_Wt_9zGXsABxnFsjRv7_E3Xer35VR1oalGBRKWdlwQPMo9SoDqOrmx9h7zqmAXMG37rcrpaU_jPXMXAdffKjB0M_zy3yQNJRpOKvqUlx2JmvB68r8cDCGbVUQvW8Zk2yoR4I23i4ZM7U" style="max-width: 80px;max-height: 80px"/><br/> -->
<!-- <ion-button (click)="addMoreBusinessAssetSightImage(getBusinessInfoControls().at(1).value.form_id)"
@ -738,7 +752,9 @@
<div *ngIf="getStockControl().length == 0" style="text-align: center;margin-top: 15px;">
No Photographs Found</div>
<div fxLayout="column" align="center" fxLayoutAlign="center center">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="addMoreStockImage($event,getBusinessInfoControls().at(2).value.form_id)"></app-capture-btn>
<span (click)="captureControls('','',getBusinessInfoControls().at(2).value.form_id,'addMoreStockImage')">
<app-capture-btn addMoreBtn="true" class="file-btn" (imageDataEmitter)="capturePic($event,getBusinessInfoControls().at(2).value.form_id)"></app-capture-btn>
</span>
<mat-label>Add More</mat-label>
<!-- <img src="https://lh3.googleusercontent.com/proxy/euOnni6JKoCJKwXq9Hq8c6fkRaxI5SYQVsHUwx_w_Wt_9zGXsABxnFsjRv7_E3Xer35VR1oalGBRKWdlwQPMo9SoDqOrmx9h7zqmAXMG37rcrpaU_jPXMXAdffKjB0M_zy3yQNJRpOKvqUlx2JmvB68r8cDCGbVUQvW8Zk2yoR4I23i4ZM7U" style="max-width: 80px;max-height: 80px"/><br/> -->
<!-- <ion-button (click)="addMoreStockImage(getBusinessInfoControls().at(2).value.form_id)"

View File

@ -2,7 +2,9 @@
color: #fff !important;
background-color: #e00201 !important;
}
::ng-deep .mat-dialog-container{
padding: 0px !important;
}
.mat-button, .mat-raised-button{
background-color: #e24533;
color: white;

View File

@ -145,6 +145,7 @@ export class CommonQuesComponent implements OnInit {
get questions() { return this.firstFormGroup.get('questions');}
employerform_pdinfo:any;
currImageControls: { controls: any; img_name?: String; form_id?: any; fun_name:string,valid:boolean};
@ViewChild('stepper') private myStepper: MatStepper;
@ -477,13 +478,13 @@ generateGroupControls(datas) {
}
if(group_obj.form_id == "13" && group_obj.hasOwnProperty('office_photographs') && group_obj.office_photographs) {
group_obj.office_photographs.forEach(()=>{
this.addMoreBusinessOfficeImage()
this.addMoreBusinessOfficeImage('')
})
}
// FOR BUSINESS ASSET SIGHT IMAGE HANDLING
if(group_obj.form_id == "22" && group_obj.hasOwnProperty('business_sight_image') && group_obj.business_sight_image) {
group_obj.business_sight_image.forEach(()=>{
this.addMoreBusinessAssetSightImage()
this.addMoreBusinessAssetSightImage('')
})
}
// For Other Documents images
@ -497,7 +498,7 @@ generateGroupControls(datas) {
// FOR STOCK IMAGES
if(group_obj.form_id == "11" && group_obj.hasOwnProperty('images') && group_obj.images) {
group_obj.images.forEach(()=>{
this.addMoreStockImage()
this.addMoreStockImage('')
})
}
})
@ -641,7 +642,7 @@ addAddressControls() {
uom_others:[''],
is_pd_done_on_initiated_address:[true],
pd_location:['',Validators.compose([Validators.required])],
pd_location_pic:[''],
pd_location_pic:['',Validators.compose([Validators.required])],
comment_locality:['',Validators.compose([Validators.required])],
form_id:['5'],
form_name:["Address Info"],
@ -702,7 +703,7 @@ addBusinessInfoControls() {
return this._formBuilder.group({
officer_total:['',Validators.compose([Validators.required])],
was_the_company_name_board_sighted:['',Validators.compose([Validators.required])],
name_board_sighted_pic:[''],
name_board_sighted_pic:['',Validators.compose([Validators.required])],
documents_sighted:['',Validators.compose([Validators.required])],
documents_info:this._formBuilder.array([]),
other_documents:['',Validators.compose([Validators.required])],
@ -715,13 +716,13 @@ addBusinessInfoControls() {
addBusinessInfoDocsControls() {
return this._formBuilder.group({
document_name:['',Validators.compose([Validators.required])],
document_image:['']
document_image:['',Validators.compose([Validators.required])]
})
}
addBusinessInfoOtherDocsControls() {
return this._formBuilder.group({
document:[''],
document_pic:['']
document:['',Validators.compose([Validators.required])],
document_pic:['',Validators.compose([Validators.required])]
})
}
addBusinessAssetControls() {
@ -849,7 +850,7 @@ getQuestionControl() {
// END OF GETTING PARTICULAR FORM CONTROLS
//START OF ADD OR REMOVE MORE FORMS OR IMAGES
addMoreStockImage(event?,form_id?) {
addMoreStockImage(event,form_id?) {
let formArray = this.firstFormGroup.get('questions') as FormArray;
// console.log(formArray);
let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
@ -866,7 +867,7 @@ addMoreStockImage(event?,form_id?) {
}
// console.log(this.firstFormGroup.value);
}
addMoreBusinessOfficeImage(event?,form_id?) {
addMoreBusinessOfficeImage(event,form_id?) {
let formArray = this.firstFormGroup.get('questions') as FormArray;
// console.log(formArray);
let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
@ -883,7 +884,7 @@ addMoreBusinessOfficeImage(event?,form_id?) {
}
// console.log(this.firstFormGroup.value);
}
addMoreBusinessAssetSightImage(event?,form_id?) {
addMoreBusinessAssetSightImage(event,form_id?) {
let formArray = this.firstFormGroup.get('questions') as FormArray;
// console.log(formArray);
let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
@ -1028,9 +1029,41 @@ if(Avaliablity == 0){
ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
}
captureControls(controls,img_name?:String,form_id?,fun_name='capturePic') {
this.currImageControls = {controls:controls,img_name:img_name,form_id:form_id,fun_name:fun_name,valid:true}
}
capturePic(event,controls,img_name?:String,form_id?) {
console.clear();
console.log(controls)
console.log("Capture pic",event,controls,img_name,event)
if(this.currImageControls && this.currImageControls.valid) {
controls = this.currImageControls.controls
img_name = this.currImageControls.img_name
form_id = this.currImageControls.form_id
}
if(this.currImageControls.fun_name != 'capturePic' && this.currImageControls.valid) {
if(this.currImageControls.fun_name == 'saveApplicantInfo') {
this.currImageControls.valid = false
this.saveApplicantInfo(event,controls,img_name)
return;
}
if(this.currImageControls.fun_name == 'addMoreBusinessOfficeImage') {
this.currImageControls.valid = false
this.addMoreBusinessOfficeImage(event,form_id)
return;
}
if(this.currImageControls.fun_name == 'addMoreBusinessAssetSightImage') {
this.currImageControls.valid = false
this.addMoreBusinessAssetSightImage(event,form_id)
return;
}
if(this.currImageControls.fun_name == 'addMoreStockImage') {
this.currImageControls.valid = false
this.addMoreStockImage(event,form_id)
return;
}
}
console.log("Capture pic",event,controls,img_name,event)
// return;
// controls.setValue("pic");
@ -1147,42 +1180,54 @@ onDocsSightedChange(value,flag) {
}
}
// saveApplicantInfo(applicant_obj,image_key) {
// console.log(applicant_obj);
// this.cameraProvider.showImageDialog().then((res:any)=>{
// console.log("g",res)
// if (res != 'error') {
// let geoCoordinates = localStorage.getItem('current_coordinates')
// // this.cons.getGeoTag().then(geoCoordinates=>{
// this.cameraProvider.addWatermarks(res).then(watermarkedImage => {
// applicant_obj.controls[image_key].setValue(watermarkedImage);
// let params = {
// "pd_co_applicant_id":applicant_obj.value.pd_co_applicant_id,
// "applicant_name":applicant_obj.value.applicant_name,
// "is_person_met":applicant_obj.value.is_person_met,
// "fk_pd_id":this.pdDetails.pd_id,
// "link":geoCoordinates
// }
// params[image_key] = applicant_obj.value[image_key]
saveApplicantInfo(event,applicant_obj,image_key) {
console.log("saveApplicantInfo",applicant_obj,image_key)
console.log(applicant_obj);
// this.cameraProvider.showImageDialog().then((res:any)=>{
var reader = new FileReader();
// let imagePath = event;
reader.readAsDataURL(event);
reader.onload = (_event) => {
// this.imageData = reader.result;
this.cameraService.getPosition().then(geoCords=>{
let geoCoordinates
if(geoCords != 'error') {
geoCoordinates = geoCords
}
else {
geoCoordinates = null;
}
console.log(geoCords);
// this.cons.getGeoTag().then(geoCoordinates=>{
this.cameraService.addWatermarks(reader.result,geoCoordinates).then(watermarkedImage => {
applicant_obj.controls[image_key].setValue(watermarkedImage);
let params = {
"pd_co_applicant_id":applicant_obj.value.pd_co_applicant_id,
"applicant_name":applicant_obj.value.applicant_name,
"is_person_met":applicant_obj.value.is_person_met,
"fk_pd_id":this.pdDetails.pd_id,
"link":geoCoordinates
}
params[image_key] = applicant_obj.value[image_key]
// this.quesService.saveApplicantImgFromVendorForm(params).subscribe(result=>{
// if(result['dataStatus']) {
// applicant_obj.controls[image_key].setValue(result['uri']);
// }
// else {
// applicant_obj.controls[image_key].setValue("");
// console.log(result);
// this.toastProvider.pdTriggerappmessage("Something went wrong!!",'warning');
// }
// },err=>{
// applicant_obj.controls[image_key].setValue("");
// console.log(err)
// this.toastProvider.pdTriggerappmessage("Network Error","danger")
// })
// })
// }
// })
// }
this.quesService.saveApplicantImgFromVendorForm(params).subscribe(result=>{
if(result['dataStatus']) {
applicant_obj.controls[image_key].setValue(result['uri']);
}
else {
applicant_obj.controls[image_key].setValue("");
console.log(result);
this.notifier.notify("warning",'Something went wrong!!')
}
},err=>{
applicant_obj.controls[image_key].setValue("");
console.log(err)
this.notifier.notify("error",'Network Error !!')
})
})
}
)}
}
public findInvalidControls() {
const invalid = [];
let msg=''
@ -1280,9 +1325,50 @@ onSubmit(flag?) {
this.notifier.notify('info',invalidMsg);
return
}
// return;
// return;
let records= this.firstFormGroup.getRawValue()
if(flag != 'go_back') {
let business_group=records.questions[2]
let index = this.stepperInfo.findIndex(vv=>vv.form_id == business_group.form_id);
console.log("Index",index);
// FOR OFFICE IMAGE CHECK (3 REQUIRED)
if(business_group.hasOwnProperty('business_group') && business_group.business_group.length > 0) {
let photCheck = business_group.business_group[0]
if(photCheck.hasOwnProperty('office_photographs') && photCheck.office_photographs.length <3) {
if(index != -1) {
this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index
}
this.notifier.notify("warning",'Minimum 3 photos required on Workplace Photograph')
return
}
}
// FOR STOCK IMAGE CHECK (3 REQUIRED)
if(business_group.hasOwnProperty('business_group') && business_group.business_group.length > 2) {
let photCheck = business_group.business_group[2]
if(photCheck.hasOwnProperty('is_stock_photo') && photCheck.is_stock_photo == 'yes' && photCheck.hasOwnProperty('images') && photCheck.images.length <3) {
if(index != -1) {
this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index
}
this.notifier.notify("warning",'Minimum 3 photos required on Stock Photographs')
return
}
}
// FOR BUSINESS ASSET IMAGE CHECK (1 REQUIRED)
if(business_group.hasOwnProperty('business_group') && business_group.business_group.length > 2) {
let photCheck = business_group.business_group[1]
if(photCheck.hasOwnProperty('business_asset_sight') && photCheck.business_asset_sight == 'yes' && photCheck.hasOwnProperty('business_sight_image') && photCheck.business_sight_image.length <1) {
if(index != -1) {
this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index
}
this.notifier.notify("warning",'Minimum 1 photo required on Business asset sighted photographs')
return
}
}
}
this.spinner_access = true;
let records= this.firstFormGroup.getRawValue()
// let records= this.firstFormGroup.getRawValue()
console.log(records);
records.pdid = this.pdDetails.pd_id;
records.formid = "25";
@ -1480,7 +1566,7 @@ if(applicant_arr && applicant_arr.length > 0) {
this.getQuestionControl().at(0)['controls'].designation_entered.setValidators(Validators.required)
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_pic.setValidators(Validators.required)
returnVal = true
}
else {
@ -1495,7 +1581,7 @@ if(applicant_arr && applicant_arr.length > 0) {
this.getQuestionControl().at(0)['controls'].designation_entered.clearValidators();
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_pic.clearValidators()
// return false
returnVal = false
}
@ -1503,7 +1589,7 @@ if(applicant_arr && applicant_arr.length > 0) {
this.getQuestionControl().at(0)['controls'].designation_entered.updateValueAndValidity();
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_pic.updateValueAndValidity();
return returnVal
}
// debugger;

View File

@ -17,10 +17,10 @@
</mat-radio-group>
</div><br/>
</div>
<div fxFlex="40">
<div fxFlex="40" align="center" fxLayoutAlign="center center">
<div *ngIf="item.controls['img'] && item.value.img != ''">
<img [src]="item.value.img" ngxViewer style="width:85px; height: 85px;float:right">
</div>
</div><br>
<app-capture-btn addMoreBtn="true" *ngIf="camera_btn[i] == true" class="file-btn" (imageDataEmitter)="capture($event,i,item)"></app-capture-btn>
<!-- <div style="width: 100%"> -->
<!-- <ion-buttons slot="end"> -->

View File

@ -3,19 +3,19 @@
</mat-card-title>
<div style="max-height: 480px; width: 550px;">
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="55" fxFlex.lg="55" fxFlex.xl="55">
<owl-date-time-inline [min]="min" [(ngModel)]="selectedMoment"></owl-date-time-inline>
</div>
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="45" fxFlex.lg="45" fxFlex.xl="45">
<mat-list style="margin-top: 60%;">
<mat-list>
<mat-list-item>
<strong>{{selectedMoment | date: 'dd/MM/yyyy'}}</strong>
<strong>{{selectedMoment | date: 'dd/MM/yyyy'}}</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{{selectedMoment | date:'h:mm a'}}</strong>
</mat-list-item>
<mat-list-item>
<!-- <mat-list-item>
<strong>{{selectedMoment | date:'h:mm a'}}</strong>
</mat-list-item>
</mat-list-item> -->
<!-- <mat-list-item>
<mat-form-field>
<mat-select placeholder="Time" [formControl]="scheduleControl" required>
@ -26,14 +26,15 @@
<mat-error *ngIf="scheduleControl.hasError('required')">Please Choose Time</mat-error>
</mat-form-field>
</mat-list-item> -->
</mat-list>
<mat-list style="padding-top: 15%;">
<!-- </mat-list> -->
<!-- <mat-list style="padding-top: 15%;"> -->
<mat-list-item>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="below" type="button" (click)="closeScheduleComponent()"><mat-icon>close</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="below" (click)="upatePDSchedule(selectedMoment)"><mat-icon>save</mat-icon></button>
</mat-list-item>
</mat-list-item>
</mat-list>
</div>
</div>
</div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,3 @@
.mat-list-item-content{
padding:0px !important;
}

View File

@ -318,6 +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)
}
// load PD question answers
// getAnswersForPD(list: any): Observable<any> {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB