master changes : ps
This commit is contained in:
commit
00786e4a93
@ -45,6 +45,7 @@
|
|||||||
"karma-jasmine": "^1.1.1",
|
"karma-jasmine": "^1.1.1",
|
||||||
"leaflet": "^1.0.2",
|
"leaflet": "^1.0.2",
|
||||||
"moment": "^2.15.0",
|
"moment": "^2.15.0",
|
||||||
|
"ng-pick-datetime": "^5.2.6",
|
||||||
"ng2-charts": "1.6.0",
|
"ng2-charts": "1.6.0",
|
||||||
"ng2-dragula": "1.3.1",
|
"ng2-dragula": "1.3.1",
|
||||||
"ng2-file-upload": "1.2.1",
|
"ng2-file-upload": "1.2.1",
|
||||||
|
|||||||
@ -285,9 +285,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
let pd_details:any={
|
let pd_details:any={
|
||||||
"fk_lender_id":formValue.fk_lender_id,
|
"fk_lender_id":formValue.fk_lender_id,
|
||||||
"lender_applicant_id":formValue.lender_applicant_id,
|
"lender_applicant_id":formValue.lender_applicant_id,
|
||||||
"lender_billing_id":formValue.lender_billing,
|
"fk_entity_billing_id":formValue.lender_billing,
|
||||||
"lender_contact_person":formValue.lender_contact_person,
|
"pd_contact_person":formValue.lender_contact_person,
|
||||||
"lender_contact_mobile":formValue.lender_contact_mobile,
|
"pd_contact_mobileno":formValue.lender_contact_mobile,
|
||||||
"fk_product_id":formValue.fk_product_id,
|
"fk_product_id":formValue.fk_product_id,
|
||||||
"fk_subproduct_id":formValue.fk_subproduct_id,
|
"fk_subproduct_id":formValue.fk_subproduct_id,
|
||||||
"fk_pd_type":formValue.fk_pd_type,
|
"fk_pd_type":formValue.fk_pd_type,
|
||||||
|
|||||||
@ -0,0 +1,81 @@
|
|||||||
|
<div style="max-height: 580px; width: 580px;">
|
||||||
|
<div style="text-align: right">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
||||||
|
(click)="closeEditComponent()"><mat-icon>close</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
<form [formGroup]="_EditApplicantForm" (submit)="updatePdApplicant(_EditApplicantForm.value)">
|
||||||
|
|
||||||
|
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||||
|
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
<mat-card class="p-2">
|
||||||
|
<h5>Main Applicant</h5>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Name" formControlName="applicant_name" required>
|
||||||
|
<mat-error *ngIf="pdMainApplicant.applicant_name.hasError('required')">Name is required.</mat-error>
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Email" formControlName="email" type="email" required>
|
||||||
|
<mat-error *ngIf="pdMainApplicant.email.hasError('required')">Email number is required.</mat-error>
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Phone" formControlName="mobile_no" type="text" required>
|
||||||
|
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('required')">Mobile number is required.</mat-error>
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div fxLayout="row" fxLayoutWrap="wrap" formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
|
||||||
|
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
|
||||||
|
<mat-card class="p-2">
|
||||||
|
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5>
|
||||||
|
|
||||||
|
<div [formGroupName]="i">
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required>
|
||||||
|
<!-- <mat-error *ngIf="pdCoApplicant.coapplicantName.hasError('required')">Name is required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Phone" formControlName="coapplicant_mobile_no" type="text">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
|
||||||
|
<mat-select placeholder="Relationship" formControlName="relationship">
|
||||||
|
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
|
||||||
|
{{rel.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||||
|
|
||||||
|
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
<mat-card class="p-2" style="opacity: 0.5;">
|
||||||
|
<button _ngcontent-c39="" class="mr-1 mb-1 mat-button" type="button"><span style="opacity: 0.5;" (click)="addCoApplicant(emptyData)" class="mat-button-wrapper">Add More Co-Applicant</span><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||||
|
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
|
||||||
|
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||||
|
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above"><mat-icon>save</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <notifier-container></notifier-container> -->
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EditPdApplicantComponent } from './edit-pd-applicant.component';
|
||||||
|
|
||||||
|
describe('EditPdApplicantComponent', () => {
|
||||||
|
let component: EditPdApplicantComponent;
|
||||||
|
let fixture: ComponentFixture<EditPdApplicantComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EditPdApplicantComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EditPdApplicantComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
import { Component, OnInit,ViewEncapsulation, Inject } from '@angular/core';
|
||||||
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||||
|
import { CustomValidators } from 'ng2-validation';
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||||
|
@Component({
|
||||||
|
selector: 'app-edit-pd-applicant',
|
||||||
|
templateUrl: './edit-pd-applicant.component.html',
|
||||||
|
styleUrls: ['./edit-pd-applicant.component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
})
|
||||||
|
export class EditPdApplicantComponent implements OnInit {
|
||||||
|
public pageTitle: string = "Edit Applicant";
|
||||||
|
errorMessage: any;
|
||||||
|
public _EditApplicantForm:FormGroup;
|
||||||
|
public notifier: NotifierService;
|
||||||
|
mainApplicantData: any[];
|
||||||
|
coApplicantData: any[];
|
||||||
|
coApplicantItems:FormArray;
|
||||||
|
emptyData:any;
|
||||||
|
relationShipList:any;
|
||||||
|
constructor(private _fb: FormBuilder,
|
||||||
|
private _pd: PdTrigerService, notifier: NotifierService, private dialogRef: MatDialogRef<EditPdApplicantComponent>,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||||
|
this.notifier=notifier
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
if(this.data.records.length>0){
|
||||||
|
this.mainApplicantData= this.data.records.filter(item => item.applicant_type == 1);
|
||||||
|
this.coApplicantData= this.data.records.filter(item => item.applicant_type == 0);
|
||||||
|
this.loadApplicantFormData();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.loadEmptyFormData()
|
||||||
|
}
|
||||||
|
this.getRelationMaster();
|
||||||
|
|
||||||
|
}
|
||||||
|
loadEmptyFormData() {
|
||||||
|
this._EditApplicantForm = this._fb.group({
|
||||||
|
fk_applicant_primary_id: [null],
|
||||||
|
applicant_name: [null, Validators.compose([Validators.required])],
|
||||||
|
mobile_no: [null, Validators.compose([Validators.required])],
|
||||||
|
email: [null, Validators.compose([Validators.required, CustomValidators.email])],
|
||||||
|
applicant_type: [1],
|
||||||
|
coApplicantItems: this._fb.array([]),
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadApplicantFormData() {
|
||||||
|
this._EditApplicantForm = this._fb.group({
|
||||||
|
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
|
||||||
|
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
|
||||||
|
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required])],
|
||||||
|
email: [this.mainApplicantData[0].email, Validators.compose([Validators.required, CustomValidators.email])],
|
||||||
|
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
|
||||||
|
coApplicantItems: this._fb.array([]),
|
||||||
|
});
|
||||||
|
// bind dynamic co applicant data
|
||||||
|
if(this.coApplicantData.length > 0){
|
||||||
|
for(let value of this.coApplicantData){
|
||||||
|
this.addCoApplicant(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
createItem(listData): FormGroup {
|
||||||
|
if(listData){
|
||||||
|
return this._fb.group({
|
||||||
|
label: ['Co Applicant'],
|
||||||
|
fk_applicant_primary_id: [listData.pd_co_applicant_id],
|
||||||
|
coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])],
|
||||||
|
coapplicant_mobile_no: [listData.mobile_no],
|
||||||
|
relationship: [listData.relation],
|
||||||
|
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return this._fb.group({
|
||||||
|
label: ['Co Applicant'],
|
||||||
|
fk_applicant_primary_id: [null],
|
||||||
|
coapplicantName: [null, Validators.compose([Validators.required])],
|
||||||
|
coapplicant_mobile_no: [],
|
||||||
|
relationship: [null],
|
||||||
|
applicant_type: [0],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
addCoApplicant(listData) {
|
||||||
|
if(this._EditApplicantForm.valid){
|
||||||
|
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
|
||||||
|
this.coApplicantItems.push(this.createItem(listData));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
get pdMainApplicant() { return this._EditApplicantForm.controls; }
|
||||||
|
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
|
||||||
|
updatePdApplicant(formValue: any) {
|
||||||
|
if(this._EditApplicantForm.valid){
|
||||||
|
let pd_applicant_details : any=[{
|
||||||
|
"fk_pd_id": this.data.pdID,
|
||||||
|
"pd_co_applicant_id": formValue.fk_applicant_primary_id,
|
||||||
|
"applicant_name":formValue.applicant_name,
|
||||||
|
"email":formValue.email,
|
||||||
|
"mobile_no":formValue.mobile_no,
|
||||||
|
"applicant_type":formValue.applicant_type,
|
||||||
|
"relation":formValue.relationship,
|
||||||
|
"isactive":1
|
||||||
|
}];
|
||||||
|
formValue.coApplicantItems.forEach((itemElement, itemIndex) => {
|
||||||
|
let obj1 = {
|
||||||
|
"fk_pd_id": this.data.pdID,
|
||||||
|
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
|
||||||
|
"applicant_name":itemElement.coapplicantName,
|
||||||
|
"relation":itemElement.relationship,
|
||||||
|
"email":"",
|
||||||
|
"mobile_no":itemElement.coapplicant_mobile_no,
|
||||||
|
"applicant_type":itemElement.applicant_type,
|
||||||
|
"isactive":1
|
||||||
|
}
|
||||||
|
pd_applicant_details.push(obj1)
|
||||||
|
});
|
||||||
|
|
||||||
|
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
|
||||||
|
if (result.status == 200) {
|
||||||
|
this.notifier.notify('success', 'Applicants updated..');
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
}
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get relation master details
|
||||||
|
getRelationMaster(){
|
||||||
|
let relation ="RELATIONSHIPS";
|
||||||
|
this._pd.getAllMasterDatas(relation).subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.relationShipList=data.records;
|
||||||
|
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
/** To Reset Popup Data */
|
||||||
|
onReset() {
|
||||||
|
if(this.data.records.length>0){
|
||||||
|
this.loadApplicantFormData();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.loadEmptyFormData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** For Popup Close Button */
|
||||||
|
closeEditComponent(): void {
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
<div style="max-height: 480px; width: 550px;">
|
||||||
|
<div style="text-align: right">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
||||||
|
(click)="closeEditMasterComponent()"><mat-icon>close</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
<mat-card>
|
||||||
|
<form [formGroup]="_EditPDtriggerForm" (submit)="submitPdDetails(_EditPDtriggerForm.value)">
|
||||||
|
<mat-card-content>
|
||||||
|
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||||
|
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (billingList)="getBillingDetails(pdMain.fk_lender_id.value)">
|
||||||
|
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
|
||||||
|
{{LL.full_name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
|
||||||
|
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<mat-select placeholder="Billing Address" formControlName="fk_enitity__billing_id">
|
||||||
|
<mat-option *ngFor="let billL of billingList" [value]="billL.entity_billing_id" >
|
||||||
|
{{billL.billing_name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_enitity__billing_id.hasError('required')">Billing Address Required</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Contact Person" formControlName="pd_contact_person" type="text" required>
|
||||||
|
<mat-error *ngIf="pdMain.pd_contact_person.hasError('required')">Contact Person Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Contact Number" formControlName="pd_contact_mobileno" type="text" required>
|
||||||
|
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('required')">Contact Number Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
|
||||||
|
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
|
||||||
|
{{PL.product_name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
|
||||||
|
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
|
||||||
|
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
|
||||||
|
{{SPL.subproduct_name}}
|
||||||
|
</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
|
||||||
|
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
|
||||||
|
{{CSL.customer_segment}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
|
||||||
|
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
|
||||||
|
{{PDL.type_name}}
|
||||||
|
</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
|
||||||
|
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<textarea matInput placeholder="Address 1" formControlName="addressline1"></textarea>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<textarea matInput placeholder="Address 2" formControlName="addressline2"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<textarea matInput placeholder="Address 3" formControlName="addressline3"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%;">
|
||||||
|
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
|
||||||
|
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||||
|
{{SL.state_name}}
|
||||||
|
</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%;">
|
||||||
|
<mat-select placeholder="City" formControlName="fk_city">
|
||||||
|
` <mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
|
||||||
|
{{CL.city_name}}
|
||||||
|
</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width: 100%;">
|
||||||
|
<input matInput placeholder="Pincode" formControlName="pincode">
|
||||||
|
<!-- <mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode Required.</mat-error> -->
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
<mat-card-actions style="text-align: right">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
|
||||||
|
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||||
|
</mat-card-actions>
|
||||||
|
</form>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EditPdMasterComponent } from './edit-pd-master.component';
|
||||||
|
|
||||||
|
describe('EditPdMasterComponent', () => {
|
||||||
|
let component: EditPdMasterComponent;
|
||||||
|
let fixture: ComponentFixture<EditPdMasterComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EditPdMasterComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EditPdMasterComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,153 @@
|
|||||||
|
import { Component, OnInit,ViewEncapsulation, Inject } from '@angular/core';
|
||||||
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||||
|
import { CustomValidators } from 'ng2-validation';
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||||
|
@Component({
|
||||||
|
selector: 'app-edit-pd-master',
|
||||||
|
templateUrl: './edit-pd-master.component.html',
|
||||||
|
styleUrls: ['./edit-pd-master.component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class EditPdMasterComponent implements OnInit {
|
||||||
|
public pageTitle: string = "Edit PD Master";
|
||||||
|
errorMessage: any;
|
||||||
|
productList:any;
|
||||||
|
subProductList:any;
|
||||||
|
lenderList:any;
|
||||||
|
customerSegmentList:any;
|
||||||
|
stateList:any;
|
||||||
|
cityList:any;
|
||||||
|
pdTypeList:any;
|
||||||
|
billingList:any;
|
||||||
|
public _EditPDtriggerForm:FormGroup;
|
||||||
|
public notifier: NotifierService;
|
||||||
|
constructor(private _fb: FormBuilder,
|
||||||
|
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||||
|
this.notifier=notifier
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
console.log(this.data)
|
||||||
|
this.getLenderList();
|
||||||
|
this.getProductsList();
|
||||||
|
this.getCustomerSegmentList();
|
||||||
|
this.getStateCityList();
|
||||||
|
this.getPDTypeList();
|
||||||
|
this.loadFormData();
|
||||||
|
}
|
||||||
|
|
||||||
|
getLenderList(){
|
||||||
|
this._pd.getLenderDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.lenderList=data.records
|
||||||
|
if(this.data.fk_lender_id){
|
||||||
|
this.getBillingDetails(this.data.fk_lender_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
getProductsList(){
|
||||||
|
this._pd.getProductsDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.productList=data.records
|
||||||
|
if(this.data.fk_product_id){
|
||||||
|
this.getSubproductList(this.data.fk_product_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
getCustomerSegmentList(){
|
||||||
|
this._pd.getCustomersDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.customerSegmentList=data.records
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
getStateCityList(){
|
||||||
|
this._pd.getStateCityDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.stateList=data.records
|
||||||
|
if(this.data.fk_state){
|
||||||
|
this.getCityList(this.data.fk_state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
getPDTypeList(){
|
||||||
|
this._pd.getPDTypeDetails().subscribe(
|
||||||
|
data => {
|
||||||
|
if (data.status == 200) {
|
||||||
|
this.pdTypeList=data.records.pd_type;
|
||||||
|
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
|
}
|
||||||
|
|
||||||
|
loadFormData() {
|
||||||
|
this._EditPDtriggerForm = this._fb.group({
|
||||||
|
fk_primary_id: [this.data.pd_id],
|
||||||
|
fk_lender_id: [this.data.fk_lender_id, Validators.compose([Validators.required])],
|
||||||
|
lender_applicant_id: [this.data.lender_applicant_id, Validators.compose([Validators.required])],
|
||||||
|
pd_contact_person: [this.data.pd_contact_person, Validators.compose([Validators.required])],
|
||||||
|
pd_contact_mobileno: [this.data.pd_contact_mobileno, Validators.compose([Validators.required])],
|
||||||
|
fk_enitity_billing_id: [this.data.fk_enitity_billing_id],
|
||||||
|
fk_product_id: [this.data.fk_product_id],
|
||||||
|
fk_subproduct_id: [this.data.fk_subproduct_id],
|
||||||
|
fk_pd_type: [this.data.fk_pd_type],
|
||||||
|
fk_customer_segment: [this.data.fk_customer_segment],
|
||||||
|
loan_amount: [this.data.loan_amount],
|
||||||
|
addressline1: [this.data.addressline1],
|
||||||
|
addressline2: [this.data.addressline2],
|
||||||
|
addressline3: [this.data.addressline3],
|
||||||
|
fk_city: [this.data.fk_city],
|
||||||
|
fk_state: [this.data.fk_state],
|
||||||
|
pincode : [this.data.pincode],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
get pdMain() { return this._EditPDtriggerForm.controls; }
|
||||||
|
|
||||||
|
//get sub product list based on prokduct id
|
||||||
|
getSubproductList(productID:string){
|
||||||
|
|
||||||
|
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||||
|
this.subProductList=this.subProductList[0].subproducts;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get city list details based on state id
|
||||||
|
getCityList(stateID:string){
|
||||||
|
this.cityList= this.stateList.filter(item => item.state_id == stateID);
|
||||||
|
this.cityList=this.cityList[0].cities;
|
||||||
|
}
|
||||||
|
// lendor billing address
|
||||||
|
getBillingDetails(lendorID:string){
|
||||||
|
console.log(lendorID)
|
||||||
|
// this.billingList= this.lenderList.filter(item => item.fk_entity_id == lendorID);
|
||||||
|
// this.billingList=this.billingList[0].billing_address;
|
||||||
|
}
|
||||||
|
submitPdDetails(formValue: any) {
|
||||||
|
if(this._EditPDtriggerForm.valid){
|
||||||
|
let my_array = this._EditPDtriggerForm.value;
|
||||||
|
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||||
|
this._pd.editPdMasterDetails(my_array).subscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** To Reset Popup Data */
|
||||||
|
onReset() {
|
||||||
|
this.loadFormData();
|
||||||
|
}
|
||||||
|
/** For Popup Close Button */
|
||||||
|
closeEditMasterComponent(): void {
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
|
<div fxLayout="row" *ngIf="viewPdList" fxLayoutAlign="start center" class="filter-header">
|
||||||
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;">
|
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;">
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
||||||
@ -20,10 +20,10 @@
|
|||||||
<mat-list-item *ngFor="let details of dataSource.connect() | async">
|
<mat-list-item *ngFor="let details of dataSource.connect() | async">
|
||||||
<img mat-list-avatar src="assets/images/lime.jpg" alt="">
|
<img mat-list-avatar src="assets/images/lime.jpg" alt="">
|
||||||
<!-- {{details.applicat_details[0].applicant_name}} -->
|
<!-- {{details.applicat_details[0].applicant_name}} -->
|
||||||
<p mat-line>{{details.applicat_details[0].applicant_name}} </p>
|
<p *ngIf="details.applicat_details" mat-line>{{details.applicat_details[0].applicant_name}} </p>
|
||||||
|
|
||||||
<p mat-line><a style="padding-right: 7%;">{{details.lender_full_name}} </a><a style="padding-right: 7%">{{details.lender_applicant_id}}</a>{{details.pd_date_of_initiation}}</p>
|
<p *ngIf="details.lender_full_name" mat-line><a style="padding-right: 7%;">{{details.lender_full_name}} </a><a style="padding-right: 7%">{{details.lender_applicant_id}}</a>{{details.pd_date_of_initiation}}</p>
|
||||||
<p mat-line><a style="padding-right: 7%;">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</a><a style="padding-right: 7%;"><span class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></a><span class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span></p>
|
<p *ngIf="details.product_abbr" mat-line><a style="padding-right: 7%;">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</a><a style="padding-right: 7%;"><span *ngIf="details.loan_amount" class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></a><span class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span></p>
|
||||||
<!-- <span class="text-mat mat-text-muted">Chennai</span> -->
|
<!-- <span class="text-mat mat-text-muted">Chennai</span> -->
|
||||||
|
|
||||||
<!-- <div class="comment-time">
|
<!-- <div class="comment-time">
|
||||||
|
|||||||
@ -33,14 +33,17 @@
|
|||||||
</mat-expansion-panel> -->
|
</mat-expansion-panel> -->
|
||||||
<mat-card [style.overflow]="'auto'" [style.height.px]="'500'" *ngIf="pdList.length > 0">
|
<mat-card [style.overflow]="'auto'" [style.height.px]="'500'" *ngIf="pdList.length > 0">
|
||||||
<mat-card class="mb-2" *ngFor="let details of dataSource.connect() | async">
|
<mat-card class="mb-2" *ngFor="let details of dataSource.connect() | async">
|
||||||
<mat-card-title>{{details.applicat_details[0].applicant_name}}</mat-card-title>
|
<mat-card-title *ngIf="details.applicat_details">{{details.applicat_details[0].applicant_name}}</mat-card-title>
|
||||||
<mat-card-subtitle><p class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i>{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</p>
|
<mat-card-subtitle ><p class="hover-icon"><i *ngIf="details.city_name" class="fa-1x fa fa-map-marker"> </i>{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</p>
|
||||||
<p>{{details.lender_full_name}}({{details.lender_applicant_id}})</p>
|
<p>{{details.lender_full_name}}({{details.lender_applicant_id}})</p>
|
||||||
<p>{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</p>
|
<p *ngIf="details.product_abbr">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</p>
|
||||||
<p>{{details.pd_date_of_initiation}} <span style="padding-left: 4%;" class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></p>
|
<p>{{details.pd_date_of_initiation}} <span *ngIf="details.loan_amount" style="padding-left: 4%;" class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></p>
|
||||||
</mat-card-subtitle>
|
</mat-card-subtitle>
|
||||||
<mat-card-actions>
|
<mat-card-actions>
|
||||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(details)"><mat-icon>directions_run</mat-icon></button>
|
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(details)"><mat-icon>directions_run</mat-icon></button>
|
||||||
|
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(details)"><mat-icon>schedule</mat-icon></button>
|
||||||
|
|
||||||
|
|
||||||
<!-- <button mat-button>Cancel</button> -->
|
<!-- <button mat-button>Cancel</button> -->
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|||||||
@ -8,6 +8,8 @@ import { GetGeometricLocationService } from '../../../location-service/get-geome
|
|||||||
import { ListPdComponent } from '../list-pd.component';
|
import { ListPdComponent } from '../list-pd.component';
|
||||||
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
|
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
|
||||||
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
|
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
|
||||||
|
import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-map-pd-view',
|
selector: 'app-map-pd-view',
|
||||||
templateUrl: './map-pd-view.component.html',
|
templateUrl: './map-pd-view.component.html',
|
||||||
@ -66,7 +68,8 @@ pdList:any[] = [];
|
|||||||
|
|
||||||
getMapViewLocations(getData:any){
|
getMapViewLocations(getData:any){
|
||||||
getData.forEach(element => {
|
getData.forEach(element => {
|
||||||
this._geolocation.findLocations(element.addressline1,element.pincode,element.state_name,element.city_name)
|
if(element.addressline1 && element.pincode && element.state_name && element.city_name){
|
||||||
|
this._geolocation.findLocations(element.addressline1,element.pincode,element.state_name,element.city_name)
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
if (response.status == 'OK') {
|
if (response.status == 'OK') {
|
||||||
this.lat = response.results[0].geometry.location.lat;
|
this.lat = response.results[0].geometry.location.lat;
|
||||||
@ -79,6 +82,8 @@ pdList:any[] = [];
|
|||||||
// console.log('geocodingAPIService', 'Other error', response.status);
|
// console.log('geocodingAPIService', 'Other error', response.status);
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -120,6 +125,20 @@ pdList:any[] = [];
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pd schedule details
|
||||||
|
scheduleDetails(pdData:any){
|
||||||
|
|
||||||
|
const dialogSchedule = this.dialog.open(SchedulePdComponent, {
|
||||||
|
data: pdData,
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogSchedule.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||||
|
this.loadPdDetails();
|
||||||
|
});
|
||||||
|
}
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.ListPdComponent.showListView(true);
|
this.ListPdComponent.showListView(true);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,53 @@
|
|||||||
|
|
||||||
|
<div style="max-height: 480px; width: 550px;">
|
||||||
|
|
||||||
|
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
|
||||||
|
<owl-date-time-inline [min]="min" [pickerType]="'calendar'" [(ngModel)]="selectedMoment"></owl-date-time-inline>
|
||||||
|
</div>
|
||||||
|
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
|
||||||
|
<mat-list style="margin-top: 20%;">
|
||||||
|
<!-- <mat-list-item>
|
||||||
|
<p>{{selectedMoment | date}}</p>
|
||||||
|
</mat-list-item> -->
|
||||||
|
<mat-list-item>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Time" [formControl]="scheduleControl" required>
|
||||||
|
<mat-option *ngFor="let times of timeDetails" [value]="times.objectValue">
|
||||||
|
{{times.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<mat-error *ngIf="scheduleControl.hasError('required')">Please Choose Time</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-list-item>
|
||||||
|
</mat-list>
|
||||||
|
<mat-list style="padding-top: 15%;">
|
||||||
|
<mat-list-item>
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeScheduleComponent()"><mat-icon>close</mat-icon></button>
|
||||||
|
<button mat-raised-button [disabled]="scheduleControl.invalid" mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="upatePDSchedule(selectedMoment,scheduleControl.value)"><mat-icon>save</mat-icon></button>
|
||||||
|
</mat-list-item>
|
||||||
|
</mat-list>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <mat-card style="width: 580px; padding: 2px;">
|
||||||
|
<mat-card-header>
|
||||||
|
<mat-card-title>{{pageTitle}}</mat-card-title>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content>
|
||||||
|
<input [owlDateTime]="dt1" [owlDateTimeTrigger]="dt1" placeholder="Date Time">
|
||||||
|
<owl-date-time #dt1></owl-date-time>
|
||||||
|
<input [owlDateTime]="dt2" placeholder="Date Time">
|
||||||
|
<span [owlDateTimeTrigger]="dt2"><i class="fa fa-calendar"></i></span>
|
||||||
|
<owl-date-time #dt2></owl-date-time>
|
||||||
|
<owl-date-time-inline [(ngModel)]="selectedMoment"></owl-date-time-inline>
|
||||||
|
</mat-card-content>
|
||||||
|
<mat-card-actions>
|
||||||
|
<div style="text-align:right;">
|
||||||
|
<button mat-raised-button mat-icon-button (click)="updatePdOfficer(selectedItem)" class="mr-1 mb-1 hover-icon" type="button"><mat-icon>save</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
</mat-card-actions>
|
||||||
|
</mat-card> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<notifier-container></notifier-container>
|
||||||
|
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SchedulePdComponent } from './schedule-pd.component';
|
||||||
|
|
||||||
|
describe('SchedulePdComponent', () => {
|
||||||
|
let component: SchedulePdComponent;
|
||||||
|
let fixture: ComponentFixture<SchedulePdComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ SchedulePdComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SchedulePdComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,102 @@
|
|||||||
|
import { Component, OnInit, Inject, Pipe, PipeTransform } from '@angular/core';
|
||||||
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
export interface Timeslot {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
objectValue: string
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-schedule-pd',
|
||||||
|
templateUrl: './schedule-pd.component.html',
|
||||||
|
styleUrls: ['./schedule-pd.component.scss']
|
||||||
|
})
|
||||||
|
export class SchedulePdComponent implements OnInit {
|
||||||
|
public pageTitle: string = "PD Schedule";
|
||||||
|
pipe = new DatePipe('en-US');
|
||||||
|
public selectedMoment = new Date();
|
||||||
|
errorMessage: any;
|
||||||
|
notifier : NotifierService;
|
||||||
|
scheduleControl = new FormControl('', [Validators.required]);
|
||||||
|
timeDetails: Timeslot[] = [
|
||||||
|
{id: '1', name: '06:00 AM', objectValue:'06:00:00'},
|
||||||
|
{id: '2', name: '06:30 AM', objectValue:'06:30:00'},
|
||||||
|
{id: '3', name: '07:00 AM', objectValue:'07:00:00'},
|
||||||
|
{id: '4', name: '07:30 AM', objectValue:'07:30:00'},
|
||||||
|
{id: '5', name: '08:00 AM', objectValue:'08:00:00'},
|
||||||
|
{id: '6', name: '08:30 AM', objectValue:'08:30:00'},
|
||||||
|
{id: '7', name: '09:00 AM', objectValue:'09:00:00'},
|
||||||
|
{id: '8', name: '09:30 AM', objectValue:'09:30:00'},
|
||||||
|
{id: '9', name: '10:00 AM', objectValue:'10:00:00'},
|
||||||
|
{id: '10', name: '10:30 AM', objectValue:'10:30:00'},
|
||||||
|
{id: '11', name: '11:00 AM', objectValue:'11:00:00'},
|
||||||
|
{id: '12', name: '11:30 AM', objectValue:'11:30:00'},
|
||||||
|
{id: '13', name: '12:00 PM', objectValue:'12:00:00'},
|
||||||
|
{id: '14', name: '12:30 PM', objectValue:'12:30:00'},
|
||||||
|
{id: '15', name: '01:00 PM', objectValue:'13:00:00'},
|
||||||
|
{id: '16', name: '01:30 PM', objectValue:'13:30:00'},
|
||||||
|
{id: '17', name: '02:00 PM', objectValue:'14:00:00'},
|
||||||
|
{id: '18', name: '02:30 PM', objectValue:'14:30:00'},
|
||||||
|
{id: '19', name: '03:00 PM', objectValue:'15:00:00'},
|
||||||
|
{id: '20', name: '03:30 PM', objectValue:'15:30:00'},
|
||||||
|
{id: '21', name: '04:00 PM', objectValue:'16:00:00'},
|
||||||
|
{id: '22', name: '04:30 PM', objectValue:'16:30:00'},
|
||||||
|
{id: '23', name: '05.00 PM', objectValue:'17:00:00'},
|
||||||
|
{id: '24', name: '05:30 PM', objectValue:'17:30:00'},
|
||||||
|
{id: '25', name: '06:00 PM', objectValue:'18:00:00'},
|
||||||
|
{id: '26', name: '06:30 PM', objectValue:'18:30:00'},
|
||||||
|
{id: '27', name: '07:00 PM', objectValue:'19:00:00'},
|
||||||
|
{id: '28', name: '07:30 PM', objectValue:'19:30:00'},
|
||||||
|
{id: '29', name: '08:00 PM', objectValue:'20:00:00'},
|
||||||
|
|
||||||
|
];
|
||||||
|
public min = new Date();
|
||||||
|
constructor(notifier: NotifierService, private dialogRef: MatDialogRef<SchedulePdComponent>,
|
||||||
|
private _pd: PdTrigerService,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||||
|
this.notifier=notifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// close pd schedule pop up
|
||||||
|
closeScheduleComponent(): void {
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
// update pd schedule
|
||||||
|
|
||||||
|
upatePDSchedule(date:any,time:string){
|
||||||
|
let myFormattedDate = this.pipe.transform(date, 'yyyy-MM-dd');
|
||||||
|
if(!this.scheduleControl.valid){
|
||||||
|
this.notifier.notify('warning', 'Please Choose Schedule Date/Time.!');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let updateData = {
|
||||||
|
"fk_pd_id":this.data.pd_id,
|
||||||
|
"schedule_time":myFormattedDate +' '+ time,
|
||||||
|
}
|
||||||
|
this._pd.updateSchedule(updateData).subscribe(
|
||||||
|
result => {
|
||||||
|
if (result.status == 200) {
|
||||||
|
this.notifier.notify('success', 'PD Scheduled.!');
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
this.errorMessage = "Something Wents Wrong Try Again.!";
|
||||||
|
}
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
|
||||||
|
this.dialogRef.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -11,25 +11,25 @@
|
|||||||
<!--pd master -->
|
<!--pd master -->
|
||||||
<mat-card *ngFor="let master of pdMasterData">
|
<mat-card *ngFor="let master of pdMasterData">
|
||||||
<div class="cardEdit">
|
<div class="cardEdit">
|
||||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
<button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
||||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button"><mat-icon>schedule</mat-icon></button>
|
<button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
|
||||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
|
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<img mat-card-avatar src="assets/images/avatar.jpg">
|
<img mat-card-avatar src="assets/images/avatar.jpg">
|
||||||
<mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}}
|
<mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}}
|
||||||
</mat-card-title>
|
</mat-card-title>
|
||||||
<mat-card-subtitle class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> <span>{{master.city_name}} / {{master.state_name}}-{{master.pincode}}</span></mat-card-subtitle>
|
<mat-card-subtitle *ngIf="master.city_name" class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> <span>{{master.city_name}} / {{master.state_name}}-{{master.pincode}}</span></mat-card-subtitle>
|
||||||
|
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<p>{{master.product_name}} / {{master.subproduct_name}}</p>
|
<p *ngIf="master.product_name">{{master.product_name}} / {{master.subproduct_name}}</p>
|
||||||
<p><span>{{master.pd_type_name}} {{master.pd_allocated_to}}</span></p>
|
<p *ngIf="master.pd_type_name"><span>{{master.pd_type_name}} {{master.pd_allocated_to}}</span></p>
|
||||||
<p><span>{{master.addressline1}}</span></p>
|
<p><span>{{master.addressline1}}</span></p>
|
||||||
<p><span>{{master.addressline2}}</span></p>
|
<p><span>{{master.addressline2}}</span></p>
|
||||||
<p><span>{{master.addressline3}}</span></p>
|
<p><span>{{master.addressline3}}</span></p>
|
||||||
|
|
||||||
<p><span class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{master.loan_amount}}</span> <span>{{master.pd_status_name}}</span> <span>{{master.pd_date_of_initiation}}</span></p>
|
<p><span *ngIf="master.loan_amount" class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{master.loan_amount}}</span> <span>{{master.pd_status_name}}</span> <span>{{master.pd_date_of_initiation}}</span></p>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
@ -45,27 +45,30 @@
|
|||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<mat-card-title>Applicants</mat-card-title>
|
<mat-card-title>Applicants</mat-card-title>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
|
||||||
<mat-list *ngFor="let applicant of pdApplicantData">
|
<mat-card-content *ngIf="pdApplicantData.length>0; else noApplicant">
|
||||||
|
<mat-list *ngFor="let applicant of pdApplicantData">
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
|
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
|
||||||
<i class="fa-1x fa fa-user-o"></i>
|
<i class="fa-1x fa fa-user-o"></i>
|
||||||
{{applicant.applicant_name}} </span> <span *ngIf="applicant.mobile_no!=null" class="mb-2 text-center hover-icon">
|
{{applicant.applicant_name}} </span> <span *ngIf="applicant.mobile_no!=null" class="mb-2 text-center hover-icon">
|
||||||
<i class="fa-1x fa fa-phone"></i>
|
<i class="fa-1x fa fa-phone"></i>
|
||||||
{{applicant.mobile_no}} </span> <span *ngIf="applicant.applicant_type=='1';else codetails"> Main Applicant</span>
|
{{applicant.mobile_no}} </span> <span *ngIf="applicant.applicant_type=='1';else codetails"> Main Applicant</span>
|
||||||
<ng-template #codetails> <span>{{applicant.relation}}</span></ng-template>
|
<ng-template #codetails> <span>{{applicant.relation_name}}</span></ng-template>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
</mat-list>
|
</mat-list>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
|
<ng-template #noApplicant><mat-card-content><p>No Applicants</p></mat-card-content></ng-template>
|
||||||
|
|
||||||
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div fxLayout="row">
|
<div fxLayout="row">
|
||||||
|
|||||||
@ -7,6 +7,10 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
|||||||
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
|
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
|
||||||
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
|
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
|
||||||
import { ListPdComponent } from '../list-pd.component';
|
import { ListPdComponent } from '../list-pd.component';
|
||||||
|
import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
|
||||||
|
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
|
||||||
|
import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-pd',
|
selector: 'app-view-pd',
|
||||||
templateUrl: './view-pd.component.html',
|
templateUrl: './view-pd.component.html',
|
||||||
@ -14,13 +18,13 @@ import { ListPdComponent } from '../list-pd.component';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class ViewPdComponent implements OnInit, OnDestroy {
|
export class ViewPdComponent implements OnInit, OnDestroy {
|
||||||
|
public selectedMoment = new Date();
|
||||||
private notifier:NotifierService;
|
private notifier:NotifierService;
|
||||||
errorMessage: any;
|
errorMessage: any;
|
||||||
pdMasterData: any;
|
pdMasterData: any=[];
|
||||||
pdApplicantData: any;
|
pdApplicantData: any=[];
|
||||||
pdDocumentsData: any;
|
pdDocumentsData: any=[];
|
||||||
pdLogsData: any;
|
pdLogsData: any=[];
|
||||||
viewID:string;
|
viewID:string;
|
||||||
viewParams:any;
|
viewParams:any;
|
||||||
// @Input() childData: string;
|
// @Input() childData: string;
|
||||||
@ -57,10 +61,31 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editPdMaster(masterData:any){
|
editPdMaster(masterData:any){
|
||||||
|
|
||||||
|
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
|
||||||
|
data: masterData,
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogPDMaster.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||||
|
this.viewPdDetails(this.viewID)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
editPdApplicant(applicantData:any){
|
editPdApplicant(applicantData:any){
|
||||||
|
let setPdDetails = {
|
||||||
|
"pdID":this.viewID,
|
||||||
|
"records":applicantData
|
||||||
|
}
|
||||||
|
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
|
||||||
|
data: setPdDetails,
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogApplicant.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||||
|
this.viewPdDetails(this.viewID)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// pd allocation to
|
// pd allocation to
|
||||||
pdAllocationTo(pdData:any) {
|
pdAllocationTo(pdData:any) {
|
||||||
@ -76,7 +101,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(pdData.fk_pd_type == 2){
|
else if(pdData.fk_pd_type == 2){
|
||||||
const dialogRef = this.dialog.open(SmartPdAllocationComponent, {
|
const dialogRef = this.dialog.open(PdAllocationComponent, {
|
||||||
data: pdData,
|
data: pdData,
|
||||||
disableClose: true
|
disableClose: true
|
||||||
});
|
});
|
||||||
@ -91,6 +116,20 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pd schedule details
|
||||||
|
scheduleDetails(pdData:any){
|
||||||
|
|
||||||
|
const dialogSchedule = this.dialog.open(SchedulePdComponent, {
|
||||||
|
data: pdData,
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
dialogSchedule.afterClosed()
|
||||||
|
.subscribe(dataresult => {
|
||||||
|
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||||
|
this.viewPdDetails(this.viewID)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// updateViewComponent(editBack:string) {
|
// updateViewComponent(editBack:string) {
|
||||||
|
|
||||||
// if(editBack=='1'){
|
// if(editBack=='1'){
|
||||||
|
|||||||
@ -30,7 +30,10 @@ import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-all
|
|||||||
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 { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
|
||||||
|
import { SchedulePdComponent } from './list-pd/schedule-pd/schedule-pd.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';
|
||||||
/**
|
/**
|
||||||
* Custom angular notifier options
|
* Custom angular notifier options
|
||||||
*/
|
*/
|
||||||
@ -97,10 +100,11 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
TreeModule,
|
TreeModule,
|
||||||
MatDialogModule,MatSortModule,
|
MatDialogModule,MatSortModule,
|
||||||
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
||||||
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),
|
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
|
||||||
|
OwlNativeDateTimeModule,
|
||||||
],
|
],
|
||||||
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent],
|
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent],
|
||||||
providers: [PdTrigerService, GetGeometricLocationService],
|
providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent]
|
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent]
|
||||||
})
|
})
|
||||||
export class ManagePdModule { }
|
export class ManagePdModule { }
|
||||||
|
|||||||
@ -141,6 +141,15 @@ export class PdTrigerService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update pd schedule
|
||||||
|
updateSchedule(updateData: any): Observable<any> {
|
||||||
|
updateData.fk_scheduled_by = this._aws.getlocale();
|
||||||
|
updateData.createdon = currentdate;
|
||||||
|
return this._http.post<any>(this.apiUrl+"schdulePD",{"records":updateData})
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('operation', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
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);
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="category_name">
|
<ng-container matColumnDef="category_name">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Question Category Name </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Category </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"> {{row.category_name}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.category_name}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@ -47,4 +47,7 @@ Author: TrendSetter Themes
|
|||||||
|
|
||||||
|
|
||||||
/* Add application styles & imports to this file! */
|
/* Add application styles & imports to this file! */
|
||||||
@import "~angular-notifier/styles";
|
@import "~angular-notifier/styles";
|
||||||
|
|
||||||
|
// import date time picker styles
|
||||||
|
@import "~ng-pick-datetime/assets/style/picker.min.css";
|
||||||
Loading…
Reference in New Issue
Block a user