add worklist+ fix conflict
commit
838e7cf99b
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
||||
import { FeedbackDirective } from './feedback.directive';
|
||||
|
||||
describe('FeedbackDirective', () => {
|
||||
it('should create an instance', () => {
|
||||
const directive = new FeedbackDirective();
|
||||
expect(directive).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -1,24 +0,0 @@
|
||||
import { Directive, ElementRef, HostListener } from '@angular/core';
|
||||
import { TranslatorService } from '../../services/translator/translator.service';
|
||||
import { CommonService } from '../../services/common/common.service';
|
||||
import { FeedbackService } from './feedback.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[feedback]'
|
||||
})
|
||||
export class FeedbackDirective {
|
||||
|
||||
constructor(
|
||||
private cs: CommonService,
|
||||
private ts: TranslatorService,
|
||||
private el: ElementRef,
|
||||
private feedBackService: FeedbackService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@HostListener('mousedown') onMouseEnter() {
|
||||
this.feedBackService.vibrate();
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FeedbackService } from './feedback.service';
|
||||
|
||||
describe('FeedbackService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: FeedbackService = TestBed.get(FeedbackService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -1,20 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Vibration } from '@ionic-native/vibration/ngx';
|
||||
// import { SettingsService } from 'src/app/settings/service/settings.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FeedbackService {
|
||||
// constructor(private vibration: Vibration, private settings: SettingsService) {}
|
||||
constructor(private vibration: Vibration) {}
|
||||
|
||||
public async vibrate() {
|
||||
try {
|
||||
const on = true;
|
||||
if (on) {
|
||||
this.vibration.vibrate(500);
|
||||
}} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<div class="main-container" [ngStyle]="active === true ? {'background': color} : {}">
|
||||
<div class="main-container-radius" [ngStyle]="active === true ? {'background-color': '#ffffff'} : {'background-color': color}"></div>
|
||||
<span class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span>
|
||||
<span class="text-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{text}}</span>
|
||||
</div>
|
||||
@ -0,0 +1,32 @@
|
||||
.main-container{
|
||||
width: 72px;
|
||||
background-color: white;
|
||||
padding: 10px;
|
||||
border-radius: 20px;
|
||||
height: 70px;
|
||||
text-align: right;
|
||||
font-family: WorkSans-Regular;
|
||||
padding-top: 25px;
|
||||
box-shadow: 0 0 6px rgba(0,0,0,0.16);
|
||||
position: relative;
|
||||
}
|
||||
.main-container-radius{
|
||||
// content: "";
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 6px;
|
||||
border-radius: 10px;
|
||||
background-color: red;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
.number-span{
|
||||
font-size: 19px;
|
||||
display: block;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.text-span{
|
||||
font-size: 14px;
|
||||
color: #888;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CardFilterComponent } from './card-filter.component';
|
||||
|
||||
describe('CardFilterComponent', () => {
|
||||
let component: CardFilterComponent;
|
||||
let fixture: ComponentFixture<CardFilterComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CardFilterComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CardFilterComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,18 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-card-filter',
|
||||
templateUrl: './card-filter.component.html',
|
||||
styleUrls: ['./card-filter.component.scss'],
|
||||
})
|
||||
export class CardFilterComponent implements OnInit {
|
||||
@Input() value: number;
|
||||
@Input() text: string;
|
||||
@Input() active: boolean;
|
||||
@Input() color: string;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@ -1,227 +1,71 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title>
|
||||
<ion-buttons slot="start">
|
||||
<nav-buttons backLink="/home"></nav-buttons>
|
||||
</ion-buttons>
|
||||
<ion-toolbar class="header-toolbar-new">
|
||||
<ion-buttons slot="start">
|
||||
<nav-buttons backLink="/home"></nav-buttons>
|
||||
</ion-buttons>
|
||||
<ion-title>WORK LIST</ion-title>
|
||||
<!-- <div class="profile-image-container" (click)="openProfilePage()">
|
||||
<img [src]="userImage"/>
|
||||
</div> -->
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content [ngClass]=" direction == 'ltr' ? 'left' : 'right'">
|
||||
<!-- first select type view -->
|
||||
<!-- <ion-item>
|
||||
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="notificationType"
|
||||
(ionChange)=onChangeView($event)>
|
||||
<ion-select-option value="1" selected="true">{{ts.trPK('worklist','openNot')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="searchBy"
|
||||
(ionChange)="getValueSelected($event)">
|
||||
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
|
||||
|
||||
</ion-select>
|
||||
</ion-item> -->
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size='3' class="ion-no-padding , menuListCol">
|
||||
<ion-list class="menuList">
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
|
||||
<ion-button class="menuListBtn" (click)="AllNotification()">
|
||||
<img *ngIf="!isAll" src="../assets/imgs/menuTabs/All1.png" />
|
||||
<img *ngIf="isAll" src="../assets/imgs/menuTabs/All2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
<!-- <ion-item lines="none" class="activeTabMenu"*ngIf="isPR"></ion-item> -->
|
||||
<!-- <ion-button class="menuListBtn" (click)="PRNotification()"><p style="color: black;">PR</p></ion-button> -->
|
||||
<ion-button ion-button class="menuListBtn" (click)="PRNotification()">
|
||||
<img *ngIf="!isPR" src="../assets/imgs/menuTabs/PR1.png" />
|
||||
<img *ngIf="isPR" src="../assets/imgs/menuTabs/PR2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
|
||||
<ion-button class="menuListBtn" (click)="PONotification()">
|
||||
<img *ngIf="!isPO" src="../assets/imgs/menuTabs/PO1.png" />
|
||||
<img *ngIf="isPO" src="../assets/imgs/menuTabs/PO2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
|
||||
<ion-button class="menuListBtn" (click)="MRNotification()">
|
||||
<img *ngIf="!isMR" src="../assets/imgs/menuTabs/MR1.png" />
|
||||
<img *ngIf="isMR" src="../assets/imgs/menuTabs/MR2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
|
||||
<ion-button class="menuListBtn" (click)="HRNotification()">
|
||||
<img *ngIf="!isHR" src="../assets/imgs/menuTabs/HR1.png" />
|
||||
<img *ngIf="isHR" src="../assets/imgs/menuTabs/HR2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item class="menuListItem" lines="none">
|
||||
<ion-button class="menuListBtn" (click)="ITGNotification()">
|
||||
<img *ngIf="!isITG" src="../assets/imgs/menuTabs/ITG1.png" />
|
||||
<img *ngIf="isITG" src="../assets/imgs/menuTabs/ITG2.png" />
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-col>
|
||||
<ion-col size='9' class="notifincationList">
|
||||
|
||||
<ion-list class="notification-list" *ngIf="!noData">
|
||||
<div class="timelineMain">
|
||||
<ion-item class="itemListNotification" *ngFor="let notificationList of filteredNotificationList"
|
||||
lines='none'>
|
||||
|
||||
<div class="item-date"> {{notificationList.BEGIN_DATE | dateString }} </div>
|
||||
<div class="timelineMain-item" slot="start">
|
||||
<!-- <div class="item-date"> {{notificationList.BEGIN_DATE }} </div> -->
|
||||
|
||||
<div class="timelineMain-thumb bg-color-dot timelineMain-icon">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-label (click)="openNotificationDetail(notificationList)"> {{notificationList.SUBJECT}}
|
||||
</ion-label>
|
||||
|
||||
</ion-item>
|
||||
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-list class="emptyItem" *ngIf="noData">
|
||||
<ion-item class="itemListNotification" lines='none'>
|
||||
<ion-label> There is no Notification
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<!-- <ion-list class="notification-list " *ngIf="isPR">
|
||||
<div class="timeline">
|
||||
<p>PR</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
|
||||
<ion-list class="notification-list " *ngIf="isPO">
|
||||
<div class="timeline">
|
||||
<p>PO</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
|
||||
<ion-list class="notification-list " *ngIf="isMR">
|
||||
<div class="timeline">
|
||||
<p>MR</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
|
||||
<ion-list class="notification-list " *ngIf="isHR">
|
||||
<div class="timeline">
|
||||
<p>HR</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
<ion-list class="notification-list " *ngIf="isITG">
|
||||
<div class="timeline">
|
||||
<p>ITG</p>
|
||||
</div>
|
||||
</ion-list> -->
|
||||
|
||||
</ion-col>
|
||||
<ion-content>
|
||||
<div class="contentBg">
|
||||
<div class="result-graph">
|
||||
<div class="request-heading">
|
||||
<span>Open Request Analysis</span>
|
||||
</div>
|
||||
<div class="result-text-container">
|
||||
<h2>{{totalRequestCount}}</h2>
|
||||
<span>TOTAL <br> OPEN REQUEST</span>
|
||||
</div>
|
||||
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
|
||||
</div>
|
||||
|
||||
<ion-row class="filters-row">
|
||||
<ion-slides [options]="slideOptsOne">
|
||||
<ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''">
|
||||
<app-card-filter
|
||||
[value]="filter.value"
|
||||
[text]="filter.name"
|
||||
[color]="filter.color"
|
||||
[active]="filter.active"
|
||||
(click)="activeFilter(i)"
|
||||
></app-card-filter>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
</ion-row>
|
||||
|
||||
<ion-row class="search-container">
|
||||
<ion-col style="float: left;" size=[6] *ngIf="showSearchButton" (click)="clearSearch()">
|
||||
<span style="margin-left: 5px;">Clear Search</span>
|
||||
<ion-icon name="close" ></ion-icon>
|
||||
</ion-col>
|
||||
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter === 'ALL'">
|
||||
<ion-icon name="search" ></ion-icon>
|
||||
<span>Advanced Search</span>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
|
||||
<!-- *ngIf="rowsNo <= noOfrows" -->
|
||||
<div [ngClass]="isEmptyObject() ? 'work-list-container' : ''">
|
||||
<div *ngFor="let data of showFormattedData | keyvalue; let i = index">
|
||||
<span class="date-span">{{data.key}}</span>
|
||||
<div class="date-data" *ngFor="let workList of data.value; let j = index">
|
||||
<p>{{workList.SUBJECT}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-data-available" *ngIf="!isEmptyObject()">
|
||||
<span>No Data Available</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll *ngIf="selectedFilter === 'ALL'" (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||
</ion-infinite-scroll>
|
||||
|
||||
|
||||
</ion-content>
|
||||
<ion-footer class="footerSearchBtn" *ngIf="!isSearch">
|
||||
<ion-button color="customnavy" expand="full" fill="outline" (click)="searchBtn()">{{ts.trPK('worklist','search')}}
|
||||
</ion-button>
|
||||
</ion-footer>
|
||||
|
||||
<ion-footer class="footerSearchBtn" *ngIf="isSearch">
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<!-- <ion-col size='3'> </ion-col> -->
|
||||
<ion-col>
|
||||
<div class="viewAndSearch">
|
||||
<ion-item lines="none">
|
||||
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
|
||||
[(ngModel)]="notificationType" (ionChange)=onChangeView($event)>
|
||||
<ion-select-option value="1" selected="true">{{ts.trPK('worklist','openNot')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="viewAndSearch">
|
||||
<ion-item>
|
||||
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
|
||||
[(ngModel)]="searchBy" (ionChange)="getValueSelected($event)">
|
||||
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
</ion-item>
|
||||
<div>
|
||||
<div *ngIf="HideDateInput==true">
|
||||
<ion-item lines='none'>
|
||||
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
|
||||
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY"
|
||||
pickerFormat="DD-MMM-YYYY" [(ngModel)]="InputDate"></ion-datetime>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="HideTextInput==true">
|
||||
<ion-item>
|
||||
<ion-input placeholder="{{ts.trPK('worklist','enter')}}" [(ngModel)]="inputSearch">
|
||||
</ion-input>
|
||||
</ion-item>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ion-button class="toSearchBtn" color="customnavy" expand="full" fill="outline"
|
||||
(click)="getAllPushNotificationFun()">
|
||||
{{ts.trPK('worklist','search')}}</ion-button>
|
||||
<ion-button class="toSearchBtn" color="customnavy" expand="full" fill="outline" (click)="searchBtn()">
|
||||
{{ts.trPK('general','close')}}</ion-button>
|
||||
</div>
|
||||
|
||||
<ion-button color="customnavy" (click)="Details()">Call details ITG</ion-button>
|
||||
<ion-button color="customnavy" (click)="Count()">Call count ITG</ion-button>
|
||||
<!--
|
||||
<ion-button color="customnavy" (click)="getAllPushNotificationFun()">{{ts.trPK('worklist','search')}}</ion-button> -->
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-footer>
|
||||
@ -1,336 +1,458 @@
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { CommonService } from "src/app/hmg-common/services/common/common.service";
|
||||
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
|
||||
import { WorkListRequest } from "../models/workListRequest";
|
||||
import * as moment from "moment";
|
||||
import { WorKListResponse } from "../models/workListResponse";
|
||||
import { WorklistService } from "../service/worklist.service";
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { WorkListRequest } from '../models/workListRequest';
|
||||
import * as moment from 'moment';
|
||||
import { WorKListResponse } from '../models/workListResponse';
|
||||
import { WorklistService } from '../service/worklist.service';
|
||||
import { IonInfiniteScroll } from '@ionic/angular';
|
||||
import { WorklistMainService } from '../service/work-list.main.service';
|
||||
import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component';
|
||||
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: "app-home",
|
||||
templateUrl: "./home.component.html",
|
||||
styleUrls: ["./home.component.scss"]
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.scss']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
// @ViewChild(Navbar) navBar: Navbar;
|
||||
public static NOTIFICATION_DATA = 'notification_data';
|
||||
public static NOTIFICATION_ARR = 'notification_arr';
|
||||
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
|
||||
private WorkListObj: WorkListRequest;
|
||||
WorkListResObj: any; //WorKListResponse;
|
||||
notificationType: string = "1";
|
||||
pageNum: number = 1;
|
||||
WorkListResObj: any;
|
||||
notificationType = '1';
|
||||
pageNum = 1;
|
||||
rowsNo: number;
|
||||
noOfrows: number;
|
||||
selectedValue: string = "";
|
||||
FromUserName: string = "";
|
||||
ItemKeyDisplayName: string = "";
|
||||
SentDate: string = "";
|
||||
Subject: string = "";
|
||||
inputSearch: string = "";
|
||||
HideDateInput: boolean = false;
|
||||
HideTextInput: boolean = false;
|
||||
InputDate: string;
|
||||
selectedValue = '';
|
||||
FromUserName = '';
|
||||
ItemKeyDisplayName = '';
|
||||
SentDate = '';
|
||||
Subject = '';
|
||||
inputSearch = '';
|
||||
inputDate: string;
|
||||
filteredNotificationList: any;
|
||||
IsReachEnd: boolean = false;
|
||||
public noData: boolean = false;
|
||||
public isAll: boolean = true;
|
||||
public isPR: boolean = false;
|
||||
public isPO: boolean = false;
|
||||
public isMR: boolean = false;
|
||||
public isHR: boolean = false;
|
||||
public isITG: boolean = false;
|
||||
public isSearch: boolean = false;
|
||||
IsReachEnd = false;
|
||||
public noData = false;
|
||||
public isAll = true;
|
||||
public isPR = false;
|
||||
public isPO = false;
|
||||
public isMR = false;
|
||||
public isHR = false;
|
||||
public isITG = false;
|
||||
public isSearch = false;
|
||||
public direction = 'ltr';
|
||||
|
||||
public currentActiveIndex = 0;
|
||||
public previousActiveIndex = 0;
|
||||
public worklistNotifications: any;
|
||||
public totalRequestCount = 0;
|
||||
public newWorkListResponse = [];
|
||||
public allFormattedData = {};
|
||||
public showFormattedData = {};
|
||||
public selectedFilter = 'ALL';
|
||||
public showSearchButton = false;
|
||||
public itemType = '';
|
||||
public options = {
|
||||
cutoutPercentage: 80,
|
||||
tooltips: { enabled: false },
|
||||
legend: { display: false }
|
||||
};
|
||||
public data = {
|
||||
datasets: [
|
||||
{
|
||||
data: [0, 0, 0, 0, 0],
|
||||
backgroundColor: [
|
||||
'#18a169',
|
||||
'#38c9b3',
|
||||
'#114475',
|
||||
'#3cb9d5',
|
||||
'#cc3232'
|
||||
],
|
||||
borderWidth: 5
|
||||
}]
|
||||
};
|
||||
public filters = [
|
||||
{
|
||||
value: 0,
|
||||
name: 'All',
|
||||
active: true,
|
||||
color: '#124375',
|
||||
key: 'ALL',
|
||||
disable: false
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
name: 'HR',
|
||||
active: false,
|
||||
color: '#18a169',
|
||||
key: 'HRSSA',
|
||||
disable: false
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
name: 'PO',
|
||||
active: false,
|
||||
color: '#38c9b3',
|
||||
key: 'POAPPRV',
|
||||
disable: false
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
name: 'PR',
|
||||
active: false,
|
||||
color: '#114475',
|
||||
key: 'REQAPPRV',
|
||||
disable: false
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
name: 'MR',
|
||||
active: false,
|
||||
color: '#3cb9d5',
|
||||
key: 'INVMOA',
|
||||
disable: false
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
name: 'ITG',
|
||||
active: false,
|
||||
color: '#cc3232',
|
||||
key: 'ITG',
|
||||
disable: false
|
||||
}
|
||||
];
|
||||
public slideOptsOne = {
|
||||
slidesPerView: 4.3,
|
||||
spaceBetween: 10
|
||||
};
|
||||
constructor(
|
||||
public common: CommonService,
|
||||
public ts: TranslatorService,
|
||||
public WorklistService: WorklistService,
|
||||
public workListService: WorklistMainService,
|
||||
) {
|
||||
this.WorkListObj = new WorkListRequest();
|
||||
this.WorkListObj.P_NOTIFICATION_TYPE = "1";
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = "";
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
|
||||
this.WorkListObj.P_PAGE_NUM = 0;
|
||||
this.WorkListObj.P_PAGE_LIMIT = 50; //number
|
||||
public common: CommonService,
|
||||
public ts: TranslatorService,
|
||||
public WorklistService: WorklistService,
|
||||
public workListService: WorklistMainService,
|
||||
public modalController: ModalController
|
||||
) {
|
||||
this.WorkListObj = new WorkListRequest();
|
||||
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
||||
this.WorkListObj.P_PAGE_NUM = 0;
|
||||
this.WorkListObj.P_PAGE_LIMIT = 50;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.direction = TranslatorService.getCurrentDirection();
|
||||
}
|
||||
ionViewDidLoad() {
|
||||
// this.navBar.backButtonClick = () => {
|
||||
// // you can set a full custom history here if you want
|
||||
// let pages = [
|
||||
// {
|
||||
// page: "HomePage"
|
||||
// }
|
||||
// ];
|
||||
// this.navCtrl.setPages(pages);
|
||||
// };
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
// this.direction = TranslatorService.getCurrentDirection();
|
||||
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
|
||||
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
||||
this.assignDataToFilters();
|
||||
this.getAllPushNotificationFun();
|
||||
}
|
||||
getValueSelected(Value) {
|
||||
this.selectedValue = Value.detail.value;
|
||||
if (this.selectedValue == "1") {
|
||||
this.HideDateInput = false;
|
||||
this.HideTextInput = true;
|
||||
} else if (this.selectedValue == "2") {
|
||||
this.HideDateInput = false;
|
||||
this.HideTextInput = true;
|
||||
} else if (this.selectedValue == "3") {
|
||||
this.HideDateInput = true;
|
||||
this.HideTextInput = false;
|
||||
} else if (this.selectedValue == "4") {
|
||||
this.HideDateInput = false;
|
||||
this.HideTextInput = true;
|
||||
} else if (this.selectedValue == "5") {
|
||||
this.HideDateInput = false;
|
||||
this.HideTextInput = false;
|
||||
|
||||
assignDataToFilters() {
|
||||
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
||||
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
|
||||
for (const notification of openNotificationsArray) {
|
||||
if (notification.ITEM_TYPE === 'HRSSA') {
|
||||
this.filters[1].value = notification.OPEN_NTF_NUMBER;
|
||||
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
|
||||
} else if (notification.ITEM_TYPE === 'POAPPRV') {
|
||||
this.filters[2].value = notification.OPEN_NTF_NUMBER;
|
||||
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
|
||||
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
|
||||
this.filters[3].value = notification.OPEN_NTF_NUMBER;
|
||||
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
|
||||
} else if (notification.ITEM_TYPE === 'INVMOA') {
|
||||
this.filters[4].value = notification.OPEN_NTF_NUMBER;
|
||||
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getAllPushNotificationFun() {
|
||||
this.WorkListObj.P_PAGE_NUM = 1;
|
||||
this.IsReachEnd = false;
|
||||
getFilteredData(filter: string) {
|
||||
if (filter === 'ALL') {
|
||||
this.showFormattedData = this.allFormattedData;
|
||||
} else {
|
||||
let arrayToFilter;
|
||||
arrayToFilter = this.newWorkListResponse.filter((workList) => {
|
||||
return workList.ITEM_TYPE === filter;
|
||||
});
|
||||
this.showFormattedData = this.categorizeData(arrayToFilter);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.selectedValue == "1") {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch;
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = "";
|
||||
} else if (this.selectedValue == "2") {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = "";
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch;
|
||||
} else if (this.selectedValue == "3") {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = "";
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
|
||||
if (this.InputDate)
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format(
|
||||
"DD-MMM-YYYY"
|
||||
);
|
||||
else this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = "";
|
||||
} else if (this.selectedValue == "4") {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = "";
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch;
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = "";
|
||||
} else if (this.selectedValue == "5") {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = "";
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = "";
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = "";
|
||||
}
|
||||
activeFilter(index: number) {
|
||||
this.showFormattedData = {};
|
||||
this.previousActiveIndex = this.currentActiveIndex;
|
||||
this.currentActiveIndex = index;
|
||||
this.filters[this.previousActiveIndex].active = false;
|
||||
this.filters[this.currentActiveIndex].active = true;
|
||||
|
||||
this.WorklistService.getWorkList(this.WorkListObj).subscribe(
|
||||
(result: WorKListResponse) => {
|
||||
this.handleWorkListResult(result);
|
||||
}
|
||||
);
|
||||
} //End getNotifications
|
||||
this.selectedFilter = this.filters[this.currentActiveIndex].key;
|
||||
this.getFilteredData(this.selectedFilter);
|
||||
}
|
||||
|
||||
private handleWorkListResult(result) {
|
||||
if (this.common.validResponse(result)) {
|
||||
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
|
||||
if (this.common.hasData(result.GetWorkList)) {
|
||||
this.WorkListObj.P_PAGE_NUM++;
|
||||
this.WorkListResObj = result.GetWorkList;
|
||||
this.filteredNotificationList = this.WorkListResObj;
|
||||
this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR);
|
||||
let lastItemIndex = this.WorkListResObj.length - 1;
|
||||
if (result.GetWorkList[lastItemIndex]) {
|
||||
let lastitem = result.GetWorkList[lastItemIndex];
|
||||
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
// this.navCtrl.push('SmsAuthenticatePage');
|
||||
}
|
||||
openProfilePage() {
|
||||
this.common.openProfile();
|
||||
}
|
||||
|
||||
disableFilters() {
|
||||
for (const filter of this.filters) {
|
||||
if (filter.key === this.itemType) {
|
||||
filter.disable = false;
|
||||
filter.active = true;
|
||||
this.selectedFilter = filter.name;
|
||||
} else if (this.itemType === 'none') {
|
||||
filter.disable = false;
|
||||
filter.active = false;
|
||||
} else {
|
||||
this.WorkListResObj = [];
|
||||
filter.disable = true;
|
||||
filter.active = false;
|
||||
}
|
||||
}
|
||||
if (this.itemType === 'none') {
|
||||
this.filters[0].active = true;
|
||||
}
|
||||
}
|
||||
|
||||
openNotificationDetail(obj) {
|
||||
console.log(obj);
|
||||
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
|
||||
//this.common.openWorklistMainPage();
|
||||
if(obj.REQUEST_TYPE == "PR"){
|
||||
this.common.openWorklistMainPRPage();
|
||||
}
|
||||
else if(obj.REQUEST_TYPE == "PO"){
|
||||
this.common.openWorklistMainPOPage();
|
||||
}
|
||||
else if(obj.REQUEST_TYPE == "MO"){
|
||||
this.common.openWorklistMainMRPage();
|
||||
async openSearchModal() {
|
||||
const modal = await this.modalController.create({
|
||||
component: WorklistAdvancedSearchComponent,
|
||||
cssClass: 'advanced-search-modal',
|
||||
backdropDismiss: false,
|
||||
componentProps: {}
|
||||
});
|
||||
modal.onDidDismiss().then(result => {
|
||||
console.log(result.data);
|
||||
if (result.data) {
|
||||
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
|
||||
this.showSearchButton = true;
|
||||
this.itemType = result.data.itemType;
|
||||
this.notificationType = result.data.notificationType;
|
||||
this.selectedValue = result.data.selectedValue;
|
||||
this.inputDate = result.data.inputDate;
|
||||
this.inputSearch = result.data.inputSearch;
|
||||
this.WorkListObj.P_PAGE_NUM = 1;
|
||||
this.newWorkListResponse = [];
|
||||
this.allFormattedData = {};
|
||||
this.showFormattedData = {};
|
||||
this.selectedFilter = 'ALL';
|
||||
this.filters[this.currentActiveIndex].active = false;
|
||||
this.currentActiveIndex = 0;
|
||||
this.previousActiveIndex = 0;
|
||||
this.filters[this.currentActiveIndex].active = true;
|
||||
this.getAllPushNotificationFun();
|
||||
if (this.itemType !== '') {
|
||||
this.disableFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
this.common.openWorklistMainPage();
|
||||
|
||||
}
|
||||
|
||||
//this.navCtrl.push("WorkListMainPage", { passNotificationList: obj });
|
||||
}
|
||||
onChangeView(selectedValue: any) {
|
||||
this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value;
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll) {
|
||||
//this.pageNum= this.pageNum + 1;
|
||||
getAllPushNotificationFun() {
|
||||
this.WorkListObj.P_PAGE_NUM = 1;
|
||||
this.IsReachEnd = false;
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
|
||||
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';;
|
||||
if (this.selectedValue === '5') {
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
||||
}
|
||||
|
||||
if (!this.IsReachEnd) {
|
||||
this.WorklistService.getWorkList(this.WorkListObj).subscribe(
|
||||
(result: any) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
this.WorkListObj.P_PAGE_NUM++;
|
||||
if (this.common.hasData(result.GetWorkList)) {
|
||||
result.GetWorkList.forEach(element => {
|
||||
if (element.ROW_NUM == element.NO_OF_ROWS) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
this.WorkListResObj.push(element);
|
||||
});
|
||||
} // if list length >0
|
||||
else {
|
||||
this.IsReachEnd = true;
|
||||
}
|
||||
} // if response == 1
|
||||
//this.pageNum++;
|
||||
this.infiniteScroll.complete();
|
||||
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
this.handleWorkListResult(result.GetWorkList);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
if (this.infiniteScroll) this.infiniteScroll.complete();
|
||||
}
|
||||
} //end infiniteScroll
|
||||
}
|
||||
|
||||
Count() {
|
||||
this.workListService.getITGCount()
|
||||
.subscribe((result: any) => {
|
||||
console.log("ENAD ITG COUNT:")
|
||||
console.log(result);
|
||||
});
|
||||
categorizeData(arrayToCategorize: any) {
|
||||
const datePipe = new DatePipe('en-US');
|
||||
const formattedData = {};
|
||||
for (const workList of arrayToCategorize) {
|
||||
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
|
||||
if (!(workList.FORMATTED_DATE in formattedData)) {
|
||||
formattedData[workList.FORMATTED_DATE] = new Array();
|
||||
formattedData[workList.FORMATTED_DATE].push(workList);
|
||||
} else {
|
||||
formattedData[workList.FORMATTED_DATE].push(workList);
|
||||
}
|
||||
}
|
||||
return formattedData;
|
||||
}
|
||||
|
||||
filterNotificationByRequestType(reqType) {
|
||||
let filterdType = [];
|
||||
if (reqType == "All") {
|
||||
this.filteredNotificationList = this.WorkListResObj;
|
||||
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") {
|
||||
this.noData = true;
|
||||
return false;
|
||||
sortArray(arrayToSort: any) {
|
||||
return arrayToSort.sort((a: any, b: any) =>
|
||||
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
|
||||
);
|
||||
}
|
||||
|
||||
private handleWorkListResult(result: any) {
|
||||
const lastItemIndex = result.length - 1;
|
||||
const lastitem = result[lastItemIndex];
|
||||
if (lastitem) {
|
||||
if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
this.infiniteScroll.complete();
|
||||
} else {
|
||||
this.noData = false;
|
||||
return false;
|
||||
this.IsReachEnd = false;
|
||||
this.infiniteScroll.complete();
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.WorkListResObj.length; i++) {
|
||||
if(reqType=="HR"){
|
||||
if ("EIT" == this.WorkListResObj[i].REQUEST_TYPE || "ABSENCE" == this.WorkListResObj[i].REQUEST_TYPE) {
|
||||
filterdType.push(this.WorkListResObj[i]);
|
||||
}
|
||||
}else{
|
||||
if (reqType == this.WorkListResObj[i].REQUEST_TYPE) {
|
||||
filterdType.push(this.WorkListResObj[i]);
|
||||
}
|
||||
if (this.common.hasData(result)) {
|
||||
this.WorkListObj.P_PAGE_NUM++;
|
||||
if (this.newWorkListResponse.length === 0) {
|
||||
this.newWorkListResponse = result;
|
||||
} else {
|
||||
this.newWorkListResponse = this.newWorkListResponse.concat(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.filteredNotificationList = filterdType;
|
||||
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") {
|
||||
this.noData = true;
|
||||
return false;
|
||||
this.newWorkListResponse = this.sortArray(this.newWorkListResponse);
|
||||
console.log(this.newWorkListResponse);
|
||||
this.allFormattedData = this.categorizeData(this.newWorkListResponse);
|
||||
this.showFormattedData = this.allFormattedData;
|
||||
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
|
||||
} else {
|
||||
this.noData = false;
|
||||
return false;
|
||||
this.newWorkListResponse = [];
|
||||
}
|
||||
}
|
||||
|
||||
Details() {
|
||||
this.workListService.getITGDetails()
|
||||
.subscribe((result: any) => {
|
||||
console.log("ENAD ITG Details:")
|
||||
console.log(result);
|
||||
});
|
||||
openNotificationDetail(obj) {
|
||||
console.log(obj);
|
||||
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
|
||||
// this.common.openWorklistMainPage();
|
||||
if (obj.REQUEST_TYPE === 'PR') {
|
||||
this.common.openWorklistMainPRPage();
|
||||
} else if (obj.REQUEST_TYPE === 'PO') {
|
||||
this.common.openWorklistMainPOPage();
|
||||
} else if (obj.REQUEST_TYPE === 'MO') {
|
||||
this.common.openWorklistMainMRPage();
|
||||
} else {
|
||||
this.common.openWorklistMainPage();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
isEmptyObject() {
|
||||
return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0));
|
||||
}
|
||||
|
||||
AllNotification() {
|
||||
this.filterNotificationByRequestType("All");
|
||||
this.isAll = true;
|
||||
this.isPR = false;
|
||||
this.isPO = false;
|
||||
this.isMR = false;
|
||||
this.isHR = false;
|
||||
this.isITG = false;
|
||||
clearSearch() {
|
||||
this.itemType = 'none';
|
||||
this.disableFilters();
|
||||
this.showSearchButton = false;
|
||||
this.notificationType = '';
|
||||
this.selectedValue = '';
|
||||
this.inputDate = '';
|
||||
this.inputSearch = '';
|
||||
this.WorkListObj.P_PAGE_NUM = 1;
|
||||
this.newWorkListResponse = [];
|
||||
this.allFormattedData = {};
|
||||
this.showFormattedData = {};
|
||||
this.selectedFilter = 'ALL';
|
||||
this.filters[this.currentActiveIndex].active = false;
|
||||
this.currentActiveIndex = 0;
|
||||
this.previousActiveIndex = 0;
|
||||
this.filters[this.currentActiveIndex].active = true;
|
||||
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
||||
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
||||
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
||||
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
||||
this.getAllPushNotificationFun();
|
||||
}
|
||||
PRNotification() {
|
||||
this.filterNotificationByRequestType("PR");
|
||||
this.isAll = false;
|
||||
this.isPR = true;
|
||||
this.isPO = false;
|
||||
this.isMR = false;
|
||||
this.isHR = false;
|
||||
this.isITG = false;
|
||||
|
||||
onChangeView(selectedValue: any) {
|
||||
this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value;
|
||||
}
|
||||
PONotification() {
|
||||
this.filterNotificationByRequestType("PO");
|
||||
this.isAll = false;
|
||||
this.isPR = false;
|
||||
this.isPO = true;
|
||||
this.isMR = false;
|
||||
this.isHR = false;
|
||||
this.isITG = false;
|
||||
|
||||
doInfinite(infiniteScroll) {
|
||||
if (!this.IsReachEnd && this.selectedFilter === 'ALL') {
|
||||
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
this.handleWorkListResult(result.GetWorkList);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.infiniteScroll && this.selectedFilter === 'ALL') {
|
||||
this.infiniteScroll.complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
MRNotification() {
|
||||
this.filterNotificationByRequestType("MO");
|
||||
this.isAll = false;
|
||||
this.isPR = false;
|
||||
this.isPO = false;
|
||||
this.isMR = true;
|
||||
this.isHR = false;
|
||||
this.isITG = false;
|
||||
|
||||
Count() {
|
||||
this.workListService.getITGCount()
|
||||
.subscribe((result: any) => {
|
||||
console.log('ENAD ITG COUNT:');
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
HRNotification() {
|
||||
this.filterNotificationByRequestType("HR");
|
||||
this.isAll = false;
|
||||
this.isPR = false;
|
||||
this.isPO = false;
|
||||
this.isMR = false;
|
||||
this.isHR = true;
|
||||
this.isITG = false;
|
||||
|
||||
// filterNotificationByRequestType(reqType) {
|
||||
// const filterdType = [];
|
||||
// if (reqType === 'All') {
|
||||
// this.filteredNotificationList = this.WorkListResObj;
|
||||
// if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') {
|
||||
// this.noData = true;
|
||||
// return false;
|
||||
// } else {
|
||||
// this.noData = false;
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// for (let i = 0; i < this.WorkListResObj.length; i++) {
|
||||
// if (reqType === 'HR') {
|
||||
// if ('EIT' === this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' === this.WorkListResObj[i].REQUEST_TYPE) {
|
||||
// filterdType.push(this.WorkListResObj[i]);
|
||||
// }
|
||||
// } else {
|
||||
// if (reqType === this.WorkListResObj[i].REQUEST_TYPE) {
|
||||
// filterdType.push(this.WorkListResObj[i]);
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// this.filteredNotificationList = filterdType;
|
||||
// if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') {
|
||||
// this.noData = true;
|
||||
// return false;
|
||||
// } else {
|
||||
// this.noData = false;
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
Details() {
|
||||
this.workListService.getITGDetails()
|
||||
.subscribe((result: any) => {
|
||||
console.log('ENAD ITG Details:');
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
|
||||
ITGNotification() {
|
||||
// this.Details();
|
||||
this.isAll = false;
|
||||
this.isPR = false;
|
||||
this.isPO = false;
|
||||
this.isMR = false;
|
||||
this.isHR = false;
|
||||
this.isITG = true;
|
||||
// this.Details();
|
||||
this.isAll = false;
|
||||
this.isPR = false;
|
||||
this.isPO = false;
|
||||
this.isMR = false;
|
||||
this.isHR = false;
|
||||
this.isITG = true;
|
||||
}
|
||||
|
||||
searchBtn() {
|
||||
this.isSearch = !this.isSearch;
|
||||
this.isSearch = !this.isSearch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +1,12 @@
|
||||
// import { Request } from './request';
|
||||
import { Request } from 'src/app/hmg-common/services/models/request';
|
||||
|
||||
export class WorkListRequest extends Request{
|
||||
public static SHARED_DATA = 'login-request';
|
||||
// Channel: Channel, //channel
|
||||
// LanguageID: LanguageID,//langlist
|
||||
// P_USER_NAME:userName,//string
|
||||
// P_SESSION_ID:sessionID,//number
|
||||
public P_NOTIFICATION_TYPE: string;//string
|
||||
public P_SEARCH_FROM_USER:string;//string
|
||||
public P_SEARCH_SUBJECT:string;//string
|
||||
public P_SEARCH_SENT_DATE:string;//string
|
||||
public P_SEARCH_ITEM_TYPE_DSP_NAME:string;//string
|
||||
public P_PAGE_NUM:number;//number
|
||||
public P_PAGE_LIMIT:number;//number
|
||||
|
||||
public P_NOTIFICATION_TYPE: string;
|
||||
public P_SEARCH_FROM_USER: string;
|
||||
public P_SEARCH_SUBJECT: string;
|
||||
public P_SEARCH_SENT_DATE: string;
|
||||
public P_SEARCH_ITEM_TYPE_DSP_NAME: string;
|
||||
public P_PAGE_NUM: number;
|
||||
public P_PAGE_LIMIT: number;
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<ion-content>
|
||||
<div class="search-header" (click)="dismissModal()">
|
||||
<h2>Advanced Search</h2>
|
||||
<ion-icon slot="icon-only" name="md-close"></ion-icon>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-container">
|
||||
<ion-item lines="none">
|
||||
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
|
||||
(ionChange)=onChangeView($event)>
|
||||
<ion-select-option value="1">{{ts.trPK('worklist','openNot')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
|
||||
<ion-item lines="none" [ngStyle]="(hideDateInput === true || hideTextInput === true) ? {'margin-bottom': '0px'} : {}">
|
||||
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
|
||||
(ionChange)="getValueSelected($event)">
|
||||
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
|
||||
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
|
||||
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
|
||||
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
|
||||
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<div>
|
||||
<div *ngIf="hideDateInput">
|
||||
<ion-item lines='none' style="border-radius: 10px;margin-right: 10px;margin-left: 10px;margin-top: 5px;">
|
||||
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
|
||||
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY"
|
||||
pickerFormat="DD-MMM-YYYY" [(ngModel)]="inputDate"></ion-datetime>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="hideTextInput">
|
||||
<ion-item lines='none' style="border-radius: 10px;margin-right: 10px;margin-left: 10px;margin-top: 5px;">
|
||||
<ion-input placeholder="{{ts.trPK('worklist','enter')}}" [(ngModel)]="inputSearch">
|
||||
</ion-input>
|
||||
</ion-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-label>Item Type</ion-label>
|
||||
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
|
||||
[(ngModel)]="itemType">
|
||||
<ion-select-option value="HRSSA">HR</ion-select-option>
|
||||
<ion-select-option value="POAPPRV">PO</ion-select-option>
|
||||
<ion-select-option value="REQAPPRV">PR</ion-select-option>
|
||||
<ion-select-option value="INVMOA">MR</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
|
||||
<div class="search-button" (click)="search()">
|
||||
<span>SEARCH</span>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
.search-header{
|
||||
display: inline-block;
|
||||
h2 {
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
font-family: WorkSans-Regular;
|
||||
font-size: 18px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
ion-icon {
|
||||
display: inline-block;
|
||||
font-size: 23px;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
.search-container {
|
||||
margin-right: 15px;
|
||||
margin-left: 15px;
|
||||
padding-bottom: 100px;
|
||||
margin-top: 5px;
|
||||
ion-item{
|
||||
border: 2px solid #eaeaea;
|
||||
border-radius: 25px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.search-button{
|
||||
background: #3dcab3;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
font-family: WorkSans-Regular;
|
||||
border-radius: 22px;
|
||||
margin-top: 20px;
|
||||
line-height: 50px;
|
||||
span{
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WorklistAdvancedSearchComponent } from './worklist-advanced-search.component';
|
||||
|
||||
describe('WorklistAdvancedSearchComponent', () => {
|
||||
let component: WorklistAdvancedSearchComponent;
|
||||
let fixture: ComponentFixture<WorklistAdvancedSearchComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WorklistAdvancedSearchComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(WorklistAdvancedSearchComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,65 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-worklist-advanced-search',
|
||||
templateUrl: './worklist-advanced-search.component.html',
|
||||
styleUrls: ['./worklist-advanced-search.component.scss'],
|
||||
})
|
||||
export class WorklistAdvancedSearchComponent implements OnInit {
|
||||
|
||||
public hideDateInput = false;
|
||||
public hideTextInput = false;
|
||||
public inputDate = '';
|
||||
public inputSearch = '';
|
||||
public selectedValue = '';
|
||||
public notificationType = '';
|
||||
public itemType = '';
|
||||
|
||||
constructor(
|
||||
public modalController: ModalController,
|
||||
public ts: TranslatorService
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public dismissModal() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
public search() {
|
||||
console.log(this.itemType);
|
||||
this.modalController.dismiss({
|
||||
notificationType: this.notificationType,
|
||||
selectedValue: this.selectedValue,
|
||||
inputDate: this.inputDate,
|
||||
inputSearch: this.inputSearch,
|
||||
itemType: this.itemType
|
||||
});
|
||||
}
|
||||
|
||||
onChangeView(selectedValue: any) {
|
||||
this.notificationType = selectedValue.detail.value;
|
||||
}
|
||||
|
||||
getValueSelected(value) {
|
||||
this.selectedValue = value.detail.value;
|
||||
if (this.selectedValue === '1') {
|
||||
this.hideDateInput = false;
|
||||
this.hideTextInput = true;
|
||||
} else if (this.selectedValue === '2') {
|
||||
this.hideDateInput = false;
|
||||
this.hideTextInput = true;
|
||||
} else if (this.selectedValue === '3') {
|
||||
this.hideDateInput = true;
|
||||
this.hideTextInput = false;
|
||||
} else if (this.selectedValue === '4') {
|
||||
this.hideDateInput = false;
|
||||
this.hideTextInput = true;
|
||||
} else if (this.selectedValue === '5') {
|
||||
this.hideDateInput = false;
|
||||
this.hideTextInput = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue