changes : ps
This commit is contained in:
parent
9a140e061c
commit
26be95f769
@ -298,9 +298,9 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select matInput placeholder="City" formControlName="residence_city" required (selectionChange)="getPinCode($event)" >
|
||||
<mat-option *ngFor="let c of cityData" [value]="c" >
|
||||
{{c.name}}
|
||||
<mat-select matInput placeholder="City" formControlName="residence_city" required>
|
||||
<mat-option *ngFor="let c of cityData" [value]="c.city_id" >
|
||||
{{c.city_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -376,8 +376,8 @@
|
||||
<div *ngIf="item.get('family_member_earning_status').value == 1">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Segment" formControlName="earning_segment" required>
|
||||
<mat-option value="{{segment.customer_segment_id}}" *ngFor="let segment of customerSegData">
|
||||
{{segment.name}}
|
||||
<mat-option value="{{earn.earning_member_status_id}}" *ngFor="let earn of earningData">
|
||||
{{earn.earning_member_status}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -323,9 +323,10 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
occupationData: any = [];
|
||||
//personMetData: any = [];
|
||||
ownerShipData: any = [];
|
||||
customerSegData: any = [];
|
||||
// customerSegData: any = [];
|
||||
earningData:any =[];
|
||||
stateData: any = [];
|
||||
wholeCityData:any =[];
|
||||
// wholeCityData:any =[];
|
||||
cityData: any =[];
|
||||
PincodeData:any=[];
|
||||
// earnMemberArrCount :any ;
|
||||
@ -347,10 +348,11 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
this.getMasterDetails('OCCUPATIONMEMBERS', 2);
|
||||
//this.getMasterDetails('PERSONSMET',3);
|
||||
this.getMasterDetails('RESIDENCEOWNERSHIP', 4);
|
||||
this.getMasterDetails('CUSTOMERSEGMENT', 5);
|
||||
// this.getMasterDetails('CUSTOMERSEGMENT', 5);
|
||||
this.getMasterDetails('EARNINGMEMBERSSTATUS', 5);
|
||||
this.getMasterDetails('STATE', 6);
|
||||
this.getMasterDetails('CITY', 7);
|
||||
this.getMasterDetails('PINCODE', 8);
|
||||
// this.getMasterDetails('CITY', 7);
|
||||
// this.getMasterDetails('PINCODE', 8);
|
||||
this.initFamilyFormDetails();
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
@ -510,6 +512,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
control.push(formData);
|
||||
} else {
|
||||
for (let val of records) {
|
||||
this.getCity(val.residence_state);
|
||||
let formData: FormGroup = this.fb.group({
|
||||
selected_person: [val.selected_person, Validators.compose([Validators.required])],
|
||||
residence_place: [val.residence_place, Validators.compose([])],
|
||||
@ -525,6 +528,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
});
|
||||
const control = <FormArray>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);
|
||||
@ -624,26 +628,30 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
this.ownerShipData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
else if (type == 5) {
|
||||
this.customerSegData = data.records.filter(item => item.isactive == 1);
|
||||
this.earningData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
else if (type == 6) {
|
||||
this.stateData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
else if(type == 7){
|
||||
this.wholeCityData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
// else if(type == 7){
|
||||
// this.wholeCityData = data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getCity(e){
|
||||
// console.log(e);
|
||||
this.cityData = this.wholeCityData.filter(city=>city.fk_state_id == e);
|
||||
}
|
||||
|
||||
getPinCode(e){
|
||||
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;
|
||||
console.log(this.cityData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
submitFamily() {
|
||||
|
||||
@ -141,17 +141,22 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
if (result_val.length > 0) {
|
||||
result_val.forEach((val,index) => {
|
||||
// console.log(val);
|
||||
// console.log('val.estimate_sales_average',val.estimate_sales_average);
|
||||
console.log(val);
|
||||
console.log('val.estimate_sales_average',val.estimate_sales_average);
|
||||
if(isNaN(val.estimate_sales_average)){
|
||||
alert(val.estimate_sales_average + " is not a number <br/>");
|
||||
}else{
|
||||
alert(val.estimate_sales_average + " is a number <br/>");
|
||||
}
|
||||
//console.log('dedrf',val.estimate_annual_sale);
|
||||
// this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.estimate_annual_sale);
|
||||
// this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.estimate_net_profit);
|
||||
// this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.estimate_net_loss);
|
||||
this.AV_SalesInwords = this._pd.convertNumberToWords(val.estimate_sales_average);
|
||||
this.AV_marginProfitAmtInwords = this._pd.convertNumberToWords(val.estimate_profit_margin);
|
||||
this.AV_netProfitAmtInwords = this._pd.convertNumberToWords(val.estimate_net_profit);
|
||||
this.AV_marginLossAmtInwords = this._pd.convertNumberToWords(val.estimate_loss_margin);
|
||||
this.AV_netLossAmtInwords = this._pd.convertNumberToWords(val.estimate_net_loss);
|
||||
this.AV_SalesInwords = this._pd.convertNumberToWords(+val.estimate_sales_average);
|
||||
this.AV_marginProfitAmtInwords = this._pd.convertNumberToWords(+val.estimate_profit_margin);
|
||||
this.AV_netProfitAmtInwords = this._pd.convertNumberToWords(+val.estimate_net_profit);
|
||||
this.AV_marginLossAmtInwords = this._pd.convertNumberToWords(+val.estimate_loss_margin);
|
||||
this.AV_netLossAmtInwords = this._pd.convertNumberToWords(+val.estimate_net_loss);
|
||||
estimated_val.push(this.createValue(''));
|
||||
});
|
||||
retriveData.estimated_value = result_val;
|
||||
|
||||
@ -477,6 +477,14 @@ export class PdTrigerService {
|
||||
)
|
||||
}
|
||||
|
||||
/** To get StateWise City Data For Family Form */
|
||||
getStateWiseCities(stateid:any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getListOfStatesAndCities", { "records":{ "state_id" : stateid}})
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
getEndUseForLoan(pdid: any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getEndUseOfLoan",{ "records":{ "pd_id" : pdid}})
|
||||
.pipe(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user