diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index bafec348b..d155b014f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -144,7 +144,7 @@ Select - {{SL.state_name}} + {{SL.name}} @@ -168,9 +168,13 @@ - + - Enter Valid Pincode. + + + Select + {{PL.pincode}} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 28da9fe0a..2fc1437ff 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -34,6 +34,7 @@ export class AddPdComponent implements OnInit, OnDestroy { pdTypeList:any; billingList: any; relationShipList: any; + pincodeList: any = []; errorMessage: any; loanAmtInWords : any; titleList: any; @@ -93,7 +94,7 @@ export class AddPdComponent implements OnInit, OnDestroy {   addressline1: [null], fk_city: [null], fk_state: [null], -  pincode : [null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])], +  pincode : [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ remarks:[null],   // allocation_type: [null],   // sub_allocation_type: [null], @@ -136,14 +137,22 @@ export class AddPdComponent implements OnInit, OnDestroy { } }, error => this.errorMessage = error); } + // getStateCityList(){ + // this._pd.getStateCityDetails().subscribe( + // data => { + // if (data.status == 200) { + // this.stateList=data.records + // } + // }, error => this.errorMessage = error); + // } getStateCityList(){ - this._pd.getStateCityDetails().subscribe( - data => { + this._pd.getAllMasterDatas('STATE').subscribe( + data => { if (data.status == 200) { - this.stateList=data.records + this.stateList = data.records.filter(item => item.isactive == 1); } - }, error => this.errorMessage = error); - } + }); + } getPDTypeList(){ this._pd.getPDTypeDetails().subscribe( data => { @@ -160,10 +169,25 @@ export class AddPdComponent implements OnInit, OnDestroy { this.subProductList=this.subProductList[0].subproducts; } - //get city list details based on state id + // get city list details based on state id + // getCityList(stateID:string){ + // console.log(this.cityList); + // this.cityList= this.stateList.filter(item => item.state_id == stateID); + // console.log(this.cityList); + // this.cityList=this.cityList[0].cities; + // console.log(this.cityList); + // } + + //get city list details based on state id getCityList(stateID:string){ - this.cityList= this.stateList.filter(item => item.state_id == stateID); - this.cityList=this.cityList[0].cities; + console.log('getCityList',stateID); + this._pd.getStateWiseCities(stateID).subscribe(data=>{ + if (data.status == 200) { + console.log(data); + this.cityList = data.records.cities; + this.pincodeList = data.records.pincode; + } + }); } // get relation master details diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 1a890ce6e..dffba6653 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -131,8 +131,12 @@ - - Enter Valid Pincode. + + + Select + {{PL.pincode}} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index d0efd9207..1ef203c37 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -21,6 +21,7 @@ export class EditPdMasterComponent implements OnInit { cityList:any; pdTypeList:any; billingList:any; + pincodeList: any = []; applicantLength:number; // draftStatus: string; // PDTriggerStatus: string; @@ -89,18 +90,27 @@ export class EditPdMasterComponent implements OnInit { } }, error => this.errorMessage = error); } - getStateCityList(){ - this._pd.getStateCityDetails().subscribe( - data => { - if (data.status == 200) { - this.stateList=data.records - if(this.data.records.fk_state){ - this.getCityList(this.data.records.fk_state); - } + // getStateCityList(){ + // this._pd.getStateCityDetails().subscribe( + // data => { + // if (data.status == 200) { + // this.stateList=data.records + // if(this.data.records.fk_state){ + // this.getCityList(this.data.records.fk_state); + // } - } - }, error => this.errorMessage = error); - } + // } + // }, error => this.errorMessage = error); + // } + getStateCityList(){ + this._pd.getAllMasterDatas('STATE').subscribe( + data => { + if (data.status == 200) { + this.stateList = data.records.filter(item => item.isactive == 1); + } + }); + } + getPDTypeList(){ this._pd.getPDTypeDetails().subscribe( data => { @@ -126,6 +136,9 @@ export class EditPdMasterComponent implements OnInit { landline = null; } } + + this.getCityList(this.data.records.fk_state); + this._EditPDtriggerForm = this._fb.group({ pd_id: [this.data.records.pd_id], fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])], @@ -142,7 +155,7 @@ export class EditPdMasterComponent implements OnInit {   addressline1: [this.data.records.addressline1], fk_city: [this.data.records.fk_city], fk_state: [this.data.records.fk_state], -   pincode : [this.data.records.pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], +   pincode : [this.data.records.pincode],/** Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], */ remarks: [this.data.records.remarks], }); } @@ -156,11 +169,23 @@ export class EditPdMasterComponent implements OnInit { this.subProductList=this.subProductList[0].subproducts; } + // //get city list details based on state id + // getCityList(stateID:string){ + // this.cityList= this.stateList.filter(item => item.state_id == stateID); + // this.cityList=this.cityList[0].cities; + // } //get city list details based on state id getCityList(stateID:string){ - this.cityList= this.stateList.filter(item => item.state_id == stateID); - this.cityList=this.cityList[0].cities; - } + console.log('getCityList',stateID); + this._pd.getStateWiseCities(stateID).subscribe(data=>{ + if (data.status == 200) { + console.log(data); + this.cityList = data.records.cities; + this.pincodeList = data.records.pincode; + } + }); + } + // save pd in draft saveDraftPD(formValue: any, status:string){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 231a187ea..3399c0763 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -281,17 +281,18 @@
- + +
Residence Details
- + {{s.name}} @@ -299,7 +300,7 @@ - + {{c.city_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index b1a4a71f8..def128aab 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -511,8 +511,9 @@ export class FamilyDetailsComponent implements OnInit { const control = this.familyForm.controls['family_details']; control.push(formData); } else { - for (let val of records) { - this.getCity(val.residence_state); + records.forEach((val,index) => { + //for (let val of records) + this.getCity(val.residence_state,index); let formData: FormGroup = this.fb.group({ selected_person: [val.selected_person, Validators.compose([Validators.required])], residence_place: [val.residence_place, Validators.compose([])], @@ -528,11 +529,10 @@ export class FamilyDetailsComponent implements OnInit { }); const control = this.familyForm.controls['family_details']; control.push(formData); - // this.getCity(val.residence_state); let inx = control.length - 1; this.addFamilyMemberDetailsWithData(inx, val.family_members_details); console.log(control); - } + }); } this.noRecordsFound = true; @@ -641,14 +641,14 @@ export class FamilyDetailsComponent implements OnInit { }); } - getCity(e){ + getCity(e,i){ console.log(e); // this.cityData = this.wholeCityData.filter(city=>city.fk_state_id == e); // this._pd.retriveForm(params).subscribe(data => { this._pd.getStateWiseCities(e).subscribe(data=>{ if (data.status == 200) { console.log(data.status); - this.cityData = data.records.cities; + this.cityData[i] = data.records.cities; console.log(this.cityData); } }); diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index b04c3a100..1e32065f9 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -477,7 +477,10 @@ export class PdTrigerService { ) } - /** To get StateWise City Data For Family Form */ + /** To get StateWise City List For + * 1) Family Form + * 2) add PD + */ getStateWiseCities(stateid:any): Observable { return this._http.post(this.apiUrl + "getListOfStatesAndCities", { "records":{ "state_id" : stateid}}) .pipe(