This commit is contained in:
venbatechnologies@gmail.com 2018-12-20 23:47:43 +05:30
commit 5923055a6b
22 changed files with 3576 additions and 2281 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -16,18 +16,27 @@
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 32%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
</mat-form-field>
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="Branch" formControlName="pd_branch_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id" >
{{LB.branch_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>

View File

@ -25,6 +25,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
productList:any;
subProductList:any;
lenderList:any;
lenderBranchList: any;
customerSegmentList:any;
stateList:any;
cityList:any;
@ -62,6 +63,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
loadFormData(){
this._PDtriggerForm = this._fb.group({
fk_lender_id: [null],
pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [null, Validators.compose([Validators.required])],
lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])],
@ -92,6 +94,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
});
}
selectedLender(lender){
// console.log(JSON.stringify(lender));
// alert(JSON.stringify(lender['branches ']));
this.lenderBranchList = lender['branches'];
this._PDtriggerForm.controls.pd_branch_id.setValue(null);
}
getLenderList(){
this._pd.getLenderDetails().subscribe(
data => {
@ -358,6 +368,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
let pd_details:any={
"fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id,
"pd_branch_id":formValue.pd_branch_id,
"pd_contact_person":formValue.lender_contact_person,
"pd_contact_mobileno":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id,

View File

@ -461,7 +461,7 @@
<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">
<div fxFlex="33%" class="ml-xs example-full-width">
<mat-form-field>
<mat-select placeholder="Type" formControlName="investments_type" required>
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
@ -469,16 +469,20 @@
</mat-form-field>
</div>
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
<mat-form-field>
<div fxFlex="33%" >
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
</div>
<!-- </div> -->
<div fxFlex="33" >
<div fxFlex="33%" >
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
</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="Bank Name" formControlName="bank_name" required autocomplete="off">
</mat-form-field>
@ -523,7 +527,7 @@
</div>
</div>
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<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">
@ -548,8 +552,8 @@
</mat-select>
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width" *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
<div fxFlex="33" *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
<mat-form-field class="ml-xs example-full-width" >
<input matInput placeholder="Specify Other Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
@ -565,7 +569,7 @@
</mat-form-field>
</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">
<label>Year and Month of Purchase?</label>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -749,4 +753,7 @@
<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>
</mat-dialog-actions>
</form>
</form>
<notifier-container></notifier-container>

View File

@ -478,25 +478,25 @@ public m_investmentType = [];
loadInsuranceDescription() {
return this._formBuilder.group({
//insurance_type: ['', Validators.compose([Validators.required])],
premium_paid: ['', Validators.compose([Validators.required])],
frequency_mode: ['', Validators.compose([Validators.required])],
sum_assured: ['', Validators.compose([Validators.required])],
members_coverd: ['', Validators.compose([Validators.required])]
premium_paid: ['', Validators.compose([])],
frequency_mode: ['', Validators.compose([])],
sum_assured: ['', Validators.compose([])],
members_coverd: ['', Validators.compose([])]
});
}
loadInvestDescription() {
return this._formBuilder.group({
investments_type: ['', Validators.compose([Validators.required])],
investments_type: ['', Validators.compose([])],
other_investments_type:[''],
amount_of_invest: ['', Validators.compose([Validators.required])],
bank_name: ['', Validators.compose([Validators.required])]
amount_of_invest: ['', Validators.compose([])],
bank_name: ['', Validators.compose([])]
});
}
load_Four_Weeler() {
return this._formBuilder.group({
manufacturer_model_four_weeler: ['', Validators.compose([Validators.required])]
manufacturer_model_four_weeler: ['', Validators.compose([])]
});
}

View File

@ -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,102 +89,606 @@
</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"
[formGroupName]="i">
<mat-card-content class="card">
<mat-form-field>
<input matInput placeholder="Name"
formControlName="partner_name" required>
</mat-form-field>
<mat-form-field>
<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>
<input matInput type="number" placeholder="Year" formControlName="current_business_experiance_year" required min='0'>
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Month" formControlName="current_business_experiance_month" required min='0' max='12'>
</mat-form-field>
</div>
</div>
<mat-form-field>
<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">
<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)"
matTooltip="Delete" matTooltipPosition="above" *ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
<mat-card-content formArrayName="partners">
<mat-card *ngFor="let members of businessForm.controls.partners['controls']; let i=index"
[formGroupName]="i">
<mat-card-content>
<mat-form-field style="width: 45%;">
<input matInput placeholder="Name"
formControlName="partner_name" required>
</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>
<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 style="width: 21%;">
<input matInput type="number" placeholder="Month" formControlName="current_business_experiance_month" required min='0' max='12'>
</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" 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)"
matTooltip="Delete" matTooltipPosition="above" *ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</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>
@ -498,4 +983,5 @@
</button>
</div>
</mat-dialog-actions>
</form>
</form>
<notifier-container></notifier-container>

View File

@ -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;
}

View File

@ -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,27 +31,36 @@ 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;
this.notifier = notifier;
this.notifier = notifier;
}
public viewerOptions: any = {
navbar: false,
@ -71,10 +82,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'];
@ -84,11 +97,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) {
@ -98,16 +120,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 {
@ -140,25 +152,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({
@ -166,14 +447,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])],
@ -198,16 +479,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])],
@ -228,6 +634,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());
@ -252,10 +779,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);
@ -272,7 +799,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);
@ -283,18 +809,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;
@ -308,15 +917,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);
@ -338,4 +968,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;
}
}
}

View File

@ -19,7 +19,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%">
<mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name">
<mat-option *ngFor="let pm of m_manufacturingProducts" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-form-field style="width: 100%">
@ -77,7 +77,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%">
<mat-select placeholder="Trading Product Name" formControlName="trade_product_name">
<mat-option *ngFor="let pm of m_tradingProducts" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_tradingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-form-field style="width: 100%">
@ -136,7 +136,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%">
<mat-select placeholder="Service Provider Product Name" formControlName="service_provider_product_name">
<mat-option *ngFor="let pm of m_suplierProducts" [value]="pm.name">{{ pm.name }}</mat-option>
<mat-option *ngFor="let pm of m_suplierProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-form-field style="width: 100%">

View File

@ -104,36 +104,38 @@ export class ClientInfoComponent implements OnInit {
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
// if(data.dataStatus === undefined){
let datas = {
"profession_name": "Others",
"type_of_activity": [
{
"type_of_activity_id": 1,
"name": "Manufacturing Details"
},
{
"type_of_activity_id": 2,
"name": "Retail trading"
},
{
"type_of_activity_id": 3,
"name": "Wholesale trading"
},
{
"type_of_activity_id": 4,
"name": "Service Providers"
}
]
};
// this.m_manufacturingProducts = data.type_of_activity_id.filter(data=>{if(data.type_of_activity_id === 1 ){return data.product_details}});
// this.m_tradingProducts = data.type_of_activity_id.filter(data=>{if(data.type_of_activity_id === 3 ){return data.product_details}});
// this.m_suplierProducts = data.type_of_activity_id.filter(data=>{if(data.type_of_activity_id === 4 ){return data.product_details}});
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 3,
// "name": "Wholesale trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Providers"
// }
// ]
// };
let datas = data.records;
this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 1 ){return data}}).map(data=> [...data.prodcuts]);
this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3 ){return data}}).map(data=> [...data.prodcuts]);
this.m_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4 ){return data}}).map(data=> [...data.prodcuts]);
// alert(JSON.stringify(this.m_manufacturingProducts[0]));
this.initFormLoadDetails(datas.type_of_activity);
// }else {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.noRecordsFound = false;
// }
}else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
}
}, err => {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
@ -153,7 +155,7 @@ export class ClientInfoComponent implements OnInit {
if (dataForm !== undefined) {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
formid: ['2'],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@ -161,7 +163,7 @@ export class ClientInfoComponent implements OnInit {
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
// Load form details for manufacturing
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
return dataForm.main_raw_materials[key];
@ -171,7 +173,7 @@ export class ClientInfoComponent implements OnInit {
}
// Load form details for the wholeshale trading details
let arr1 = record.filter(data => data.type_of_activity_id === 3);
let arr1 = record.filter(data => data.type_of_activity_id == 3);
if (arr1.length > 0) {
let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
return dataForm.trading_products[key];
@ -181,7 +183,7 @@ export class ClientInfoComponent implements OnInit {
}
// Load form details for the service provider prduct details
let arr2 = record.filter(data => data.type_of_activity_id === 4);
let arr2 = record.filter(data => data.type_of_activity_id == 4);
if (arr2.length > 0) {
let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) {
return dataForm.service_products[key];
@ -190,7 +192,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_products_total_payments_percent_on_credit || null);
}
// Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id === 2);
let arr3 = record.filter(data => data.type_of_activity_id == 2);
if (arr3.length > 0) {
this.retaildTradingForm = true;
}
@ -198,24 +200,24 @@ export class ClientInfoComponent implements OnInit {
} else {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
formid: ['2'],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 3);
let arr1 = record.filter(data => data.type_of_activity_id == 3);
if (arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
}
let arr2 = record.filter(data => data.type_of_activity_id === 4);
let arr2 = record.filter(data => data.type_of_activity_id == 4);
if (arr2.length > 0) {
let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) {
return dataForm.service_products[key];
@ -224,7 +226,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_products_total_payments_percent_on_credit || null);
}
// Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id === 2);
let arr3 = record.filter(data => data.type_of_activity_id == 2);
if (arr3.length > 0) {
this.retaildTradingForm = true;
}
@ -233,30 +235,30 @@ export class ClientInfoComponent implements OnInit {
} else {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
formid: ['2'],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 3);
let arr1 = record.filter(data => data.type_of_activity_id == 3);
if (arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
let arr2 = record.filter(data => data.type_of_activity_id === 4);
let arr2 = record.filter(data => data.type_of_activity_id == 4);
if (arr2.length > 0) {
this.initServiceProviderProductsDetails(null);
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null);
}
// Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id === 2);
let arr3 = record.filter(data => data.type_of_activity_id == 2);
if (arr3.length > 0) {
this.retaildTradingForm = true;
}
@ -271,7 +273,7 @@ export class ClientInfoComponent implements OnInit {
manufacturingForm: Boolean = false;
manufacturingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 1);
let arr = val.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
this.manufacturingForm = true;
return this._formBuilder.group({
@ -286,7 +288,7 @@ export class ClientInfoComponent implements OnInit {
tradingForm: Boolean = false;
tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 3);
let arr = val.filter(data => data.type_of_activity_id == 3);
if (arr.length > 0) {
this.tradingForm = true;
return this._formBuilder.group({
@ -300,7 +302,7 @@ export class ClientInfoComponent implements OnInit {
serviceProviderForm: Boolean = false;
serviceProviderFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 4);
let arr = val.filter(data => data.type_of_activity_id == 4);
if (arr.length > 0) {
this.serviceProviderForm = true;
return this._formBuilder.group({
@ -491,8 +493,16 @@ export class ClientInfoComponent implements OnInit {
var answerFormValues = this._supplierQuesFrom.value;
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
console.log(JSON.stringify(answerFormValues));
Object.keys(answerFormValues).forEach((key) => {if(answerFormValues[key] === null || answerFormValues[key] === undefined || answerFormValues[key] === ''){ delete answerFormValues[key]}; console.log("chec:" +answerFormValues[key])});
if(answerFormValues.manufacturing_details[0]==null){
delete answerFormValues['manufacturing_details'];
}
if(answerFormValues.trade_details[0]==null){
delete answerFormValues['trade_details'];
}
if(answerFormValues.service_provider_details[0]==null){
delete answerFormValues['service_provider_details'];
}
// Add BRANCH data with help Service File
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {

View File

@ -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>

View File

@ -0,0 +1,9 @@
mat-form-field {
margin: 0 2%;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}

View File

@ -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();
});
});

View File

@ -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);
}
});
}
}

View File

@ -25,8 +25,8 @@
<div>
<mat-form-field>
<mat-select placeholder="Select a person" formControlName="selected_person" required>
<mat-option value="{{person.id}}" *ngFor="let person of selectPerson">
{{person.name}}
<mat-option value="{{person.pd_co_applicant_id}}" *ngFor="let person of selectPerson">
{{person.applicant_name}}
</mat-option>
</mat-select>
</mat-form-field>
@ -144,102 +144,6 @@
</div>
</div>
<!--<mat-card>
<mat-card-header>
<p>Earning Members
</p>
</mat-card-header>
<div formArrayName="earningMembers">
<div *ngFor="let item of familyForm.controls.earningMembers['controls']; let i=index" [formGroupName]="i">
<mat-card-content class="matcards">
<mat-form-field>
<input matInput placeholder="Name" formControlName="earning_member_name" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Age" (keypress)="keyPress($event)" formControlName="earning_member_age" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relation" formControlName="relation" required>
<mat-option value="{{relations.relationship_id}}" *ngFor="let relations of relationData">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Segment" formControlName="segment" required>
<mat-option value="{{cusSeg.customer_segment_id}}" *ngFor="let cusSeg of customerSegData">
{{cusSeg.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Income / Revenue" formControlName="income" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Name of Employer / Business" formControlName="employer_name" required>
</mat-form-field>
<button type="button" mat-raised-button mat-icon-button *ngIf="i==0" color="primary" matTooltip="Add More Earning Members"
matTooltipPosition="above" (click)="addearningMembers()">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteEarningMembers(i)"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
</mat-card>
<mat-card>
<mat-card-header>
<p>Non Earning Members
</p>
</mat-card-header>
<div formArrayName="nonEarningMembers">
<div *ngFor="let members of familyForm.controls.nonEarningMembers['controls']; let i=index" [formGroupName]="i">
<mat-card-content class="matcard">
<mat-form-field>
<input matInput placeholder="Name" formControlName="non_earning_member_name" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Age" (keypress)="keyPress($event)" formControlName="non_earning_member_age" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relation" formControlName="relationship" required>
<mat-option value="{{relation.relationship_id}}" *ngFor="let relation of relationData">
{{relation.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Occupation" formControlName="occupation" required>
<mat-option value="{{occupation.occupation_non_earning_member_id}}" *ngFor="let occupation of occupationData">{{occupation.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="members['controls'].occupation.value==3">
<input matInput placeholder="Retired From" formControlName="retired">
</mat-form-field>
<mat-form-field *ngIf="members['controls'].occupation.value==9">
<input matInput placeholder="Specify Others Occupation" formControlName="others_occupation">
</mat-form-field>
<button type="button" mat-raised-button mat-icon-button (click)="addMembers()" color="primary" matTooltip="Add More Non Earning Members"
matTooltipPosition="above" *ngIf="i==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteMembers(i)" matTooltip="Delete" matTooltipPosition="above"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
</mat-card>-->
</mat-card-content>
</mat-card>
</div>

View File

@ -36,14 +36,14 @@ export class FamilyDetailsComponent implements OnInit {
private notifier: NotifierService;
public familyForm: FormGroup;
selectPerson = [{
name : 'person 1',
id : 111
}, {
name : 'person 2',
id : 222
}];
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
@ -65,6 +65,8 @@ export class FamilyDetailsComponent implements OnInit {
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
@ -136,8 +138,6 @@ export class FamilyDetailsComponent implements OnInit {
public initFamilyForm(): void {
this.familyForm = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
// personOther: [''],
// members: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
@ -146,12 +146,8 @@ export class FamilyDetailsComponent implements OnInit {
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
// earningMembers: this.fb.array([]),
// nonEarningMembers: this.fb.array([]),
family_details_form_remark: ['']
});
}
@ -259,3 +255,4 @@ export class FamilyDetailsComponent implements OnInit {
// }
}

View File

@ -9,7 +9,7 @@
<form [formGroup]="_finalRemarkForm" (submit)="onSubmit()" novalidate>
<mat-dialog-content>
<mat-card>
<mat-form-field style="width: 100%">
<mat-form-field>
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{ pm.description }}</mat-option>
</mat-select>

View File

@ -165,8 +165,11 @@ export class GeneralInfoComponent implements OnInit {
});
}
// exist_status
});
}
else{
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
@ -178,6 +181,7 @@ export class GeneralInfoComponent implements OnInit {
}
else {
if(item.pd_co_applicant_id.value!=0){
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
let pos_id = relationControl.value.map(e=> e.pd_co_applicant_id).indexOf(item.pd_co_applicant_id.value);
relationControl.removeAt(pos_id);
@ -185,6 +189,7 @@ export class GeneralInfoComponent implements OnInit {
let pos_name=this.fetch_related_details.indexOf(item.applicant_name.value);
this.fetch_related_details.splice(pos_name, 1);
}
}
}
// submit form details

View File

@ -77,29 +77,30 @@ export class SupplierInfoComponent implements OnInit {
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
// if(data.dataStatus === undefined){
let datas = {
"profession_name": "Others",
"type_of_activity": [
{
"type_of_activity_id": 1,
"name": "Manufacturing Details"
},
{
"type_of_activity_id": 2,
"name": "Retail trading"
},
{
"type_of_activity_id": 4,
"name": "Service Provider"
}
]
};
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
// "type_of_activity": [
// {
// "type_of_activity_id": 1,
// "name": "Manufacturing Details"
// },
// {
// "type_of_activity_id": 2,
// "name": "Retail trading"
// },
// {
// "type_of_activity_id": 4,
// "name": "Service Provider"
// }
// ]
// };
let datas = data.records;
this.initFormLoadDetails(datas.type_of_activity);
// }else {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.noRecordsFound = false;
// }
}else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
}
}, err => {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
@ -113,6 +114,7 @@ export class SupplierInfoComponent implements OnInit {
serviceProviderForm: Boolean = false;
initFormLoadDetails(record) {
// alert(JSON.stringify(record));
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
data => {
if(data.dataStatus){
@ -126,7 +128,7 @@ export class SupplierInfoComponent implements OnInit {
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
return dataForm.main_raw_materials[key];
@ -134,7 +136,7 @@ export class SupplierInfoComponent implements OnInit {
this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.main_raw_materials_total_payments_percent_on_credit || null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2 || 3);
let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
if(arr1.length > 0) {
let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
return dataForm.trading_products[key];
@ -152,19 +154,19 @@ export class SupplierInfoComponent implements OnInit {
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2 || 3);
let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
if(arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
}
this.noRecordsFound = true;
}
let arr2 = record.filter(data => data.type_of_activity_id === 4);
let arr2 = record.filter(data => data.type_of_activity_id == 4);
if(arr2.length > 0) {
this.serviceProviderForm = true;
}
@ -177,17 +179,17 @@ export class SupplierInfoComponent implements OnInit {
supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2 || 3);
let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3);
if(arr1.length > 0) {
this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
let arr2 = record.filter(data => data.type_of_activity_id === 4);
let arr2 = record.filter(data => data.type_of_activity_id == 4);
if(arr2.length > 0) {
this.serviceProviderForm = true;
}
@ -202,7 +204,7 @@ export class SupplierInfoComponent implements OnInit {
manufacturingForm: Boolean = false;
manufacturingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 1);
let arr = val.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
this.manufacturingForm = true;
return this._formBuilder.group({
@ -217,7 +219,7 @@ export class SupplierInfoComponent implements OnInit {
tradingForm: Boolean = false;
tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 2 || 3);
let arr = val.filter(data => data.type_of_activity_id == 2 || 3);
if (arr.length > 0) {
this.tradingForm = true;
return this._formBuilder.group({

View File

@ -5,7 +5,7 @@
<mat-card-content style="background:#e00201;">
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs" fxFlex="45" style="color:#fff;">
<h4>{{master.lender_full_name}} </h4>
<h4>{{master.lender_full_name}} - {{master.branch_name}}</h4>
<span *ngIf="master.lender_applicant_id"> {{master.lender_applicant_id}} - </span> {{master.pd_date_of_initiation}}
</div>
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" >

View File

@ -32,6 +32,8 @@ import {NotifierModule, NotifierOptions} from 'angular-notifier';
import {OwlDateTimeModule, OwlNativeDateTimeModule} from 'ng-pick-datetime';
import {AgmCoreModule} from '@agm/core';
import {MAT_MOMENT_DATE_FORMATS, MomentDateAdapter} from '@angular/material-moment-adapter';
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
import {ManagePdRoutingModule} from './manage-pd.routing';
import {ListPdComponent} from './list-pd/list-pd.component';
import {ManagePdComponent} from './manage-pd.component';
@ -84,6 +86,8 @@ import { NeighbourHoodComponent } from './list-pd/start-pd/forms/neighbour-hood/
import { NgxViewerModule } from 'ngx-viewer';
import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/final-remarks.component';
import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component';
/**
* Custom angular notifier options
*/
@ -260,7 +264,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@ -297,11 +301,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
OwlNativeDateTimeModule,
],
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent],
providers: [PdTrigerService, GetGeometricLocationService],
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent],
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent],
})
export class ManagePdModule {