address form master details changes

This commit is contained in:
gandhimathi 2018-11-14 18:42:40 +05:30
parent beb7d389ff
commit bd92cb8f43
3 changed files with 38 additions and 49 deletions

View File

@ -9,27 +9,18 @@
<mat-form-field>
<mat-select placeholder="Address Type" formControlName="address_type">
<mat-option value="Office">Office</mat-option>
<mat-option value="Clinic">Clinic</mat-option>
<mat-option value="Factory">Factory</mat-option>
<mat-option value="Warehouse">Warehouse</mat-option>
<mat-option value="Shop">Shop</mat-option>
<mat-option value="ResidencecumOffice">Residence cum Office</mat-option>
<mat-option value="Residence">Residence</mat-option>
<mat-option value="Other">Other (PD officer to fill)</mat-option>
<mat-option value="{{m_addressType.address_type_id}}"
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Locality" formControlName="locality">
<mat-option value="CommercialOffice">Commercial (Office type) Area
</mat-option>
<mat-option value="CommercialShop">Commercial (shop type) Area</mat-option>
<mat-option value="Industrial">Industrial Area</mat-option>
<mat-option value="Residential">Residential Area</mat-option>
<mat-option value="Mix">Mix use (Comment mandatory)</mat-option>
<mat-option value="Rural">Rural (Village) area</mat-option>
<mat-option value="Others">Others (Please specify)</mat-option>
<mat-option value="{{m_locality.locality_id}}"
*ngFor="let m_locality of localityData">{{m_locality.locality_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'">
@ -74,6 +65,9 @@
formControlName="do_you_know">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="{{m_neighbourStatus}}"
*ngFor="let m_neighbourStatus of neighbourStatusData">{{m_neighbourStatus}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -83,9 +77,10 @@
<mat-form-field>
<mat-select placeholder="Is the applicant owner"
formControlName="is_owner">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="dont_know">Dont Know</mat-option>
<mat-option value="{{m_applicantOwner}}"
*ngFor="let m_applicantOwner of applicantOwnerData">{{m_applicantOwner}}
</mat-option>
</mat-select>
</mat-form-field>
<button type="button" matTooltip="Add More Neighbour Details" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i==0"

View File

@ -34,6 +34,11 @@ export class AddressComponent implements OnInit {
locationdata: any = [];
commentData: any = [];
customerData: any = [];
addressData:any = [];
localityData:any = [];
neighbourStatusData:any=["Yes","No"];
applicantOwnerData:any=["Yes","No","Dont Know"];
public currentLoanForm: FormGroup;
private notifier: NotifierService;
public addressForm: FormGroup;
@ -53,9 +58,11 @@ export class AddressComponent implements OnInit {
}
ngOnInit() {
this.getLocation();
this.getComment();
this.getCustomer();
this.getMasterDetails('PDLOCATIONAPPROACH',1);
this.getMasterDetails('COMMENTSONLOCALITY',2);
this.getMasterDetails('CUSTOMERBEHAVIOUR',3);
this.getMasterDetails('LOCALITY',4);
this.getMasterDetails('ADDRESSTYPE',5);
this.initAddressForm();
let params: any = {};
params.pd_id = this.pdid;
@ -85,7 +92,6 @@ export class AddressComponent implements OnInit {
});
this.addressForm.controls.neighbourhood.setValue(result);
}
console.log('result', result);
} else {
control.push(this.createNeighbour());
}
@ -118,36 +124,24 @@ export class AddressComponent implements OnInit {
is_owner: ['', Validators.compose([Validators.required])],
});
}
getLocation() {
let master_name = 'PDLOCATIONAPPROACH';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
getMasterDetails(table:string,type:number){
this._pd.getAllMasterDatas(table).subscribe(data => {
data.records.forEach(val => {
if (val.isactive == 1) {
if (type==1 && val.isactive == 1) {
this.locationdata.push(val);
}
})
});
}
getComment() {
let master_name = 'COMMENTSONLOCALITY';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
data.records.forEach(val => {
if (val.isactive == 1) {
else if(type==2 && val.isactive == 1){
this.commentData.push(val);
}
})
});
}
getCustomer() {
let master_name = 'CUSTOMERBEHAVIOUR';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
data.records.forEach(val => {
if (val.isactive == 1) {
else if(type==3 && val.isactive == 1){
this.customerData.push(val);
}
else if(type==4 && val.isactive == 1){
this.localityData.push(val);
}
else if(type==5 && val.isactive == 1){
this.addressData.push(val);
}
})
});
}

View File

@ -205,13 +205,13 @@ this.loadDataStatus = true;
data => {
if (data.status == 200) {
if(type==1){
this.relationShipList=data.records;
this.relationShipList=data.records.filter(item => item.isactive == 1);
}
else if(type==2){
this.earningStatus=data.records;
this.earningStatus=data.records.filter(item => item.isactive == 1);
}
else if(type==3){
this.qualifications=data.records;
this.qualifications=data.records.filter(item => item.isactive == 1);
}