issues fixes : ps
This commit is contained in:
parent
165228342c
commit
35b3664b45
@ -89,7 +89,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 24%">
|
||||
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
|
||||
<mat-hint align="end" *ngIf="pdMain.loan_amount.value != ''">{{"₹"}} {{loanAmtInWords}} Only</mat-hint>
|
||||
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
|
||||
@ -142,7 +142,7 @@
|
||||
</div>
|
||||
<div fxFlex="30" align="end">
|
||||
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="PD Process" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
|
||||
|
||||
@ -19,105 +19,118 @@
|
||||
<mat-card>
|
||||
<!-- <mat-card-title>Address Details</mat-card-title> -->
|
||||
<mat-card-content>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="33">
|
||||
<div fxLayout="row wrap">
|
||||
|
||||
<div fxFlex="33">
|
||||
|
||||
<mat-form-field style="width: 80%;">
|
||||
<!-- <input matInput placeholder="Name" formControlName="name_ans" type="text" required> -->
|
||||
<input matInput placeholder="Address" formControlName="address" required autocomplete="off">
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Address Type" formControlName="address_type" required>
|
||||
<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 *ngIf="addressForm.controls['address_type'].value == 12" style="width: 80%;">
|
||||
<input matInput placeholder="Address Type Others" formControlName="address_type_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Locality" formControlName="locality" required>
|
||||
<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 style="width: 80%;">
|
||||
<!-- <input matInput placeholder="Name" formControlName="name_ans" type="text" required> -->
|
||||
<input matInput placeholder="Address" formControlName="address" required autocomplete="off">
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Address Type" formControlName="address_type" required>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['address_type'].value == 12" fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Locality" formControlName="locality" required>
|
||||
<mat-option value="{{m_locality.locality_id}}"
|
||||
*ngFor="let m_locality of localityData">{{m_locality.locality_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'" style="width: 80%;">
|
||||
<input matInput placeholder="Specify Locality"
|
||||
formControlName="locality_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Approach to PD Location" formControlName="pd_location" required>
|
||||
<mat-option value="{{data.pd_location_approach_id}}"
|
||||
*ngFor="let data of locationdata">{{data.description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Comment on Locality" formControlName="comment_locality" required>
|
||||
<mat-option value="{{data.comments_on_locality_id}}"
|
||||
*ngFor="let data of commentData">{{data.rating}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Ownership" formControlName="address_ownership">
|
||||
<mat-option value="{{ownerShip.id}}"
|
||||
*ngFor="let ownerShip of ownerShipData">
|
||||
{{ownerShip.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="addressForm.controls['address_ownership'].value == 4 " style="width: 80%;">
|
||||
<input matInput placeholder="Specify Other Ownership" formControlName="other_ownership" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<div *ngIf="addressForm.controls.locality.value == 7" fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Locality"
|
||||
formControlName="locality_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-form-field *ngIf="addressForm.controls['address_ownership'].value == 3 " style="width: 80%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Approach to PD Location" formControlName="pd_location" required>
|
||||
<mat-option value="{{data.pd_location_approach_id}}"
|
||||
*ngFor="let data of locationdata">{{data.description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Is there any business activity is being run?"
|
||||
formControlName="bussiness_activity" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap" *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%">
|
||||
<div fxFlex="100">
|
||||
<label>How long has business been operated from this premise?</label>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Year(s)" formControlName="business_years">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Month(s)" formControlName="business_month" (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Comment on Locality" formControlName="comment_locality" required>
|
||||
<mat-option value="{{data.comments_on_locality_id}}"
|
||||
*ngFor="let data of commentData">{{data.rating}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Ownership" formControlName="address_ownership">
|
||||
<mat-option value="{{ownerShip.id}}"
|
||||
*ngFor="let ownerShip of ownerShipData">
|
||||
{{ownerShip.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['address_ownership'].value == 4 " fxFlex="33">
|
||||
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Ownership" formControlName="other_ownership" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['address_ownership'].value == 3 " fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<label>How long has business been operated from this premise?</label>
|
||||
<mat-form-field>
|
||||
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Is there any other premises from which business activity is being run?"
|
||||
formControlName="bussiness_activity" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Don't Remove To replace atlast of the PD Completion and creating new form (Customer Behaviour 221118 review doc : s.no 3.e )
|
||||
@ -151,9 +164,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<mat-form-field *ngIf="PremisesOtherFlag == true" style="width: 40%">
|
||||
<input matInput placeholder="Specify Other Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field *ngIf="PremisesOtherFlag == true" style="width: 40%">
|
||||
<input matInput placeholder="Specify Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
|
||||
</mat-form-field> -->
|
||||
<span *ngIf="PremisesOtherFlag == true">
|
||||
<br>
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Specify Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</span>
|
||||
|
||||
|
||||
<span formArrayName="additional_premises">
|
||||
<div
|
||||
*ngFor="let item of addressForm.controls.additional_premises['controls']; let i = index;" [formGroupName]="i">
|
||||
@ -184,7 +205,7 @@
|
||||
|
||||
<!-- <mat-form-field *ngIf="addressForm.controls['premises_ownership'].value == 4 "> -->
|
||||
<mat-form-field *ngIf="item.get('premises_ownership').value == 4" style="width: 40%;">
|
||||
<input matInput placeholder="Specify Other Ownership" formControlName="premises_ownership_others" autocomplete="off">
|
||||
<input matInput placeholder="Specify Ownership" formControlName="premises_ownership_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off">
|
||||
@ -383,10 +404,4 @@
|
||||
</mat-dialog-actions>
|
||||
|
||||
</form>
|
||||
<notifier-container></notifier-container>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
@ -125,61 +125,15 @@ export class AddressComponent implements OnInit {
|
||||
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
|
||||
// this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
|
||||
this.addressForm.controls.locality.setValue(data.records.locality);
|
||||
if(data.records.locality == 7 ){
|
||||
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
||||
}
|
||||
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
|
||||
this.addressForm.controls.address_ownership.setValue(data.records.address_ownership);
|
||||
this.addressForm.controls.other_ownership.setValue(data.records.other_ownership);
|
||||
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
|
||||
this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
|
||||
|
||||
// if(data.records.bussiness_activity == 'yes') {
|
||||
|
||||
// this.bussiness_address_type = [];
|
||||
|
||||
// this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
|
||||
// {
|
||||
// return data.records.bussiness_address_type[key].premises_types;
|
||||
// }))
|
||||
|
||||
// // console.log(bussiness_address_type);
|
||||
|
||||
|
||||
// let selectedPremisesDBData = Object.keys(data.records.bussiness_address_type).map(function (key) {
|
||||
// return data.records.bussiness_address_type[key];
|
||||
// });
|
||||
|
||||
// let enduse: any = [];
|
||||
// let existPremises: any =[];
|
||||
|
||||
// selectedPremisesDBData.forEach(val => {
|
||||
// enduse.push(val.premises_types);
|
||||
// existPremises.push(val);
|
||||
// });
|
||||
|
||||
// this.formPremisesArray = existPremises;
|
||||
|
||||
|
||||
// this.addressForm.controls.bussiness_address_type.setValue(enduse);
|
||||
|
||||
// var additionalPremisesResult = Object.keys(data.records.additional_premises).map(function (key) {
|
||||
// return data.records.additional_premises[key];
|
||||
// });
|
||||
|
||||
// this.additional_premises = additionalPremisesResult;
|
||||
|
||||
// if (additionalPremisesResult.length == 0) {
|
||||
// additionalPremisesControl.push(this.createPremises());
|
||||
// } else {
|
||||
// additionalPremisesResult.forEach(datas => {
|
||||
// additionalPremisesControl.push(this.createPremises());
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// if(data.records.bussiness_address_type == 12) {
|
||||
// this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others);
|
||||
// }
|
||||
// }
|
||||
|
||||
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
|
||||
this.addressForm.controls.business_years.setValue(data.records.business_years);
|
||||
this.addressForm.controls.business_month.setValue(data.records.business_month);
|
||||
@ -198,8 +152,6 @@ export class AddressComponent implements OnInit {
|
||||
})
|
||||
|
||||
}
|
||||
// console.log(this.bussiness_address_type);
|
||||
// console.log(this.additional_premises);
|
||||
|
||||
this.selectedValue(this.bussiness_address_type,this.additional_premises);
|
||||
if (data.records.locality_others) {
|
||||
@ -333,8 +285,9 @@ export class AddressComponent implements OnInit {
|
||||
control.removeAt(index);
|
||||
}*/
|
||||
onSubmit() {
|
||||
//console.log('form data', this.addressForm.value);
|
||||
|
||||
if (!this.addressForm.valid) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -345,7 +298,7 @@ export class AddressComponent implements OnInit {
|
||||
records.address_type_others = this.addressForm.controls.address_type_others.value;
|
||||
}
|
||||
records.locality = this.locality.value;
|
||||
if (this.locality.value == 'Others') {
|
||||
if (this.locality.value == 7) {
|
||||
records.locality_others = this.addressForm.controls.locality_others.value;
|
||||
}
|
||||
records.pd_location = this.pdLocation.value;
|
||||
@ -369,16 +322,16 @@ export class AddressComponent implements OnInit {
|
||||
records.bussiness_address_type_others = this.addressForm.controls.bussiness_address_type_others.value;
|
||||
}
|
||||
}
|
||||
console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value);
|
||||
this.addressForm.controls.additional_premises.value.forEach((val,index)=>
|
||||
{
|
||||
//console.log(val);
|
||||
|
||||
if(val.premises_city != ''){
|
||||
{
|
||||
|
||||
console.log('val.premises_city',val.premises_city);
|
||||
if(val.premises_city != '' && val.premises_city != null){
|
||||
this.formPremisesCityArray = [];
|
||||
val.premises_city.forEach(option => {
|
||||
this.formPremisesCityArray.push({additional_premises_city: option});
|
||||
this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray;
|
||||
// console.log(val);
|
||||
});
|
||||
}
|
||||
else{
|
||||
@ -390,15 +343,14 @@ export class AddressComponent implements OnInit {
|
||||
});
|
||||
|
||||
records.additional_premises = this.addressForm.controls.additional_premises.value;
|
||||
// console.log(this.formPremisesCityArray);
|
||||
// console.log(this.addressForm.controls.premises.value);
|
||||
|
||||
records.pdid = this.pdid;
|
||||
records.formid = '5';
|
||||
// records.fk_createdby = '250';
|
||||
console.log('params', records);
|
||||
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
//console.log('data', data);
|
||||
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
@ -414,22 +366,22 @@ export class AddressComponent implements OnInit {
|
||||
SelectedPremises($event){
|
||||
|
||||
let premisesData = $event.source.value;
|
||||
//console.log(premisesData);
|
||||
|
||||
|
||||
if($event.checked === true ){
|
||||
|
||||
//this.formPremisesArray.push({member: $event.source.value});
|
||||
//this.selectedSegmentDatas.push(CustomerSegmentName.name);
|
||||
//console.log('true',premisesData);
|
||||
|
||||
|
||||
//console.log(this.formPremisesArray);
|
||||
|
||||
|
||||
this.formPremisesArray.push({premises_types: $event.source.value});
|
||||
|
||||
//console.log(this.formPremisesArray);
|
||||
|
||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
|
||||
//console.log(array);
|
||||
|
||||
if(premisesData == 12){
|
||||
this.PremisesOtherFlag = true;
|
||||
// this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
|
||||
@ -455,7 +407,7 @@ export class AddressComponent implements OnInit {
|
||||
if(premisesData == 12){
|
||||
this.PremisesOtherFlag = false;
|
||||
}
|
||||
//console.log(this.formPremisesArray);
|
||||
|
||||
let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
|
||||
//console.log(index);
|
||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
@ -481,78 +433,9 @@ export class AddressComponent implements OnInit {
|
||||
let z = this.z;
|
||||
this.PremisesLabel[z-1] = this.addressForm.get('bussiness_address_type_others').value;
|
||||
}
|
||||
// checkaddress(value)
|
||||
// {
|
||||
// // console.log(value);
|
||||
// if(value=="OTHERS")
|
||||
// {
|
||||
// this.addressRemarksAccess = true;
|
||||
// }else
|
||||
// {
|
||||
// this.addressRemarksAccess = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// SelectedPremises($event){
|
||||
// console.log('event',$event);
|
||||
|
||||
// let premisesData = $event.source.value;
|
||||
|
||||
|
||||
// if($event.source._selected === true ){
|
||||
|
||||
// //this.formPremisesArray.push({member: $event.source.value});
|
||||
// //this.selectedSegmentDatas.push(CustomerSegmentName.name);
|
||||
// //console.log('true',premisesData);
|
||||
|
||||
// //console.log(this.formPremisesArray);
|
||||
|
||||
// this.formPremisesArray.push({premises_types: $event.source.value});
|
||||
|
||||
// //console.log(this.formPremisesArray);
|
||||
|
||||
// let array = this.addressData.filter(data => data.address_type_id == premisesData);
|
||||
|
||||
// if(premisesData == 12){
|
||||
// this.PremisesOtherFlag = true;
|
||||
// this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value;
|
||||
// }
|
||||
// else{
|
||||
// this.PremisesLabel[this.z] = array[0].address_type;
|
||||
// }
|
||||
// this.z++;
|
||||
|
||||
|
||||
// const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
// control.push(this.createPremises());
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// else if($event.source._selected === false ){
|
||||
|
||||
// console.log('false',premisesData);
|
||||
|
||||
|
||||
// if(premisesData == 12){
|
||||
// this.PremisesOtherFlag = false;
|
||||
// }
|
||||
|
||||
// const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
// control.removeAt(this.z);
|
||||
// this.z--;
|
||||
// //let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
|
||||
// //this.selectedSegmentDatas.splice(index,1);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
selectedValue(e,data)
|
||||
{
|
||||
// console.log('501 function',);
|
||||
// console.log('inside function in bussiness_address_type,',e);
|
||||
// console.log('inside function in this.additional_premises,',data);
|
||||
|
||||
let premisesData = e ;
|
||||
this.tempArr = [];
|
||||
@ -562,12 +445,12 @@ export class AddressComponent implements OnInit {
|
||||
that.addressData[key].status = 0;
|
||||
return that.addressData[key];
|
||||
})
|
||||
//console.log(this.addressData);
|
||||
|
||||
premisesData.forEach((val,index)=>
|
||||
{
|
||||
//console.log(val);
|
||||
|
||||
this.z++;
|
||||
// console.log(this.addressTypes);
|
||||
|
||||
this.formPremisesArray.push({premises_types: val});
|
||||
|
||||
this.tempArr.push(this.addressData.filter(add=>add.address_type_id==val)[0]);
|
||||
@ -579,6 +462,7 @@ export class AddressComponent implements OnInit {
|
||||
{
|
||||
return data[index].premises_city[key].additional_premises_city;
|
||||
});
|
||||
//data[index].premises_city = data[index].premises_city.additional_premises_city;
|
||||
}
|
||||
this.addressData.forEach(data=>
|
||||
{
|
||||
@ -621,7 +505,5 @@ export class AddressComponent implements OnInit {
|
||||
this.addressForm.controls.business_years.setValue(+business_year + +Math.floor(converted_year));
|
||||
this.addressForm.controls.business_month.setValue(Math.floor(converted_month));
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,6 +90,10 @@
|
||||
<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 != ''">{{"₹"}} {{topUpAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%">
|
||||
<input matInput placeholder="End Use of Top Up" formControlName="end_use_topup" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
|
||||
|
||||
@ -97,29 +101,41 @@
|
||||
<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 != ''">{{"₹"}} {{ownContributionInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field style="width: 30%">
|
||||
<mat-select placeholder="Source" formControlName="source" required>
|
||||
<mat-select (selectionChange)="sourceChange($event.value)" placeholder="Source of Own Contribution" formControlName="source" required multiple>
|
||||
<mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<!--<mat-select placeholder="Source"
|
||||
<mat-form-field *ngIf="isPLSource" style="width: 30%">
|
||||
<input matInput placeholder="Specify Personal Loan" formControlName="personal_loan_source" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="isOtherSource" style="width: 30%">
|
||||
<input matInput placeholder="Specify Other Sources" formControlName="other_source" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<!--<mat-form-field>
|
||||
<mat-select placeholder="Source"
|
||||
formControlName="source">
|
||||
<mat-option value="borrowed">Borrowed from Relatives & Friends</mat-option>
|
||||
<mat-option value="own_money">Own money</mat-option>
|
||||
<mat-option value="other">Loan from another lender</mat-option>
|
||||
</mat-select>-->
|
||||
|
||||
</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" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</mat-select>
|
||||
</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" autocomplete="off">
|
||||
</mat-form-field>-->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<mat-form-field style="width: 30%">
|
||||
<input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required autocomplete="off">
|
||||
<mat-form-field style="width: 60%">
|
||||
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" required autocomplete="off">
|
||||
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"₹"}} {{emiAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->
|
||||
<mat-card *ngIf="mortageCardAccess">
|
||||
@ -165,7 +181,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Status of Construction" formControlName="construction_status" required>
|
||||
<mat-option *ngFor="let status of m_statusofCunstruction" [value]="status.id">{{ status.name }} {{status.id}}</mat-option>
|
||||
<mat-option *ngFor="let status of m_statusofCunstruction" [value]="status.id">{{ status.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -183,7 +199,8 @@
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Estimate Market Value as Per Customer"
|
||||
formControlName="emv_per_customer" (keypress)="keyPress($event)" required autocomplete="off">
|
||||
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required autocomplete="off">
|
||||
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"₹"}} {{emvAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field>
|
||||
<input matInput placeholder="Value as Per Agreement"
|
||||
|
||||
@ -42,11 +42,13 @@ export class LoanDetailsComponent implements OnInit {
|
||||
subProductName: any;
|
||||
|
||||
isOtherPurpose: boolean = false;
|
||||
isSource: boolean = false;
|
||||
isOtherSource: boolean = false;
|
||||
isPLSource: boolean = false;
|
||||
mortageCheck : boolean = true;
|
||||
OtherOwnerFlag : boolean;
|
||||
|
||||
endUserList: any = [];
|
||||
sourceList : any = [];
|
||||
ownerNames: any = [];
|
||||
m_endUseofLoad = [];
|
||||
m_sourceofamount = [];
|
||||
@ -59,6 +61,8 @@ export class LoanDetailsComponent implements OnInit {
|
||||
valAsPerAgmtInWords : any;
|
||||
ownContributionInWords : any;
|
||||
topUpAmtInWords: any;
|
||||
emiAmtInWords : any;
|
||||
emvAmtInWords : any;
|
||||
pageTitle: string ="Loan Details";
|
||||
|
||||
mortageCardAccess: boolean;
|
||||
@ -159,6 +163,9 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount);
|
||||
this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount);
|
||||
}
|
||||
|
||||
this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup);
|
||||
|
||||
if (value.records.lender) {
|
||||
this.loanDetailsForm.controls['lender'].setValue(value.records.lender);
|
||||
}
|
||||
@ -166,17 +173,46 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValue(value.records.other_bt_lender);
|
||||
}
|
||||
if(value.records.is_transfer != 'yes'){
|
||||
|
||||
let source = Object.keys(value.records.source_group).map(function(key) {
|
||||
return value.records.source_group[key];
|
||||
});
|
||||
|
||||
console.log(source);
|
||||
|
||||
let dbsourcelist : any = [];
|
||||
source.forEach(val => {
|
||||
dbsourcelist.push(val.sources);
|
||||
});
|
||||
|
||||
console.log('sources',dbsourcelist);
|
||||
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution);
|
||||
if(value.records.own_contribution){ this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); }
|
||||
|
||||
this.loanDetailsForm.controls['source'].setValue(value.records.source);
|
||||
this.loanDetailsForm.controls['source'].setValue(dbsourcelist);
|
||||
this.sourceChange(dbsourcelist);
|
||||
|
||||
if(value.records.other_source) {
|
||||
// this.isOtherSource = true;
|
||||
this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source);
|
||||
}
|
||||
|
||||
if(value.records.personal_loan_source) {
|
||||
// this.isPLSource = true;
|
||||
this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source);
|
||||
}
|
||||
}
|
||||
|
||||
if (value.records.lender_name_type) {
|
||||
this.loanDetailsForm.controls['lender_name_type'].setValue(value.records.lender_name_type);
|
||||
// if (value.records.lender_name_type) {
|
||||
// this.loanDetailsForm.controls['lender_name_type'].setValue(value.records.lender_name_type);
|
||||
// }
|
||||
|
||||
if(value.records.emi_level){
|
||||
this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level);
|
||||
this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level);
|
||||
}
|
||||
|
||||
this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level);
|
||||
this.loanDetailsForm.controls['property_type'].setValue(value.records.property_type);
|
||||
this.propertyType = value.records.property_type;
|
||||
//console.log(value.records.property_type);
|
||||
@ -193,7 +229,11 @@ export class LoanDetailsComponent implements OnInit {
|
||||
else{
|
||||
this.loanDetailsForm.controls['percentage_of_construction'].setValue('');
|
||||
}
|
||||
this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer);
|
||||
if(value.records.emv_per_customer != ''){
|
||||
this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer);
|
||||
this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer);
|
||||
}
|
||||
|
||||
// this.loanDetailsForm.controls['value_per_agreement'].setValue(value.records.value_per_agreement);
|
||||
// if(value.records.value_per_agreement){ this.valAsPerAgmtInWords = this._pd.convertNumberToWords(value.records.value_per_agreement); }
|
||||
this.loanDetailsForm.controls['loandetails_remarks'].setValue(value.records.loandetails_remarks);
|
||||
@ -314,11 +354,14 @@ getM_sourceofamount() {
|
||||
is_topup: [''],
|
||||
balance_transfer_amount: [''],
|
||||
topup_amount: [''],
|
||||
end_use_topup:[''],
|
||||
lender: [''],
|
||||
other_bt_lender : [''],
|
||||
own_contribution: [''],
|
||||
source: [''],
|
||||
lender_name_type: [''],
|
||||
other_source:[''],
|
||||
personal_loan_source:[''],
|
||||
//lender_name_type: [''],
|
||||
emi_level: ['', Validators.compose([Validators.required])],
|
||||
property_type: ['', Validators.compose([Validators.required])],
|
||||
property_type_others:[''],
|
||||
@ -343,24 +386,48 @@ getM_sourceofamount() {
|
||||
|
||||
endUserChange(event) {
|
||||
this.endUserList = [];
|
||||
let OthersAvaliable;
|
||||
event.forEach(option => {
|
||||
let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
|
||||
othersData = othersData.name.substr(0,6).toLowerCase();
|
||||
OthersAvaliable = othersData.name.substr(0,6).toLowerCase();
|
||||
console.log('other',othersData);
|
||||
console.log('',OthersAvaliable);
|
||||
|
||||
this.endUserList.push({ end_use: option });
|
||||
if (othersData == 'others') {
|
||||
this.isOtherPurpose = true;
|
||||
return ;
|
||||
}else
|
||||
{
|
||||
this.isOtherPurpose = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (OthersAvaliable == 'others') {
|
||||
this.isOtherPurpose = true;
|
||||
}else
|
||||
{
|
||||
this.isOtherPurpose = false;
|
||||
}
|
||||
|
||||
console.log('e',event);
|
||||
|
||||
//this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only;
|
||||
}
|
||||
|
||||
|
||||
sourceChange(evt) {
|
||||
// console.log('source Changed Values',evt);
|
||||
|
||||
// this.isOtherSource = (evt.some(e => e == 4) == true) ? true : false ;
|
||||
// this.isPLSource = (evt.some(e => e == 3) == true) ? true : false ;
|
||||
|
||||
this.isOtherSource = evt.some(e => e == 4) // this return true or false Only;
|
||||
this.isPLSource = evt.some(e => e == 3) // this return true or false Only;
|
||||
|
||||
this.sourceList = [];
|
||||
|
||||
evt.forEach(option => {
|
||||
this.sourceList.push({source: option});
|
||||
});
|
||||
}
|
||||
|
||||
ownerNameChange(event) {
|
||||
let EventValue;
|
||||
|
||||
event.value.forEach(option => {
|
||||
EventValue = option;
|
||||
if(EventValue == 'Others'){
|
||||
@ -397,7 +464,7 @@ getM_sourceofamount() {
|
||||
|
||||
if (this.isOtherPurpose) {
|
||||
records.end_use_other = this.loanDetailsForm.controls['end_use_other'].value;
|
||||
}
|
||||
}else{ records.end_use_other = '' ;}
|
||||
records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value;
|
||||
records.is_topup = this.loanDetailsForm.controls['is_topup'].value;
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
@ -405,14 +472,27 @@ getM_sourceofamount() {
|
||||
}
|
||||
else if(this.loanDetailsForm.controls['is_transfer'].value == 'no') {
|
||||
records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value;
|
||||
records.source = this.loanDetailsForm.controls['source'].value;
|
||||
if (this.loanDetailsForm.controls['source'].value == 'other') {
|
||||
records.lender_name_type = this.loanDetailsForm.controls['lender_name_type'].value;
|
||||
}
|
||||
// records.source = this.loanDetailsForm.controls['source'].value;
|
||||
// if (this.loanDetailsForm.controls['source'].value == 'other') {
|
||||
// records.lender_name_type = this.loanDetailsForm.controls['lender_name_type'].value;
|
||||
// }
|
||||
// if (this.loanDetailsForm.controls['source'].value == 4) {
|
||||
// records.other_source = this.loanDetailsForm.controls['other_source'].value;
|
||||
// }
|
||||
|
||||
let dataSource_list = [];
|
||||
this.loanDetailsForm.controls['source'].value.forEach(element => {
|
||||
dataSource_list.push({sources: element})
|
||||
});
|
||||
records.source_group = dataSource_list;
|
||||
|
||||
|
||||
}
|
||||
if (this.loanDetailsForm.controls['is_topup'].value == 'yes') {
|
||||
records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value;
|
||||
}
|
||||
records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
|
||||
|
||||
if (this.loanDetailsForm.controls['is_topup'].value == 'yes' || this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
records.lender = this.loanDetailsForm.controls['lender'].value;
|
||||
}
|
||||
@ -430,7 +510,19 @@ getM_sourceofamount() {
|
||||
dataOwner_name.push({owner_name: element})
|
||||
});
|
||||
records.owner_name_group = dataOwner_name;
|
||||
records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
|
||||
|
||||
if(this.OtherOwnerFlag){
|
||||
records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
|
||||
}else{ records.other_owners_name = ''; }
|
||||
|
||||
if(this.isOtherSource){
|
||||
records.other_source = this.loanDetailsForm.controls['other_source'].value;
|
||||
}else{ records.other_source = ''; }
|
||||
|
||||
if(this.isPLSource){
|
||||
records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value;
|
||||
}else{ records.personal_loan_source = ''; }
|
||||
|
||||
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
|
||||
records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value;
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
@ -510,6 +602,12 @@ getM_sourceofamount() {
|
||||
case 5 :
|
||||
this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 6 :
|
||||
this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 7:
|
||||
this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user