EB bill added by suren

This commit is contained in:
sriram-at-840620226347 2019-10-18 15:54:00 +05:30
parent e0f2b62023
commit 237fd6dcf9
2 changed files with 56 additions and 1 deletions

View File

@ -2282,6 +2282,40 @@
</div>
</ion-col>
</ion-row>
<ion-row *ngIf="businessForm.controls['eb_bill']">
<ion-col>
<p>Electricity Bill</p>
<mat-radio-group formControlName="eb_bill" (change)="radioChange($event,9)" required>
<mat-radio-button value="yes">Yes</mat-radio-button>
<mat-radio-button value="no">No</mat-radio-button>
<mat-radio-button class="na" value="not applicable">NA</mat-radio-button>
</mat-radio-group>
<mat-error style="color:red;font-size:12px;margin:0;padding:0;font-weight: normal;float:right" *ngIf="businessForm.controls['eb_bill'].hasError('required')">Fire NOC
is Required</mat-error>
</ion-col>
<ion-col>
<div float-right *ngIf="businessForm.controls['eb_bill'].value == 'yes'">
<br>
<div *ngIf="businessForm.controls['eb_bill_pic']">
<div *ngIf="businessForm.controls['eb_bill_pic'].value !== ''">
<img src="{{businessForm.controls['eb_bill_pic'].value}}" imageViewer
style="width: 40px;height: 35px;">
</div>
<div *ngIf="businessForm.controls['eb_bill_pic'].value === ''">
<label style="display: block; text-align: center !important;"> Electricity Bill Image </label>
</div>
<div style="text-align: -webkit-center;">
<ion-icon title="Click Here For Electricity Bill Image" name="md-camera"
(click)="ImageUpload(9)"></ion-icon>
</div>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>

View File

@ -499,6 +499,7 @@ export class PdQuestionBusinessInfoPage {
return data['records'].manufacturing_activity_details[key];
});
if (selectedManufacturing.length > 0) {
this.businessForm.addControl('eb_bill',new FormControl('',Validators.compose([Validators.required])))
selectedManufacturing.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert');
selectedManufacturing.length > 0 ? this.businessForm.addControl('factory_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('factory_cert');
@ -895,6 +896,7 @@ export class PdQuestionBusinessInfoPage {
if (data['records'].esic_regn == 'yes') { this.businessForm.addControl('esic_regn_pic', new FormControl('', Validators.compose([Validators.required]))); } else { this.businessForm.removeControl('esic_regn_pic'); }
if (data['records'].export_import_cert == 'yes') { this.businessForm.addControl('export_import_cert_pic', new FormControl('', Validators.compose([Validators.required]))); } else { this.businessForm.removeControl('export_import_cert_pic'); }
if (data['records'].fire_noc == 'yes') { this.businessForm.addControl('fire_noc_pic', new FormControl('', Validators.compose([Validators.required]))); } else { this.businessForm.removeControl('fire_noc_pic'); }
if (data['records'].eb_bill =='yes' && data['records'].manufacturing_activity_details.length > 0){ this.businessForm.addControl('eb_bill_pic', new FormControl('')); }else{ this.businessForm.removeControl('eb_bill_pic');}
businessVal.business_info_location ? delete businessVal.business_info_location : ''
this.businessForm.patchValue(businessVal);
@ -1120,12 +1122,14 @@ export class PdQuestionBusinessInfoPage {
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
manufacturingControl.controls = [];
manufacturingControl.setValue([]);
this.businessForm.removeControl('eb_bill')
}
else if (event.value.exist_status == false && event.value.type_of_activity_id == 2) {
this.ManufacturingChecked = event.value.exist_status;
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
manufacturingControl.push(this.manufactureDetails());
this.businessForm.addControl('eb_bill',new FormControl('',Validators.compose([Validators.required])))
}
@ -1990,6 +1994,19 @@ export class PdQuestionBusinessInfoPage {
this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
} }
if (this.businessForm.controls['eb_bill'] && this.businessForm.controls['eb_bill'].invalid) {
this.toast.pdTriggerappmessage("Electricity Bill is required");
this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
if (this.businessForm.controls['eb_bill_pic'] && this.businessForm.value.eb_bill == 'yes') {
if (this.businessForm.controls['eb_bill_pic'].invalid) {
this.toast.pdTriggerappmessage("Electricity Bill pic is required");
this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
} }
// if(this.businessForm.controls['export_sale_of_total_sales']){
@ -2204,6 +2221,7 @@ export class PdQuestionBusinessInfoPage {
records.hasOwnProperty('pf_regn_pic') && records.pf_regn_pic != '' ? records.pf_regn_pic = 'SAVED' :''
records.hasOwnProperty('esic_regn_pic') && records.esic_regn_pic != '' ? records.esic_regn_pic = 'SAVED' :''
records.hasOwnProperty('fire_noc_pic') && records.fire_noc_pic != '' ? records.fire_noc_pic = 'SAVED' :''
records.hasOwnProperty('eb_bill_pic') && records.eb_bill_pic != '' ? records.eb_bill_pic = 'SAVED' :''
console.log("record params2",records.gst_Regn_cert_pic)
if(records.hasOwnProperty('documents')){
if(records.documents.length >0){
@ -2680,6 +2698,7 @@ export class PdQuestionBusinessInfoPage {
if (Flag == 6) { this.businessForm.controls.pf_regn_pic.setValue(res != 'error' ? res : ''); img_name="pf_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 7) { this.businessForm.controls.esic_regn_pic.setValue(res != 'error' ? res : ''); img_name="esic_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 8) { this.businessForm.controls.fire_noc_pic.setValue(res != 'error' ? res : ''); img_name="fire_noc_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 9) { this.businessForm.controls.eb_bill_pic.setValue(res != 'error' ? res : ''); img_name="eb_bill_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if(res != 'error'){
this.cons.getGeoTag().then(geoCoordinates=>{
let bucket:any=[]
@ -2701,9 +2720,10 @@ export class PdQuestionBusinessInfoPage {
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
}
}
radioChange(event, Flag) {
console.log(event)
if (Flag == 1) { event.value == 'yes' ? this.businessForm.addControl('shop_eat_act_cert_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('shop_eat_act_cert_pic'); }
if (Flag == 2) { event.value == 'yes' ? this.businessForm.addControl('gst_Regn_cert_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('gst_Regn_cert_pic'); }
if (Flag == 4) { event.value == 'yes' ? this.businessForm.addControl('factory_cert_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('factory_cert_pic'); }
@ -2712,5 +2732,6 @@ export class PdQuestionBusinessInfoPage {
if (Flag == 7) { event.value == 'yes' ? this.businessForm.addControl('esic_regn_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('esic_regn_pic'); }
if (Flag == 3) { event.value == 'yes' ? this.businessForm.addControl('export_import_cert_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('export_import_cert_pic'); }
if (Flag == 8) { event.value == 'yes' ? this.businessForm.addControl('fire_noc_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('fire_noc_pic'); }
if (Flag == 9) { event.value == 'yes' ? this.businessForm.addControl('eb_bill_pic', new FormControl('', Validators.compose([Validators.required]))) : this.businessForm.removeControl('eb_bill_pic'); }
}
}