changes by suren
This commit is contained in:
parent
907d235854
commit
0079f760af
@ -52,8 +52,9 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
|
<mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
|
||||||
<mat-card-header>
|
<div *ngIf="coDetails.value.isactive != 0">
|
||||||
<mat-card-title>Applicant {{i+2}}</mat-card-title>
|
<mat-card-header>
|
||||||
|
<mat-card-title>Applicant {{coDetails.value.coapplicantindex}}</mat-card-title>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content [formGroupName]="i">
|
<mat-card-content [formGroupName]="i">
|
||||||
<mat-form-field style="width: 15%">
|
<mat-form-field style="width: 15%">
|
||||||
@ -100,8 +101,17 @@
|
|||||||
</mat-form-field> -->
|
</mat-form-field> -->
|
||||||
|
|
||||||
|
|
||||||
|
<div fxLayout="row nowrap" [style.display]="'block'">
|
||||||
|
<div align="right">
|
||||||
|
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button
|
||||||
|
mat-icon-button matTooltip="Remove" (click)="removecoapplicant(coDetails,i)"
|
||||||
|
matTooltipPosition="above">
|
||||||
|
<mat-icon>delete</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
public notifier: NotifierService;
|
public notifier: NotifierService;
|
||||||
mainApplicantData: any[];
|
mainApplicantData: any[];
|
||||||
coApplicantData: any[];
|
coApplicantData: any[];
|
||||||
|
coApplicantDataIndex: number=1 ;
|
||||||
coApplicantItems:FormArray;
|
coApplicantItems:FormArray;
|
||||||
emptyData:any;
|
emptyData:any;
|
||||||
relationShipList:any;
|
relationShipList:any;
|
||||||
@ -40,6 +41,8 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
if(this.data.records.length>0){
|
if(this.data.records.length>0){
|
||||||
this.mainApplicantData= this.data.records.filter(item => item.applicant_type == 1);
|
this.mainApplicantData= this.data.records.filter(item => item.applicant_type == 1);
|
||||||
this.coApplicantData= this.data.records.filter(item => item.applicant_type == 0);
|
this.coApplicantData= this.data.records.filter(item => item.applicant_type == 0);
|
||||||
|
// this.coApplicantDataIndex= this.data.records.filter(item => item.applicant_type == 0 && item.isactive == 1);
|
||||||
|
// console.log(this.coApplicantDataIndex);
|
||||||
this.loadApplicantFormData();
|
this.loadApplicantFormData();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -97,6 +100,12 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
createItem(listData): FormGroup {
|
createItem(listData): FormGroup {
|
||||||
if(listData){
|
if(listData){
|
||||||
|
if(listData.hasOwnProperty('isactive')){
|
||||||
|
if(listData.isactive == 1 ){
|
||||||
|
this.coApplicantDataIndex+=1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log(listData);
|
||||||
let stdcode;
|
let stdcode;
|
||||||
let landline;
|
let landline;
|
||||||
if(listData.landline != null){
|
if(listData.landline != null){
|
||||||
@ -119,9 +128,12 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
// relationship: [listData.relation],
|
// relationship: [listData.relation],
|
||||||
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
|
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
|
||||||
company_name: [listData.company_name],
|
company_name: [listData.company_name],
|
||||||
|
coapplicantindex:[listData.isactive == 1 ? this.coApplicantDataIndex:''],
|
||||||
|
isactive: [listData.isactive || 1],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
this.coApplicantDataIndex+=1
|
||||||
return this._fb.group({
|
return this._fb.group({
|
||||||
label: ['Co Applicant'],
|
label: ['Co Applicant'],
|
||||||
fk_applicant_primary_id: [null],
|
fk_applicant_primary_id: [null],
|
||||||
@ -134,6 +146,8 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
// relationship: [null],
|
// relationship: [null],
|
||||||
applicant_type: [0],
|
applicant_type: [0],
|
||||||
company_name: [null],
|
company_name: [null],
|
||||||
|
coapplicantindex:[this.coApplicantDataIndex],
|
||||||
|
isactive: [1],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,9 +157,34 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
|
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
|
||||||
this.coApplicantItems.push(this.createItem(listData));
|
this.coApplicantItems.push(this.createItem(listData));
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removecoapplicant(codetails,i){
|
||||||
|
console.log(codetails);
|
||||||
|
let control: any = this._EditApplicantForm.get('coApplicantItems') as FormArray;
|
||||||
|
console.log(control);
|
||||||
|
if(codetails.value.fk_applicant_primary_id == null){
|
||||||
|
control.removeAt(i);
|
||||||
|
this.coApplicantDataIndex-=1
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
control.controls[i].controls.isactive.setValue(0);
|
||||||
|
control.controls[i].controls.applicant_title_name.clearValidators();
|
||||||
|
control.controls[i].controls.coapplicantName.clearValidators();
|
||||||
|
control.controls[i].controls.coapplicant_mobile_no.clearValidators();
|
||||||
|
control.controls[i].controls.coapplicant_stdcode.clearValidators();
|
||||||
|
control.controls[i].controls.coapplicant_landline.clearValidators();
|
||||||
|
control.controls[i].controls.company_name.clearValidators();
|
||||||
|
control.controls[i].controls.applicant_type.clearValidators();
|
||||||
|
this.coApplicantDataIndex-=1
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get pdMainApplicant() { return this._EditApplicantForm.controls; }
|
get pdMainApplicant() { return this._EditApplicantForm.controls; }
|
||||||
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
|
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
|
||||||
updatePdApplicant(formValue: any) {
|
updatePdApplicant(formValue: any) {
|
||||||
@ -248,7 +287,7 @@ export class EditPdApplicantComponent implements OnInit {
|
|||||||
"landline":concat_landline,
|
"landline":concat_landline,
|
||||||
"applicant_type":itemElement.applicant_type,
|
"applicant_type":itemElement.applicant_type,
|
||||||
"company_name":itemElement.company_name,
|
"company_name":itemElement.company_name,
|
||||||
"isactive":1
|
"isactive": itemElement.isactive,
|
||||||
}
|
}
|
||||||
pd_applicant_details.push(obj1)
|
pd_applicant_details.push(obj1)
|
||||||
});
|
});
|
||||||
|
|||||||
@ -302,7 +302,8 @@
|
|||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
|
|
||||||
<mat-card-content *ngIf="pdApplicantData.length>0; else noApplicant">
|
<mat-card-content *ngIf="pdApplicantData.length>0; else noApplicant">
|
||||||
<mat-list *ngFor="let applicant of pdApplicantData">
|
<mat-list *ngFor="let applicant of pdApplicantData ">
|
||||||
|
<div *ngIf="applicant.isactive != 0">
|
||||||
<mat-list-item style="height:68px !important;">
|
<mat-list-item style="height:68px !important;">
|
||||||
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
|
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
|
||||||
<i class="fa-1x fa fa-user-o" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
|
<i class="fa-1x fa fa-user-o" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
|
||||||
@ -320,6 +321,7 @@
|
|||||||
<ng-template #codetails><span> {{applicant.relation_name}} </span></ng-template>
|
<ng-template #codetails><span> {{applicant.relation_name}} </span></ng-template>
|
||||||
</p>
|
</p>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
</div>
|
||||||
</mat-list>
|
</mat-list>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<ng-template #noApplicant>
|
<ng-template #noApplicant>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<div *ngIf="listView">
|
<div [style.display]="listView ? 'block' : 'none'">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
|
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
|
||||||
|
|||||||
@ -60,8 +60,7 @@ export class EntityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getCategorMaster();
|
|
||||||
this.getEntityListMasters();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get question master list details
|
// get question master list details
|
||||||
@ -77,6 +76,8 @@ export class EntityListComponent implements OnInit {
|
|||||||
// this.questionListData = data.records;
|
// this.questionListData = data.records;
|
||||||
this.dataLength = data.records.length;
|
this.dataLength = data.records.length;
|
||||||
this.dataSource.data = this.enityList;
|
this.dataSource.data = this.enityList;
|
||||||
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.enityList = [];
|
this.enityList = [];
|
||||||
this.dataLength = null;
|
this.dataLength = null;
|
||||||
@ -104,6 +105,8 @@ export class EntityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
this.getCategorMaster();
|
||||||
|
this.getEntityListMasters();
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
this.dataSource.sort = this.sort;
|
this.dataSource.sort = this.sort;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<div *ngIf="listView">
|
<div [style.display]="listView ? 'block' : 'none'">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div class="mb-1" fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="start center">
|
<div class="mb-1" fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="start center">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user