merge : kms

This commit is contained in:
gandhimathi 2018-12-21 15:05:11 +05:30
parent deb9a48b86
commit 86902dfc63
7 changed files with 636 additions and 174 deletions

View File

@ -200,4 +200,10 @@
</div>
</mat-dialog-actions>
</form>
</div>
</div>
<div *ngIf="!noRecordsFound">
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
</div>
<!--
<notifier-container></notifier-container>-->

View File

@ -101,6 +101,7 @@ export class ClientInfoComponent implements OnInit {
};
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
@ -135,10 +136,12 @@ export class ClientInfoComponent implements OnInit {
}else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = data.msg;
}
}, err => {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = 'No Records Found , Something went Wrong!';
})
// this.getM_FreqOfPurchase();

View File

@ -269,181 +269,277 @@
<!--<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"
mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<form *ngIf="noRecordsFound" class="address" [formGroup]="familyForm">
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<div formArrayName="family_details">
<mat-card *ngFor="let sup of familyForm.controls.family_details['controls']; let ix=index" [formGroupName]="ix">
<mat-card-content>
<div>
<mat-form-field>
<mat-select placeholder="Select a person" formControlName="selected_person" required>
<mat-option value="{{person.pd_co_applicant_id}}" *ngFor="let person of selectPerson">
{{person.applicant_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<h5>Residence Details</h5>
<mat-form-field>
<input matInput placeholder="Place" formControlName="residence_place" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="City" formControlName="residence_city" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="State" formControlName="residence_state" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Pin" formControlName="residence_pin" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Number of yrs" formControlName="residence_No_of_years" type="number" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Ownership" formControlName="residence_ownership" required>
<mat-option value="{{ownerShip.id}}" *ngFor="let ownerShip of ownerShipData">
{{ownerShip.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 4">
<input matInput placeholder="Please specify" formControlName="ownershipOther">
</mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 3">
<input matInput placeholder="Rent Amount" formControlName="rent">
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Number of Family Members" formControlName="total_number_of_family_members" (focusout)="getNumberOfFamilyMemberDetails(ix)"
type="number" max='20' min='1'>
</mat-form-field>
</div>
<div>
<div formArrayName="family_members_details">
<div *ngFor="let item of sup.controls.family_members_details['controls']; let i=index" [formGroupName]="i">
<mat-card>
<div>
<mat-form-field>
<input matInput placeholder="Name" formControlName="family_member_name" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relationship" formControlName="family_member_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>
<input matInput placeholder="Age" formControlName="family_member_age" required>
</mat-form-field>
</div>
<div>
<mat-form-field>
<mat-select placeholder="Earning Status" formControlName="family_member_earning_status" required>
<mat-option value="{{earnings.id}}" *ngFor="let earnings of earningStatus">
{{earnings.type}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div *ngIf="item.get('family_member_earning_status').value == 1">
<mat-form-field>
<mat-select placeholder="Segment" formControlName="earning_segment" required>
<mat-option value="{{segment.customer_segment_id}}" *ngFor="let segment of customerSegData">
{{segment.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Income Per Month" formControlName="earning_gross_income_per_month" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="No. of years in Employer/Business" formControlName="earning_number_of_years_in_employment_or_business"
required>
</mat-form-field>
</div>
<div *ngIf="item.get('family_member_earning_status').value == 2">
<mat-form-field>
<mat-select placeholder="Occupation" formControlName="non_earning_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="item.get('non_earning_occupation').value==9">
<input matInput placeholder="Specify Others" formControlName="non_earning_if_others" required>
</mat-form-field>
<mat-form-field *ngIf="item.get('non_earning_occupation').value==3">
<input matInput placeholder="Retired From" formControlName="non_earning_if_retired_from" type="date" required>
</mat-form-field>
</div>
</mat-card>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
</ng-template>
</mat-tab>
<!-- <mat-card style="min-height: 550px;">
<mat-card-content>
<p>Family Details</p>
<form class="address" [formGroup]="familyForm"> -->
<!-- <mat-form-field>
<mat-select placeholder="Person Met" formControlName="person" required>
<mat-option *ngFor="let personMet of personMetData" [value]="personMet.person_met_id">
{{personMet.person_met_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="person.value ==8">
<input matInput placeholder="Enter the relationship" formControlName="personOther">
</mat-form-field> -->
<!-- <mat-form-field>
<input matInput placeholder="Number Of Family Members" formControlName="members" required>
</mat-form-field>
<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-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com">
<mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</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>
<mat-card-header>
<p>Residence </p>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
<input matInput placeholder="Residence Address"
formControlName="residence" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Number of yrs" formControlName="years" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Ownership" formControlName="ownership" required>
<mat-option value="{{ownerShip.id}}"
*ngFor="let ownerShip of ownerShipData">
{{ownerShip.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="ownership.value ==4">
<input matInput placeholder="Please specify" formControlName="ownershipOther">
</mat-form-field>
<mat-form-field *ngIf="ownership.value ==3">
<input matInput placeholder="Rent Amount"
formControlName="rent">
</mat-form-field>
</mat-card-content>
</mat-card>
<div fxLayout="row">
<div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%">
</mat-tab-group>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="family_details_form_remark"></textarea>
</mat-form-field>
</div>
</div>
<div style="text-align: right;">
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon>
</button>
</div>
</form>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Applicant Family Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addMoreApplicantFamilyDetails($event); false"><mat-icon>add</mat-icon></button>
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</mat-card-content>
</mat-card> -->
</form>
<notifier-container></notifier-container>-->

View File

@ -254,4 +254,354 @@ export class FamilyDetailsComponent implements OnInit {
// }
// }
}
}
// =================== 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);
// // 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 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":"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)])],
// family_members_details: this.fb.array([]),
// });
// 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);
// // 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

@ -131,4 +131,9 @@
</div>
</mat-dialog-actions>
</form>
</div>
</div>
<div *ngIf="!noRecordsFound">
<div style="margin: 12px; font-size: 18px;"> {{ errorMessage }} </div>
</div>
<!--
<notifier-container></notifier-container>-->

View File

@ -74,8 +74,8 @@ export class SupplierInfoComponent implements OnInit {
};
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
if(data.dataStatus){
// let datas = {
@ -100,10 +100,12 @@ export class SupplierInfoComponent implements OnInit {
}else {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = data.msg;
}
}, err => {
this.notifier.notify('warning', 'No Category Records Found.!');
this.noRecordsFound = false;
this.errorMessage = 'No Records Found , Something went Wrong!';
})
// this.getM_FreqOfPurchase();

View File

@ -16,13 +16,13 @@
</mat-card-header>
<mat-card-content style="max-height:100% !important;">
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="30" fxFlex.lg="23" fxFlex.xl="23" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#827f7f' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton)">
<mat-card-header>
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="30" fxFlex.lg="23" fxFlex.xl="23" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton)">
<mat-card-header >
<div fxFlex="90" align="left" style="padding:15px !important;">
{{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }}
</div>
<div fxFlex="20" align="end">
<span style="padding: 3px;" class="menu-badge mat-purple ng-star-inserted" align="center">Q{{formButton.pd_form_order}}</span>
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div>
<!-- <mat-card-subtitle>Karthi Kms</mat-card-subtitle> -->
</mat-card-header>