+
+
+ Remarks
+
+
+
+
-
+
-
+
\ No newline at end of file
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 06a7862b3..2d4e6a122 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
@@ -1,428 +1,299 @@
-import {
- Component,OnInit,
- Inject, Output,
- Input, ElementRef, ViewEncapsulation
-} from '@angular/core';
+import { Component, OnInit, Inject, Output, Input, ElementRef, ViewEncapsulation } from '@angular/core';
-import {
- FormBuilder, FormGroup,
- Validators,
- FormArray, FormControl, AbstractControl,
-} from '@angular/forms';
+import { FormBuilder, FormGroup, Validators, FormArray, FormControl, AbstractControl } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
-import {
- MatDialog,
- MatDialogRef,
- MAT_DIALOG_DATA
-} from '@angular/material';
+import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+
+import { ActivatedRoute, Router } from "@angular/router";
+
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
-import {ActivatedRoute, Router} from "@angular/router";
+
@Component({
selector: 'app-address',
templateUrl: './address.component.html',
styleUrls: ['./address.component.scss'],
encapsulation: ViewEncapsulation.None
-
})
export class AddressComponent implements OnInit {
+
+ /**Declaration of Header Variables */
customer_segment_abbr: any;
subproduct_abbr: any;
lender_applicant_id: any;
main_applicant: any;
- pageTitle: string ="PD Address Details";
-
+ pageTitle: string = "PD Address Details";
+
+ /**Declaration of FormField Variables */
//@Input() pdid: number;
- pdid : number;
+ pdid: number;
form_id: number;
pdAddress: string;
+ pdState: any;
+ pdCity: any;
+ pdPincode: any;
+ pdOtherPincode: any;
CustSegAbbr: any;
- loadDataStatus: boolean=true;
-
- // PremisesOtherFlag:boolean;
- // PremisesLabel : any = [];
+ loadDataStatus: boolean = true;
+ placeholderName: any = 'Estimated area of the (Address Type)';
+
+ /**Array declaration Of Dropdown */
locationdata: any = [];
commentData: any = [];
- //customerData: any = []; 221118 review doc s.no 3.e
- addressData:any = [];
- localityData:any = [];
- // ownerShipData:any = [];
- // cityData:any = [];
-
- // z = 0;
+ addressData: any = [];
+ localityData: any = [];
+ stateData: any = [];
+ pincodeData: any = [];
+ cityData: any = [];
+ uomData: any = [];
- // formPremisesArray: any = [];
- // formPremisesCityArray: any = [];
- // additional_premises: any=[];
- // bussiness_address_type: any=[];
- // premisesRentAmtInwords:any=[];
- // rentAmtInwords:any;
- // tempArr: any[];
- placeholderName : any = 'Was any business activity seen at the Address Type during PD visit?';
- //neighbourStatusData:any=["Yes","No"];
- //applicantOwnerData:any=["Yes","No","Dont Know"];
- // public currentLoanForm: FormGroup;
+ /**Declaration of FormField Variables */
private notifier: NotifierService;
public addressForm: FormGroup;
public address: AbstractControl;
public addressType: AbstractControl;
+ public state: AbstractControl;
+ public city: AbstractControl;
+ public pincode: AbstractControl;
public locality: AbstractControl;
public pdLocation: AbstractControl;
public commentLocality: AbstractControl;
- // public otherCommentLocality: AbstractControl;
- // public customerBehaviour: AbstractControl;
- // public ownership: AbstractControl;
- // public other_ownership: AbstractControl;
- // public rent_amt : AbstractControl;
- // public other_premises_bussiness_activity : AbstractControl;
- // public bussiness_activity_remark: AbstractControl;
- // public bussinessActivity: AbstractControl;
- // public business_years: AbstractControl;
- // public business_month: AbstractControl;
- //constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) {
- constructor(private el: ElementRef, notifier: NotifierService,
- private fb: FormBuilder,
- private route: ActivatedRoute,
- private router: Router,
- private _pd: PdTrigerService,
- private dialogRef: MatDialogRef
,
- @Inject(MAT_DIALOG_DATA) public pd_all_details: any)
- {
- // console.log(this.pd_all_details);
+ public estArea: AbstractControl;
+ public uom: AbstractControl;
+
+ /**Constructor of the class */
+ constructor(private el: ElementRef, notifier: NotifierService,
+ private fb: FormBuilder,
+ private route: ActivatedRoute,
+ private router: Router,
+ private _pd: PdTrigerService,
+ private dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
+
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 5;
- //commented
+
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
- // console.log(this.pd_all_details.template_forms.form_id);
- // console.log(this.pd_all_details.pdmaster_details.customer_segment_abbr);
+ console.log('this.pd_all_details',this.pd_all_details);
let CSAbbrSearch = this.pd_all_details.pdmaster_details.customer_segment_abbr.search("-");
- this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0,CSAbbrSearch);
-
+ this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0, CSAbbrSearch);
+
this.notifier = notifier;
this.pdAddress = this.pd_all_details.pdmaster_details.addressline1;
+ this.pdState = this.pd_all_details.pdmaster_details.fk_state;
+ this.getCityAndPincodeDetails(this.pdState);
+ this.pdCity = this.pd_all_details.pdmaster_details.fk_city;
+ this.pdPincode = this.pd_all_details.pdmaster_details.pincode_id;
+ console.log('this.pdPincode', this.pdPincode);
+ this.pdOtherPincode = this.pdPincode == 1 ? this.pd_all_details.pdmaster_details.other_pincode : '';
+ console.log('this.pdOtherPincode', this.pdOtherPincode);
+
}
+ /**Init Fns of the class */
ngOnInit() {
- // console.clear();
- // console.log('this.address',this.pdAddress);
- this.getMasterDetails('PDLOCATIONAPPROACH',1);
- this.getMasterDetails('COMMENTSONLOCALITY',2);
- //this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
- this.getMasterDetails('LOCALITY',4);
- // this.getMasterDetails('ADDRESSTYPE',5);
- this.getMasterDetails('RESIDENCEOWNERSHIP',6);
- this.getMasterDetails('CITY',7);
- this.getM_Address_Type();
+ this.getMasterDetails('PDLOCATIONAPPROACH', 1);
+ this.getMasterDetails('COMMENTSONLOCALITY', 2);
+ this.getMasterDetails('UOM', 3);
+ this.getMasterDetails('LOCALITY', 4);
+ this.getMasterDetails('ADDRESSTYPE', 5);
+ this.getMasterDetails('STATE', 6);
this.initAddressForm();
+
let params: any = {};
params.pd_id = this.pdid;
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['additional_address_units'];
- //const additionalPremisesControl = this.addressForm.controls['additional_premises'];
- if(data.status == 200) {
-
- 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);
- let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type)[0];
- this.selectedAddressType(selectedAddressType.address_type);
+ if (data.status == 200) {
- if(data.records.address_type == 1) {
- this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
- this.addressForm.controls.address_type_others.setValidators([Validators.required]);
- this.addressForm.controls.address_type_others.updateValueAndValidity();
- this.selectedAddressType(data.records.address_type_others);
- }
-
+ this.addressForm.controls.address.setValue(data.records.address);
+ this.addressForm.controls.state.setValue(data.records.state);
- this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
+ if (data.records.state != '') {
+ this.getCityAndPincodeDetails(data.records.state);
+ this.addressForm.controls.city.setValue(data.records.city);
+ this.addressForm.controls.pincode.setValue(data.records.pincode);
+ if (data.records.pincode == 1) {
+ this.addressForm.controls.pincode_others.setValue(data.records.pincode_others);
+ this.addressForm.controls.pincode_others.setValidators([Validators.required]);
+ this.addressForm.controls.pincode_others.updateValueAndValidity();
+ }
+ }
- // if(data.records.comment_locality == 1){
- // this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality);
- // // this.addressForm.controls.other_comment_locality.setValidators([Validators.required]);
- // // this.addressForm.controls.other_comment_locality.updateValueAndValidity();
- // }
- // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
- this.addressForm.controls.locality.setValue(data.records.locality);
+ this.addressForm.controls.pd_location.setValue(data.records.pd_location);
+ this.addressForm.controls.address_type.setValue(data.records.address_type);
- if(data.records.locality == 1 ){
- this.addressForm.controls.locality_others.setValue(data.records.locality_others);
- this.addressForm.controls.locality_others.setValidators([Validators.required]);
- this.addressForm.controls.locality_others.updateValueAndValidity();
- }
- if(data.records.locality == 5){
- this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse);
- this.addressForm.controls.locality_mixuse.setValidators([Validators.required])
- this.addressForm.controls.locality_mixuse.updateValueAndValidity();
- }
- this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
+ let selectedAddressType = this.addressData.filter(element => element.address_type_id == data.records.address_type)[0];
+ this.selectedAddressType(selectedAddressType.address_type);
- // this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity);
- // if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) {
- // this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark);
- // }
- // else{
- // this.addressForm.controls.bussiness_activity_remark.setValue('');
- // }
- // this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
+ if (data.records.address_type == 1) {
+ this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
+ this.addressForm.controls.address_type_others.setValidators([Validators.required]);
+ this.addressForm.controls.address_type_others.updateValueAndValidity();
+ this.selectedAddressType(data.records.address_type_others);
+ }
- // this.addressForm.controls.business_years.setValue(data.records.business_years);
- // this.addressForm.controls.business_month.setValue(data.records.business_month);
+ this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
- // if(data.records.bussiness_activity == 'yes') {
- // // const control = this.addressForm.controls['additional_address_units'];
-
- // var resultOfUnits = Object.keys(data.records.additional_address_units).map(function (key) {
- // return data.records.additional_address_units[key];
- // });
- // //console.log(resultOfUnits);
+ this.addressForm.controls.locality.setValue(data.records.locality);
- // if (resultOfUnits.length == 0) {
- // control.push(this.createUnits());
- // } else {
- // resultOfUnits.forEach((datas,index) => {
- // // this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(datas.premises_rent_amt);
- // if(datas.premises_type == 1){
- // // control.controls[index].premises_type_others.clearValidators();
- // // control.controls[index].premises_type_others.updateValueAndValidity();
- // }
-
- // control.push(this.createUnits());
- // });
- // this.addressForm.controls.additional_address_units.setValue(resultOfUnits);
- // }
-
- // }
+ if (data.records.locality == 1) {
+ this.addressForm.controls.locality_others.setValue(data.records.locality_others);
+ this.addressForm.controls.locality_others.setValidators([Validators.required]);
+ this.addressForm.controls.locality_others.updateValueAndValidity();
+ }
+ if (data.records.locality == 5) {
+ this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse);
+ this.addressForm.controls.locality_mixuse.setValidators([Validators.required])
+ this.addressForm.controls.locality_mixuse.updateValueAndValidity();
+ }
-
- } else {
- //control.push(this.createNeighbour());
- // control.push(this.createUnits());
- }
+ this.addressForm.controls.estimated_area.setValue(data.records.estimated_area);
+ this.addressForm.controls.uom.setValue(data.records.uom);
+ if (data.records.uom == 1) {
+ this.addressForm.controls.uom_others.setValue(data.records.uom_others);
+ this.addressForm.controls.uom_others.setValidators([Validators.required])
+ this.addressForm.controls.uom_others.updateValueAndValidity();
+ }
+ this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
+ }
});
}
- getM_Address_Type() {
- this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe(
- data => {
- this.addressData = data.records.filter(data => data.isactive == 1);
- // console.log(this.addressData);
- // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
-
- // // console.log('whole',FilteredAddressType);
- // let index1 = this.addressData.map(data => data.address_type).indexOf("Residence");
- // this.addressData.splice(index1, 1);
- // // console.log('FirstOne',FilteredAddressType);
- // let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office");
- // this.addressData.splice(index2, 1);
- // // console.log('SecondOne',FilteredAddressType);
- // }
- // console.log(this.addressData);
- })
- }
+ // getM_Address_Type() {
+ // this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe(
+ // data => {
+ // this.addressData = data.records.filter(data => data.isactive == 1);
+ // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
+ // let index1 = this.addressData.map(data => data.address_type).indexOf("Residence");
+ // this.addressData.splice(index1, 1);
+ // let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office");
+ // this.addressData.splice(index2, 1);
+ // }
+ // })
+ // }
+
+ /** Address Form ELements */
public initAddressForm(): void {
this.addressForm = this.fb.group({
- address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])],
+ address: [this.pdAddress != '' ? this.pdAddress : '', Validators.compose([Validators.required])],
address_type: ['', Validators.compose([Validators.required])],
address_type_others: [''],
+ state: [this.pdState != '' ? this.pdState : ''],
+ city: [this.pdCity != '' ? this.pdCity : ''],
+ pincode: [this.pdPincode != '' ? this.pdPincode : ''],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
+ pincode_others: [this.pdOtherPincode != '' ? this.pdOtherPincode : '', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: ['', Validators.compose([Validators.required])],
locality_others: [''],
- locality_mixuse:[''],
+ locality_mixuse: [''],
pd_location: ['', Validators.compose([Validators.required])],
comment_locality: ['', Validators.compose([Validators.required])],
- // other_comment_locality : [''],
- //customer_behaviour: ['', Validators.compose([Validators.required])],
- //neighbourhood: this.fb.array([]),
- // additional_address_units: this.fb.array([]),
- address_form_remark:[''],
- // address_ownership:[''],
- // other_ownership:[''],
- // rent_amt:[''],
- // other_premises_bussiness_activity : [''],
- // bussiness_activity_remark:[''],
- // bussiness_activity:[''],
- // business_years:[''],
- // business_month:[''],
- // bussiness_address_type:[''],
- // bussiness_address_type_others: [''],
+ estimated_area: [''],
+ uom: [''],
+ uom_others: [''],
+ address_form_remark: ['']
//additional_premises: this.fb.array([])
});
this.address = this.addressForm.controls['address'];
+ this.state = this.addressForm.controls['state'];
+ this.city = this.addressForm.controls['city'];
+ this.pincode = this.addressForm.controls['pincode'];
this.addressType = this.addressForm.controls['address_type'];
this.locality = this.addressForm.controls['locality'];
this.pdLocation = this.addressForm.controls['pd_location'];
this.commentLocality = this.addressForm.controls['comment_locality'];
- // this.otherCommentLocality = this.addressForm.controls['other_comment_locality'];
- //this.customerBehaviour = this.addressForm.controls['customer_behaviour'];
- // this.ownership = this.addressForm.controls['address_ownership'];
- // this.other_ownership = this.addressForm.controls['other_ownership'];
- // this.rent_amt = this.addressForm.controls['rent_amt'];
- // this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'],
- // this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'],
- // this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
- // this.business_years = this.addressForm.controls['business_years'];
- // this.business_month = this.addressForm.controls['business_month'];
- // this.bussiessAddressType = this.addressForm.controls['bussiness_address_type'];
+ this.estArea = this.addressForm.controls['estimated_area'];
+ this.uom = this.addressForm.controls['uom'];
}
- // 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])],
- // });
- // }
- // createUnits(): FormGroup {
- // return this.fb.group({
- // no_of_additional_units: [''],
- // premises_type: [''],
- // premises_type_others: [''],
- // premises_city: [''],
- // // premises_ownership: [''],
- // // premises_ownership_others: [''],
- // // premises_rent_amt:[''],
- // premises_remarks: [''],
- // });
- // }
-// createPremises(): FormGroup {
-// return this.fb.group({
-// no_of_additional_units: [''],
-// premises_city: [''],
-// premises_remarks: [''],
-// premises_ownership: [''],
-// premises_ownership_others: [''],
-// premises_rent_amt:[''],
-// });
-// }
- getMasterDetails(table:string,type:number){
+
+
+ /** To Get Dropdown Data For Address Form */
+ getMasterDetails(table: string, type: number) {
this._pd.getAllMasterDatas(table).subscribe(data => {
data.records.forEach(val => {
- if (type==1 && val.isactive == 1) {
+ if (type == 1 && val.isactive == 1) {
this.locationdata.push(val);
}
- else if(type==2 && val.isactive == 1){
+ else if (type == 2 && val.isactive == 1) {
this.commentData.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){
+ else if (type == 3 && val.isactive == 1) {
+ this.uomData.push(val);
+ }
+ else if (type == 4 && val.isactive == 1) {
this.localityData.push(val);
}
- // else if(type==5 && val.isactive == 1){
- // this.addressData.push(val);
- // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
- // // console.log(this.CustSegAbbr);
- // // console.log('inside if',this.addressData);
- // this.addressData.indexOf("Residence")
- // this.addressData.indexOf("Residence cum Office")
- // // console.log('inside if 2',this.addressData);
- // }
- // }
- // else if(type==6 && val.isactive == 1){
- // this.ownerShipData.push(val);
- // }
- // else if(type==7 && val.isactive == 1){
- // this.cityData.push(val);
- // }
+ else if (type == 5 && val.isactive == 1) {
+ this.addressData.push(val);
+ }
+ else if (type == 6 && val.isactive == 1) {
+ this.stateData.push(val);
+ }
})
});
}
- public viewerOptions: any = {
- navbar: false,
- toolbar: {
- zoomIn: 4,
- zoomOut: 4,
- oneToOne: 4,
- reset: 4,
- prev: 4,
- play: {
- show: 4,
- size: 'large',
- },
- next: 4,
- rotateLeft: 4,
- rotateRight: 4,
- flipHorizontal: 4,
- flipVertical: 4,
- }
-};
- /*221118 review doc s.no 3.f
- addNeighbour() {
- const control = this.addressForm.controls['neighbourhood'];
- if (control.length <= 1) {
- control.push(this.createNeighbour());
- }
+
+ /** To Get City And Pincode Data For Address Form
+ * Param 'stateID' -> selected StateId
+ */
+ getCityAndPincodeDetails(stateID: string) {
+ this._pd.getStateWiseCities(stateID).subscribe(data => {
+ if (data.status == 200) {
+ this.cityData = data.records.cities;
+ this.pincodeData = data.records.pincode;
+ }
+ });
}
- removeNeighbour(index) {
- const control = this.addressForm.controls['neighbourhood'];
- control.removeAt(index);
- }*/
-
- // setRequiredValidation(value,item) {
- // console.log(item);
- // console.log(value);
- // value==1
- // ? item.controls.premises_type_others.setValidators([Validators.required])
- // : item.controls.premises_type_others.clearValidators();
- // item.controls.premises_type_others.updateValueAndValidity();
- // }
-
- // addUnits() {
- // const control = this.addressForm.controls['additional_address_units'];
- // control.push(this.createUnits());
- // }
-
- // removeUnits(index) {
- // const control = this.addressForm.controls['additional_address_units'];
- // control.removeAt(index);
- // }
+ /** TO Save Address Forms Details*/
onSubmit() {
- // Partnr.controls[key].addControl('partner_other_name', new FormControl('', Validators.required))
-
- this.addressForm.controls.address_type.value == 1
+
+ this.addressForm.controls.address_type.value == 1
? this.addressForm.controls['address_type_others'].setValidators([Validators.required])
: this.addressForm.controls['address_type_others'].clearValidators();
- this.addressForm.controls['address_type_others'].updateValueAndValidity();
-
- this.addressForm.controls.locality.value == 1
+ this.addressForm.controls['address_type_others'].updateValueAndValidity();
+
+ this.addressForm.controls.locality.value == 1
? this.addressForm.controls['locality_others'].setValidators([Validators.required])
: this.addressForm.controls['locality_others'].clearValidators();
- this.addressForm.controls['locality_others'].updateValueAndValidity();
+ this.addressForm.controls['locality_others'].updateValueAndValidity();
- this.addressForm.controls.locality.value == 5
+ this.addressForm.controls.pincode.value == 1
+ ? this.addressForm.controls['pincode_others'].setValidators([Validators.required])
+ : this.addressForm.controls['pincode_others'].clearValidators();
+ this.addressForm.controls['pincode_others'].updateValueAndValidity();
+
+ this.addressForm.controls.locality.value == 5
? this.addressForm.controls['locality_mixuse'].setValidators([Validators.required])
: this.addressForm.controls['locality_mixuse'].clearValidators();
- this.addressForm.controls['locality_mixuse'].updateValueAndValidity();
-
-
+ this.addressForm.controls['locality_mixuse'].updateValueAndValidity();
+
+ this.addressForm.controls.uom.value == 1
+ ? this.addressForm.controls['uom_others'].setValidators([Validators.required])
+ : this.addressForm.controls['uom_others'].clearValidators();
+ this.addressForm.controls['uom_others'].updateValueAndValidity();
+
if (!this.addressForm.valid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
- // console.log(this.addressForm.controls.bussiness_activity_remark.value);
- // console.log(this.address.value.bussiness_activity_remark);
+
// if(this.address.value.bussiness_activity_remark == ''){
// this.notifier.notify('warning', 'Fill Remark!');
// return;
@@ -430,102 +301,104 @@ export class AddressComponent implements OnInit {
let records: any = {};
records.address = this.address.value;
+ records.state = this.state.value;
+ records.city = this.city.value;
records.address_type = this.addressType.value;
- if (this.addressType.value == 1) {
- records.address_type_others = this.addressForm.controls.address_type_others.value;
- }
+
+ records.address_type_others = this.addressType.value == 1 ?
+ this.addressForm.controls.address_type_others.value : '';
+
records.locality = this.locality.value;
- if (this.locality.value == 1) {
- records.locality_others = this.addressForm.controls.locality_others.value;
- }
- if(this.locality.value == 5){
- records.locality_mixuse = this.addressForm.controls.locality_mixuse.value;
- }
+ records.locality_others = this.locality.value == 1 ?
+ this.addressForm.controls.locality_others.value : '';
+
+ records.locality_mixuse = this.locality.value == 5 ?
+ this.addressForm.controls.locality_mixuse.value : '';
+
+ records.pincode = this.pincode.value;
+ records.pincode_others = this.pincode.value == 1 ?
+ this.addressForm.controls.pincode_others.value : '';
+
records.pd_location = this.pdLocation.value;
records.comment_locality = this.commentLocality.value;
- // records.other_comment_locality = this.otherCommentLocality.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.other_ownership = this.other_ownership.value;
- // records.rent_amt = this.rent_amt.value;
- // records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value;
- // records.bussiness_activity_remark = this.bussiness_activity_remark.value;
- // records.bussiness_activity = this.bussinessActivity.value;
- // records.business_years = this.business_years.value;
- // records.business_month = this.business_month.value;
- // if (this.bussinessActivity.value == 'yes') {
- // records.additional_address_units = this.addressForm.controls.additional_address_units.value;
- // }
+ records.address_form_remark = this.addressForm.controls.address_form_remark.value;
+ records.estimated_area = this.estArea.value;
+
+ records.uom = this.uom.value;
+ records.uom_others = records.uom == 1 ?
+ this.addressForm.controls.uom_others.value : '';
records.pdid = this.pdid;
records.formid = '5';
// records.fk_createdby = '250';
-
+
// console.log(JSON.stringify(records));
this._pd.saveForm(records).subscribe(data => {
- if(data.status == 200) {
+ if (data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
- setTimeout(() =>{
+ setTimeout(() => {
this.dialogRef.close();
- },3000);
+ }, 3000);
}
else {
- this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
- this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
- selectedAddressType(e: any){
- this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?';
+ /** For PlaceHolder
+ * selected AddressType is concate with label */
+ selectedAddressType(e: any) {
+ console.log(e);
+ this.placeholderName = 'Estimated area of the ' + e;
}
+ /** To validate All Form Fields */
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
- control.markAsTouched({onlySelf: true});
+ control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
});
}
-
-
- // ConvertMonthintoYear(e){
-
- // let business_year = this.addressForm.controls.business_years.value;
+ /** On Key Press Event For Numbers */
+ keyPress(event: any) {
+ const pattern = /[0-9]/;
- // let converted_month : number = e%12;
- // let converted_year : number = e/12;
+ let inputChar = String.fromCharCode(event.charCode);
+ if (event.keyCode != 8 && !pattern.test(inputChar)) {
+ event.preventDefault();
+ }
+ }
- // this.addressForm.controls.business_years.setValue(+business_year + +Math.floor(converted_year));
- // this.addressForm.controls.business_month.setValue(Math.floor(converted_month));
-
- // }
- /** On Key Press Event For Numbers */
- // keyPress(event: any) {
- // const pattern = /[0-9]/;
-
- // let inputChar = String.fromCharCode(event.charCode);
- // if (event.keyCode != 8 && !pattern.test(inputChar)) {
- // event.preventDefault();
- // }
- // }
+ /** For DOCS Tab */
+ public viewerOptions: any = {
+ navbar: false,
+ toolbar: {
+ zoomIn: 4,
+ zoomOut: 4,
+ oneToOne: 4,
+ reset: 4,
+ prev: 4,
+ play: {
+ show: 4,
+ size: 'large',
+ },
+ next: 4,
+ rotateLeft: 4,
+ rotateRight: 4,
+ flipHorizontal: 4,
+ flipVertical: 4,
+ }
+ };
- // inWords(e,i){
- // this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
- // }
-
- // inWordsForRent(e){
- // this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value);
- // }
}
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
index 69448f507..c57f7e4a6 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
@@ -29,6 +29,7 @@
+ Select
{{ asset.name }}
@@ -42,6 +43,7 @@
+ Select
{{ prop.name }}
@@ -59,6 +61,7 @@
+ Select
{{ vehicle.vehicle_type_name }}
@@ -135,6 +138,7 @@
+ Select
{{ freqn.name }}
@@ -167,6 +171,7 @@
+ Select
{{ ins_type.name }}
@@ -209,19 +214,19 @@
-
+
+
-
-
+
-->
+
@@ -296,6 +301,7 @@