This commit is contained in:
velz 2019-01-02 19:56:43 +05:30
commit 896f937244
54 changed files with 939 additions and 942 deletions

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,7 @@
"ngx-mat-select-search": "^1.3.1",
"ngx-perfect-scrollbar": "5.0.0-7",
"ngx-viewer": "^1.0.1",
"node-sass": "^4.11.0",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.2.0",
"rxjs": "^6.3.1",

View File

@ -273,7 +273,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
// save pd in draft
saveDraftPD(formValue: any, status:string){
alert('Inside The Draft PD');
//alert('Inside The Draft PD');
this.submitPdDetails(formValue, status);
}
//trigger pd
@ -362,11 +362,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
// common function for both draft and process pd
submitPdDetails(formValue: any, status:string) {
alert('Inside Function Submit Function');
//alert('Inside Function Submit Function');
if(this._PDtriggerForm.invalid) {
this.validateAllFormFields(this._PDtriggerForm);
alert('validationError');
console.log(this._PDtriggerForm);
//alert('validationError');
//console.log(this._PDtriggerForm);
return;
}
else {

View File

@ -42,7 +42,7 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null],
@ -59,7 +59,7 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [stdcode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
company_name: [this.mainApplicantData[0].company_name],
@ -76,9 +76,19 @@ export class EditPdApplicantComponent implements OnInit {
}
createItem(listData): FormGroup {
if(listData){
console.log(listData.landline);
let stdcode;
let landline;
if(listData.landline != null){
let stdcodesearch = listData.landline.search("-");
let stdcode = listData.landline.substr(0,stdcodesearch);
let landline = listData.landline.substr(+stdcodesearch + 1,8);
stdcode = listData.landline.substr(0,stdcodesearch);
//console.log(stdcode);
landline = listData.landline.substr(+stdcodesearch + 1,8);}
else{
stdcode = null;
landline = null;
}
console.log(landline);
return this._fb.group({
label: ['Co Applicant'],
fk_applicant_primary_id: [listData.pd_co_applicant_id],
@ -136,13 +146,28 @@ export class EditPdApplicantComponent implements OnInit {
"isactive":1
}];
formValue.coApplicantItems.forEach((itemElement, itemIndex) => {
// console.log(itemElement.coapplicant_stdcode);
// console.log(itemElement.coapplicant_landline);
let concat_landline
if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){
let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode;
let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline;
concat_landline = std+'-'+landline;
}else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
concat_landline = null;
}else{
concat_landline = null;
}
console.log(concat_landline);
let obj1 = {
"fk_pd_id": this.data.pdID,
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
"applicant_name":itemElement.coapplicantName,
"relation":itemElement.relationship,
"mobile_no":itemElement.coapplicant_mobile_no,
"landline":itemElement.coapplicant_stdcode+'-'+itemElement.coapplicant_landline,
"landline":concat_landline,
"applicant_type":itemElement.applicant_type,
"company_name":itemElement.company_name,
"isactive":1

View File

@ -121,7 +121,8 @@
</div>
<div fxFlex="100">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Is there any other premises from which business activity is being run?"
<!-- <mat-select placeholder="Is there any other premises from which business activity is being run?"-->
<mat-select placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"
formControlName="bussiness_activity" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>

View File

@ -12,7 +12,7 @@
mat-form-field {
margin: 0 2%;
}
.cdk-global-overlay-wrapper{
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;

View File

@ -15,6 +15,9 @@ tr.mat-footer-row {
border-top: 1px solid #e0e0e0;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.mat-form-field {
width: 100%;
}

View File

@ -6,7 +6,6 @@
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
@ -35,29 +34,29 @@
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="business_details" class="example-full-width">
<!--Property-->
<!--Property-->
<div *ngIf="sup.get('business_assets_mode').value == 1 ">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<!-- <div> -->
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" *ngIf="detail.get('property_type').value == 5">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
</mat-form-field>
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Four Wheeler-->
<!--Four Wheeler-->
<div *ngIf="sup.get('business_assets_mode').value == 2">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -67,14 +66,12 @@
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Two Wheeler-->
<!--Two Wheeler-->
<div *ngIf="sup.get('business_assets_mode').value == 3">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<!-- <div> -->
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" autocomplete="off">
@ -82,11 +79,10 @@
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Consumer Durable-->
<!--Consumer Durable-->
<div *ngIf="sup.get('business_assets_mode').value == 5">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -96,85 +92,72 @@
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Insurance-->
<div *ngIf="sup.get('business_assets_mode').value == 6">
<!-- <div fxFill> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,5)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{PremiumPaidInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- </div>
<div fxFlex="33"> -->
<mat-form-field style="width:30%">
<mat-form-field style="width:30%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- </div>
<div fxFlex="33"> -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,7)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{SumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Investments-->
<div *ngIf="sup.get('business_assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:30%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
<mat-form-field style="width:30%" *ngIf="detail.get('investments_type').value == 6 ">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33" > -->
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,9)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{AmtInvestInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- </div>
<div fxFlex="33"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
<!--other assets-->
<!-- <div *ngIf="sup.get('assets_mode').value == 8"> -->
<div *ngIf="sup.get('business_assets_mode').value == 8">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -182,41 +165,57 @@
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,11)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{AssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,2)">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off" (keyup)="inWords($event,s,13)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{B_emiAmtInwords[s]}} Only</mat-hint>
</mat-form-field>
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> -->
<!-- </mat-form-field> --
<mat-form-field style="width:30%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,2)">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
<!-- <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="nan">NA</mat-option> -->
</mat-select>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> --
<mat-form-field style="width:95%" *ngIf="businessEmiAmtFlag">
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
<!-- <span matSuffix>.00</span> -->
<!-- <span matSuffix>.00</span> --
</mat-form-field>
</div>
</div>-->
</div>
</div>
<!-- </div> -->
</div>
</div>
<!--Desction Dynamic details : END -->
<!-- {{sup.get('business_assets_mode').value}} -->
<!-- <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 4" style="width:30%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:30%">
@ -228,35 +227,31 @@
<span *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:95%">
<mat-select placeholder="Is there a loan existing against this asset?" formControlName="business_emi">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<!-- </div> -->
<!-- <div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33"> -->
<mat-form-field style="width:95%" *ngIf="sup.get('business_emi').value === 'yes'">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('business_emi_paid').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- </div> -->
<!-- <div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33"> -->
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<!-- </div>
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33" style="width:95%"> -->
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)">
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<!-- </div> -->
<!-- <div *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " fxFlex="33" style="width:95%"> -->
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
<!-- </div> -->
</div>
</span>
@ -314,7 +309,6 @@
<div formArrayName="details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('assets_mode').value == 1 ">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -329,7 +323,6 @@
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--Four Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 2">
@ -345,7 +338,6 @@
</div>
<!--Two Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 3">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -355,7 +347,6 @@
</div>
</div>
</div>
<!-- </div> -->
</div>
<!--jwell details -->
<!--<div *ngIf="sup.get('assets_mode').value == 4">
@ -373,7 +364,6 @@
</div>-->
<!--Consumer Durable-->
<div *ngIf="sup.get('assets_mode').value == 5">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -383,21 +373,17 @@
</div>
</div>
</div>
</div>
<!--Insurance-->
<div *ngIf="sup.get('assets_mode').value == 6">
<!-- <div fxFill> -->
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,6)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{OtherPremiumPaidInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- </div>
<div fxFlex="33"> -->
<mat-form-field style="width:30%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
@ -406,69 +392,59 @@
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- </div>
<div fxFlex="33"> -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,8)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{OtherSumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
<!-- </div> -->
</div>
<!-- </div> -->
<!-- </div> -->
<!--Investments-->
<div *ngIf="sup.get('assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33%" class="ml-xs example-full-width"> -->
<mat-form-field style="width:30%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33" "> -->
<!-- <div fxFlex="33%" > -->
<mat-form-field style="width:30%" *ngIf="detail.get('investments_type').value == 6">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<!-- </div> -->
<!-- </div> -->
<!-- <div fxFlex="33%" > -->
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- </div> -->
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33%"> -->
<mat-form-field style="width:30%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
<!--other assets-->
<div *ngIf="sup.get('assets_mode').value == 8">
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> -->
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -477,33 +453,35 @@
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Name of the Owner"
formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <div> -->
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''" style="width:30%">
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0" style="width:30%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
<!-- </div>---- -->
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,12)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{OtherAssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> -->
@ -516,20 +494,20 @@
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
<mat-form-field style="width:30%" *ngIf="otherEmiamtFlag">
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off"(keyup)="inWords($event,s,14)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{O_emiAmtInwords[s]}} Only</mat-hint>
<!-- <span matSuffix>.00</span> -->
</mat-form-field>
</div>
</div>
</div>
<!-- </div> -->
</div>
</div>
<!--Desction Dynamic details : END -->
<!--<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">-->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4" style="width:30%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:30%">
@ -554,35 +532,31 @@
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <div fxFlex="33"> -->
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:95%">
<mat-select placeholder="Is there a loan existing against this asset?" formControlName="emi">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33"> -->
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:95%">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="emi_paid" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="emi_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,4)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('emi_paid').value != ''">{{"&#8377;"}} {{OtherEmiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33"> -->
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanTenureCalc(sup,1)" autocomplete="off">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanTenureCalc(sup,1)" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<!-- </div> -->
<!-- <div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33" > -->
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanTenureCalc(sup,1)" autocomplete="off">
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanTenureCalc(sup,1)"(keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex="33" style="width:95%"> -->
<mat-form-field *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
<!-- </div> -->
</div>
</div>
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
@ -592,7 +566,7 @@
</span>
</div>
</div>
<!-- </div> -->
</mat-card-content>
</mat-card>
</div>

View File

@ -8,6 +8,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;

View File

@ -43,6 +43,20 @@ export class AssetsInfoComponent implements OnInit {
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
{'value': "no",'viewValue': "No"},
{'value': "nan",'viewValue': "NA"}]
appxMarketAmtInwords : any = [];
OtherAppxMarketAmtInwords : any = [];
emiAmtInwords : any = [];
OtherEmiAmtInwords : any = [];
PremiumPaidInwords : any = [];
OtherPremiumPaidInwords: any = [];
SumAssuredInwords: any = [];
OtherSumAssuredInwords: any = [];
AmtInvestInwords: any = [];
OtherAmtInvestInwords: any = [];
AssetValueInwords: any = [];
OtherAssetValueInwords: any = [];
B_emiAmtInwords: any = [];
O_emiAmtInwords: any = [];
// public m_assets_type = [
// {
// 'id': "1",
@ -295,6 +309,8 @@ public m_investmentType = [];
getPdSupplierFormDetails() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '4').subscribe(
data => {
console.log(data);
console.log(data.records);
if (data) {
if (data.dataStatus) {
this.formLoadData(data.records);
@ -310,6 +326,7 @@ public m_investmentType = [];
}
formLoadData(val) {
console.log(val);
if (val !== null) {
let value = val;
this._assetsQuesFrom = this._formBuilder.group({
@ -631,6 +648,7 @@ public m_investmentType = [];
}
initBusinessDetailsWithdata(data) {
return this._formBuilder.group({
business_assets_mode: [data.business_assets_mode],
business_details: this._formBuilder.array([]),
@ -650,10 +668,16 @@ public m_investmentType = [];
loadDetails: boolean;
addAssetsDetailsWithData(supp_data) {
console.log(supp_data);
//console.log(supp_data);
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
result.forEach((datas,index) => {
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.approximate_market_value);
this.OtherEmiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.emi_paid);
});
if (result.length > 0) {
for (let val of result) {
let vals = {
@ -680,12 +704,16 @@ public m_investmentType = [];
addBusinessAssetsDetailsWithData(supp_data) {
console.log(supp_data);
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
if (result.length > 0) {
result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value);
this.emiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_emi_paid);
});
for (let val of result) {
let vals = {
business_assets_mode: val.business_assets_mode,
@ -702,10 +730,6 @@ public m_investmentType = [];
business_balance_tenure: val.business_balance_tenure
};
// const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
// control.push(this.initDetailsWithdata(vals));
// this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1)
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetailsWithdata(vals));
this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1)
@ -751,16 +775,27 @@ public m_investmentType = [];
break;
}
case '6': {
data.forEach((datas,i) => {
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInsuranceDescriptionWithData(data));
break;
}
case '7': {
data.forEach((datas,i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInvestDescriptionWithData(data));
break;
}
case '8': {
data.forEach((datas,i) => {
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(data));
break;
@ -772,6 +807,7 @@ public m_investmentType = [];
}
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
console.log(datas);
let val = i;
let data = datas;
const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
@ -802,16 +838,27 @@ public m_investmentType = [];
break;
}
case '6': {
data.forEach((datas,i) => {
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInsuranceDescriptionWithData(data));
break;
}
case '7': {
data.forEach((datas,i) => {
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInvestDescriptionWithData(data));
break;
}
case '8': {
data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescriptionWithData(data));
break;
@ -871,6 +918,7 @@ public m_investmentType = [];
/** To Save/Edited Popup Data */
onSubmit() {
console.log(this._assetsQuesFrom.value);
this.submitted = true;
// stop here if form is invalid
@ -899,7 +947,7 @@ public m_investmentType = [];
val.business_elapsed_tenure = '';
}
});
console.log(answerFormValues);
// Save the data with help of Service
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
@ -960,14 +1008,53 @@ public m_investmentType = [];
}
// {
// 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [
// {
// 'supplier_name':'ldskjfalks',
// 'payment_mode': '1',
// 'payment_mode_value':''
// }
// ]
// }
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 2 :
this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 3 :
this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 4 :
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 5 :
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 6 :
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 7 :
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8 :
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9 :
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10 :
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 11 :
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 12 :
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 13:
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 14:
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}

View File

@ -9,7 +9,9 @@
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -105,7 +105,7 @@ export class BankingDetailsComponent implements OnInit {
} else {
result.forEach((datas,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(datas.limit);
this. selectedBorrower(datas.applicant_name,index);
this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(datas.account_type,index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);

View File

@ -30,7 +30,9 @@
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;

View File

@ -94,6 +94,7 @@ export class BusinessInfoComponent implements OnInit {
this.getStateCityList();
this.initBusinessForm();
this.getCompanyRelation();
this.getCompanyListForBusiness();
// const Desgn = <FormArray>this.businessForm.controls['designation'];
// const Partnr = <FormArray>this.businessForm.controls['partners'];
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
@ -516,7 +517,7 @@ export class BusinessInfoComponent implements OnInit {
// 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.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');
@ -1261,4 +1262,12 @@ export class BusinessInfoComponent implements OnInit {
return merged.length > 0 ? merged : [];
}
}
getCompanyListForBusiness(): void{
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records;
}
})
}
}

View File

@ -8,6 +8,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;

View File

@ -28,7 +28,9 @@
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;
}

View File

@ -6,4 +6,7 @@ mat-form-field {
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -11,4 +11,7 @@
.example-margin {
margin: 0 10px;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -19,7 +19,9 @@
background: #62B013;
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -1,4 +1,4 @@
<form class="address" [formGroup]="familyForm">
<!--<form class="address" [formGroup]="familyForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
@ -255,11 +255,11 @@
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>
<notifier-container></notifier-container>-->
<!--<h2 mat-dialog-title class="paragraph_change">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
@ -532,4 +532,4 @@
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>-->
<notifier-container></notifier-container>

View File

@ -21,7 +21,9 @@
// background: #62B013;
// color: white;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;

View File

@ -1,269 +1,3 @@
import {
Component,
OnInit,
Inject,
Input, Output
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
@Component({
selector: 'app-family-details',
templateUrl: './family-details.component.html',
styleUrls: ['./family-details.component.scss']
})
export class FamilyDetailsComponent implements OnInit {
//@Input() pdid: number;
pageTitle: string ="Other Family Details";
pdid : string;
form_id : number;
private notifier: NotifierService;
public familyForm: FormGroup;
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
id: 1
}, {
type: 'Non Earning',
id: 2
}]
relationData: any = [];
occupationData: any = [];
//personMetData: any = [];
ownerShipData: any = [];
customerSegData: any = [];
// earnMemberArrCount :any ;
// nonEarnMemberArrCount :any ;
count : number;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
}
ngOnInit() {
this.getMasterDetails('RELATIONSHIPS',1);
this.getMasterDetails('OCCUPATIONMEMBERS',2);
//this.getMasterDetails('PERSONSMET',3);
this.getMasterDetails('RESIDENCEOWNERSHIP',4);
this.getMasterDetails('CUSTOMERSEGMENT',5);
this.initFamilyForm();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '6';
this._pd.retriveForm(params).subscribe(data => {
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
const value = <FormArray>this.familyForm.controls['earningMembers'];
if (data.status == 200) {
this.familyForm.controls.selected_person.setValue(data.records.selected_person);
this.familyForm.controls.residence_place.setValue(data.records.residence_place);
this.familyForm.controls.residence_city.setValue(data.records.residence_city);
this.familyForm.controls.residence_state.setValue(data.records.residence_state);
this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
this.familyForm.controls.rent.setValue(data.records.rent);
this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
} else {
// value.push(this.createMembers());
// control.push(this.createNonMembers());
}
});
}
initgenerateFamilyMembersDetailsGet(val): FormGroup {
return this.fb.group({
family_member_name : [val.family_member_name, Validators.compose([])],
family_member_relationship : [val.family_member_relationship, Validators.compose([])],
family_member_age : [val.family_member_age, Validators.compose([])],
family_member_earning_status : [val.family_member_earning_status, Validators.compose([])],
earning_segment: [val.earning_segment, Validators.compose([])],
earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
})
}
generateFamilyMembersDetailsGetData(data) {
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
for (let val of result) {
const control = <FormArray>this.familyForm.controls['family_members_details'];
control.push(this.initgenerateFamilyMembersDetailsGet(val));
}
}
}
onSearchChange(e):void {
e.preventDefault();
}
public initFamilyForm(): void {
this.familyForm = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
residence_pin: ['', Validators.compose([])],
residence_No_of_years: ['', Validators.compose([])],
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
family_details_form_remark: ['']
});
}
getNumberOfFamilyMemberDetails(){
// alert(this.familyForm.controls.total_number_of_family_members.valid);
if(this.familyForm.controls.total_number_of_family_members.valid){
let totalMem = this.familyForm.get('total_number_of_family_members').value;
const control = <FormArray>this.familyForm.controls.family_members_details;
if(totalMem > control.length) {
let len = totalMem - control.length;
for(let i = 0; i < len; i++){
control.push(this.generateFamilyMembersDetailsGet());
}
} else if (totalMem < control.length) {
// control.controls.slice(0, totalMem);
control.controls = [];
for(let i = 0; i < totalMem; i++){
control.push(this.generateFamilyMembersDetailsGet());
}
}
} else {
}
}
generateFamilyMembersDetailsGet(): FormGroup {
return this.fb.group({
family_member_name : ['', Validators.compose([])],
family_member_relationship : ['', Validators.compose([])],
family_member_age : ['', Validators.compose([])],
family_member_earning_status : ['', Validators.compose([])],
earning_segment: ['', Validators.compose([])],
earning_gross_income_per_month: ['', Validators.compose([])],
earning_name_of_the_employer_or_business: ['', Validators.compose([])],
earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
non_earning_occupation: ['', Validators.compose([])],
non_earning_if_others: ['', Validators.compose([])],
non_earning_if_retired_from: ['', Validators.compose([])],
})
}
// get all master details
getMasterDetails(table:string,type:number){
this._pd.getAllMasterDatas(table).subscribe(
data => {
if (data.status == 200) {
if(type==1){
this.relationData=data.records.filter(item => item.isactive == 1);
}
else if(type==2){
this.occupationData=data.records.filter(item => item.isactive == 1);
}
// else if(type==3){
// this.personMetData=data.records.filter(item => item.isactive == 1);
// }
else if(type==4){
this.ownerShipData=data.records.filter(item => item.isactive == 1);
}
else if(type==5){
this.customerSegData=data.records.filter(item => item.isactive == 1);
}
}
});
}
submitFamily() {
if (!this.familyForm.valid) {
return;
}
var records = this.familyForm.value;
//To Remove The "Null" With Key also
Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
// records.other_family_details = answerFormValues;
records.pdid = this.pdid;
records.formid = '6';
// records.fk_createdby = '251';
this._pd.saveForm(records).subscribe(data => {
this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// validateAllFormFields(formGroup: FormGroup) {
// Object.keys(formGroup.controls).forEach(field => {
// const control = formGroup.get(field);
// if (control instanceof FormControl) {
// control.markAsTouched({onlySelf: true});
// } else if (control instanceof FormGroup) {
// this.validateAllFormFields(control);
// }
// });
// }
// /** On Key Press Event For Age */
// keyPress(event: any) {
// const pattern = /[0-9]/;
// let inputChar = String.fromCharCode(event.charCode);
// if (event.keyCode != 8 && !pattern.test(inputChar)) {
// event.preventDefault();
// }
// }
}
// =================== other family details multiple add
// import {
// Component,
// OnInit,
@ -343,7 +77,7 @@ export class FamilyDetailsComponent implements OnInit {
// //this.getMasterDetails('PERSONSMET',3);
// this.getMasterDetails('RESIDENCEOWNERSHIP',4);
// this.getMasterDetails('CUSTOMERSEGMENT',5);
// this.initFamilyFormDetails();
// this.initFamilyForm();
// let params: any = {};
// params.pd_id = this.pdid;
// params.pd_form_id = '6';
@ -351,19 +85,18 @@ export class FamilyDetailsComponent implements OnInit {
// const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
// const value = <FormArray>this.familyForm.controls['earningMembers'];
// if (data.status == 200) {
// this.initFamilyForm(data.records);
// // this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// // this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// // this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// // this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// // this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// // this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// // this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// // this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// // this.familyForm.controls.rent.setValue(data.records.rent);
// // this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
// // this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// // this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
// this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// this.familyForm.controls.rent.setValue(data.records.rent);
// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
// this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
// } else {
// // value.push(this.createMembers());
// // control.push(this.createNonMembers());
@ -402,111 +135,29 @@ export class FamilyDetailsComponent implements OnInit {
// onSearchChange(e):void {
// e.preventDefault();
// }
// public initFamilyFormDetails(): void {
// public initFamilyForm(): void {
// this.familyForm = this.fb.group({
// family_details: this.fb.array([]),
// family_details_form_remark: ['']
// })
// }
// public noRecordsFound: Boolean = false;
// public initFamilyForm(records): void {
// // let data = [...records];
// let recordss = {
// "selected_person":"95",
// "residence_place":"check ",
// "residence_city":"check ",
// "residence_state":"check ",
// "residence_pin":"123456",
// "residence_No_of_years":"2",
// "residence_ownership":"1",
// "ownershipOther":"",
// "rent":"",
// "total_number_of_family_members":"2",
// "family_members_details":{
// "1":{
// "family_member_name":"name",
// "family_member_relationship":"1",
// "family_member_age":"21",
// "family_member_earning_status":"1",
// "earning_segment":"1",
// "earning_gross_income_per_month":"12000",
// "earning_name_of_the_employer_or_business":"check",
// "earning_number_of_years_in_employment_or_business":"2",
// "non_earning_occupation":"",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// },
// "2":{
// "family_member_name":"chekc ",
// "family_member_relationship":"2",
// "family_member_age":"31",
// "family_member_earning_status":"2",
// "earning_segment":"",
// "earning_gross_income_per_month":"",
// "earning_name_of_the_employer_or_business":"",
// "earning_number_of_years_in_employment_or_business":"",
// "non_earning_occupation":"9",
// "non_earning_if_others":"others check ",
// "non_earning_if_retired_from":""
// }
// },
// "family_details_form_remark":"check remark"
// };
// if(recordss === null) {
// this.fb.group({
// selected_person: ['', Validators.compose([Validators.required])],
// residence_place: ['', Validators.compose([])],
// residence_city: ['', Validators.compose([])],
// residence_state: ['', Validators.compose([])],
// residence_pin: ['', Validators.compose([])],
// residence_No_of_years: ['', Validators.compose([])],
// residence_ownership: ['', Validators.compose([])],
// ownershipOther: [''],
// rent: [''],
// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
// family_members_details: this.fb.array([this.addFamilyMemberDetails()]),
// });
// } else {
// let formData: FormGroup = this.fb.group({
// selected_person: ['1', Validators.compose([Validators.required])],
// residence_place: ['as', Validators.compose([])],
// residence_city: ['as', Validators.compose([])],
// residence_state: ['sa', Validators.compose([])],
// residence_pin: ['sa', Validators.compose([])],
// residence_No_of_years: ['sa', Validators.compose([])],
// residence_ownership: ['s', Validators.compose([])],
// ownershipOther: ['s'],
// rent: ['as'],
// total_number_of_family_members: ['1', Validators.compose([Validators.min(1), Validators.max(20)])],
// selected_person: ['', Validators.compose([Validators.required])],
// residence_place: ['', Validators.compose([])],
// residence_city: ['', Validators.compose([])],
// residence_state: ['', Validators.compose([])],
// residence_pin: ['', Validators.compose([])],
// residence_No_of_years: ['', Validators.compose([])],
// residence_ownership: ['', Validators.compose([])],
// ownershipOther: [''],
// rent: [''],
// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
// family_members_details: this.fb.array([]),
// family_details_form_remark: ['']
// });
// const control = <FormArray>this.familyForm.controls['family_details'];
// control.push(formData);
// console.log(this.familyForm.value);
// }
// this.noRecordsFound = true;
// }
// addFamilyMemberDetails(): void {
// }
// addMoreApplicantFamilyDetails(e): void {
// e.stopPropagation();
// this.initFamilyForm('chck');
// }
// getNumberOfFamilyMemberDetails(inx){
// // alert(inx);
// let formData = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls;
// // alert(formData['total_number_of_family_members'].value);
// getNumberOfFamilyMemberDetails(){
// // alert(this.familyForm.controls.total_number_of_family_members.valid);
// if(formData['total_number_of_family_members'].valid){
// let totalMem = formData['total_number_of_family_members'].value;
// const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
// if(this.familyForm.controls.total_number_of_family_members.valid){
// let totalMem = this.familyForm.get('total_number_of_family_members').value;
// const control = <FormArray>this.familyForm.controls.family_members_details;
// if(totalMem > control.length) {
// let len = totalMem - control.length;
// for(let i = 0; i < len; i++){
@ -523,7 +174,7 @@ export class FamilyDetailsComponent implements OnInit {
// }
// }
// generateFamilyMembersDetailsGet(): FormGroup {
// return this.fb.group({
// family_member_name : ['', Validators.compose([])],
@ -560,7 +211,7 @@ export class FamilyDetailsComponent implements OnInit {
// else if(type==5){
// this.customerSegData=data.records.filter(item => item.isactive == 1);
// }
// }
// });
// }
@ -576,12 +227,11 @@ export class FamilyDetailsComponent implements OnInit {
// records.pdid = this.pdid;
// records.formid = '6';
// // records.fk_createdby = '251';
// console.log(JSON.stringify(records));
// // this._pd.saveForm(records).subscribe(data => {
// // this.notifier.notify('success', 'Saved Successfully.');
// // }, error => {
// // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// // });
// this._pd.saveForm(records).subscribe(data => {
// this.notifier.notify('success', 'Saved Successfully.');
// }, error => {
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// });
// }
// // validateAllFormFields(formGroup: FormGroup) {
// // Object.keys(formGroup.controls).forEach(field => {
@ -597,11 +247,416 @@ export class FamilyDetailsComponent implements OnInit {
// // /** On Key Press Event For Age */
// // keyPress(event: any) {
// // const pattern = /[0-9]/;
// // let inputChar = String.fromCharCode(event.charCode);
// // if (event.keyCode != 8 && !pattern.test(inputChar)) {
// // event.preventDefault();
// // }
// // }
// }
// }
// =================== other family details multiple add
import {
Component,
OnInit,
Inject,
Input, Output
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: 'app-family-details',
templateUrl: './family-details.component.html',
styleUrls: ['./family-details.component.scss']
})
export class FamilyDetailsComponent implements OnInit {
//@Input() pdid: number;
pageTitle: string = "Other Family Details";
pdid: string;
form_id: number;
private notifier: NotifierService;
public familyForm: FormGroup;
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
id: 1
}, {
type: 'Non Earning',
id: 2
}]
relationData: any = [];
occupationData: any = [];
//personMetData: any = [];
ownerShipData: any = [];
customerSegData: any = [];
// earnMemberArrCount :any ;
// nonEarnMemberArrCount :any ;
count: number;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
}
ngOnInit() {
this.getMasterDetails('RELATIONSHIPS', 1);
this.getMasterDetails('OCCUPATIONMEMBERS', 2);
//this.getMasterDetails('PERSONSMET',3);
this.getMasterDetails('RESIDENCEOWNERSHIP', 4);
this.getMasterDetails('CUSTOMERSEGMENT', 5);
this.initFamilyFormDetails();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '6';
this._pd.retriveForm(params).subscribe(data => {
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
const value = <FormArray>this.familyForm.controls['earningMembers'];
if (data.status == 200) {
this.initFamilyForm(data.records.family_details);
// this.familyForm.controls.selected_person.setValue(data.records.selected_person);
// this.familyForm.controls.residence_place.setValue(data.records.residence_place);
// this.familyForm.controls.residence_city.setValue(data.records.residence_city);
// this.familyForm.controls.residence_state.setValue(data.records.residence_state);
// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin);
// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years);
// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership);
// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther);
// this.familyForm.controls.rent.setValue(data.records.rent);
// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members);
this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark);
// this.generateFamilyMembersDetailsGetData(data.records.family_members_details);
} else {
// value.push(this.createMembers());
// control.push(this.createNonMembers());
this.initFamilyForm(null);
}
});
}
initgenerateFamilyMembersDetailsGet(val): FormGroup {
return this.fb.group({
family_member_name: [val.family_member_name, Validators.compose([])],
family_member_relationship: [val.family_member_relationship, Validators.compose([])],
family_member_age: [val.family_member_age, Validators.compose([])],
family_member_earning_status: [val.family_member_earning_status, Validators.compose([])],
earning_segment: [val.earning_segment, Validators.compose([])],
earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])],
earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])],
non_earning_occupation: [val.non_earning_occupation, Validators.compose([])],
non_earning_if_others: [val.non_earning_if_others, Validators.compose([])],
non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])],
})
}
generateFamilyMembersDetailsGetData(data) {
var result = Object.keys(data).map(function (key) {
return data[key];
});
if (result.length > 0) {
for (let val of result) {
const control = <FormArray>this.familyForm.controls['family_members_details'];
control.push(this.initgenerateFamilyMembersDetailsGet(val));
}
}
}
onSearchChange(e): void {
e.preventDefault();
}
public initFamilyFormDetails(): void {
this.familyForm = this.fb.group({
family_details: this.fb.array([]),
family_details_form_remark: ['']
})
}
public noRecordsFound: Boolean = false;
public initFamilyForm(records): void {
// let data = [...records];
// let recordss = [
// {
// "selected_person":"51",
// "residence_place":"as",
// "residence_city":"as",
// "residence_state":"sa",
// "residence_pin":"sa",
// "residence_No_of_years":12,
// "residence_ownership":"1",
// "ownershipOther":"s",
// "rent":"as",
// "total_number_of_family_members":2,
// "family_members_details":[
// {
// "family_member_name":"ce",
// "family_member_relationship":"2",
// "family_member_age":"12",
// "family_member_earning_status":"1",
// "earning_segment":"6",
// "earning_gross_income_per_month":"12",
// "earning_name_of_the_employer_or_business":"21",
// "earning_number_of_years_in_employment_or_business":"12",
// "non_earning_occupation":null,
// "non_earning_if_others":null,
// "non_earning_if_retired_from":null
// },
// {
// "family_member_name":"csdcs",
// "family_member_relationship":"2",
// "family_member_age":"21",
// "family_member_earning_status":"1",
// "earning_segment":"4",
// "earning_gross_income_per_month":"as",
// "earning_name_of_the_employer_or_business":"as",
// "earning_number_of_years_in_employment_or_business":"sa",
// "non_earning_occupation":"",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// }
// ]
// },
// {
// "selected_person":"51",
// "residence_place":"as",
// "residence_city":"as",
// "residence_state":"sa",
// "residence_pin":"sa",
// "residence_No_of_years":13,
// "residence_ownership":"2",
// "ownershipOther":"s",
// "rent":"as",
// "total_number_of_family_members":"1",
// "family_members_details":[
// {
// "family_member_name":"dinesh",
// "family_member_relationship":"4",
// "family_member_age":"26",
// "family_member_earning_status":"2",
// "earning_segment":"",
// "earning_gross_income_per_month":"",
// "earning_name_of_the_employer_or_business":"",
// "earning_number_of_years_in_employment_or_business":"",
// "non_earning_occupation":"2",
// "non_earning_if_others":"",
// "non_earning_if_retired_from":""
// }
// ]
// }
// ];
if (records === null) {
let formData: FormGroup = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
residence_pin: ['', Validators.compose([])],
residence_No_of_years: ['', Validators.compose([])],
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
});
const control = <FormArray>this.familyForm.controls['family_details'];
control.push(formData);
} else {
for (let val of records) {
let formData: FormGroup = this.fb.group({
selected_person: [val.selected_person, Validators.compose([Validators.required])],
residence_place: [val.residence_place, Validators.compose([])],
residence_city: [val.residence_city, Validators.compose([])],
residence_state: [val.residence_state, Validators.compose([])],
residence_pin: [val.residence_pin, Validators.compose([])],
residence_No_of_years: [val.residence_No_of_years, Validators.compose([])],
residence_ownership: [val.residence_ownership, Validators.compose([])],
ownershipOther: [val.ownershipOther || null],
rent: [val.rent || null],
total_number_of_family_members: [val.total_number_of_family_members, Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
});
const control = <FormArray>this.familyForm.controls['family_details'];
control.push(formData);
let inx = control.length - 1;
this.addFamilyMemberDetailsWithData(inx, val.family_members_details);
console.log(control);
}
}
this.noRecordsFound = true;
}
addFamilyMemberDetailsWithData(inx, val): void {
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
for (let vals of val) {
let datas = this.fb.group({
family_member_name: [vals.family_member_name || null, Validators.compose([])],
family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])],
family_member_age: [vals.family_member_age || null, Validators.compose([])],
family_member_earning_status: [vals.family_member_earning_status || null, Validators.compose([])],
earning_segment: [vals.earning_segment || null, Validators.compose([])],
earning_gross_income_per_month: [vals.earning_gross_income_per_month || null, Validators.compose([])],
earning_name_of_the_employer_or_business: [vals.earning_name_of_the_employer_or_business || null, Validators.compose([])],
earning_number_of_years_in_employment_or_business: [vals.earning_number_of_years_in_employment_or_business || null, Validators.compose([])],
non_earning_occupation: [vals.non_earning_occupation || null, Validators.compose([])],
non_earning_if_others: [vals.non_earning_if_others || null, Validators.compose([])],
non_earning_if_retired_from: [vals.non_earning_if_retired_from || null, Validators.compose([])],
});
control.push(datas);
}
}
addFamilyMemberDetails() {
}
addMoreApplicantFamilyDetails(e): void {
e.stopPropagation();
this.initFamilyForm('chck');
}
getNumberOfFamilyMemberDetails(inx) {
// alert(inx);
let formData = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls;
// alert(formData['total_number_of_family_members'].value);
// alert(this.familyForm.controls.total_number_of_family_members.valid);
if (formData['total_number_of_family_members'].valid) {
let totalMem = formData['total_number_of_family_members'].value;
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
if (totalMem > control.length) {
let len = totalMem - control.length;
for (let i = 0; i < len; i++) {
control.push(this.generateFamilyMembersDetailsGet());
}
} else if (totalMem < control.length) {
// control.controls.slice(0, totalMem);
control.controls = [];
for (let i = 0; i < totalMem; i++) {
control.push(this.generateFamilyMembersDetailsGet());
}
}
} else {
}
}
generateFamilyMembersDetailsGet(): FormGroup {
return this.fb.group({
family_member_name: ['', Validators.compose([])],
family_member_relationship: ['', Validators.compose([])],
family_member_age: ['', Validators.compose([])],
family_member_earning_status: ['', Validators.compose([])],
earning_segment: ['', Validators.compose([])],
earning_gross_income_per_month: ['', Validators.compose([])],
earning_name_of_the_employer_or_business: ['', Validators.compose([])],
earning_number_of_years_in_employment_or_business: ['', Validators.compose([])],
non_earning_occupation: ['', Validators.compose([])],
non_earning_if_others: ['', Validators.compose([])],
non_earning_if_retired_from: ['', Validators.compose([])],
})
}
// get all master details
getMasterDetails(table: string, type: number) {
this._pd.getAllMasterDatas(table).subscribe(
data => {
if (data.status == 200) {
if (type == 1) {
this.relationData = data.records.filter(item => item.isactive == 1);
}
else if (type == 2) {
this.occupationData = data.records.filter(item => item.isactive == 1);
}
// else if(type==3){
// this.personMetData=data.records.filter(item => item.isactive == 1);
// }
else if (type == 4) {
this.ownerShipData = data.records.filter(item => item.isactive == 1);
}
else if (type == 5) {
this.customerSegData = data.records.filter(item => item.isactive == 1);
}
}
});
}
submitFamily() {
if (!this.familyForm.valid) {
return;
}
var records = this.familyForm.value;
//To Remove The "Null" With Key also
Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]);
// records.other_family_details = answerFormValues;
records.pdid = this.pdid;
records.formid = '6';
// records.fk_createdby = '251';
console.log(JSON.stringify(records));
this._pd.saveForm(records).subscribe(data => {
this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// validateAllFormFields(formGroup: FormGroup) {
// Object.keys(formGroup.controls).forEach(field => {
// const control = formGroup.get(field);
// if (control instanceof FormControl) {
// control.markAsTouched({onlySelf: true});
// } else if (control instanceof FormGroup) {
// this.validateAllFormFields(control);
// }
// });
// }
// /** On Key Press Event For Age */
// keyPress(event: any) {
// const pattern = /[0-9]/;
// let inputChar = String.fromCharCode(event.charCode);
// if (event.keyCode != 8 && !pattern.test(inputChar)) {
// event.preventDefault();
// }
// }
}

View File

@ -6,6 +6,9 @@
color: #fff !important;
background-color: #e00201 !important;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
// ::ng-deep .cdk-overlay-pane{
// max-width: 100vw !important;
// width: 100% !important;

View File

@ -21,7 +21,9 @@
.underline input {
border: none;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.greenhighlight {
color: green;
}

View File

@ -23,4 +23,7 @@
.p-text {
color:#e00201 !important;
font-weight: bold;
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -9,7 +9,9 @@
// margin: 0 2%;
// width:100%;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -21,7 +21,9 @@
color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -26,8 +26,7 @@
</div>
</mat-card-header>
<mat-card-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0">
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
<mat-card-content>
<mat-card-content *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
<mat-form-field style="width: 42%">
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text">
</mat-form-field>
@ -51,7 +50,7 @@
matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0">
<mat-icon>delete</mat-icon></button>
</mat-card-content>
</mat-card>
</mat-card-content>
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;" [formGroupName]="r">

View File

@ -18,4 +18,7 @@
.example-radio-button {
margin: 0 4%;
color: #000 !important
}
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}

View File

@ -16,7 +16,9 @@
// background: #62B013;
// color: white;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -12,7 +12,9 @@
mat-form-field {
margin: 0 2%;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main {

View File

@ -25,7 +25,9 @@
// width: 45%;
// margin: 0 2%;
// }
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -18,13 +18,13 @@
<div fxFlex="100">
<mat-card *ngIf="manufacturingForm">
<mat-card-header>
<mat-card-title><p> Manufacturing Details</p></mat-card-title>
<mat-card-title class="highlight"> Manufacturing Details </mat-card-title>
</mat-card-header>
<div formArrayName="manufacturing_details">
<div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<div formArrayName="manufacturing_raw_materials">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index" [formGroupName]="a">
<mat-card-subtitle> <p>{{a+1}} . Raw Material </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{a+1}} . Raw Material </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="raw_name" >
@ -62,7 +62,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field>
</span>
@ -80,7 +80,7 @@
<div formArrayName="manufacturing_finished_goods">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index" [formGroupName]="b">
<mat-card-subtitle> <p> {{b+1}} Finished Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p> {{b+1}} Finished Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
@ -109,7 +109,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the finished goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field>
</span>
@ -128,7 +128,7 @@
<div formArrayName="manufacturing_traded_goods">
<div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index" [formGroupName]="c">
<mat-card-subtitle> <p>{{c+1}} Traded Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{c+1}} Traded Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
@ -158,7 +158,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field>
</span>
@ -185,10 +185,10 @@
<div formArrayName="retail_details">
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j">
<div formArrayName="retail_finished_goods">
<div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index" [formGroupName]="d">
<mat-card-subtitle> <p>{{d+1}} Finished Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{d+1}} Finished Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
@ -218,7 +218,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the finished goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field>
</span>
@ -237,7 +237,7 @@
<div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index" [formGroupName]="e">
<mat-card-subtitle> <p>{{e+1}} Traded Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{e+1}} Traded Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
@ -267,7 +267,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field>
</span>
@ -298,7 +298,7 @@
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k">
<div formArrayName="trading_finished_goods">
<div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index" [formGroupName]="f">
<mat-card-subtitle> <p>{{f+1}} Finished Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{f+1}} Finished Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
@ -328,7 +328,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the finished goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field>
</span>
@ -348,7 +348,7 @@
<div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index" [formGroupName]="g">
<mat-card-subtitle> <p>{{g+1}} Traded Goods </p> </mat-card-subtitle>
<mat-label class="highlight"> <i> <p>{{g+1}} Traded Goods </p> </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
@ -378,7 +378,7 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field>
</span>
@ -515,7 +515,7 @@
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<mat-label class="highlight"> <i>Remarks</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="stock_remarks"></textarea>
</mat-form-field>
</div>

View File

@ -16,7 +16,9 @@
// background: #62B013;
// color: white;
// }
.highlight {
color: red;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
@ -24,6 +26,9 @@
.mat-card-content {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.mat-card-actions {
background-color: white;
}

View File

@ -7,6 +7,9 @@
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-card.parent_mat_card > {
mat-card-header {
display: flex;

View File

@ -469,6 +469,15 @@ export class PdTrigerService {
catchError(this.handleError('operation', []))
)
}
getCompaniesListsForBusiness(pdid: any): Observable<any> {
return this._http.post<any>(this.apiUrl + "getCompaniesListsForBusiness", { "records":{ "pd_id" : pdid}})
.pipe(
catchError(this.handleError('operation', []))
)
}
// private handleError<T>(operation = 'operation', result?: T) {
// return (error: any): Observable<T> => {
// return of(result as T);

0
ng6-seed/src/app/shared/rating/rating.component.html Normal file → Executable file
View File

0
ng6-seed/src/app/shared/rating/rating.component.scss Normal file → Executable file
View File

View File

0
ng6-seed/src/app/shared/rating/rating.component.ts Normal file → Executable file
View File