This commit is contained in:
dineshkumarkannan 2018-11-08 21:02:15 +05:30
commit be208de246
20 changed files with 311 additions and 299 deletions

View File

@ -64,7 +64,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
} }
let users= { let users= {
'userid':this.currentUser.userid, 'userid':this.currentUser.userid,
'entityid':this.currentUser.fk_entity_id, 'entityid':this.currentUser.fk_entity_type_id,
'profilepic':this.currentUser.profilepic 'profilepic':this.currentUser.profilepic
} }
this.users.getprofilepic(users).subscribe(res=>{ this.users.getprofilepic(users).subscribe(res=>{

View File

@ -29,6 +29,10 @@
<mat-option value="Others">Others (Please specify)</mat-option> <mat-option value="Others">Others (Please specify)</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'">
<input matInput placeholder="Specify Locality"
formControlName="locality_others">
</mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Approach to PD location" formControlName="pd_location"> <mat-select placeholder="Approach to PD location" formControlName="pd_location">
<mat-option value="{{data.pd_location_approach_id}}" <mat-option value="{{data.pd_location_approach_id}}"
@ -99,4 +103,5 @@
</mat-card> </mat-card>
<button mat-raised-button type="submit" class="button" (click)="onSubmit()">Submit <button mat-raised-button type="submit" class="button" (click)="onSubmit()">Submit
</button> </button>
</form> </form>
<notifier-container></notifier-container>

View File

@ -28,6 +28,8 @@ import {ActivatedRoute, Router} from "@angular/router";
styleUrls: ['./address.component.scss'] styleUrls: ['./address.component.scss']
}) })
export class AddressComponent implements OnInit { export class AddressComponent implements OnInit {
@Input() pdid: number;
locationdata: any = []; locationdata: any = [];
commentData: any = []; commentData: any = [];
customerData: any = []; customerData: any = [];
@ -46,6 +48,7 @@ export class AddressComponent implements OnInit {
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService) { private _pd: PdTrigerService) {
this.notifier = notifier;
} }
ngOnInit() { ngOnInit() {
@ -58,25 +61,32 @@ export class AddressComponent implements OnInit {
params.pd_form_id = '250'; params.pd_form_id = '250';
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
console.log('data', data); console.log('data', data);
var result = Object.keys(data.records.neighbourhood).map(function(key) {
return data.records.neighbourhood[key];
});
this.addressForm.controls.address.setValue(data.records.address);
this.addressForm.controls.pd_location.setValue(data.records.pd_location);
this.addressForm.controls.address_type.setValue(data.records.address_type);
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
this.addressForm.controls.locality.setValue(data.records.locality);
const control = <FormArray>this.addressForm.controls['neighbourhood']; const control = <FormArray>this.addressForm.controls['neighbourhood'];
if(result.length == 0) { if(data.status == 200) {
control.push(this.createNeighbour()); var result = Object.keys(data.records.neighbourhood).map(function (key) {
} else { return data.records.neighbourhood[key];
result.forEach(datas => { });
control.push(this.createNeighbour()); this.addressForm.controls.address.setValue(data.records.address);
}); this.addressForm.controls.pd_location.setValue(data.records.pd_location);
this.addressForm.controls.neighbourhood.setValue(result); this.addressForm.controls.address_type.setValue(data.records.address_type);
} this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
console.log('result', result); this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
this.addressForm.controls.locality.setValue(data.records.locality);
if (data.records.locality_others) {
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
}
if (result.length == 0) {
control.push(this.createNeighbour());
} else {
result.forEach(datas => {
control.push(this.createNeighbour());
});
this.addressForm.controls.neighbourhood.setValue(result);
}
console.log('result', result);
} else {
control.push(this.createNeighbour());
}
}); });
} }
public initAddressForm(): void { public initAddressForm(): void {
@ -84,6 +94,7 @@ export class AddressComponent implements OnInit {
address: ['', Validators.compose([Validators.required])], address: ['', Validators.compose([Validators.required])],
address_type: ['', Validators.compose([Validators.required])], address_type: ['', Validators.compose([Validators.required])],
locality: ['', Validators.compose([Validators.required])], locality: ['', Validators.compose([Validators.required])],
locality_others: [''],
pd_location: ['', Validators.compose([Validators.required])], pd_location: ['', Validators.compose([Validators.required])],
comment_locality: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])],
customer_behaviour: ['', Validators.compose([Validators.required])], customer_behaviour: ['', Validators.compose([Validators.required])],
@ -157,10 +168,13 @@ export class AddressComponent implements OnInit {
records.address = this.address.value; records.address = this.address.value;
records.address_type = this.addressType.value; records.address_type = this.addressType.value;
records.locality = this.locality.value; records.locality = this.locality.value;
if (this.locality.value == 'Others') {
records.locality_others = this.addressForm.controls.locality_others.value;
}
records.pd_location = this.pdLocation.value; records.pd_location = this.pdLocation.value;
records.comment_locality = this.commentlocality.value; records.comment_locality = this.commentlocality.value;
records.customer_behaviour = this.commentlocality.value; records.customer_behaviour = this.commentlocality.value;
records.neighbourhood = this.addressForm.value.items; records.neighbourhood = this.addressForm.controls.neighbourhood.value;
records.pdid = '250'; records.pdid = '250';
records.formid = '250'; records.formid = '250';
records.fk_createdby = '250'; records.fk_createdby = '250';
@ -169,7 +183,9 @@ export class AddressComponent implements OnInit {
console.log('data', data); console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}); }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => { Object.keys(formGroup.controls).forEach(field => {

View File

@ -62,4 +62,5 @@
</div> </div>
<button mat-raised-button class="button" (click)="bankSubmit()">Submit <button mat-raised-button class="button" (click)="bankSubmit()">Submit
</button> </button>
</form> </form>
<notifier-container></notifier-container>

View File

@ -28,6 +28,7 @@ import {ActivatedRoute, Router} from "@angular/router";
styleUrls: ['./banking-details.component.scss'] styleUrls: ['./banking-details.component.scss']
}) })
export class BankingDetailsComponent implements OnInit { export class BankingDetailsComponent implements OnInit {
@Input() pdid: number;
public bankingForm: FormGroup; public bankingForm: FormGroup;
step: any; step: any;
private notifier: NotifierService; private notifier: NotifierService;
@ -35,6 +36,7 @@ export class BankingDetailsComponent implements OnInit {
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService) { private _pd: PdTrigerService) {
this.notifier = notifier;
} }
ngOnInit() { ngOnInit() {
@ -45,18 +47,22 @@ export class BankingDetailsComponent implements OnInit {
params.pd_form_id = '252'; params.pd_form_id = '252';
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
console.log('data', data); console.log('data', data);
var result = Object.keys(data.records.banking_details).map(function(key) {
return data.records.banking_details[key];
});
const control = <FormArray>this.bankingForm.controls['itemRows']; const control = <FormArray>this.bankingForm.controls['itemRows'];
if(result.length == 0) { if( data.status == 200) {
control.push(this.createBankarray()); var result = Object.keys(data.records.banking_details).map(function (key) {
} else { return data.records.banking_details[key];
result.forEach(datas => { });
control.push(this.createBankarray()); if (result.length == 0) {
}); control.push(this.createBankarray());
this.bankingForm.controls.itemRows.setValue(result); } else {
} result.forEach(datas => {
control.push(this.createBankarray());
});
this.bankingForm.controls.itemRows.setValue(result);
}
} else {
control.push(this.createBankarray());
}
}); });
} }
public initBankingForm(): void { public initBankingForm(): void {
@ -99,7 +105,9 @@ export class BankingDetailsComponent implements OnInit {
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}) }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => { Object.keys(formGroup.controls).forEach(field => {

View File

@ -1,3 +1,4 @@
<p>Current Loan Details</p>
<form [formGroup]="currentLoanForm" class="address"> <form [formGroup]="currentLoanForm" class="address">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Do you have any other existing Loan" <mat-select placeholder="Do you have any other existing Loan"

View File

@ -12,6 +12,7 @@
} }
.address .button { .address .button {
float: right; float: right;
height: 10px;
width: 10px; width: 10px;
background: #62B013; background: #62B013;
color: white; color: white;

View File

@ -30,19 +30,45 @@ import {ActivatedRoute, Router} from "@angular/router";
export class CurrentLoanComponent implements OnInit { export class CurrentLoanComponent implements OnInit {
public currentLoanForm: FormGroup; public currentLoanForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
@Input() pdid: number;
@Input() form_id: number;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService) { private _pd: PdTrigerService) {
this.notifier = notifier;
} }
ngOnInit() { ngOnInit() {
this.initCurrentloanForm(); this.initCurrentloanForm();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => {
console.log('value', value);
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
if (value.status == 200) {
var result = Object.keys(value.records.loan_details).map(function(key) {
return value.records.loan_details[key];
});
this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan);
if (result.length > 0) {
result.forEach(val => {
control.push(this.createLoanDetail());
});
this.currentLoanForm.controls['loan_details'].setValue(result);
} else {
control.push(this.createLoanDetail());
}
} else {
control.push(this.createLoanDetail());
}
})
} }
public initCurrentloanForm(): void { public initCurrentloanForm(): void {
this.currentLoanForm = this.fb.group({ this.currentLoanForm = this.fb.group({
existing_loan: ['', Validators.compose([Validators.required])], existing_loan: ['', Validators.compose([Validators.required])],
loan_details: this.fb.array([this.createLoanDetail()]) loan_details: this.fb.array([])
}); });
} }
createLoanDetail() { createLoanDetail() {
@ -69,15 +95,17 @@ export class CurrentLoanComponent implements OnInit {
return; return;
} }
let records: any = {}; let records: any = {};
records.pdid = '253'; records.pdid = this.pdid;
records.formid = '253'; records.formid = this.form_id;
records.fk_createdby = '253'; records.fk_createdby = this.pdid;
records.existing_loan = this.currentLoanForm.controls['existing_loan'].value; records.existing_loan = this.currentLoanForm.controls['existing_loan'].value;
records.loan_details = this.currentLoanForm.controls['loan_details'].value; records.loan_details = this.currentLoanForm.controls['loan_details'].value;
console.log('data', records); console.log('data', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}) })
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: FormGroup) {

View File

@ -24,9 +24,9 @@
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Relation" formControlName="relation"> <mat-select placeholder="Relation" formControlName="relation">
<mat-option value="{{relation.relationship_id}}" <mat-option value="{{relations.relationship_id}}"
*ngFor="let relation of relationData"> *ngFor="let relations of relationData">
{{relation.name}} {{relations.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -131,4 +131,5 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<button mat-raised-button class="button" (click)="submitFamily()">Submit</button> <button mat-raised-button class="button" (click)="submitFamily()">Submit</button>
</form> </form>
<notifier-container></notifier-container>

View File

@ -28,6 +28,8 @@ import {ActivatedRoute, Router} from "@angular/router";
styleUrls: ['./family-details.component.scss'] styleUrls: ['./family-details.component.scss']
}) })
export class FamilyDetailsComponent implements OnInit { export class FamilyDetailsComponent implements OnInit {
@Input() pdid: number;
public currentLoanForm: FormGroup; public currentLoanForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
public familyForm: FormGroup; public familyForm: FormGroup;
@ -40,13 +42,21 @@ export class FamilyDetailsComponent implements OnInit {
public ownership: AbstractControl; public ownership: AbstractControl;
public ownershipOther: AbstractControl; public ownershipOther: AbstractControl;
public rent: AbstractControl; public rent: AbstractControl;
filteredStates: any = [
'Co-Applicant 1 to x',
'Accountant',
'Manager',
'Relative of the applicant',
'Friend of the Applicant',
'DSA',
'Other'
];
relationData: any = []; relationData: any = [];
occupationData: any = []; occupationData: any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService) { private _pd: PdTrigerService) {
this.notifier = notifier;
} }
ngOnInit() { ngOnInit() {
this.getRelation(); this.getRelation();
@ -54,41 +64,50 @@ export class FamilyDetailsComponent implements OnInit {
this.initFamilyForm(); this.initFamilyForm();
let params: any = {}; let params: any = {};
params.pd_id = '251'; params.pd_id = '251';
params.pd_form_id = '251'; params.pd_form_id = '555';
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
console.log('data', data); console.log('data', data);
var result = Object.keys(data.records.non_earning_members).map(function(key) {
return data.records.non_earning_members[key];
});
var earning = Object.keys(data.records.earning_members).map(function(key) {
return data.records.earning_members[key];
});
this.familyForm.controls.person.setValue(data.records.person_met);
this.familyForm.controls.members.setValue(data.records.family_members);
this.familyForm.controls.years.setValue(data.records.no_of_years);
this.familyForm.controls.ownership.setValue(data.records.ownership);
this.familyForm.controls.rent.setValue(data.records.what_rent);
const control = <FormArray>this.familyForm.controls['nonEarningMembers']; const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
if (result.length == 0) {
control.push(this.createNonMembers());
} else {
result.forEach(datas => {
control.push(this.createNonMembers());
});
this.familyForm.controls.nonEarningMembers.setValue(result);
}
const value = <FormArray>this.familyForm.controls['earningMembers']; const value = <FormArray>this.familyForm.controls['earningMembers'];
if(earning.length == 0) { if (data.status == 200) {
value.push(this.createMembers()); var result = Object.keys(data.records.non_earning_members).map(function (key) {
} else { return data.records.non_earning_members[key];
earning.forEach(datas => {
value.push(this.createMembers());
}); });
this.familyForm.controls.earningMembers.setValue(earning); var earning = Object.keys(data.records.earning_members).map(function (key) {
return data.records.earning_members[key];
});
this.familyForm.controls.person.setValue(data.records.person_met);
if (data.records.person_met_other) {
this.familyForm.controls.personOther.setValue(data.records.person_met_other);
}
this.familyForm.controls.members.setValue(data.records.family_members);
this.familyForm.controls.years.setValue(data.records.no_of_years);
this.familyForm.controls.ownership.setValue(data.records.ownership);
if (data.records.ownership_others) {
this.familyForm.controls.ownershipOther.setValue(data.records.ownership_others);
}
this.familyForm.controls.rent.setValue(data.records.what_rent);
if (result.length == 0) {
control.push(this.createNonMembers());
} else {
result.forEach(datas => {
control.push(this.createNonMembers());
});
this.familyForm.controls.nonEarningMembers.setValue(result);
}
if (earning.length == 0) {
value.push(this.createMembers());
} else {
earning.forEach(datas => {
value.push(this.createMembers());
});
this.familyForm.controls.earningMembers.setValue(earning);
}
this.familyForm.controls.residence.setValue(data.records.residence);
} else {
value.push(this.createMembers());
control.push(this.createNonMembers());
} }
this.familyForm.controls.residence.setValue(data.records.residence);
}); });
} }
public initFamilyForm(): void { public initFamilyForm(): void {
@ -178,30 +197,30 @@ export class FamilyDetailsComponent implements OnInit {
let records: any = {}; let records: any = {};
records.no_of_years = this.years.value; records.no_of_years = this.years.value;
if (this.ownership.value == 'Others') { if (this.ownership.value == 'Others') {
records.ownership = this.ownershipOther.value; records.ownership_others = this.ownershipOther.value;
} else {
records.ownership = this.ownership.value;
} }
records.ownership = this.ownership.value;
records.residence = this.residence.value; records.residence = this.residence.value;
if (this.ownership.value == 'Rented') { if (this.ownership.value == 'Rented') {
records.what_rent = this.rent.value; records.what_rent = this.rent.value;
} }
if (this.person.value == 'Other') { if (this.person.value == 'Other') {
records.person_met = this.personOther.value; records.person_met_other = this.personOther.value;
} else {
records.person_met = this.person.value;
} }
records.person_met = this.person.value;
records.family_members = this.members.value; records.family_members = this.members.value;
records.earning_members = this.familyForm.controls['earningMembers'].value; records.earning_members = this.familyForm.controls['earningMembers'].value;
records.non_earning_members = this.familyForm.controls['nonEarningMembers'].value; records.non_earning_members = this.familyForm.controls['nonEarningMembers'].value;
records.pdid = '251'; records.pdid = '251';
records.formid = '251'; records.formid = '555';
records.fk_createdby = '251'; records.fk_createdby = '251';
console.log('params', records); console.log('params', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}) }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => { Object.keys(formGroup.controls).forEach(field => {

View File

@ -6,7 +6,7 @@
<mat-option value="No">No</mat-option> <mat-option value="No">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'"> <mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">
<mat-card-header> <mat-card-header>
<p>Loan Details<p> <p>Loan Details<p>
</mat-card-header> </mat-card-header>
@ -27,7 +27,9 @@
<input matInput placeholder="Amount" formControlName="amount"> <input matInput placeholder="Amount" formControlName="amount">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Frequency" formControlName="frequency"> <mat-select placeholder="Frequency" formControlName="frequency">
<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field> </mat-form-field>
<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()" <button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"
*ngIf="i==0"> *ngIf="i==0">
@ -41,5 +43,5 @@
</div> </div>
</div> </div>
</mat-card> </mat-card>
<button type="submit" (click)="submitCurrentDetails()"></button> <button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()"></button>
</form> </form>

View File

@ -13,6 +13,7 @@
.address .button { .address .button {
float: right; float: right;
width: 10px; width: 10px;
height: 10px;
background: #62B013; background: #62B013;
color: white; color: white;
} }

View File

@ -28,23 +28,48 @@ import {ActivatedRoute, Router} from '@angular/router';
styleUrls: ['./other-income.component.scss'] styleUrls: ['./other-income.component.scss']
}) })
export class OtherIncomeComponent implements OnInit { export class OtherIncomeComponent implements OnInit {
@Input() pdid: number;
@Input() form_id: number;
public otherIncomeForm: FormGroup; public otherIncomeForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
frequencyData: any; frequencyData: any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService) { private _pd: PdTrigerService) {
this.notifier = notifier;
} }
ngOnInit() { ngOnInit() {
this.initOtherincomeForm();
this.getFrequency(); this.getFrequency();
this.initOtherincomeForm();
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => {
console.log('value', value);
const control = <FormArray>this.otherIncomeForm.controls['income_details'];
if (value.status == 200) {
var result = Object.keys(value.records.income_details).map(function(key) {
return value.records.income_details[key];
});
this.otherIncomeForm.controls['other_income'].setValue(value.records.other_income);
if (result.length > 0) {
result.forEach(val => {
control.push(this.createDetail());
});
this.otherIncomeForm.controls['income_details'].setValue(result);
} else {
control.push(this.createDetail());
}
} else {
control.push(this.createDetail());
}
})
} }
public initOtherincomeForm(): void { public initOtherincomeForm(): void {
this.otherIncomeForm = this.fb.group({ this.otherIncomeForm = this.fb.group({
other_income: ['', Validators.compose([Validators.required])], other_income: ['', Validators.compose([Validators.required])],
income_details: this.fb.array([this.createDetail()]) income_details: this.fb.array([])
}); });
} }
createDetail() { createDetail() {
@ -79,15 +104,17 @@ export class OtherIncomeComponent implements OnInit {
return; return;
} }
let records: any = {}; let records: any = {};
records.pdid = '254'; records.pdid = this.pdid;
records.formid = '254'; records.formid = this.form_id;
records.fk_createdby = '254'; records.fk_createdby = this.pdid;
records.other_income = this.otherIncomeForm.controls['other_income'].value; records.other_income = this.otherIncomeForm.controls['other_income'].value;
records.income_details = this.otherIncomeForm.controls['income_details'].value; records.income_details = this.otherIncomeForm.controls['income_details'].value;
console.log('data', records); console.log('data', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}) })
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: FormGroup) {

View File

@ -394,21 +394,21 @@
<app-assets-info [pdid]="startPD"></app-assets-info> <app-assets-info [pdid]="startPD"></app-assets-info>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="5"> <ng-container *ngSwitchCase="5">
<app-address></app-address> <app-address [pdid]="startPD"></app-address>
<!-- end personal type questions --> <!-- end personal type questions -->
</ng-container> </ng-container>
<ng-container *ngSwitchCase="6"> <ng-container *ngSwitchCase="6">
<app-family-details></app-family-details> <app-family-details [pdid]="startPD"></app-family-details>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="7"> <ng-container *ngSwitchCase="7">
<!--<p>Banking details</p>--> <!--<p>Banking details</p>-->
<app-banking-details></app-banking-details> <app-banking-details [pdid]="startPD" ></app-banking-details>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="8"> <ng-container *ngSwitchCase="8">
<app-current-loan></app-current-loan> <app-current-loan [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-current-loan>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="9"> <ng-container *ngSwitchCase="9">
<app-other-income></app-other-income> <app-other-income [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-other-income>
</ng-container> </ng-container>
<!-- end personal type questions <!-- end personal type questions
--> -->

View File

@ -28,15 +28,6 @@ export class StartPdComponent implements OnInit, OnDestroy {
getQuestionsLength: number; getQuestionsLength: number;
answerList: any = []; answerList: any = [];
ansPDList: any = []; ansPDList: any = [];
filteredStates: any = [
'Co-Applicant 1 to x',
'Accountant',
'Manager',
'Relative of the applicant',
'Friend of the Applicant',
'DSA',
'Other'
];
relationDetails: any = [1]; relationDetails: any = [1];
// errorMessage:any; // errorMessage:any;
// selectedCategory:any=[]; // selectedCategory:any=[];

View File

@ -193,13 +193,13 @@
<div> <div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center"> <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<div fxFlex="30%"> <div fxFlex="30%">
<mat-form-field class="ml-xs"> <mat-form-field class="ml-xs" style="width:100%">
<input matInput placeholder="Entity Full Name" formControlName="full_name"> <input matInput placeholder="Entity Full Name" formControlName="full_name">
<mat-error *ngIf="submitted && f.full_name.hasError('required')" class="mat-text-warn">You must Include Entity Full Name.</mat-error> <mat-error *ngIf="submitted && f.full_name.hasError('required')" class="mat-text-warn">You must Include Entity Full Name.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="30%"> <div fxFlex="30%">
<mat-form-field class="ml-xs"> <mat-form-field class="ml-xs" style="width:100%">
<input matInput placeholder="Entity Short Name" formControlName="short_name"> <input matInput placeholder="Entity Short Name" formControlName="short_name">
<mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Entity Short Name.</mat-error> <mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Entity Short Name.</mat-error>
</mat-form-field> </mat-form-field>

View File

@ -96,71 +96,66 @@
<mat-card-title>Role</mat-card-title><hr/> <mat-card-title>Role</mat-card-title><hr/>
<mat-card-content> <mat-card-content>
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2"> <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
<mat-select matInput placeholder="Enitity Type" (selectionChange)="checktype($event.value)" [formControl]="regForm.controls['type']"
required>
<mat-option>--</mat-option>
<mat-option *ngFor="let types of types" [value]="types">
{{types.name}}
</mat-option>
</mat-select>
<mat-error *ngIf="regForm.controls['type'].hasError('required') && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
<mat-error *ngIf="regForm.controls['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '2'">
<mat-select matInput placeholder="Lender Name" [formControl]="regForm.controls['lenVenName']" required>
<mat-option>--</mat-option>
<mat-option *ngFor="let ent of entities" [value]="ent">
{{ent.full_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Lender Name Required.</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '3'">
<mat-select matInput placeholder="Vendor Name" [formControl]="regForm.controls['lenVenName']" required>
<mat-option>--</mat-option>
<mat-option *ngFor="let ent of entities" [value]="ent">
{{ent.full_name}}
</mat-option>
</mat-select><mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Vendor Name Required.</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" > <mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
<mat-select matInput placeholder="Enitity Type" (selectionChange)="checktype($event.value)" [formControl]="regForm.controls['type']" <mat-select matInput placeholder="Role" (selectionChange)="toggleAllSelection($event,regForm.controls['type'].value)" [formControl]="regForm.controls['role']" required>
required> <mat-option *ngFor="let role of roles" [value]="role" >
<mat-option>--</mat-option> {{role.role_name}}
<mat-option *ngFor="let types of types" [value]="types"> </mat-option>
{{types.name}} </mat-select>
</mat-option>
</mat-select> <div *ngIf="roleload"><mat-progress-bar mode="indeterminate" color="defalut"></mat-progress-bar></div>
<mat-error *ngIf="regForm.controls['type'].hasError('required') && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error> <mat-error *ngIf="regForm.controls['role'].hasError('required') && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
<mat-error *ngIf="regForm.controls['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error> <mat-error *ngIf="regForm.controls['role'].errors?.phone && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
</mat-form-field>
</mat-form-field> <mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="roleAccess">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '2'"> <mat-select matInput placeholder="PD Team" [formControl]="regForm.controls['pdteam']" required >
<mat-select matInput placeholder="Lender Name" [formControl]="regForm.controls['lenVenName']" required> <mat-option>--</mat-option>
<mat-option>--</mat-option> <mat-option *ngFor="let pd of pdTeam" [value]="pd" >
<mat-option *ngFor="let ent of entities" [value]="ent"> {{pd.team_name}}
{{ent.full_name}} </mat-option>
</mat-option> </mat-select>
</mat-select> </mat-form-field>
<mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Lender Name Required.</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '3'">
<mat-select matInput placeholder="Vendor Name" [formControl]="regForm.controls['lenVenName']" required>
<mat-option>--</mat-option>
<mat-option *ngFor="let ent of entities" [value]="ent">
{{ent.full_name}}
</mat-option>
</mat-select><mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Vendor Name Required.</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
<mat-select matInput placeholder="Role" (selectionChange)="toggleAllSelection($event,regForm.controls['type'].value)" [formControl]="regForm.controls['role']" required>
<mat-option *ngFor="let role of roles" [value]="role" >
{{role.role_name}}
</mat-option>
</mat-select>
<div *ngIf="roleload"><mat-progress-bar mode="indeterminate" color="defalut"></mat-progress-bar></div>
<mat-error *ngIf="regForm.controls['role'].hasError('required') && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
<mat-error *ngIf="regForm.controls['role'].errors?.phone && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
</mat-form-field>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="roleAccess">
<mat-select matInput placeholder="PD Team" [formControl]="regForm.controls['pdteam']" required >
<mat-option>--</mat-option>
<mat-option *ngFor="let pd of pdTeam" [value]="pd" >
{{pd.team_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div> </div>
</mat-card-content>
</mat-card-content>
</mat-card> </mat-card>
</div> </div>
</div> </div>
</mat-card-content>
</mat-card-content>
<hr> <hr>
<mat-card-actions style="text-align:right;">
<mat-card-actions style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>

View File

@ -8,4 +8,7 @@
.hoverdp:hover mat-icon{ .hoverdp:hover mat-icon{
display:block; display:block;
} }
mat-form-field {
width:23%;
}

View File

@ -1,130 +1,43 @@
<div class="user-profile relative"> <mat-card>
<div class="profile-cover"> <mat-card-content>
</div> <div class="user-profile relative">
<div class=""> <div class="profile-cover">
<!-- <div fxLayout="row" fxLayoutWrap="wrap" class="profile-w"> </div>
<div fxFlex.gt-sm="25" fxFlex.gt-xs="25" fxFlex="20">
</div> <div fxLayout="row" fxLayoutWrap="wrap">
<div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="80" class="user-links"> <div fxFlex.gt-sm="25" fxFlex.gt-xs="50" fxFlex="100" class="relative">
<ul class="profile-menu"> <div class="profile-avatar" style="margin-left: 39%;margin-top:-12%;">
<li><a href="">Tweets<span class="block text-lg-center">217</span></a></li>
<li><a href="">Followings<span class="block text-lg-center">89</span></a></li> <img [src]="profileurl || 'https://image.ibb.co/mGjZB9/usernew.png'" width="200" height="200" alt="user">
<li><a href="">Followers<span class="block text-lg-center">78,6790</span></a></li> </div>
<li><a href="">Likes<span class="block text-lg-center">7</span></a></li>
<li><a href="">Moments<span class="block text-lg-center">0</span></a></li> </div>
</ul> <div fxLayout="row wrap" fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
</div> <div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="50" class="align-self-center pt-1" >
<div fxFlex.gt-sm="25" fxFlex.gt-xs="25" fxFlex="100" class="align-self-center">
<button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button">
<span class="button-text">Edit profile</span>
</button>
</div>
</div> -->
<div fxLayout="row" fxLayoutWrap="wrap">
<div fxFlex.gt-sm="25" fxFlex.gt-xs="50" fxFlex="100" class="relative">
<div class="profile-avatar" style="margin-left: 39%;margin-top:-12%;">
<img [src]="profileurl ||''" width="200" height="200" alt="user">
</div>
<div class="profile-info">
<!-- <h3 class="profile-name"><strong>{{userDetails.user_full_name}}</strong></h3>
<span class="user-name">{{userDetails.email}}</span>
<span class="user-name">{{userDetails.mobile_no}}</span>
<span class="pro-des">
</span>
<span><i class="fa fa-map-marker"></i> {{userDetails.addressline1}} {{userDetails.addressline2}}</span>
<span><i class="fa fa-calendar"></i>{{userDetails.addressline3}} {{userDetails.state_name}} - {{userDetails.pincode}}</span>
<span>{{userDetails.createdon | date:'dd MMM yyyy'}}</span> -->
</div>
</div>
<div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="100" class="mt-1">
<div class="profile-content">
<div class="profile-head">
<div fxFlex.gt-sm="25" fxFlex.gt-xs="25" fxFlexOffset="100" fxFlex="100" class="align-self-center">
<button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="changePassword()">
<span class="button-text">Change Password</span>
</button>
<button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="editprofile()">
<span class="button-text">Edit profile</span>
</button>
</div>
<hr>
</div>
<div class="profile-cont">
<ul class="pl-0">
<li>
<div fxLayout="row"> <div fxLayout="row">
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" [src]="profileurl ||''" width="80" height="80" alt="user"> <div class="pl-1 pr-1 profile-i" fxFlex.xs="85" fxFlex.sm="85" fxFlex.md="85" fxFlex.lg="85" fxFlex.xl="85">
</div> <p> {{userDetails.user_first_name}} {{userDetails.user_last_name}}</p>
<div class="pl-1 pr-1 profile-i" fxFlex.xs="85" fxFlex.sm="85" fxFlex.md="85" fxFlex.lg="85" fxFlex.xl="85"> <p>{{userDetails.role_name}}</p>
<div> <p> {{userDetails.email}}</p>
<span class="post-profile-head">{{userDetails.user_full_name}}</span> <p> {{userDetails.mobile_no}}</p>
<span class="twitter-uname"><i class="fa fa-email"></i> {{userDetails.email}}</span><br/> <p> {{userDetails.city_name}} ,{{userDetails.state_name}} </p>
<span class="time">{{userDetails.createdon | date:'dd MMM yyyy'}}</span> </div>
<p><i class="fa fa-mobile"></i> {{userDetails.mobile_no}}</p> </div>
<p>{{userDetails.addressline1}} {{userDetails.addressline2}} <br/> </div>
{{userDetails.addressline3}} - {{userDetails.pincode}} {{userDetails.state_name}} <div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="50" class="align-self-center pt-1">
</p> <button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="changePassword()">
<span class="button-text">Change Password</span>
</div> </button>
<!-- <div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div> --> <button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="editprofile()">
</div> <span class="button-text">Edit Profile</span>
</div> </button>
</li> </div>
<!-- <li>
<div fxLayout="row"> </div>
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" src="../../../assets/images/test3.jpg" width="80" height="80" alt="user">
</div> </div>
<div class="pl-1 pr-1 profile-i" fxFlex.xs="85" fxFlex.sm="85" fxFlex.md="85" fxFlex.lg="85" fxFlex.xl="85"> </div>
<div> </mat-card-content>
<span class="post-profile-head">Jane Doe</span> </mat-card>
<span class="twitter-uname">@JaneDoe</span>
<span class="time">Sep 11, 2017</span>
<p>
“Tomorrow belongs to those who can hear it coming.” - David Bowie
</p>
</div>
<div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div>
</div>
</div>
</li>
<li>
<div fxLayout="row">
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" src="../../../assets/images/test3.jpg" width="80" height="80" alt="user">
</div>
<div class="pl-1 pr-1 profile-i" fxFlex.xs="85" fxFlex.sm="85" fxFlex.md="85" fxFlex.lg="85" fxFlex.xl="85">
<div>
<span class="post-profile-head">Jane Doe</span>
<span class="twitter-uname">@JaneDoe</span>
<span class="time">Sep 13, 2017</span>
<p>our recent work</p>
</div>
<div class="img-wrp" fxLayout="row" fxLayoutWrap="space-around">
<div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="100">
<div class="thumb-border">
<img src="../../../assets/images/blog-1.jpg" alt="user">
</div>
</div>
<div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="100">
<div class="thumb-border">
<img src="../../../assets/images/blog-2.jpg" alt="user">
</div>
</div>
</div>
<div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div>
</div>
</div>
</li> -->
</ul>
</div>
</div>
</div>
<div fxFlex.gt-sm="25" fxFlex.gt-xs="50" fxFlex="100" class="align-self-center">
</div>
</div>
</div>
</div>

View File

@ -68,7 +68,7 @@ export class UserProfileComponent implements OnInit {
getprofilepic(){ getprofilepic(){
let users= { let users= {
'userid':this.userDetails.userid, 'userid':this.userDetails.userid,
'entityid':this.userDetails.fk_entity_id, 'entityid':this.userDetails.fk_entity_type_id,
'profilepic':this.userDetails.profilepic 'profilepic':this.userDetails.profilepic
} }
this.users.getprofilepic(users).subscribe(res=>{ this.users.getprofilepic(users).subscribe(res=>{
@ -85,7 +85,7 @@ export class UserProfileComponent implements OnInit {
@Component({ @Component({
selector: 'app-jazz-dialog', selector: 'app-jazz-dialog',
template: ` template: `
<h5 class="mt-0">New Password Change.</h5> <h5 class="mt-0">Change Password</h5>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Old Password" [(ngModel)]="pass.oldPassword" type="password" style="width: 100%;"> <input matInput placeholder="Old Password" [(ngModel)]="pass.oldPassword" type="password" style="width: 100%;">
@ -99,15 +99,15 @@ export class UserProfileComponent implements OnInit {
<br/> <br/>
<mat-form-field> <mat-form-field>
<input matInput placeholder="ConfirmPassword" [(ngModel)]="pass.confirmPassword" type="password" style="width: 100%;"> <input matInput placeholder="Confirm Password" [(ngModel)]="pass.confirmPassword" type="password" style="width: 100%;">
</mat-form-field> </mat-form-field>
<small *ngIf="pass.confirmPassword !='' && pass.newPassword != pass.confirmPassword" class="mat-text-warn">Passwords do not math.</small> <small *ngIf="pass.confirmPassword !='' && pass.newPassword != pass.confirmPassword" class="mat-text-warn">Passwords do not math.</small>
<br> <br>
<button mat-raised-button class="mat-green" type="submit" (click)="dialogRef.close(pass)">Submit</button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Submit" matTooltipPosition="above" type="submit" (click)="dialogRef.close(pass)"><mat-icon>save</mat-icon></button>
` `
}) })