General_form

This commit is contained in:
venbatechnologies@gmail.com 2019-01-28 12:52:25 +05:30
parent 26049f9353
commit 668cd1077c
36 changed files with 2580 additions and 850 deletions

1
.sourcemaps/main.js.map Normal file

File diff suppressed because one or more lines are too long

View File

@ -92,6 +92,7 @@ import { PdQuestionAssessedPurchasePage } from '../pages/pd-question/pd-question
import { PdQuestionAssessedDashPage } from '../pages/pd-question/pd-question-assessed-dash/pd-question-assessed-dash';
import { PdQuestionAssessedBusinessIncomePage } from '../pages/pd-question/pd-question-assessed-business-income/pd-question-assessed-business-income';
import { PdQuestionAssessedBusinessPage } from '../pages/pd-question/pd-question-assessed-business/pd-question-assessed-business';
import { PdQuestionGeneralInfoPage } from '../pages/pd-question/pd-question-general-info/pd-question-general-info';
import { LocationAccuracy } from '@ionic-native/location-accuracy';
import { BouncedRejectPage } from '../pages/input/bounced-reject/bounced-reject';
import { DatabaseProvider } from '../providers/database/database';
@ -134,6 +135,7 @@ import { PdGeneralImagesPage } from '../pages/pd-general-images/pd-general-image
PdQuestionAssessedDashPage,
PdQuestionAssessedBusinessPage,
PdQuestionAssessedBusinessIncomePage,
PdQuestionGeneralInfoPage,
BouncedRejectPage,
PdGeneralImagesPage,
@ -208,6 +210,7 @@ import { PdGeneralImagesPage } from '../pages/pd-general-images/pd-general-image
PdQuestionAssessedDashPage,
PdQuestionAssessedBusinessPage,
PdQuestionAssessedBusinessIncomePage,
PdQuestionGeneralInfoPage,
BouncedRejectPage,
PdGeneralImagesPage,

0
src/pages/pd-general-images/pd-general-images.html Normal file → Executable file
View File

0
src/pages/pd-general-images/pd-general-images.scss Normal file → Executable file
View File

0
src/pages/pd-general-images/pd-general-images.ts Normal file → Executable file
View File

View File

@ -28,7 +28,7 @@ import { PdQuestionFinancialInfoPage } from '../pd-question/pd-question-financia
import { PdQuestionAssessedInfoPage } from '../pd-question/pd-question-assessed-info/pd-question-assessed-info';
import { PdQuestionAssessedDashPage } from '../pd-question/pd-question-assessed-dash/pd-question-assessed-dash';
// import { PdQuestionLenderRepresentativePage } from '../pd-question/pd-question-lender-representative/pd-question-lender-representative';
// import { PdQuestionGeneralInfoPage } from '../pd-question/pd-question-general-info/pd-question-general-info';
import { PdQuestionGeneralInfoPage } from '../pd-question/pd-question-general-info/pd-question-general-info';
// import { PdQuestionNeighbourHoodPage } from '../pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood';
import { Geolocation, Geoposition } from '@ionic-native/geolocation';
@ -279,7 +279,7 @@ completedStatus:FormGroup;
}else if(categroyId==18)
{
// this.navCtrl.push(PdQuestionGeneralInfoPage,{'FormId':formName,'pdDetails':this.pdinfo});
this.navCtrl.push(PdQuestionGeneralInfoPage,{'FormId':formName,'pdDetails':this.pdinfo});
}else if(categroyId==19)
{
// this.navCtrl.push(PdQuestionNeighbourHoodPage,{'FormId':formName,'pdDetails':this.pdinfo});

View File

@ -0,0 +1,351 @@
<ion-header>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<form [formGroup]="generalForm">
<!-- <mat-card>
<mat-card-title>Name of Person Met</mat-card-title>
<div formArrayName="applicant_list">
<mat-list *ngFor="let applicant of generalForm.controls.applicant_list['controls']; let c = index;" [formGroupName]="c">
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status" (change)="coapplicantChange($event, c, applicant.controls)">{{applicant.controls.applicant_name.value}}</mat-checkbox>
</mat-list>
</div>
</mat-card>-->
<!--<ion-list>
<ion-item>
<ion-grid item-content>
<h5>1</h5>
<ion-row>
<ion-col>
<h4 class="p_name"> Hai skdjfkjdsfkjdsf kjdsf</h4>
<h5 class="p_age">dsf</h5>
<h5 class="p_qual">dsf</h5>
</ion-col>
<ion-col text-right width-10>
<ion-row>
<ion-item>
<ion-label></ion-label>
<ion-toggle></ion-toggle>
</ion-item>
<ion-item>
<ion-label>Person Met</ion-label>
<ion-toggle></ion-toggle>
</ion-item>
</ion-row>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
</ion-list>
Ion Grid usage
-->
<!--Individual Value Display Field-->
<div class="lis" formArrayName="list_value">
<h6 padding>Name of individuals</h6>
<mat-card-content style="padding: 10px 5px !important;margin-bottom: 0px !important;">
<div text-wrap [formGroupName]="i" *ngFor="let item of generalForm.controls.list_value['controls']; let i=index">
<ion-row>
<ion-col col-1 style="align-self: center;">
<h6 class="num" >{{i+1}}</h6>
</ion-col>
<ion-col col-8 style="padding:0px !important;">
<p style="margin:0px !important;padding:0px !important;" class="p_name">{{item.get('applicant_name').value | uppercase}}</p>
<p class="p_age">Age : {{item.get('age').value}}</p>
<p class="p_qual"> <ion-icon name="school"></ion-icon> {{item.get('qualification').value}}</p>
</ion-col>
<ion-col col-2>
<ion-item style="padding-left:0px !important;">
<ion-toggle item-end></ion-toggle>
</ion-item>
<ion-item style="padding-left:0px !important;">
<ion-toggle item-end></ion-toggle>
</ion-item>
</ion-col>
<ion-col col-1>
<button style="margin: 0px !important;height: 100%;background-color: #e00201;color: #fff;"><ion-icon name="trash"></ion-icon></button>
</ion-col>
</ion-row>
<hr>
</div>
</mat-card-content>
</div>
<mat-card-content style="padding: 10px 15px !important;">
<ion-row>
<ion-col end>
<div class="btn">
<button *ngIf="!buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)"> <ion-icon name="person-add"></ion-icon></button>
<button *ngIf="buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)">Close<ion-icon name="md-close"></ion-icon></button>
</div>
</ion-col>
</ion-row>
<div *ngIf="buttonClick" >
<mat-card-header>
<mat-card-title>Add individuals</mat-card-title>
</mat-card-header>
<!--Individual Value add Field-->
<div formArrayName="individuals">
<div [formGroupName]="i" *ngFor="let indi of generalForm.controls.individuals['controls']; let i=index">
<mat-form-field>
<input matInput type="text" placeholder="Name of the Person" formControlName="applicant_name">
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Person Age" formControlName="age">
</mat-form-field>
<mat-form-field >
<mat-select placeholder="Qualification" formControlName="qualification" >
<mat-option [value]="qu.qualification_name" *ngFor="let qu of qualificationList">{{qu.qualification_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox class="table-checkbox-com" color="primary" formControlName="is_person_met">Is Person Met</mat-checkbox><br/> <br/>
<mat-checkbox class="table-checkbox-com" color="primary" formControlName="is_applicant">Is Applicant</mat-checkbox><br/>
<div padding class="add_btn">
<button ion-button float-right color="optblue" (click)="delete(1)">Add</button>
</div>
</div>
</div>
<!-- <span float-right ion-button large color="optblue" icon-left clear (click)="add()"><ion-icon name="md-add"></ion-icon></span>-->
</div>
</mat-card-content>
<!--Company Value Display Field-->
<div class="lis" formArrayName="company_value">
<ion-list >
<ion-list-header>
<p> Company/Firm </p>
</ion-list-header>
<div [formGroupName]="i" *ngFor="let item of generalForm.controls.company_value['controls']; let i=index">
<ion-item text-wrap>
<ion-label class="num" >{{i+1}}</ion-label>
<ion-label class="det_p" style="margin: 5px 0px 10px 0 !important;">
<h4 class="p_name">{{item.get('company_name').value | uppercase}}</h4>
<h5 class="p_age">{{item.get('business_entity_type').value}}</h5>
<h6 class="p_qual"><ion-icon name="md-calendar"></ion-icon>3yrs 2 Months</h6>
</ion-label>
<ion-toggle item-end class="applicant_t" formControlName="is_company_applicant"></ion-toggle>
<!-- <button item-end small ion-button (click)="removeList(i,2)">Rem</button>-->
</ion-item>
<hr>
</div>
</ion-list>
</div>
<div class="btn1">
<button *ngIf="!h_companies" float-right ion-button large color="optblue" icon-left clear (click)="addRec(2)"><ion-icon name="add"></ion-icon></button>
<button *ngIf="h_companies" float-right ion-button large color="optblue" icon-left clear (click)="addRec(2)">Close<ion-icon name="md-close"></ion-icon></button>
</div>
<!--Company Value add Field-->
<div >
<mat-card *ngIf="h_companies">
<mat-card-header>
Add Company/Firm
</mat-card-header>
<mat-card-content formArrayName="companies">
<div *ngFor="let cmp of generalForm.controls.companies['controls']; let i=index" [formGroupName]="i">
<mat-form-field>
<mat-label color="primary" stacked>Company / Firm</mat-label>
<input matInput type="text" formControlName="company_name">
</mat-form-field>
<mat-checkbox class="table-checkbox-com" color="primary" formControlName="is_company_applicant">Is Applicant</mat-checkbox><br/>
<br/> <mat-form-field>
<mat-select placeholder="Business Entity Type" formControlName="business_entity_type" >
<mat-option *ngFor="let business of businessEntityTypeList" [value]="business.business_entity_type_id">
{{business.business_entity_type_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="cmp.value.business_entity_type==1">
<input matInput type="text" placeholder="Please Specity Others" formControlName="business_entity_type_other">
</mat-form-field>
<p>Number of Years For Which The Business Has Been Running</p>
<mat-form-field>
<input matInput type="number" placeholder="Year" >
</mat-form-field>
<mat-form-field>
<input matInput type="text" placeholder="Month" >
</mat-form-field>
<mat-form-field>
<input matInput type="date" placeholder="Enter Date of Formation, If Available" >
</mat-form-field>
<div padding class="add_btn">
<button ion-button float-right color="optblue" (click)="delete(2)">Add</button>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
<br/>
<!-- companies end -->
<!-- Person Relationship Starts Here -->
<div formArrayName="person_with_relationships" class="rbi">
<mat-card-header>
<mat-card-title style="font-size:16px;font-weight:bold"> Relationship Between Individuals</mat-card-title>
</mat-card-header>
<mat-card class="rbi">
<div *ngFor="let relation of generalForm.controls.person_with_relationships['controls']; let i=index" [formGroupName]="i">
<mat-card-content>
<h6>Applicant {{i+1}}</h6>
<mat-form-field>
<mat-select formControlName="applicant_name" placeholder="Applicant">
<mat-option *ngFor="let name of fulldata" [value]="name.applicant_name">{{name.applicant_name}}</mat-option>
</mat-select>
</mat-form-field><br/>
<mat-form-field style="width:50%">
<mat-select formControlName="relationship" placeholder="Relation">
<mat-option [value]="member.relationship_id" *ngFor="let member of relationShipList">{{member.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:50%" >
<mat-select placeholder="RelationTo" formControlName="relation_to">
<mat-option>Select</mat-option>
<mat-option [value]="rel.applicant_name" *ngFor="let rel of generalForm.value.list_value">{{rel.applicant_name | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
</mat-card-content>
</div>
</mat-card>
</div>
<div formArrayName="company_with_relationships">
<mat-card-header>
<mat-card-title style="font-size:16px;font-weight:bold"> Relationship of Individuals to Company / Firm</mat-card-title>
</mat-card-header>
<mat-card *ngFor="let cmprel of generalForm.controls.company_with_relationships['controls']; let i=index" [formGroupName]="i">
<h6>Applicant {{i+1}}</h6>
<mat-form-field>
<mat-select formControlName="applicant_name" placeholder="Applicant Name">
<mat-option *ngFor="let name of fulldata" [value]="name.applicant_name">{{name.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select formControlName="company_relationship" placeholder="Company Relation">
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select formControlName="relation_to_company" placeholder="Relation to">
<mat-option *ngFor="let comp of companyList" [value]="comp.company_name">{{comp.company_name}}-{{comp.company_order_id}}</mat-option>
</mat-select>
</mat-form-field>
<span float-right ion-button small color="optblue" clear (click)="removeList(i,'companyrel')"><ion-icon name="close"></ion-icon></span>
</mat-card>
<div padding>
<button ion-button style="background-color:#e00201 !important;" (click)="initCompanyRelationShip('')">Add More Company Relation</button>
</div>
</div>
<mat-card>
<mat-form-field style="width:100%">
<textarea matInput placeholder="Remarks" formControlName="general_remark" name="general_remark"></textarea>
</mat-form-field>
</mat-card>
<ion-row>
<!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="submitData(generalForm.value)"> Save</button>
<!-- </ion-buttons> -->
</ion-row>
</form>
<!--Old Data
<mat-card>
<div formArrayName="applicant_relation">
<div *ngFor="let relation of generalForm.controls.applicant_relation['controls']; let r = index;" [formGroupName]="r">
<mat-card-title>{{relation.controls.applicant_name.value}}</mat-card-title>
<mat-form-field style="width: 100%" *ngIf="relation.controls.company_name.value">
<input matInput placeholder="Company / Firm" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="relation.controls.company_name.value">
<mat-select placeholder="Relation" formControlName="company_relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Relation to" formControlName="applicant_relation_to">
<mat-option>Select</mat-option>
<mat-option *ngFor="let rel of fetch_related_details" [value]="rel">
[disabled]="relation.controls.applicant_name.value == rel"
{{rel | titlecase}}
</mat-option>
</mat-select>
<input matInput placeholder="Relation to" formControlName="applicant_relation_to" type="text">
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="relation.controls.applicant_relation_to.value">
<mat-select placeholder="Relation" formControlName="relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let relShip of relationShipList" [value]="relShip.relationship_id">
{{relShip.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<ion-col offset-1 col-3 *ngIf="relation.controls.pd_co_applicant_id.value==0">
<a (click)="removereferance(r)">
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
<hr/>
</div>
</div>
</mat-card>-->
</ion-content>

View File

@ -0,0 +1,141 @@
page-pd-question-general-info {
div{
margin:0;
padding:0;
}
.lis{
height:auto;
width:auto;
// margin-bottom:55px;
}
ion-item{
// height: 500px;
height:auto;
}
.check{
font-size: 16px;
}
// .item-cover{
// width: 0% !important;
// height: 0% !important;
// }
.det_p{
//float: left;
position: relative;
// padding-right:20px;
// padding-left:20px;
width:auto;
right:43%;
}
.p_name{
font-weight: bold;
font-size:16px;
width:auto;
// color:blue;
}
.scroll-content{
padding:0px !important;
}
.p_age{
font-size:14px;
}
.p_qual{
font-size: 13px;
width:auto;
}
.num{
font-size:12px;
font-weight: bold;
}
.icons{
position: relative;;
width:2px;
left:20%;
}
.applicant{
//
float:right;
//margin-left:90px;
position:relative;
left:50px;
z-index: 3;
}
.applicant_t{
margin:auto !important;
}
.item-md.item-block .item-inner{
border-bottom: 0px solid gray !important;
}
ion-toggle{
zoom:0.7;
width:10px;
height: 10px;
}
.app{
font-size: 10px;
float: right;
position: relative;
width:0px;
left:90px;
}
p{
font-weight: bold;
//font-size:28px;
//font-size:20px;
}
ion-input{
border-bottom:none;
box-shadow: none;
border:0.5px solid #673AB7;
}
.btn{
// margin:2px;
position:relative;
// top:-49px;
//margin:200px;
}
.checkbox{
width:10px;
height:auto;
float: right;
}
ion-select ion-label{
color:black;
}
mat-form-field{
width:100%;
}
.label-md {
margin: 0px !important;
}
.item-md.item-block .item-inner{
padding-right: 0px !important;
}
.rbi{
margin-bottom: 30px;
}
hr{
font-weight: bold;
}
.btn1{
padding:0px;
position: relative;
//margin-bottom: 55px;
// top:-50px;
// height:35px;
width:auto;
//margin-top:110px;
display:block;
}
}

View File

@ -0,0 +1,580 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, CardTitle } from 'ionic-angular';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
import { ToastProvider } from '../../../providers/common-provider/toast';
import { FormGroup, FormBuilder,FormArray,Validator, Validators } from '@angular/forms';
// import { PdQuestionGeneralOtherApplicantPage } from './pd-question-general-other-applicant/pd-question-general-other-applicant';
/**
* Generated class for the PdQuestionGeneralInfoPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@Component({
selector: 'page-pd-question-general-info',
templateUrl: 'pd-question-general-info.html',
})
export class PdQuestionGeneralInfoPage {
// person_name:any;
applicant_name: any;
otherapp: any;
fetch_related_details: any = [];
checkApplicantExist: any;
pd_applicants_details: any = [];
companyRelationShipList: any;
qualificationList:any;
businessEntityTypeList:any;
relationShipList: any;
users: any;
FormId: any;
pdDetails: any;
generalForm:FormGroup;
fulldata:any
public buttonClick:boolean;
public h_companies:boolean
datav:any;
individualsListBothCase:any;
companyList:any;
i:number;
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public modal:ModalController) {
this.pd_applicants_details = [];
this.pd_applicants_details.pop();
this.pdDetails = this.navParams.get('pdDetails');
this.FormId = this.navParams.get('FormId');
console.log(this.pdDetails);
this.users = this.aws.getlocale();
this.generalForm = this.fb.group({
pdid:this.pdDetails.pd_id,
formid:this.FormId.form_id,
applicant_list: this.fb.array([]),
applicant_relation: this.fb.array([]),
list_value:this.fb.array([]),
company_value:this.fb.array([]),
individuals:this.fb.array([]),
companies:this.fb.array([]),
person_with_relationships:this.fb.array([]),
company_with_relationships:this.fb.array([]),
general_remark:''
});
//this.initIndividuals();
this.pd_applicants_details = this.pdDetails.applicat_details;
// console.log(this.pd_applicants_details);
// console.log(this.pd_applicants_details);
this.getGeneralForm();
this.getdropdown();
// this.getcoapplicantDetails();
this.buttonClick=false;
this.h_companies=false;
// this.initCompanies()
this.datav=[{
name:"fairoj",
id:1
},
{
name:"ff",
id:2
}
]
//this.fulldata=this.generalForm.value
this.generalForm.controls['list_value'].valueChanges.subscribe(val=>{
let control=<FormArray>this.generalForm.controls['list_value'];
this.individualsListBothCase=control.value.filter(element=>element.is_applicant==true || element.is_person_met==true)
this.fulldata=control.value;
//control.controls.length
//control.push()
console.log("individualsListBothCase",this.individualsListBothCase);
});
this.generalForm.controls['company_value'].valueChanges.subscribe(val=>{
let control=<FormArray>this.generalForm.controls['company_value'];
this.companyList=control.value.filter(element=>element.company_name)
})
this.i=0;
}
initlistv(data) :void
{
console.log("gne data",data)
const control=<FormArray>this.generalForm.controls['list_value'];
for(let val of data)
{
let formData:FormGroup=this.fb.group({
applicant_name:[val.applicant_name],
//pd_co_applicant_id:[control.controls.length],
is_person_met:val.is_person_met,
is_applicant:val.is_applicant,
age:[val.age],
qualification:[val.qualification]
});
control.push(formData);
this.buttonClick=false;
// this.generalForm.value.individuals.value=""
}
}
initCompanyValue(data):void{
const control=<FormArray>this.generalForm.controls['company_value'];
for(let val of data)
{
let formData:FormGroup=this.fb.group({
company_name:[val.company_name],
// pd_co_applicant_id:[this.i+1],
is_company_applicant:[val.is_company_applicant],
business_entity_type:[val.business_entity_type],
business_entity_type_other:[val.business_entity_type_other]
});
control.push(formData);
this.h_companies=false;
}
}
ionViewDidLoad() {
this.pd_applicants_details.pop();
console.log('ionViewDidLoad PdQuestionGeneralInfoPage');
}
initIndividuals():void{
let formData : FormGroup=this.fb.group({
applicant_name:[''],
is_person_met:false,
is_applicant:false,
age:[''],
qualification:['']
});
const control=<FormArray>this.generalForm.controls['individuals'];
control.controls=[]
control.push(formData);
}
initCompanies():void{
let formData:FormGroup=this.fb.group({
company_name:[''],
is_company_applicant:false,
business_entity_type:[''],
business_entity_type_other:['']
});
const control=<FormArray>this.generalForm.controls['companies'];
control.controls=[]
control.push(formData)
}
initPersonRelationship(value):void{
if(value=='')
{
let formData:FormGroup=this.fb.group({
applicant_name:[''],
relationship:[''],
relation_to:[''],
});
const control=<FormArray>this.generalForm.controls['person_with_relationships'];
control.push(formData);
}
else{
for(let val of value)
{
let formData:FormGroup=this.fb.group({
applicant_name:[val.applicant_name],
relationship:[val.relationship],
relation_to:[val.relation_to],
});
const control=<FormArray>this.generalForm.controls['person_with_relationships'];
control.push(formData);
}
}
}
initCompanyRelationShip(value):void{
if(value=='')
{
let formData:FormGroup=this.fb.group({
applicant_name:[''],
company_relationship:[''],
relation_to_company:[''],
});
const control=<FormArray>this.generalForm.controls['company_with_relationships'];
control.push(formData);
}
else{
for(let val of value){
let formData:FormGroup=this.fb.group({
applicant_name:[val.applicant_name],
company_relationship:[val.company_relationship],
relation_to_company:[val.relation_to_company],
});
const control=<FormArray>this.generalForm.controls['company_with_relationships'];
control.push(formData);
}
}
}
add():void{
this.initIndividuals();
}
data:any;
cart=[];
datajson:any;
dataobj:any;
addRec(v){
console.log("v",v);
if(v=='1')
{
this.buttonClick=!this.buttonClick;
this.initIndividuals();
}
if(v=='2')
{
this.h_companies=!this.h_companies;
this.initCompanies();
}
}
delete(v,i):void{
// const control=<FormArray>this.generalForm.controls['individuals'];
//control.removeAt(i);
//this.data=this.generalForm.value.individuals;
/* console.log("Data First",this.data);
this.cart.push(this.generalForm.value.individuals);
this.data=Object.assign(this.cart);
console.log("Cart",this.cart);
// this.data=Object.assign(this.generalForm.value.individuals)
this.datajson=JSON.stringify(this.cart)
console.log("dataobj",this.dataobj)
console.log("data",this.data);
console.log("datajson",this.datajson)*/
if(v=='1')
{
this.initlistv(this.generalForm.value.individuals)
this.initPersonRelationship('');
}
if(v=='2')
{
this.initCompanyValue(this.generalForm.value.companies)
}
}
removeList(i,index){
if(index=='1')
{
//For List
const control=<FormArray>this.generalForm.controls['list_value'];
control.removeAt(i);
//For Person RelationShip auto Delete
const control1=<FormArray>this.generalForm.controls['person_with_relationships'];
control1.removeAt(i);
}
if(index==2){
const control=<FormArray>this.generalForm.controls['company_value'];
control.removeAt(i);
}
if(index=="companyrel")
{
const control=<FormArray>this.generalForm.controls['company_with_relationships'];
control.removeAt(i);
}
}
getdropdown()
{
this.qustCat.getcommondrop('RELATIONSHIPS').subscribe(res=>
{
if(res['dataStatus']==true)
{
this.relationShipList = res['records'].filter(rel=>rel.isactive==1);
}
});
this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe(res=>
{
if(res['dataStatus']==true)
{
this.companyRelationShipList = res['records'].filter(com=>com.isactive==1);
}
});
this.qustCat.getcommondrop('EDUQUALIFICATION').subscribe(res=>{
if(res['dataStatus']==true)
{
this.qualificationList=res['records'].filter(com=>com.isactive==1);
console.log("qualificationList",this.qualificationList)
}
});
this.qustCat.getcommondrop('BUSINESSENTITYTYPE').subscribe(res=>{
this.businessEntityTypeList=res['records'].filter(com=>com.isactive==1);
})
}
getcoapplicantDetails(checkApplicantExist,exist_applicant_relation)
{
let applicantControl = <FormArray>this.generalForm.controls['applicant_list'];
let relationControl = <FormArray>this.generalForm.controls['applicant_relation'];
if(checkApplicantExist.length > 0)
{
checkApplicantExist.forEach(val => {
applicantControl.push(this.createApplicant(val));
});
}
if(exist_applicant_relation.length > 0){
exist_applicant_relation.forEach(val => {
console.log(val);
relationControl.push(this.createApplicantRelation(val));
//push related to details
this.fetch_related_details.push(val.applicant_name);
});
}
}
createApplicant(elementValue:any){
return this.fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name],
company_name: [elementValue.company_name],
exist_status:[elementValue.exist_status==1 && elementValue.pd_co_applicant_id > 0 ? true : false],
});
}
coapplicantChange(event,index,item)
{
let relationControl = <FormArray>this.generalForm.controls['applicant_relation'];
let applicantControl = <FormArray>this.generalForm.controls['applicant_list'];
if(item.exist_status.value)
{
if(item.pd_co_applicant_id.value==0){
// let modal = this.modal.create(PdQuestionGeneralOtherApplicantPage);
// modal.onDidDismiss(data => {
// if(data!=1){
// data.otherName.forEach(val=>
// {
// let applicant_details: any= {'pd_co_applicant_id':val.pd_co_applicant_id,'applicant_name':val.applicant_name,'applicant_relation_to':'','relation':'','company_name':'','company_relation':''};
// relationControl.push(this.createApplicantRelation(applicant_details));
// // push related to details
// this.fetch_related_details.push(val.applicant_name);
// });
// }else
// {
// applicantControl.at(index).get('exist_status').setValue(false);
// }
// });
// modal.present();
}else
{
let applicant_details: any= {'pd_co_applicant_id':item.pd_co_applicant_id.value,'applicant_name':item.applicant_name.value,'applicant_relation_to':'','relation':'','company_name':item.company_name.value,'company_relation':''};
relationControl.push(this.createApplicantRelation(applicant_details));
// push related to details
this.fetch_related_details.push(item.applicant_name.value);
}
}
else
{
let relationControl = <FormArray>this.generalForm.controls['applicant_relation'];
let pos_id = relationControl.value.map(e=>
e.pd_co_applicant_id).indexOf(item.pd_co_applicant_id.value);
console.log(pos_id,item.pd_co_applicant_id.value);
if(item.pd_co_applicant_id.value !=0){
relationControl.removeAt(pos_id);
let pos_name=this.fetch_related_details.indexOf(item.applicant_name.value);
this.fetch_related_details.splice(pos_name, 1);
}else
{
applicantControl.at(index).get('exist_status').setValue(false);
}
// remove related to details
}
}
createApplicantRelation(elementValue: any) {
console.log('function in 156');
return this.fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name],
company_name: [elementValue.company_name,elementValue.company_name ? Validators.required : Validators.nullValidator],
company_relationship: [elementValue.company_relationship],
applicant_relation_to: [elementValue.applicant_relation_to, Validators.required],
relationship: [elementValue.relationship],
});
}
// temparr=[];
removereferance(index)
{
let relationControl = <FormArray>this.generalForm.controls['applicant_relation'];
relationControl.removeAt(index);
// this.temparr = [];
}
// createApplicateOthers()
// {
// return this.fb.group(
// {
// Name:
// })
// }
submitData(answerData)
{
console.log("Answer",answerData);
let saveRecords:any={}
saveRecords.pdid=answerData.pdid;
saveRecords.formid=answerData.formid;
saveRecords.fk_createdby=this.users;
saveRecords.individuals=answerData.list_value;
saveRecords.companies=answerData.company_value;
saveRecords.person_with_relationships=answerData.person_with_relationships;
saveRecords.company_with_relationships=answerData.company_with_relationships
saveRecords.general_remark=answerData.general_remark;
console.log("save Records",saveRecords);
this.qustCat.saveForm(saveRecords).subscribe(dataResult=>{
if(dataResult['dataStatus']==true){
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
}
else{
this.toast.pdTriggerappmessage('Error');
//console.log("Error",)
}
})
/* Old Data
console.log("Answer Data",answerData);
if(this.generalForm.valid)
{
let saveRecords:any = {}
let applicantList:any=[];
let applicantRelationList:any=[];
// this for applicant list for selected
answerData.applicant_list.forEach((element,key) => {
if(element.exist_status==1){
applicantList.push({
"pd_co_applicant_id":element.pd_co_applicant_id,
"applicant_name":element.applicant_name,
})
}
});
// this is for selected applicant relation
answerData.applicant_relation.forEach((element,key) => {
applicantRelationList.push({
"pd_co_applicant_id":element.pd_co_applicant_id,
"applicant_name":element.applicant_name,
"company_name":element.company_name,
"company_relationship":element.company_relationship,
"applicant_relation_to":element.applicant_relation_to,
"relationship":element.relationship,
})
});
saveRecords.pdid=answerData.pdid;
saveRecords.formid=answerData.formid;
saveRecords.general_remark=answerData.general_remark;
saveRecords.selected_applicant=applicantList;
saveRecords.applicant_relation=applicantRelationList;
saveRecords.fk_createdby = this.users;
console.log(saveRecords);
this.qustCat.saveForm(saveRecords).subscribe(res=>
{
if(res['dataStatus']==true)
{
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
this.navCtrl.pop();
}
})
}*/
}
getGeneralForm()
{
let records={'pd_id':this.pdDetails.pd_id,'pd_form_id':this.FormId.form_id};
this.qustCat.retiverForm(records).subscribe(res=>{
if(res['dataStatus']==true)
{
console.log("Getting DAta",res);
this.generalForm.controls['general_remark'].setValue(res['records'].general_remark);
this.initlistv(res['records'].individuals)
this.initCompanyValue(res['records'].companies);
this.initPersonRelationship(res['records'].person_with_relationships);
if(res['records'].company_with_relationships != ''){
this.initCompanyRelationShip(res['records'].company_with_relationships);
}
}
})
/*let records = {'pd_id':this.pdDetails.pd_id,'pd_form_id':this.FormId.form_id};
console.log('function in');
this.qustCat.retiverForm(records).subscribe(res=>
{
if(res['dataStatus']==true)
{
this.pd_applicants_details.push({'pd_co_applicant_id':"0",'applicant_name':'Others'});
let generalDetails = res['records'];
this.generalForm.controls['general_remark'].setValue(generalDetails.general_remark);
let applicant_relation = Object.keys(res['records'].applicant_relation).map(function(key)
{
console.log(key);
return res['records'].applicant_relation[key];
});
let selected_applicant = Object.keys(res['records'].selected_applicant).map(function(key)
{
return res['records'].selected_applicant[key].pd_co_applicant_id;
});
let applicantControl = <FormArray>this.generalForm.controls['applicant_list'];
let actual_applicant = this.pd_applicants_details.map(item => item.pd_co_applicant_id);
let checkApplicantExist =actual_applicant.map((id, index) => {
if (selected_applicant.indexOf(id) < 0) {
this.pd_applicants_details[index].exist_status=0;
return this.pd_applicants_details[index];
}
else{
this.pd_applicants_details[index].exist_status=1;
this.pd_applicants_details[index].applicant_relation_to='';
this.pd_applicants_details[index].relation='';
return this.pd_applicants_details[index];
}
}).filter(item => item != undefined);
this.getcoapplicantDetails(checkApplicantExist,applicant_relation);
}else
{
this.pd_applicants_details.push({'pd_co_applicant_id':"0",'applicant_name':'Others'});
}
})*/
}
}

0
www/assets/fonts/ionicons.eot Normal file → Executable file
View File

0
www/assets/fonts/ionicons.scss Normal file → Executable file
View File

0
www/assets/fonts/ionicons.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 391 KiB

After

Width:  |  Height:  |  Size: 391 KiB

0
www/assets/fonts/ionicons.ttf Normal file → Executable file
View File

0
www/assets/fonts/noto-sans-bold.ttf Normal file → Executable file
View File

0
www/assets/fonts/noto-sans-bold.woff Normal file → Executable file
View File

0
www/assets/fonts/noto-sans-regular.ttf Normal file → Executable file
View File

0
www/assets/fonts/noto-sans-regular.woff Normal file → Executable file
View File

0
www/assets/fonts/noto-sans.scss Normal file → Executable file
View File

0
www/assets/fonts/roboto-bold.ttf Normal file → Executable file
View File

0
www/assets/fonts/roboto-bold.woff Normal file → Executable file
View File

0
www/assets/fonts/roboto-bold.woff2 Normal file → Executable file
View File

0
www/assets/fonts/roboto-light.ttf Normal file → Executable file
View File

0
www/assets/fonts/roboto-light.woff Normal file → Executable file
View File

0
www/assets/fonts/roboto-light.woff2 Normal file → Executable file
View File

0
www/assets/fonts/roboto-medium.ttf Normal file → Executable file
View File

0
www/assets/fonts/roboto-medium.woff Normal file → Executable file
View File

0
www/assets/fonts/roboto-medium.woff2 Normal file → Executable file
View File

0
www/assets/fonts/roboto-regular.ttf Normal file → Executable file
View File

0
www/assets/fonts/roboto-regular.woff Normal file → Executable file
View File

0
www/assets/fonts/roboto-regular.woff2 Normal file → Executable file
View File

0
www/assets/fonts/roboto.scss Normal file → Executable file
View File

View File

@ -29117,3 +29117,138 @@ page-pd-question-assessed-info ion-scroll.scroll-y .scroll-content {
page-pd-question-assessed-info span {
font-size: 12px;
}
page-pd-question-general-info div {
margin: 0;
padding: 0;
}
page-pd-question-general-info .lis {
height: auto;
width: auto;
}
page-pd-question-general-info ion-item {
height: auto;
}
page-pd-question-general-info .check {
font-size: 16px;
}
page-pd-question-general-info .det_p {
position: relative;
width: auto;
right: 43%;
}
page-pd-question-general-info .p_name {
font-weight: bold;
font-size: 16px;
width: auto;
}
page-pd-question-general-info .scroll-content {
padding: 0px !important;
}
page-pd-question-general-info .p_age {
font-size: 14px;
}
page-pd-question-general-info .p_qual {
font-size: 13px;
width: auto;
}
page-pd-question-general-info .num {
font-size: 12px;
font-weight: bold;
}
page-pd-question-general-info .icons {
position: relative;
width: 2px;
left: 20%;
}
page-pd-question-general-info .applicant {
float: right;
position: relative;
left: 50px;
z-index: 3;
}
page-pd-question-general-info .applicant_t {
margin: auto !important;
}
page-pd-question-general-info .item-md.item-block .item-inner {
border-bottom: 0px solid gray !important;
}
page-pd-question-general-info ion-toggle {
zoom: 0.7;
width: 10px;
height: 10px;
}
page-pd-question-general-info .app {
font-size: 10px;
float: right;
position: relative;
width: 0px;
left: 90px;
}
page-pd-question-general-info p {
font-weight: bold;
}
page-pd-question-general-info ion-input {
border-bottom: none;
-webkit-box-shadow: none;
box-shadow: none;
border: 0.5px solid #673AB7;
}
page-pd-question-general-info .btn {
position: relative;
}
page-pd-question-general-info .checkbox {
width: 10px;
height: auto;
float: right;
}
page-pd-question-general-info ion-select ion-label {
color: black;
}
page-pd-question-general-info mat-form-field {
width: 100%;
}
page-pd-question-general-info .label-md {
margin: 0px !important;
}
page-pd-question-general-info .item-md.item-block .item-inner {
padding-right: 0px !important;
}
page-pd-question-general-info .rbi {
margin-bottom: 30px;
}
page-pd-question-general-info hr {
font-weight: bold;
}
page-pd-question-general-info .btn1 {
padding: 0px;
position: relative;
width: auto;
display: block;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long