diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts index 648ef999c..a8fca707a 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts @@ -10,7 +10,7 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service'; styleUrls: ['./pd-allocation.component.scss'] }) export class PdAllocationComponent implements OnInit { - public pageTitle: string = "PD Allocation To"; + public pageTitle: string = "Allocation To PD Officer"; public _pdAllocationForm: FormGroup; public pdOfficerList: any = []; errorMessage: any; @@ -43,9 +43,8 @@ export class PdAllocationComponent implements OnInit { this._pd.getPdOfficerList(pdID).subscribe( data => { if (data.status == 200) { - this.pdOfficerList= data.records.filter(item => item.fk_pd_type_id != 2); + this.pdOfficerList= data.records.pdofficers.filter(item => item.fk_pd_type_id == 1); - } }, error => this.errorMessage = error); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html index 7e88d465b..f5ae7e2bf 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html @@ -11,9 +11,9 @@ -
+
-
+
- +

No central officer available.

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts index 2f5f0a433..ccd61b41e 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts @@ -14,7 +14,8 @@ export class SmartPdAllocationComponent implements OnInit { public pageTitle: string = "Allocate To Executive"; public pageTitle2: string = "Allocate To Central Officer"; public _pdAllocationForm: FormGroup; - public pdOfficerList: any = []; + //public pdOfficerList: any = []; + public pdCentralOfficerList: any = []; public pdExcutiveList: any = []; errorMessage: any; notifier : NotifierService; @@ -34,34 +35,6 @@ export class SmartPdAllocationComponent implements OnInit { ngOnInit() { this.showFirstCard=true; -// this.pdExcutiveList=[ -// { -// "first_name": "Ramya", -// "allocated": "4", -// "scheduled":"2", -// "inprogress":"0", -// }, -// { -// "first_name": "Sri Vidhya", -// "allocated": "5", -// "scheduled":"3", -// "inprogress":"2", -// }, -// ] -// this.pdOfficerList=[ -// { -// "first_name": "Moorthy", -// "allocated": "4", -// "scheduled":"2", -// "inprogress":"0", -// }, -// { -// "first_name": "Priya", -// "allocated": "5", -// "scheduled":"3", -// "inprogress":"2", -// }, -// ] this.isDisabled=true; this.getPDOfficerList(this.data.pd_id); } @@ -71,8 +44,8 @@ export class SmartPdAllocationComponent implements OnInit { this._pd.getPdOfficerList(pdID).subscribe( data => { if (data.status == 200) { - this.pdOfficerList= data.records.filter(item => item.fk_pd_type_id != 2); - this.pdExcutiveList= data.records.filter(item => item.fk_pd_type_id == 2); + this.pdCentralOfficerList= data.records.centralpdofficers; + this.pdExcutiveList= data.records.pdofficers.filter(item => item.fk_pd_type_id == 2); } }, error => this.errorMessage = error); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.html new file mode 100644 index 000000000..125066e83 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.html @@ -0,0 +1,51 @@ +
+
+ + +
+ + + {{pageTitle}} + + + + + +
+
+
+ + + + No Image
+ {{officer.first_name}} +
+ {{officer.mobile_no}}
+ PD in hand - {{officer.count}} +
+
+
+
+ + +
+ + +

No central pd officer available.

+
+
+ + +
+ +
+ +
+
+
+
+ + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.scss new file mode 100644 index 000000000..6e263adae --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.scss @@ -0,0 +1,3 @@ +.example-full-width{ + width: 100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.spec.ts new file mode 100644 index 000000000..4ff90d423 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TelePdAllocationComponent } from './tele-pd-allocation.component'; + +describe('TelePdAllocationComponent', () => { + let component: TelePdAllocationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TelePdAllocationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TelePdAllocationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.ts new file mode 100644 index 000000000..082d80ac2 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.ts @@ -0,0 +1,84 @@ +import { Component, OnInit, Inject } 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'; + +@Component({ + selector: 'app-tele-pd-allocation', + templateUrl: './tele-pd-allocation.component.html', + styleUrls: ['./tele-pd-allocation.component.scss'] +}) +export class TelePdAllocationComponent implements OnInit { + public pageTitle: string = "Allocate To Central Officer"; + public _pdAllocationForm: FormGroup; + public pdCentralOfficerList: any = []; + errorMessage: any; + notifier : NotifierService; + selectedItem:any; + isDisabled: boolean; + constructor( notifier: NotifierService, + private _fb: FormBuilder, + private dialogRef: MatDialogRef, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier=notifier; + } + + ngOnInit() { + this.isDisabled=true; + this.getPDOfficerList(this.data.pd_id); + + } + +// pd officer list + getPDOfficerList(pdID:string){ + this._pd.getPdOfficerList(pdID).subscribe( + data => { + if (data.status == 200) { + this.pdCentralOfficerList= data.records.centralpdofficers; + + } + }, error => this.errorMessage = error); + + } + // select pd officer list + selectPdOfficer(selected:any){ + this.isDisabled=false; + this.selectedItem=selected; + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + } + /** To update pd officer*/ + updatePdOfficer(allocateDate:any) { + if(this.isDisabled){ + this.notifier.notify('warning', 'Please Choose PD Officer.!'); + } + else { + let updateData = { + "pd_id":this.data.pd_id, + "fk_pd_allocated_to":allocateDate.fk_user_id, + } + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Allocated.!'); + 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(); + }); + } + } +/** For Popup Close Button */ + closeAllocationComponent(): void { + this.dialogRef.close(); + } +} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 34a139eee..0f38ac44e 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -6,6 +6,7 @@ import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component'; +import { TelePdAllocationComponent } from './../tele-pd-allocation/tele-pd-allocation.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'; @@ -110,7 +111,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { } // pd allocation to pdAllocationTo(pdData:any) { - if(pdData.fk_pd_type != 2){ + if(pdData.fk_pd_type == 1){ const dialogRef = this.dialog.open(PdAllocationComponent, { data: pdData, disableClose: true @@ -133,6 +134,18 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.viewPdDetails(this.viewID) }); } + else if(pdData.fk_pd_type == 3){ + const dialogRef = this.dialog.open(TelePdAllocationComponent, { + data: pdData, + disableClose: true, + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + + this.viewPdDetails(this.viewID) + }); + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index d23e0e2fb..3942b2bd3 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -55,6 +55,7 @@ import { AssetsInfoComponent } from './list-pd/start-pd/forms/assets-info/assets 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"; +import { TelePdAllocationComponent } from './list-pd/tele-pd-allocation/tele-pd-allocation.component'; /** * Custom angular notifier options @@ -128,7 +129,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // 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], + 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, TelePdAllocationComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], // entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent], @@ -160,7 +161,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // 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], providers: [PdTrigerService, GetGeometricLocationService], - entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent] + entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent] }) export class ManagePdModule { }