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-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'">
@ -72,8 +63,9 @@
<mat-form-field>
<mat-select placeholder="Do you know"
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 +75,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

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

View File

@ -11,9 +11,12 @@ import { Key } from 'protractor';
})
export class PersonalInfoComponent implements OnInit {
qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"];
earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"];
//qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"];
//earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"];
earningStatus:any=[];
qualifications:any=[];
relationShipList:any=[];
@Input() pdid : string;
@Input() pd_all_details:any;
form_id:number;
@ -39,7 +42,9 @@ export class PersonalInfoComponent implements OnInit {
ngOnInit() {
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);
// console.log(this.mainApplicantDetails)
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 relation master details
getRelationMaster(){
let relation ="RELATIONSHIPS";
this._pd.getAllMasterDatas(relation).subscribe(
getMasterDetails(table:string,type:number){
//let relation ="RELATIONSHIPS";
this._pd.getAllMasterDatas(table).subscribe(
data => {
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);
}
// get earning master details
// submit forms details
submitPersonalForm(formData:any) {

View File

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