Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
8a1b569fec
@ -0,0 +1,102 @@
|
|||||||
|
<p>Address</p>
|
||||||
|
<form class="address" [formGroup]="addressForm">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Address" formControlName="address">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Address Type" formControlName="address_type">
|
||||||
|
<mat-option value="Office">Office</mat-option>
|
||||||
|
<mat-option value="Clinic">Clinic</mat-option>
|
||||||
|
<mat-option value="Factory">Factory</mat-option>
|
||||||
|
<mat-option value="Warehouse">Warehouse</mat-option>
|
||||||
|
<mat-option value="Shop">Shop</mat-option>
|
||||||
|
<mat-option value="ResidencecumOffice">Residence cum Office</mat-option>
|
||||||
|
<mat-option value="Residence">Residence</mat-option>
|
||||||
|
<mat-option value="Other">Other (PD officer to fill)</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Locality" formControlName="locality">
|
||||||
|
<mat-option value="CommercialOffice">Commercial (Office type) Area
|
||||||
|
</mat-option>
|
||||||
|
<mat-option value="CommercialShop">Commercial (shop type) Area</mat-option>
|
||||||
|
<mat-option value="Industrial">Industrial Area</mat-option>
|
||||||
|
<mat-option value="Residential">Residential Area</mat-option>
|
||||||
|
<mat-option value="Mix">Mix use (Comment mandatory)</mat-option>
|
||||||
|
<mat-option value="Rural">Rural (Village) area</mat-option>
|
||||||
|
<mat-option value="Others">Others (Please specify)</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Approach to PD location" formControlName="pd_location">
|
||||||
|
<mat-option value="{{data.pd_location_approach_id}}"
|
||||||
|
*ngFor="let data of locationdata">{{data.description}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Comment on locality" formControlName="comment_locality">
|
||||||
|
<mat-option value="{{data.comments_on_locality_id}}"
|
||||||
|
*ngFor="let data of commentData">{{data.rating}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Customer Behaviour"
|
||||||
|
formControlName="customer_behaviour">
|
||||||
|
<mat-option value="{{data.customer_behaviour_id}}"
|
||||||
|
*ngFor="let data of customerData">{{data.description}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Neighbour hood
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="neighbourhood">
|
||||||
|
<div *ngFor="let item of addressForm.get('neighbourhood').controls; let i=index">
|
||||||
|
<mat-card-content class="matcard" [formGroup]="item">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Neighbour name"
|
||||||
|
formControlName="name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Do you know"
|
||||||
|
formControlName="do_you_know">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="How long do you know the applicant"
|
||||||
|
formControlName="how_long">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Is the applicant owner"
|
||||||
|
formControlName="is_owner">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
<mat-option value="dont_know">Dont Know</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button *ngIf="i==0"
|
||||||
|
(click)="addNeighbour($event)"
|
||||||
|
style="float: right;">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button *ngIf="i>0"
|
||||||
|
(click)="removeNeighbour(i)"
|
||||||
|
style="float: right;">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="onSubmit()">Submit
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} 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-address',
|
||||||
|
templateUrl: './address.component.html',
|
||||||
|
styleUrls: ['./address.component.scss']
|
||||||
|
})
|
||||||
|
export class AddressComponent implements OnInit {
|
||||||
|
locationdata: any = [];
|
||||||
|
commentData: any = [];
|
||||||
|
customerData: any = [];
|
||||||
|
public currentLoanForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
public addressForm: FormGroup;
|
||||||
|
|
||||||
|
public address: AbstractControl;
|
||||||
|
public addressType: AbstractControl;
|
||||||
|
public locality: AbstractControl;
|
||||||
|
public pdLocation: AbstractControl;
|
||||||
|
public commentlocality: AbstractControl;
|
||||||
|
public customerBehaviour: AbstractControl;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.getLocation();
|
||||||
|
this.getComment();
|
||||||
|
this.getCustomer();
|
||||||
|
this.initAddressForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = '250';
|
||||||
|
params.pd_form_id = '250';
|
||||||
|
this._pd.retriveForm(params).subscribe(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'];
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public initAddressForm(): void {
|
||||||
|
this.addressForm = this.fb.group({
|
||||||
|
address: ['', Validators.compose([Validators.required])],
|
||||||
|
address_type: ['', Validators.compose([Validators.required])],
|
||||||
|
locality: ['', Validators.compose([Validators.required])],
|
||||||
|
pd_location: ['', Validators.compose([Validators.required])],
|
||||||
|
comment_locality: ['', Validators.compose([Validators.required])],
|
||||||
|
customer_behaviour: ['', Validators.compose([Validators.required])],
|
||||||
|
neighbourhood: this.fb.array([])
|
||||||
|
});
|
||||||
|
this.address = this.addressForm.controls['address'];
|
||||||
|
this.addressType = this.addressForm.controls['address_type'];
|
||||||
|
this.locality = this.addressForm.controls['locality'];
|
||||||
|
this.pdLocation = this.addressForm.controls['pd_location'];
|
||||||
|
this.commentlocality = this.addressForm.controls['comment_locality'];
|
||||||
|
this.customerBehaviour = this.addressForm.controls['customer_behaviour'];
|
||||||
|
}
|
||||||
|
createNeighbour(): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
name: ['', Validators.compose([Validators.required])],
|
||||||
|
do_you_know: ['', Validators.compose([Validators.required])],
|
||||||
|
how_long: ['', Validators.compose([Validators.required])],
|
||||||
|
is_owner: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getLocation() {
|
||||||
|
let master_name = 'PDLOCATIONAPPROACH';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.locationdata.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getComment() {
|
||||||
|
let master_name = 'COMMENTSONLOCALITY';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.commentData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getCustomer() {
|
||||||
|
let master_name = 'CUSTOMERBEHAVIOUR';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.customerData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addNeighbour() {
|
||||||
|
const control = <FormArray>this.addressForm.controls['neighbourhood'];
|
||||||
|
if (control.length <= 1) {
|
||||||
|
control.push(this.createNeighbour());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
removeNeighbour(index) {
|
||||||
|
const control = <FormArray>this.addressForm.controls['neighbourhood'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
onSubmit() {
|
||||||
|
if (!this.addressForm.valid) {
|
||||||
|
this.validateAllFormFields(this.addressForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('form', this.addressForm.value);
|
||||||
|
let records: any = {};
|
||||||
|
records.address = this.address.value;
|
||||||
|
records.address_type = this.addressType.value;
|
||||||
|
records.locality = this.locality.value;
|
||||||
|
records.pd_location = this.pdLocation.value;
|
||||||
|
records.comment_locality = this.commentlocality.value;
|
||||||
|
records.customer_behaviour = this.commentlocality.value;
|
||||||
|
records.neighbourhood = this.addressForm.value.items;
|
||||||
|
records.pdid = '250';
|
||||||
|
records.formid = '250';
|
||||||
|
records.fk_createdby = '250';
|
||||||
|
console.log('params', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
<form [formGroup]="bankingForm" class="bankForm">
|
||||||
|
<div formArrayName="itemRows">
|
||||||
|
<mat-accordion
|
||||||
|
*ngFor="let itemrow of bankingForm.controls.itemRows.controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-expansion-panel class="banlFields" [expanded]="step == i">
|
||||||
|
<mat-expansion-panel-header>
|
||||||
|
<mat-panel-title>
|
||||||
|
<h4>{{i+1}} Banking details<span *ngIf="i==0" style="float: right;">
|
||||||
|
<mat-icon (click)="addBankdetails(i)">add</mat-icon>
|
||||||
|
</span>
|
||||||
|
<span *ngIf="i > 0">
|
||||||
|
<mat-icon (click)="deleteBankdetails(i)">delete</mat-icon>
|
||||||
|
</span></h4>
|
||||||
|
</mat-panel-title>
|
||||||
|
</mat-expansion-panel-header>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Applicant Name"
|
||||||
|
formControlName="applicant_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Bank Name" formControlName="bank_name">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Account Type"
|
||||||
|
formControlName="account_type">
|
||||||
|
<mat-option value="Savings">Savings</mat-option>
|
||||||
|
<mat-option value="Current">Current</mat-option>
|
||||||
|
<mat-option value="OD">OD</mat-option>
|
||||||
|
<mat-option value="CC">CC</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Salary Credited in this account"
|
||||||
|
formControlName="salary">
|
||||||
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
<mat-option value="No">No</mat-option>
|
||||||
|
<mat-option value="NA">NA</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Limit in case of OD / CC account"
|
||||||
|
formControlName="limit">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Is this the main business account"
|
||||||
|
formControlName="is_main">
|
||||||
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
<mat-option value="No">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Approximate Vintage"
|
||||||
|
formControlName="vintage">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-expansion-panel>
|
||||||
|
|
||||||
|
</mat-accordion>
|
||||||
|
</div>
|
||||||
|
<button mat-raised-button class="button" (click)="bankSubmit()">Submit
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
.banlFields mat-form-field {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.bankForm .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} 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-banking-details',
|
||||||
|
templateUrl: './banking-details.component.html',
|
||||||
|
styleUrls: ['./banking-details.component.scss']
|
||||||
|
})
|
||||||
|
export class BankingDetailsComponent implements OnInit {
|
||||||
|
public bankingForm: FormGroup;
|
||||||
|
step: any;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.step = 0;
|
||||||
|
this.initBankingForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = '252';
|
||||||
|
params.pd_form_id = '252';
|
||||||
|
this._pd.retriveForm(params).subscribe(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'];
|
||||||
|
if(result.length == 0) {
|
||||||
|
control.push(this.createBankarray());
|
||||||
|
} else {
|
||||||
|
result.forEach(datas => {
|
||||||
|
control.push(this.createBankarray());
|
||||||
|
});
|
||||||
|
this.bankingForm.controls.itemRows.setValue(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public initBankingForm(): void {
|
||||||
|
this.bankingForm = this.fb.group({
|
||||||
|
itemRows: this.fb.array([])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createBankarray() {
|
||||||
|
return this.fb.group({
|
||||||
|
applicant_name: ['', Validators.compose([Validators.required])],
|
||||||
|
bank_name: ['', Validators.compose([Validators.required])],
|
||||||
|
account_type: ['', Validators.compose([Validators.required])],
|
||||||
|
salary: ['', Validators.compose([Validators.required])],
|
||||||
|
limit: ['', Validators.compose([Validators.required])],
|
||||||
|
is_main: ['', Validators.compose([Validators.required])],
|
||||||
|
vintage: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addBankdetails(i) {
|
||||||
|
this.step = i++;
|
||||||
|
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
||||||
|
control.push(this.createBankarray());
|
||||||
|
}
|
||||||
|
deleteBankdetails(index: number) {
|
||||||
|
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
bankSubmit() {
|
||||||
|
if (!this.bankingForm.valid) {
|
||||||
|
this.validateAllFormFields(this.bankingForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = '252';
|
||||||
|
records.formid = '252';
|
||||||
|
records.fk_createdby = '252';
|
||||||
|
records.banking_details = this.bankingForm.controls['itemRows'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
<form [formGroup]="currentLoanForm" class="address">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Do you have any other existing Loan"
|
||||||
|
formControlName="existing_loan">
|
||||||
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
<mat-option value="No">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Loan Details<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="loan_details">
|
||||||
|
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="EMI" formControlName="emi">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Loan Type" formControlName="loan_type">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Lender" formControlName="lender">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Original Tenure" formControlName="original_tenure">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Current Balance Tenure" formControlName="current_balance_tenure">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addLoanDetails()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteLoanDetails(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitCurrentloan()"></button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl,
|
||||||
|
} 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-current-loan',
|
||||||
|
templateUrl: './current-loan.component.html',
|
||||||
|
styleUrls: ['./current-loan.component.scss']
|
||||||
|
})
|
||||||
|
export class CurrentLoanComponent implements OnInit {
|
||||||
|
public currentLoanForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initCurrentloanForm();
|
||||||
|
}
|
||||||
|
public initCurrentloanForm(): void {
|
||||||
|
this.currentLoanForm = this.fb.group({
|
||||||
|
existing_loan: ['', Validators.compose([Validators.required])],
|
||||||
|
loan_details: this.fb.array([this.createLoanDetail()])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createLoanDetail() {
|
||||||
|
return this.fb.group({
|
||||||
|
loan_amount: ['', Validators.compose([Validators.required])],
|
||||||
|
emi: ['', Validators.compose([Validators.required])],
|
||||||
|
loan_type: ['', Validators.compose([Validators.required])],
|
||||||
|
lender: ['', Validators.compose([Validators.required])],
|
||||||
|
original_tenure: ['', Validators.compose([Validators.required])],
|
||||||
|
current_balance_tenure: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addLoanDetails() {
|
||||||
|
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||||
|
control.push(this.createLoanDetail());
|
||||||
|
}
|
||||||
|
deleteLoanDetails(index) {
|
||||||
|
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
submitCurrentloan() {
|
||||||
|
if (!this.currentLoanForm.valid) {
|
||||||
|
this.validateAllFormFields(this.currentLoanForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = '253';
|
||||||
|
records.formid = '253';
|
||||||
|
records.fk_createdby = '253';
|
||||||
|
records.existing_loan = this.currentLoanForm.controls['existing_loan'].value;
|
||||||
|
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
<p>Family</p>
|
||||||
|
<form class="address" [formGroup]="familyForm">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Person Met" formControlName="person">
|
||||||
|
<mat-option *ngFor="let state of filteredStates" [value]="state">
|
||||||
|
{{state}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="person.value =='Other'">
|
||||||
|
<input matInput placeholder="Enter the relationship" formControlName="personOther">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="No. Of family members" formControlName="members">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Earning Members
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="earningMembers">
|
||||||
|
<div *ngFor="let item of familyForm.get('earningMembers').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Relation" formControlName="relation">
|
||||||
|
<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="Segment" formControlName="segment">
|
||||||
|
<mat-option value="Salaried">Salaried</mat-option>
|
||||||
|
<mat-option value="SENP">SENP</mat-option>
|
||||||
|
<mat-option value="SEP">SEP</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Income / Revenue"
|
||||||
|
formControlName="income">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name of Employer / Business"
|
||||||
|
formControlName="employer_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button *ngIf="i==0"
|
||||||
|
(click)="addearningMembers()">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button
|
||||||
|
(click)="deleteEarningMembers(i)" *ngIf="i>0">
|
||||||
|
<mat-icon>close</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.get('nonEarningMembers').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Relation"
|
||||||
|
formControlName="relationship">
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
<input matInput placeholder="Retired From"
|
||||||
|
formControlName="retired">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addMembers()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteMembers(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</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="Where is the residence"
|
||||||
|
formControlName="residence">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="No.of yrs" formControlName="years">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Ownership" formControlName="ownership">
|
||||||
|
<mat-option value="Self">Self Owned</mat-option>
|
||||||
|
<mat-option value="Family">Family Owned</mat-option>
|
||||||
|
<mat-option value="Rented">Rented</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="ownership.value =='Others'">
|
||||||
|
<input matInput placeholder="Please specify" formControlName="ownershipOther">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="ownership.value =='Rented'">
|
||||||
|
<input matInput placeholder="what rent"
|
||||||
|
formControlName="rent">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<button mat-raised-button class="button" (click)="submitFamily()">Submit</button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,216 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} 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 {
|
||||||
|
public currentLoanForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
public familyForm: FormGroup;
|
||||||
|
|
||||||
|
public person: AbstractControl;
|
||||||
|
public personOther: AbstractControl;
|
||||||
|
public members: AbstractControl;
|
||||||
|
public residence: AbstractControl;
|
||||||
|
public years: AbstractControl;
|
||||||
|
public ownership: AbstractControl;
|
||||||
|
public ownershipOther: AbstractControl;
|
||||||
|
public rent: AbstractControl;
|
||||||
|
|
||||||
|
relationData: any = [];
|
||||||
|
occupationData: any = [];
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.getRelation();
|
||||||
|
this.getOccupation();
|
||||||
|
this.initFamilyForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = '251';
|
||||||
|
params.pd_form_id = '251';
|
||||||
|
this._pd.retriveForm(params).subscribe(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'];
|
||||||
|
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'];
|
||||||
|
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);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public initFamilyForm(): void {
|
||||||
|
this.familyForm = this.fb.group({
|
||||||
|
person: ['', Validators.compose([Validators.required])],
|
||||||
|
personOther: [''],
|
||||||
|
members: ['', Validators.compose([Validators.required])],
|
||||||
|
residence: ['', Validators.compose([Validators.required])],
|
||||||
|
years: ['', Validators.compose([Validators.required])],
|
||||||
|
ownership: ['', Validators.compose([Validators.required])],
|
||||||
|
ownershipOther: [''],
|
||||||
|
rent: [''],
|
||||||
|
earningMembers: this.fb.array([]),
|
||||||
|
nonEarningMembers: this.fb.array([])
|
||||||
|
});
|
||||||
|
this.person = this.familyForm.controls['person'];
|
||||||
|
this.personOther = this.familyForm.controls['personOther'];
|
||||||
|
this.members = this.familyForm.controls['members'];
|
||||||
|
this.residence = this.familyForm.controls['residence'];
|
||||||
|
this.years = this.familyForm.controls['years'];
|
||||||
|
this.ownership = this.familyForm.controls['ownership'];
|
||||||
|
this.ownershipOther = this.familyForm.controls['ownershipOther'];
|
||||||
|
this.rent = this.familyForm.controls['rent'];
|
||||||
|
}
|
||||||
|
createMembers(): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
relation: ['', Validators.compose([Validators.required])],
|
||||||
|
segment: ['', Validators.compose([Validators.required])],
|
||||||
|
income: ['', Validators.compose([Validators.required])],
|
||||||
|
employer_name: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createNonMembers(): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
relationship: ['', Validators.compose([Validators.required])],
|
||||||
|
occupation: ['', Validators.compose([Validators.required])],
|
||||||
|
retired: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
addearningMembers() {
|
||||||
|
const control = <FormArray>this.familyForm.controls['earningMembers'];
|
||||||
|
control.push(this.createMembers());
|
||||||
|
}
|
||||||
|
addMembers() {
|
||||||
|
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
|
||||||
|
control.push(this.createNonMembers());
|
||||||
|
}
|
||||||
|
deleteEarningMembers(index) {
|
||||||
|
const control = <FormArray>this.familyForm.controls['earningMembers'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
deleteMembers(index) {
|
||||||
|
const control = <FormArray>this.familyForm.controls['nonEarningMembers'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRelation() {
|
||||||
|
let master_name = 'RELATIONSHIPS';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.relationData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getOccupation() {
|
||||||
|
let master_name = 'OCCUPATIONMEMBERS';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.occupationData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
submitFamily() {
|
||||||
|
if (!this.familyForm.valid) {
|
||||||
|
this.validateAllFormFields(this.familyForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('data', this.familyForm.value);
|
||||||
|
let records: any = {};
|
||||||
|
records.no_of_years = this.years.value;
|
||||||
|
if (this.ownership.value == 'Others') {
|
||||||
|
records.ownership = this.ownershipOther.value;
|
||||||
|
} else {
|
||||||
|
records.ownership = this.ownership.value;
|
||||||
|
}
|
||||||
|
records.residence = this.residence.value;
|
||||||
|
if (this.ownership.value == 'Rented') {
|
||||||
|
records.what_rent = this.rent.value;
|
||||||
|
}
|
||||||
|
if (this.person.value == 'Other') {
|
||||||
|
records.person_met = this.personOther.value;
|
||||||
|
} else {
|
||||||
|
records.person_met = this.person.value;
|
||||||
|
}
|
||||||
|
records.family_members = this.members.value;
|
||||||
|
records.earning_members = this.familyForm.controls['earningMembers'].value;
|
||||||
|
records.non_earning_members = this.familyForm.controls['nonEarningMembers'].value;
|
||||||
|
records.pdid = '251';
|
||||||
|
records.formid = '251';
|
||||||
|
records.fk_createdby = '251';
|
||||||
|
console.log('params', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
<form [formGroup]="loanDetailsForm" class="address">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Loan Amount applied" formControlName="loan_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="What is the end use"
|
||||||
|
formControlName="other_income">
|
||||||
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
<mat-option value="No">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Loan Details<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="income_details">
|
||||||
|
<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Source"
|
||||||
|
formControlName="source">
|
||||||
|
<mat-option value="rental_income">Rental Income</mat-option>
|
||||||
|
<mat-option value="interest_income">Interest Income</mat-option>
|
||||||
|
<mat-option value="agricultural_income">Agricultural Income</mat-option>
|
||||||
|
<mat-option value="dividend_income">Dividend Income and Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Amount" formControlName="amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Frequency" formControlName="frequency">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<button type="submit" (click)="submitCurrentDetails()"></button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl,
|
||||||
|
} 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-loan-details',
|
||||||
|
templateUrl: './loan-details.component.html',
|
||||||
|
styleUrls: ['./loan-details.component.scss']
|
||||||
|
})
|
||||||
|
export class LoanDetailsComponent implements OnInit {
|
||||||
|
public loanDetailsForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
frequencyData: any;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initloanDetailsForm();
|
||||||
|
// this.getFrequency();
|
||||||
|
}
|
||||||
|
public initloanDetailsForm(): void {
|
||||||
|
this.loanDetailsForm = this.fb.group({
|
||||||
|
other_income: ['', Validators.compose([Validators.required])],
|
||||||
|
// income_details: this.fb.array([this.createDetail()])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// createDetail() {
|
||||||
|
// return this.fb.group({
|
||||||
|
// source: ['', Validators.compose([Validators.required])],
|
||||||
|
// amount: ['', Validators.compose([Validators.required])],
|
||||||
|
// frequency: ['', Validators.compose([Validators.required])],
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// getFrequency() {
|
||||||
|
// let master_name = 'FREQUENCY';
|
||||||
|
// this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
// console.log('data', data);
|
||||||
|
// data.records.forEach(val => {
|
||||||
|
// if (val.isactive == 1) {
|
||||||
|
// this.frequencyData.push(val);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// addIncomeDetails() {
|
||||||
|
// const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
||||||
|
// control.push(this.createDetail());
|
||||||
|
// }
|
||||||
|
// deleteIncomeDetails(index) {
|
||||||
|
// const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
||||||
|
// control.removeAt(index);
|
||||||
|
// }
|
||||||
|
// submitCurrentDetails() {
|
||||||
|
// if (!this.otherIncomeForm.valid) {
|
||||||
|
// this.validateAllFormFields(this.otherIncomeForm);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// let records: any = {};
|
||||||
|
// records.pdid = '254';
|
||||||
|
// records.formid = '254';
|
||||||
|
// records.fk_createdby = '254';
|
||||||
|
// records.other_income = this.otherIncomeForm.controls['other_income'].value;
|
||||||
|
// records.income_details = this.otherIncomeForm.controls['income_details'].value;
|
||||||
|
// console.log('data', records);
|
||||||
|
// this._pd.saveForm(records).subscribe(data => {
|
||||||
|
// console.log('data', data);
|
||||||
|
// this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// 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);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
<form [formGroup]="otherIncomeForm" class="address">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Other Income"
|
||||||
|
formControlName="other_income">
|
||||||
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
<mat-option value="No">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Loan Details<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="income_details">
|
||||||
|
<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Source"
|
||||||
|
formControlName="source">
|
||||||
|
<mat-option value="rental_income">Rental Income</mat-option>
|
||||||
|
<mat-option value="interest_income">Interest Income</mat-option>
|
||||||
|
<mat-option value="agricultural_income">Agricultural Income</mat-option>
|
||||||
|
<mat-option value="dividend_income">Dividend Income and Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Amount" formControlName="amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Frequency" formControlName="frequency">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<button type="submit" (click)="submitCurrentDetails()"></button>
|
||||||
|
</form>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl,
|
||||||
|
} 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-other-income',
|
||||||
|
templateUrl: './other-income.component.html',
|
||||||
|
styleUrls: ['./other-income.component.scss']
|
||||||
|
})
|
||||||
|
export class OtherIncomeComponent implements OnInit {
|
||||||
|
public otherIncomeForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
frequencyData: any;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initOtherincomeForm();
|
||||||
|
this.getFrequency();
|
||||||
|
}
|
||||||
|
public initOtherincomeForm(): void {
|
||||||
|
this.otherIncomeForm = this.fb.group({
|
||||||
|
other_income: ['', Validators.compose([Validators.required])],
|
||||||
|
income_details: this.fb.array([this.createDetail()])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createDetail() {
|
||||||
|
return this.fb.group({
|
||||||
|
source: ['', Validators.compose([Validators.required])],
|
||||||
|
amount: ['', Validators.compose([Validators.required])],
|
||||||
|
frequency: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getFrequency() {
|
||||||
|
let master_name = 'FREQUENCY';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.frequencyData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addIncomeDetails() {
|
||||||
|
const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
||||||
|
control.push(this.createDetail());
|
||||||
|
}
|
||||||
|
deleteIncomeDetails(index) {
|
||||||
|
const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
submitCurrentDetails() {
|
||||||
|
if (!this.otherIncomeForm.valid) {
|
||||||
|
this.validateAllFormFields(this.otherIncomeForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = '254';
|
||||||
|
records.formid = '254';
|
||||||
|
records.fk_createdby = '254';
|
||||||
|
records.other_income = this.otherIncomeForm.controls['other_income'].value;
|
||||||
|
records.income_details = this.otherIncomeForm.controls['income_details'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -393,6 +393,23 @@
|
|||||||
<ng-container *ngSwitchCase="4">
|
<ng-container *ngSwitchCase="4">
|
||||||
<app-assets-info [pdid]="startPD"></app-assets-info>
|
<app-assets-info [pdid]="startPD"></app-assets-info>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="5">
|
||||||
|
<app-address></app-address>
|
||||||
|
<!-- end personal type questions -->
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="6">
|
||||||
|
<app-family-details></app-family-details>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="7">
|
||||||
|
<!--<p>Banking details</p>-->
|
||||||
|
<app-banking-details></app-banking-details>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="8">
|
||||||
|
<app-current-loan></app-current-loan>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="9">
|
||||||
|
<app-other-income></app-other-income>
|
||||||
|
</ng-container>
|
||||||
<!-- end personal type questions
|
<!-- end personal type questions
|
||||||
-->
|
-->
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@ -400,13 +417,35 @@
|
|||||||
<!-- end form based questions -->
|
<!-- end form based questions -->
|
||||||
|
|
||||||
</figure>
|
</figure>
|
||||||
|
<!--</ng-container>-->
|
||||||
|
<!--<!– end supplier type questions –>-->
|
||||||
|
|
||||||
|
<!--<!– start client type questions –>-->
|
||||||
|
<!--<ng-container *ngSwitchCase="2">-->
|
||||||
|
<!--<app-client-info [pdid]="startPD"></app-client-info>-->
|
||||||
|
<!--</ng-container>-->
|
||||||
|
<!--<!– end client type questions –>-->
|
||||||
|
|
||||||
|
<!--<!– start personal type questions –>-->
|
||||||
|
<!--<ng-container *ngSwitchCase="3">-->
|
||||||
|
<!--<app-personal-info [pdid]="startPD" [pd_all_details]="pdFullDetails"></app-personal-info>-->
|
||||||
|
<!--</ng-container>-->
|
||||||
|
<!--<ng-container *ngSwitchCase="4">-->
|
||||||
|
<!--<app-assets-info [pdid]="startPD"></app-assets-info>-->
|
||||||
|
<!--</ng-container>-->
|
||||||
|
<!--<!– end personal type questions -->
|
||||||
|
<!--–>-->
|
||||||
|
<!--</ng-container>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!-- end form based questions -->
|
||||||
|
|
||||||
|
<!--</figure>-->
|
||||||
</div>
|
</div>
|
||||||
</mat-sidenav-container>
|
</mat-sidenav-container>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
<notifier-container></notifier-container>
|
<notifier-container></notifier-container>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -121,3 +121,22 @@ mat-icon{
|
|||||||
right: 69px;
|
right: 69px;
|
||||||
top: 112px;
|
top: 112px;
|
||||||
}
|
}
|
||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { Component, ViewChild ,OnInit,ViewEncapsulation, OnDestroy } from '@angular/core';
|
import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { NotifierService } from 'angular-notifier';
|
import {NotifierService} from 'angular-notifier';
|
||||||
import { ListPdComponent } from './../list-pd.component';
|
import {ListPdComponent} from './../list-pd.component';
|
||||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
import {PdTrigerService} from '../../../pd-service/pd-triger.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-start-pd',
|
selector: 'app-start-pd',
|
||||||
@ -11,72 +11,129 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
|||||||
styleUrls: ['./start-pd.component.scss']
|
styleUrls: ['./start-pd.component.scss']
|
||||||
})
|
})
|
||||||
export class StartPdComponent implements OnInit, OnDestroy {
|
export class StartPdComponent implements OnInit, OnDestroy {
|
||||||
private notifier: NotifierService;
|
public startPD: string;
|
||||||
public startPD:string;
|
public mainApplicantName: string;
|
||||||
public mainApplicantName:string;
|
|
||||||
//public remarks: string;
|
//public remarks: string;
|
||||||
errorMessage:any;
|
errorMessage: any;
|
||||||
selectedCategory:any=[];
|
selectedCategory: any = [];
|
||||||
categoryList: any=[];
|
categoryList: any = [];
|
||||||
pdMasterList: any=[];
|
pdMasterList: any = [];
|
||||||
optionsForm: FormGroup;
|
optionsForm: FormGroup;
|
||||||
checkBoxForm:FormGroup;
|
checkBoxForm: FormGroup;
|
||||||
textBoxForm:FormGroup;
|
textBoxForm: FormGroup;
|
||||||
next:number;
|
next: number;
|
||||||
previous:number;
|
previous: number;
|
||||||
selectedCategoryIndex:number;
|
selectedCategoryIndex: number;
|
||||||
selectedQuestionIndex:number;
|
selectedQuestionIndex: number;
|
||||||
getQuestionsLength:number;
|
getQuestionsLength: number;
|
||||||
answerList:any=[];
|
answerList: any = [];
|
||||||
ansPDList:any=[];
|
ansPDList: any = [];
|
||||||
pdFullDetails:any=[];
|
filteredStates: any = [
|
||||||
|
'Co-Applicant 1 to x',
|
||||||
|
'Accountant',
|
||||||
|
'Manager',
|
||||||
|
'Relative of the applicant',
|
||||||
|
'Friend of the Applicant',
|
||||||
|
'DSA',
|
||||||
|
'Other'
|
||||||
|
];
|
||||||
|
relationDetails: any = [1];
|
||||||
|
// errorMessage:any;
|
||||||
|
// selectedCategory:any=[];
|
||||||
|
// categoryList: any=[];
|
||||||
|
// pdMasterList: any=[];
|
||||||
|
// optionsForm: FormGroup;
|
||||||
|
// checkBoxForm:FormGroup;
|
||||||
|
// textBoxForm:FormGroup;
|
||||||
|
// next:number;
|
||||||
|
// previous:number;
|
||||||
|
// selectedCategoryIndex:number;
|
||||||
|
// selectedQuestionIndex:number;
|
||||||
|
// getQuestionsLength:number;
|
||||||
|
// answerList:any=[];
|
||||||
|
// ansPDList:any=[];
|
||||||
|
// pdFullDetails:any=[];
|
||||||
|
|
||||||
// category static form buttons
|
// category static form buttons
|
||||||
categoryFormButtons : any=[
|
categoryFormButtons: any = [
|
||||||
{
|
{
|
||||||
"form_id":1,
|
"form_id": 1,
|
||||||
"form_name":"Supplier Details"
|
"form_name": "Supplier Details"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"form_id":2,
|
"form_id": 2,
|
||||||
"form_name":"Client Details",
|
"form_name": "Client Details",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"form_id":3,
|
"form_id": 3,
|
||||||
"form_name":"Personal Details",
|
"form_name": "Personal Details",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"form_id":4,
|
"form_id":4,
|
||||||
"form_name":"Asset Details",
|
"form_name":"Asset Details",
|
||||||
},
|
},
|
||||||
];
|
{
|
||||||
|
"form_id": 5,
|
||||||
formsCategoryEnable:boolean=false;
|
"form_name": "Address"
|
||||||
selectedFormsCategory:any;
|
},
|
||||||
|
{
|
||||||
|
"form_id": 6,
|
||||||
|
"form_name": "Family",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"form_id": 7,
|
||||||
|
"form_name": "Banking",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"form_id": 8,
|
||||||
|
"form_name": "Current Loan",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"form_id": 9,
|
||||||
|
"form_name": "Other Income",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"form_id": 10,
|
||||||
|
"form_name": "Loan Details",
|
||||||
|
},
|
||||||
|
|
||||||
|
];
|
||||||
|
formsCategoryEnable: boolean = false;
|
||||||
|
selectedFormsCategory: any;
|
||||||
// create values for status check
|
// create values for status check
|
||||||
pdStatusCheck :any={
|
pdStatusCheck: any = {
|
||||||
"DRAFT" :'DRAFT',
|
"DRAFT": 'DRAFT',
|
||||||
"TRIGGERED" :'TRIGGERED',
|
"TRIGGERED": 'TRIGGERED',
|
||||||
"ALLOCATED" :'ALLOCATED',
|
"ALLOCATED": 'ALLOCATED',
|
||||||
"SCHEDULED" :'SCHEDULED',
|
"SCHEDULED": 'SCHEDULED',
|
||||||
"INPROGRESS" :'INPROGRESS',
|
"INPROGRESS": 'INPROGRESS',
|
||||||
"COMPLETED" :'COMPLETED',
|
"COMPLETED": 'COMPLETED',
|
||||||
"QC_COMPLETED" :'QC_COMPLETED',
|
"QC_COMPLETED": 'QC_COMPLETED',
|
||||||
};
|
};
|
||||||
currentPDStatus: string;
|
currentPDStatus: string;
|
||||||
actualQuestions:number;
|
actualQuestions: number;
|
||||||
answeredQuestions :number;
|
answeredQuestions: number;
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder,private route: ActivatedRoute,
|
|
||||||
|
|
||||||
|
|
||||||
|
// start
|
||||||
|
|
||||||
|
// end
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private listPDComponent : ListPdComponent, private _pd: PdTrigerService,) {
|
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) {
|
||||||
this.startPD = this.route.snapshot.params['pdid'];
|
this.startPD = this.route.snapshot.params['pdid'];
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
// start
|
||||||
|
|
||||||
|
// end
|
||||||
this.listPDComponent.showListView(false);
|
this.listPDComponent.showListView(false);
|
||||||
const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
|
const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
|
||||||
const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');
|
const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');
|
||||||
@ -87,9 +144,14 @@ constructor(notifier: NotifierService, private fb: FormBuilder,private route: Ac
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.loadTemplates(this.startPD);
|
this.loadTemplates(this.startPD);
|
||||||
this.next=1;
|
this.next = 1;
|
||||||
this.previous=2;
|
this.previous = 2;
|
||||||
}
|
}
|
||||||
|
// start
|
||||||
|
|
||||||
|
|
||||||
|
// end
|
||||||
|
|
||||||
isMac(): boolean {
|
isMac(): boolean {
|
||||||
let bool = false;
|
let bool = false;
|
||||||
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
|
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
|
||||||
@ -97,28 +159,27 @@ constructor(notifier: NotifierService, private fb: FormBuilder,private route: Ac
|
|||||||
}
|
}
|
||||||
return bool;
|
return bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load pd template details
|
// load pd template details
|
||||||
loadTemplates(startID:string){
|
loadTemplates(startID: string) {
|
||||||
this._pd.loadPDTemplates(startID).subscribe(
|
this._pd.loadPDTemplates(startID).subscribe(
|
||||||
data => {
|
data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
this.pdMasterList=data.records.pdmaster_details;
|
this.pdMasterList = data.records.pdmaster_details;
|
||||||
this.categoryList=data.records.question_answers;
|
this.categoryList = data.records.question_answers;
|
||||||
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||||
this.mainApplicantName = filterApplicantName[0].applicant_name;
|
this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||||
this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||||
|
|
||||||
this.actualQuestions = data.records.counts.overall_question_count;
|
this.actualQuestions = data.records.counts.overall_question_count;
|
||||||
this.answeredQuestions = data.records.counts.overall_answered_count;
|
this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||||
|
|
||||||
this.pdFullDetails = data.records
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.pdMasterList="";
|
this.pdMasterList = "";
|
||||||
this.mainApplicantName="";
|
this.mainApplicantName = "";
|
||||||
this.categoryList=[];
|
this.categoryList = [];
|
||||||
this.currentPDStatus="";
|
this.currentPDStatus = "";
|
||||||
}
|
}
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
}
|
}
|
||||||
@ -128,74 +189,97 @@ loadTemplates(startID:string){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
isOver(): boolean {
|
isOver(): boolean {
|
||||||
return window.matchMedia(`(max-width: 960px)`).matches;
|
return window.matchMedia(`(max-width: 960px)`).matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnSelectDirectQuestions(selectedQuestions: any, categoryIndex:number,questionsIndex:number){
|
OnSelectDirectQuestions(selectedQuestions: any, categoryIndex: number, questionsIndex: number) {
|
||||||
this.formsCategoryEnable=false;
|
this.formsCategoryEnable = false;
|
||||||
this.selectedCategory=selectedQuestions;
|
this.selectedCategory = selectedQuestions;
|
||||||
this.selectedCategoryIndex=categoryIndex;
|
this.selectedCategoryIndex = categoryIndex;
|
||||||
this.selectedQuestionIndex=questionsIndex;
|
this.selectedQuestionIndex = questionsIndex;
|
||||||
|
|
||||||
let serachQuestions = {
|
let serachQuestions = {
|
||||||
"question_id":selectedQuestions.fk_question_id,
|
"question_id": selectedQuestions.fk_question_id,
|
||||||
"pd_id":this.startPD,
|
"pd_id": this.startPD,
|
||||||
"template_id":selectedQuestions.fk_template_id,
|
"template_id": selectedQuestions.fk_template_id,
|
||||||
"category_id":selectedQuestions.fk_template_question_category_id
|
"category_id": selectedQuestions.fk_template_question_category_id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.getAnswers(serachQuestions);
|
|
||||||
|
|
||||||
}
|
// loadTemplates(startID:string){
|
||||||
|
// this._pd.loadPDTemplates(startID).subscribe(
|
||||||
|
// data => {
|
||||||
|
// if (data.status == 200) {
|
||||||
|
// this.pdMasterList=data.records.pdmaster_details;
|
||||||
|
// this.categoryList=data.records.question_answers;
|
||||||
|
// let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||||
|
// this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||||
|
// this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||||
|
//
|
||||||
|
// this.actualQuestions = data.records.counts.overall_question_count;
|
||||||
|
// this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||||
|
//
|
||||||
|
// this.pdFullDetails = data.records
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// this.pdMasterList="";
|
||||||
|
// this.mainApplicantName="";
|
||||||
|
// this.categoryList=[];
|
||||||
|
// this.currentPDStatus="";
|
||||||
|
// }
|
||||||
|
// this.getAnswers(serachQuestions);
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// load question based answer list
|
// load question based answer list
|
||||||
getAnswers(serachList:any){
|
getAnswers(serachList: any) {
|
||||||
this.answerList=[];
|
this.answerList = [];
|
||||||
this._pd.getAnswersForPD(serachList).subscribe(
|
this._pd.getAnswersForPD(serachList).subscribe(
|
||||||
data => {
|
data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
this.answerList=data.records.answers;
|
this.answerList = data.records.answers;
|
||||||
this.ansPDList=data.records;
|
this.ansPDList = data.records;
|
||||||
this.actualQuestions = data.records.counts.overall_question_count,
|
this.actualQuestions = data.records.counts.overall_question_count,
|
||||||
this.answeredQuestions = data.records.counts.overall_answered_count
|
this.answeredQuestions = data.records.counts.overall_answered_count
|
||||||
|
|
||||||
// this for options type questions
|
// this for options type questions
|
||||||
if(this.selectedCategory.fk_question_answertype==1){
|
if (this.selectedCategory.fk_question_answertype == 1) {
|
||||||
this.loadOtionsForm(this.selectedCategory, this.answerList);
|
this.loadOtionsForm(this.selectedCategory, this.answerList);
|
||||||
}
|
}
|
||||||
//this for text box type questions
|
//this for text box type questions
|
||||||
else if(this.selectedCategory.fk_question_answertype==2){
|
else if (this.selectedCategory.fk_question_answertype == 2) {
|
||||||
|
|
||||||
this.loadTextBoxForm(this.selectedCategory,this.answerList);
|
this.loadTextBoxForm(this.selectedCategory, this.answerList);
|
||||||
}
|
}
|
||||||
//this for check box type questions
|
//this for check box type questions
|
||||||
else if(this.selectedCategory.fk_question_answertype==3){
|
else if (this.selectedCategory.fk_question_answertype == 3) {
|
||||||
|
|
||||||
this.loadCheckBoxForm(this.selectedCategory,this.answerList);
|
this.loadCheckBoxForm(this.selectedCategory, this.answerList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// load check box form
|
// load check box form
|
||||||
|
|
||||||
loadCheckBoxForm(selectedCategory: any, ansItem: any){
|
loadCheckBoxForm(selectedCategory: any, ansItem: any) {
|
||||||
// create checkbox group
|
// create checkbox group
|
||||||
let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({
|
let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||||
fk_pd_id:new FormControl(this.startPD),
|
fk_pd_id: new FormControl(this.startPD),
|
||||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||||
pd_answer_id: new FormControl(item.question_answer_id),
|
pd_answer_id: new FormControl(item.question_answer_id),
|
||||||
pd_answer: new FormControl(item.answer),
|
pd_answer: new FormControl(item.answer),
|
||||||
pd_answer_weightage:new FormControl(item.template_answer_weightage),
|
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||||
checkbox: new FormControl(item.isactive==null ? false: true)
|
checkbox: new FormControl(item.isactive == null ? false : true)
|
||||||
})));
|
})));
|
||||||
// create documents group
|
// create documents group
|
||||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||||
pd_document_title:new FormControl(item.pd_document_title),
|
pd_document_title: new FormControl(item.pd_document_title),
|
||||||
pd_document_url: new FormControl(item.pd_document_name),
|
pd_document_url: new FormControl(item.pd_document_name),
|
||||||
|
|
||||||
})));
|
})));
|
||||||
@ -215,7 +299,7 @@ loadTemplates(startID:string){
|
|||||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||||
pd_question: new FormControl(this.selectedCategory.question),
|
pd_question: new FormControl(this.selectedCategory.question),
|
||||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||||
pd_answer_remark:new FormControl(this.ansPDList.question_remark),
|
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||||
items: checkboxGroup,
|
items: checkboxGroup,
|
||||||
selectedItems: hiddenControl,
|
selectedItems: hiddenControl,
|
||||||
documents: documentsGroup
|
documents: documentsGroup
|
||||||
@ -229,27 +313,27 @@ loadTemplates(startID:string){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load Options form
|
// load Options form
|
||||||
loadOtionsForm(selectedCategory: any, ansItem: any){
|
loadOtionsForm(selectedCategory: any, ansItem: any) {
|
||||||
// create options type group
|
// create options type group
|
||||||
let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({
|
let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||||
fk_pd_id:new FormControl(this.startPD),
|
fk_pd_id: new FormControl(this.startPD),
|
||||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||||
pd_answer_id: new FormControl(item.question_answer_id),
|
pd_answer_id: new FormControl(item.question_answer_id),
|
||||||
pd_answer: new FormControl(item.answer),
|
pd_answer: new FormControl(item.answer),
|
||||||
pd_answer_weightage:new FormControl(item.template_answer_weightage),
|
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||||
options: new FormControl(item.isactive==null ? false: true)
|
options: new FormControl(item.isactive == null ? false : true)
|
||||||
})));
|
})));
|
||||||
|
|
||||||
// create documents group
|
// create documents group
|
||||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||||
pd_document_title:new FormControl(item.pd_document_title),
|
pd_document_title: new FormControl(item.pd_document_title),
|
||||||
pd_document_url: new FormControl(item.pd_document_name),
|
pd_document_url: new FormControl(item.pd_document_name),
|
||||||
|
|
||||||
})));
|
})));
|
||||||
|
|
||||||
// create a hidden reuired formControl to keep status of checkbox group
|
// create a hidden reuired formControl to keep status of checkbox group
|
||||||
let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required);
|
let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required);
|
||||||
let checkedItem = hiddenControl.value!=null ? new FormControl(hiddenControl.value[0].pd_answer_id) :new FormControl(null);
|
let checkedItem = hiddenControl.value != null ? new FormControl(hiddenControl.value[0].pd_answer_id) : new FormControl(null);
|
||||||
|
|
||||||
this.optionsForm = new FormGroup({
|
this.optionsForm = new FormGroup({
|
||||||
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
|
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
|
||||||
@ -258,47 +342,48 @@ loadTemplates(startID:string){
|
|||||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||||
pd_question: new FormControl(this.selectedCategory.question),
|
pd_question: new FormControl(this.selectedCategory.question),
|
||||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||||
pd_answer_remark:new FormControl(this.ansPDList.question_remark),
|
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||||
items: optionsGroup,
|
items: optionsGroup,
|
||||||
selectedItems: hiddenControl,
|
selectedItems: hiddenControl,
|
||||||
modelValue : checkedItem,
|
modelValue: checkedItem,
|
||||||
documents: documentsGroup
|
documents: documentsGroup
|
||||||
|
|
||||||
});
|
});
|
||||||
this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => {
|
this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => {
|
||||||
hiddenControl.setValue(this.updateOptionsMapItems(v,optionsGroup.value));
|
hiddenControl.setValue(this.updateOptionsMapItems(v, optionsGroup.value));
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// map option type group values
|
// map option type group values
|
||||||
optionsMapItems(items) {
|
optionsMapItems(items) {
|
||||||
|
|
||||||
let optionSelectedItems = items.filter((item) => item.options==true).map((item) => item);
|
let optionSelectedItems = items.filter((item) => item.options == true).map((item) => item);
|
||||||
return optionSelectedItems.length ? optionSelectedItems : null;
|
return optionSelectedItems.length ? optionSelectedItems : null;
|
||||||
}
|
}
|
||||||
// map options type while change options
|
|
||||||
updateOptionsMapItems(key,items) {
|
|
||||||
|
|
||||||
let updateSelectedItems = items.filter((item) => item.pd_answer_id==key).map((item) => item);
|
// map options type while change options
|
||||||
|
updateOptionsMapItems(key, items) {
|
||||||
|
|
||||||
|
let updateSelectedItems = items.filter((item) => item.pd_answer_id == key).map((item) => item);
|
||||||
return updateSelectedItems.length ? updateSelectedItems : null;
|
return updateSelectedItems.length ? updateSelectedItems : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load text box form
|
// load text box form
|
||||||
loadTextBoxForm(selectedCategory: any, ansItem: any){
|
loadTextBoxForm(selectedCategory: any, ansItem: any) {
|
||||||
// create text box type group
|
// create text box type group
|
||||||
let textGroup = new FormArray(ansItem.map(item => new FormGroup({
|
let textGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||||
fk_pd_id:new FormControl(this.startPD),
|
fk_pd_id: new FormControl(this.startPD),
|
||||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||||
pd_answer_id: new FormControl(item.question_answer_id),
|
pd_answer_id: new FormControl(item.question_answer_id),
|
||||||
pd_answer: new FormControl(item.pd_answer),
|
pd_answer: new FormControl(item.pd_answer),
|
||||||
pd_answer_weightage:new FormControl(item.template_answer_weightage),
|
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||||
text: new FormControl(item.pd_detail_answer_id==null ? false: true)
|
text: new FormControl(item.pd_detail_answer_id == null ? false : true)
|
||||||
})));
|
})));
|
||||||
|
|
||||||
// create documents group
|
// create documents group
|
||||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||||
pd_document_title:new FormControl(item.pd_document_title),
|
pd_document_title: new FormControl(item.pd_document_title),
|
||||||
pd_document_url: new FormControl(item.pd_document_name),
|
pd_document_url: new FormControl(item.pd_document_name),
|
||||||
|
|
||||||
})));
|
})));
|
||||||
@ -310,82 +395,83 @@ optionsMapItems(items) {
|
|||||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||||
pd_question: new FormControl(this.selectedCategory.question),
|
pd_question: new FormControl(this.selectedCategory.question),
|
||||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||||
pd_answer_remark:new FormControl(this.ansPDList.question_remark),
|
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||||
items: textGroup,
|
items: textGroup,
|
||||||
documents: documentsGroup
|
documents: documentsGroup
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// next save and previous save for options and check box type questions
|
// next save and previous save for options and check box type questions
|
||||||
saveNextPrevious(details:any, type:number){
|
saveNextPrevious(details: any, type: number) {
|
||||||
|
|
||||||
let fetchAns =[];
|
let fetchAns = [];
|
||||||
details.selectedItems.value.forEach((itemElement, itemIndex) => {
|
details.selectedItems.value.forEach((itemElement, itemIndex) => {
|
||||||
let obj1 = {
|
let obj1 = {
|
||||||
fk_pd_detail_id:details.pd_detail_id.value,
|
fk_pd_detail_id: details.pd_detail_id.value,
|
||||||
fk_pd_id:itemElement.fk_pd_id,
|
fk_pd_id: itemElement.fk_pd_id,
|
||||||
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
||||||
pd_answer_id: itemElement.pd_answer_id,
|
pd_answer_id: itemElement.pd_answer_id,
|
||||||
pd_answer: itemElement.pd_answer,
|
pd_answer: itemElement.pd_answer,
|
||||||
pd_answer_weightage:itemElement.pd_answer_weightage,
|
pd_answer_weightage: itemElement.pd_answer_weightage,
|
||||||
}
|
}
|
||||||
fetchAns.push(obj1)
|
fetchAns.push(obj1)
|
||||||
});
|
});
|
||||||
|
|
||||||
let pd_details:any=[{
|
let pd_details: any = [{
|
||||||
"pd_detail_id":details.pd_detail_id.value,
|
"pd_detail_id": details.pd_detail_id.value,
|
||||||
"fk_pd_id":details.fk_pd_id.value,
|
"fk_pd_id": details.fk_pd_id.value,
|
||||||
"fk_category_id":details.fk_category_id.value,
|
"fk_category_id": details.fk_category_id.value,
|
||||||
"fk_question_id":details.fk_question_id.value,
|
"fk_question_id": details.fk_question_id.value,
|
||||||
"pd_question":details.pd_question.value,
|
"pd_question": details.pd_question.value,
|
||||||
"pd_question_weightage":details.pd_question_weightage.value,
|
"pd_question_weightage": details.pd_question_weightage.value,
|
||||||
"question_remark":details.pd_answer_remark.value,
|
"question_remark": details.pd_answer_remark.value,
|
||||||
"answers":fetchAns,
|
"answers": fetchAns,
|
||||||
"images":[]
|
"images": []
|
||||||
}];
|
}];
|
||||||
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
||||||
if (result.status == 200) {
|
if (result.status == 200) {
|
||||||
if(type==1){
|
if (type == 1) {
|
||||||
this.skipNextPrevious(this.next);
|
this.skipNextPrevious(this.next);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.skipNextPrevious(this.previous);
|
this.skipNextPrevious(this.previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// next save and previous save for text type questions
|
// next save and previous save for text type questions
|
||||||
saveNextPreviousText(details:any, type:number){
|
saveNextPreviousText(details: any, type: number) {
|
||||||
let fetchAns =[];
|
let fetchAns = [];
|
||||||
details.items.value.forEach((itemElement, itemIndex) => {
|
details.items.value.forEach((itemElement, itemIndex) => {
|
||||||
let obj1 = {
|
let obj1 = {
|
||||||
fk_pd_detail_id:details.pd_detail_id.value,
|
fk_pd_detail_id: details.pd_detail_id.value,
|
||||||
fk_pd_id:itemElement.fk_pd_id,
|
fk_pd_id: itemElement.fk_pd_id,
|
||||||
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
||||||
pd_answer_id: itemElement.pd_answer_id,
|
pd_answer_id: itemElement.pd_answer_id,
|
||||||
pd_answer: itemElement.pd_answer,
|
pd_answer: itemElement.pd_answer,
|
||||||
pd_answer_weightage:itemElement.pd_answer_weightage,
|
pd_answer_weightage: itemElement.pd_answer_weightage,
|
||||||
}
|
}
|
||||||
fetchAns.push(obj1)
|
fetchAns.push(obj1)
|
||||||
});
|
});
|
||||||
let pd_details:any=[{
|
let pd_details: any = [{
|
||||||
"pd_detail_id":details.pd_detail_id.value,
|
"pd_detail_id": details.pd_detail_id.value,
|
||||||
"fk_pd_id":details.fk_pd_id.value,
|
"fk_pd_id": details.fk_pd_id.value,
|
||||||
"fk_category_id":details.fk_category_id.value,
|
"fk_category_id": details.fk_category_id.value,
|
||||||
"fk_question_id":details.fk_question_id.value,
|
"fk_question_id": details.fk_question_id.value,
|
||||||
"pd_question":details.pd_question.value,
|
"pd_question": details.pd_question.value,
|
||||||
"pd_question_weightage":details.pd_question_weightage.value,
|
"pd_question_weightage": details.pd_question_weightage.value,
|
||||||
"question_remark":details.pd_answer_remark.value,
|
"question_remark": details.pd_answer_remark.value,
|
||||||
"answers":fetchAns,
|
"answers": fetchAns,
|
||||||
"images":[]
|
"images": []
|
||||||
}];
|
}];
|
||||||
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
||||||
if (result.status == 200) {
|
if (result.status == 200) {
|
||||||
if(type==1){
|
if (type == 1) {
|
||||||
this.skipNextPrevious(this.next);
|
this.skipNextPrevious(this.next);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.skipNextPrevious(this.previous);
|
this.skipNextPrevious(this.previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,39 +481,39 @@ optionsMapItems(items) {
|
|||||||
|
|
||||||
// skip to previous and next questions
|
// skip to previous and next questions
|
||||||
|
|
||||||
skipNextPrevious(type:number){
|
skipNextPrevious(type: number) {
|
||||||
// for skip to next
|
// for skip to next
|
||||||
if(type==1){
|
if (type == 1) {
|
||||||
if(this.categoryList.length > this.selectedCategoryIndex ){
|
if (this.categoryList.length > this.selectedCategoryIndex) {
|
||||||
let nextCatList = this.categoryList[this.selectedCategoryIndex];
|
let nextCatList = this.categoryList[this.selectedCategoryIndex];
|
||||||
this.selectedQuestionIndex=this.selectedQuestionIndex < nextCatList.questions.length-1 ? this.selectedQuestionIndex+1 : this.selectedQuestionIndex;
|
this.selectedQuestionIndex = this.selectedQuestionIndex < nextCatList.questions.length - 1 ? this.selectedQuestionIndex + 1 : this.selectedQuestionIndex;
|
||||||
let nextQuesList = nextCatList.questions[this.selectedQuestionIndex];
|
let nextQuesList = nextCatList.questions[this.selectedQuestionIndex];
|
||||||
this.selectedCategory=nextQuesList;
|
this.selectedCategory = nextQuesList;
|
||||||
this.selectedCategoryIndex=this.selectedCategoryIndex;
|
this.selectedCategoryIndex = this.selectedCategoryIndex;
|
||||||
this.selectedQuestionIndex=this.selectedQuestionIndex;
|
this.selectedQuestionIndex = this.selectedQuestionIndex;
|
||||||
let serachQuestions = {
|
let serachQuestions = {
|
||||||
"question_id":nextQuesList.fk_question_id,
|
"question_id": nextQuesList.fk_question_id,
|
||||||
"pd_id":this.startPD,
|
"pd_id": this.startPD,
|
||||||
"template_id":nextQuesList.fk_template_id,
|
"template_id": nextQuesList.fk_template_id,
|
||||||
"category_id":nextQuesList.fk_template_question_category_id
|
"category_id": nextQuesList.fk_template_question_category_id
|
||||||
}
|
}
|
||||||
this.getAnswers(serachQuestions);
|
this.getAnswers(serachQuestions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for skip to previous
|
// for skip to previous
|
||||||
else if(type==2){
|
else if (type == 2) {
|
||||||
if(this.categoryList.length > this.selectedCategoryIndex ){
|
if (this.categoryList.length > this.selectedCategoryIndex) {
|
||||||
let preCatList = this.categoryList[this.selectedCategoryIndex];
|
let preCatList = this.categoryList[this.selectedCategoryIndex];
|
||||||
this.selectedQuestionIndex=this.selectedQuestionIndex ==0 ? this.selectedQuestionIndex : this.selectedQuestionIndex-1;
|
this.selectedQuestionIndex = this.selectedQuestionIndex == 0 ? this.selectedQuestionIndex : this.selectedQuestionIndex - 1;
|
||||||
let preQuesList = preCatList.questions[this.selectedQuestionIndex];
|
let preQuesList = preCatList.questions[this.selectedQuestionIndex];
|
||||||
this.selectedCategory=preQuesList;
|
this.selectedCategory = preQuesList;
|
||||||
this.selectedCategoryIndex=this.selectedCategoryIndex;
|
this.selectedCategoryIndex = this.selectedCategoryIndex;
|
||||||
this.selectedQuestionIndex=this.selectedQuestionIndex;
|
this.selectedQuestionIndex = this.selectedQuestionIndex;
|
||||||
let serachQuestions = {
|
let serachQuestions = {
|
||||||
"question_id":preQuesList.fk_question_id,
|
"question_id": preQuesList.fk_question_id,
|
||||||
"pd_id":this.startPD,
|
"pd_id": this.startPD,
|
||||||
"template_id":preQuesList.fk_template_id,
|
"template_id": preQuesList.fk_template_id,
|
||||||
"category_id":preQuesList.fk_template_question_category_id
|
"category_id": preQuesList.fk_template_question_category_id
|
||||||
}
|
}
|
||||||
this.getAnswers(serachQuestions);
|
this.getAnswers(serachQuestions);
|
||||||
}
|
}
|
||||||
@ -436,14 +522,14 @@ optionsMapItems(items) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//change pd status
|
//change pd status
|
||||||
changePDStatus(status:string){
|
changePDStatus(status: string) {
|
||||||
|
|
||||||
let update_array = {
|
let update_array = {
|
||||||
"pd_id": this.startPD
|
"pd_id": this.startPD
|
||||||
}
|
}
|
||||||
this._pd.editPdMasterDetails(update_array, status).subscribe(result => {
|
this._pd.editPdMasterDetails(update_array, status).subscribe(result => {
|
||||||
if (result.status == 200) {
|
if (result.status == 200) {
|
||||||
this.currentPDStatus=this.pdStatusCheck.COMPLETED;
|
this.currentPDStatus = this.pdStatusCheck.COMPLETED;
|
||||||
this.notifier.notify('success', 'PD Completed.');
|
this.notifier.notify('success', 'PD Completed.');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -453,9 +539,9 @@ optionsMapItems(items) {
|
|||||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// start
|
||||||
// direct form based questions
|
// direct form based questions
|
||||||
OnSelectDirectForms(details:any){
|
OnSelectDirectForms(details: any) {
|
||||||
this.formsCategoryEnable = true;
|
this.formsCategoryEnable = true;
|
||||||
this.selectedFormsCategory = details;
|
this.selectedFormsCategory = details;
|
||||||
|
|
||||||
@ -463,10 +549,10 @@ optionsMapItems(items) {
|
|||||||
|
|
||||||
|
|
||||||
// load pd view component
|
// load pd view component
|
||||||
loadPdViewCompoent(){
|
loadPdViewCompoent() {
|
||||||
this.router.navigate([ '../../viewpd',this.startPD], { relativeTo: this.route });
|
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
// end
|
||||||
|
}
|
||||||
|
|||||||
@ -1,51 +1,61 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
MatRadioModule,
|
MatRadioModule,
|
||||||
MatButtonModule,MatTableModule,MatPaginatorModule,
|
MatButtonModule, MatTableModule, MatPaginatorModule,
|
||||||
MatProgressBarModule,MatDialogModule, MatSortModule,
|
MatProgressBarModule, MatDialogModule, MatSortModule,
|
||||||
MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule, MatStepperModule ,MatSidenavModule ,MatMenuModule, MatButtonToggleModule } from '@angular/material';
|
MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule,
|
||||||
|
MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
|
||||||
|
MatAutocompleteModule
|
||||||
|
} from '@angular/material';
|
||||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
|
import {FileUploadModule} from 'ng2-file-upload/ng2-file-upload';
|
||||||
import { TreeModule } from 'angular-tree-component';
|
import {TreeModule} from 'angular-tree-component';
|
||||||
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
|
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
import {FlexLayoutModule} from '@angular/flex-layout';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
|
|
||||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
||||||
import 'hammerjs';
|
import 'hammerjs';
|
||||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
import {NotifierModule, NotifierOptions} from 'angular-notifier';
|
||||||
import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
|
import {OwlDateTimeModule, OwlNativeDateTimeModule} from 'ng-pick-datetime';
|
||||||
|
|
||||||
import { AgmCoreModule } from '@agm/core';
|
import {AgmCoreModule} from '@agm/core';
|
||||||
import { ManagePdRoutingModule } from './manage-pd.routing';
|
import {ManagePdRoutingModule} from './manage-pd.routing';
|
||||||
import { ListPdComponent } from './list-pd/list-pd.component';
|
import {ListPdComponent} from './list-pd/list-pd.component';
|
||||||
import { ManagePdComponent } from './manage-pd.component';
|
import {ManagePdComponent} from './manage-pd.component';
|
||||||
import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component';
|
import {MapPdViewComponent} from './list-pd/map-pd-view/map-pd-view.component';
|
||||||
import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component';
|
import {AddPdComponent} from '../manage-pd/list-pd/add-pd/add-pd.component';
|
||||||
import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component';
|
import {ViewPdComponent} from '../manage-pd/list-pd/view-pd/view-pd.component';
|
||||||
import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component';
|
import {PdAllocationComponent} from '../manage-pd/list-pd/pd-allocation/pd-allocation.component';
|
||||||
import { SmartPdAllocationComponent } from './list-pd/smart-pd-allocation/smart-pd-allocation.component';
|
import {SmartPdAllocationComponent} from './list-pd/smart-pd-allocation/smart-pd-allocation.component';
|
||||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
import {PdTrigerService} from '../pd-service/pd-triger.service';
|
||||||
import { GetGeometricLocationService } from '../location-service/get-geometric-location.service';
|
import {GetGeometricLocationService} from '../location-service/get-geometric-location.service';
|
||||||
import { SchedulePdComponent } from './list-pd/schedule-pd/schedule-pd.component';
|
import {SchedulePdComponent} from './list-pd/schedule-pd/schedule-pd.component';
|
||||||
import { EditPdApplicantComponent } from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
|
import {EditPdApplicantComponent} from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
|
||||||
import { EditPdMasterComponent } from './list-pd/edit-pd-master/edit-pd-master.component';
|
import {EditPdMasterComponent} from './list-pd/edit-pd-master/edit-pd-master.component';
|
||||||
import { StartPdComponent } from './list-pd/start-pd/start-pd.component';
|
import {StartPdComponent} from './list-pd/start-pd/start-pd.component';
|
||||||
import { InprogressPdComponent } from './list-pd/inprogress-pd/inprogress-pd.component';
|
import {InprogressPdComponent} from './list-pd/inprogress-pd/inprogress-pd.component';
|
||||||
import { AllPdComponent } from './list-pd/all-pd/all-pd.component';
|
import {AllPdComponent} from './list-pd/all-pd/all-pd.component';
|
||||||
import { ScheduledPdComponent } from './list-pd/scheduled-pd/scheduled-pd.component';
|
import {ScheduledPdComponent} from './list-pd/scheduled-pd/scheduled-pd.component';
|
||||||
import { CompletedPdComponent } from './list-pd/completed-pd/completed-pd.component';
|
import {CompletedPdComponent} from './list-pd/completed-pd/completed-pd.component';
|
||||||
import { QcCompletedPdComponent } from './list-pd/qc-completed-pd/qc-completed-pd.component';
|
import {QcCompletedPdComponent} from './list-pd/qc-completed-pd/qc-completed-pd.component';
|
||||||
|
|
||||||
import { ClientInfoComponent } from './list-pd/start-pd/forms/client-info/client-info.component';
|
import {ClientInfoComponent} from './list-pd/start-pd/forms/client-info/client-info.component';
|
||||||
import { SupplierInfoComponent } from './list-pd/start-pd/forms/supplier-info/supplier-info.component';
|
import {SupplierInfoComponent} from './list-pd/start-pd/forms/supplier-info/supplier-info.component';
|
||||||
import { PersonalInfoComponent } from './list-pd/start-pd/forms/personal-info/personal-info.component';
|
import {PersonalInfoComponent} from './list-pd/start-pd/forms/personal-info/personal-info.component';
|
||||||
|
import {CurrentLoanComponent} from "./list-pd/start-pd/forms/current-loan/current-loan.component";
|
||||||
|
import {LoanDetailsComponent} from "./list-pd/start-pd/forms/loan-details/loan-details.component";
|
||||||
|
import {OtherIncomeComponent} from "./list-pd/start-pd/forms/other-income/other-income.component";
|
||||||
import { AssetsInfoComponent } from './list-pd/start-pd/forms/assets-info/assets-info.component';
|
import { AssetsInfoComponent } from './list-pd/start-pd/forms/assets-info/assets-info.component';
|
||||||
|
import {AddressComponent} from "./list-pd/start-pd/forms/address/address.component";
|
||||||
|
import {FamilyDetailsComponent} from "./list-pd/start-pd/forms/family-details/family-details.component";
|
||||||
|
import {BankingDetailsComponent} from "./list-pd/start-pd/forms/banking-details/banking-details.component";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom angular notifier options
|
* Custom angular notifier options
|
||||||
*/
|
*/
|
||||||
@ -91,6 +101,37 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
// imports: [
|
||||||
|
// CommonModule,
|
||||||
|
// ManagePdRoutingModule,
|
||||||
|
// NotifierModule.withConfig(pdCustomNotifierOptions),
|
||||||
|
// MatCardModule,
|
||||||
|
// MatIconModule,
|
||||||
|
// MatInputModule,
|
||||||
|
// MatRadioModule,
|
||||||
|
// MatTableModule,
|
||||||
|
// MatPaginatorModule,
|
||||||
|
// MatButtonModule,
|
||||||
|
// MatProgressBarModule,
|
||||||
|
// MatAutocompleteModule,
|
||||||
|
// MatToolbarModule,
|
||||||
|
// FlexLayoutModule,
|
||||||
|
// NgxDatatableModule,
|
||||||
|
// FormsModule,
|
||||||
|
// MatSlideToggleModule,
|
||||||
|
// MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
|
||||||
|
// ReactiveFormsModule,
|
||||||
|
// FileUploadModule,
|
||||||
|
// TreeModule,
|
||||||
|
// MatDialogModule, MatSortModule,
|
||||||
|
// NgxMatSelectSearchModule, MatTooltipModule, MatExpansionModule,
|
||||||
|
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||||
|
// OwlNativeDateTimeModule,
|
||||||
|
// ],
|
||||||
|
declarations: [BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent],
|
||||||
|
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
|
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
|
// entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
ManagePdRoutingModule,
|
ManagePdRoutingModule,
|
||||||
@ -116,9 +157,10 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
|
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
|
||||||
OwlNativeDateTimeModule,
|
OwlNativeDateTimeModule,
|
||||||
],
|
],
|
||||||
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
|
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
|
||||||
exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
providers: [PdTrigerService, GetGeometricLocationService],
|
providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent]
|
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent]
|
||||||
})
|
})
|
||||||
export class ManagePdModule { }
|
export class ManagePdModule {
|
||||||
|
}
|
||||||
|
|||||||
@ -1,137 +1,167 @@
|
|||||||
/** Common Import Section */
|
/** Common Import Section */
|
||||||
import { Injectable } from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import { Observable } from 'rxjs';//for Datatables
|
import {Observable} from 'rxjs';//for Datatables
|
||||||
import { HttpClient,HttpParams } from '@angular/common/http';
|
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import {catchError, map} from 'rxjs/operators';
|
||||||
import { of } from 'rxjs';
|
import {of} from 'rxjs';
|
||||||
|
|
||||||
/** Imported Service Files Are., */
|
/** Imported Service Files Are., */
|
||||||
import { AwsService } from '../../AwsService/aws.service';
|
import {AwsService} from '../../AwsService/aws.service';
|
||||||
|
|
||||||
/** Environment */
|
/** Environment */
|
||||||
import { environment } from 'environments/environment'
|
import {environment} from 'environments/environment'
|
||||||
|
|
||||||
|
const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' ');
|
||||||
|
|
||||||
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
|
|
||||||
/** Master Interface */
|
/** Master Interface */
|
||||||
export interface Master {
|
export interface Master {
|
||||||
master_id:number;
|
master_id: number;
|
||||||
master_name:string;
|
master_name: string;
|
||||||
constant_name:string;
|
constant_name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
||||||
|
|
||||||
export class PdTrigerService {
|
export class PdTrigerService {
|
||||||
|
|
||||||
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
// private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||||
//private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/";
|
// private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/";
|
||||||
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
|
||||||
private apiUrl = environment.apiEndpoint;
|
|
||||||
MAP_API_KEY: string;
|
MAP_API_KEY: string;
|
||||||
MAP_API_URL: string;
|
MAP_API_URL: string;
|
||||||
|
// private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||||
|
private apiUrl = environment.apiEndpoint;
|
||||||
|
|
||||||
constructor(private _http: HttpClient,
|
constructor(private _http: HttpClient,
|
||||||
private _aws:AwsService) {
|
private _aws: AwsService) {
|
||||||
this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
|
this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
|
||||||
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
|
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get add pd master details
|
// get add pd master details
|
||||||
getAllMasterDatas(TableName:string): Observable<any> {
|
getAllMasterDatas(TableName: string): Observable<any> {
|
||||||
return this._http.post<any>(this.apiUrl+'getListOfMaster', { "master_name":TableName })
|
console.log('table', TableName);
|
||||||
|
return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName})
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
saveForm(records): Observable<any> {
|
||||||
|
console.log('table', records);
|
||||||
|
let params = {records}
|
||||||
|
return this._http.post(this.apiUrl + 'savePDFormDetails', params)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
retriveForm(params): Observable<any> {
|
||||||
|
console.log('data', params);
|
||||||
|
return this._http.post(this.apiUrl + 'getPDFormDetails', params)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
//get product and subproduct master details
|
//get product and subproduct master details
|
||||||
getProductsDetails(): Observable<any> {
|
getProductsDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfProducts')
|
return this._http.get<any>(this.apiUrl + 'getListOfProducts')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get lenders list
|
// get lenders list
|
||||||
getLenderDetails(): Observable<any> {
|
getLenderDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfLenders')
|
return this._http.get<any>(this.apiUrl + 'getListOfLenders')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get customers list
|
// get customers list
|
||||||
getCustomersDetails(): Observable<any> {
|
getCustomersDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfCustomerSegments')
|
return this._http.get<any>(this.apiUrl + 'getListOfCustomerSegments')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get Pd Allocation type details list
|
// get Pd Allocation type details list
|
||||||
getPDAllocationDetails(): Observable<any> {
|
getPDAllocationDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfPDAllocationTypes')
|
return this._http.get<any>(this.apiUrl + 'getListOfPDAllocationTypes')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get state and city details
|
// get state and city details
|
||||||
getStateCityDetails(): Observable<any> {
|
getStateCityDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfStatesAndCities')
|
return this._http.get<any>(this.apiUrl + 'getListOfStatesAndCities')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get pd type and allocation type details
|
// get pd type and allocation type details
|
||||||
getPDTypeDetails():Observable<any> {
|
getPDTypeDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+'getListOfPDAllocationTypes')
|
return this._http.get<any>(this.apiUrl + 'getListOfPDAllocationTypes')
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add pd details
|
// add pd details
|
||||||
addPdDetails(pdForm: any): Observable<any> {
|
addPdDetails(pdForm: any): Observable<any> {
|
||||||
return this._http.post<any>(this.apiUrl+"triggerNewPD", pdForm)
|
return this._http.post<any>(this.apiUrl + "triggerNewPD", pdForm)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get pd details
|
// get pd details
|
||||||
getPdDetails(): Observable<any> {
|
getPdDetails(): Observable<any> {
|
||||||
return this._http.get<any>(this.apiUrl+"listLessPDDetails/get")
|
return this._http.get<any>(this.apiUrl + "listLessPDDetails/get")
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get status based pd list
|
// get status based pd list
|
||||||
getTabStatusPdDetails(status:string): Observable<any> {
|
getTabStatusPdDetails(status: string): Observable<any> {
|
||||||
const tabStatus = status ?
|
const tabStatus = status ?
|
||||||
{ params: new HttpParams().set('status', status) } : {};
|
{params: new HttpParams().set('status', status)} : {};
|
||||||
return this._http.get<any[]>(this.apiUrl+"listLessPDDetails/get",tabStatus)
|
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", tabStatus)
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('operation', []))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// get edit row pd details
|
|
||||||
editPdDetails(editId:string):Observable<any>{
|
|
||||||
let httpParams = new HttpParams().set('pdid', editId);
|
|
||||||
return this._http.post<any>(this.apiUrl+"getFullPDDetails",httpParams)
|
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get edit row pd details
|
||||||
|
editPdDetails(editId: string): Observable<any> {
|
||||||
|
let httpParams = new HttpParams().set('pdid', editId);
|
||||||
|
return this._http.post<any>(this.apiUrl + "getFullPDDetails", httpParams)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('operation', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// update pd master details
|
// update pd master details
|
||||||
editPdMasterDetails(editData:any,status:string):Observable<any>{
|
editPdMasterDetails(editData: any, status: string): Observable<any> {
|
||||||
editData.pd_status = status;
|
editData.pd_status = status;
|
||||||
editData.fk_updatedby = this._aws.getlocale();
|
editData.fk_updatedby = this._aws.getlocale();
|
||||||
editData.updatedon = currentdate;
|
editData.updatedon = currentdate;
|
||||||
return this._http.post<any>(this.apiUrl+"updatePDMaster",{records:editData})
|
return this._http.post<any>(this.apiUrl + "updatePDMaster", {records: editData})
|
||||||
|
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// update pd applicant
|
// update pd applicant
|
||||||
updatePdApplicant(editData:any):Observable<any>{
|
updatePdApplicant(editData: any): Observable<any> {
|
||||||
// editData.fk_updatedby = this._aws.getlocale();
|
// editData.fk_updatedby = this._aws.getlocale();
|
||||||
// editData.updatedon = currentdate;
|
// editData.updatedon = currentdate;
|
||||||
return this._http.post<any>(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData})
|
return this._http.post<any>(this.apiUrl + "updatePDApplicants", {"pd_applicant_details": editData})
|
||||||
|
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
@ -139,17 +169,18 @@ export class PdTrigerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get pd allocation to details
|
// get pd allocation to details
|
||||||
getPdOfficerList(pdID:string): Observable<any> {
|
getPdOfficerList(pdID: string): Observable<any> {
|
||||||
return this._http.post<any>(this.apiUrl+"getListPDOfficers",{"pdid":pdID})
|
return this._http.post<any>(this.apiUrl + "getListPDOfficers", {"pdid": pdID})
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// update pd officer
|
// update pd officer
|
||||||
updatePdOfficer(updateData: any): Observable<any> {
|
updatePdOfficer(updateData: any): Observable<any> {
|
||||||
updateData.fk_updatedby = this._aws.getlocale();
|
updateData.fk_updatedby = this._aws.getlocale();
|
||||||
updateData.updatedon = currentdate;
|
updateData.updatedon = currentdate;
|
||||||
return this._http.post<any>(this.apiUrl+"allocatePD",{"records":updateData})
|
return this._http.post<any>(this.apiUrl + "allocatePD", {"records": updateData})
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
@ -159,36 +190,54 @@ export class PdTrigerService {
|
|||||||
updateSchedule(updateData: any): Observable<any> {
|
updateSchedule(updateData: any): Observable<any> {
|
||||||
updateData.fk_scheduled_by = this._aws.getlocale();
|
updateData.fk_scheduled_by = this._aws.getlocale();
|
||||||
updateData.createdon = currentdate;
|
updateData.createdon = currentdate;
|
||||||
return this._http.post<any>(this.apiUrl+"schdulePD",{"records":updateData})
|
return this._http.post<any>(this.apiUrl + "schdulePD", {"records": updateData})
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//load pd template details
|
//load pd template details
|
||||||
loadPDTemplates(pdId: string):Observable<any>{
|
loadPDTemplates(pdId: string): Observable<any> {
|
||||||
const options = pdId ?
|
const options = pdId ?
|
||||||
{ params: new HttpParams().set('pd_id', pdId) } : {};
|
{params: new HttpParams().set('pd_id', pdId)} : {};
|
||||||
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate",options)
|
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// load PD question answers
|
// load PD question answers
|
||||||
getAnswersForPD(list: any):Observable<any>{
|
getAnswersForPD(list: any): Observable<any> {
|
||||||
let httpParams = new HttpParams();
|
let httpParams = new HttpParams();
|
||||||
httpParams = httpParams.append("category_id", list.category_id);
|
httpParams = httpParams.append("category_id", list.category_id);
|
||||||
httpParams = httpParams.append("pd_id", list.pd_id);
|
httpParams = httpParams.append("pd_id", list.pd_id);
|
||||||
httpParams = httpParams.append("question_id", list.question_id);
|
httpParams = httpParams.append("question_id", list.question_id);
|
||||||
httpParams = httpParams.append("template_id", list.template_id);
|
httpParams = httpParams.append("template_id", list.template_id);
|
||||||
|
|
||||||
return this._http.post<any[]>(this.apiUrl + "getAnswersForPD",httpParams)
|
return this._http.post<any[]>(this.apiUrl + "getAnswersForPD", httpParams)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save pd answers
|
||||||
|
// savePDQuestions(saveData: any): Observable<any> {
|
||||||
|
// saveData.createdby = this._aws.getlocale();
|
||||||
|
// saveData.fk_createdon = currentdate;
|
||||||
|
// // saveData[0].fk_updatedby = this._aws.getlocale();
|
||||||
|
// // saveData[0].updatedon = currentdate;
|
||||||
|
//
|
||||||
|
// return this._http.post<any>(this.apiUrl + "savePDQuestions", {"records": saveData})
|
||||||
|
// .pipe(
|
||||||
|
// catchError(this.handleError('operation', []))
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
|
private handleError<T>(operation = 'operation', result?: T) {
|
||||||
|
return (error: any): Observable<T> => {
|
||||||
|
return of(result as T);
|
||||||
|
};
|
||||||
|
}
|
||||||
// common Pd form details get for the Pd Process
|
// common Pd form details get for the Pd Process
|
||||||
getPDFormDetailsWithID(pdID, formID ):Observable<any> {
|
getPDFormDetailsWithID(pdID, formID ):Observable<any> {
|
||||||
return this._http.post<any>(this.apiUrl+"getPDFormDetails",{"pd_id":pdID,"pd_form_id" : formID})
|
return this._http.post<any>(this.apiUrl+"getPDFormDetails",{"pd_id":pdID,"pd_form_id" : formID})
|
||||||
@ -222,9 +271,9 @@ getPDFormDetailsWithID(pdID, formID ):Observable<any> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleError<T>(operation = 'operation', result?: T) {
|
// private handleError<T>(operation = 'operation', result?: T) {
|
||||||
return (error: any): Observable<T> => {
|
// return (error: any): Observable<T> => {
|
||||||
return of(result as T);
|
// return of(result as T);
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
|
<mat-card>
|
||||||
|
|
||||||
<mat-card>
|
|
||||||
|
|
||||||
<form [formGroup]="regForm" (ngSubmit)="register(regForm.value)">
|
<form [formGroup]="regForm" (ngSubmit)="register(regForm.value)">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxflex="100" fxLayout="row" fxLayoutAlign="start center">
|
<div fxflex="100" fxLayout="row" fxLayoutAlign="start center">
|
||||||
@ -17,46 +14,36 @@
|
|||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-title>Personal</mat-card-title><hr/>
|
<mat-card-title>Personal</mat-card-title><hr/>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2" style="display: inline-flex;">
|
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||||
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="profileaccess">
|
<label class="hoverdp" for="fileUpload" >
|
||||||
<img [src]="profileurl" style="width: 50%;border-radius: 50%;">
|
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="!imageaccess">
|
||||||
|
<img [src]="profileurl || 'https://image.ibb.co/mGjZB9/usernew.png'" style="width: 100px;height:100px;border-radius: 50%;border:2px solid red">
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="imageaccess">
|
<span dividerColor="primary" *ngIf="imageaccess">
|
||||||
<img [src]="filename" style="width: 50%; border-radius: 50%;">
|
<img [src]="filename" style="width: 100px;height:100px; border-radius: 50%;border:2px solid #e00201">
|
||||||
</span>
|
</span>
|
||||||
<div style="width:60%">
|
<mat-icon style="color:#716462;position: absolute; top: 39%;left: 5.5%;">camera_alt</mat-icon>
|
||||||
Profile Picture
|
</label>
|
||||||
<input type="file" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <span *ngIf="usersData !=''">
|
<input type="file" id="fileUpload" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" style="display:none"/>
|
||||||
{{img}}
|
|
||||||
</span> -->
|
|
||||||
</div>
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||||
<input matInput placeholder="First Name" [formControl]="regForm.controls['firstName']" required>
|
<input matInput placeholder="First Name" [formControl]="regForm.controls['firstName']" required>
|
||||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('required') && regForm.controls['firstName'].touched" class="mat-text-warn">First Name Required.</mat-error>
|
<mat-error *ngIf="regForm.controls['firstName'].hasError('required') && regForm.controls['firstName'].touched" class="mat-text-warn">First Name Required.</mat-error>
|
||||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('minlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Atleast 5 Characters.</mat-error>
|
<mat-error *ngIf="regForm.controls['firstName'].hasError('minlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Atleast 5 Characters.</mat-error>
|
||||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('maxlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Not More Than 10 Characters.</mat-error>
|
<mat-error *ngIf="regForm.controls['firstName'].hasError('maxlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Not More Than 10 Characters.</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||||
<input matInput placeholder="Last Name" [formControl]="regForm.controls['lastName']" required>
|
<input matInput placeholder="Last Name" [formControl]="regForm.controls['lastName']" required>
|
||||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('required') && regForm.controls['lastName'].touched" class="mat-text-warn">Last Name Required.</mat-error>
|
<mat-error *ngIf="regForm.controls['lastName'].hasError('required') && regForm.controls['lastName'].touched" class="mat-text-warn">Last Name Required.</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<!-- <mat-error *ngIf="regForm.controls['lastName'].hasError('minlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name must be at least 5 characters long.</mat-error>
|
|
||||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('maxlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name cannot exceed 10 characters.</mat-error> -->
|
|
||||||
<mat-form-field style="display: none;">
|
<mat-form-field style="display: none;">
|
||||||
<input matInput placeholder="User Id" [formControl]="regForm.controls['userid']">
|
<input matInput placeholder="User Id" [formControl]="regForm.controls['userid']">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
<mat-slide-toggle color="primary" [formControl]="regForm.controls['isactive']">
|
<mat-slide-toggle color="primary" [formControl]="regForm.controls['isactive']">
|
||||||
Isactive
|
Isactive
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
@ -72,9 +59,6 @@
|
|||||||
<mat-error *ngIf="regForm.controls['email'].errors?.email && regForm.controls['email'].touched" class="mat-text-warn">Invalid Email Address.</mat-error>
|
<mat-error *ngIf="regForm.controls['email'].errors?.email && regForm.controls['email'].touched" class="mat-text-warn">Invalid Email Address.</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
<input matInput placeholder="Alt Email address" [formControl]="regForm.controls['altemail']" type="email">
|
|
||||||
</mat-form-field> -->
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||||
<input matInput placeholder="Phone Number" [formControl]="regForm.controls['phone']" type="number" required>
|
<input matInput placeholder="Phone Number" [formControl]="regForm.controls['phone']" type="number" required>
|
||||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">Phone Number Required.</mat-error>
|
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">Phone Number Required.</mat-error>
|
||||||
@ -106,71 +90,7 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
<div fxFlex.gt-sm="33.33%" fxFlex="50" class="m-gap p-gap">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <mat-card-title>Contact Information</mat-card-title><hr/>
|
|
||||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
<input matInput placeholder="Phone number" [formControl]="regForm.controls['phone']" type="text">
|
|
||||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">You must include phone number.</mat-error>
|
|
||||||
<mat-error *ngIf="regForm.controls['phone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">You must include a valid phone number.</mat-error>
|
|
||||||
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
<input matInput placeholder="Alt Phone number" [formControl]="regForm.controls['altphone']" type="text">
|
|
||||||
<mat-error *ngIf="regForm.controls['altphone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">You must include a valid phone number.</mat-error>
|
|
||||||
|
|
||||||
</mat-form-field>
|
|
||||||
<!-- <mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">You must include phone number.</mat-error>
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
|
|
||||||
<input matInput placeholder="Address 1" [formControl]="regForm.controls['address1']">
|
|
||||||
</mat-form-field>
|
|
||||||
</div> -->
|
|
||||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
|
|
||||||
<input matInput placeholder="Address 2" [formControl]="regForm.controls['address2']">
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
|
|
||||||
<input matInput placeholder="Address 3" [formControl]="regForm.controls['address3']">
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
|
||||||
|
|
||||||
<input matInput placeholder="Pincode" [formControl]="regForm.controls['pincode']">
|
|
||||||
</mat-form-field>
|
|
||||||
</div> -->
|
|
||||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
|
||||||
<mat-select matInput placeholder="State" [formControl]="regForm.controls['state']" required (selectionChange)="getcity($event)" >
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let s of State" [value]="s" >
|
|
||||||
{{s.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
<mat-error *ngIf="regForm.controls['state'].hasError('required') && regForm.controls['state'].touched" class="mat-text-warn">State Required.</mat-error>
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
|
||||||
<mat-select matInput placeholder="City" [formControl]="regForm.controls['city']" required>
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let c of City" [value]="c">
|
|
||||||
{{c.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
<mat-error *ngIf="regForm.controls['city'].hasError('required') && regForm.controls['city'].touched" class="mat-text-warn">city Required.</mat-error>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>-->
|
|
||||||
<mat-card>
|
<mat-card>
|
||||||
|
|
||||||
<mat-card-title>Role</mat-card-title><hr/>
|
<mat-card-title>Role</mat-card-title><hr/>
|
||||||
@ -188,8 +108,6 @@
|
|||||||
<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['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<!-- <span *ngIf="roleload"> -->
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '2'">
|
<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-select matInput placeholder="Lender Name" [formControl]="regForm.controls['lenVenName']" required>
|
||||||
<mat-option>--</mat-option>
|
<mat-option>--</mat-option>
|
||||||
@ -212,7 +130,6 @@
|
|||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
<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-select matInput placeholder="Role" (selectionChange)="toggleAllSelection($event,regForm.controls['type'].value)" [formControl]="regForm.controls['role']" required>
|
||||||
<!-- <mat-option #allSelected (click)="toggleAllSelection()" [value]="0">ALL</mat-option> -->
|
|
||||||
<mat-option *ngFor="let role of roles" [value]="role" >
|
<mat-option *ngFor="let role of roles" [value]="role" >
|
||||||
{{role.role_name}}
|
{{role.role_name}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
@ -232,48 +149,16 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
|
||||||
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
|
||||||
<mat-select matInput placeholder="PD Type" [formControl]="regForm.controls['pdtype']" required>
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let PDT of pdType" [value]="PDT">
|
|
||||||
{{PDT.type_name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
|
|
||||||
</mat-form-field>
|
|
||||||
</div>-->
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2" *ngIf="roleAccess">
|
</div>
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" >
|
|
||||||
<mat-select matInput placeholder="Select Customer" [formControl]="regForm.controls['customer']" required (selectionChange)="getcity($event)">
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let C of customerSeg" [value]="C" >
|
|
||||||
{{C.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
|
||||||
<mat-select matInput placeholder="Select Product" [formControl]="regForm.controls['product']" required>
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let P of product" [value]="P">
|
|
||||||
{{P.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
|
|
||||||
</mat-form-field>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<hr>
|
<hr>
|
||||||
<!-- <pre>{{regForm.controls['userid'].value | json}}</pre> -->
|
|
||||||
|
|
||||||
<mat-card-actions style="text-align:right;">
|
<mat-card-actions style="text-align:right;">
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,11 @@
|
|||||||
|
.hoverdp:hover img {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
// .mat-card-title{
|
.hoverdp mat-icon{
|
||||||
|
display:none;
|
||||||
// color: #fff;
|
}
|
||||||
// margin-left: 13px;
|
.hoverdp:hover mat-icon{
|
||||||
// background: rgba(157, 69, 124, 1);
|
display:block;
|
||||||
// box-shadow: 0 4px 20px 0 rgba(157, 69, 124, 1), 0 7px 10px -5px rgba(157, 69, 124, 1);;
|
}
|
||||||
// display: inline-block;
|
|
||||||
// border-radius: 6px;
|
|
||||||
// padding: 10px;
|
|
||||||
// margin-top: -52px;
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ this.loader = true;
|
|||||||
this.AWS.adminUpdateuser(userData, data.record).subscribe(res => {
|
this.AWS.adminUpdateuser(userData, data.record).subscribe(res => {
|
||||||
this.loader =false;
|
this.loader =false;
|
||||||
console.log(res);
|
console.log(res);
|
||||||
Swal('user Created');
|
Swal('User Created');
|
||||||
this.router.navigate(['setting/users/userlist']);
|
this.router.navigate(['setting/users/userlist']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ this.loader = true;
|
|||||||
});}
|
});}
|
||||||
this.users.saveRecords(res,userData).subscribe(res=>{
|
this.users.saveRecords(res,userData).subscribe(res=>{
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
Swal('Update User');
|
Swal('User Updated');
|
||||||
this.router.navigate(['setting/users/userlist']);
|
this.router.navigate(['setting/users/userlist']);
|
||||||
//this.shared.redirectTo('settings/userListing');
|
//this.shared.redirectTo('settings/userListing');
|
||||||
delete this.AWS.localUserId;
|
delete this.AWS.localUserId;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user