This commit is contained in:
saravanakumarkandasami 2018-11-14 18:47:21 +05:30
commit 0f97901526
5 changed files with 125 additions and 122 deletions

View File

@ -9,27 +9,18 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Address Type" formControlName="address_type"> <mat-select placeholder="Address Type" formControlName="address_type">
<mat-option value="Office">Office</mat-option> <mat-option value="{{m_addressType.address_type_id}}"
<mat-option value="Clinic">Clinic</mat-option> *ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
<mat-option value="Factory">Factory</mat-option> </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-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Locality" formControlName="locality"> <mat-select placeholder="Locality" formControlName="locality">
<mat-option value="CommercialOffice">Commercial (Office type) Area <mat-option value="{{m_locality.locality_id}}"
</mat-option> *ngFor="let m_locality of localityData">{{m_locality.locality_name}}
<mat-option value="CommercialShop">Commercial (shop type) Area</mat-option> </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-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'"> <mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'">
@ -72,8 +63,9 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Do you know" <mat-select placeholder="Do you know"
formControlName="do_you_know"> formControlName="do_you_know">
<mat-option value="yes">Yes</mat-option> <mat-option value="{{m_neighbourStatus}}"
<mat-option value="no">No</mat-option> *ngFor="let m_neighbourStatus of neighbourStatusData">{{m_neighbourStatus}}
</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
@ -83,9 +75,10 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Is the applicant owner" <mat-select placeholder="Is the applicant owner"
formControlName="is_owner"> formControlName="is_owner">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="{{m_applicantOwner}}"
<mat-option value="dont_know">Dont Know</mat-option> *ngFor="let m_applicantOwner of applicantOwnerData">{{m_applicantOwner}}
</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<button type="button" matTooltip="Add More Neighbour Details" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i==0" <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 = []; locationdata: any = [];
commentData: any = []; commentData: any = [];
customerData: any = []; customerData: any = [];
addressData:any = [];
localityData:any = [];
neighbourStatusData:any=["Yes","No"];
applicantOwnerData:any=["Yes","No","Dont Know"];
public currentLoanForm: FormGroup; public currentLoanForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
public addressForm: FormGroup; public addressForm: FormGroup;
@ -53,9 +58,11 @@ export class AddressComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.getLocation(); this.getMasterDetails('PDLOCATIONAPPROACH',1);
this.getComment(); this.getMasterDetails('COMMENTSONLOCALITY',2);
this.getCustomer(); this.getMasterDetails('CUSTOMERBEHAVIOUR',3);
this.getMasterDetails('LOCALITY',4);
this.getMasterDetails('ADDRESSTYPE',5);
this.initAddressForm(); this.initAddressForm();
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -85,7 +92,6 @@ export class AddressComponent implements OnInit {
}); });
this.addressForm.controls.neighbourhood.setValue(result); this.addressForm.controls.neighbourhood.setValue(result);
} }
console.log('result', result);
} else { } else {
control.push(this.createNeighbour()); control.push(this.createNeighbour());
} }
@ -118,36 +124,24 @@ export class AddressComponent implements OnInit {
is_owner: ['', Validators.compose([Validators.required])], is_owner: ['', Validators.compose([Validators.required])],
}); });
} }
getLocation() { getMasterDetails(table:string,type:number){
let master_name = 'PDLOCATIONAPPROACH'; this._pd.getAllMasterDatas(table).subscribe(data => {
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
data.records.forEach(val => { data.records.forEach(val => {
if (val.isactive == 1) { if (type==1 && val.isactive == 1) {
this.locationdata.push(val); this.locationdata.push(val);
} }
}) else if(type==2 && val.isactive == 1){
});
}
getComment() {
let master_name = 'COMMENTSONLOCALITY';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
data.records.forEach(val => {
if (val.isactive == 1) {
this.commentData.push(val); this.commentData.push(val);
} }
}) else if(type==3 && val.isactive == 1){
});
}
getCustomer() {
let master_name = 'CUSTOMERBEHAVIOUR';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data);
data.records.forEach(val => {
if (val.isactive == 1) {
this.customerData.push(val); 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

@ -30,16 +30,16 @@
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="Educational Qualification" formControlName="qualification_ans" required> <mat-select placeholder="Educational Qualification" formControlName="qualification_ans" required>
<mat-option *ngFor="let education of qualifications" [value]="education" > <mat-option *ngFor="let education of qualifications" [value]="education.qualification_id" >
{{education}} {{education.qualification_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="Earning Status" formControlName="earning_ans" required> <mat-select placeholder="Earning Status" formControlName="earning_ans" required>
<mat-option *ngFor="let earning of earningStatus" [value]="earning" > <mat-option *ngFor="let earning of earningStatus" [value]="earning.earning_member_status_id" >
{{earning}} {{earning.earning_member_status}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -83,8 +83,8 @@
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> --> <!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
<mat-select placeholder="Educational Qualification" formControlName="qualification_ans" required> <mat-select placeholder="Educational Qualification" formControlName="qualification_ans" required>
<mat-option *ngFor="let education of qualifications" [value]="education" > <mat-option *ngFor="let education of qualifications" [value]="education.qualification_id" >
{{education}} {{education.qualification_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -92,8 +92,8 @@
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> --> <!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
<mat-select placeholder="Earning Status" formControlName="earning_ans" required> <mat-select placeholder="Earning Status" formControlName="earning_ans" required>
<mat-option *ngFor="let earning of earningStatus" [value]="earning" > <mat-option *ngFor="let earning of earningStatus" [value]="earning.earning_member_status_id" >
{{earning}} {{earning.earning_member_status}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>

View File

@ -11,9 +11,12 @@ import { Key } from 'protractor';
}) })
export class PersonalInfoComponent implements OnInit { export class PersonalInfoComponent implements OnInit {
qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"]; //qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"];
earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"]; //earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"];
earningStatus:any=[];
qualifications:any=[];
relationShipList:any=[]; relationShipList:any=[];
@Input() pdid : string; @Input() pdid : string;
@Input() pd_all_details:any; @Input() pd_all_details:any;
form_id:number; form_id:number;
@ -39,7 +42,9 @@ export class PersonalInfoComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.loadPDDetails(this.pdid,this.form_id); this.loadPDDetails(this.pdid,this.form_id);
this.getRelationMaster(); this.getMasterDetails('RELATIONSHIPS',1);
this.getMasterDetails('EARNINGMEMBERSSTATUS',2);
this.getMasterDetails('EDUQUALIFICATION',3);
this.mainApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 1); this.mainApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 1);
// console.log(this.mainApplicantDetails) // console.log(this.mainApplicantDetails)
this.coApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 0); this.coApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 0);
@ -194,16 +199,26 @@ this.loadDataStatus = true;
get pdCoapplicant() {return this._personalForm.get('coItem') as FormArray;} get pdCoapplicant() {return this._personalForm.get('coItem') as FormArray;}
// get relation master details // get relation master details
getRelationMaster(){ getMasterDetails(table:string,type:number){
let relation ="RELATIONSHIPS"; //let relation ="RELATIONSHIPS";
this._pd.getAllMasterDatas(relation).subscribe( this._pd.getAllMasterDatas(table).subscribe(
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.relationShipList=data.records; if(type==1){
this.relationShipList=data.records.filter(item => item.isactive == 1);
}
else if(type==2){
this.earningStatus=data.records.filter(item => item.isactive == 1);
}
else if(type==3){
this.qualifications=data.records.filter(item => item.isactive == 1);
}
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
} }
// get earning master details
// submit forms details // submit forms details
submitPersonalForm(formData:any) { submitPersonalForm(formData:any) {

View File

@ -46,69 +46,69 @@ export class StartPdComponent implements OnInit, OnDestroy {
// category static form buttons // category static form buttons
categoryFormButtons: any = [ // categoryFormButtons: any = [
{ // {
"form_id": 1, // "form_id": 1,
"form_name": "Supplier Details" // "form_name": "Supplier Details"
}, // },
{ // {
"form_id": 2, // "form_id": 2,
"form_name": "Client Details", // "form_name": "Client Details",
}, // },
{ // {
"form_id": 3, // "form_id": 3,
"form_name": "Personal Details", // "form_name": "Personal Details",
}, // },
{ // {
"form_id":4, // "form_id":4,
"form_name":"Asset Details", // "form_name":"Asset Details",
}, // },
{ // {
"form_id": 5, // "form_id": 5,
"form_name": "Address" // "form_name": "Address"
}, // },
{ // {
"form_id": 6, // "form_id": 6,
"form_name": "Family", // "form_name": "Family",
}, // },
{ // {
"form_id": 7, // "form_id": 7,
"form_name": "Banking", // "form_name": "Banking",
}, // },
{ // {
"form_id": 8, // "form_id": 8,
"form_name": "Current Loan", // "form_name": "Current Loan",
}, // },
{ // {
"form_id": 9, // "form_id": 9,
"form_name": "Other Income", // "form_name": "Other Income",
}, // },
{ // {
"form_id": 10, // "form_id": 10,
"form_name": "Loan Details", // "form_name": "Loan Details",
}, // },
{ // {
"form_id": 11, // "form_id": 11,
"form_name": "Stock", // "form_name": "Stock",
}, // },
{ // {
"form_id": 12, // "form_id": 12,
"form_name": "Employmet Info", // "form_name": "Employmet Info",
}, // },
{ // {
"form_id": 13, // "form_id": 13,
"form_name": "Business Info", // "form_name": "Business Info",
}, // },
{ // {
"form_id": 14, // "form_id": 14,
"form_name": "Financial Info", // "form_name": "Financial Info",
}, // },
]; // ];
pdFullDetails:any=[]; pdFullDetails:any=[];
// category static form buttons // category static form buttons
// categoryFormButtons: any; categoryFormButtons: any;
// = [ // = [
// { // {
// "form_id": 1, // "form_id": 1,
@ -293,6 +293,7 @@ pdFullDetails:any=[];
if (data.status == 200) { if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details; this.pdMasterList=data.records.pdmaster_details;
this.categoryList=data.records.question_answers; this.categoryList=data.records.question_answers;
this.categoryFormButtons = data.records.template_forms;
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
this.mainApplicantName = filterApplicantName[0].applicant_name; this.mainApplicantName = filterApplicantName[0].applicant_name;
this.currentPDStatus = data.records.pdmaster_details.pd_status; this.currentPDStatus = data.records.pdmaster_details.pd_status;