This commit is contained in:
dineshkumarkannan 2018-12-14 12:09:37 +05:30
commit 3bd4046ff2
4 changed files with 64 additions and 36 deletions

View File

@ -104,7 +104,7 @@
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('applicant_name').value == 'Others'">
<input matInput placeholder="Specify Other Applicant"
formControlName="other_applicant">
formControlName="other_applicant" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field>
@ -122,7 +122,7 @@
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 3">
<input matInput placeholder="Specify Other Bank Name"
formControlName="other_bank">
formControlName="other_bank" autocomplete="off">
</mat-form-field>
@ -140,7 +140,7 @@
</mat-select>-->
</mat-form-field>
<mat-form-field>
<mat-form-field *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" required>
<mat-option value="Yes">Yes</mat-option>
@ -151,7 +151,7 @@
<mat-form-field *ngIf="itemrow.get('account_type').value != 2">
<input matInput placeholder="Limit in case of OD / CC account"
formControlName="limit" (keypress)="keyPress($event)" required>
formControlName="limit" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
@ -169,10 +169,10 @@
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput type="number" placeholder="Year" formControlName="vintage_year" required min='0'>
<input matInput type="number" placeholder="Year(s)" formControlName="vintage_year" required min='0' (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Month" formControlName="vintage_month" required min='0' max='12'>
<input matInput type="number" placeholder="Month(s)" formControlName="vintage_month" required min='0' max='11'(keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
</div>

View File

@ -37,6 +37,7 @@ export class BankingDetailsComponent implements OnInit {
public applicants: any;
m_accountType= [];
m_btLenderList = [];
salaryField : boolean;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -57,6 +58,8 @@ export class BankingDetailsComponent implements OnInit {
this.initBankingForm();
this.getM_AccountType();
this.getM_BTLenderList();
this.salaryField = this.pd_cus_segment.substring(0,2) == 'SE' ? false : true ;
// this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
// // console.log("(0,3): " + this.pd_cus_segment.substring(0,3));
// // console.log(this.pd_all_details.pdmaster_details);
@ -123,7 +126,8 @@ export class BankingDetailsComponent implements OnInit {
bank_name: ['', Validators.compose([Validators.required])],
other_bank: [''],
account_type: ['', Validators.compose([Validators.required])],
salary: ['', Validators.compose([Validators.required])],
//salary: ['', Validators.compose([Validators.required])],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : ['', Validators.compose([Validators.required])],
limit: ['', Validators.compose([Validators.required])],
//is_main: ['', Validators.compose([Validators.required])],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : '', Validators.compose([Validators.required])],
@ -188,13 +192,13 @@ export class BankingDetailsComponent implements OnInit {
}
selectedAccTypeChanges(event: any){
console.log('First Time',event);
console.log('First Time Value',event.value);
// console.log('First Time',event);
// console.log('First Time Value',event.value);
if(event.value == 2) {
const control = <FormArray>this.bankingForm.controls['itemRows'];
console.log('Inside If Condition');
console.log(control);
console.log(control.controls);
// console.log('Inside If Condition');
// console.log(control);
// console.log(control.controls);
control.controls[0].get('limit').clearValidators();
control.controls[0].get('limit').updateValueAndValidity();
@ -208,7 +212,7 @@ export class BankingDetailsComponent implements OnInit {
}
else{
alert('sd');
//alert('sd');
}
}

View File

@ -18,12 +18,12 @@
<div fxFlex="100">
<mat-card>
<mat-form-field style="width: 25%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required>
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-select multiple (selectionChange)="endUserChange($event)" placeholder="What is the end use" formControlName="end_use" required>
<mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.id">{{ enduse.name }}</mat-option>
<mat-select multiple (selectionChange)="endUserChange($event.value)" placeholder="What is the end use" formControlName="end_use" required>
<mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.subproduct_id">{{ enduse.name }}</mat-option>
</mat-select>
<!--<mat-select multiple placeholder="What is the end use"
formControlName="end_use" (selectionChange)="endUserChange($event)">
@ -38,7 +38,7 @@
</mat-select>-->
</mat-form-field>
<mat-form-field *ngIf="isOtherPurpose" style="width: 25%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other">
<input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
@ -49,7 +49,7 @@
</mat-form-field>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 50%">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:20%">
@ -67,18 +67,18 @@
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 25%">
<input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender">
<input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 20%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
<mat-form-field style="width: 35%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field>
@ -96,14 +96,14 @@
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['source'].value =='other'" style="width: 35%">
<input matInput placeholder="Specify Lender Name and Type" formControlName="lender_name_type">
<input matInput placeholder="Specify Lender Name and Type" formControlName="lender_name_type" autocomplete="off">
</mat-form-field>
</div>
<mat-form-field style="width: 50%">
<input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required>
<input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field>
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->
<mat-card *ngIf="mortageCardAccess">
@ -133,7 +133,7 @@
</mat-select>-->
<mat-form-field *ngIf="mortageAccess">
<input matInput placeholder="Specify Type of Property" formControlName="property_type_others">
<input matInput placeholder="Specify Type of Property" formControlName="property_type_others" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select multiple placeholder="Name of Owner"
@ -144,7 +144,7 @@
</mat-form-field>
<mat-form-field *ngIf="OtherOwnerFlag">
<input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name">
<input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name" autocomplete="off">
</mat-form-field>
<mat-form-field>
@ -155,7 +155,7 @@
<mat-form-field *ngIf="loanDetailsForm.controls['construction_status'].value == 4">
<input matInput placeholder="What is the approximate stage of construction (%)?"
formControlName="percentage_of_construction" (keypress)="keyPress($event)" required>
formControlName="percentage_of_construction" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field>
<!--<mat-select placeholder="Status of construction"
@ -167,7 +167,7 @@
<mat-form-field>
<input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" (keypress)="keyPress($event)" required>
formControlName="emv_per_customer" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field>
<!-- <mat-form-field>
<input matInput placeholder="Value as Per Agreement"

View File

@ -38,6 +38,7 @@ export class LoanDetailsComponent implements OnInit {
applicants: any;
productAbbr: any;
productID: any;
subProductName: any;
isOtherPurpose: boolean = false;
@ -70,8 +71,10 @@ export class LoanDetailsComponent implements OnInit {
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.applicants = this.pd_all_details.pdapplicants_detials;
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount :'';
this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
@ -81,7 +84,8 @@ export class LoanDetailsComponent implements OnInit {
}
ngOnInit() {
console.clear();
console.log(this.pd_all_details);
this.initloanDetailsForm();
this.getM_EndUseofLoad();
this.getM_sourceofamount();
@ -123,6 +127,7 @@ export class LoanDetailsComponent implements OnInit {
if(value.records.loan_amount){ this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); }
this.loanDetailsForm.controls['end_use'].setValue(enduse);
this.endUserChange(enduse);
if (value.records.end_use_other) {
this.loanDetailsForm.controls['end_use_other'].setValue(value.records.end_use_other);
}
@ -187,9 +192,10 @@ export class LoanDetailsComponent implements OnInit {
// =============
getM_EndUseofLoad() {
this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe(
//this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe(
this._pd.getAllMasterDatas('SUBPRODUCTS').subscribe(
data => {
this.m_endUseofLoad = data.records.filter(data => data.isactive == 1);
this.m_endUseofLoad = data.records.filter(data => data.isactive == 1 && data.fk_product_id == this.productID);
},
error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
@ -307,15 +313,33 @@ getM_sourceofamount() {
loandetails_remarks: ['', Validators.compose([Validators.required])],
});
}
// endUserChange(event) {
// this.endUserList = [];
// event.value.forEach(option => {
// this.endUserList.push({end_use: option});
// if (option == 'other') {
// this.isOtherPurpose = true;
// }
// });
// }
endUserChange(event) {
this.endUserList = [];
event.value.forEach(option => {
event.forEach(option => {
let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
othersData = othersData.name.substr(0,6).toLowerCase();
this.endUserList.push({ end_use: option });
if (option == 'other') {
if (othersData == 'others') {
this.isOtherPurpose = true;
return ;
}else
{
this.isOtherPurpose = false;
}
});
}
ownerNameChange(event) {
let EventValue;