changes: ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-25 20:23:01 +05:30
parent 22896ca1c7
commit 8c0f13c977
3 changed files with 127 additions and 315 deletions

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@
<div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Address Type" formControlName="address_type" required (selectionChange)="selectedAddressType($event.source.triggerValue)">
<mat-select placeholder="Address Type" formControlName="address_type" required (selectionChange)="selectedAddressType($event.source.triggerValue)" >
<mat-option value="{{m_addressType.address_type_id}}"
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
</mat-option>

View File

@ -111,10 +111,12 @@ export class AddressComponent implements OnInit {
this.getMasterDetails('COMMENTSONLOCALITY',2);
//this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
this.getMasterDetails('LOCALITY',4);
this.getMasterDetails('ADDRESSTYPE',5);
// this.getMasterDetails('ADDRESSTYPE',5);
this.getMasterDetails('RESIDENCEOWNERSHIP',6);
this.getMasterDetails('CITY',7);
this.getM_Address_Type();
this.initAddressForm();
let params: any = {};
params.pd_id = this.pdid;
@ -198,6 +200,24 @@ export class AddressComponent implements OnInit {
});
}
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);
})
}
public initAddressForm(): void {
this.addressForm = this.fb.group({
address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])],
@ -287,16 +307,16 @@ export class AddressComponent implements OnInit {
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==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);
}