From f339d46ebe0141f202434f2e22ad884fcfc8988c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 28 Nov 2018 13:45:04 +0530 Subject: [PATCH] smar and tele pd view more officres list change --- .../pd-allocation.component.html | 2 +- .../smart-pd-allocation.component.html | 211 ++++++++---------- .../smart-pd-allocation.component.scss | 14 ++ .../smart-pd-allocation.component.ts | 65 ++++-- .../tele-pd-allocation.component.html | 108 +++++---- .../tele-pd-allocation.component.scss | 11 + .../tele-pd-allocation.component.ts | 37 ++- .../list-pd/view-pd/view-pd.component.ts | 4 + .../qc-list/qc-view/qc-view.component.ts | 4 + 9 files changed, 258 insertions(+), 198 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html index ef714550f..c41ba5c4a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html @@ -47,7 +47,7 @@
-

Currently Selected: {{selectedItem.first_name}}

+

PD Officer: {{selectedItem.first_name}}

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 b5711e5a9..e1407f0f5 100755 --- 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 @@ -1,121 +1,102 @@ -
-
- - -
- - - - {{pageTitle}} - - - - -
-
-
- - - - - - No Image
- {{officer.first_name}} -
- {{officer.mobile_no}}
- PD in hand - {{officer.count}} -
-
-
-
-
- - -

No executive available.

-
-
+

+
+ {{pageTitle}} +
+
+ - - - -
- +
+ +

+ + + +
+ + + +
+
+
+ + {{officer.first_name}} + +
+
+ {{officer.mobile_no}} +
+
+ PD in hand - {{officer.count}} + +
+
+ +
+ +
+ +
+ + +

No central officer available.

+
+
+
+ + +
+ + +
+
+
+ + {{excutive.first_name}} + +
+
+ {{excutive.mobile_no}} +
+
+ PD in hand - {{excutive.count}} + +
+
+ +
+ +
+ +
+ + +

No executive available.

+
+
+
+ -
- - - - - {{pageTitle2}} - - - -
-
-
- - - - No Image
- {{excutive.first_name}} -
- {{excutive.mobile_no}}
- PD in hand - {{excutive.count}} -
-
-
-
-
- - - -

No central officer available.

-
-
- - - -
- -
- - - -
-
-
-
- + + + + + +
+

Central Officer: {{selectedCentralItem.first_name}}

+

Executive: {{selectedExcutiveItem.first_name}}

+
+
+ + + +
+ +
+ + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss index e69de29bb..de092b6a6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss @@ -0,0 +1,14 @@ +.example-full-width{ + width: 100%; +} +.view_more { + cursor: pointer; + color: #e00201 !important; + // text-decoration-line: underline; + // text-decoration-style: dotted; + // font-weight: bold; + +} +.text_change { + color: #e00201 !important; +} \ No newline at end of file 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 37f09a2ff..f07e95c76 100755 --- 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 @@ -1,8 +1,9 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MatDialog, 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 { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component'; @Component({ selector: 'app-smart-pd-allocation', @@ -11,22 +12,22 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service'; }) export class SmartPdAllocationComponent implements OnInit { - public pageTitle2: string = "Allocate To Executive"; public pageTitle: string = "Allocate To Central Officer"; public _pdAllocationForm: FormGroup; - //public pdOfficerList: any = []; public pdCentralOfficerList: any = []; public pdExcutiveList: any = []; errorMessage: any; notifier : NotifierService; - selectedItem:any=[]; - selectedItem1:any=[]; - isDisabled: boolean; + // isDisabled: boolean; showFirstCard: boolean; showSecondCard: boolean; + selectedCentralItem: any; + selectedExcutiveItem: any; + checkFirstItem:string =''; + checkSecondItem:string =''; constructor( notifier: NotifierService, - private _fb: FormBuilder, + private _fb: FormBuilder, private dialog: MatDialog, private dialogRef: MatDialogRef, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any) { @@ -35,7 +36,7 @@ export class SmartPdAllocationComponent implements OnInit { ngOnInit() { this.showFirstCard=true; - this.isDisabled=true; + // this.isDisabled=true; this.getPDOfficerList(this.data.pd_id); } @@ -50,27 +51,19 @@ export class SmartPdAllocationComponent implements OnInit { }, error => this.errorMessage = error); } - // select pd officer list - selectPdOfficer(selected:any){ - - this.selectedItem=selected; - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - // select excutive officer - selectExcutiveOfficer(selected:any){ - this.isDisabled=false; - this.selectedItem1=selected; - } /** To update pd officer*/ - updateAllocation(pdOfficer:any,excutiveOfficer:any) { - if(this.isDisabled){ - this.notifier.notify('warning', 'Please Choose Allocate To Whom.!'); + updateAllocation(centralOfficer:any,excutiveOfficer:any) { + if(!centralOfficer){ + this.notifier.notify('warning', 'Please Choose Central Officer.!'); + } + else if(!excutiveOfficer){ + this.notifier.notify('warning', 'Please Choose Executive.!'); } else { let updateData = { "pd_id":this.data.pd_id, - "central_pd_officer_id":pdOfficer.fk_user_id, + "central_pd_officer_id":centralOfficer.fk_user_id, "executive_id":excutiveOfficer.fk_user_id, } this._pd.updatePdOfficer(updateData).subscribe( @@ -93,12 +86,16 @@ export class SmartPdAllocationComponent implements OnInit { getFirstCard() { this.showSecondCard=false; this.showFirstCard=true; + this.pageTitle = "Allocate To Central Officer"; + this.checkFirstItem = this.selectedCentralItem ? this.selectedCentralItem.fk_user_id : ''; } getSecondCard(){ this.showFirstCard=false; this.showSecondCard=true; - + this.pageTitle = "Allocate To Executive"; + this.checkSecondItem = this.selectedExcutiveItem ? this.selectedExcutiveItem.fk_user_id : ''; + } /** For Popup Close Button */ @@ -106,4 +103,24 @@ export class SmartPdAllocationComponent implements OnInit { this.dialogRef.close(); } + // officer view more + viewMoreDetails(details:any){ + if(Number(details.count) > 0) { + const dialogSchedule = this.dialog.open(AllocationViewMoreComponent, { + data: details, + disableClose: true, + position: { right: '0'}, + // hasBackdrop:false + }); + // dialogSchedule.afterClosed() + // .subscribe(dataresult => { + // }); + } + else { + this.notifier.notify('warning', 'No PD In Hand'); + + } + } + + } 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 index fc8ef5769..6c253b7f1 100755 --- 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 @@ -1,50 +1,66 @@ -
-
- - -
- - - {{pageTitle}} - - - - - -
-
-
- - - - No Image
- {{officer.first_name}} -
- {{officer.mobile_no}}
- PD in hand - {{officer.count}} -
-
-
-
- - -
- - -

No central pd officer available.

-
-
- - -
- -
- +

+
+ {{pageTitle}}
- - -

- +
+ + +
+ + + + + + + + +
+
+
+ + {{officer.first_name}} + +
+
+ {{officer.mobile_no}} +
+
+ PD in hand - {{officer.count}} + +
+
+ +
+ +
+ +
+ + +

No central officer available.

+
+
+ + + +
+ + +
+

Central Officer: {{selectedItem.first_name}}

+
+
+ +
+ +
+ + + + + + + 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 index 6e263adae..de092b6a6 100755 --- 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 @@ -1,3 +1,14 @@ .example-full-width{ width: 100%; +} +.view_more { + cursor: pointer; + color: #e00201 !important; + // text-decoration-line: underline; + // text-decoration-style: dotted; + // font-weight: bold; + +} +.text_change { + color: #e00201 !important; } \ 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.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/tele-pd-allocation/tele-pd-allocation.component.ts index 9fb85fb4b..fd82fa7b0 100755 --- 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 @@ -1,8 +1,9 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MatDialog, 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 { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component'; @Component({ selector: 'app-tele-pd-allocation', @@ -18,7 +19,7 @@ export class TelePdAllocationComponent implements OnInit { selectedItem:any; isDisabled: boolean; constructor( notifier: NotifierService, - private _fb: FormBuilder, + private _fb: FormBuilder, private dialog: MatDialog, private dialogRef: MatDialogRef, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any) { @@ -42,22 +43,16 @@ export class TelePdAllocationComponent implements OnInit { }, 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.!'); + updatePdOfficer(allocateDetails:any) { + if(!allocateDetails){ + this.notifier.notify('warning', 'Please Choose Central Officer.!'); } else { let updateData = { "pd_id":this.data.pd_id, - "central_pd_officer_id":allocateDate.fk_user_id, + "central_pd_officer_id":allocateDetails.fk_user_id, } this._pd.updatePdOfficer(updateData).subscribe( result => { @@ -80,5 +75,23 @@ export class TelePdAllocationComponent implements OnInit { closeAllocationComponent(): void { this.dialogRef.close(); } + // officer view more + viewMoreDetails(details:any){ + if(Number(details.count) > 0) { + const dialogSchedule = this.dialog.open(AllocationViewMoreComponent, { + data: details, + disableClose: true, + position: { right: '0'}, + // hasBackdrop:false + }); + // dialogSchedule.afterClosed() + // .subscribe(dataresult => { + // }); + } + else { + this.notifier.notify('warning', 'No PD In Hand'); + + } + } } 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 65bc8a3d8..5653b73b3 100755 --- 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 @@ -127,6 +127,8 @@ export class ViewPdComponent implements OnInit, OnDestroy { else if(pdData.fk_pd_type == 2){ const dialogRef = this.dialog.open(SmartPdAllocationComponent, { data: pdData, + width: '60%', + maxHeight: '60%', disableClose: true }); dialogRef.afterClosed() @@ -139,6 +141,8 @@ export class ViewPdComponent implements OnInit, OnDestroy { else if(pdData.fk_pd_type == 3){ const dialogRef = this.dialog.open(TelePdAllocationComponent, { data: pdData, + width: '60%', + maxHeight: '60%', disableClose: true, }); dialogRef.afterClosed() diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index a2b91264c..dc2b61fda 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -125,6 +125,8 @@ export class QcViewComponent implements OnInit, OnDestroy { else if(pdData.fk_pd_type == 2){ const dialogRef = this.dialog.open(SmartPdAllocationComponent, { data: pdData, + width: '60%', + maxHeight: '60%', disableClose: true }); dialogRef.afterClosed() @@ -137,6 +139,8 @@ export class QcViewComponent implements OnInit, OnDestroy { else if(pdData.fk_pd_type == 3){ const dialogRef = this.dialog.open(TelePdAllocationComponent, { data: pdData, + width: '60%', + maxHeight: '60%', disableClose: true, }); dialogRef.afterClosed()