assets , current loan details changes : kdk
This commit is contained in:
parent
606715f979
commit
ec5044bb9f
@ -1,70 +1,70 @@
|
||||
<!--<pre> {{ m_group | json}}</pre>-->
|
||||
|
||||
<mat-card style="min-height: 550px;" >
|
||||
<mat-card-content>
|
||||
<p>Assets Details</p>
|
||||
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_assetsQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<div formArrayName="assets_details" fxFill>
|
||||
<div *ngFor="let sup of _assetsQuesFrom.controls.assets_details['controls']; let i=index">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select (selectionChange)="selectedAssetsType($event, i)" placeholder="Assets Type" formControlName="assets_mode">
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!--Desction Dynamic details: START-->
|
||||
<div formArrayName="details" class="example-full-width">
|
||||
<!--Property-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 ">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select placeholder="Property" formControlName="property_type">
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-card style="min-height: 550px;">
|
||||
<mat-card-content>
|
||||
<p>Assets Details</p>
|
||||
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_assetsQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<div formArrayName="assets_details" fxFill>
|
||||
<div *ngFor="let sup of _assetsQuesFrom.controls.assets_details['controls']; let i=index">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select (selectionChange)="selectedAssetsType($event, i)" placeholder="Assets Type" formControlName="assets_mode">
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!--Desction Dynamic details: START-->
|
||||
<div formArrayName="details" class="example-full-width">
|
||||
<!--Property-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 ">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select placeholder="Property" formControlName="property_type">
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Four Wheeler-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 2">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!--Four Wheeler-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 2">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Two Wheeler-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 3">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!--Two Wheeler-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 3">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--jwell details
|
||||
<div *ngIf="sup.get('assets_mode').value == 4">
|
||||
</div>
|
||||
<!--jwell details -->
|
||||
<!--<div *ngIf="sup.get('assets_mode').value == 4">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
@ -77,98 +77,55 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<!--Consumer Durable-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 5">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<!--Consumer Durable-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 5">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Description" formControlName="consumer_durable_description">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Insurance-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 6">
|
||||
<div fxFill>
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type" formControlName="insurance_type">
|
||||
<mat-option *ngFor="let ins_type of m_insuranceType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Description" formControlName="consumer_durable_description">
|
||||
<input matInput placeholder="Premium Paid" formControlName="premium_paid">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode">
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Insurance-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 6">
|
||||
<div fxFill>
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type" formControlName="insurance_type">
|
||||
<mat-option *ngFor="let ins_type of m_insuranceType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Premium Paid" formControlName="premium_paid">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode">
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Sum Assured" formControlName="sum_assured">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Members Covered" formControlName="members_coverd">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Investments-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 7">
|
||||
<div>
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type" formControlName="investments_type">
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Bank Name" formControlName="bank_name">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--other assets-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 8">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets">
|
||||
<input matInput placeholder="Sum Assured" formControlName="sum_assured">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Members Covered" formControlName="members_coverd">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
@ -176,100 +133,119 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Desction Dynamic details : END -->
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value">
|
||||
<!--Investments-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 7">
|
||||
<div>
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type" formControlName="investments_type">
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Bank Name" formControlName="bank_name">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--other assets-->
|
||||
<div *ngIf="sup.get('assets_mode').value == 8">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
|
||||
<div [formGroupName]="s">
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Desction Dynamic details : END -->
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Name of the Owner" formControlName="name_of_the_owner">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 5">
|
||||
<div fxFlex="33">
|
||||
|
||||
<div>
|
||||
<label>Year and Month of Purchase?</label>
|
||||
<br>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Year" formControlName="purchase_year">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Month" formControlName="purchase_month">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 5">
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 5">
|
||||
<label>Year and Month of Purchase?</label>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Year" formControlName="purchase_year">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Month" formControlName="purchase_month">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Year" formControlName="purchase_year">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Month" formControlName="purchase_month">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
||||
|
||||
</div>
|
||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<mat-select placeholder="Is there a loan?"
|
||||
formControlName="emi">
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<mat-select placeholder="Is there a loan?" formControlName="emi">
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<!--<mat-checkbox formControlName="emi" [ngModel]="sup.get('emi').value === '1' ? true : false" (ngModelChange)="sup.get('emi').value = $event ? '1' : '0'">Is there a loan?</mat-checkbox>-->
|
||||
</div>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="EMI Paid" formControlName="emi_paid">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
||||
<div fxFlex="20">
|
||||
<span *ngIf="_assetsQuesFrom.controls.assets_details.controls.length > 1" (click)="removeLanguage(i)">
|
||||
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
||||
<div fxFlex="20">
|
||||
<span *ngIf="_assetsQuesFrom.controls.assets_details.controls.length > 1" (click)="removeLanguage(i)">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<!--<div fxLayout="row">
|
||||
</div>
|
||||
</div>
|
||||
<!--<div fxLayout="row">
|
||||
<div fxFlex="60" class="pb-0 text-sm-left">
|
||||
<mat-form-field appearance="outline" style="width: 100%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
@ -277,16 +253,16 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Asset Details" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" (click)="addSupplierDetails($event); false"><mat-icon>add</mat-icon></button>
|
||||
|
||||
<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></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Asset Details" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" (click)="addSupplierDetails($event); false"><mat-icon>add</mat-icon></button>
|
||||
|
||||
<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></button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mat-card>
|
||||
@ -297,10 +297,10 @@ public m_investmentType = [];
|
||||
return this._formBuilder.group({
|
||||
assets_mode: ['', Validators.compose([Validators.required])],
|
||||
details: this._formBuilder.array([]),
|
||||
approximate_market_value: ['', Validators.compose([Validators.required])],
|
||||
name_of_the_owner: ['', Validators.compose([Validators.required])],
|
||||
purchase_year: ['', Validators.compose([Validators.required])],
|
||||
purchase_month: ['', Validators.compose([Validators.required])],
|
||||
approximate_market_value: ['', Validators.compose([])],
|
||||
name_of_the_owner: ['', Validators.compose([])],
|
||||
purchase_year: ['', Validators.compose([])],
|
||||
purchase_month: ['', Validators.compose([])],
|
||||
emi: [''],
|
||||
emi_paid: [''],
|
||||
elapsed_tenure: [''],
|
||||
@ -323,12 +323,12 @@ public m_investmentType = [];
|
||||
}
|
||||
case '2': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Two_Four_Weeler());
|
||||
control.push(this.load_Four_Weeler());
|
||||
break;
|
||||
}
|
||||
case '3': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Two_Four_Weeler());
|
||||
control.push(this.load_Two_Weeler());
|
||||
break;
|
||||
}
|
||||
case '4': {
|
||||
@ -371,7 +371,7 @@ public m_investmentType = [];
|
||||
|
||||
loadJwellDescription() {
|
||||
return this._formBuilder.group({
|
||||
jwell_description: ['', Validators.compose([Validators.required])]
|
||||
jwell_description: ['', Validators.compose([])]
|
||||
});
|
||||
}
|
||||
|
||||
@ -405,9 +405,15 @@ public m_investmentType = [];
|
||||
});
|
||||
}
|
||||
|
||||
load_Two_Four_Weeler() {
|
||||
load_Four_Weeler() {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model: ['', Validators.compose([Validators.required])]
|
||||
manufacturer_model_four_weeler: ['', Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
load_Two_Weeler() {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model_two_weeler: ['', Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
@ -455,21 +461,28 @@ public m_investmentType = [];
|
||||
});
|
||||
}
|
||||
|
||||
load_Two_Four_WeelerWithData(data) {
|
||||
load_Four_WeelerWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model: [data.manufacturer_model, Validators.compose([Validators.required])]
|
||||
manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler, Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
load_Two_WeelerWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler, Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
initDetailsWithdata(data) {
|
||||
return this._formBuilder.group({
|
||||
assets_mode: [data.assets_mode, Validators.compose([Validators.required])],
|
||||
details: this._formBuilder.array([]),
|
||||
approximate_market_value: [data.approximate_market_value, Validators.compose([Validators.required])],
|
||||
name_of_the_owner: [data.name_of_the_owner, Validators.compose([Validators.required])],
|
||||
purchase_year: [data.purchase_year, Validators.compose([Validators.required])],
|
||||
purchase_month: [data.purchase_month, Validators.compose([Validators.required])],
|
||||
approximate_market_value: [data.approximate_market_value, Validators.compose([])],
|
||||
name_of_the_owner: [data.name_of_the_owner, Validators.compose([])],
|
||||
purchase_year: [data.purchase_year, Validators.compose([])],
|
||||
purchase_month: [data.purchase_month, Validators.compose([])],
|
||||
emi: [data.emi || 0],
|
||||
emi_paid: [data.emi_paid || ''],
|
||||
elapsed_tenure: [data.elapsed_tenure || ''],
|
||||
@ -519,12 +532,12 @@ public m_investmentType = [];
|
||||
}
|
||||
case '2': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Two_Four_WeelerWithData(data));
|
||||
control.push(this.load_Four_WeelerWithData(data));
|
||||
break;
|
||||
}
|
||||
case '3': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Two_Four_WeelerWithData(data));
|
||||
control.push(this.load_Two_WeelerWithData(data));
|
||||
break;
|
||||
}
|
||||
case '4': {
|
||||
|
||||
@ -33,63 +33,98 @@ export class ClientInfoComponent implements OnInit {
|
||||
|
||||
public _clientQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
public m_paymentModeType= [
|
||||
{
|
||||
'id': "1",
|
||||
'name': 'Immediate Or Advanced Payment'
|
||||
},
|
||||
{
|
||||
'id': "2",
|
||||
'name': 'Credit'
|
||||
},
|
||||
{
|
||||
'id': "3",
|
||||
'name': 'Combination of Both'
|
||||
},
|
||||
];
|
||||
|
||||
public m_freqOfPurchase= [
|
||||
{
|
||||
'id': "1",
|
||||
'name': 'Daily'
|
||||
},
|
||||
{
|
||||
'id': "2",
|
||||
'name': 'Weekly'
|
||||
},
|
||||
{
|
||||
'id': "3",
|
||||
'name': 'Monthly'
|
||||
},
|
||||
{
|
||||
'id': "4",
|
||||
'name': 'Every 3 months'
|
||||
},
|
||||
{
|
||||
'id': "5",
|
||||
'name': 'Half yearly'
|
||||
},
|
||||
{
|
||||
'id': "6",
|
||||
'name': 'Yearly'
|
||||
},
|
||||
{
|
||||
'id': "7",
|
||||
'name': 'As and when required'
|
||||
},
|
||||
{
|
||||
'id': "8",
|
||||
'name': 'Others'
|
||||
}
|
||||
]
|
||||
public m_paymentModeType= [];
|
||||
// public m_paymentModeType= [
|
||||
// {
|
||||
// 'id': "1",
|
||||
// 'name': 'Immediate Or Advanced Payment'
|
||||
// },
|
||||
// {
|
||||
// 'id': "2",
|
||||
// 'name': 'Credit'
|
||||
// },
|
||||
// {
|
||||
// 'id': "3",
|
||||
// 'name': 'Combination of Both'
|
||||
// },
|
||||
// ];
|
||||
public m_freqOfPurchase= [];
|
||||
// public m_freqOfPurchase= [
|
||||
// {
|
||||
// 'id': "1",
|
||||
// 'name': 'Daily'
|
||||
// },
|
||||
// {
|
||||
// 'id': "2",
|
||||
// 'name': 'Weekly'
|
||||
// },
|
||||
// {
|
||||
// 'id': "3",
|
||||
// 'name': 'Monthly'
|
||||
// },
|
||||
// {
|
||||
// 'id': "4",
|
||||
// 'name': 'Every 3 months'
|
||||
// },
|
||||
// {
|
||||
// 'id': "5",
|
||||
// 'name': 'Half yearly'
|
||||
// },
|
||||
// {
|
||||
// 'id': "6",
|
||||
// 'name': 'Yearly'
|
||||
// },
|
||||
// {
|
||||
// 'id': "7",
|
||||
// 'name': 'As and when required'
|
||||
// },
|
||||
// {
|
||||
// 'id': "8",
|
||||
// 'name': 'Others'
|
||||
// }
|
||||
// ]
|
||||
|
||||
constructor(
|
||||
private _formBuilder: FormBuilder,
|
||||
private pdTrigerService: PdTrigerService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.getM_FreqOfPurchase();
|
||||
this.getM_PaymentModeType();
|
||||
this.getClientFormDetails();
|
||||
}
|
||||
|
||||
|
||||
// ==================
|
||||
|
||||
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.";
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getM_PaymentModeType() {
|
||||
this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe(
|
||||
data => {
|
||||
this.m_paymentModeType = data.records.filter(data => data.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
// this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
// this.m_assets_type = "No Category Records Found.";
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// ==================
|
||||
|
||||
apiLoadFinish: boolean = false;
|
||||
getClientFormDetails() {
|
||||
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '2').subscribe(
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<p>Current Loan Details</p>
|
||||
<form [formGroup]="currentLoanForm" class="address">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Do you have any other existing loan"
|
||||
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan"
|
||||
formControlName="existing_loan">
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
|
||||
@ -21,7 +21,7 @@ import {
|
||||
} from '@angular/material';
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-current-loan',
|
||||
@ -35,8 +35,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
@Input() form_id: number;
|
||||
|
||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService) {
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService) {
|
||||
this.notifier = notifier;
|
||||
|
||||
}
|
||||
@ -49,18 +49,22 @@ export class CurrentLoanComponent implements OnInit {
|
||||
console.log('value', value);
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
if (value.status == 200) {
|
||||
var result = Object.keys(value.records.loan_details).map(function(key) {
|
||||
return value.records.loan_details[key];
|
||||
});
|
||||
|
||||
this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan);
|
||||
this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks);
|
||||
if (result.length > 0) {
|
||||
result.forEach(val => {
|
||||
control.push(this.createLoanDetail());
|
||||
|
||||
if (value.records.existing_loan == 'Yes') {
|
||||
var result = Object.keys(value.records.loan_details).map(function (key) {
|
||||
return value.records.loan_details[key];
|
||||
});
|
||||
this.currentLoanForm.controls['loan_details'].setValue(result);
|
||||
} else {
|
||||
control.push(this.createLoanDetail());
|
||||
if (result.length > 0) {
|
||||
result.forEach(val => {
|
||||
control.push(this.createLoanDetail());
|
||||
});
|
||||
this.currentLoanForm.controls['loan_details'].setValue(result);
|
||||
} else {
|
||||
control.push(this.createLoanDetail());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
control.push(this.createLoanDetail());
|
||||
@ -74,6 +78,16 @@ export class CurrentLoanComponent implements OnInit {
|
||||
loan_details: this.fb.array([]),
|
||||
});
|
||||
}
|
||||
|
||||
selectedLoanChanges(e): void {
|
||||
if (e.value == 'Yes') {
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
control.push(this.createLoanDetail());
|
||||
} else if (e.value == 'No') {
|
||||
const arr = <FormArray>this.currentLoanForm.controls.loan_details;
|
||||
arr.removeAt(0);
|
||||
}
|
||||
}
|
||||
createLoanDetail() {
|
||||
return this.fb.group({
|
||||
loan_amount: ['', Validators.compose([Validators.required])],
|
||||
@ -94,7 +108,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
}
|
||||
submitCurrentloan() {
|
||||
if (!this.currentLoanForm.valid) {
|
||||
return;
|
||||
console.log("data invalid")
|
||||
return;
|
||||
}
|
||||
let records: any = {};
|
||||
records.pdid = this.pdid;
|
||||
@ -102,7 +117,9 @@ export class CurrentLoanComponent implements OnInit {
|
||||
records.fk_createdby = this.pdid;
|
||||
records.existing_loan = this.currentLoanForm.controls['existing_loan'].value;
|
||||
records.currentloan_remarks = this.currentLoanForm.controls['currentloan_remarks'].value;
|
||||
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
|
||||
if (records.existing_loan == 'Yes') {
|
||||
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
|
||||
}
|
||||
console.log('data', records);
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
@ -115,7 +132,7 @@ export class CurrentLoanComponent implements OnInit {
|
||||
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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user