new changes : ps
This commit is contained in:
parent
2f655a8b3b
commit
8f0949bd4a
@ -127,7 +127,8 @@
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 96%">
|
||||
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" formControlName="addressline1" oninput="this.value = this.value.toUpperCase()"></textarea>
|
||||
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" formControlName="addressline1" style="text-transform: uppercase"></textarea>
|
||||
<!-- oninput="this.value = this.value.toUpperCase()" -->
|
||||
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
@ -2,444 +2,326 @@
|
||||
<form class="address" [formGroup]="addressForm">
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
|
||||
matTooltipPosition="right" mat-dialog-close>
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
|
||||
<mat-dialog-content>
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Questions">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<mat-card style="min-height: 550px;">
|
||||
<!-- <mat-card-title>Address Details</mat-card-title> -->
|
||||
<mat-card style="min-height: 550px;">
|
||||
<mat-card-content>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxLayout="row wrap">
|
||||
|
||||
<div fxFlex="50">
|
||||
|
||||
<mat-form-field style="width: 92%;">
|
||||
<!-- <input matInput placeholder="Name" formControlName="name_ans" type="text" required> -->
|
||||
<input matInput placeholder="Address" formControlName="address" oninput="this.value = this.value.toUpperCase()" required autocomplete="off">
|
||||
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 96%">
|
||||
<input matInput placeholder="Address" formControlName="address" oninput="this.value = this.value.toUpperCase()"
|
||||
required autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<mat-select placeholder="Address Type" formControlName="address_type" required (selectionChange)="selectedAddressType($event.source.triggerValue)" >
|
||||
<mat-option value="{{m_addressType.address_type_id}}"
|
||||
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<div fxFlex="100" fxLayout="nowrap">
|
||||
<mat-form-field style="width: 32%">
|
||||
<mat-select placeholder="State" formControlName="state"
|
||||
(selectionChange)="getcityList($event.target.value)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let SL of stateData" [value]="SL.state_id">{{SL.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 32%">
|
||||
<mat-select placeholder="City" formControlName="city">
|
||||
<mat-option> Select </mat-option>
|
||||
<mat-option *ngFor="let CL of cityData" [value]="CL.city_id">{{CL.city_name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 24%">
|
||||
<mat-select placeholder="Pincode" formControlName="pincode">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let PL of pincodeData" [value]="PL.pincode_id">{{PL.pincode}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 24%" *ngIf="addressForm.controls['pincode'].value == 1">
|
||||
<input matInput autocomplete="off" placeholder="Specify Pincode *"
|
||||
formControlName="pincode_others" (keypress)="keyPress($event)">
|
||||
<mat-error *ngIf="!addressForm.controls['pincode_others'].valid">Pincode
|
||||
Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['address_type'].value == 1" fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<input matInput placeholder="Specify Address Type *" formControlName="address_type_others" autocomplete="off" (change)="selectedAddressType($event.target.value)">
|
||||
<mat-error *ngIf="!addressForm.controls['address_type_others'].valid">Address Type Required</mat-error>
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 46%;">
|
||||
<mat-select placeholder="Address Type" formControlName="address_type"
|
||||
required (selectionChange)="selectedAddressType($event.source.triggerValue)">
|
||||
<mat-option>Select</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 style="width: 46%;" *ngIf="addressForm.controls['address_type'].value == 1">
|
||||
<input matInput placeholder="Specify Address Type *" formControlName="address_type_others"
|
||||
autocomplete="off" (change)="selectedAddressType($event.target.value)">
|
||||
<mat-error *ngIf="!addressForm.controls['address_type_others'].valid">Address Type Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<div fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 46%;">
|
||||
<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>Select</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 style="width: 46%;" *ngIf="addressForm.controls.locality.value == 1">
|
||||
<input matInput placeholder="Specify Locality *" formControlName="locality_others"
|
||||
autocomplete="off">
|
||||
<!-- autofocus -->
|
||||
<mat-error *ngIf="!addressForm.controls['locality_others'].valid">Locality Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 46%;" *ngIf="addressForm.controls.locality.value == 5">
|
||||
<input matInput placeholder="Specify the MixUse *" formControlName="locality_mixuse"
|
||||
autocomplete="off">
|
||||
<mat-error *ngIf="!addressForm.controls['locality_mixuse'].valid">MixUse
|
||||
Required</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 46%;">
|
||||
<mat-select placeholder="Approach to PD Location" formControlName="pd_location"
|
||||
required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="{{data.pd_location_approach_id}}" *ngFor="let data of locationdata">{{data.description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 46%;">
|
||||
<mat-select placeholder="Comment on Locality" formControlName="comment_locality"
|
||||
required>
|
||||
<mat-option>Select</mat-option>
|
||||
<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="100" fxLayout="nowrap">
|
||||
<mat-form-field style="width: 46%;">
|
||||
<input matInput [placeholder]="placeholderName" formControlName="estimated_area"
|
||||
(keypress)="keyPress($event)">
|
||||
</mat-form-field>
|
||||
|
||||
<div *ngIf="addressForm.controls.locality.value == 1" fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<input matInput placeholder="Specify Locality *" formControlName="locality_others" autocomplete="off">
|
||||
<!-- autofocus -->
|
||||
<mat-error *ngIf="!addressForm.controls['locality_others'].valid">Locality Required</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls.locality.value == 5" fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<input matInput placeholder="Specify the MixUse *"
|
||||
formControlName="locality_mixuse" autocomplete="off">
|
||||
<mat-error *ngIf="!addressForm.controls['locality_mixuse'].valid">MixUse Required</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<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="50">
|
||||
<mat-form-field style="width: 92%;">
|
||||
<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 *ngIf="addressForm.controls['comment_locality'].value == 1 " fxFlex="33">
|
||||
<mat-form-field style="width: 85%;">
|
||||
<input matInput placeholder="Specify Comment on Locality *" formControlName="other_comment_locality" autocomplete="off">
|
||||
<mat-error *ngIf="!addressForm.controls['other_comment_locality'].valid">Comment on Locality Required</mat-error>
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
|
||||
<!-- <div fxFlex="33">
|
||||
<mat-form-field style="width: 85%;">
|
||||
<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: 85%;">
|
||||
<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: 85%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWordsForRent($event)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="addressForm.controls['rent_amt'].value != ''">{{"₹"}} {{rentAmtInwords}} Only</mat-hint>
|
||||
</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" (keypress)="keyPress($event)">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="68">
|
||||
<mat-form-field style="width: 95%;">
|
||||
<mat-select [placeholder]="placeholderName"
|
||||
formControlName="other_premises_bussiness_activity" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="32">
|
||||
<mat-form-field *ngIf="addressForm.controls['other_premises_bussiness_activity'].value != ''" style="width: 85%;">
|
||||
<input matInput autocomplete="off" placeholder="Remark" formControlName="bussiness_activity_remark">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 95%;">
|
||||
<!--placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"--
|
||||
<mat-select placeholder="Are 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-form-field style="width: 46%;">
|
||||
<mat-select placeholder="Unit of Mearsurement" formControlName="uom">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<mat-form-field style="width: 24%;" *ngIf="addressForm.controls['uom'].value == 1 ">
|
||||
<input matInput placeholder="Specify UOM *" formControlName="uom_others"
|
||||
autocomplete="off">
|
||||
<mat-error *ngIf="!addressForm.controls['uom_others'].valid">UOM
|
||||
Required</mat-error>
|
||||
</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 )
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Customer Behaviour"
|
||||
formControlName="customer_behaviour" required>
|
||||
<mat-option value="{{data.customer_behaviour_id}}"
|
||||
*ngFor="let data of customerData">{{data.description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>--(Customer Behaviour)-->
|
||||
|
||||
|
||||
<!-- <mat-card *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
|
||||
|
||||
<div formArrayName="additional_address_units">
|
||||
<div *ngFor="let item of addressForm.controls.additional_address_units['controls']; let i=index let last=last" >
|
||||
<mat-card-header><p>Additional Unit #{{i+1}}</p></mat-card-header>
|
||||
<mat-card-content class="matcard" [formGroup]="item">
|
||||
|
||||
<mat-form-field style="width: 42%">
|
||||
<mat-select placeholder="Type of Premises" formControlName="premises_type" (selectionChange)="setRequiredValidation($event.value,item)">
|
||||
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('premises_type').value == 1" style="width: 42%">
|
||||
<input matInput placeholder="Specify Premises Type *" formControlName="premises_type_others" autocomplete="off">
|
||||
<mat-error>Premises Type Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 42%;">
|
||||
<input matInput placeholder="Number Of Additional Units"
|
||||
formControlName="no_of_additional_units" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 42%;">
|
||||
|
||||
<input matInput placeholder="Location/City"
|
||||
formControlName="premises_city" autocomplete="off">
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field style="width: 40%;">
|
||||
<mat-select placeholder="Ownership" formControlName="premises_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['premises_ownership'].value == 4 "> -->
|
||||
<!-- <mat-form-field *ngIf="item.get('premises_ownership').value == 4" style="width: 40%;">
|
||||
<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" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('premises_rent_amt').value != ''">{{"₹"}} {{premisesRentAmtInwords[i]}} Only</mat-hint>
|
||||
</mat-form-field> -->
|
||||
<!----<mat-form-field style="width: 88%">
|
||||
<input matInput placeholder="Remarks"
|
||||
formControlName="premises_remarks" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<div align="center">
|
||||
<button type="button" mat-flat-button (click)="addUnits($event)"
|
||||
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
|
||||
<strong>Add More Additional Unit </strong>
|
||||
</button>
|
||||
</div>
|
||||
<!-- <button type="button" mat-flat-button (click)="removeUnits(i)"
|
||||
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
|
||||
<strong>Delete Additional Unit </strong>
|
||||
</button> -->
|
||||
<!---- <div align="right">
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="removeUnits(i)"
|
||||
matTooltip="Delete Additional Unit" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</mat-card-actions>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>-->
|
||||
|
||||
<!--- Don't Remove To replace atlast of the PD Completion and creating new form (Neighbourhood check) --
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Neighbourhood</p>
|
||||
</mat-card-header>
|
||||
<div formArrayName="neighbourhood">
|
||||
<div *ngFor="let item of addressForm.controls.neighbourhood['controls']; let i=index" >
|
||||
<mat-card-content class="matcard" [formGroup]="item">
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Neighbour Name"
|
||||
formControlName="name" required>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Do you know"
|
||||
formControlName="do_you_know" required>
|
||||
<mat-option value="{{m_neighbourStatus}}"
|
||||
*ngFor="let m_neighbourStatus of neighbourStatusData">{{m_neighbourStatus}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Is the applicant owner"
|
||||
formControlName="is_owner" required>
|
||||
|
||||
<mat-option value="{{m_applicantOwner}}"
|
||||
*ngFor="let m_applicantOwner of applicantOwnerData">{{m_applicantOwner}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- <mat-form-field>
|
||||
<input matInput placeholder="How long do you know the applicant"
|
||||
formControlName="how_long">
|
||||
</mat-form-field> ->-
|
||||
<div>
|
||||
<label>How long do you know the applicant?</label>
|
||||
<br>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Year" formControlName="how_long_year" required min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Month" formControlName="how_long_month" required min='0' max='12'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
<button type="button" matTooltip="Add More Neighbour Details" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i==0"
|
||||
(click)="addNeighbour($event)"
|
||||
color="primary" style="float: right;">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i>0"
|
||||
(click)="removeNeighbour(i)"
|
||||
style="float: right;">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
End of Neighbourhood Check-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
|
||||
<mat-tab label="Docs">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap" style="padding:20px;">
|
||||
<div fxFlex="100">
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
|
||||
<mat-tab label="Docs">
|
||||
<ng-template matTabContent>
|
||||
<div fxLayout="row wrap" style="padding:20px;">
|
||||
<div fxFlex="100">
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="row">
|
||||
<div fxFlex="100" class="m-gap p-gap">
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
|
||||
</mat-tab-group>
|
||||
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20" class="m-gap p-gap">
|
||||
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
|
||||
<div class="p-list">
|
||||
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="row">
|
||||
<div fxFlex="100" class="m-gap p-gap">
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25"
|
||||
fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25"
|
||||
fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25"
|
||||
fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25"
|
||||
fxFlex.lg="25" fxFlex.xl="25">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20"
|
||||
fxFlex.lg="20" fxFlex.xl="20">
|
||||
<a href="http://www.google.com">
|
||||
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon>
|
||||
<span class="d-block">version_111</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
|
||||
</mat-tab-group>
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<mat-form-field appearance="outline" style="width: 100%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput placeholder="Remarks" formControlName="address_form_remark"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<mat-form-field appearance="outline" style="width: 100%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput placeholder="Remarks" formControlName="address_form_remark"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above"><mat-icon>save</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" (click)="onSubmit()"><mat-icon>save</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above"
|
||||
type="submit" (click)="onSubmit()">
|
||||
<mat-icon>save</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
|
||||
|
||||
</form>
|
||||
<notifier-container></notifier-container>
|
||||
@ -1,428 +1,299 @@
|
||||
import {
|
||||
Component,OnInit,
|
||||
Inject, Output,
|
||||
Input, ElementRef, ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, Inject, Output, Input, ElementRef, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import {
|
||||
FormBuilder, FormGroup,
|
||||
Validators,
|
||||
FormArray, FormControl, AbstractControl,
|
||||
} from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, Validators, FormArray, FormControl, AbstractControl } from '@angular/forms';
|
||||
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA
|
||||
} from '@angular/material';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-address',
|
||||
templateUrl: './address.component.html',
|
||||
styleUrls: ['./address.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
||||
})
|
||||
|
||||
export class AddressComponent implements OnInit {
|
||||
|
||||
/**Declaration of Header Variables */
|
||||
customer_segment_abbr: any;
|
||||
subproduct_abbr: any;
|
||||
lender_applicant_id: any;
|
||||
main_applicant: any;
|
||||
|
||||
pageTitle: string ="PD Address Details";
|
||||
|
||||
pageTitle: string = "PD Address Details";
|
||||
|
||||
/**Declaration of FormField Variables */
|
||||
//@Input() pdid: number;
|
||||
pdid : number;
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
pdAddress: string;
|
||||
pdState: any;
|
||||
pdCity: any;
|
||||
pdPincode: any;
|
||||
pdOtherPincode: any;
|
||||
CustSegAbbr: any;
|
||||
loadDataStatus: boolean=true;
|
||||
|
||||
// PremisesOtherFlag:boolean;
|
||||
// PremisesLabel : any = [];
|
||||
|
||||
loadDataStatus: boolean = true;
|
||||
placeholderName: any = 'Estimated area of the (Address Type)';
|
||||
|
||||
/**Array declaration Of Dropdown */
|
||||
locationdata: any = [];
|
||||
commentData: any = [];
|
||||
//customerData: any = []; 221118 review doc s.no 3.e
|
||||
addressData:any = [];
|
||||
localityData:any = [];
|
||||
// ownerShipData:any = [];
|
||||
// cityData:any = [];
|
||||
|
||||
// z = 0;
|
||||
addressData: any = [];
|
||||
localityData: any = [];
|
||||
stateData: any = [];
|
||||
pincodeData: any = [];
|
||||
cityData: any = [];
|
||||
uomData: any = [];
|
||||
|
||||
// formPremisesArray: any = [];
|
||||
// formPremisesCityArray: any = [];
|
||||
// additional_premises: any=[];
|
||||
// bussiness_address_type: any=[];
|
||||
// premisesRentAmtInwords:any=[];
|
||||
// rentAmtInwords:any;
|
||||
// tempArr: any[];
|
||||
placeholderName : any = 'Was any business activity seen at the Address Type during PD visit?';
|
||||
//neighbourStatusData:any=["Yes","No"];
|
||||
//applicantOwnerData:any=["Yes","No","Dont Know"];
|
||||
|
||||
// public currentLoanForm: FormGroup;
|
||||
/**Declaration of FormField Variables */
|
||||
private notifier: NotifierService;
|
||||
public addressForm: FormGroup;
|
||||
|
||||
public address: AbstractControl;
|
||||
public addressType: AbstractControl;
|
||||
public state: AbstractControl;
|
||||
public city: AbstractControl;
|
||||
public pincode: AbstractControl;
|
||||
public locality: AbstractControl;
|
||||
public pdLocation: AbstractControl;
|
||||
public commentLocality: AbstractControl;
|
||||
// public otherCommentLocality: AbstractControl;
|
||||
// public customerBehaviour: AbstractControl;
|
||||
// public ownership: AbstractControl;
|
||||
// public other_ownership: AbstractControl;
|
||||
// public rent_amt : AbstractControl;
|
||||
// public other_premises_bussiness_activity : AbstractControl;
|
||||
// public bussiness_activity_remark: AbstractControl;
|
||||
// public bussinessActivity: AbstractControl;
|
||||
// public business_years: AbstractControl;
|
||||
// public business_month: AbstractControl;
|
||||
//constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) {
|
||||
constructor(private el: ElementRef, notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
private dialogRef: MatDialogRef<AddressComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any)
|
||||
{
|
||||
// console.log(this.pd_all_details);
|
||||
public estArea: AbstractControl;
|
||||
public uom: AbstractControl;
|
||||
|
||||
/**Constructor of the class */
|
||||
constructor(private el: ElementRef, notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
private dialogRef: MatDialogRef<AddressComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 5;
|
||||
//commented
|
||||
|
||||
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
// console.log(this.pd_all_details.template_forms.form_id);
|
||||
// console.log(this.pd_all_details.pdmaster_details.customer_segment_abbr);
|
||||
console.log('this.pd_all_details',this.pd_all_details);
|
||||
|
||||
let CSAbbrSearch = this.pd_all_details.pdmaster_details.customer_segment_abbr.search("-");
|
||||
this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0,CSAbbrSearch);
|
||||
|
||||
this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0, CSAbbrSearch);
|
||||
|
||||
this.notifier = notifier;
|
||||
this.pdAddress = this.pd_all_details.pdmaster_details.addressline1;
|
||||
this.pdState = this.pd_all_details.pdmaster_details.fk_state;
|
||||
this.getCityAndPincodeDetails(this.pdState);
|
||||
this.pdCity = this.pd_all_details.pdmaster_details.fk_city;
|
||||
this.pdPincode = this.pd_all_details.pdmaster_details.pincode_id;
|
||||
console.log('this.pdPincode', this.pdPincode);
|
||||
this.pdOtherPincode = this.pdPincode == 1 ? this.pd_all_details.pdmaster_details.other_pincode : '';
|
||||
console.log('this.pdOtherPincode', this.pdOtherPincode);
|
||||
|
||||
}
|
||||
|
||||
/**Init Fns of the class */
|
||||
ngOnInit() {
|
||||
// console.clear();
|
||||
// console.log('this.address',this.pdAddress);
|
||||
this.getMasterDetails('PDLOCATIONAPPROACH',1);
|
||||
this.getMasterDetails('COMMENTSONLOCALITY',2);
|
||||
//this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
|
||||
this.getMasterDetails('LOCALITY',4);
|
||||
// this.getMasterDetails('ADDRESSTYPE',5);
|
||||
this.getMasterDetails('RESIDENCEOWNERSHIP',6);
|
||||
this.getMasterDetails('CITY',7);
|
||||
|
||||
this.getM_Address_Type();
|
||||
this.getMasterDetails('PDLOCATIONAPPROACH', 1);
|
||||
this.getMasterDetails('COMMENTSONLOCALITY', 2);
|
||||
this.getMasterDetails('UOM', 3);
|
||||
this.getMasterDetails('LOCALITY', 4);
|
||||
this.getMasterDetails('ADDRESSTYPE', 5);
|
||||
this.getMasterDetails('STATE', 6);
|
||||
|
||||
this.initAddressForm();
|
||||
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = '5';
|
||||
|
||||
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
// console.log('data', data);
|
||||
//const control = <FormArray>this.addressForm.controls['neighbourhood'];
|
||||
// const control = <FormArray>this.addressForm.controls['additional_address_units'];
|
||||
//const additionalPremisesControl = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
if(data.status == 200) {
|
||||
|
||||
|
||||
this.addressForm.controls.address.setValue(data.records.address);
|
||||
this.addressForm.controls.pd_location.setValue(data.records.pd_location);
|
||||
this.addressForm.controls.address_type.setValue(data.records.address_type);
|
||||
let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type)[0];
|
||||
this.selectedAddressType(selectedAddressType.address_type);
|
||||
if (data.status == 200) {
|
||||
|
||||
if(data.records.address_type == 1) {
|
||||
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
|
||||
this.addressForm.controls.address_type_others.setValidators([Validators.required]);
|
||||
this.addressForm.controls.address_type_others.updateValueAndValidity();
|
||||
this.selectedAddressType(data.records.address_type_others);
|
||||
}
|
||||
|
||||
this.addressForm.controls.address.setValue(data.records.address);
|
||||
this.addressForm.controls.state.setValue(data.records.state);
|
||||
|
||||
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
|
||||
if (data.records.state != '') {
|
||||
this.getCityAndPincodeDetails(data.records.state);
|
||||
this.addressForm.controls.city.setValue(data.records.city);
|
||||
this.addressForm.controls.pincode.setValue(data.records.pincode);
|
||||
if (data.records.pincode == 1) {
|
||||
this.addressForm.controls.pincode_others.setValue(data.records.pincode_others);
|
||||
this.addressForm.controls.pincode_others.setValidators([Validators.required]);
|
||||
this.addressForm.controls.pincode_others.updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
|
||||
// if(data.records.comment_locality == 1){
|
||||
// this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality);
|
||||
// // this.addressForm.controls.other_comment_locality.setValidators([Validators.required]);
|
||||
// // this.addressForm.controls.other_comment_locality.updateValueAndValidity();
|
||||
// }
|
||||
// this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
|
||||
this.addressForm.controls.locality.setValue(data.records.locality);
|
||||
this.addressForm.controls.pd_location.setValue(data.records.pd_location);
|
||||
this.addressForm.controls.address_type.setValue(data.records.address_type);
|
||||
|
||||
if(data.records.locality == 1 ){
|
||||
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
||||
this.addressForm.controls.locality_others.setValidators([Validators.required]);
|
||||
this.addressForm.controls.locality_others.updateValueAndValidity();
|
||||
}
|
||||
if(data.records.locality == 5){
|
||||
this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse);
|
||||
this.addressForm.controls.locality_mixuse.setValidators([Validators.required])
|
||||
this.addressForm.controls.locality_mixuse.updateValueAndValidity();
|
||||
}
|
||||
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
|
||||
let selectedAddressType = this.addressData.filter(element => element.address_type_id == data.records.address_type)[0];
|
||||
this.selectedAddressType(selectedAddressType.address_type);
|
||||
|
||||
// this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity);
|
||||
// if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) {
|
||||
// this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark);
|
||||
// }
|
||||
// else{
|
||||
// this.addressForm.controls.bussiness_activity_remark.setValue('');
|
||||
// }
|
||||
// this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
|
||||
if (data.records.address_type == 1) {
|
||||
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
|
||||
this.addressForm.controls.address_type_others.setValidators([Validators.required]);
|
||||
this.addressForm.controls.address_type_others.updateValueAndValidity();
|
||||
this.selectedAddressType(data.records.address_type_others);
|
||||
}
|
||||
|
||||
// this.addressForm.controls.business_years.setValue(data.records.business_years);
|
||||
// this.addressForm.controls.business_month.setValue(data.records.business_month);
|
||||
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
|
||||
|
||||
// if(data.records.bussiness_activity == 'yes') {
|
||||
// // const control = <FormArray>this.addressForm.controls['additional_address_units'];
|
||||
|
||||
// var resultOfUnits = Object.keys(data.records.additional_address_units).map(function (key) {
|
||||
// return data.records.additional_address_units[key];
|
||||
// });
|
||||
// //console.log(resultOfUnits);
|
||||
this.addressForm.controls.locality.setValue(data.records.locality);
|
||||
|
||||
// if (resultOfUnits.length == 0) {
|
||||
// control.push(this.createUnits());
|
||||
// } else {
|
||||
// resultOfUnits.forEach((datas,index) => {
|
||||
// // this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(datas.premises_rent_amt);
|
||||
// if(datas.premises_type == 1){
|
||||
// // control.controls[index].premises_type_others.clearValidators();
|
||||
// // control.controls[index].premises_type_others.updateValueAndValidity();
|
||||
// }
|
||||
|
||||
// control.push(this.createUnits());
|
||||
// });
|
||||
// this.addressForm.controls.additional_address_units.setValue(resultOfUnits);
|
||||
// }
|
||||
|
||||
// }
|
||||
if (data.records.locality == 1) {
|
||||
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
||||
this.addressForm.controls.locality_others.setValidators([Validators.required]);
|
||||
this.addressForm.controls.locality_others.updateValueAndValidity();
|
||||
}
|
||||
if (data.records.locality == 5) {
|
||||
this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse);
|
||||
this.addressForm.controls.locality_mixuse.setValidators([Validators.required])
|
||||
this.addressForm.controls.locality_mixuse.updateValueAndValidity();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//control.push(this.createNeighbour());
|
||||
// control.push(this.createUnits());
|
||||
}
|
||||
this.addressForm.controls.estimated_area.setValue(data.records.estimated_area);
|
||||
this.addressForm.controls.uom.setValue(data.records.uom);
|
||||
if (data.records.uom == 1) {
|
||||
this.addressForm.controls.uom_others.setValue(data.records.uom_others);
|
||||
this.addressForm.controls.uom_others.setValidators([Validators.required])
|
||||
this.addressForm.controls.uom_others.updateValueAndValidity();
|
||||
}
|
||||
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getM_Address_Type() {
|
||||
this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe(
|
||||
data => {
|
||||
this.addressData = data.records.filter(data => data.isactive == 1);
|
||||
// console.log(this.addressData);
|
||||
// if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
|
||||
|
||||
// // console.log('whole',FilteredAddressType);
|
||||
// let index1 = this.addressData.map(data => data.address_type).indexOf("Residence");
|
||||
// this.addressData.splice(index1, 1);
|
||||
// // console.log('FirstOne',FilteredAddressType);
|
||||
// let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office");
|
||||
// this.addressData.splice(index2, 1);
|
||||
// // console.log('SecondOne',FilteredAddressType);
|
||||
// }
|
||||
// console.log(this.addressData);
|
||||
})
|
||||
}
|
||||
// getM_Address_Type() {
|
||||
// this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe(
|
||||
// data => {
|
||||
// this.addressData = data.records.filter(data => data.isactive == 1);
|
||||
// if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
|
||||
// let index1 = this.addressData.map(data => data.address_type).indexOf("Residence");
|
||||
// this.addressData.splice(index1, 1);
|
||||
// let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office");
|
||||
// this.addressData.splice(index2, 1);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
/** Address Form ELements */
|
||||
public initAddressForm(): void {
|
||||
this.addressForm = this.fb.group({
|
||||
address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])],
|
||||
address: [this.pdAddress != '' ? this.pdAddress : '', Validators.compose([Validators.required])],
|
||||
address_type: ['', Validators.compose([Validators.required])],
|
||||
address_type_others: [''],
|
||||
state: [this.pdState != '' ? this.pdState : ''],
|
||||
city: [this.pdCity != '' ? this.pdCity : ''],
|
||||
pincode: [this.pdPincode != '' ? this.pdPincode : ''],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
|
||||
pincode_others: [this.pdOtherPincode != '' ? this.pdOtherPincode : '', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
|
||||
locality: ['', Validators.compose([Validators.required])],
|
||||
locality_others: [''],
|
||||
locality_mixuse:[''],
|
||||
locality_mixuse: [''],
|
||||
pd_location: ['', Validators.compose([Validators.required])],
|
||||
comment_locality: ['', Validators.compose([Validators.required])],
|
||||
// other_comment_locality : [''],
|
||||
//customer_behaviour: ['', Validators.compose([Validators.required])],
|
||||
//neighbourhood: this.fb.array([]),
|
||||
// additional_address_units: this.fb.array([]),
|
||||
address_form_remark:[''],
|
||||
// address_ownership:[''],
|
||||
// other_ownership:[''],
|
||||
// rent_amt:[''],
|
||||
// other_premises_bussiness_activity : [''],
|
||||
// bussiness_activity_remark:[''],
|
||||
// bussiness_activity:[''],
|
||||
// business_years:[''],
|
||||
// business_month:[''],
|
||||
// bussiness_address_type:[''],
|
||||
// bussiness_address_type_others: [''],
|
||||
estimated_area: [''],
|
||||
uom: [''],
|
||||
uom_others: [''],
|
||||
address_form_remark: ['']
|
||||
//additional_premises: this.fb.array([])
|
||||
});
|
||||
this.address = this.addressForm.controls['address'];
|
||||
this.state = this.addressForm.controls['state'];
|
||||
this.city = this.addressForm.controls['city'];
|
||||
this.pincode = this.addressForm.controls['pincode'];
|
||||
this.addressType = this.addressForm.controls['address_type'];
|
||||
this.locality = this.addressForm.controls['locality'];
|
||||
this.pdLocation = this.addressForm.controls['pd_location'];
|
||||
this.commentLocality = this.addressForm.controls['comment_locality'];
|
||||
// this.otherCommentLocality = this.addressForm.controls['other_comment_locality'];
|
||||
//this.customerBehaviour = this.addressForm.controls['customer_behaviour'];
|
||||
// this.ownership = this.addressForm.controls['address_ownership'];
|
||||
// this.other_ownership = this.addressForm.controls['other_ownership'];
|
||||
// this.rent_amt = this.addressForm.controls['rent_amt'];
|
||||
// this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'],
|
||||
// this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'],
|
||||
// this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
|
||||
// this.business_years = this.addressForm.controls['business_years'];
|
||||
// this.business_month = this.addressForm.controls['business_month'];
|
||||
// this.bussiessAddressType = this.addressForm.controls['bussiness_address_type'];
|
||||
this.estArea = this.addressForm.controls['estimated_area'];
|
||||
this.uom = this.addressForm.controls['uom'];
|
||||
}
|
||||
// createNeighbour(): FormGroup {
|
||||
// return this.fb.group({
|
||||
// name: ['', Validators.compose([Validators.required])],
|
||||
// do_you_know: ['', Validators.compose([Validators.required])],
|
||||
// how_long_year: ['', Validators.compose([Validators.required])],
|
||||
// how_long_month: ['', Validators.compose([Validators.required])],
|
||||
// is_owner: ['', Validators.compose([Validators.required])],
|
||||
// });
|
||||
// }
|
||||
// createUnits(): FormGroup {
|
||||
// return this.fb.group({
|
||||
// no_of_additional_units: [''],
|
||||
// premises_type: [''],
|
||||
// premises_type_others: [''],
|
||||
// premises_city: [''],
|
||||
// // premises_ownership: [''],
|
||||
// // premises_ownership_others: [''],
|
||||
// // premises_rent_amt:[''],
|
||||
// premises_remarks: [''],
|
||||
// });
|
||||
// }
|
||||
// createPremises(): FormGroup {
|
||||
// return this.fb.group({
|
||||
// no_of_additional_units: [''],
|
||||
// premises_city: [''],
|
||||
// premises_remarks: [''],
|
||||
// premises_ownership: [''],
|
||||
// premises_ownership_others: [''],
|
||||
// premises_rent_amt:[''],
|
||||
// });
|
||||
// }
|
||||
getMasterDetails(table:string,type:number){
|
||||
|
||||
|
||||
/** To Get Dropdown Data For Address Form */
|
||||
getMasterDetails(table: string, type: number) {
|
||||
this._pd.getAllMasterDatas(table).subscribe(data => {
|
||||
data.records.forEach(val => {
|
||||
if (type==1 && val.isactive == 1) {
|
||||
if (type == 1 && val.isactive == 1) {
|
||||
this.locationdata.push(val);
|
||||
}
|
||||
else if(type==2 && val.isactive == 1){
|
||||
else if (type == 2 && val.isactive == 1) {
|
||||
this.commentData.push(val);
|
||||
}
|
||||
/* else if(type==3 && val.isactive == 1){
|
||||
this.customerData.push(val);
|
||||
} //221118 review doc s.no 3.e */
|
||||
else if(type==4 && val.isactive == 1){
|
||||
else if (type == 3 && val.isactive == 1) {
|
||||
this.uomData.push(val);
|
||||
}
|
||||
else if (type == 4 && val.isactive == 1) {
|
||||
this.localityData.push(val);
|
||||
}
|
||||
// else if(type==5 && val.isactive == 1){
|
||||
// this.addressData.push(val);
|
||||
// if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
|
||||
// // console.log(this.CustSegAbbr);
|
||||
// // console.log('inside if',this.addressData);
|
||||
// this.addressData.indexOf("Residence")
|
||||
// this.addressData.indexOf("Residence cum Office")
|
||||
// // console.log('inside if 2',this.addressData);
|
||||
// }
|
||||
// }
|
||||
// else if(type==6 && val.isactive == 1){
|
||||
// this.ownerShipData.push(val);
|
||||
// }
|
||||
// else if(type==7 && val.isactive == 1){
|
||||
// this.cityData.push(val);
|
||||
// }
|
||||
else if (type == 5 && val.isactive == 1) {
|
||||
this.addressData.push(val);
|
||||
}
|
||||
else if (type == 6 && val.isactive == 1) {
|
||||
this.stateData.push(val);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
/*221118 review doc s.no 3.f
|
||||
addNeighbour() {
|
||||
const control = <FormArray>this.addressForm.controls['neighbourhood'];
|
||||
if (control.length <= 1) {
|
||||
control.push(this.createNeighbour());
|
||||
}
|
||||
|
||||
/** To Get City And Pincode Data For Address Form
|
||||
* Param 'stateID' -> selected StateId
|
||||
*/
|
||||
getCityAndPincodeDetails(stateID: string) {
|
||||
this._pd.getStateWiseCities(stateID).subscribe(data => {
|
||||
if (data.status == 200) {
|
||||
this.cityData = data.records.cities;
|
||||
this.pincodeData = data.records.pincode;
|
||||
}
|
||||
});
|
||||
}
|
||||
removeNeighbour(index) {
|
||||
const control = <FormArray>this.addressForm.controls['neighbourhood'];
|
||||
control.removeAt(index);
|
||||
}*/
|
||||
|
||||
// setRequiredValidation(value,item) {
|
||||
// console.log(item);
|
||||
// console.log(value);
|
||||
// value==1
|
||||
// ? item.controls.premises_type_others.setValidators([Validators.required])
|
||||
// : item.controls.premises_type_others.clearValidators();
|
||||
// item.controls.premises_type_others.updateValueAndValidity();
|
||||
// }
|
||||
|
||||
// addUnits() {
|
||||
// const control = <FormArray>this.addressForm.controls['additional_address_units'];
|
||||
// control.push(this.createUnits());
|
||||
// }
|
||||
|
||||
// removeUnits(index) {
|
||||
// const control = <FormArray>this.addressForm.controls['additional_address_units'];
|
||||
// control.removeAt(index);
|
||||
// }
|
||||
|
||||
/** TO Save Address Forms Details*/
|
||||
onSubmit() {
|
||||
// Partnr.controls[key].addControl('partner_other_name', new FormControl('', Validators.required))
|
||||
|
||||
this.addressForm.controls.address_type.value == 1
|
||||
|
||||
this.addressForm.controls.address_type.value == 1
|
||||
? this.addressForm.controls['address_type_others'].setValidators([Validators.required])
|
||||
: this.addressForm.controls['address_type_others'].clearValidators();
|
||||
this.addressForm.controls['address_type_others'].updateValueAndValidity();
|
||||
|
||||
this.addressForm.controls.locality.value == 1
|
||||
this.addressForm.controls['address_type_others'].updateValueAndValidity();
|
||||
|
||||
this.addressForm.controls.locality.value == 1
|
||||
? this.addressForm.controls['locality_others'].setValidators([Validators.required])
|
||||
: this.addressForm.controls['locality_others'].clearValidators();
|
||||
this.addressForm.controls['locality_others'].updateValueAndValidity();
|
||||
this.addressForm.controls['locality_others'].updateValueAndValidity();
|
||||
|
||||
this.addressForm.controls.locality.value == 5
|
||||
this.addressForm.controls.pincode.value == 1
|
||||
? this.addressForm.controls['pincode_others'].setValidators([Validators.required])
|
||||
: this.addressForm.controls['pincode_others'].clearValidators();
|
||||
this.addressForm.controls['pincode_others'].updateValueAndValidity();
|
||||
|
||||
this.addressForm.controls.locality.value == 5
|
||||
? this.addressForm.controls['locality_mixuse'].setValidators([Validators.required])
|
||||
: this.addressForm.controls['locality_mixuse'].clearValidators();
|
||||
this.addressForm.controls['locality_mixuse'].updateValueAndValidity();
|
||||
|
||||
|
||||
this.addressForm.controls['locality_mixuse'].updateValueAndValidity();
|
||||
|
||||
this.addressForm.controls.uom.value == 1
|
||||
? this.addressForm.controls['uom_others'].setValidators([Validators.required])
|
||||
: this.addressForm.controls['uom_others'].clearValidators();
|
||||
this.addressForm.controls['uom_others'].updateValueAndValidity();
|
||||
|
||||
if (!this.addressForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
// console.log(this.addressForm.controls.bussiness_activity_remark.value);
|
||||
// console.log(this.address.value.bussiness_activity_remark);
|
||||
|
||||
// if(this.address.value.bussiness_activity_remark == ''){
|
||||
// this.notifier.notify('warning', 'Fill Remark!');
|
||||
// return;
|
||||
@ -430,102 +301,104 @@ export class AddressComponent implements OnInit {
|
||||
|
||||
let records: any = {};
|
||||
records.address = this.address.value;
|
||||
records.state = this.state.value;
|
||||
records.city = this.city.value;
|
||||
records.address_type = this.addressType.value;
|
||||
if (this.addressType.value == 1) {
|
||||
records.address_type_others = this.addressForm.controls.address_type_others.value;
|
||||
}
|
||||
|
||||
records.address_type_others = this.addressType.value == 1 ?
|
||||
this.addressForm.controls.address_type_others.value : '';
|
||||
|
||||
records.locality = this.locality.value;
|
||||
if (this.locality.value == 1) {
|
||||
records.locality_others = this.addressForm.controls.locality_others.value;
|
||||
}
|
||||
if(this.locality.value == 5){
|
||||
records.locality_mixuse = this.addressForm.controls.locality_mixuse.value;
|
||||
}
|
||||
records.locality_others = this.locality.value == 1 ?
|
||||
this.addressForm.controls.locality_others.value : '';
|
||||
|
||||
records.locality_mixuse = this.locality.value == 5 ?
|
||||
this.addressForm.controls.locality_mixuse.value : '';
|
||||
|
||||
records.pincode = this.pincode.value;
|
||||
records.pincode_others = this.pincode.value == 1 ?
|
||||
this.addressForm.controls.pincode_others.value : '';
|
||||
|
||||
records.pd_location = this.pdLocation.value;
|
||||
records.comment_locality = this.commentLocality.value;
|
||||
// records.other_comment_locality = this.otherCommentLocality.value;
|
||||
//records.customer_behaviour = this.commentlocality.value;
|
||||
//records.neighbourhood = this.addressForm.controls.neighbourhood.value;
|
||||
|
||||
records.address_form_remark = this.addressForm.controls.address_form_remark.value;
|
||||
// records.address_ownership = this.ownership.value;
|
||||
// records.other_ownership = this.other_ownership.value;
|
||||
// records.rent_amt = this.rent_amt.value;
|
||||
// records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value;
|
||||
// records.bussiness_activity_remark = this.bussiness_activity_remark.value;
|
||||
// records.bussiness_activity = this.bussinessActivity.value;
|
||||
// records.business_years = this.business_years.value;
|
||||
// records.business_month = this.business_month.value;
|
||||
|
||||
// if (this.bussinessActivity.value == 'yes') {
|
||||
// records.additional_address_units = this.addressForm.controls.additional_address_units.value;
|
||||
// }
|
||||
records.address_form_remark = this.addressForm.controls.address_form_remark.value;
|
||||
records.estimated_area = this.estArea.value;
|
||||
|
||||
records.uom = this.uom.value;
|
||||
records.uom_others = records.uom == 1 ?
|
||||
this.addressForm.controls.uom_others.value : '';
|
||||
|
||||
records.pdid = this.pdid;
|
||||
records.formid = '5';
|
||||
// records.fk_createdby = '250';
|
||||
|
||||
|
||||
// console.log(JSON.stringify(records));
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
if(data.status == 200) {
|
||||
if (data.status == 200) {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() =>{
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
},3000);
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
|
||||
selectedAddressType(e: any){
|
||||
this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?';
|
||||
/** For PlaceHolder
|
||||
* selected AddressType is concate with label */
|
||||
selectedAddressType(e: any) {
|
||||
console.log(e);
|
||||
this.placeholderName = 'Estimated area of the ' + e;
|
||||
}
|
||||
|
||||
|
||||
/** To validate All Form Fields */
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
control.markAsTouched({onlySelf: true});
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ConvertMonthintoYear(e){
|
||||
|
||||
// let business_year = this.addressForm.controls.business_years.value;
|
||||
/** On Key Press Event For Numbers */
|
||||
keyPress(event: any) {
|
||||
const pattern = /[0-9]/;
|
||||
|
||||
// let converted_month : number = e%12;
|
||||
// let converted_year : number = e/12;
|
||||
let inputChar = String.fromCharCode(event.charCode);
|
||||
if (event.keyCode != 8 && !pattern.test(inputChar)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
// this.addressForm.controls.business_years.setValue(+business_year + +Math.floor(converted_year));
|
||||
// this.addressForm.controls.business_month.setValue(Math.floor(converted_month));
|
||||
|
||||
// }
|
||||
/** On Key Press Event For Numbers */
|
||||
// keyPress(event: any) {
|
||||
// const pattern = /[0-9]/;
|
||||
|
||||
// let inputChar = String.fromCharCode(event.charCode);
|
||||
// if (event.keyCode != 8 && !pattern.test(inputChar)) {
|
||||
// event.preventDefault();
|
||||
// }
|
||||
// }
|
||||
/** For DOCS Tab */
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
|
||||
// inWords(e,i){
|
||||
// this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
// }
|
||||
|
||||
// inWordsForRent(e){
|
||||
// this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value);
|
||||
// }
|
||||
}
|
||||
@ -29,6 +29,7 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type" formControlName="assets_mode" requried>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -42,6 +43,7 @@
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type" (selectionChange)="setRequiredValidation($event.value,detail,1)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -59,6 +61,7 @@
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Type of Vehicle" formControlName="vehicle_type" (selectionChange)="setRequiredValidation($event.value,detail,5)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let vehicle of m_vehicle_type" [value]="vehicle.vehicle_type_id">{{ vehicle.vehicle_type_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -135,6 +138,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode" (selectionChange)="setRequiredValidation($event.value,detail,2)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -167,6 +171,7 @@
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Type" formControlName="investments_type" (selectionChange)="setRequiredValidation($event.value,detail,3)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -209,19 +214,19 @@
|
||||
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
|
||||
<!-- <mat-form-field style="width:40%">
|
||||
<mat-form-field style="width:40%">
|
||||
<mat-select placeholder="Relation" formControlName="relation" >
|
||||
<mat-option value="{{relations.relationship_id}}"
|
||||
*ngFor="let relations of m_relation">
|
||||
{{relations.name | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field> -->
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
</div> -->
|
||||
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,12)" (keypress)="keyPress($event)">
|
||||
@ -233,7 +238,7 @@
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -296,6 +301,7 @@
|
||||
|
||||
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:95%">
|
||||
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="emi">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
|
||||
@ -400,8 +400,8 @@ export class AssetsInfoComponent implements OnInit {
|
||||
//name_of_the_owner:[''],
|
||||
//other_owner:[''],
|
||||
//relation:[''],
|
||||
any_other_asset_value : [''],
|
||||
any_other_asset_loan : [''],
|
||||
// any_other_asset_value : [''],
|
||||
// any_other_asset_loan : [''],
|
||||
|
||||
});
|
||||
}
|
||||
@ -480,16 +480,16 @@ export class AssetsInfoComponent implements OnInit {
|
||||
// name_of_the_owner:[data.name_of_the_owner],
|
||||
// other_owner:[data.other_owner],
|
||||
// relation:[data.relation],
|
||||
any_other_asset_value : [data.any_other_asset_value],
|
||||
any_other_asset_loan : [data.any_other_asset_loan],
|
||||
// any_other_asset_value : [data.any_other_asset_value],
|
||||
// any_other_asset_loan : [data.any_other_asset_loan],
|
||||
});
|
||||
}
|
||||
|
||||
otherBusinessAssetsDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [data.any_other_assets],
|
||||
any_other_asset_value : [data.any_other_asset_value],
|
||||
any_other_asset_loan : [data.any_other_asset_loan],
|
||||
// any_other_asset_value : [data.any_other_asset_value],
|
||||
// any_other_asset_loan : [data.any_other_asset_loan],
|
||||
});
|
||||
}
|
||||
|
||||
@ -519,8 +519,8 @@ export class AssetsInfoComponent implements OnInit {
|
||||
load_Four_WeelerWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model_vehicle: [data.manufacturer_model_vehicle],
|
||||
vehicle_type:[''],
|
||||
other_vehicle_type:['']
|
||||
vehicle_type:[data.vehicle_type],
|
||||
other_vehicle_type:[data.other_vehicle_type]
|
||||
});
|
||||
}
|
||||
|
||||
@ -611,11 +611,11 @@ export class AssetsInfoComponent implements OnInit {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
array_data = { 'any_other_assets': datas.any_other_assets,
|
||||
'name_of_the_owner':datas.name_of_the_owner,
|
||||
'other_owner':datas.other_owner,
|
||||
// 'name_of_the_owner':datas.name_of_the_owner,
|
||||
// 'other_owner':datas.other_owner,
|
||||
//'relation':datas.relation,
|
||||
'any_other_asset_value' : datas.any_other_asset_value,
|
||||
'any_other_asset_loan' : datas.any_other_asset_loan,
|
||||
// 'any_other_asset_value' : datas.any_other_asset_value,
|
||||
// 'any_other_asset_loan' : datas.any_other_asset_loan,
|
||||
};
|
||||
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
|
||||
});
|
||||
|
||||
@ -109,6 +109,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Bank Name" formControlName="bank_name" (selectionChange)="setRequiredValidation($event.value,itemrow,2)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -120,6 +121,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -136,6 +138,7 @@
|
||||
<mat-form-field style="width: 35%;" *ngIf="salaryField">
|
||||
<mat-select placeholder="Salary Credited in this account"
|
||||
formControlName="salary" >
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
<mat-option value="NA">NA</mat-option>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
@ -12,9 +11,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
<mat-dialog-content>
|
||||
|
||||
<mat-tab-group>
|
||||
<mat-tab label={{pageTitle}}>
|
||||
<ng-template matTabContent>
|
||||
@ -32,6 +29,7 @@
|
||||
<mat-form-field style="width: 95%;">
|
||||
<mat-select placeholder="is this the business address ? " (selectionChange)="setRequiredValidation($event.value,'',1);"
|
||||
formControlName="business_address_availability" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -40,7 +38,7 @@
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none" *ngIf=" _businessAssetsQuesFrom.controls['business_address_availability'].value == 'yes'">
|
||||
<div style="width:95%">
|
||||
<label>How long has business been operated from this premise?</label>
|
||||
<label style="padding-left:2%">How long has business been operated from this premise?</label>
|
||||
<mat-form-field>
|
||||
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years"
|
||||
(change)="checkWithExistBusinessYear($event.target.value)" (keypress)="keyPress($event)">
|
||||
@ -60,6 +58,7 @@
|
||||
|
||||
<mat-form-field style="width: 95%;">
|
||||
<mat-select [placeholder]="placeholderName" formControlName="business_is_pd_visited">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -84,6 +83,7 @@
|
||||
<mat-select placeholder="Ownership Type" formControlName="business_ownership_type"
|
||||
(selectionChange)="setRequiredValidation($event.value,itemrow,7)">
|
||||
<!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" -->
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="owned">Owned</mat-option>
|
||||
<mat-option value="rented">Rented</mat-option>
|
||||
</mat-select>
|
||||
@ -99,9 +99,7 @@
|
||||
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
|
||||
<!-- {{itemrow.get('business_ownership_type').value}} -->
|
||||
|
||||
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 5" style="width:45%"> -->
|
||||
<mat-form-field style="width:45%">
|
||||
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
|
||||
(keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
|
||||
@ -121,18 +119,11 @@
|
||||
<mat-error>Asset Owned by Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field style="width:45%">
|
||||
<input matInput placeholder="business_name_of_the_owner" formControlName="business_name_of_the_owner" autocomplete="off">
|
||||
</mat-form-field> -->
|
||||
<!-- -->
|
||||
<mat-form-field style="width:45%" *ngIf="isOtherOwnerForAddress">
|
||||
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
|
||||
<!-- <span *ngIf="(sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3) && sup.get('business_ownership_type').value == 'owned'"> -->
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-label>Approx Vintage</mat-label>
|
||||
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage"
|
||||
@ -147,12 +138,13 @@
|
||||
<!-- <mat-error> Invalid year format</mat-error> -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
<span>
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:95%" *ngIf="(itemrow.get('business_ownership_type').value == 'owned')">
|
||||
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="business_emi">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -163,73 +155,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none" *ngIf=" _businessAssetsQuesFrom.controls['business_address_availability'].value == 'yes'">
|
||||
<mat-form-field style="width: 95%;">
|
||||
<!--placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"--
|
||||
<mat-select placeholder="Are there any other premises from which business activity is being run?" formControlName="business_activity" >
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_activity'].value.valid">Field Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div> -->
|
||||
|
||||
|
||||
<!----<mat-card *ngIf=" _businessAssetsQuesFrom.controls['business_activity'].value == 'yes'">
|
||||
|
||||
<div formArrayName="business_premises_additional_units">
|
||||
<div *ngFor="let item of _businessAssetsQuesFrom.controls.business_premises_additional_units['controls']; let i=index let last=last" >
|
||||
<mat-card-header><p>Additional Unit #{{i+1}}</p></mat-card-header>
|
||||
<mat-card-content class="matcard" [formGroup]="item">
|
||||
|
||||
<mat-form-field style="width: 42%">
|
||||
<mat-select placeholder="Type of Premises" formControlName="premises_type" (selectionChange)="setRequiredValidation($event.value,item,2)">
|
||||
<mat-option *ngFor="let m_address_type of m_address_type" [value]="m_address_type.address_type_id"> {{m_address_type.address_type}} </mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('premises_type').value == 1" style="width: 42%">
|
||||
<input matInput placeholder="Specify Premises Type *" formControlName="premises_type_others" autocomplete="off">
|
||||
<mat-error>Premises Type Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 42%;">
|
||||
<input matInput placeholder="Number Of Additional Units"
|
||||
formControlName="no_of_additional_units" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 42%;">
|
||||
|
||||
<input matInput placeholder="Location/City"
|
||||
formControlName="premises_city" autocomplete="off">
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 88%">
|
||||
<input matInput placeholder="Remarks"
|
||||
formControlName="premises_remarks" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions>
|
||||
<div align="center">
|
||||
<button type="button" mat-flat-button (click)="addUnits($event)"
|
||||
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
|
||||
<strong>Add More Additional Unit </strong>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div align="right">
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="removeUnits(i)"
|
||||
matTooltip="Delete Additional Unit" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</mat-card-actions>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-card>-->
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex="100">
|
||||
@ -250,6 +175,7 @@
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select (selectionChange)="selectedAssetsType($event,i)" placeholder="Asset Type"
|
||||
formControlName="business_assets_mode" requried>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id" [disabled]="asset.flag!=1">{{
|
||||
asset.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
@ -267,6 +193,7 @@
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type"
|
||||
(selectionChange)="setRequiredValidation($event.value,detail,6)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let m_address_type of m_address_type" [value]="m_address_type.address_type_id">
|
||||
{{m_address_type.address_type}} </mat-option>
|
||||
<!-- <mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option> -->
|
||||
@ -294,6 +221,7 @@
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Type of Vehicle" formControlName="vehicle_type"
|
||||
(selectionChange)="setRequiredValidation($event.value,detail,5)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let vehicle of m_vehicle_type" [value]="vehicle.vehicle_type_id">{{
|
||||
vehicle.vehicle_type_name }}</mat-option>
|
||||
</mat-select>
|
||||
@ -328,82 +256,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Consumer Durable--
|
||||
<div *ngIf="sup.get('business_assets_mode').value == 6">
|
||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:95%">
|
||||
<input matInput placeholder="Description" formControlName="consumer_durable_description" >
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!--Insurance--
|
||||
<div *ngIf="sup.get('business_assets_mode').value == 7">
|
||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,2)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"₹"}} {{PremiumPaidInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:40%">
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:40%" *ngIf="detail.get('frequency_mode').value == 8 ">
|
||||
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,4)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"₹"}} {{SumAssuredInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!--Investments--
|
||||
<div *ngIf="sup.get('business_assets_mode').value == 8">
|
||||
<div>
|
||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:40%">
|
||||
<mat-select placeholder="Type" formControlName="investments_type" >
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 6 ">
|
||||
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,5)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"₹"}} {{AmtInvestInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!--other assets-->
|
||||
<div *ngIf="sup.get('business_assets_mode').value == 1">
|
||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||
@ -414,34 +266,9 @@
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
|
||||
<!-- <mat-form-field style="width:45%">
|
||||
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value"
|
||||
autocomplete="off" (keyup)="inWords($event,s,6)" (keypress)="keyPress($event)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"₹"}}
|
||||
{{AssetValueInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan">
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue
|
||||
| titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field style="width:40%" *ngIf="businessEmiAmtFlag">
|
||||
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off" (keyup)="inWords($event,s,7)" (keypress)="keyPress($event)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"₹"}} {{B_emiAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--Desction Dynamic details : END -->
|
||||
@ -451,6 +278,7 @@
|
||||
<mat-select placeholder="Ownership Type" formControlName="business_ownership_type"
|
||||
(selectionChange)="setRequiredValidation($event.value,sup,7)">
|
||||
<!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" -->
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="owned">Owned</mat-option>
|
||||
<mat-option value="rented">Rented</mat-option>
|
||||
</mat-select>
|
||||
@ -467,8 +295,6 @@
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'owned'">
|
||||
|
||||
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 5" style="width:45%"> -->
|
||||
<mat-form-field style="width:45%">
|
||||
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
|
||||
(keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,1)">
|
||||
@ -493,9 +319,6 @@
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
|
||||
<!-- <span *ngIf="(sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3) && sup.get('business_ownership_type').value == 'owned'"> -->
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-label>Approx Vintage</mat-label>
|
||||
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage"
|
||||
@ -516,6 +339,7 @@
|
||||
<mat-form-field style="width:95%">
|
||||
<mat-select placeholder="Is There a Loan Existing Against This Asset?"
|
||||
formControlName="business_emi">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -538,11 +362,6 @@
|
||||
<strong>Add More Business Asset </strong>
|
||||
</button>
|
||||
</div>
|
||||
<!-- <button type="button" mat-flat-button (click)="removeAssetsDetails(i)"
|
||||
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
|
||||
<strong>Delete Business Assets </strong>
|
||||
</button> -->
|
||||
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
@ -709,7 +528,6 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above"
|
||||
type="submit">
|
||||
<mat-icon>save</mat-icon>
|
||||
@ -717,6 +535,5 @@
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
<!-- <div class="loading" *ngIf="!apiLoadFinish && !loadDetails">Loading</div> -->
|
||||
<div *ngIf="!apiLoadFinish && !loadDetails"> <i> Loading.... </i> </div>
|
||||
<!-- <div *ngIf="!apiLoadFinish && !loadDetails"> <i> Loading.... </i> </div> -->
|
||||
<notifier-container></notifier-container>
|
||||
@ -14,68 +14,57 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
templateUrl: './business-assets-info.component.html',
|
||||
styleUrls: ['./business-assets-info.component.scss']
|
||||
})
|
||||
|
||||
export class BusinessAssetsInfoComponent implements OnInit {
|
||||
|
||||
/**Declaration of Header Variables */
|
||||
customer_segment_abbr: any;
|
||||
subproduct_abbr: any;
|
||||
lender_applicant_id: any;
|
||||
main_applicant: any;
|
||||
|
||||
pageTitle: string = "Assets used for Business";
|
||||
|
||||
/**Declaration of Form Fields Variables */
|
||||
pdid: string;
|
||||
company_id: any;
|
||||
placeholderName: any = 'Was any business activity seen at the Address Type during PD visit?';
|
||||
|
||||
private notifier: NotifierService;
|
||||
public _businessAssetsQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
public m_assets_type = [];
|
||||
public applicants: any;
|
||||
isOtherOwnerForAddress : boolean = false;
|
||||
isOtherOwner: boolean = false;
|
||||
loadDetails: boolean;
|
||||
|
||||
// businessEmiAmtFlag : boolean = false;
|
||||
public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" },
|
||||
{ 'value': "no", 'viewValue': "No" }]
|
||||
appxMarketAmtInwords: any = [];
|
||||
appxMarketAmtInwordsForAddress: any = [];
|
||||
// AssetValueInwords: any = [];
|
||||
RentAmtInwords: any = [];
|
||||
RentAmtInwordsForAddress: any = [];
|
||||
public m_propertyType = [];
|
||||
PropertyOwnedType: any = [];
|
||||
private notifier: NotifierService;
|
||||
existCompanyList: any = [];
|
||||
mergeCompanyApplicant: any = [];
|
||||
currentYear: any = new Date().getFullYear();
|
||||
addressLabel: any;
|
||||
public m_address_type = [];
|
||||
public m_vehicle_type = [];
|
||||
endUserList = [];
|
||||
CustSegAbbr: any;
|
||||
generalExistBusinessYear: Number;
|
||||
generalExistBusinessMonth: Number;
|
||||
yearErrorMessage: any;
|
||||
monthErrorMessage: any;
|
||||
isOtherOwnerForAddress : boolean = false;
|
||||
isOtherOwner: boolean = false;
|
||||
currentYear: any = new Date().getFullYear();
|
||||
addressLabel: any;
|
||||
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
company_id: any;
|
||||
/**Declaration of Dropdown And Array */
|
||||
public applicants: any;
|
||||
public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" },
|
||||
{ 'value': "no", 'viewValue': "No" }]
|
||||
public m_assets_type = [];
|
||||
public m_propertyType = [];
|
||||
public m_address_type = [];
|
||||
public m_vehicle_type = [];
|
||||
|
||||
PropertyOwnedType: any = [];
|
||||
existCompanyList: any = [];
|
||||
mergeCompanyApplicant: any = [];
|
||||
endUserList = [];
|
||||
|
||||
/**Declaration of amount in words */
|
||||
appxMarketAmtInwords: any = [];
|
||||
appxMarketAmtInwordsForAddress: any = [];
|
||||
RentAmtInwords: any = [];
|
||||
RentAmtInwordsForAddress: any = [];
|
||||
|
||||
/**Constructor of the class */
|
||||
constructor(
|
||||
notifier: NotifierService,
|
||||
private _formBuilder: FormBuilder,
|
||||
@ -97,7 +86,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.generalExistBusinessMonth = this.pd_all_details.business_month;
|
||||
}
|
||||
|
||||
|
||||
/** init Function */
|
||||
ngOnInit() {
|
||||
|
||||
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
|
||||
@ -139,7 +128,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.pdTrigerService.retriveForm(params).subscribe(data => {
|
||||
if (data.status == 200) {
|
||||
|
||||
|
||||
this.addressLabel = '';
|
||||
|
||||
let selectedAddressType = this.m_address_type.filter(element => element.address_type_id == data.records.address_type)[0];
|
||||
@ -179,48 +167,15 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
)
|
||||
}
|
||||
|
||||
// getM_InvestmentType() {
|
||||
// this.pdTrigerService.getAllMasterDatas('INVESTMENTTYPE').subscribe(
|
||||
// data => {
|
||||
// this.m_investmentType = data.records.filter(data => data.isactive == 1);
|
||||
// },
|
||||
// error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// // this.m_assets_type = "No Category Records Found.";
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
|
||||
// getM_FreqOfPurchase() {
|
||||
// this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
|
||||
// data => {
|
||||
// this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1);
|
||||
// },
|
||||
// error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// // this.m_assets_type = "No Category Records Found.";
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
|
||||
/** Address Type For Dropdown List */
|
||||
getM_Address_Type() {
|
||||
this.pdTrigerService.getAllMasterDatas('ADDRESSTYPE').subscribe(
|
||||
data => {
|
||||
this.m_address_type = data.records.filter(data => data.isactive == 1);
|
||||
|
||||
// if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
|
||||
|
||||
// let index1 = this.m_address_type.map(data => data.address_type).indexOf("Residence");
|
||||
// this.m_address_type.splice(index1, 1);
|
||||
|
||||
// let index2 = this.m_address_type.map(data => data.address_type).indexOf("Residence cum Office");
|
||||
// this.m_address_type.splice(index2, 1);
|
||||
|
||||
// }
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/** Vehicle Type For Dropdown List */
|
||||
getM_Vehicle_Type() {
|
||||
this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe(
|
||||
data => {
|
||||
@ -234,7 +189,9 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.pdTrigerService.getPDFormDetailsWithCompanyID(this.pdid, '22', this.company_id).subscribe(
|
||||
data => {
|
||||
if (data) {
|
||||
console.log('data.records',data);
|
||||
if (data.dataStatus) {
|
||||
console.log('data.records',data.records);
|
||||
this.formLoadData(data.records);
|
||||
} else {
|
||||
this.formLoadData(null);
|
||||
@ -247,7 +204,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
//load Form Data
|
||||
/** load Form Data */
|
||||
formLoadData(val) {
|
||||
if (val !== null) {
|
||||
let value = val;
|
||||
@ -261,45 +218,30 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
business_is_pd_visited: [value.business_is_pd_visited],
|
||||
business_pd_visited_remark: [value.business_pd_visited_remark],
|
||||
business_assets_for_address: this._formBuilder.array([]),
|
||||
// business_activity:[value.business_activity],
|
||||
// business_premises_additional_units: this._formBuilder.array([]),
|
||||
business_assets_details: this._formBuilder.array([]),
|
||||
business_assets_form_remark: [value.business_assets_form_remark || null]
|
||||
});
|
||||
if (value.business_address_availability == 'yes') {
|
||||
console.log(value.business_assets_for_address);
|
||||
this.addBusinessAssetsForAddress(value.business_assets_for_address);
|
||||
}
|
||||
else {
|
||||
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
|
||||
control.push(this.createBusinessAssetsForAddress());
|
||||
}
|
||||
// if(value.business_activity == 'yes'){
|
||||
// this.addBusinessUnitsWithData(value.business_premises_additional_units);
|
||||
// }
|
||||
// else{
|
||||
// const control = <FormArray>this._businessAssetsQuesFrom.controls['business_premises_additional_units'];
|
||||
// control.push(this.createUnits());
|
||||
// }
|
||||
this.addBusinessAssetsDetailsWithData(value.business_assets_details);
|
||||
} else {
|
||||
this._businessAssetsQuesFrom = this._formBuilder.group({
|
||||
pdid: [this.pdid],
|
||||
formid: ['22'],
|
||||
company_id: [this.company_id],
|
||||
business_assets_details: this._formBuilder.array([
|
||||
this.initBusinessDetails(),
|
||||
]),
|
||||
business_assets_details: this._formBuilder.array([ this.initBusinessDetails() ]),
|
||||
business_years: [''],
|
||||
business_month: [''],
|
||||
business_address_availability: [''],
|
||||
// business_activity:[''],
|
||||
business_is_pd_visited: [''],
|
||||
business_pd_visited_remark: [''],
|
||||
business_assets_for_address: this._formBuilder.array([
|
||||
this.createBusinessAssetsForAddress()]),
|
||||
// business_premises_additional_units: this._formBuilder.array([
|
||||
// this.createUnits()
|
||||
// ]),
|
||||
business_assets_for_address: this._formBuilder.array([ this.createBusinessAssetsForAddress() ]),
|
||||
business_assets_form_remark: ['']
|
||||
});
|
||||
}
|
||||
@ -309,10 +251,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
// convenience getter for easy access to form fields
|
||||
get f() { return this._businessAssetsQuesFrom.controls; }
|
||||
|
||||
// get f_assets_details() {
|
||||
// return <FormArray>this._businessAssetsQuesFrom.get('assets_details');
|
||||
// }
|
||||
|
||||
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initBusinessDetails() {
|
||||
return this._formBuilder.group({
|
||||
@ -328,16 +267,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
business_emi: [''],
|
||||
});
|
||||
}
|
||||
createUnits(): FormGroup {
|
||||
return this._formBuilder.group({
|
||||
no_of_additional_units: [''],
|
||||
premises_type: [''],
|
||||
premises_type_others: [''],
|
||||
premises_city: [''],
|
||||
premises_remarks: [''],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createBusinessAssetsForAddress(): FormGroup {
|
||||
return this._formBuilder.group({
|
||||
business_approximate_market_value: [''],
|
||||
@ -351,7 +281,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
selectedPropertyOwnedType(e, s, i) {
|
||||
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ;
|
||||
@ -364,6 +293,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.PropertyOwnedType[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
show: boolean;
|
||||
selectedAssetsType(e: any, i: any): void {
|
||||
let val = i;
|
||||
@ -371,6 +301,11 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
arr.controls.splice(0);
|
||||
|
||||
switch (e.value) {
|
||||
case '1': {
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
control.push(this.otherBusinessAssetsDescription());
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
let val = i;
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
@ -387,37 +322,17 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
control.push(this.loadEquipmentManufacturingDescription());
|
||||
break;
|
||||
}
|
||||
// case '5': {
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// //control.push(this.loadJwellDescription());
|
||||
// break;
|
||||
// }
|
||||
// case '8': {
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadConsumerDurableDescription());
|
||||
// break;
|
||||
// }
|
||||
// case '6': {
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadInsuranceDescription());
|
||||
// break;
|
||||
// }
|
||||
// case '7': {
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadInvestDescription());
|
||||
// break;
|
||||
// }
|
||||
case '1': {
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
control.push(this.otherBusinessAssetsDescription());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadEquipmentManufacturingDescription() {
|
||||
return this._formBuilder.group({
|
||||
equipment_manufacturing_description: ['']
|
||||
});
|
||||
}
|
||||
|
||||
loadProperty() {
|
||||
return this._formBuilder.group({
|
||||
@ -427,52 +342,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// loadJwellDescription() {
|
||||
// return this._formBuilder.group({
|
||||
// jwell_description: ['']
|
||||
// });
|
||||
// }
|
||||
|
||||
// loadConsumerDurableDescription() {
|
||||
// return this._formBuilder.group({
|
||||
// consumer_durable_description: ['']
|
||||
// });
|
||||
// }
|
||||
|
||||
loadEquipmentManufacturingDescription() {
|
||||
return this._formBuilder.group({
|
||||
equipment_manufacturing_description: ['']
|
||||
});
|
||||
}
|
||||
|
||||
otherBusinessAssetsDescription() {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [''],
|
||||
// any_other_asset_value: [''],
|
||||
any_other_asset_loan: [''],
|
||||
});
|
||||
}
|
||||
|
||||
// loadInsuranceDescription() {
|
||||
// return this._formBuilder.group({
|
||||
// //insurance_type: [''],
|
||||
// premium_paid: [''],
|
||||
// frequency_mode: [''],
|
||||
// other_frequency_mode:[''],
|
||||
// sum_assured: [''],
|
||||
// members_coverd: ['']
|
||||
// });
|
||||
// }
|
||||
|
||||
// loadInvestDescription() {
|
||||
// return this._formBuilder.group({
|
||||
// investments_type: [''],
|
||||
// other_investments_type:[''],
|
||||
// amount_of_invest: [],
|
||||
// bank_name: ['']
|
||||
// });
|
||||
// }
|
||||
|
||||
load_Four_Weeler() {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model_vehicle: [''],
|
||||
@ -482,33 +351,21 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// load_Two_Weeler() {
|
||||
// return this._formBuilder.group({
|
||||
// manufacturer_model_vehicle: ['']
|
||||
// });
|
||||
// }
|
||||
otherBusinessAssetsDescription() {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [''],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
loadPropertyWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
property_type: [data.property_type],
|
||||
other_property_type: [data.other_property_type],
|
||||
address_of_the_property: [data.address_of_the_property],
|
||||
//property_type:['']
|
||||
});
|
||||
}
|
||||
|
||||
// loadJwellDescriptionWithData(data) {
|
||||
// return this._formBuilder.group({
|
||||
// jwell_description: [data.jwell_description]
|
||||
// });
|
||||
// }
|
||||
|
||||
// loadConsumerDurableDescriptionWithData(data) {
|
||||
// return this._formBuilder.group({
|
||||
// consumer_durable_description: [data.consumer_durable_description]
|
||||
// });
|
||||
// }
|
||||
|
||||
loadEquipmentManufacturingDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
equipment_manufacturing_description: [data.equipment_manufacturing_description]
|
||||
@ -518,32 +375,9 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
otherBusinessAssetsDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [data.any_other_assets],
|
||||
// any_other_asset_value: [data.any_other_asset_value],
|
||||
any_other_asset_loan: [data.any_other_asset_loan],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// loadInsuranceDescriptionWithData(data) {
|
||||
// return this._formBuilder.group({
|
||||
// //insurance_type: [data.insurance_type],
|
||||
// premium_paid: [data.premium_paid],
|
||||
// frequency_mode: [data.frequency_mode],
|
||||
// other_frequency_mode:[data.other_frequency_mode],
|
||||
// sum_assured: [data.sum_assured],
|
||||
// members_coverd: [data.members_coverd]
|
||||
// });
|
||||
// }
|
||||
|
||||
// loadInvestDescriptionWithData(data) {
|
||||
// return this._formBuilder.group({
|
||||
// investments_type: [data.investments_type],
|
||||
// other_investments_type : [data.other_investments_type],
|
||||
// amount_of_invest: [data.amount_of_invest],
|
||||
// bank_name: [data.bank_name]
|
||||
// });
|
||||
// }
|
||||
|
||||
load_Four_WeelerWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model_vehicle: [data.manufacturer_model_vehicle],
|
||||
@ -552,22 +386,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// load_Two_WeelerWithData(data) {
|
||||
// return this._formBuilder.group({
|
||||
// manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
|
||||
// });
|
||||
// }
|
||||
|
||||
createUnitswithData(data) {
|
||||
let formGroup = this._formBuilder.group({
|
||||
no_of_additional_units: [data.no_of_additional_units],
|
||||
premises_type: [data.premises_type],
|
||||
premises_type_others: [data.premises_type_others],
|
||||
premises_city: [data.premises_city],
|
||||
premises_remarks: [data.premises_remarks],
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
createBusinessAssetsForAddressWithData(data): FormGroup {
|
||||
return this._formBuilder.group({
|
||||
@ -592,17 +410,16 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
business_monthly_rented_amt: [data.business_monthly_rented_amt],
|
||||
business_name_of_the_owner: [data.business_name_of_the_owner],
|
||||
business_name_of_the_other_owner: [data.business_name_of_the_other_owner || ''],
|
||||
// relation: [data.relation || ''],
|
||||
business_vintage: [data.business_vintage],
|
||||
business_purchase_year: [data.business_purchase_year, Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
|
||||
// purchase_month: [data.purchase_month],
|
||||
business_emi: [data.business_emi || ''],
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
loadDetails: boolean;
|
||||
|
||||
addBusinessAssetsForAddress(data) {
|
||||
console.log(data);
|
||||
var result = Object.keys(data).map(function (key) {
|
||||
return data[key];
|
||||
});
|
||||
@ -620,6 +437,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
this.isOtherOwnerForAddress = Avaliablity == 0 ? true : false;
|
||||
|
||||
});
|
||||
|
||||
for (let val of result) {
|
||||
@ -641,31 +459,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
control.push(this.createBusinessAssetsForAddress());
|
||||
}
|
||||
}
|
||||
// addBusinessUnitsWithData(data){
|
||||
|
||||
// var result = Object.keys(data).map(function (key) {
|
||||
// return data[key];
|
||||
// });
|
||||
|
||||
// if (result.length > 0) {
|
||||
// for (let val of result) {
|
||||
// let vals = {
|
||||
// no_of_additional_units: val.no_of_additional_units,
|
||||
// premises_type: val.premises_type,
|
||||
// premises_type_others: val.premises_type_others,
|
||||
// premises_city: val.premises_city,
|
||||
// premises_remarks: val.premises_remarks,
|
||||
// };
|
||||
// const control = <FormArray>this._businessAssetsQuesFrom.controls['business_premises_additional_units'];
|
||||
// control.push(this.createUnitswithData(vals));
|
||||
// }
|
||||
// }else{
|
||||
// const control = <FormArray>this._businessAssetsQuesFrom.controls['business_premises_additional_units'];
|
||||
// control.push(this.createUnits());
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
addBusinessAssetsDetailsWithData(supp_data) {
|
||||
|
||||
var result = Object.keys(supp_data).map(function (key) {
|
||||
@ -677,15 +471,9 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
|
||||
this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt);
|
||||
let Avaliablity = 1;
|
||||
// console.log(datas.business_name_of_the_owner);
|
||||
// datas.business_name_of_the_owner.forEach(option => {
|
||||
// if(option.id == 0 && option.group_id == 2){
|
||||
// Avaliablity = option.id;
|
||||
// }
|
||||
// });
|
||||
this.isOtherOwner = Avaliablity == 0 ? true : false;
|
||||
// .business_assets_details['controls']
|
||||
// this.setRequiredValidation(datas.business_name_of_the_owner, item, 4);
|
||||
|
||||
this.isOtherOwner = Avaliablity == 0 ? true : false;
|
||||
|
||||
});
|
||||
|
||||
for (let val of result) {
|
||||
@ -718,11 +506,19 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
arr.controls.splice(0);
|
||||
|
||||
switch (assets_details_mode) {
|
||||
case '1': {
|
||||
let array_datas: any;
|
||||
data.forEach((datas, i) => {
|
||||
array_datas = { 'any_other_assets': datas.any_other_assets };
|
||||
});
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
let business_property_datas: any;
|
||||
data.forEach((datas, i) => {
|
||||
business_property_datas = { 'property_type': datas.property_type, 'other_property_type': datas.other_property_type, 'address_of_the_property': datas.address_of_the_property };
|
||||
// this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val);
|
||||
});
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
control.push(this.loadPropertyWithData(business_property_datas));
|
||||
@ -746,62 +542,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas));
|
||||
break;
|
||||
}
|
||||
// case '4': {
|
||||
// break;
|
||||
// }
|
||||
// case '5': {
|
||||
// let business_ConsumerDurableDescription_datas : any;
|
||||
// data.forEach((datas,i) => {
|
||||
// business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
|
||||
// });
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas));
|
||||
// break;
|
||||
// }
|
||||
// case '6': {
|
||||
// let business_InsuranceDescription_datas : any;
|
||||
// data.forEach((datas,i) => {
|
||||
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
|
||||
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
|
||||
// business_InsuranceDescription_datas = {
|
||||
// 'premium_paid': datas.premium_paid,
|
||||
// 'frequency_mode': datas.frequency_mode,
|
||||
// 'other_frequency_mode':datas.other_frequency_mode,
|
||||
// 'sum_assured': datas.sum_assured,
|
||||
// 'members_coverd': datas.members_coverd
|
||||
// };
|
||||
// });
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas));
|
||||
// break;
|
||||
// }
|
||||
// case '7': {
|
||||
// let business_InvestDescription_datas : any;
|
||||
// data.forEach((datas,i) => {
|
||||
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
|
||||
// business_InvestDescription_datas = { 'investments_type': datas.investments_type,
|
||||
// 'other_investments_type' : datas.other_investments_type,
|
||||
// 'amount_of_invest': datas.amount_of_invest,
|
||||
// 'bank_name': datas.bank_name };
|
||||
// });
|
||||
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
// control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas));
|
||||
// break;
|
||||
// }
|
||||
case '1': {
|
||||
let array_datas: any;
|
||||
data.forEach((datas, i) => {
|
||||
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
|
||||
array_datas = {
|
||||
'any_other_assets': datas.any_other_assets,
|
||||
// 'any_other_asset_value': datas.any_other_asset_value,
|
||||
'any_other_asset_loan': datas.any_other_asset_loan,
|
||||
};
|
||||
});
|
||||
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
|
||||
control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
@ -827,13 +567,13 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
public paymentModeTextBox: number;
|
||||
selectedPM(e) {
|
||||
this.paymentModeTextBox = e.value;
|
||||
// this.f.supplier_details.controls.get('payment_mode_value');
|
||||
}
|
||||
|
||||
public freqPurchaseTextBox: number;
|
||||
selectedFreqPurchase(e) {
|
||||
this.freqPurchaseTextBox = e.value;
|
||||
}
|
||||
|
||||
// // compare objects for merge two master table details
|
||||
compareObjects(o1: any, o2: any) {
|
||||
if (o1.id == o2.id && o1.group_id == o2.group_id)
|
||||
@ -841,27 +581,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
else return false
|
||||
}
|
||||
|
||||
// // check others
|
||||
// checkOthers(values) {
|
||||
// if (values != null) {
|
||||
// return values.id == 0 ? true : false;
|
||||
// }
|
||||
// else {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// checkOthers2(values) {
|
||||
// if (values != null) {
|
||||
// return values.id == 0 ? true : false;
|
||||
// }
|
||||
// else {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// calculate vintage and purchase {}
|
||||
calculateVintagePurchase(value: any, controlKey: any, type: number) {
|
||||
if (type == 1) {
|
||||
@ -895,12 +614,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
} else {
|
||||
var answerFormValues = this._businessAssetsQuesFrom.value;
|
||||
let dataOwner_name = [];
|
||||
// console.log('answerFormValues',answerFormValues);
|
||||
|
||||
// this.loanDetailsForm.controls['owner_name'].value.forEach(element => {
|
||||
// dataOwner_name.push({ owner_name: element })
|
||||
// });
|
||||
// records.owner_name_group = dataOwner_name;
|
||||
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
|
||||
@ -922,13 +635,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/** To Reset Popup Data */
|
||||
// onReset() {
|
||||
// const arr = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_details;
|
||||
// arr.controls.splice(0);
|
||||
// this.getPdSupplierFormDetails();
|
||||
// }
|
||||
|
||||
/** On Key Press Event For Number only Accepting */
|
||||
keyPress(event: any) {
|
||||
const pattern = /[0-9]/;
|
||||
@ -939,17 +645,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
// ConvertMonthintoYear(e){
|
||||
|
||||
// let business_year = this._businessAssetsQuesFrom.controls.business_years.value;
|
||||
|
||||
// let converted_month : number = e%12;
|
||||
// let converted_year : number = e/12;
|
||||
|
||||
// this._businessAssetsQuesFrom.controls.business_years.setValue(+business_year + +Math.floor(converted_year));
|
||||
// this._businessAssetsQuesFrom.controls.business_month.setValue(Math.floor(converted_month));
|
||||
|
||||
// }
|
||||
|
||||
/** To Convert Month into Year */
|
||||
ConvertMonthintoYear(e) {
|
||||
@ -995,42 +690,29 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
setRequiredValidation(value, item, flag) {
|
||||
console.log('controls',item);
|
||||
|
||||
if (flag == 1) {
|
||||
if (value == 'yes') {
|
||||
this._businessAssetsQuesFrom.controls.business_years.setValidators([Validators.required]);
|
||||
|
||||
this._businessAssetsQuesFrom.controls.business_years.setValidators([Validators.required]);
|
||||
this._businessAssetsQuesFrom.controls.business_address_availability.setValidators([Validators.required]);
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.setValidators([Validators.required]) ;
|
||||
this._businessAssetsQuesFrom.controls.business_is_pd_visited.setValidators([Validators.required]);
|
||||
this._businessAssetsQuesFrom.controls.business_pd_visited_remark.setValidators([Validators.required]);
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.setValidators([Validators.required]) ;
|
||||
|
||||
}
|
||||
else {
|
||||
this._businessAssetsQuesFrom.controls.business_years.clearValidators();
|
||||
|
||||
this._businessAssetsQuesFrom.controls.business_address_availability.clearValidators();
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.clearValidators();
|
||||
this._businessAssetsQuesFrom.controls.business_is_pd_visited.clearValidators();
|
||||
this._businessAssetsQuesFrom.controls.business_pd_visited_remark.clearValidators();
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.clearValidators();
|
||||
|
||||
}
|
||||
this._businessAssetsQuesFrom.controls.business_years.updateValueAndValidity();
|
||||
|
||||
this._businessAssetsQuesFrom.controls.business_address_availability.updateValueAndValidity();
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.updateValueAndValidity();
|
||||
this._businessAssetsQuesFrom.controls.business_is_pd_visited.updateValueAndValidity();
|
||||
this._businessAssetsQuesFrom.controls.business_pd_visited_remark.updateValueAndValidity();
|
||||
// this._businessAssetsQuesFrom.controls.business_activity.updateValueAndValidity();
|
||||
|
||||
|
||||
|
||||
}
|
||||
// if(flag == 2){
|
||||
// value==1
|
||||
// ? item.controls.premises_type_others.setValidators([Validators.required])
|
||||
// : item.controls.premises_type_others.clearValidators();
|
||||
// item.controls.premises_type_others.updateValueAndValidity();
|
||||
// }
|
||||
if (flag == 3) {
|
||||
if (value == 'owned') {
|
||||
item.controls.business_monthly_rented_amt.clearValidators();
|
||||
@ -1063,10 +745,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
|
||||
item.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
|
||||
// value == 0
|
||||
// ? item.controls.business_name_of_the_other_owner.setValidators([Validators.required])
|
||||
// : item.controls.business_name_of_the_other_owner.clearValidators();
|
||||
// item.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
}
|
||||
if (flag == 5) {
|
||||
value == 1
|
||||
@ -1101,17 +779,16 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
let Avaliablity = 1;
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
// console.log('true');
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
// isOtherOwner: boolean = false;
|
||||
|
||||
if(Avaliablity == 0){
|
||||
// console.log(Avaliablity);
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwnerForAddress = true;
|
||||
}else{
|
||||
// console.log(Avaliablity);
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValue('');
|
||||
item.controls.business_name_of_the_other_owner.clearValidators();
|
||||
this.isOtherOwnerForAddress = false;
|
||||
@ -1123,41 +800,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
// endUserChange(event) {
|
||||
|
||||
// this.endUserList = [];
|
||||
//
|
||||
|
||||
// event.forEach(option => {
|
||||
// // let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
|
||||
// let othersData = this.m_endUseForLoan.filter(sub => sub.enduse_of_loan_id == option)[0];
|
||||
|
||||
// OthersAvaliable = othersData.enduse_of_loan.substr(0, 6).toLowerCase();
|
||||
|
||||
// this.endUserList.push({ end_use: option });
|
||||
// });
|
||||
|
||||
// if (OthersAvaliable == 'others') {
|
||||
// this.isOtherPurpose = true;
|
||||
// this.loanDetailsForm.controls['end_use_other'].setValidators([Validators.required]);
|
||||
|
||||
// } else {
|
||||
// this.loanDetailsForm.controls['end_use_other'].clearValidators();
|
||||
// this.isOtherPurpose = false;
|
||||
// }
|
||||
// this.loanDetailsForm.controls['end_use_other'].updateValueAndValidity();
|
||||
// //this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only;
|
||||
// }
|
||||
|
||||
// addUnits() {
|
||||
// const control = <FormArray>this._businessAssetsQuesFrom.controls['business_premises_additional_units'];
|
||||
// control.push(this.createUnits());
|
||||
// }
|
||||
|
||||
// removeUnits(index) {
|
||||
// const control = <FormArray>this._businessAssetsQuesFrom.controls['business_premises_additional_units'];
|
||||
// control.removeAt(index);
|
||||
// }
|
||||
|
||||
selectedAddressType(e: any) {
|
||||
this.placeholderName = 'Was any business activity seen at the ' + e + ' during PD visit?';
|
||||
@ -1169,24 +811,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
case 1:
|
||||
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
// case 2 :
|
||||
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
// case 3 :
|
||||
// this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
// case 4 :
|
||||
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
// case 5 :
|
||||
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
// case 6:
|
||||
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
// case 7 :
|
||||
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// break;
|
||||
case 8:
|
||||
this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
@ -1202,22 +826,25 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// let ownername: any = [];
|
||||
// if (value.records.owner_name_group != null) {
|
||||
// let owner = Object.keys(value.records.owner_name_group).map(function (key) {
|
||||
// return value.records.owner_name_group[key];
|
||||
// });
|
||||
/** For Docs Tab */
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// owner.forEach(val => {
|
||||
// ownername.push(val.business_name_of_the_owner);
|
||||
// if (val.business_name_of_the_owner == 'Others') {
|
||||
// this.OtherOwnerFlag = true;
|
||||
// }
|
||||
// else {
|
||||
// this.OtherOwnerFlag = false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// this.loanDetailsForm.controls['business_name_of_the_owner'].setValue(owner);
|
||||
}
|
||||
@ -24,6 +24,9 @@
|
||||
<p>Banking Details #{{i+1}}
|
||||
</p>
|
||||
</mat-panel-title>
|
||||
<!-- <mat-panel-description end>
|
||||
<mat-icon (click)="deleteBankdetails(i)" *ngIf="!last" style = "padding-top: 2%" matTooltip="Delete Banking Details" matTooltipPosition="above" >delete</mat-icon>
|
||||
</mat-panel-description> -->
|
||||
</mat-expansion-panel-header>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,1)">
|
||||
@ -40,7 +43,8 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Bank Name" formControlName="bank_name" (selectionChange)="setRequiredValidation($event.values,itemrow,2)">
|
||||
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="itemrow.get('bank_name').value == 1">
|
||||
@ -51,6 +55,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -58,6 +63,7 @@
|
||||
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
|
||||
<mat-select placeholder="Is this the main business account"
|
||||
formControlName="is_main" >
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
</mat-select>
|
||||
@ -67,6 +73,7 @@
|
||||
<mat-form-field style="width: 35%;" *ngIf="salaryField">
|
||||
<mat-select placeholder="Salary Credited in this account"
|
||||
formControlName="salary" >
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
<mat-option value="NA">NA</mat-option>
|
||||
@ -108,7 +115,8 @@
|
||||
|
||||
<!-- ngIf="i > 0" -->
|
||||
<div align="right">
|
||||
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details" matTooltipPosition="above" (click)="deleteBankdetails(i)" *ngIf="!last">
|
||||
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details" matTooltipPosition="above" (click)="deleteBankdetails(i)"
|
||||
*ngIf="bankingForm.controls.itemRows.controls.length > 1">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
@ -116,9 +124,9 @@
|
||||
</mat-action-row>
|
||||
</mat-expansion-panel>
|
||||
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
|
||||
<button class="mr-1 mb-1 hover-icon" color="primary" mat-raised-button mat-icon-button matTooltip="Add More Banking Details" matTooltipPosition="above" >
|
||||
<button class="mr-1 mb-1 hover-icon" color="primary" mat-raised-button mat-icon-button matTooltip="Add More Banking Details" matTooltipPosition="above" >
|
||||
<mat-icon >add</mat-icon>
|
||||
</button></div> -->
|
||||
</button></div> -->
|
||||
</mat-accordion>
|
||||
</div>
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Started Business" formControlName="started_business" (selectionChange)="changeOfStartedBusiness(members,i,$event.value);">
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -116,6 +116,7 @@
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field style="width: 90%;">
|
||||
<mat-select formControlName="family_member_salutation">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option [value]="title.title_id" *ngFor="let title of titleData">{{title.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -136,6 +137,7 @@
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field style="width: 90%;">
|
||||
<mat-select formControlName="other_family_relationship_id">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option [value]="member.relationship_id" *ngFor="let member of relationData">{{member.name + ' of' | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -147,7 +149,8 @@
|
||||
<mat-form-field style="width: 90%;">
|
||||
<mat-select
|
||||
formControlName="relation_to_id" style="width: 90%;">
|
||||
<mat-option *ngFor="let appc of applicants" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let appc of applicants" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
@ -158,6 +161,7 @@
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field style="width: 90%;">
|
||||
<mat-select formControlName="relationship_with_company_id">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">{{comrelShip.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -169,7 +173,7 @@
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field style="width: 75%;">
|
||||
<mat-select formControlName="started_business">
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
@ -300,6 +304,7 @@
|
||||
<mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label>
|
||||
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
|
||||
<mat-select placeholder="Countries" formControlName="country_name">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
|
||||
{{CL.country_name}}
|
||||
</mat-option>
|
||||
|
||||
@ -148,7 +148,6 @@ export class CurrentLoanComponent implements OnInit {
|
||||
result.forEach((val,index) => {
|
||||
this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount);
|
||||
this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
|
||||
control.push(this.createLoanDetail(null));
|
||||
this.selectedfrequency(val.frequency,index);
|
||||
//this.selectedLoanTakenBy(val.loan_taken_by,index);
|
||||
});
|
||||
@ -518,7 +517,9 @@ export class CurrentLoanComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
setRequiredValidation(value,item,flag) {
|
||||
|
||||
console.log('value',value);
|
||||
console.log('item',item);
|
||||
console.log('flag',flag);
|
||||
|
||||
if(flag == 1){
|
||||
value==1
|
||||
|
||||
@ -403,7 +403,7 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"₹"}} {{IncomePerMonth[i]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required>
|
||||
<input matInput [placeholder]="item.get('earning_segment').value != 5 ? 'Name of the Employer/Business' : 'Pension Received From'" formControlName="earning_name_of_the_employer_or_business" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="No. of years in Employment/Business" formControlName="earning_number_of_years_in_employment_or_business"
|
||||
|
||||
@ -1,382 +1,93 @@
|
||||
// import {
|
||||
// Component,
|
||||
// OnInit,
|
||||
// Inject,
|
||||
// Input, Output
|
||||
// } from '@angular/core';
|
||||
import { Component,OnInit,Inject,Input, Output } from '@angular/core';
|
||||
|
||||
// import {
|
||||
// FormBuilder,
|
||||
// FormGroup,
|
||||
// Validators,
|
||||
// FormArray, FormControl, AbstractControl,
|
||||
// } from '@angular/forms';
|
||||
|
||||
// import { NotifierService } from 'angular-notifier';
|
||||
|
||||
// import {
|
||||
// MatDialog,
|
||||
// MatDialogRef,
|
||||
// MAT_DIALOG_DATA
|
||||
// } from '@angular/material';
|
||||
// /** Service */
|
||||
// import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
// import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
||||
// @Component({
|
||||
// selector: 'app-family-details',
|
||||
// templateUrl: './family-details.component.html',
|
||||
// styleUrls: ['./family-details.component.scss']
|
||||
// })
|
||||
// export class FamilyDetailsComponent implements OnInit {
|
||||
// //@Input() pdid: number;
|
||||
// pageTitle: string ="Other Family Details";
|
||||
// pdid : string;
|
||||
// form_id : number;
|
||||
|
||||
// private notifier: NotifierService;
|
||||
// public familyForm: FormGroup;
|
||||
// public selectPerson;
|
||||
// // selectPerson = [{
|
||||
// // name : 'person 1',
|
||||
// // id : 111
|
||||
// // }, {
|
||||
// // name : 'person 2',
|
||||
// // id : 222
|
||||
// // }];
|
||||
|
||||
// earningStatus = [{
|
||||
// type: 'Earning',
|
||||
// id: 1
|
||||
// }, {
|
||||
// type: 'Non Earning',
|
||||
// id: 2
|
||||
// }]
|
||||
|
||||
// relationData: any = [];
|
||||
// occupationData: any = [];
|
||||
// //personMetData: any = [];
|
||||
// ownerShipData: any = [];
|
||||
// customerSegData: any = [];
|
||||
// // earnMemberArrCount :any ;
|
||||
// // nonEarnMemberArrCount :any ;
|
||||
// count : number;
|
||||
// constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
// private router: Router,
|
||||
// private _pd: PdTrigerService,
|
||||
// @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
// console.log(pd_all_details);
|
||||
// this.selectPerson = this.pd_all_details.pdapplicants_detials;
|
||||
// this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
// this.form_id = 6;
|
||||
// this.notifier = notifier;
|
||||
// }
|
||||
// ngOnInit() {
|
||||
// this.getMasterDetails('RELATIONSHIPS',1);
|
||||
// this.getMasterDetails('OCCUPATIONMEMBERS',2);
|
||||
// //this.getMasterDetails('PERSONSMET',3);
|
||||
// this.getMasterDetails('RESIDENCEOWNERSHIP',4);
|
||||
// this.getMasterDetails('CUSTOMERSEGMENT',5);
|
||||
// this.initFamilyForm();
|
||||
// let params: any = {};
|
||||
// params.pd_id = this.pdid;
|
||||
// params.pd_form_id = '6';
|
||||
// this._pd.retriveForm(params).subscribe(data => {
|
||||
// const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
|
||||
// const value = <FormArray>this.familyForm.controls['earningMembers'];
|
||||
// if (data.status == 200) {
|
||||
// this.familyForm.controls.selected_person.setValue(data.records.selected_person);
|
||||
// this.familyForm.controls.residence_place.setValue(data.records.residence_place);
|
||||
// this.familyForm.controls.residence_city.setValue(data.records.residence_city);
|
||||
// this.familyForm.controls.residence_state.setValue(data.records.residence_state);
|
||||
// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
|
||||
// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
|
||||
// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
|
||||
// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
|
||||
// this.familyForm.controls.rent.setValue(data.records.rent);
|
||||
// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
|
||||
// this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
|
||||
// this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
|
||||
// } else {
|
||||
// // value.push(this.createMembers());
|
||||
// // control.push(this.createNonMembers());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// initgenerateFamilyMembersDetailsGet(val): FormGroup {
|
||||
// return this.fb.group({
|
||||
// family_member_name : [val.family_member_name, Validators.compose([])],
|
||||
// family_member_relationship : [val.family_member_relationship, Validators.compose([])],
|
||||
// family_member_age : [val.family_member_age, Validators.compose([])],
|
||||
// family_member_earning_status : [val.family_member_earning_status, Validators.compose([])],
|
||||
// earning_segment: [val.earning_segment, Validators.compose([])],
|
||||
// earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
|
||||
// earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
|
||||
// earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
|
||||
// non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
|
||||
// non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
|
||||
// non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
|
||||
// })
|
||||
// }
|
||||
|
||||
// generateFamilyMembersDetailsGetData(data) {
|
||||
// var result = Object.keys(data).map(function (key) {
|
||||
// return data[key];
|
||||
// });
|
||||
// if (result.length > 0) {
|
||||
// for (let val of result) {
|
||||
// const control = <FormArray>this.familyForm.controls['family_members_details'];
|
||||
// control.push(this.initgenerateFamilyMembersDetailsGet(val));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// onSearchChange(e):void {
|
||||
// e.preventDefault();
|
||||
// }
|
||||
// public initFamilyForm(): void {
|
||||
// this.familyForm = this.fb.group({
|
||||
// selected_person: ['', Validators.compose([Validators.required])],
|
||||
// residence_place: ['', Validators.compose([])],
|
||||
// residence_city: ['', Validators.compose([])],
|
||||
// residence_state: ['', Validators.compose([])],
|
||||
// residence_pin: ['', Validators.compose([])],
|
||||
// residence_No_of_years: ['', Validators.compose([])],
|
||||
// residence_ownership: ['', Validators.compose([])],
|
||||
// ownershipOther: [''],
|
||||
// rent: [''],
|
||||
// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
|
||||
// family_members_details: this.fb.array([]),
|
||||
// family_details_form_remark: ['']
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// getNumberOfFamilyMemberDetails(){
|
||||
// // alert(this.familyForm.controls.total_number_of_family_members.valid);
|
||||
// if(this.familyForm.controls.total_number_of_family_members.valid){
|
||||
// let totalMem = this.familyForm.get('total_number_of_family_members').value;
|
||||
// const control = <FormArray>this.familyForm.controls.family_members_details;
|
||||
// if(totalMem > control.length) {
|
||||
// let len = totalMem - control.length;
|
||||
// for(let i = 0; i < len; i++){
|
||||
// control.push(this.generateFamilyMembersDetailsGet());
|
||||
// }
|
||||
// } else if (totalMem < control.length) {
|
||||
// // control.controls.slice(0, totalMem);
|
||||
// control.controls = [];
|
||||
// for(let i = 0; i < totalMem; i++){
|
||||
// control.push(this.generateFamilyMembersDetailsGet());
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// generateFamilyMembersDetailsGet(): FormGroup {
|
||||
// return this.fb.group({
|
||||
// family_member_name : ['', Validators.compose([])],
|
||||
// family_member_relationship : ['', Validators.compose([])],
|
||||
// family_member_age : ['', Validators.compose([])],
|
||||
// family_member_earning_status : ['', Validators.compose([])],
|
||||
// earning_segment: ['', Validators.compose([])],
|
||||
// earning_gross_income_per_month: ['', Validators.compose([])],
|
||||
// earning_name_of_the_employer_or_business: ['', Validators.compose([])],
|
||||
// earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
|
||||
// non_earning_occupation: ['', Validators.compose([])],
|
||||
// non_earning_if_others: ['', Validators.compose([])],
|
||||
// non_earning_if_retired_from: ['', Validators.compose([])],
|
||||
// })
|
||||
// }
|
||||
|
||||
// // get all master details
|
||||
// getMasterDetails(table:string,type:number){
|
||||
// this._pd.getAllMasterDatas(table).subscribe(
|
||||
// data => {
|
||||
// if (data.status == 200) {
|
||||
// if(type==1){
|
||||
// this.relationData=data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
// else if(type==2){
|
||||
// this.occupationData=data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
// // else if(type==3){
|
||||
// // this.personMetData=data.records.filter(item => item.isactive == 1);
|
||||
// // }
|
||||
// else if(type==4){
|
||||
// this.ownerShipData=data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
// else if(type==5){
|
||||
// this.customerSegData=data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// submitFamily() {
|
||||
// if (!this.familyForm.valid) {
|
||||
// return;
|
||||
// }
|
||||
// var records = this.familyForm.value;
|
||||
// //To Remove The "Null" With Key also
|
||||
// Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
|
||||
// // records.other_family_details = answerFormValues;
|
||||
// records.pdid = this.pdid;
|
||||
// records.formid = '6';
|
||||
// // records.fk_createdby = '251';
|
||||
// this._pd.saveForm(records).subscribe(data => {
|
||||
// this.notifier.notify('success', 'Saved Successfully.');
|
||||
// }, error => {
|
||||
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
// });
|
||||
// }
|
||||
// // validateAllFormFields(formGroup: FormGroup) {
|
||||
// // Object.keys(formGroup.controls).forEach(field => {
|
||||
// // const control = formGroup.get(field);
|
||||
// // if (control instanceof FormControl) {
|
||||
// // control.markAsTouched({onlySelf: true});
|
||||
// // } else if (control instanceof FormGroup) {
|
||||
// // this.validateAllFormFields(control);
|
||||
// // }
|
||||
// // });
|
||||
// // }
|
||||
|
||||
// // /** On Key Press Event For Age */
|
||||
// // keyPress(event: any) {
|
||||
// // const pattern = /[0-9]/;
|
||||
|
||||
// // let inputChar = String.fromCharCode(event.charCode);
|
||||
// // if (event.keyCode != 8 && !pattern.test(inputChar)) {
|
||||
// // event.preventDefault();
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// =================== other family details multiple add
|
||||
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
Inject,
|
||||
Input, Output
|
||||
} from '@angular/core';
|
||||
|
||||
import {
|
||||
FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormArray, FormControl, AbstractControl,
|
||||
} from '@angular/forms';
|
||||
import { FormBuilder,FormGroup,Validators,FormArray, FormControl, AbstractControl } from '@angular/forms';
|
||||
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA
|
||||
} from '@angular/material';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-family-details',
|
||||
templateUrl: './family-details.component.html',
|
||||
styleUrls: ['./family-details.component.scss']
|
||||
})
|
||||
|
||||
export class FamilyDetailsComponent implements OnInit {
|
||||
|
||||
/** Header Variable Declaration */
|
||||
customer_segment_abbr: any;
|
||||
subproduct_abbr: any;
|
||||
lender_applicant_id: any;
|
||||
main_applicant: any;
|
||||
IncomePerMonth: any = [];
|
||||
RentAmount: any = [];
|
||||
FamilyMemberAsLabel: any = [];
|
||||
//@Input() pdid: number;
|
||||
pageTitle: string = "Family Details";
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
isReadOnly:any = [];
|
||||
|
||||
|
||||
/** Variable Declaration */
|
||||
private notifier: NotifierService;
|
||||
public familyForm: FormGroup;
|
||||
public selectPerson;
|
||||
public apiFamilyMembers : any = [];
|
||||
// selectPerson = [{
|
||||
// name : 'person 1',
|
||||
// id : 111
|
||||
// }, {
|
||||
// name : 'person 2',
|
||||
// id : 222
|
||||
// }];
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
isReadOnly:any = [];
|
||||
count: number;
|
||||
IncomePerMonth: any = [];
|
||||
RentAmount: any = [];
|
||||
FamilyMemberAsLabel: any = [];
|
||||
|
||||
//@Input() pdid: number;
|
||||
|
||||
earningStatus = [{
|
||||
type: 'Earning',
|
||||
id: 1
|
||||
}, {
|
||||
type: 'Non Earning',
|
||||
id: 2
|
||||
}]
|
||||
|
||||
/** Declartion For Dropdowns */
|
||||
relationData: any = [];
|
||||
occupationData: any = [];
|
||||
//personMetData: any = [];
|
||||
ownerShipData: any = [];
|
||||
// customerSegData: any = [];
|
||||
earningData:any =[];
|
||||
stateData: any = [];
|
||||
// wholeCityData:any =[];
|
||||
cityData: any =[];
|
||||
pincodeData:any=[];
|
||||
// earnMemberArrCount :any ;
|
||||
// nonEarnMemberArrCount :any ;
|
||||
count: number;
|
||||
earningStatus = [{ id: 1,type: 'Earning' },
|
||||
{ id: 2,type: 'Non Earning' }]
|
||||
|
||||
/** constructor Of the class */
|
||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
private dialogRef: MatDialogRef<FamilyDetailsComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
// console.log(pd_all_details);
|
||||
this.selectPerson = this.pd_all_details.pdapplicants_detials;
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 6;
|
||||
this.notifier = notifier;
|
||||
|
||||
this.form_id = 6;
|
||||
this.notifier = notifier;
|
||||
this.selectPerson = this.pd_all_details.pdapplicants_detials;
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getMasterDetails('RELATIONSHIPS', 1);
|
||||
this.getMasterDetails('OCCUPATIONMEMBERS', 2);
|
||||
//this.getMasterDetails('PERSONSMET',3);
|
||||
this.getMasterDetails('RESIDENCEOWNERSHIP', 4);
|
||||
// this.getMasterDetails('CUSTOMERSEGMENT', 5);
|
||||
this.getMasterDetails('EARNINGMEMBERSSTATUS', 5);
|
||||
this.getMasterDetails('STATE', 6);
|
||||
// this.getMasterDetails('CITY', 7);
|
||||
// this.getMasterDetails('PINCODE', 8);
|
||||
|
||||
this._pd.getFamilyDetails(this.pdid).subscribe(data=>{
|
||||
console.clear();
|
||||
// console.log('getFamilyDetails data',data);
|
||||
|
||||
if(data.dataStatus == true){
|
||||
|
||||
let Temparr : any = [];
|
||||
|
||||
// console.log('from_business_form',data.record.from_business_form);
|
||||
// console.log('from_general_form',data.record.from_general_form);
|
||||
|
||||
if(data.record.from_general_form.length > 0){
|
||||
let familyMembersGeneralForm = Object.keys(data.record.from_general_form).map(function (key) {
|
||||
return data.record.from_general_form[key];
|
||||
@ -390,7 +101,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
age:element.age,
|
||||
data_gets_from:'GeneralForm'};
|
||||
});
|
||||
// console.log('familyMembersGeneralForm',familyMembersGeneralForm);
|
||||
|
||||
Temparr.push(datas);
|
||||
|
||||
}
|
||||
@ -420,7 +131,6 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = '6';
|
||||
|
||||
// - { "pd_id":"104"}
|
||||
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
|
||||
@ -478,6 +188,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
onSearchChange(e): void {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
public initFamilyFormDetails(): void {
|
||||
this.familyForm = this.fb.group({
|
||||
family_details: this.fb.array([]),
|
||||
@ -794,9 +505,6 @@ removeFamilyMembers(inx,i) {
|
||||
else if (type == 2) {
|
||||
this.occupationData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
// else if(type==3){
|
||||
// this.personMetData=data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
else if (type == 4) {
|
||||
this.ownerShipData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
@ -806,18 +514,11 @@ removeFamilyMembers(inx,i) {
|
||||
else if (type == 6) {
|
||||
this.stateData = data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
// else if(type == 7){
|
||||
// this.wholeCityData = data.records.filter(item => item.isactive == 1);
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getCity(e,i){
|
||||
|
||||
// this.cityData = this.wholeCityData.filter(city=>city.fk_state_id == e);
|
||||
// this._pd.retriveForm(params).subscribe(data => {
|
||||
this._pd.getStateWiseCities(e).subscribe(data=>{
|
||||
if (data.status == 200) {
|
||||
|
||||
@ -836,13 +537,12 @@ removeFamilyMembers(inx,i) {
|
||||
var records = this.familyForm.value;
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
|
||||
// records.other_family_details = answerFormValues;
|
||||
|
||||
records.pdid = this.pdid;
|
||||
records.formid = '6';
|
||||
// records.fk_createdby = '251';
|
||||
// console.log(JSON.stringify(records));
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
// this.notifier.notify('success', 'Saved Successfully.');
|
||||
|
||||
if(data.status == 200) {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() =>{
|
||||
@ -856,6 +556,7 @@ removeFamilyMembers(inx,i) {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
|
||||
// validateAllFormFields(formGroup: FormGroup) {
|
||||
// Object.keys(formGroup.controls).forEach(field => {
|
||||
// const control = formGroup.get(field);
|
||||
@ -876,6 +577,7 @@ removeFamilyMembers(inx,i) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/** To Convert Amount into Words */
|
||||
inWords(e,flag:number,i){
|
||||
switch(flag){
|
||||
@ -883,8 +585,8 @@ removeFamilyMembers(inx,i) {
|
||||
this.RentAmount[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 2 :
|
||||
this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -12,53 +12,45 @@
|
||||
<form [formGroup]="_finalRemarkForm" (submit)="onSubmit()" novalidate>
|
||||
<mat-dialog-content>
|
||||
<mat-card>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-form-field style="width:50%;">
|
||||
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{ pm.description }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;" *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1">
|
||||
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1">
|
||||
<input matInput autocomplete="off" placeholder="Specify Customer Behaviour" formControlName="final_other_customer_behaviour">
|
||||
</mat-form-field>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title>Location </mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select
|
||||
placeholder="Is the location of the business / profession suited to the nature of business / service provided? "
|
||||
formControlName="is_service_provided" required>
|
||||
<mat-option value="well_suited.">Well Suited.</mat-option>
|
||||
<mat-option value="fairly_suited">Fairly Suited</mat-option>
|
||||
<mat-option value="not_suited">Not Suited</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width:40%;">
|
||||
<mat-select placeholder="PD Officers Recommendation:" formControlName="pd_officers_recommendation" required (selectionChange)="RecommendationChange($event.value)">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-card-subtitle>Location</mat-card-subtitle>
|
||||
<mat-form-field style="width:94%;">
|
||||
<mat-select placeholder="Is the location of the business / profession suited to the nature of business / service provided? "
|
||||
formControlName="is_service_provided" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="well_suited.">Well Suited.</mat-option>
|
||||
<mat-option value="fairly_suited">Fairly Suited</mat-option>
|
||||
<mat-option value="not_suited">Not Suited</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<br>
|
||||
<mat-form-field style="width:50%;">
|
||||
<mat-select placeholder="PD Officers Recommendation" formControlName="pd_officers_recommendation" required (selectionChange)="RecommendationChange($event.value)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{ list.pdofficer_recommendation }}</mat-option>
|
||||
<!-- pdofficer_recommendation_id: "2", pdofficer_recommendation: "Positive" -->
|
||||
<!-- <mat-option value=2>Positive</mat-option>
|
||||
<mat-option value=3>Negative</mat-option>
|
||||
<mat-option value=4>Refer to Credit</mat-option>
|
||||
<mat-option value=1>Others</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
|
||||
<input matInput autocomplete="off" placeholder="Enter reason for Negative" formControlName="enter_reason_for_negative">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1">
|
||||
<input matInput autocomplete="off" placeholder="Specify Others" formControlName="others_pd_officers_recommendation">
|
||||
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">
|
||||
<input matInput autocomplete="off" placeholder="Specify Reason for Negative" formControlName="enter_reason_for_negative">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4">
|
||||
<input matInput autocomplete="off" placeholder="Enter reason for Refer to Credit" formControlName="enter_reason_for_refer_to_credit">
|
||||
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 1">
|
||||
<input matInput autocomplete="off" placeholder="Specify PD Officers Recommendation" formControlName="others_pd_officers_recommendation">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:40%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 4">
|
||||
<input matInput autocomplete="off" placeholder="Specify Reason for Refer to Credit" formControlName="enter_reason_for_refer_to_credit">
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
|
||||
@ -151,10 +151,10 @@ export class FinalRemarksComponent implements OnInit {
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
this.submitted = true;
|
||||
if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) {
|
||||
this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]);
|
||||
this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity();
|
||||
}
|
||||
if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) {
|
||||
this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]);
|
||||
this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity();
|
||||
}
|
||||
// stop here if form is invalid
|
||||
if (this._finalRemarkForm.invalid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
@ -203,18 +203,18 @@ export class FinalRemarksComponent implements OnInit {
|
||||
}
|
||||
|
||||
RecommendationChange(e){
|
||||
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
|
||||
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
|
||||
|
||||
}
|
||||
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
|
||||
// }
|
||||
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
|
||||
|
||||
}
|
||||
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
|
||||
// }
|
||||
// if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
console.log('e',e);
|
||||
if(e==1){
|
||||
|
||||
console.log('other only',e);
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
|
||||
|
||||
@ -227,7 +227,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
|
||||
}
|
||||
if(e==2){
|
||||
|
||||
console.log('all Validation clear ',e);
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
|
||||
@ -242,7 +242,7 @@ export class FinalRemarksComponent implements OnInit {
|
||||
|
||||
}
|
||||
if(e==3){
|
||||
|
||||
console.log('negative only',e);
|
||||
this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]);
|
||||
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
|
||||
|
||||
@ -251,12 +251,12 @@ export class FinalRemarksComponent implements OnInit {
|
||||
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
|
||||
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
|
||||
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators();
|
||||
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators();
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
|
||||
|
||||
}
|
||||
if(e==4){
|
||||
|
||||
console.log('credit only',e);
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]);
|
||||
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
|
||||
|
||||
|
||||
@ -168,9 +168,9 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxLayout="row wrap" *ngIf="CustSegAbbr != 'AI'">
|
||||
<div fxFlex="100">
|
||||
|
||||
<!-- -->
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title><p> Financial as per Customer</p></mat-card-title>
|
||||
@ -275,8 +275,46 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- </span> -->
|
||||
|
||||
|
||||
<div *ngIf="details.get('estimate_net_profit').value != ''">
|
||||
<mat-form-field style="width:50%">
|
||||
<input matInput autocomplete="off" placeholder="what is the average no of days taken to receive the money?" formControlName="estimate_receive_the_money_in_days" type="number">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:50%">
|
||||
<input matInput autocomplete="off" placeholder="what is the average no of days taken to pay the money?" formControlName="estimate_pay_the_money_in_days" type="number">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:50%">
|
||||
<input matInput autocomplete="off" placeholder="What is the average no of days for which stock lies unsold during the year?" formControlName="estimate_unsold_stock_lies_in_days" type="number">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:50%">
|
||||
<mat-select placeholder="Is there Working Capital Facilities?" formControlName="is_there_working_capital_available">
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;" *ngIf="details.get('is_there_working_capital_available').value == 'yes'">
|
||||
<mat-select multiple formControlName="estimate_working_capital_facilities_availed" placeholder="Working Capital Facilities availed">
|
||||
<mat-option *ngFor="let a of av" [value]="a.id">{{a.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;" *ngIf="details.get('estimate_working_capital_facilities_availed').value != ''">
|
||||
<input matInput autocomplete="off" placeholder="Specify The Reason" formControlName="reason_for_working_capital_facilities_availed">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- <table>
|
||||
<tr *ngFor="let value of values">
|
||||
<ng-container>
|
||||
<td>
|
||||
<input #chkEnable ngModel type="checkbox" />
|
||||
</td>
|
||||
<td [disabled]="!chkEnable.checked">
|
||||
<mat-form-field>
|
||||
<input matInput autocomplete="off" type="text" placeholder="Enter text here">
|
||||
</mat-form-field>
|
||||
<input />
|
||||
</td>
|
||||
</ng-container>
|
||||
</tr>
|
||||
</table> -->
|
||||
<!-- <span *ngIf="details.get('estimate_profit_or_loss').value == 2 "> -->
|
||||
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'yes' ">
|
||||
<mat-form-field style="width:25%">
|
||||
|
||||
@ -39,6 +39,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
company_id: string;
|
||||
CustSegAbbr : any;
|
||||
|
||||
public financialForm: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
@ -66,7 +67,14 @@ export class FinancialInfoComponent implements OnInit {
|
||||
AV_netLossAmtToInwords: any = [];
|
||||
AV_SalesFrmInwords: any = [];
|
||||
AV_SalesToInwords: any = [];
|
||||
|
||||
av : any =[{id:6, name:'Letter of Credit'},
|
||||
{id:2, name:'Bank Guarantee'},
|
||||
{id:3, name:'Cash Credit Limit'},
|
||||
{id:7, name:'OD Limit'},
|
||||
{id:4, name:'Factoring'},
|
||||
{id:5, name:'Forfaiting'},
|
||||
{id:1, name:'Others'}]
|
||||
// values = [0, 1, 2, 3];
|
||||
|
||||
constructor(notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
@ -84,6 +92,9 @@ export class FinancialInfoComponent implements OnInit {
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
let x = this.customer_segment_abbr.split("-");
|
||||
this.CustSegAbbr = x[1];
|
||||
console.log('this.CustSegAbbr',this.CustSegAbbr);
|
||||
}
|
||||
|
||||
//ViewerOption For Docs Display
|
||||
@ -146,6 +157,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
/** Backend Data of Asper Customer */
|
||||
if(this.CustSegAbbr != 'AI'){
|
||||
|
||||
let result_val = Object.keys(value.records.estimated_value).map(function(key) {
|
||||
return value.records.estimated_value[key];
|
||||
});
|
||||
@ -169,6 +182,9 @@ export class FinancialInfoComponent implements OnInit {
|
||||
} else {
|
||||
estimated_val.push(this.createValue(''));
|
||||
}
|
||||
}
|
||||
else
|
||||
{retriveData.estimated_value = [];}
|
||||
retriveData.pdid = this.pdid;
|
||||
retriveData.formid = this.form_id;
|
||||
retriveData.company_id = this.company_id;
|
||||
@ -256,7 +272,13 @@ export class FinancialInfoComponent implements OnInit {
|
||||
estimate_net_loss_to:[''],
|
||||
estimate_net_loss_percent:[''],
|
||||
estimate_net_loss:[''],
|
||||
estimate_reason_for_loss:['']
|
||||
estimate_reason_for_loss:[''],
|
||||
estimate_receive_the_money_in_days:[''],
|
||||
estimate_pay_the_money_in_days:[''],
|
||||
estimate_unsold_stock_lies_in_days:[''],
|
||||
estimate_working_capital_facilities_availed:[''],
|
||||
reason_for_working_capital_facilities_availed:[''],
|
||||
is_there_working_capital_available:['']
|
||||
|
||||
});
|
||||
}
|
||||
@ -288,6 +310,12 @@ export class FinancialInfoComponent implements OnInit {
|
||||
estimate_net_loss_percent:[value.estimate_net_loss_percent],
|
||||
estimate_net_loss:[value.estimate_net_loss],
|
||||
estimate_reason_for_loss:[value.estimate_reason_for_loss],
|
||||
estimate_receive_the_money_in_days:[value.estimate_receive_the_money_in_days],
|
||||
estimate_pay_the_money_in_days:[value.estimate_pay_the_money_in_days],
|
||||
estimate_unsold_stock_lies_in_days:[value.estimate_unsold_stock_lies_in_days],
|
||||
is_there_working_capital_available:[value.is_there_working_capital_available],
|
||||
estimate_working_capital_facilities_availed:[value.estimate_working_capital_facilities_availed],
|
||||
reason_for_working_capital_facilities_availed:[value.reason_for_working_capital_facilities_availed]
|
||||
});
|
||||
}
|
||||
|
||||
@ -798,7 +826,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
annual_sale = val.financial_annual_sale;
|
||||
|
||||
/** Calculating Sale Variation Based on Prev.Year ( Datas returns in percentage )
|
||||
* Label name = " Sale Variation from Previous Year in % "
|
||||
* Explaination : Comparing Curr.Year annual sales and Prev.year annual sales
|
||||
* Label name : " Sale Variation from Previous Year in % "
|
||||
*/
|
||||
|
||||
if (index != 0) {
|
||||
@ -821,7 +850,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
loss_amt = val.financial_net_loss;
|
||||
|
||||
/** Calculating Profit's Variation - STARTS HERE
|
||||
* Label name = "Profit Variation from Previous Year in %"
|
||||
* Explaination : Comparing Curr.Year Net Profit (or) Loss Amount With Prev.year Net Profit (or) Loss Amount
|
||||
* Label name : "Profit Variation from Previous Year in %"
|
||||
*/
|
||||
if((profit_amt != '' || loss_amt != '') && index != 0) {
|
||||
if(+profit_amt > +annual_sale){
|
||||
@ -842,7 +872,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
/********************************* Calculating Profit's Variation - ENDS HERE **************************************************************/
|
||||
|
||||
/** Calculating Net Profit (or) Net Loss (and) Sales's Profit Variation
|
||||
* Label name = "Net Profit to Sales in % (or) Net Loss to Sales in %
|
||||
* Explaination : Comparing Curr.Year Net Profit Amount With Curr.year Annual Sales Amount ( like wise loss )
|
||||
* Label name : "Net Profit to Sales in % (or) Net Loss to Sales in %
|
||||
**/
|
||||
let SelectedlossOrProfit = val.finanical_profit_or_loss;
|
||||
|
||||
@ -895,9 +926,14 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0;
|
||||
prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ;
|
||||
console.log('val.financial_margin_of_profit',val.financial_margin_of_profit);
|
||||
console.log('profit_margin',profit_margin);
|
||||
console.log('childArray.controls.financial_margin_of_loss',childArray.controls.financial_margin_of_loss.value);
|
||||
// prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0;
|
||||
// prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ;
|
||||
prev_profit_margin[index] = profit_margin != '' ? profit_margin : 0;
|
||||
prev_loss_margin[index] = loss_margin !='' ? loss_margin : 0 ;
|
||||
|
||||
|
||||
// if(index != 0 ){
|
||||
|
||||
@ -917,12 +953,22 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
if ((profit_margin != '' || loss_margin != '') && index != 0) {
|
||||
|
||||
|
||||
console.log('temp_prev_losses',prev_loss_margin);
|
||||
console.log('temp_prev_profits',prev_profit_margin);
|
||||
|
||||
console.log('curr index',index);
|
||||
|
||||
loss_margin = loss_margin !== undefined ? loss_margin : 0;
|
||||
profit_margin = profit_margin !== undefined ? profit_margin:0;
|
||||
let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ;
|
||||
let temp_prev_profit_margin = prev_profit_margin[index-1] !== undefined ? prev_profit_margin[index-1] : 0 ;
|
||||
|
||||
console.log('profit_margin',profit_margin);
|
||||
console.log('pre year loss_margin',temp_prev_loss_margin);
|
||||
console.log('loss_margin',loss_margin);
|
||||
console.log('pre year profit_margin',temp_prev_profit_margin);
|
||||
|
||||
|
||||
if(annual_sale != ''){
|
||||
|
||||
@ -1573,7 +1619,12 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// }
|
||||
|
||||
submitDetails() {
|
||||
|
||||
|
||||
if(this.CustSegAbbr == 'AI'){
|
||||
this.financialForm.removeControl('estimated_value');
|
||||
this.financialForm.controls['is_financial_customer'].setValue('');
|
||||
}
|
||||
|
||||
if(this.financialForm.value.date_per_financial['finanical_profit_or_loss'] == 1){
|
||||
|
||||
this.financialForm.value.date_per_financial['financial_net_profit'].setValidators([Validators.required]);
|
||||
@ -1602,6 +1653,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
this.financialForm.value.date_per_financial['financial_margin_of_loss'].setValidators([Validators.required]);
|
||||
this.financialForm.value.date_per_financial['financial_margin_of_loss'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
// if (!this.financialForm.valid) {
|
||||
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
// return;
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
<mat-form-field>
|
||||
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Did the lender representative accompany the PD officer for PD?"
|
||||
formControlName="lender_representative_accompany">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
</mat-select>
|
||||
|
||||
@ -29,6 +29,11 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"₹"}}
|
||||
{{loanAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput placeholder="Loan Tenure applied for?" formControlName="loan_tenure" (keypress)="keyPress($event)"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 64%">
|
||||
<mat-select multiple (selectionChange)="endUserChange($event.value)"
|
||||
placeholder="What is the end use" formControlName="end_use">
|
||||
@ -37,18 +42,18 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="isOtherPurpose" style="width: 28%">
|
||||
<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: 64%">
|
||||
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
|
||||
formControlName="is_transfer">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
<span *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
|
||||
<mat-form-field style="width: 64%">
|
||||
@ -58,23 +63,18 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"₹"}}
|
||||
{{balTxrfAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field style="width:28%">
|
||||
<mat-select placeholder="Is there a Top Up"
|
||||
formControlName="is_topup" >
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field style="width: 64%">
|
||||
<mat-select placeholder="Lender from where balance transfer done"
|
||||
formControlName="lender">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{
|
||||
btLen.lender_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 1" style="width: 28%">
|
||||
<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>
|
||||
|
||||
@ -90,20 +90,14 @@
|
||||
<mat-form-field style="width:64%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 ">
|
||||
<mat-select placeholder="What is the End Use of the Top Up?"
|
||||
formControlName="end_use_topup">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let list of m_endUseOFTopUpList" [value]="list.end_use_of_topup_id">{{
|
||||
list.end_use_of_topup }}</mat-option>
|
||||
<!-- <mat-option value=2>Business Use.</mat-option>
|
||||
<mat-option value=3>Child’s Marriage.</mat-option>
|
||||
<mat-option value=4>Furniture & Finishing of House Property.</mat-option>
|
||||
<mat-option value=5>Medical Expenses.</mat-option>
|
||||
<mat-option value=6>Paying Off Existing Loans.</mat-option>
|
||||
<mat-option value=1>Others.</mat-option> -->
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="loanDetailsForm.controls['end_use_topup'].value == 1"
|
||||
style="width: 28%">
|
||||
<input matInput placeholder="Specify End Use of Top Up" formControlName="other_end_use_topup"
|
||||
<input matInput placeholder="Specify End Use of Top Up *" formControlName="other_end_use_topup"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
</span>
|
||||
@ -126,11 +120,11 @@
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field *ngIf="isPLSource" style="width: 28%">
|
||||
<input matInput placeholder="Specify Personal Loan" formControlName="personal_loan_source" autocomplete="off">
|
||||
</mat-form-field> -->
|
||||
<input matInput placeholder="Specify Personal Loan" formControlName="personal_loan_source" autocomplete="off">
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field *ngIf="isOtherSource" style="width: 28%">
|
||||
<input matInput placeholder="Specify Other Sources" formControlName="other_source"
|
||||
<input matInput placeholder="Specify Other Sources *" formControlName="other_source"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
@ -151,20 +145,21 @@
|
||||
<p>Details of Property being Mortgaged</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="matcard">
|
||||
<mat-form-field style="width:50%;">
|
||||
<mat-form-field style="width:46%;">
|
||||
<mat-select placeholder="Type of Property" formControlName="property_type"
|
||||
(selectionChange)="mortage_type($event.value)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let typeprop of m_mortageTypeProperty" [value]="typeprop.mortage_property_id">{{
|
||||
typeprop.property_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="mortageAccess" style="width:50%;">
|
||||
<input matInput placeholder="Specify Type of Property" formControlName="property_type_others"
|
||||
<mat-form-field *ngIf="mortageAccess" style="width:46%;">
|
||||
<input matInput placeholder="Specify Type of Property *" formControlName="property_type_others"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:50%;">
|
||||
<mat-form-field style="width:46%;">
|
||||
<mat-select multiple placeholder="Name of the Owner" formControlName="owner_name"
|
||||
[compareWith]="compareObjects">
|
||||
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
|
||||
@ -195,17 +190,18 @@
|
||||
<!-- </mat-form-field> -->
|
||||
|
||||
<!-- <mat-form-field *ngIf="checkOthers(loanDetailsForm.controls['owner_name'].value)===true">
|
||||
<input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name" autocomplete="off">
|
||||
<input matInput placeholder="Specify Other Owner Name *" formControlName="other_owners_name" autocomplete="off">
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field style="width:50%;">
|
||||
<mat-form-field style="width:46%;">
|
||||
<mat-select placeholder="Status of Construction" formControlName="construction_status">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let status of m_statusofCunstruction" [value]="status.id">{{
|
||||
status.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:50%">
|
||||
<mat-form-field style="width:46%">
|
||||
<input matInput placeholder="Estimate Market Value as Per Customer"
|
||||
formControlName="emv_per_customer" (keypress)="keyPress($event)"
|
||||
(keyup)="inWords($event,7)" autocomplete="off">
|
||||
|
||||
@ -5,37 +5,38 @@ import {
|
||||
Input
|
||||
} from '@angular/core';
|
||||
|
||||
import {
|
||||
FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormArray, FormControl,
|
||||
} from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms';
|
||||
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA
|
||||
} from '@angular/material';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-loan-details',
|
||||
templateUrl: './loan-details.component.html',
|
||||
styleUrls: ['./loan-details.component.scss']
|
||||
})
|
||||
|
||||
export class LoanDetailsComponent implements OnInit {
|
||||
|
||||
/**Declaration of Header Variables */
|
||||
customer_segment_abbr: any;
|
||||
subproduct_abbr: any;
|
||||
lender_applicant_id: any;
|
||||
main_applicant: any;
|
||||
public loanDetailsForm: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
pageTitle: string = "Loan Details";
|
||||
|
||||
|
||||
/**Declaration of formfields Variables */
|
||||
private notifier: NotifierService;
|
||||
public loanDetailsForm: FormGroup;
|
||||
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
exist_loan_amt: any;
|
||||
@ -44,7 +45,10 @@ export class LoanDetailsComponent implements OnInit {
|
||||
productAbbr: any;
|
||||
productID: any;
|
||||
subProductName: any;
|
||||
propertyType: any;
|
||||
|
||||
mortageCardAccess: boolean;
|
||||
mortageAccess: boolean = false;
|
||||
isOtherPurpose: boolean = false;
|
||||
isOtherSource: boolean = false;
|
||||
isPLSource: boolean = false;
|
||||
@ -52,6 +56,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
isContribution: boolean = false;
|
||||
OtherOwnerFlag: boolean;
|
||||
|
||||
/* Declaration of Array For Dropdown */
|
||||
endUserList: any = [];
|
||||
sourceList: any = [];
|
||||
ownerNames: any = [];
|
||||
@ -69,6 +74,8 @@ export class LoanDetailsComponent implements OnInit {
|
||||
mergeCompanyApplicant: any = [];
|
||||
existCompanyList: any = [];
|
||||
companies: any = [];
|
||||
|
||||
/* Declaration of Variables For Amount IN words */
|
||||
loanAmtInWords: any;
|
||||
balTxrfAmtInWords: any;
|
||||
valAsPerAgmtInWords: any;
|
||||
@ -76,13 +83,9 @@ export class LoanDetailsComponent implements OnInit {
|
||||
topUpAmtInWords: any;
|
||||
emiAmtInWords: any;
|
||||
emvAmtInWords: any;
|
||||
pageTitle: string = "Loan Details";
|
||||
|
||||
mortageCardAccess: boolean;
|
||||
mortageAccess: boolean = false;
|
||||
propertyType: any;
|
||||
|
||||
|
||||
/** Constructor Of the Class */
|
||||
constructor(notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
@ -112,26 +115,10 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.isContribution = true;
|
||||
}
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
|
||||
/** init Fns */
|
||||
ngOnInit() {
|
||||
|
||||
this.initloanDetailsForm();
|
||||
this.getM_EndUseofLoad();
|
||||
this.getM_EndUseForLoan(this.pdid);
|
||||
@ -204,16 +191,16 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.endUserChange(enduse);
|
||||
|
||||
|
||||
|
||||
this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount);
|
||||
if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); }
|
||||
|
||||
|
||||
|
||||
this.loanDetailsForm.controls['loan_tenure'].setValue(value.records.loan_tenure);
|
||||
|
||||
if (value.records.end_use_other != null) {
|
||||
this.loanDetailsForm.controls['end_use_other'].setValue(value.records.end_use_other);
|
||||
}
|
||||
this.loanDetailsForm.controls['is_transfer'].setValue(value.records.is_transfer);
|
||||
// this.loanDetailsForm.controls['is_topup'].setValue(value.records.is_topup);
|
||||
|
||||
if (value.records.balance_transfer_amount) {
|
||||
this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount);
|
||||
this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount);
|
||||
@ -261,22 +248,12 @@ export class LoanDetailsComponent implements OnInit {
|
||||
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.emi_level) {
|
||||
this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level);
|
||||
this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level);
|
||||
@ -292,15 +269,9 @@ export class LoanDetailsComponent implements OnInit {
|
||||
if (this.mortageCardAccess == true) {
|
||||
this.loanDetailsForm.controls['property_type_others'].setValue(value.records.property_type_others);
|
||||
this.loanDetailsForm.controls['owner_name'].setValue(ownername);
|
||||
// this.loanDetailsForm.controls['other_owners_name'].setValue(value.records.other_owners_name);
|
||||
|
||||
this.loanDetailsForm.controls['construction_status'].setValue(value.records.construction_status);
|
||||
|
||||
// if(value.records.construction_status == 4 ){
|
||||
// this.loanDetailsForm.controls['percentage_of_construction'].setValue(value.records.percentage_of_construction);
|
||||
// }
|
||||
// else{
|
||||
// this.loanDetailsForm.controls['percentage_of_construction'].setValue('');
|
||||
// }
|
||||
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);
|
||||
@ -308,10 +279,6 @@ export class LoanDetailsComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 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);
|
||||
}
|
||||
})
|
||||
@ -330,42 +297,25 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
// =============
|
||||
|
||||
getM_EndUseofLoad() {
|
||||
//this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe(
|
||||
this._pd.getAllMasterDatas('SUBPRODUCTS').subscribe(
|
||||
data => {
|
||||
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.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
getM_EndUseForLoan(pdid) {
|
||||
this._pd.getEndUseForLoan(pdid).subscribe(
|
||||
data => {
|
||||
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
getM_sourceofamount() {
|
||||
this._pd.getAllMasterDatas('SOURCEOFBALANCETRANSFER').subscribe(
|
||||
data => {
|
||||
this.m_sourceofamount = data.records.filter(data => data.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
getM_MortageTypeProperty() {
|
||||
@ -395,27 +345,16 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
this.m_mortageTypeProperty
|
||||
// mortage_property_id">{{ typeprop.property_name
|
||||
|
||||
}
|
||||
},
|
||||
error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
getM_StatusofCunstruction() {
|
||||
this._pd.getAllMasterDatas('STATUSOFCONSTRUCTION').subscribe(
|
||||
data => {
|
||||
this.m_statusofCunstruction = data.records.filter(data => data.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
getM_BTLenderList() {
|
||||
@ -431,7 +370,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
// }
|
||||
// return 0;
|
||||
// });
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -439,10 +378,36 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this._pd.getAllMasterDatas('ENDUSEOFTOPUP').subscribe(
|
||||
data => {
|
||||
this.m_endUseOFTopUpList = data.records.filter(data => data.is_active == 1);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** Loan Form Elements */
|
||||
public initloanDetailsForm(): void {
|
||||
this.loanDetailsForm = this.fb.group({
|
||||
|
||||
loan_amount: [this.exist_loan_amt],
|
||||
loan_tenure:[''],
|
||||
end_use: [''],
|
||||
end_use_other: [''],
|
||||
is_transfer: [''],
|
||||
balance_transfer_amount: [''],
|
||||
topup_amount: [''],
|
||||
end_use_topup: [''],
|
||||
other_end_use_topup: [''],
|
||||
lender: [''],
|
||||
other_bt_lender: [''],
|
||||
own_contribution: [''],
|
||||
source: [''],
|
||||
other_source: [''],
|
||||
emi_level: [''],
|
||||
property_type: [''],
|
||||
property_type_others: [''],
|
||||
owner_name: [''],
|
||||
construction_status: [''],
|
||||
emv_per_customer: [''],
|
||||
loandetails_remarks: [''],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// compare objects for merge two master table details
|
||||
@ -464,49 +429,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ==================
|
||||
public initloanDetailsForm(): void {
|
||||
this.loanDetailsForm = this.fb.group({
|
||||
|
||||
loan_amount: [this.exist_loan_amt],
|
||||
end_use: [''],
|
||||
end_use_other: [''],
|
||||
is_transfer: [''],
|
||||
//is_topup: [''],
|
||||
balance_transfer_amount: [''],
|
||||
topup_amount: [''],
|
||||
end_use_topup: [''],
|
||||
other_end_use_topup: [''],
|
||||
lender: [''],
|
||||
other_bt_lender: [''],
|
||||
own_contribution: [''],
|
||||
source: [''],
|
||||
other_source: [''],
|
||||
// personal_loan_source:[''],
|
||||
//lender_name_type: [''],
|
||||
emi_level: [''],
|
||||
property_type: [''],
|
||||
property_type_others: [''],
|
||||
owner_name: [''],
|
||||
// other_owners_name :[''],
|
||||
construction_status: [''],
|
||||
//percentage_of_construction : [''],
|
||||
emv_per_customer: [''],
|
||||
//value_per_agreement: [''],
|
||||
loandetails_remarks: [''],
|
||||
});
|
||||
}
|
||||
// endUserChange(event) {
|
||||
// this.endUserList = [];
|
||||
// event.value.forEach(option => {
|
||||
// this.endUserList.push({end_use: option});
|
||||
// if (option == 'other') {
|
||||
// this.isOtherPurpose = true;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/** Enduse Changes And its Validation */
|
||||
endUserChange(event) {
|
||||
this.endUserList = [];
|
||||
let OthersAvaliable;
|
||||
@ -532,18 +455,16 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
/** Source Changes with Validation */
|
||||
sourceChange(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 == 1) // this return true or false Only;
|
||||
// this.isPLSource = evt.some(e => e == 3) // this return true or false Only;
|
||||
|
||||
if (this.isOtherSource) {
|
||||
this.loanDetailsForm.controls['other_source'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
} else {
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
this.loanDetailsForm.controls['other_source'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
}
|
||||
@ -554,6 +475,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/** Validation Based on Owner Name */
|
||||
ownerNameChange(event) {
|
||||
let EventValue;
|
||||
event.value.forEach(option => {
|
||||
@ -566,195 +488,38 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
|
||||
// this.ownerNames = [];
|
||||
// event.value.forEach(option => {
|
||||
// this.ownerNames.push({owner_name: option});
|
||||
// });
|
||||
}
|
||||
submitLoanDetails() {
|
||||
|
||||
if ((this.isContribution == true) && (this.loanDetailsForm.controls['is_transfer'].value != 'yes')) {
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue('');
|
||||
this.loanDetailsForm.controls['own_contribution'].clearValidators();
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
this.loanDetailsForm.controls['other_source'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if (this.loanDetailsForm.controls['lender'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if (!this.loanDetailsForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
|
||||
let records: any = {};
|
||||
records.pdid = this.pdid;
|
||||
records.formid = this.form_id;
|
||||
records.fk_createdby = this.pdid;
|
||||
records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value;
|
||||
|
||||
// get end user final group data
|
||||
let dataEnd_user_data = [];
|
||||
|
||||
this.loanDetailsForm.controls['end_use'].value.forEach(element => {
|
||||
dataEnd_user_data.push({ end_use: element })
|
||||
});
|
||||
|
||||
records.end_use_group = dataEnd_user_data;
|
||||
|
||||
if (this.isOtherPurpose) {
|
||||
records.end_use_other = this.loanDetailsForm.controls['end_use_other'].value;
|
||||
} else { records.end_use_other = null; }
|
||||
|
||||
records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value;
|
||||
// records.is_topup = this.loanDetailsForm.controls['is_topup'].value;
|
||||
// if((this.productAbbr != 'PL' || this.productAbbr != 'BL' || this.productAbbr != 'LAP') && (value.records.is_transfer != 'yes')){
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value;
|
||||
}
|
||||
else if (this.loanDetailsForm.controls['is_transfer'].value == 'no') {
|
||||
if (this.isContribution) {
|
||||
records.own_contribution = '';
|
||||
records.source_group = '';
|
||||
records.other_source = '';
|
||||
}
|
||||
else {
|
||||
|
||||
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;
|
||||
// }
|
||||
// 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;
|
||||
// }
|
||||
|
||||
if (records.topup_amount > 0) {
|
||||
records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
|
||||
if (records.end_use_topup == 1) {
|
||||
records.other_end_use_topup = this.loanDetailsForm.controls['other_end_use_topup'].value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' ||
|
||||
records.lender = this.loanDetailsForm.controls['lender'].value;
|
||||
if (this.loanDetailsForm.controls['lender'].value == 1) {
|
||||
records.other_bt_lender = this.loanDetailsForm.controls['other_bt_lender'].value;
|
||||
}
|
||||
}
|
||||
|
||||
records.emi_level = this.loanDetailsForm.controls['emi_level'].value;
|
||||
if (this.mortageCardAccess == true) {
|
||||
|
||||
records.property_type = this.loanDetailsForm.controls['property_type'].value;
|
||||
records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value;
|
||||
let dataOwner_name = [];
|
||||
this.loanDetailsForm.controls['owner_name'].value.forEach(element => {
|
||||
dataOwner_name.push({ owner_name: element })
|
||||
});
|
||||
records.owner_name_group = dataOwner_name;
|
||||
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
} else {
|
||||
records.property_type = null;
|
||||
records.property_type_others = null;
|
||||
records.owner_name_group = null;
|
||||
records.construction_status = null;
|
||||
records.emv_per_customer = null;
|
||||
}
|
||||
|
||||
if (this.isOtherSource) {
|
||||
records.other_source = this.loanDetailsForm.controls['other_source'].value;
|
||||
} else { records.other_source = ''; }
|
||||
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
|
||||
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
if (data.status == 200) {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
// this.dialogRef.close();
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
})
|
||||
}
|
||||
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**For Setting Validations */
|
||||
selectedBalancesTransferChanges(event: any) {
|
||||
|
||||
if (event.value == 'no') {
|
||||
// this.loanDetailsForm.controls['is_topup'].clearValidators();
|
||||
// this.loanDetailsForm.controls['is_topup'].updateValueAndValidity();
|
||||
|
||||
this.loanDetailsForm.controls['source'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
|
||||
this.loanDetailsForm.controls['own_contribution'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValue('');
|
||||
this.loanDetailsForm.controls['balance_transfer_amount'].setValue('');
|
||||
this.loanDetailsForm.controls['lender'].setValue('');
|
||||
this.loanDetailsForm.controls['topup_amount'].setValue('');
|
||||
this.loanDetailsForm.controls['end_use_topup'].setValue('');
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValue('');
|
||||
|
||||
}
|
||||
else if (event.value == 'yes') {
|
||||
// this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]);
|
||||
// this.loanDetailsForm.controls['is_topup'].updateValueAndValidity();
|
||||
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
|
||||
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue('');
|
||||
this.loanDetailsForm.controls['own_contribution'].clearValidators();
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
|
||||
|
||||
this.isOtherSource = false;
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -798,9 +563,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* mortage_type
|
||||
*/
|
||||
/** Using Selected Mortage Type Set validation */
|
||||
mortage_type(mortage_value) {
|
||||
|
||||
//let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0];
|
||||
@ -812,14 +575,13 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
|
||||
} else {
|
||||
this.mortageAccess = false;
|
||||
this.loanDetailsForm.controls['property_type_others'].setValue('');
|
||||
this.loanDetailsForm.controls['property_type_others'].clearValidators();
|
||||
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* LoanCalculation
|
||||
*/
|
||||
/** For Loan Calculation */
|
||||
loanCalc() {
|
||||
let BtAmount: number = +this.loanDetailsForm.value.balance_transfer_amount;
|
||||
let loanAmount: number = +this.loanDetailsForm.value.loan_amount;
|
||||
@ -840,4 +602,179 @@ export class LoanDetailsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/** Validation */
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** To save Loan FOrm Details */
|
||||
submitLoanDetails() {
|
||||
|
||||
if ((this.isContribution == true)){
|
||||
if(this.loanDetailsForm.controls['is_transfer'].value != 'yes') {
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue('');
|
||||
this.loanDetailsForm.controls['own_contribution'].clearValidators();
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
this.loanDetailsForm.controls['other_source'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
}
|
||||
else if(this.loanDetailsForm.controls['is_transfer'].value == 'yes'){
|
||||
|
||||
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValue('');
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if (this.loanDetailsForm.controls['lender'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValue('');
|
||||
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.loanDetailsForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
|
||||
let records: any = {};
|
||||
records.pdid = this.pdid;
|
||||
records.formid = this.form_id;
|
||||
records.fk_createdby = this.pdid;
|
||||
records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value;
|
||||
records.loan_tenure = this.loanDetailsForm.controls['loan_tenure'].value;
|
||||
|
||||
// get end user final group data
|
||||
let dataEnd_user_data = [];
|
||||
|
||||
this.loanDetailsForm.controls['end_use'].value.forEach(element => {
|
||||
dataEnd_user_data.push({ end_use: element })
|
||||
});
|
||||
|
||||
records.end_use_group = dataEnd_user_data;
|
||||
|
||||
records.end_use_other = this.isOtherPurpose ? this.loanDetailsForm.controls['end_use_other'].value : null;
|
||||
|
||||
records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value;
|
||||
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value;
|
||||
}
|
||||
else if (this.loanDetailsForm.controls['is_transfer'].value == 'no') {
|
||||
if (this.isContribution) {
|
||||
records.own_contribution = '';
|
||||
records.source_group = '';
|
||||
records.other_source = '';
|
||||
}
|
||||
else {
|
||||
records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value;
|
||||
|
||||
let dataSource_list = [];
|
||||
this.loanDetailsForm.controls['source'].value.forEach(element => {
|
||||
dataSource_list.push({ sources: element })
|
||||
});
|
||||
records.source_group = dataSource_list;
|
||||
}
|
||||
}
|
||||
|
||||
records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value;
|
||||
|
||||
|
||||
if (records.topup_amount > 0) {
|
||||
records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
|
||||
records.other_end_use_topup = records.end_use_topup == 1 ?
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].value : '';
|
||||
}
|
||||
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
records.lender = this.loanDetailsForm.controls['lender'].value;
|
||||
records.other_bt_lender = this.loanDetailsForm.controls['lender'].value == 1 ?
|
||||
this.loanDetailsForm.controls['other_bt_lender'].value : '';
|
||||
}
|
||||
|
||||
records.emi_level = this.loanDetailsForm.controls['emi_level'].value;
|
||||
if (this.mortageCardAccess == true) {
|
||||
|
||||
records.property_type = this.loanDetailsForm.controls['property_type'].value;
|
||||
records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value;
|
||||
let dataOwner_name = [];
|
||||
this.loanDetailsForm.controls['owner_name'].value.forEach(element => {
|
||||
dataOwner_name.push({ owner_name: element })
|
||||
});
|
||||
records.owner_name_group = dataOwner_name;
|
||||
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
} else {
|
||||
records.property_type = null;
|
||||
records.property_type_others = null;
|
||||
records.owner_name_group = null;
|
||||
records.construction_status = null;
|
||||
records.emv_per_customer = null;
|
||||
}
|
||||
|
||||
records.other_source = this.isOtherSource ?
|
||||
this.loanDetailsForm.controls['other_source'].value : '';
|
||||
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
|
||||
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
if (data.status == 200) {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
// this.dialogRef.close();
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/** For DOCS tab */
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
toolbar: {
|
||||
zoomIn: 4,
|
||||
zoomOut: 4,
|
||||
oneToOne: 4,
|
||||
reset: 4,
|
||||
prev: 4,
|
||||
play: {
|
||||
show: 4,
|
||||
size: 'large',
|
||||
},
|
||||
next: 4,
|
||||
rotateLeft: 4,
|
||||
rotateRight: 4,
|
||||
flipHorizontal: 4,
|
||||
flipVertical: 4,
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -155,7 +155,7 @@ export class StockComponent implements OnInit {
|
||||
pdid: [this.pdid],
|
||||
formid: [this.form_id],
|
||||
company_id: [this.company_id],
|
||||
stock_remarks: [''],
|
||||
stock_remarks: [dataForm.stock_remarks],
|
||||
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
|
||||
retail_details : this.fb.array([this.retailFormCreation(api)]),
|
||||
trade_details: this.fb.array([this.tradingFormCreation(api)]),
|
||||
|
||||
@ -192,8 +192,8 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%">
|
||||
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
|
||||
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
|
||||
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
|
||||
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
|
||||
<mat-option value="Payment made through Banking channels.">Payment made through Banking channels.</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
<i class="fa-1x fa fa-phone" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
|
||||
{{applicant.landline}}
|
||||
</span>
|
||||
<span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">( Main Applicant )</span>
|
||||
<span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">( Applicant )</span>
|
||||
<ng-template #codetails><span> {{applicant.relation_name}} </span></ng-template>
|
||||
</p>
|
||||
</mat-list-item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user