From d07e18b657cbba1f200714b2b0fd50a70df1c2c5 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 23 May 2021 12:55:36 +0300 Subject: [PATCH 1/3] added new category for Item Creation --- .../app/notification/home/home.component.ts | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index fc4f266c..d0aae37b 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -75,6 +75,8 @@ export class HomeComponent implements OnInit { public totalPO = 0; public totalPR = 0; public totalMR = 0; + public totalIC = 0; + public showChart = false; public isPostNoLoad = true; @@ -86,13 +88,14 @@ export class HomeComponent implements OnInit { public data = { datasets: [ { - data: [0, 0, 0, 0, 0], + data: [0, 0, 0, 0, 0, 0], backgroundColor: [ '#18a169', '#38c9b3', '#114475', '#3cb9d5', - '#cc3232' + '#cc3232', + '#9e7e97' ], borderWidth: 5 }] @@ -145,6 +148,14 @@ export class HomeComponent implements OnInit { color: '#cc3232', key: 'ITG', disable: false + }, + { + value: 0, + name: 'IC', + active: false, + color: '#9e7e97', + key: 'INVITEM', + disable: false } ]; public slideOptsOne = { @@ -226,6 +237,7 @@ export class HomeComponent implements OnInit { this.filters[2].value = this.totalPO; this.filters[3].value = this.totalPR; this.filters[4].value = this.totalMR; + this.filters[5].value = this.totalIC; if (this.totalHR === 0) { this.data.datasets[0].data[0] = 0; @@ -243,6 +255,10 @@ export class HomeComponent implements OnInit { this.data.datasets[0].data[3] = 0; } + if (this.totalIC === 0) { + this.data.datasets[0].data[5] = 0; + } + const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList; for (const notification of openNotificationsArray) { @@ -258,6 +274,9 @@ export class HomeComponent implements OnInit { } else if (notification.ITEM_TYPE === 'INVMOA') { this.filters[4].value = this.totalMR; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'INVITEM') { + this.filters[6].value = this.totalIC; + this.data.datasets[0].data[5] = notification.OPEN_NTF_NUMBER; } } // this.data.datasets[0].data[4] = this.ITGCount; @@ -414,6 +433,8 @@ export class HomeComponent implements OnInit { this.totalPR = this.totalPR + 1; } else if (workList.ITEM_TYPE === 'INVMOA') { this.totalMR = this.totalMR + 1; + } else if (workList.ITEM_TYPE === 'INVITEM') { + this.totalIC = this.totalIC + 1; } } @@ -422,6 +443,7 @@ export class HomeComponent implements OnInit { this.totalPO = 0; this.totalPR = 0; this.totalMR = 0; + this.totalIC = 0; const datePipe = new DatePipe('en-US'); const formattedData = []; From 57467ea800eb28b1756602b4eedce6270870bd3c Mon Sep 17 00:00:00 2001 From: enadhilal Date: Sun, 23 May 2021 15:00:10 +0300 Subject: [PATCH 2/3] Item Creation page added --- .../services/common/common.service.ts | 4 +- .../app/notification/home/home.component.ts | 2 + .../app/notification/notification.module.ts | 82 +- .../service/work-list.main.service.ts | 52 +- .../worklist-main-ic.component.html | 558 ++++++++ .../worklist-main-ic.component.scss | 144 ++ .../worklist-main-ic.component.spec.ts | 27 + .../worklist-main-ic.component.ts | 1272 +++++++++++++++++ .../worklist-main-po.component.html | 2 +- 9 files changed, 2079 insertions(+), 64 deletions(-) create mode 100644 Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html create mode 100644 Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss create mode 100644 Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts create mode 100644 Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 8e7fce00..83f50a82 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1178,7 +1178,6 @@ public getMonthNameAr(value: number): string { public openMOItemHistoryPage(){ this.nav.navigateForward(['/notification/item-history-MO']); - } public openQutationAnalysisPage() { this.nav.navigateForward(['/notification/qutation-analysis-PO']); @@ -1186,6 +1185,9 @@ public getMonthNameAr(value: number): string { public openWorklistMainMRPage() { this.nav.navigateForward(['/notification/worklist-main-MR']); } + public openWorklistMainICPage() { + this.nav.navigateForward(['/notification/item-creation-IC']); + } public openWorklistITGPage() { this.nav.navigateForward(['/notification/worklist-main-ITG']); } diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index fc4f266c..a93dcfb6 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -507,6 +507,8 @@ export class HomeComponent implements OnInit { this.common.openWorklistMainPOPage(); } else if (obj.REQUEST_TYPE === 'MO') { this.common.openWorklistMainMRPage(); + } else if (obj.REQUEST_TYPE === 'ITEM_CREATION') { + this.common.openWorklistMainICPage(); } else { this.common.openWorklistMainPage(); } diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index e191db27..d9b5da73 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -28,9 +28,10 @@ import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.com import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component'; import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component'; // import { WorklistMainComponent } from './worklist-main/worklist-main.component'; -import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component' +import { MoreActionModalComponent } from './more-action-modal/more-action-modal.component' import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component'; import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component'; +import { WorklistMainIcComponent } from './worklist-main-ic/worklist-main-ic.component'; const routes: Routes = [ @@ -50,7 +51,7 @@ const routes: Routes = [ path: 'worklist-main', component: WorklistMainComponent }, - { + { path: 'work-list-replacement-roll', component: WorkListReplacementRollComponent }, @@ -84,40 +85,44 @@ const routes: Routes = [ component: WorklistMainPRComponent }, { - path: 'apply-action-modal', - component: ApplyActionModalComponent - }, - { - path: 'worklist-main-PO', - component: WorklistMainPoComponent - }, - { - path: 'item-history-PO', - component: ItemHistoryComponent - }, - { - path: 'qutation-analysis-PO', - component: QutationAnalysisComponent - }, - { - path: 'worklist-main-MR', - component: WorklistMainMRComponent - }, - { - path: 'worklist-main-ITG', - component: WorkListMainItgComponent - }, - { - path: 'more-action-modal', - component: MoreActionModalComponent - }, - { - path: 'worklist-replacement-itg', - component: WorkListReplacementItgComponent - }, - { - path: 'item-history-MO', - component: MoItemHistoryComponent + path: 'apply-action-modal', + component: ApplyActionModalComponent + }, + { + path: 'worklist-main-PO', + component: WorklistMainPoComponent + }, + { + path: 'item-history-PO', + component: ItemHistoryComponent + }, + { + path: 'qutation-analysis-PO', + component: QutationAnalysisComponent + }, + { + path: 'worklist-main-MR', + component: WorklistMainMRComponent + }, + { + path: 'worklist-main-ITG', + component: WorkListMainItgComponent + }, + { + path: 'more-action-modal', + component: MoreActionModalComponent + }, + { + path: 'worklist-replacement-itg', + component: WorkListReplacementItgComponent + }, + { + path: 'item-history-MO', + component: MoItemHistoryComponent + }, + { + path: 'item-creation-IC', + component: WorklistMainIcComponent } ] } @@ -153,7 +158,8 @@ const routes: Routes = [ WorklistAdvancedSearchComponent, WorkListMainItgComponent, WorkListReplacementItgComponent, - MoItemHistoryComponent + MoItemHistoryComponent, + WorklistMainIcComponent // WorklistMainComponent ], entryComponents: [ @@ -161,4 +167,4 @@ const routes: Routes = [ ], providers: [WorklistService, WorklistMainService, WorklistAttachService] }) -export class NotificationPageModule {} +export class NotificationPageModule { } diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index b4d19488..dec72b70 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -23,33 +23,22 @@ import { itgRequest } from '../models/itgFormDetailsRequest'; @Injectable() export class WorklistMainService { - public static getEITNotificationBody = - "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; - public static getAbsenceNotificationBody = - "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; - public static getPoNotificationBody = - "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY"; - public static getMONotificationBody = - "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; - public static getPRNotificationBody = - "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; + public static getEITNotificationBody = "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; + public static getAbsenceNotificationBody = "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; + public static getPoNotificationBody = "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY"; + public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; + public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; + public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY"; public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY"; - public static getNotificationButtons = - "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; + public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation"; - public static getNotificationAction = - "Services/ERP.svc/REST/NOTIFICATION_ACTIONS"; - public static getNotificationRespondAtt = - "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES"; - public static getQutationAnalysisUrl = - "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; - public static getITGFormTaskCount = - 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; - public static getITGFormTaskDetails = - 'Services/COCWS.svc/REST/ITGFormsPendingTasks'; - public static getITGFormDetails = - 'Services/COCWS.svc/REST/ITGGetFormDetials'; + public static getNotificationAction = "Services/ERP.svc/REST/NOTIFICATION_ACTIONS"; + public static getNotificationRespondAtt = "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES"; + public static getQutationAnalysisUrl = "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; + public static getITGFormTaskCount = 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; + public static getITGFormTaskDetails = 'Services/COCWS.svc/REST/ITGFormsPendingTasks'; + public static getITGFormDetails = 'Services/COCWS.svc/REST/ITGGetFormDetials'; @@ -118,6 +107,21 @@ export class WorklistMainService { ); } + public getICNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getICNotificationBody, + request, + onError, + errorLabel + ); + } + public getPONotificationBody( WorkListBodyRequest: any, onError?: any, diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html new file mode 100644 index 00000000..6050b9d4 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html @@ -0,0 +1,558 @@ + + + + +
+
{{getPassNotificationDetails.SUBJECT}}
+ + + + + + {{'worklistMain,itemReq'| translate}} + + + + {{'worklistMain, action' | translate}} + + + + {{'worklistMain, attach-file' | translate}} + + + + + {{'worklistMain, info'| translate}} + + + + + + +
+

{{ 'general, empty' | translate}}

+
+ + +
+ + + +
{{pInformation}}
+
+
+ + + + +
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+ + + + + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+ +
+ + +
+
+ + + {{actionHistory.NAME}} + + +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+
+ + +
+ +
+ Note: {{actionHistory.NOTE}} + + +
+ + +
+
+ +
+ {{actionHistory.ACTION}} + + + + {{actionHistory.NOTIFICATION_DATE| + dateString }} + +
+
+
+
+
+ + +
+ +
+
+
+ + + + + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + + + + {{i+1}}. {{attachList.FILE_NAME}} + + + + + + + + +
+
+
+
+
+ + + + + + +
+ + + + + +
+ {{Lines.OPERATING_UNIT}} +
+ + +
+ {{Lines.CATEGORY}} +
+
+ + + +
+ {{Lines.REQUESTER}} +
+ + +
+ {{Lines.ANALYZED_BY}} +
+
+ + + +
+ {{Lines.APPROVED_DATE}} +
+ + +
+ {{Lines.ITEM_TYPE}} +
+
+ + + +
+ {{Lines.RELATED_TO}} +
+ + +
+ {{Lines.REQUEST_DATE| date}} + +
+
+ + + +
+ {{Lines.ANALYZED_DATE| date}} +
+ + +
+ {{Lines.URGENT_FLAG_DISP}} +
+
+ + +
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+ + + + +
{{'worklistMain, Tran_Succ' | translate}}
+
+
+
+ + + + + + + + + + + + + {{approve_label}} + + + + + + {{close_label}} + + + + + + {{reject_label}} + + + + + {{reqInfo_label}} + + + + {{'worklistMain, skip' | translate}} + + + + + {{'worklistMain, more' | translate}} + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss new file mode 100644 index 00000000..ffee0278 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss @@ -0,0 +1,144 @@ +// .itemHISBtn{ +// padding: 5px; +// color: var(--light); +// background: var(--darkgray); +// border-radius: 3px; +// width: 85%; +// height: 40px; +// } + + +// .rowBtn{ +// display: flex; +// flex-direction: row; +// justify-content: center; +// align-items: center; +// background: white; +// } + + + +// .rowBorder{ +// border-bottom: solid 0.03cm var(--grayBG); + +// } +// .colBorder{ +// border-right: solid 0.03cm var(--grayBG); + +// } + +// .dateActionHistory{ +// text-align: end; +// // margin-top: -25px; +// } + + +// .actionBtn{ +// --border-radius: 50% !important; +// height: 55px; +// width: 55px; +// --background: var(--newgreen); // will be dynamic +// background: transparent; +// margin:10px; +// } + +// .itemAttch{ +// border-radius: 11px; +// margin: 8px; +// --min-height: 60px; +// --max-height: 60px; +// } + +// .less { +// max-height: 54px; +// } + +// .noDataDiv{ +// background: #ffffff; +// height: 11%; +// text-align: center; +// padding-top: 1px; +// border-radius: 10px; +// margin: 10px; +// } + + +// .container { +// font-size: 14px; +// line-height: 14px; +// height: 16px; +// overflow: hidden; +// text-align: justify; +// } + +// .show { +// overflow: visible; +// height: auto; +// } + +// .showMore{ +// padding: 0px; +// background: transparent; +// color: blue; +// text-decoration: underline; +// font-size: 14px; +// } + +// .succssfullMSG{ +// height: 100%; +// width: 100%; +// background: var(--newgreen); +// color: white; +// font-weight: bold; +// font-size: 20px; +// text-align: center; +// vertical-align: middle; +// padding-top: 30px; +// } + +// .succssfullIcon{ +// width: 60%; +// text-align: center; +// height: 60%; +// } + +// .subjectNotification{ +// text-align: center; +// padding-top: 10px; +// font-weight: bold; +// } + +.no-padding-label { + padding: 0px !important; +} + +.margin-left { + margin-left: 0px; +} + +.active-Segment { + font-size: 0.3cm !important; + background: #269DB8 !important; + text-transform: none; + --color-checked: none; + border-radius: 100px; + border:0; + } + .active-Segment ion-label{ + font-size: 11px; + color: white !important; + } + .normal-Segment ion-label{ + color: black !important; + font-size: 11px; + } + .normal-Segment { + font-size: 0.3cm !important; + text-transform: none; + --color-checked: none; + border: 0; + } + .action-btn { + white-space: nowrap; + font-size: 10px; + } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts new file mode 100644 index 00000000..5364d18a --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistMainIcComponent } from './worklist-main-ic.component'; + +describe('WorklistMainIcComponent', () => { + let component: WorklistMainIcComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistMainIcComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistMainIcComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts new file mode 100644 index 00000000..0e6f77e5 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts @@ -0,0 +1,1272 @@ +import { Component, OnInit, ElementRef, 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 { WorkListBodyRequest } from "../models/NotificationBodyReq"; +import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; +import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes"; +import { NotificatonButtonResponse } from "../models/NotificationButtonRes"; +import { WorkListActionRequest } from "../models/NotificationActionReq"; +import { WorkListButtonRequest } from "../models/NotificationButtonReq"; +// import { isDate } from 'angular6-json-schema-form'; +import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; +import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request"; +import { WorklistMainService } from "../service/work-list.main.service"; +import { HomeComponent } from "src/app/notification/home/home.component"; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; +import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; +import { Events, ModalController } from '@ionic/angular'; +import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes'; +import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes'; +import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes'; +import { WorklistAttachService } from 'src/app/absence/service/work-list-attach.service'; +import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes'; +import { PRNotificatonBodyList } from '../models/PRNotificationBodyList'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { WorklistService } from '../service/worklist.service'; +import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.component'; +import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; +import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; +import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; +import { POItemHistoryRes } from '../models/POItemHistoryRes'; +import { POItemHistoryRequest } from '../models/POItemHistoryReq'; +import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; +import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq'; +import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component' +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; +import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; +import { IonSlides } from '@ionic/angular';​ + +@Component({ + selector: 'app-worklist-main-ic', + templateUrl: './worklist-main-ic.component.html', + styleUrls: ['./worklist-main-ic.component.scss'], +}) +export class WorklistMainIcComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; + private WorkListBodyObj: WorkListBodyRequest; + private WorkListButtonsObj: WorkListButtonRequest; + private WorkListActionObj: WorkListActionRequest; + private WorkListActionHistoryObj: WorkListActionHistoryRequest; + private WorkListAttachObj: WorkListButtonRequest; + private PRList: PRNotificatonBodyList; + + public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; + public static PASS_PO_INFO = "passPOInfo"; + public static PASS_PO_HEADER_ID = "passPOHeader"; + public static PASS_ACTION_MODE = "passActionMode"; + public static PASS_ACTION_MORE = "passActioMore"; + public isPostNoLoad = true; + public worklistNotifications: any; + public totalRequestCount = 0; + getPassNotificationDetails: any; + public static PASS_RES_ATTR = "passResAttr"; + TransactionID: number = -999; + notificationBodyRes: any = []; + actionHistoryRes: any = []; + notificationButtonRes: any; + actionMode: any; + pInformation: string = ""; + pQuestion: string = ""; + RespondAttributesListRes: any; + schemaNotific: any; + NotRespondAttributeList: any; + Resp2_val: any; + notExampleJsonObject: any; + hideForwordEmployee: any; + exampleJsonObject: any; + dataOfAttr: any; + P_RESPOND_ATTRIBUTES_TBL: any; + selEmployeeID: any; + actionType: string = ""; + notificationArray: any; + notificationDynamicAttributeArr: any; + private textInput: TextInput; + private textArea: TextAreaInput; + notificationCount: any; + attachmentRes: any; + PRHeader: any;//change the tpye later + PRLines: any;//change the tpye later + IsReachEnd: boolean = true; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 100; + headerTotal: any; + totalH: any; + valueH: any; + taxH: any; + taxvalueH: any; + NotificationGetRespondAttributesList: any; + confirmMsg: string; + delMsg: string; + closeMsg: string; + POHeader: any; + POLines: any; + PO_NUMBER: any; + itemHistoryRes: any; + QutationAnalysisRes: any; + activeSegment: any = "line_details"; + lines_note_limit: number = 24; + notiActionBtnMore: any = []; + demoeAttach: any = []; + orgNote: any; + truncating: boolean = true; + hidden: boolean = true; + selectedIndex = -1; + showLessBtn: boolean; + showMoreBtn: boolean = true; + selectedAction: any = []; + messageSuccess: boolean = false; + approveDis: boolean = false; + rejectDis: boolean = false; + requestDis: boolean = false; + moreDisabled: boolean = true; + direction: string; + defaultSegment = ''; + approve_label: any; + reject_label: any; + reqInfo_label: any; + closeDis: boolean = false; + selectedFilter: string; +; + close_label: any; + + constructor( + public common: CommonService, + public ts: TranslatorService, + public worklistMainService: WorklistMainService, + public elementRef: ElementRef, + public menuService: MenuService, + public events: Events, + public worklistAttachService: WorklistAttachService, + private modalCtrl: ModalController, + public worklistService: WorklistService, + public dashboredService: DashboredService, + + ) { + this.direction = TranslatorService.getCurrentLanguageName() + this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); + this.WorkListActionHistoryObj.P_PAGE_NUM = 1; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + } + + ngOnInit() { + this.WorkListAttachObj = new WorkListButtonRequest(); + this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); + this.intializeNotificationDetail(); + }//ngOn + + + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + if (this.activeSegment === 'line_details') { + this.slides.slideTo(0); + } + else if (this.activeSegment === 'action-history') { + this.slides.slideTo(1); + } + else if (this.activeSegment === 'attach') { + this.slides.slideTo(2); + } + else if (this.activeSegment === 'info') { + this.slides.slideTo(3); + } + // console.log(" event.detail.value: " + event.detail.value); + } + + public slideChanged(event: any) { + this.slides.getActiveIndex().then(index => { + // console.log(index); + // console.log(event); + if (index === 0) { + this.activeSegment = 'line_details'; + } + else if (index === 1) { + this.activeSegment = 'action-history'; + } + else if (index === 2) { + this.activeSegment = 'attach'; + } + else if (index === 3) { + this.activeSegment = 'info'; + } + // console.log(this.activeSegment); + }); + } + + + + + intializeNotificationDetail() { + this.approveDis = false; + this.rejectDis = false; + this.requestDis = false; + this.closeDis = false; + this.moreDisabled = true; + + if (this.messageSuccess) { + document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; + } + // console.log("intializeNotificationDetail"); + this.getPassNotificationDetails = this.common.sharedService.getSharedData( + HomeComponent.NOTIFICATION_DATA, + false + ); + // console.log(this.getPassNotificationDetails.ROW_NUM); + this.notificationArray = this.common.sharedService.getSharedData( + HomeComponent.NOTIFICATION_ARR, + false + ); + this.WorkListBodyObj = new WorkListBodyRequest(); + this.WorkListButtonsObj = new WorkListButtonRequest(); + + this.WorkListActionObj = new WorkListActionRequest(); + + this.WorkListBodyObj.P_TRANSACTION_ID = this.TransactionID; + this.WorkListBodyObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + this.WorkListBodyObj.P_PAGE_NUM = 1; + this.WorkListBodyObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + + this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + + this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; + this.WorkListActionObj.P_ACTION_MODE = ""; + this.WorkListActionObj.P_COMMENTS = ""; + this.WorkListActionObj.P_APPROVER_INDEX = null; + + this.WorkListActionHistoryObj.P_PAGE_NUM = 1; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + + this.WorkListAttachObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + + this.getNotificationButtons(this.WorkListButtonsObj); + this.getNotificationResAttr(this.WorkListButtonsObj); + this.getActionHistory(this.WorkListActionHistoryObj); + this.getAttachmentNotification(this.WorkListAttachObj); + + + if (this.getPassNotificationDetails.REQUEST_TYPE == "ITEM_CREATION") { + this.getICNotificationDetails(this.WorkListBodyObj); + } + } + + public segmentChanged1(event: any) { + this.activeSegment = event.detail.value; + // console.log(" event.detail.value: " + event.detail.value); + } + + getICNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getICNotificationBody(notificationBodyObj) + .subscribe((result: any) => { + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "IC"); + }); + } + + handleWorkListBodyResult(result, Type) { + this.notificationBodyRes = []; + if (this.common.validResponse(result)) { + this.pInformation = result.P_INFORMATION; + this.pQuestion = result.P_QUESTION; + if (Type == "EIT") { + if (result.GetEITCollectionNotificationBodyList) { + this.notificationBodyRes = + result.GetEITCollectionNotificationBodyList; + } + } else if (Type == "ABSENCE") { + // console.log("ABSENCE"); + if (result.GetAbsenceCollectionNotificationBodyList) { + this.notificationBodyRes = + result.GetAbsenceCollectionNotificationBodyList; + } + } else if (Type == "PR") { + if (result.GetPrNotificationBodyList) { + // console.log("PR"); + + this.PRHeader = result.GetPrNotificationBodyList.PRHeader; + this.PRLines = result.GetPrNotificationBodyList.PRLines; + for (var i = 0; i < this.PRHeader.length; i++) { + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + + } + + // HDR_ATTRIBUTE_VALUE + } + this.notificationBodyRes = + result.GetPrNotificationBodyList; + } + + } else if (Type == "PO") { + if (result.GetPoNotificationBodyList) { + // console.log("PO"); + + this.POHeader = result.GetPoNotificationBodyList.POHeader; + this.POLines = result.GetPoNotificationBodyList.POLines; + for (var i = 0; i < this.POHeader.length; i++) { + this.PO_NUMBER = this.POHeader[i].PO_NUMBER; + + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + } + + // HDR_ATTRIBUTE_VALUE + } + this.notificationBodyRes = + result.GetPoNotificationBodyList; + } + } else if (Type == "IC") { + if (result.GetItemCreationNtfBodyList) { + this.POHeader = result.GetItemCreationNtfBodyList.ItemCreationHeader; + this.POLines = result.GetItemCreationNtfBodyList.ItemCreationLines; + for (var i = 0; i < this.POHeader.length; i++) { + this.PO_NUMBER = this.POHeader[i].PO_NUMBER; + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + } + + // HDR_ATTRIBUTE_VALUE + } + this.notificationBodyRes = + result.GetPoNotificationBodyList; + } + }// + } + } //End handleWorkListBodyResult + + + + + getNotificationButtons(notificationButtonsObj) { + this.worklistMainService + .getNotificationButtons(notificationButtonsObj) + .subscribe((result: NotificatonButtonResponse) => { + this.handleWorkListButtonsResult(result); + }); + } + + handleWorkListButtonsResult(result) { + if (this.common.validResponse(result)) { + this.notiActionBtnMore = [] + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetNotificationButtonsList != null) { + this.notificationButtonRes = result.GetNotificationButtonsList; + this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); + // console.log("test" + this.notificationButtonRes.length); + for (let i = 0; i < this.notificationButtonRes.length; i++) { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { + this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL; + + this.approveDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { + this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL; + this.rejectDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { + this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL; + + this.requestDis = true; + } // if result == null + else if // if result == null + (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") { + this.close_label = this.notificationButtonRes[i].BUTTON_LABEL; + this.closeDis = true; + } + else if ( + this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") { + this.moreDisabled = false; + + } + + } // valid it + + } // valid it + } // End handleWorkListButtonsResult + + + } + applyAction(WorkListActionObj) { + // console.log("applyactio"); + this.worklistMainService + .actionButton(WorkListActionObj) + .subscribe((result: any) => { + this.handleApplayActionResult(result); + }); + } + + handleApplayActionResult(result) { + if (this.common.validResponse(result)) { + // tslint:disable-next-line: triple-equals + if (result.MessageStatus == 1) { + this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + // this.openNotificationsDashboard(); + this.nextNotfification(); + }, 5000); + } + } // valid it + } + + // public nextNotfification() { + // //let itemExist = false; + // let itemNo = this.getPassNotificationDetails.ROW_NUM; + // itemNo += 1; + // if (itemNo > this.notificationArray.length) { + // this.common.openNotificationPage(); + // } else { + // for (let i = 0; i < this.notificationArray.length; i++) { + // if (this.notificationArray[i].ROW_NUM == itemNo) { + // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // // itemExist = true; + // this.intializeNotificationDetail(); + // break; + // } + // } + // // if(itemExist==false){ + // // this.nextNotfification(); + // // } + // } + // } + + public nextNotfification() { + if (document.getElementById('notificationDynamicFieldsPO') != null) { + document.getElementById('notificationDynamicFieldsPO').innerHTML = ''; + } + + let itemNo = this.getPassNotificationDetails.ROW_NUM; + let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; + index += 1; + + if (index < this.notificationArray.length) { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + this.activeSegment = 'line_details'; + if(this.selectedFilter === 'ALL'){ + this.checkRequestType(index); + } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { + this.checkRequestType(index); + }else { + this.common.openNotificationPage(); + } + } else { + this.common.openNotificationPage(); + } + } + + + checkRequestType(index){ + if (this.notificationArray[index].REQUEST_TYPE === 'PO') { + this.intializeNotificationDetail(); + } else + if (this.notificationArray[index].REQUEST_TYPE === 'PR') { + this.common.openWorklistMainPRPage(); + } else + if (this.notificationArray[index].REQUEST_TYPE === 'MO') { + this.common.openWorklistMainMRPage(); + } else { + this.common.openWorklistMainPage(); + } + } + + actionButton(action) { + + // console.log("actionButton" + action); + // alert("don't forget"); + //let ButtonAction: string = this.actionType; + let ButtonAction: string = action; + + var responseAttrDic = this.notExampleJsonObject; + this.P_RESPOND_ATTRIBUTES_TBL = []; + for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) { + let obj: any = {}; + obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME; + if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") { + obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value; + } + // else if (isDate(responseAttrDic[key])) { + // obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key]; + // } + else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") { + obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value; + } + this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + } + // console.log("a" + this.P_RESPOND_ATTRIBUTES_TBL); + + let repUserName = this.selEmployeeID; + // if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { + // let obj: any = {}; + // repUserName = ""; + // obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; + // obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; + // this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + // } + + if ( + ButtonAction == "APPROVE" || + ButtonAction == "REJECT" || + ButtonAction == "DEL" || + ButtonAction == "CLOSE" + ) { + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; + this.WorkListActionObj.P_ACTION_MODE = ButtonAction; + this.WorkListActionObj.P_COMMENTS = ""; + this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; + + //sheardData + + // this.common.sharedService.setSharedData( + // this.WorkListActionObj, + // WorklistMainPRComponent.PASS_NOTIFICATION_INFO + // ); + if (ButtonAction == "APPROVE") { + this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') + } + else if (ButtonAction == "REJECT") { + this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') + + } + else if (ButtonAction == "DEL") { + this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg') + + } + else if (ButtonAction == "CLOSE") { + this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') + + } + + this.common.confirmAlertDialogAction( + () => { + this.applyAction(this.WorkListActionObj); + }, this.ts.trPK('general', 'ok'), + () => { }, this.ts.trPK('general', 'cancel'), + this.ts.trPK('vacation-rule', 'confirmation'), + this.confirmMsg); + + + + + + // alert.onDidDismiss((data) => { + // if (data == true) { + // this.continueDelete(attach); + // } + // }); + + //this.openApplyModal(this.WorkListActionObj); + + + + ////////////this.applyAction(this.WorkListActionObj); + } + + if (ButtonAction == "RFC") { + // alert("Return For Correction"); + this.WorkListActionObj.P_ACTION_MODE = ButtonAction; + // this.navCtrl.push("WorkListRfcPage", { + // passNotificationInfo: this.getPassNotificationDetails, + // passActionMode: ButtonAction, + // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainIcComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainIcComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainIcComponent.PASS_RES_ATTR + ); + //this.common.openWorklistRFCPage(); + this.openRFCModal(); + } else if (ButtonAction == "ANSWER_INFO") { + // this.navCtrl.push("WorkListReplacmentRollPage", { + // pQuestion: this.pQuestion, + // passNotificationInfo: this.getPassNotificationDetails, + // passActionMode: ButtonAction, + // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL + // }); + this.common.sharedService.setSharedData(this.pQuestion, "pQuestion"); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainIcComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainIcComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainIcComponent.PASS_RES_ATTR + ); + // console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL); + + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); + } else if ( + ButtonAction == "DELEGATE" || + ButtonAction == "REQUEST_INFO" || + ButtonAction == "TRANSFER" || + ButtonAction == "TRANSFER_INFO" || + ButtonAction == "APPROVE_AND_FORWARD" || + ButtonAction == "FORWARD" + + + ) { + // alert("multi option: "+ ButtonAction); + this.WorkListActionObj.P_ACTION_MODE = ButtonAction; + // this.navCtrl.push("WorkListReplacmentRollPage", { + // passNotificationInfo: this.getPassNotificationDetails, + // passActionMode: ButtonAction, + // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainIcComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainIcComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainIcComponent.PASS_RES_ATTR + ); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); + } else if ( + ButtonAction == "UPDATE_ACTION" || + ButtonAction == "CONTINUE_ACTION" + ) { + if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { + this.common.sharedService.setSharedData( + this.notificationBodyRes, + EITNotificatonBodyResponse.SHARED_DATA + ); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + EITNotificatonBodyResponse.NOT_WORKLIST + ); + // this.navCtrl.push("EitUpdateListPage"); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { + this.common.sharedService.setSharedData( + this.notificationBodyRes, + AbsenceNotificatonBodyResponse.SHARED_DATA + ); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + AbsenceNotificatonBodyResponse.NOT_WORKLIST + ); + // this.navCtrl.push("SubmitAbsencePage", { + // dirfromNotificationPage: true, + // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification + // }); + this.common.openConfirmAbsece(); + } + } + else if (this.notificationButtonRes.length > 0 && !ButtonAction) { + (this.elementRef.nativeElement.querySelectorAll( + "ion-item" + ) as HTMLElement[]).forEach(x => { + if (x.classList.contains("requiredItem")) { + x.classList.add("ng-touched"); + x.classList.remove("ng-untouched"); + } + }); + this.common.presentAlert( + this.ts.trPK("worklistMain", "actionRequird") + ); + } + } + + openActionHistory() { + // this.navCtrl.push("WorkListActionHistoryPage", { + // passNotificationInfo: this.getPassNotificationDetails + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainIcComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistHistoryPage(); + } + + + + openSupportDocuments() { + // this.navCtrl.push("WorkListAttachPage", { + // passNotificationInfo: this.getPassNotificationDetails + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainIcComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistAttachPage(); + } + + getNotificationResAttr(notificationButtonsObj) { + // console.log("getNotificationResAttr"); + this.NotRespondAttributeList = []; + + this.worklistMainService + .notificationResponseAttr(notificationButtonsObj) + .subscribe((result: NotificatonButtonResponse) => { + this.handleNotificationResAttrResult(result); + }); + } + + handleNotificationResAttrResult(result) { + if (this.common.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + this.NotRespondAttributeList = + result.NotificationGetRespondAttributesList; + if ( + result.NotificationRespondRolesList != "" && + result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null && + result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined + ) { + this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME; + this.hideForwordEmployee = result.NotificationRespondRolesList[0]; + } + this.notificationDynamicFields(result.NotificationGetRespondAttributesList); + this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList; + + this.common.sharedService.setSharedData( + this.NotificationGetRespondAttributesList, + WorklistMainIcComponent.PASS_RES_ATTR + ); + + this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; + if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); + } // valid it + } // End handleWorkListButtonsResult + + notificationDynamicFields(notificationAttr) { + const containerId = 'notificationDynamicFieldsPO'; + for (let i = 0; i < notificationAttr.length; i++) { + if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") { + this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); + // console.log(this.textArea); + + } else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") { + + } else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") { + + } else if (notificationAttr[i].ATTRIBUTE_TYPE == "NUMBER") { + + } + } + } + + openNotificationBody() { + if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { + this.common.sharedService.setSharedData( + this.notificationBodyRes, + EITNotificatonBodyResponse.SHARED_DATA + ); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + EITNotificatonBodyResponse.NOT_WORKLIST + ); + // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); + this.common.sharedService.setSharedData("EIT", "NotBodyType"); + this.common.openNotificationDetailsPage(); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { + this.common.sharedService.setSharedData( + this.notificationBodyRes, + AbsenceNotificatonBodyResponse.SHARED_DATA + ); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + AbsenceNotificatonBodyResponse.NOT_WORKLIST + ); + this.common.sharedService.setSharedData("ABSENCE", "NotBodyType"); + //this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" }); + this.common.openNotificationDetailsPage(); + } + } + + // getNotificationCountAfterSubmit() { + // const req: any = {}; + // this.menuService.getNotificationCount(req).subscribe((result: any) => { + // if (this.common.validResponse(result)) { + // this.notificationCount = + // result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM; + // if (this.notificationCount <= 0) { + // this.notificationCount = null; + // } + // this.events.publish("getNotCount", this.notificationCount); + // } + // }); + // } + + + + + getAttachmentNotification(WorkListAttachObj) { + this.attachmentRes = []; + this.worklistAttachService.getAttach(WorkListAttachObj). + subscribe((result: NotificationGetAttachResponse) => { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.common.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + } + + getActionHistory(WorkListActionHistoryObj) { + this.IsReachEnd = true; + this.actionHistoryRes = []; + this.worklistService.getActionHistory(WorkListActionHistoryObj). + subscribe((result: WorkListActionHistoryResponse) => { + this.handleWorkListActionHistoryResult(result); + }); + + + } + handleWorkListActionHistoryResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetActionHistoryList)) { + this.actionHistoryRes = result.GetActionHistoryList; + + this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + let lastItemIndex = this.actionHistoryRes.length - 1; + if (result.GetActionHistoryList[lastItemIndex]) { + let lastitem = result.GetActionHistoryList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + this.turnCateFun(this.actionHistoryRes); + + } + } + + async openNoteDetail(note, sender) { + // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); + // modalPage.present(); + // console.log("note" + note); + + this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') + this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') + + const modal = await this.modalCtrl.create({ + component: ViewNoteModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + return await modal.present(); + } + + doInfinite(infiniteScroll) { + // console.log("doInfinite action history"); + if (!this.IsReachEnd) { + this.worklistService.getActionHistory(this.WorkListActionHistoryObj). + subscribe((result: any) => { + if (this.common.validResponse(result)) { + if (result.GetActionHistoryList != undefined) { + this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + + (result.GetActionHistoryList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.actionHistoryRes.push(element); + }, (Error) => console.log(Error), () => infiniteScroll.target.complete()); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + infiniteScroll.target.complete(); + + }); + } else { + if (infiniteScroll) + infiniteScroll.target.complete(); + } + }//end infiniteScroll + + //**********Attachment *****************// + + + async OpenAttachFiles(value, Type) { + // let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type }); + // modal.present(); + + this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') + const modal = await this.modalCtrl.create({ + component: WorkListAttachViewComponent + }); + + return await modal.present(); + } + + getItemHistory(itemID) { + // console.log(itemID); + this.IsReachEnd = false; + const request = new POItemHistoryRequest(); + request.P_ITEM_ID = parseInt(itemID); + request.P_PAGE_LIMIT = 100; + request.P_PAGE_NUM = 1; + this.worklistMainService.getPOItemHistory(request). + subscribe((result: POItemHistoryRes) => { + // this.common.sharedService.setSharedData( + // result.GetItemHistoryList, + // WorklistMainIcComponent.ItemHistoryList + // ); + this.common.sharedService.setSharedData( + itemID, + WorklistMainIcComponent.PASS_PO_INFO + ); + //open page + // this.common.openItemHistoryPage(); + this.handleItemHistoryResult(result); + }); + } + + + handleItemHistoryResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetPoItemHistoryList)) { + this.common.openItemHistoryPage(); + + } + } + else { + this.common.presentAlert( + this.ts.trPK("general", "empty") + ); + } + + } + + getQutationAnalysis(headerID, itemID) { + // console.log(itemID + headerID); + this.IsReachEnd = false; + const request = new QuotationAnalysisRequest(); + request.P_ITEM_ID = parseInt(itemID); + request.P_PO_HEADER_ID = headerID; + request.P_PAGE_LIMIT = 100; + request.P_PAGE_NUM = 1; + this.worklistMainService.getQutationAnalysis(request). + subscribe((result: QuotationAnalysisResponse) => { + this.common.sharedService.setSharedData( + itemID, + WorklistMainIcComponent.PASS_PO_INFO + ); + this.common.sharedService.setSharedData( + headerID, + WorklistMainIcComponent.PASS_PO_HEADER_ID + ); + //open page + + this.handleQutationAnalysisResult(result); + }); + + + } + handleQutationAnalysisResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetQuotationAnalysisList)) { + + //open page + //set sheard data + // + + this.common.openQutationAnalysisPage(); + + + // this.QutationAnalysisRes = result.GetQutationAnalysisList; + // this.P_PAGE_NUM++; + // let lastItemIndex = this.QutationAnalysisRes.length - 1; + // if (result.GetQutationAnalysisList[lastItemIndex]) { + // let lastitem = result.GetQutationAnalysisList[lastItemIndex]; + // if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + // this.IsReachEnd = true; + // } else { + // this.IsReachEnd = false; + // } + // } + }//hasData + else { + this.common.presentAlert( + this.ts.trPK("general", "empty") + ); + } + + } + } + + loadMoreNotificationBody() { + // console.log("loadMoreNotificationBody PO"); + if (!this.IsReachEnd) { + // console.log("this.IsReachEnd" + this.IsReachEnd); + + this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). + subscribe((result: any) => { + if (this.common.validResponse(result)) { + if (result.GetPoNotificationBodyList != undefined) { + this.P_PAGE_NUM++; + this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetPoNotificationBodyList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.notificationBodyRes.push(element); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("test") + ); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + // infiniteScroll.target.complete(); + + }); + } else { + // if (infiniteScroll) + // infiniteScroll.target.complete(); + } + }//end infiniteScroll + + loadMoreActionHistory() { + console.log("doInfinite action history MR"); + + if (!this.IsReachEnd) { + this.worklistService.getActionHistory(this.WorkListActionHistoryObj). + subscribe((result: any) => { + if (this.common.validResponse(result)) { + if (result.GetActionHistoryList != undefined) { + this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetActionHistoryList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.actionHistoryRes.push(element); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + // infiniteScroll.target.complete(); + + }); + } else { + //if (infiniteScroll) + //infiniteScroll.target.complete(); + } + }//end infiniteScroll + + async openMoreActions() { + + + + + const modal = await this.modalCtrl.create({ + component: MoreActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + // this.selectedAction = data.data; + this.actionType = data.data.BUTTON_ACTION; + console.log(this.actionType); + ///call Action button + this.actionButton(this.actionType); + } + }); + + return await modal.present(); + + + + + } + + /////////////////////////////////////////// + + public checkLines(note) { + console.log(note.split("\n").length); + console.log(note.length); + + if (note && note != null) { + + + return (note.length > this.lines_note_limit) ? true : false; + + + + } + + + + return false; + }; + + + public turnCateFun(actionHis) { + for (let i = 0; i < actionHis.length; i++) { + actionHis[i].visible = false; + + } + // actionHis.map((obj) => { + // obj.visible = false; + // // or via brackets + // // obj['total'] = 2; + // return obj; + // }) + this.actionHistoryRes = actionHis; + console.log("test"); + } + + async openRepRolModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListReplacementRollComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data.data == "cancel" || data.data.data == undefined) { + return; + } else if (data.data.data == "Success") { + // this.openNotificationsDashboard(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.nextNotfification(); + }, 2000); + // this.nextNotfification(); + + } + }); + + return await modal.present(); + + + + + } + + async openRFCModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListRfcComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + + openNotificationsDashboard() { + this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => { + if (this.common.validResponse(result)) { + this.worklistNotifications = result; + this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; + this.common.sharedService.setSharedData(result, 'worklistNotifications'); + } + }); + } + + +} diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index 02711308..43de0020 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -248,7 +248,7 @@ - +

{{ 'general, notAttch' | translate}}

From 5619ad7ba8d1d9857ccd7b8ba74006f2272ef47a Mon Sep 17 00:00:00 2001 From: enadhilal Date: Sun, 23 May 2021 15:55:31 +0300 Subject: [PATCH 3/3] add translate in IC --- .../worklist-main-ic.component.html | 172 ++++-------------- Mohem/src/assets/localization/i18n.json | 116 ++++++++++++ 2 files changed, 148 insertions(+), 140 deletions(-) diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html index 6050b9d4..8c45af78 100644 --- a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html @@ -50,207 +50,141 @@ -
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +

-
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 4ec28a25..b4a33926 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2036,6 +2036,122 @@ "empty-comment": { "en": "you shoud add comment", "ar": "يجب عليك اضافة تعليق" + }, + "product-name":{ + "en":"Product Name", + "ar":"اسم المنتج" + }, + "product-description":{ + "en":"Product Description", + "ar":"وصف للمنتج" + }, + "Unit-price":{ + "en":"Unit Price", + "ar":"سعر الوحدة" + }, + "manufacturer-name":{ + "en":"Manufacturer Name", + "ar":"اسم المصنع" + }, + "manufacturer-part-number":{ + "en":"Manufacturer Part Number", + "ar":"رقم قطعة المصنع" + }, + "supplier-name":{ + "en":"Supplier Name", + "ar":"اسم المورد" + }, + "supplier-contact":{ + "en":"Supplier Contact", + "ar":"عقد المورد" + }, + "charge-to-patient":{ + "en":"Charge to Patient", + "ar":"رسوم على المرضى" + }, + "justification":{ + "en":"Justification", + "ar":"تبرير" + }, + "item-code":{ + "en":"Item Code", + "ar":"رمز الصنف" + }, + "item-description":{ + "en":"Item Description", + "ar":"وصف الصنف" + }, + "group-code":{ + "en":"Group Code", + "ar":"رمز المجموعة" + }, + "group-description":{ + "en":"Group Description", + "ar":"وصف المجموعة" + }, + "subgroup-code":{ + "en":"Subgroup Code", + "ar":"رمز المجموعة الفرعية" + }, + "subgroup-description":{ + "en":"Subgroup Description", + "ar":"وصف المجموعة الفرعية" + }, + "primary-uom":{ + "en":"Primary UOM", + "ar":"Primary UOM" + }, + "template-name":{ + "en":"Template Name", + "ar":"اسم القالب" + }, + "item-creation-status":{ + "en":"Item Creation Status", + "ar":"حالة انشاء العنصر" + }, + "standardization-approval-status":{ + "en":"Standardization Approval Status", + "ar":"حالةالموافقة على المعايرة" + }, + "standardization-approval-rejection-reason":{ + "en":"Standardization Approval Rejection Reason", + "ar":"سبب رفض الموافقة على المعايرة" + }, + "category":{ + "en":"Category", + "ar":"فئة" + }, + "requester":{ + "en":"Requester", + "ar":"مقدم الطلب" + }, + "analyzed-by":{ + "en":"Analyzed By", + "ar":"تحليل بواسطة" + }, + "approved-date":{ + "en":"Approved Date", + "ar":"تاريخ الموافقة" + }, + "item-type":{ + "en":"Item Type", + "ar":"نوع الصنف" + }, + "related-to":{ + "en":"Related To", + "ar":"" + }, + "request-date":{ + "en":"Request Date", + "ar":"متعلق بـ" + }, + "analyzed-date":{ + "en":"Analyzed Date", + "ar":"تاريخ التحليل" + }, + "urgent":{ + "en":"Urgent", + "ar":"عاجل" } }, "worklistMain": {