general form changes
This commit is contained in:
parent
97e8931da2
commit
70e605627e
@ -158,7 +158,8 @@
|
|||||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.persons_with_relationships.value[i].relationship==0 ? 'hidden':'visible'">
|
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.persons_with_relationships.value[i].relationship==0 ? 'hidden':'visible'">
|
||||||
<mat-select placeholder="Applicant" formControlName="relation_to" style="width: 75%;" [disabled]="_generalForm.controls.persons_with_relationships.value[i].relationship==0">
|
<mat-select placeholder="Applicant" formControlName="relation_to" style="width: 75%;" [disabled]="_generalForm.controls.persons_with_relationships.value[i].relationship==0">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let appc of individualsList" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
<!-- getRelationRestrict(_generalForm.controls.persons_with_relationships.value[i].pd_co_applicant_id,_generalForm.controls.persons_with_relationships.value,individualsList)" -->
|
||||||
|
<mat-option *ngFor="let appc of individualsList | searchRelation : { currentApplicantID:_generalForm.controls.persons_with_relationships.value[i].pd_co_applicant_id, existRelationList:_generalForm.controls.persons_with_relationships.value}" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
||||||
<mat-option value="0" > Not Applicable </mat-option>
|
<mat-option value="0" > Not Applicable </mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|
||||||
|
|||||||
@ -7,10 +7,13 @@ import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-deta
|
|||||||
import { element } from '@angular/core/src/render3/instructions';
|
import { element } from '@angular/core/src/render3/instructions';
|
||||||
import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser/src/dom/debug/ng_probe';
|
import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser/src/dom/debug/ng_probe';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SearchRelationPipe } from './../../../../../pd-pipes/search-relation.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-general-info',
|
selector: 'app-general-info',
|
||||||
templateUrl: './general-info.component.html',
|
templateUrl: './general-info.component.html',
|
||||||
styleUrls: ['./general-info.component.scss'],
|
styleUrls: ['./general-info.component.scss'],
|
||||||
|
providers: [SearchRelationPipe],
|
||||||
})
|
})
|
||||||
export class GeneralInfoComponent implements OnInit {
|
export class GeneralInfoComponent implements OnInit {
|
||||||
pipe = new DatePipe('en-US');
|
pipe = new DatePipe('en-US');
|
||||||
@ -37,7 +40,7 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
qualificationList: any=[];
|
qualificationList: any=[];
|
||||||
businessEntityTypeList: any=[];
|
businessEntityTypeList: any=[];
|
||||||
maxDate: any;
|
maxDate: any;
|
||||||
constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any,) {
|
constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any,private dialogRef: MatDialogRef<GeneralInfoComponent>) {
|
||||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
this.form_id = 18;
|
this.form_id = 18;
|
||||||
@ -555,8 +558,8 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
if (dataresult.status == 200) {
|
if (dataresult.status == 200) {
|
||||||
this.notifier.notify('success', 'General Information Updated.!');
|
this.notifier.notify('success', 'General Information Updated.!');
|
||||||
setTimeout(() =>{
|
setTimeout(() =>{
|
||||||
this.dialog.closeAll();
|
this.dialogRef.close();
|
||||||
},1000);
|
},3000);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -90,6 +90,7 @@ import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dia
|
|||||||
import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component';
|
import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component';
|
||||||
import { SharedModule } from "app/shared/shared.module";
|
import { SharedModule } from "app/shared/shared.module";
|
||||||
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
|
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
|
||||||
|
import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom angular notifier options
|
* Custom angular notifier options
|
||||||
@ -108,7 +109,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
},
|
},
|
||||||
theme: 'material',
|
theme: 'material',
|
||||||
behaviour: {
|
behaviour: {
|
||||||
autoHide: 5000,
|
autoHide: 2000,
|
||||||
onClick: 'hide',
|
onClick: 'hide',
|
||||||
onMouseover: 'pauseAutoHide',
|
onMouseover: 'pauseAutoHide',
|
||||||
showDismissButton: true,
|
showDismissButton: true,
|
||||||
@ -267,7 +268,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||||
// OwlNativeDateTimeModule,
|
// OwlNativeDateTimeModule,
|
||||||
// ],
|
// ],
|
||||||
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
|
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe],
|
||||||
|
|
||||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { SearchRelationPipe } from './search-relation.pipe';
|
||||||
|
|
||||||
|
describe('SearchRelationPipe', () => {
|
||||||
|
it('create an instance', () => {
|
||||||
|
const pipe = new SearchRelationPipe();
|
||||||
|
expect(pipe).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({
|
||||||
|
name: 'searchRelation'
|
||||||
|
})
|
||||||
|
export class SearchRelationPipe implements PipeTransform {
|
||||||
|
|
||||||
|
transform(value: any, searchItem:any): any {
|
||||||
|
let findExistIndex = searchItem.existRelationList.filter(sVal=>sVal.relation_to==searchItem.currentApplicantID);
|
||||||
|
if(findExistIndex.length>0){
|
||||||
|
let check = value.filter(function(fVal){
|
||||||
|
return !findExistIndex.some(function(sVal){
|
||||||
|
return fVal.pd_co_applicant_id==searchItem.currentApplicantID || fVal.pd_co_applicant_id == sVal.pd_co_applicant_id;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
return check;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return value.filter(fVal=>fVal.pd_co_applicant_id!=searchItem.currentApplicantID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user