businees form changes
This commit is contained in:
parent
e2e165206e
commit
2e006b2085
3752
ng6-seed/package-lock.json
generated
3752
ng6-seed/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,7 @@
|
||||
"@angular/forms": "^6.0.0-rc.5",
|
||||
"@angular/http": "^6.0.0-rc.5",
|
||||
"@angular/material": "^6.0.0-rc.5",
|
||||
"@angular/material-moment-adapter": "^7.1.1",
|
||||
"@angular/platform-browser": "^6.0.0-rc.5",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0-rc.5",
|
||||
"@angular/router": "^6.0.0-rc.5",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<form [formGroup]="businessForm" class="address">
|
||||
<form [formGroup]="businessForm">
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">{{pageTitle}}</div>
|
||||
@ -17,68 +17,50 @@
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<mat-card style="padding: 12px;">
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Name of Business / Profession" formControlName="profession_name" required>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>About Business</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<div flexLayout="row wrap">
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Name in Which The Business is Run"
|
||||
formControlName="profession_name" required>
|
||||
<mat-option value="{{company}}" *ngFor="let company of existCompanyList">{{company | titlecase}}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.profession_name.value=='Others'">
|
||||
<input matInput placeholder="Other Name in Which The Business is Run" formControlName="profession_name_other" required>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div flexLayout="row wrap">
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Business Entity Type"
|
||||
formControlName="business_entity_type" required>
|
||||
<mat-option value="{{entity}}" *ngFor="let entity of businessEntityTypeList">{{entity | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='Others'">
|
||||
<input matInput placeholder="Other Business Entity Type" formControlName="business_entity_type_other" required>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Business Experience in Year" formControlName="business_years" required min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" placeholder="Business Experience in Month" formControlName="business_month" required min='0' max='12'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 45%">
|
||||
<mat-select placeholder="Industry"
|
||||
formControlName="industry" required>
|
||||
formControlName="industry">
|
||||
<mat-option value="{{list.industry_classification_id}}" *ngFor="let list of industryData">{{list.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type of Activity"
|
||||
formControlName="type_of_activity" requried>
|
||||
<mat-option value="{{type.type_of_activity_id}}" *ngFor="let type of activityData">{{type.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="businessForm.controls['type_of_activity'].value == 5">
|
||||
<input matInput placeholder="Specify Other Activity"
|
||||
formControlName="other_activity_type">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<!-- <input matInput placeholder="Seasonality" formControlName="seasonality" required> -->
|
||||
<mat-select placeholder="Is the business Seasonal?"
|
||||
formControlName="seasonality" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="businessForm.controls['seasonality'].value == 'yes'">
|
||||
<input matInput placeholder="How many months in a year does the business run?" formControlName="month_of_business_run">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="businessForm.controls['seasonality'].value == 'yes'">
|
||||
<mat-select multiple placeholder="What is the peak period of business ? "
|
||||
formControlName="peak_period_of_business" required>
|
||||
<mat-option value="1">January</mat-option>
|
||||
<mat-option value="2">February</mat-option>
|
||||
<mat-option value="3">March</mat-option>
|
||||
<mat-option value="4">April</mat-option>
|
||||
<mat-option value="5">May</mat-option>
|
||||
<mat-option value="6">June</mat-option>
|
||||
<mat-option value="7">July</mat-option>
|
||||
<mat-option value="8">August</mat-option>
|
||||
<mat-option value="9">September</mat-option>
|
||||
<mat-option value="10">October</mat-option>
|
||||
<mat-option value="11">November</mat-option>
|
||||
<mat-option value="12">December</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<!--<mat-card>
|
||||
<mat-card-header>
|
||||
@ -107,89 +89,39 @@
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>-->
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Who started the business / professions"
|
||||
formControlName="who_started" required>
|
||||
<mat-option value="applicant">Started by Applicants</mat-option>
|
||||
<mat-option value="family_business">Family Business</mat-option>
|
||||
<mat-option value="others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="businessForm.controls['who_started'].value == 'others'">
|
||||
<input matInput placeholder="Specify Other Bussiness Started"
|
||||
formControlName="other_bussiness_who_started">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Main person running the businesss"
|
||||
formControlName="main_person" required>
|
||||
<!-- <mat-option value="applicants">One of the applicants</mat-option> -->
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||
<mat-option value="Relative">Relative of an applicant</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="businessForm.controls['main_person'].value == 'Others'">
|
||||
<input matInput placeholder="Specify other person"
|
||||
formControlName="other_main_person">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select multiple placeholder="Other family members invovled"
|
||||
formControlName="family_members_involved" (selectionChange)="relationChanged($event)" required>
|
||||
<mat-option value="{{member.relationship_id}}" *ngFor="let member of relationData">{{member.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<!-- <input matInput placeholder="Any other business before"
|
||||
formControlName="before_business" required> -->
|
||||
<mat-select placeholder="Were the loan applicants involved in any other business before starting this business?"
|
||||
formControlName="before_business" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="businessForm.controls['before_business'].value == 'yes'">
|
||||
<input matInput placeholder="Description for before starting this business"
|
||||
formControlName="before_business_description">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Any delays"
|
||||
formControlName="any_delays" required>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Partners / Directors / Shareholders
|
||||
</p>
|
||||
<p>{{businessForm.controls.business_entity_type.value =='Others' ? businessForm.controls.business_entity_type_other.value : sourceNames[businessForm.controls.business_entity_type.value]}}</p>
|
||||
</mat-card-header>
|
||||
<div formArrayName="partners">
|
||||
<div *ngFor="let members of businessForm.controls.partners['controls']; let i=index"
|
||||
<mat-card-content formArrayName="partners">
|
||||
<mat-card *ngFor="let members of businessForm.controls.partners['controls']; let i=index"
|
||||
[formGroupName]="i">
|
||||
<mat-card-content class="card">
|
||||
<mat-form-field>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput placeholder="Name"
|
||||
formControlName="partner_name" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput placeholder="Share of Profit / Shareholding (%)" (keypress)="keyPress($event)"
|
||||
formControlName="shareholding" required>
|
||||
</mat-form-field>
|
||||
<div>
|
||||
<label>How many years and month in this business</label>
|
||||
<br>
|
||||
<div fxLayout="col" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<p style="padding-left: 2% !important">No of Years in Current Business</p>
|
||||
<mat-form-field style="width: 20%;">
|
||||
<input matInput type="number" placeholder="Year" formControlName="current_business_experiance_year" required min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 21%;">
|
||||
<input matInput type="number" placeholder="Month" formControlName="current_business_experiance_month" required min='0' max='12'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 35%;">
|
||||
<input matInput placeholder="Total Business Experience"
|
||||
formControlName="total_business_experiance" required>
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addPartnerDetails()"
|
||||
matTooltip="Add More Partners / Directors / Shareholders" matTooltipPosition="above" color="primary" *ngIf="i==0">
|
||||
matTooltip="Add More" matTooltipPosition="above" color="primary" *ngIf="i==0">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="deletePartnerDetails(i)"
|
||||
@ -197,12 +129,566 @@
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-card>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Employees As per applicant
|
||||
<p>Number of Years For Which The Business Has Been Running</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 20%;">
|
||||
<input matInput type="number" placeholder="Year" formControlName="business_years" required min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 20%;">
|
||||
<input matInput type="number" placeholder="Month" formControlName="business_month" required min='0' max='12'>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 30%;">
|
||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="business_date_object" placeholder="Choose a date">
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>List of Persons With Relationships</p>
|
||||
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
|
||||
<mat-table [dataSource]="relationSource" *ngIf="businessForm.controls.persons_with_relationships['controls'].length>0" formArrayName="persons_with_relationships">
|
||||
|
||||
<ng-container matColumnDef="family_member_name">
|
||||
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
{{details.value.family_member_name | titlecase}} ( {{ details.value.other_family_relationship_name | titlecase}})
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="relation_to">
|
||||
<mat-header-cell *matHeaderCellDef> Relationship To </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
{{details.value.relation_to | titlecase}}
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="relationship">
|
||||
<mat-header-cell *matHeaderCellDef> Relationship With Company </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
{{details.value.relationship_with_company | titlecase}}
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="started_business">
|
||||
<mat-header-cell *matHeaderCellDef class="mat-header-color"> Started Business </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="started_business">
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="currently_active_status">
|
||||
<mat-header-cell *matHeaderCellDef class="mat-header-color"> Currently Actively Involved In Running The Business </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="currently_active_status">
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="otherFamilyMemberDialogue()"
|
||||
matTooltip="Add Other Family Members" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Type of Business Activity</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<!-- <mat-select placeholder="Type of Activity"
|
||||
formControlName="type_of_business_activity" required>
|
||||
<mat-option value="{{type.type_of_activity_id}}" *ngFor="let type of activityData">{{type.name}}</mat-option>
|
||||
</mat-select> -->
|
||||
<div fxLayout="row wrap" class="example-section" formArrayName="select_business_activity_type">
|
||||
<div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" *ngFor="let entityType of businessForm.controls.select_business_activity_type['controls']; let e = index;" [formGroupName]="e">
|
||||
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status" (click)="changeBusinessActivity(entityType)">{{entityType.controls.name.value | titlecase}}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<mat-card *ngIf="businessForm.controls.manufacturing_activity_details['controls'].length>0">
|
||||
<mat-card-header>
|
||||
<p>Manufacturing Details</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="manufacturing_activity_details">
|
||||
<mat-card *ngFor="let manufacturing of businessForm.controls.manufacturing_activity_details['controls']; let m=index" [formGroupName]="m">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeManufacturingAreaSale(manufacturing,m)" required>
|
||||
<mat-option value="Within India">Within India</mat-option>
|
||||
<mat-option value="Export">Export</mat-option>
|
||||
<!-- <mat-option value="Both">Both</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<ng-container *ngIf="manufacturing.value.india_where_sale_done !=undefined">
|
||||
<div formArrayName="india_where_sale_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<mat-select placeholder="State" formControlName="state_name" required>
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select multiple formControlName="city_name" placeholder="City" required>
|
||||
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreState(m,'1')" *ngIf="s==0"
|
||||
matTooltip="Add More State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeState(m,s,'1')" *ngIf="s>0"
|
||||
matTooltip="Remove State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined">
|
||||
<div formArrayName="countries_where_export_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
|
||||
</mat-form-field>
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreState(m,'2')" *ngIf="c==0"
|
||||
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeState(m,c,'2')" *ngIf="c>0"
|
||||
matTooltip="Remove Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<mat-form-field style="width: 92%">
|
||||
<mat-label>Description of Manufacturing</mat-label>
|
||||
<textarea matInput placeholder="Description of Manufacturing" formControlName="description"></textarea>
|
||||
</mat-form-field>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreManufacturing()"
|
||||
matTooltip="Add More Manufacturing Details" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card *ngIf="businessForm.controls.retail_trading_activity_details['controls'].length>0">
|
||||
<mat-card-header>
|
||||
<p>Retail Trading</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="retail_trading_activity_details">
|
||||
<mat-card *ngFor="let retail of businessForm.controls.retail_trading_activity_details['controls']; let r=index" [formGroupName]="r">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeRetailAreaSale(retail,r)" required>
|
||||
<mat-option value="Within India">Within India</mat-option>
|
||||
<mat-option value="Export">Export</mat-option>
|
||||
<!-- <mat-option value="Both">Both</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<ng-container *ngIf="retail.value.india_where_sale_done !=undefined">
|
||||
<div formArrayName="india_where_sale_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<mat-select placeholder="State" formControlName="state_name" required>
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select multiple formControlName="city_name" placeholder="City" required>
|
||||
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addRetailMoreState(r,'1')" *ngIf="s==0"
|
||||
matTooltip="Add More State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeRetailState(r,s,'1')" *ngIf="s>0"
|
||||
matTooltip="Remove State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="retail.value.countries_where_export_done !=undefined">
|
||||
<div formArrayName="countries_where_export_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
|
||||
</mat-form-field>
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addRetailMoreState(r,'2')" *ngIf="c==0"
|
||||
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeRetailState(r,c,'2')" *ngIf="c>0"
|
||||
matTooltip="Remove Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<mat-form-field style="width: 92%">
|
||||
<mat-label>Description of Retail Trading</mat-label>
|
||||
<textarea matInput placeholder="Description of Retail Trading" formControlName="description"></textarea>
|
||||
</mat-form-field>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreRetail()"
|
||||
matTooltip="Add More Retail Details" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card *ngIf="businessForm.controls.wholesale_trading_activity_details['controls'].length>0">
|
||||
<mat-card-header>
|
||||
<p>Wholesale Trade</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="wholesale_trading_activity_details">
|
||||
<mat-card *ngFor="let wholesale of businessForm.controls.wholesale_trading_activity_details['controls']; let w=index" [formGroupName]="w">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeWholesaleAreaSale(wholesale,w)" required>
|
||||
<mat-option value="Within India">Within India</mat-option>
|
||||
<mat-option value="Export">Export</mat-option>
|
||||
<!-- <mat-option value="Both">Both</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<ng-container *ngIf="wholesale.value.india_where_sale_done !=undefined">
|
||||
<div formArrayName="india_where_sale_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<mat-select placeholder="State" formControlName="state_name" required>
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select multiple formControlName="city_name" placeholder="City" required>
|
||||
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addWholesaleMoreState(w,'1')" *ngIf="s==0"
|
||||
matTooltip="Add More State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeWholesaleState(w,s,'1')" *ngIf="s>0"
|
||||
matTooltip="Remove State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="wholesale.value.countries_where_export_done !=undefined">
|
||||
<div formArrayName="countries_where_export_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
|
||||
</mat-form-field>
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addWholesaleMoreState(w,'2')" *ngIf="c==0"
|
||||
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeWholesaleState(w,c,'2')" *ngIf="c>0"
|
||||
matTooltip="Remove Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<mat-form-field style="width: 92%">
|
||||
<mat-label>Description of Wholesale Trade</mat-label>
|
||||
<textarea matInput placeholder="Description of Wholesale Trade" formControlName="description"></textarea>
|
||||
</mat-form-field>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreWholesale()"
|
||||
matTooltip="Add More Wholesale Details" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card *ngIf="businessForm.controls.service_provider_activity_details['controls'].length>0">
|
||||
<mat-card-header>
|
||||
<p>Service Provider Details</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="service_provider_activity_details">
|
||||
<mat-card *ngFor="let serviceprovider of businessForm.controls.service_provider_activity_details['controls']; let sp=index" [formGroupName]="sp">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<input matInput type="text" placeholder="Services Provided" formControlName="main_products" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select formControlName="area_of_sale" placeholder="Area of Service" (selectionChange)="changeServiceArea(serviceprovider,sp)" required>
|
||||
<mat-option value="Within India">Within India</mat-option>
|
||||
<mat-option value="Export">Export</mat-option>
|
||||
<!-- <mat-option value="Both">Both</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<ng-container *ngIf="serviceprovider.value.india_where_sale_done !=undefined">
|
||||
<div formArrayName="india_where_sale_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required>
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select multiple formControlName="city_name" placeholder="City" required>
|
||||
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addServiceMoreState(sp,'1')" *ngIf="s==0"
|
||||
matTooltip="Add More State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeServiceState(sp,s,'1')" *ngIf="s>0"
|
||||
matTooltip="Remove State" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="serviceprovider.value.countries_where_export_done !=undefined">
|
||||
<div formArrayName="countries_where_export_done">
|
||||
<div fxLayout="row nowrap" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
|
||||
|
||||
<mat-form-field style="width:35%;">
|
||||
<input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%;">
|
||||
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
|
||||
</mat-form-field>
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addServiceMoreState(sp,'2')" *ngIf="c==0"
|
||||
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeServiceState(sp,c,'2')" *ngIf="c>0"
|
||||
matTooltip="Remove Country" matTooltipPosition="right" color="primary">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<mat-form-field style="width: 92%">
|
||||
<mat-label>Description of Service Provider</mat-label>
|
||||
<textarea matInput placeholder="Description of Service Provider" formControlName="description"></textarea>
|
||||
</mat-form-field>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreServiceprovider()"
|
||||
matTooltip="Add More Service Provider Details" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card *ngIf="businessForm.controls.others_activity_details['controls'].length>0">
|
||||
<mat-card-header>
|
||||
<p>Other Details</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="others_activity_details">
|
||||
<mat-card *ngFor="let others of businessForm.controls.others_activity_details['controls']; let o=index" [formGroupName]="o">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width:92%;">
|
||||
<textarea matInput placeholder="Other Details" formControlName="others_details" required></textarea>
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreOthersActivity()"
|
||||
matTooltip="Add More Details" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<div fxLayout="row nowrap">
|
||||
<mat-form-field style="width: 60%">
|
||||
<mat-select placeholder="Either Currently Running The Business / Are Loan Applicants"
|
||||
formControlName="main_person" required>
|
||||
<!-- <mat-option value="applicants">One of the applicants</mat-option> -->
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||
<mat-option value="Relative">Relative of An Applicant</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%" *ngIf="businessForm.controls['main_person'].value == 'Others'">
|
||||
<input matInput placeholder="Specify other person"
|
||||
formControlName="other_main_person">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row nowrap">
|
||||
<mat-form-field style="width: 60%">
|
||||
<mat-select placeholder="Were They Involved In Any Other Business Before Starting This Business"
|
||||
formControlName="before_business" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row nowrap">
|
||||
<mat-form-field style="width: 60%" *ngIf="businessForm.controls['before_business'].value == 'yes'">
|
||||
<textarea matInput placeholder="Description For Before Starting This Business"
|
||||
formControlName="before_business_description"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<mat-form-field style="width: 28%">
|
||||
<!-- <input matInput placeholder="Seasonality" formControlName="seasonality" required> -->
|
||||
<mat-select placeholder="Is The Business Seasonal"
|
||||
formControlName="seasonality" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No Major Changes In Sales </mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 60%" *ngIf="businessForm.controls['seasonality'].value == 'yes'">
|
||||
<mat-select multiple placeholder="In Which Period Is Maximum Sale / Service Done "
|
||||
formControlName="peak_period_of_business" required>
|
||||
<mat-option value="1">January</mat-option>
|
||||
<mat-option value="2">February</mat-option>
|
||||
<mat-option value="3">March</mat-option>
|
||||
<mat-option value="4">April</mat-option>
|
||||
<mat-option value="5">May</mat-option>
|
||||
<mat-option value="6">June</mat-option>
|
||||
<mat-option value="7">July</mat-option>
|
||||
<mat-option value="8">August</mat-option>
|
||||
<mat-option value="9">September</mat-option>
|
||||
<mat-option value="10">October</mat-option>
|
||||
<mat-option value="11">November</mat-option>
|
||||
<mat-option value="12">December</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div fxLayout="row nowrap" *ngIf="businessForm.controls['seasonality'].value == 'yes'">
|
||||
<mat-form-field style="width: 60%">
|
||||
<textarea matInput placeholder="Comments" formControlName="month_of_business_run" required></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field>
|
||||
<input matInput placeholder="Any delays"
|
||||
formControlName="any_delays" required>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Employees As Per Applicant
|
||||
</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="matcard">
|
||||
@ -222,7 +708,7 @@
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>No of Employees sighted by PD officer during his visit
|
||||
<p>No of Employees Sighted Ny PD Officer During His Visit
|
||||
</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="matcard">
|
||||
@ -242,7 +728,7 @@
|
||||
</mat-card>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<p>Investment in business by Applicants
|
||||
<p>Investment In Business By Applicants
|
||||
</p>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="matcard">
|
||||
@ -380,7 +866,6 @@
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
@ -517,3 +1002,4 @@
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
<notifier-container></notifier-container>
|
||||
@ -116,3 +116,20 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.mat-header-color{
|
||||
color:#e00201;
|
||||
}
|
||||
mat-header-cell mat-cell {
|
||||
display:flex;
|
||||
justify-content:flex-end;
|
||||
}
|
||||
|
||||
.example-section {
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.example-margin {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
|
||||
@ -17,11 +17,13 @@ import { NotifierService } from 'angular-notifier';
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA
|
||||
MAT_DIALOG_DATA, MatTableDataSource
|
||||
} from '@angular/material';
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {DatePipe } from '@angular/common';
|
||||
import { BusinessOtherFamilyMemberComponent } from './../dialogue/business-other-family-member/business-other-family-member.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-business-info',
|
||||
@ -29,23 +31,32 @@ import {ActivatedRoute, Router} from "@angular/router";
|
||||
styleUrls: ['./business-info.component.scss']
|
||||
})
|
||||
export class BusinessInfoComponent implements OnInit {
|
||||
pipe = new DatePipe('en-US');
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
pageTitle: string ="Business Details";
|
||||
relationData: any = [];
|
||||
industryData: any = [];
|
||||
activityData: any = [];
|
||||
stateList: any = [];
|
||||
relativeNames: any;
|
||||
applicants: any;
|
||||
public businessForm: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
|
||||
existCompanyList: any = [];
|
||||
businessEntityTypeList: any=["Private Limited Company","Proprietorship","Partnership","Limited Liability Partnership (LLP)","One Person Company (OPC)","Hindu Undivided Family (HUF)","Society","Cooperative","Trust","Public Ltd Company","Others"]
|
||||
// this is for automatic bind entitity name for display
|
||||
sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'};
|
||||
maxDate:any;
|
||||
public relationSource= new MatTableDataSource();
|
||||
displayedColumns = ['family_member_name','relation_to','relationship','started_business','currently_active_status'];
|
||||
constructor(notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
|
||||
//this.adapter.setLocale('fr');
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||
this.form_id = 13;
|
||||
@ -53,10 +64,12 @@ export class BusinessInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
let get_max_date = this.pd_all_details.pdmaster_details.pd_date_of_initiation.split('/').reverse().join("/");
|
||||
this.maxDate = new Date(get_max_date);
|
||||
this.getRelation();
|
||||
this.getIndustry();
|
||||
this.getActivity();
|
||||
this.getStateCityList();
|
||||
this.initBusinessForm();
|
||||
// const Desgn = <FormArray>this.businessForm.controls['designation'];
|
||||
// const Partnr = <FormArray>this.businessForm.controls['partners'];
|
||||
@ -66,11 +79,20 @@ export class BusinessInfoComponent implements OnInit {
|
||||
params.pd_form_id = this.form_id;
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
let businessVal = data.records;
|
||||
console.log('data', businessVal);
|
||||
let constVal: any;
|
||||
//const Desgn = <FormArray>this.businessForm.controls['designation'];
|
||||
const Partnr = <FormArray>this.businessForm.controls['partners'];
|
||||
const otherDoc = <FormArray>this.businessForm.controls['documents'];
|
||||
const personRel = <FormArray>this.businessForm.controls['persons_with_relationships'];
|
||||
const businessActivityControl = <FormArray>this.businessForm.controls['select_business_activity_type'];
|
||||
const manufacturingControl:any = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
|
||||
const retailControl: any = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
|
||||
const wholesaleControl: any = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
|
||||
const serviceProviderControl: any = <FormArray>this.businessForm.controls['service_provider_activity_details'];
|
||||
const othersControl: any = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||
|
||||
|
||||
|
||||
if (data.status == 200) {
|
||||
let DocArray: any;
|
||||
// let DesgnArray = Object.keys(data.records.designation).map(function (key) {
|
||||
@ -80,16 +102,6 @@ export class BusinessInfoComponent implements OnInit {
|
||||
return data.records.partners[key];
|
||||
});
|
||||
|
||||
let selectedMembers = Object.keys(data.records.family_members_involved).map(function (key) {
|
||||
return data.records.family_members_involved[key];
|
||||
});
|
||||
let enduse: any = [];
|
||||
let existRelative: any =[];
|
||||
selectedMembers.forEach(val => {
|
||||
enduse.push(val.member);
|
||||
existRelative.push(val);
|
||||
});
|
||||
this.relativeNames = existRelative;
|
||||
// if (DesgnArray.length == 0) {
|
||||
// Desgn.push(this.createDesignation());
|
||||
// } else {
|
||||
@ -122,25 +134,294 @@ export class BusinessInfoComponent implements OnInit {
|
||||
// if (data.records.ownership_setup != 'rented') {
|
||||
// businessVal.rent_paid = '';
|
||||
// }
|
||||
businessVal.family_members_involved = enduse;
|
||||
|
||||
// person with relation ship
|
||||
|
||||
businessVal.pdid = this.pdid;
|
||||
businessVal.formid = this.form_id;
|
||||
businessVal.fk_createdby = this.pdid;
|
||||
//businessVal.designation = DesgnArray;
|
||||
businessVal.partners = PartnrArray;
|
||||
businessVal.documents = DocArray;
|
||||
if(data.records.persons_with_relationships){
|
||||
let selectedFamilyMember = Object.keys(data.records.persons_with_relationships).map(function (key) {
|
||||
return data.records.persons_with_relationships[key];
|
||||
});
|
||||
if(selectedFamilyMember.length > 0) {
|
||||
selectedFamilyMember.forEach(val=>{
|
||||
personRel.push(this.createPersonRelationhip(val));
|
||||
});
|
||||
businessVal.persons_with_relationships=selectedFamilyMember;
|
||||
|
||||
}
|
||||
else{
|
||||
businessVal.persons_with_relationships=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.persons_with_relationships=[];
|
||||
|
||||
}
|
||||
|
||||
// find exist and non-exist businees activity type list
|
||||
let activityData=this.activityData.map(item=>({name : item.name,type_of_activity_id : item.type_of_activity_id}))
|
||||
let exist_activity_data: any=[];
|
||||
if(data.records.select_business_activity_type){
|
||||
exist_activity_data=Object.keys(data.records.select_business_activity_type).map(function(key) {
|
||||
return data.records.select_business_activity_type[key].type_of_activity_id;
|
||||
});
|
||||
}
|
||||
|
||||
let actual_businees_activity = activityData.map(item => item.type_of_activity_id);
|
||||
let check_exist_businees_activity =actual_businees_activity.map((id, index) => {
|
||||
if (exist_activity_data.indexOf(id) < 0) {
|
||||
activityData[index].exist_status=0;
|
||||
return activityData[index];
|
||||
}
|
||||
else{
|
||||
activityData[index].exist_status=1;
|
||||
return activityData[index];
|
||||
}
|
||||
}).filter(item => item != undefined);
|
||||
|
||||
if(check_exist_businees_activity.length > 0)
|
||||
{
|
||||
check_exist_businees_activity.forEach(val => {
|
||||
businessActivityControl.push(this.createEntityType(val));
|
||||
});
|
||||
businessVal.select_business_activity_type=check_exist_businees_activity;
|
||||
}
|
||||
|
||||
// dynamically add form group control
|
||||
if(data.dataStatus){
|
||||
if(data.records.profession_name.toUpperCase()=='OTHERS'){
|
||||
this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required));
|
||||
}
|
||||
|
||||
if(data.records.business_entity_type.toUpperCase()=='OTHERS'){
|
||||
this.businessForm.addControl('business_entity_type_other', new FormControl('', Validators.required));
|
||||
}
|
||||
if(data.records.seasonality.toUpperCase()=='YES'){
|
||||
this.businessForm.addControl('peak_period_of_business', new FormControl('', Validators.required));
|
||||
this.businessForm.addControl('month_of_business_run', new FormControl('', Validators.required)); }
|
||||
|
||||
}
|
||||
if(data.records.manufacturing_activity_details){
|
||||
// update manufacturing details
|
||||
let selectedManufacturing = Object.keys(data.records.manufacturing_activity_details).map(function (key) {
|
||||
return data.records.manufacturing_activity_details[key];
|
||||
});
|
||||
if(selectedManufacturing.length > 0) {
|
||||
selectedManufacturing.forEach((element,index)=>{
|
||||
manufacturingControl.push(this.createActivity());
|
||||
if(element.area_of_sale=='Within India'){
|
||||
manufacturingControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
|
||||
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = manufacturingControl.controls[index].get('india_where_sale_done') as FormArray;
|
||||
innercontrol.push(this.createStateSale())
|
||||
});
|
||||
}
|
||||
else if(element.area_of_sale=='Export'){
|
||||
manufacturingControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
|
||||
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = manufacturingControl.controls[index].get('countries_where_export_done') as FormArray;
|
||||
innercontrol.push(this.createCountrySale())
|
||||
});
|
||||
}
|
||||
});
|
||||
businessVal.manufacturing_activity_details=selectedManufacturing;
|
||||
}
|
||||
else{
|
||||
businessVal.manufacturing_activity_details=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.manufacturing_activity_details=[];
|
||||
}
|
||||
// update retail trading
|
||||
if(data.records.retail_trading_activity_details){
|
||||
|
||||
let selectedRetail = Object.keys(data.records.retail_trading_activity_details).map(function (key) {
|
||||
return data.records.retail_trading_activity_details[key];
|
||||
});
|
||||
if(selectedRetail.length > 0) {
|
||||
selectedRetail.forEach((element,index)=>{
|
||||
retailControl.push(this.createActivity());
|
||||
if(element.area_of_sale=='Within India'){
|
||||
retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
|
||||
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray;
|
||||
innercontrol.push(this.createStateSale())
|
||||
});
|
||||
}
|
||||
else if(element.area_of_sale=='Export'){
|
||||
retailControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
|
||||
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = retailControl.controls[index].get('countries_where_export_done') as FormArray;
|
||||
innercontrol.push(this.createCountrySale())
|
||||
});
|
||||
}
|
||||
});
|
||||
businessVal.retail_trading_activity_details=selectedRetail;
|
||||
}
|
||||
else{
|
||||
businessVal.retail_trading_activity_details=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.retail_trading_activity_details=[];
|
||||
|
||||
}
|
||||
|
||||
// update whole sale details
|
||||
if(data.records.wholesale_trading_activity_details){
|
||||
let selectedWholesale = Object.keys(data.records.wholesale_trading_activity_details).map(function (key) {
|
||||
return data.records.wholesale_trading_activity_details[key];
|
||||
});
|
||||
if(selectedWholesale.length > 0) {
|
||||
selectedWholesale.forEach((element,index)=>{
|
||||
wholesaleControl.push(this.createActivity());
|
||||
if(element.area_of_sale=='Within India'){
|
||||
wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
|
||||
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray;
|
||||
innercontrol.push(this.createStateSale())
|
||||
});
|
||||
}
|
||||
else if(element.area_of_sale=='Export'){
|
||||
wholesaleControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
|
||||
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = wholesaleControl.controls[index].get('countries_where_export_done') as FormArray;
|
||||
innercontrol.push(this.createCountrySale())
|
||||
});
|
||||
}
|
||||
});
|
||||
businessVal.wholesale_trading_activity_details=selectedWholesale;
|
||||
}
|
||||
else{
|
||||
businessVal.wholesale_trading_activity_details=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.wholesale_trading_activity_details=[];
|
||||
|
||||
}
|
||||
// update service provider details
|
||||
if(data.records.service_provider_activity_details){
|
||||
|
||||
let selectedService = Object.keys(data.records.service_provider_activity_details).map(function (key) {
|
||||
return data.records.service_provider_activity_details[key];
|
||||
});
|
||||
if(selectedService.length > 0) {
|
||||
selectedService.forEach((element,index)=>{
|
||||
serviceProviderControl.push(this.createServiceActivity());
|
||||
if(element.area_of_sale=='Within India'){
|
||||
serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
|
||||
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray;
|
||||
innercontrol.push(this.createStateSale())
|
||||
});
|
||||
}
|
||||
else if(element.area_of_sale=='Export'){
|
||||
serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
|
||||
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
|
||||
let innercontrol:any = serviceProviderControl.controls[index].get('countries_where_export_done') as FormArray;
|
||||
innercontrol.push(this.createCountrySale())
|
||||
});
|
||||
}
|
||||
});
|
||||
businessVal.service_provider_activity_details=selectedService;
|
||||
}
|
||||
else{
|
||||
businessVal.service_provider_activity_details=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.service_provider_activity_details=[];
|
||||
|
||||
}
|
||||
if(data.records.others_activity_details){
|
||||
|
||||
// update others activity details
|
||||
let selectedOthers = Object.keys(data.records.others_activity_details).map(function (key) {
|
||||
return data.records.others_activity_details[key];
|
||||
});
|
||||
if(selectedOthers.length > 0) {
|
||||
selectedOthers.forEach((element,index)=>{
|
||||
othersControl.push(this.createOthersActivity());
|
||||
});
|
||||
businessVal.others_activity_details=selectedOthers;
|
||||
}
|
||||
else{
|
||||
businessVal.others_activity_details=[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
businessVal.others_activity_details=[];
|
||||
|
||||
}
|
||||
this.businessForm.setValue(businessVal);
|
||||
} else {
|
||||
//Desgn.push(this.createDesignation());
|
||||
Partnr.push(this.createPartners());
|
||||
otherDoc.push(this.createDocument());
|
||||
|
||||
// find business activity type businees activity type list
|
||||
let activityData=this.activityData.map(item=>({name : item.name,type_of_activity_id : item.type_of_activity_id,exist_status:0}))
|
||||
if(activityData.length > 0)
|
||||
{
|
||||
activityData.forEach(val => {
|
||||
businessActivityControl.push(this.createEntityType(val));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
// Desgn.push(this.createDesignation());
|
||||
// Partnr.push(this.createPartners());
|
||||
// otherDoc.push(this.createDocument());
|
||||
|
||||
// load exist company list from master
|
||||
this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name);
|
||||
|
||||
this.businessForm.controls['profession_name'].valueChanges.subscribe(val => {
|
||||
val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('profession_name_other');
|
||||
});
|
||||
this.businessForm.controls['business_entity_type'].valueChanges.subscribe(val => {
|
||||
val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('business_entity_type_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('business_entity_type_other');
|
||||
});
|
||||
this.businessForm.controls['business_date_object'].valueChanges.subscribe(val=>{
|
||||
|
||||
let pd_initiation_date:string = this.pd_all_details.pdmaster_details.pd_date_of_initiation.split('/').reverse().join("/");
|
||||
let selected_date = this.pipe.transform(val, 'yyyy/MM/dd'); ;
|
||||
let diffInMs: number = Date.parse(pd_initiation_date) - Date.parse(selected_date);
|
||||
let diff: number = Math.floor(diffInMs / 1000);
|
||||
diff /= (60 * 60 * 24 * 30);
|
||||
diff=Math.abs(Math.round(diff));
|
||||
if(this.businessForm.controls['business_date_object'].value){
|
||||
this.businessForm.controls['business_years'].setValue(0);
|
||||
this.businessForm.controls['business_month'].setValue(0);
|
||||
}
|
||||
|
||||
if(diff){
|
||||
this.businessForm.controls['business_years'].setValue(Math.floor(diff / 12));
|
||||
this.businessForm.controls['business_month'].setValue(Math.floor(diff % 12));
|
||||
}
|
||||
|
||||
});
|
||||
// change relation with businees update dat sorce table
|
||||
this.businessForm.controls['persons_with_relationships'].valueChanges.subscribe(val=>{
|
||||
let relationControl = <FormArray>this.businessForm.controls['persons_with_relationships'];
|
||||
this.relationSource.data =relationControl.controls;
|
||||
});
|
||||
|
||||
// change business sessional
|
||||
this.businessForm.controls['seasonality'].valueChanges.subscribe(val => {
|
||||
val.toUpperCase()=='YES' ? this.businessForm.addControl('peak_period_of_business', new FormControl('', Validators.required)) : this.businessForm.removeControl('peak_period_of_business');
|
||||
val.toUpperCase()=='YES' ? this.businessForm.addControl('month_of_business_run', new FormControl('', Validators.required)) : this.businessForm.removeControl('month_of_business_run');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
public initBusinessForm(): void {
|
||||
this.businessForm = this.fb.group({
|
||||
@ -148,14 +429,14 @@ export class BusinessInfoComponent implements OnInit {
|
||||
formid: this.form_id,
|
||||
fk_createdby: this.pdid,
|
||||
profession_name: ['', Validators.compose([Validators.required])],
|
||||
business_entity_type: ['', Validators.compose([Validators.required])],
|
||||
business_years: ['', Validators.compose([Validators.required])],
|
||||
business_month: ['', Validators.compose([Validators.required])],
|
||||
industry: ['', Validators.compose([Validators.required])],
|
||||
type_of_activity: ['', Validators.compose([Validators.required])],
|
||||
other_activity_type : [''],
|
||||
business_date_object: [''],
|
||||
industry: [''],
|
||||
seasonality: ['', Validators.compose([Validators.required])],
|
||||
month_of_business_run : [''],
|
||||
peak_period_of_business : [''],
|
||||
//month_of_business_run : [''],
|
||||
// peak_period_of_business : [''],
|
||||
//designation: this.fb.array([]),
|
||||
partners: this.fb.array([]),
|
||||
employees_total: ['', Validators.compose([Validators.required])],
|
||||
@ -180,16 +461,141 @@ export class BusinessInfoComponent implements OnInit {
|
||||
other_documents: ['', Validators.compose([Validators.required])],
|
||||
documents: this.fb.array([]),
|
||||
business_remarks: ['', Validators.compose([Validators.required])],
|
||||
who_started: ['', Validators.compose([Validators.required])],
|
||||
other_bussiness_who_started : [''],
|
||||
main_person: ['', Validators.compose([Validators.required])],
|
||||
other_main_person: [''],
|
||||
family_members_involved: ['', Validators.compose([Validators.required])],
|
||||
before_business: ['', Validators.compose([Validators.required])],
|
||||
before_business_description: [''],
|
||||
any_delays: ['', Validators.compose([Validators.required])],
|
||||
//any_delays: ['', Validators.compose([Validators.required])],
|
||||
persons_with_relationships:this.fb.array([]),
|
||||
select_business_activity_type: this.fb.array([]),
|
||||
manufacturing_activity_details: this.fb.array([]),
|
||||
retail_trading_activity_details: this.fb.array([]),
|
||||
wholesale_trading_activity_details: this.fb.array([]),
|
||||
service_provider_activity_details: this.fb.array([]),
|
||||
others_activity_details: this.fb.array([]),
|
||||
});
|
||||
}
|
||||
|
||||
// businees activity type change event
|
||||
changeBusinessActivity(event: any){
|
||||
if(event.value.exist_status==true && event.value.type_of_activity_id==1){
|
||||
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
|
||||
// manufacturingControl.controls = [];
|
||||
//manufacturingControl.setValue([]);
|
||||
manufacturingControl.controls.forEach((element,index) => {
|
||||
manufacturingControl.removeAt(index);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
else if(event.value.exist_status==false && event.value.type_of_activity_id==1){
|
||||
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
|
||||
manufacturingControl.push(this.createActivity());
|
||||
}
|
||||
if(event.value.exist_status==true && event.value.type_of_activity_id==2){
|
||||
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
|
||||
//retailControl.controls = [];
|
||||
retailControl.controls.forEach((element,index) => {
|
||||
retailControl.removeAt(index);
|
||||
});
|
||||
}
|
||||
else if(event.value.exist_status==false && event.value.type_of_activity_id==2){
|
||||
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
|
||||
retailControl.push(this.createActivity());
|
||||
}
|
||||
if(event.value.exist_status==true && event.value.type_of_activity_id==3){
|
||||
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
|
||||
//wholesaleControl.controls = [];
|
||||
wholesaleControl.controls.forEach((element,index) => {
|
||||
wholesaleControl.removeAt(index);
|
||||
});
|
||||
}
|
||||
else if(event.value.exist_status==false && event.value.type_of_activity_id==3){
|
||||
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
|
||||
wholesaleControl.push(this.createActivity());
|
||||
}
|
||||
if(event.value.exist_status==true && event.value.type_of_activity_id==4){
|
||||
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
|
||||
//serviceControl.controls = [];
|
||||
serviceControl.controls.forEach((element,index) => {
|
||||
serviceControl.removeAt(index);
|
||||
});
|
||||
}
|
||||
else if(event.value.exist_status==false && event.value.type_of_activity_id==4){
|
||||
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
|
||||
serviceControl.push(this.createServiceActivity());
|
||||
}
|
||||
|
||||
if(event.value.exist_status==true && event.value.type_of_activity_id==5){
|
||||
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||
// othersControl.controls = [];
|
||||
othersControl.controls.forEach((element,index) => {
|
||||
othersControl.removeAt(index);
|
||||
});
|
||||
}
|
||||
else if(event.value.exist_status==false && event.value.type_of_activity_id==5){
|
||||
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||
othersControl.push(this.createOthersActivity());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// change area of sale options in manufacturing
|
||||
changeManufacturingAreaSale(getDetails: any, getIndex){
|
||||
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
|
||||
|
||||
if(getDetails.value.area_of_sale=="Within India"){
|
||||
control.controls[getIndex].removeControl('countries_where_export_done');
|
||||
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
|
||||
}
|
||||
else if(getDetails.value.area_of_sale=="Export"){
|
||||
control.controls[getIndex].removeControl('india_where_sale_done');
|
||||
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
|
||||
}
|
||||
}
|
||||
|
||||
// change retail options
|
||||
changeRetailAreaSale(getDetails: any, getIndex){
|
||||
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
|
||||
|
||||
if(getDetails.value.area_of_sale=="Within India"){
|
||||
control.controls[getIndex].removeControl('countries_where_export_done');
|
||||
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
|
||||
}
|
||||
else if(getDetails.value.area_of_sale=="Export"){
|
||||
control.controls[getIndex].removeControl('india_where_sale_done');
|
||||
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
|
||||
}
|
||||
}
|
||||
|
||||
// change whole options
|
||||
changeWholesaleAreaSale(getDetails: any, getIndex){
|
||||
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
|
||||
|
||||
if(getDetails.value.area_of_sale=="Within India"){
|
||||
control.controls[getIndex].removeControl('countries_where_export_done');
|
||||
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
|
||||
}
|
||||
else if(getDetails.value.area_of_sale=="Export"){
|
||||
control.controls[getIndex].removeControl('india_where_sale_done');
|
||||
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
|
||||
}
|
||||
}
|
||||
// change service provider
|
||||
changeServiceArea(getDetails: any, getIndex) {
|
||||
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
|
||||
|
||||
if(getDetails.value.area_of_sale=="Within India"){
|
||||
control.controls[getIndex].removeControl('countries_where_export_done');
|
||||
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
|
||||
}
|
||||
else if(getDetails.value.area_of_sale=="Export"){
|
||||
control.controls[getIndex].removeControl('india_where_sale_done');
|
||||
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createCountrySale()]));
|
||||
}
|
||||
}
|
||||
|
||||
// createDesignation(): FormGroup {
|
||||
// return this.fb.group({
|
||||
// sec_name: ['', Validators.compose([Validators.required])],
|
||||
@ -210,6 +616,127 @@ export class BusinessInfoComponent implements OnInit {
|
||||
document: ['']
|
||||
});
|
||||
}
|
||||
|
||||
createStateSale() {
|
||||
return this.fb.group({
|
||||
state_name: ['', Validators.compose([Validators.required])],
|
||||
city_name: ['', Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
createCountrySale() {
|
||||
return this.fb.group({
|
||||
country_name: ['',Validators.compose([Validators.required])],
|
||||
approx_sale: ['', Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
// add more dtate for manufacturing
|
||||
addMoreState(mindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('india_where_sale_done') as FormArray;
|
||||
control.push(this.createStateSale())
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('countries_where_export_done') as FormArray;
|
||||
control.push(this.createCountrySale())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// remove state for manufacturing
|
||||
removeState(mindex,sindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('india_where_sale_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('countries_where_export_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
}
|
||||
// add more retail state
|
||||
addRetailMoreState(rindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
|
||||
control = control.controls[rindex].get('india_where_sale_done') as FormArray;
|
||||
control.push(this.createStateSale())
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
|
||||
control = control.controls[rindex].get('countries_where_export_done') as FormArray;
|
||||
control.push(this.createCountrySale())
|
||||
}
|
||||
}
|
||||
// remove state for retail
|
||||
removeRetailState(mindex,sindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('india_where_sale_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('countries_where_export_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
}
|
||||
// add more whole sale state
|
||||
addWholesaleMoreState(windex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
|
||||
control = control.controls[windex].get('india_where_sale_done') as FormArray;
|
||||
control.push(this.createStateSale())
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
|
||||
control = control.controls[windex].get('countries_where_export_done') as FormArray;
|
||||
control.push(this.createCountrySale())
|
||||
}
|
||||
}
|
||||
// remove for whole sale
|
||||
removeWholesaleState(mindex,sindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('india_where_sale_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('countries_where_export_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
}
|
||||
// add more service provider
|
||||
addServiceMoreState(sindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
|
||||
control = control.controls[sindex].get('india_where_sale_done') as FormArray;
|
||||
control.push(this.createStateSale())
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
|
||||
control = control.controls[sindex].get('countries_where_export_done') as FormArray;
|
||||
control.push(this.createCountrySale())
|
||||
}
|
||||
}
|
||||
// remove service provider
|
||||
removeServiceState(mindex,sindex,type) {
|
||||
if(type==1){
|
||||
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('india_where_sale_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
else if(type==2){
|
||||
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
|
||||
control = control.controls[mindex].get('countries_where_export_done') as FormArray;
|
||||
control.removeAt(sindex);
|
||||
}
|
||||
}
|
||||
|
||||
// addDesignation() {
|
||||
// const control = <FormArray>this.businessForm.controls['designation'];
|
||||
// control.push(this.createDesignation());
|
||||
@ -234,10 +761,10 @@ export class BusinessInfoComponent implements OnInit {
|
||||
const control = <FormArray>this.businessForm.controls['documents'];
|
||||
control.removeAt(index);
|
||||
}
|
||||
|
||||
getRelation() {
|
||||
let master_name = 'RELATIONSHIPS';
|
||||
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||
console.log('data', data);
|
||||
data.records.forEach(val => {
|
||||
if (val.isactive == 1) {
|
||||
this.relationData.push(val);
|
||||
@ -254,7 +781,6 @@ export class BusinessInfoComponent implements OnInit {
|
||||
getIndustry() {
|
||||
let master_name = 'INDUSTRYCLASSIFICATION';
|
||||
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||
console.log('data', data);
|
||||
data.records.forEach(val => {
|
||||
if (val.isactive == 1) {
|
||||
this.industryData.push(val);
|
||||
@ -265,18 +791,101 @@ export class BusinessInfoComponent implements OnInit {
|
||||
getActivity() {
|
||||
let master_name = 'TYPEOFACTIVITY';
|
||||
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||
console.log('data', data);
|
||||
data.records.forEach(val => {
|
||||
let entityTypeControl = <FormArray>this.businessForm.controls['select_business_activity_type'];
|
||||
if (val.isactive == 1) {
|
||||
this.activityData.push(val);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// get state and city list
|
||||
getStateCityList(){
|
||||
this._pd.getStateCityDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateList=data.records
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// add and create person with relationship details
|
||||
createPersonRelationhip(details: any):FormGroup {
|
||||
return this.fb.group({
|
||||
other_family_relationship_id: [details.other_family_relationship_id],
|
||||
other_family_relationship_name: [details.other_family_relationship_name],
|
||||
family_member_name: [details.family_member_name],
|
||||
relationship_with_company_id: [details.relationship_with_company_id],
|
||||
relationship_with_company: [details.relationship_with_company],
|
||||
relation_to_id: [details.relation_to_id],
|
||||
relation_to: [details.relation_to],
|
||||
started_business: [details.started_business],
|
||||
currently_active_status: [details.currently_active_status],
|
||||
});
|
||||
}
|
||||
|
||||
//create entity type details
|
||||
createEntityType(details: any): FormGroup {
|
||||
return this.fb.group({
|
||||
type_of_activity_id: [details.type_of_activity_id, Validators.compose([Validators.required])],
|
||||
name: [details.name, Validators.compose([Validators.required])],
|
||||
exist_status:[details.exist_status==1 ? true : false]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// create manufacturing ,retail and wholesale details
|
||||
createActivity(): FormGroup {
|
||||
return this.fb.group({
|
||||
main_products: ['', Validators.compose([Validators.required])],
|
||||
area_of_sale: ['', Validators.compose([Validators.required])],
|
||||
description: ['']
|
||||
});
|
||||
}
|
||||
// create service ctivity
|
||||
createServiceActivity(): FormGroup {
|
||||
return this.fb.group({
|
||||
main_products: ['', Validators.compose([Validators.required])],
|
||||
area_of_sale: ['', Validators.compose([Validators.required])],
|
||||
description: ['']
|
||||
});
|
||||
}
|
||||
// create Others activity
|
||||
createOthersActivity(): FormGroup {
|
||||
return this.fb.group({
|
||||
others_details: ['', Validators.compose([Validators.required])]
|
||||
});
|
||||
}
|
||||
|
||||
// add more manufacturing details
|
||||
addMoreManufacturing() {
|
||||
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
|
||||
manufacturingControl.push(this.createActivity());
|
||||
}
|
||||
// add more retail details
|
||||
addMoreRetail() {
|
||||
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
|
||||
retailControl.push(this.createActivity());
|
||||
}
|
||||
// add more retail details
|
||||
addMoreWholesale() {
|
||||
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
|
||||
wholesaleControl.push(this.createActivity());
|
||||
}
|
||||
// add more service provider details
|
||||
addMoreServiceprovider() {
|
||||
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
|
||||
serviceControl.push(this.createServiceActivity());
|
||||
}
|
||||
// add more others details
|
||||
addMoreOthersActivity() {
|
||||
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||
othersControl.push(this.createOthersActivity());
|
||||
}
|
||||
submitDetails() {
|
||||
let family: any = [];
|
||||
if (!this.businessForm.valid) {
|
||||
console.log('form', this.businessForm)
|
||||
return;
|
||||
}
|
||||
let design: any;
|
||||
@ -290,15 +899,36 @@ export class BusinessInfoComponent implements OnInit {
|
||||
if (records.ownership_others == '') {
|
||||
delete records.ownership_others;
|
||||
}
|
||||
records.family_members_involved = this.relativeNames;
|
||||
console.log('recordss', records);
|
||||
|
||||
records.select_business_activity_type = records.select_business_activity_type.filter(value=>value.exist_status==1);
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
|
||||
// open other family family member details
|
||||
otherFamilyMemberDialogue() {
|
||||
const dialogRef = this.dialog.open(BusinessOtherFamilyMemberComponent, {
|
||||
data: this.pd_all_details,
|
||||
width:'60%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.data.length>0){
|
||||
let relationControl = <FormArray>this.businessForm.controls['persons_with_relationships'];
|
||||
dataresult.data.forEach(element => {
|
||||
let other_family_member: any= {'other_family_relationship_id':element.family_members_involved.relationship_id,'other_family_relationship_name':element.family_members_involved.name,'family_member_name':element.name,'relationship_with_company_id':element.relationship_with_company.company_relationship_id,'relationship_with_company':element.relationship_with_company.name,'relation_to_id':element.relation_to.pd_co_applicant_id,'relation_to':element.relation_to.applicant_name,'started_business':'','currently_active_status':''};
|
||||
relationControl.push(this.createPersonRelationhip(other_family_member));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
@ -320,4 +950,13 @@ export class BusinessInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
filterCity(datasource: any,filterid:number) {
|
||||
if(filterid){
|
||||
let filter = datasource.filter(x=>x.state_id==filterid);
|
||||
return filter[0].cities;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
<form [formGroup]="_OtherForm" novalidate>
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
{{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" (click)="closeDialogue()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
</h2>
|
||||
<mat-dialog-content formArrayName="family_list">
|
||||
<mat-card *ngFor="let family of _OtherForm.controls.family_list['controls']; let f = index;" [formGroupName]="f">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Name" formControlName="name" type="text" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%">
|
||||
<mat-select placeholder="Relationship"
|
||||
formControlName="family_members_involved" required>
|
||||
<mat-option [value]="member" *ngFor="let member of relationData">{{member.name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%">
|
||||
<mat-select placeholder="Relationship To"
|
||||
formControlName="relation_to" required>
|
||||
<mat-option *ngFor="let applicant of pd_applicants_details" [value]="applicant">{{applicant.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%">
|
||||
<mat-select placeholder="Relationship With Company"
|
||||
formControlName="relationship_with_company" required>
|
||||
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip">{{comrelShip.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="remove(f)"
|
||||
matTooltip="Remove Family Member" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="f!=0">
|
||||
<mat-icon>delete</mat-icon></button>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="addMoreFamilyMember()"><mat-icon>add</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add to List" matTooltipPosition="above" (click)="saveFamilyMember(_OtherForm.value)"><mat-icon>save</mat-icon></button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
mat-form-field {
|
||||
margin: 0 2%;
|
||||
}
|
||||
|
||||
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BusinessOtherFamilyMemberComponent } from './business-other-family-member.component';
|
||||
|
||||
describe('BusinessOtherFamilyMemberComponent', () => {
|
||||
let component: BusinessOtherFamilyMemberComponent;
|
||||
let fixture: ComponentFixture<BusinessOtherFamilyMemberComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ BusinessOtherFamilyMemberComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BusinessOtherFamilyMemberComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,111 @@
|
||||
import { Component, OnInit, Input, Output, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
|
||||
import { PdTrigerService} from './../../../../../../pd-service/pd-triger.service';
|
||||
@Component({
|
||||
selector: 'app-business-other-family-member',
|
||||
templateUrl: './business-other-family-member.component.html',
|
||||
styleUrls: ['./business-other-family-member.component.scss']
|
||||
})
|
||||
export class BusinessOtherFamilyMemberComponent implements OnInit {
|
||||
|
||||
pageTitle: string ="Add Other Family Member Involved In The Business";
|
||||
public _OtherForm: FormGroup;
|
||||
relationData: any=[];
|
||||
companyRelationShipList: any=[];
|
||||
public pd_applicants_details: any;
|
||||
constructor(private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<BusinessOtherFamilyMemberComponent>, private _pd: PdTrigerService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.initFormDetails();
|
||||
this.getMasterDetails('RELATIONSHIPS',1);
|
||||
this.getMasterDetails('COMPANYRELATIONSHIPS',2);
|
||||
this.pd_applicants_details = this.data.pdapplicants_detials;
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
if(type==2){
|
||||
this.companyRelationShipList=data.records.filter(item => item.isactive == 1);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// init form
|
||||
initFormDetails() {
|
||||
this._OtherForm = this._fb.group({
|
||||
family_list: this._fb.array([this.createFamilyMember()]),
|
||||
});
|
||||
}
|
||||
|
||||
// create family member form array
|
||||
createFamilyMember(){
|
||||
return this._fb.group({
|
||||
family_members_involved: ['', Validators.required],
|
||||
name: ['', Validators.required],
|
||||
relationship_with_company: ['', Validators.required],
|
||||
relation_to: ['', Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
// add more
|
||||
addMoreFamilyMember(){
|
||||
if (this._OtherForm.invalid) {
|
||||
this.validateAllFormFields(this._OtherForm);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
let relationControl = <FormArray>this._OtherForm.controls['family_list'];
|
||||
relationControl.push(this.createFamilyMember());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// remove
|
||||
remove(intex:number){
|
||||
let control = <FormArray>this._OtherForm.controls['family_list'];
|
||||
control.removeAt(intex);
|
||||
}
|
||||
|
||||
// save family member
|
||||
saveFamilyMember(formData:any){
|
||||
if (this._OtherForm.invalid) {
|
||||
this.validateAllFormFields(this._OtherForm);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.dialogRef.close({
|
||||
data:formData.family_list
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// close dialogue
|
||||
closeDialogue(){
|
||||
this.dialogRef.close({
|
||||
data:[]
|
||||
});
|
||||
}
|
||||
|
||||
// validate all form group and form array fields
|
||||
validateAllFormFields(formGroup: any) {
|
||||
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);
|
||||
} else if (control instanceof FormArray) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user