From d09d251c716fde62be6df40e02b669e955c86e2d Mon Sep 17 00:00:00 2001 From: ashwaq Date: Thu, 28 Nov 2019 16:22:56 +0300 Subject: [PATCH] PR Worklist --- .../services/common/common.service.ts | 4 +- .../app/notification/home/home.component.ts | 11 +- .../app/notification/notification.module.ts | 15 +- .../view-note-modal.component.html | 1 + .../view-note-modal.component.scss | 9 + .../view-note-modal.component.ts | 4 + .../worklist-main-pr.component.html | 400 ++++++++++ .../worklist-main-pr.component.scss | 231 ++++++ .../worklist-main-pr.component.spec.ts | 27 + .../worklist-main-pr.component.ts | 699 ++++++++++++++++++ Mohem/src/assets/localization/i18n.json | 59 +- Mohem/src/imgs/noteLarge.png | Bin 0 -> 1468 bytes Mohem/src/imgs/noteSmall.png | Bin 0 -> 764 bytes Mohem/src/theme/styles.scss | 26 +- 14 files changed, 1455 insertions(+), 31 deletions(-) create mode 100644 Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html create mode 100644 Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss create mode 100644 Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.spec.ts create mode 100644 Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts create mode 100644 Mohem/src/imgs/noteLarge.png create mode 100644 Mohem/src/imgs/noteSmall.png 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 8f2dbb56..dc49580f 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -980,7 +980,9 @@ export class CommonService { public openWorklistMainPage() { this.nav.navigateForward(["/notification/worklist-main"]); } - + public openWorklistMainPRPage() { + this.nav.navigateForward(["/notification/worklist-main-PR"]); + } public openWorklistReplacementRollPage() { this.nav.navigateForward(["/notification/work-list-replacement-roll"]); } diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 6b3b03d6..1b56f510 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -153,8 +153,17 @@ export class HomeComponent implements OnInit { } openNotificationDetail(obj) { + console.log(obj); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); - this.common.openWorklistMainPage(); + //this.common.openWorklistMainPage(); + if(obj.REQUEST_TYPE == "PR"){ + this.common.openWorklistMainPRPage(); + } + else{ + this.common.openWorklistMainPage(); + + } + //this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); } onChangeView(selectedValue: any) { diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index 65f7109f..0f19d3f0 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -19,9 +19,11 @@ import { ViewReplacementModalComponent } from './view-replacement-modal/view-rep import { WorkListActionHistoryComponent } from './work-list-action-history/work-list-action-history.component'; import { WorkListDetailsComponent } from './work-list-details/work-list-details.component'; import { WorklistAttachService } from '../absence/service/work-list-attach.service'; +import { WorklistMainPRComponent } from './worklist-main-pr/worklist-main-pr.component'; // import { WorklistMainComponent } from './worklist-main/worklist-main.component'; + const routes: Routes = [ { path: '', @@ -66,12 +68,12 @@ const routes: Routes = [ { path: 'work-list-details', component: WorkListDetailsComponent - } + }, - // { - // path:'worklist-main', - // component:WorklistMainComponent - // } + { + path:'worklist-main-PR', + component:WorklistMainPRComponent + } ] } ]; @@ -95,7 +97,8 @@ const routes: Routes = [ ViewReplacementModalComponent, WorkListActionHistoryComponent, WorkListAttachComponent, - WorkListDetailsComponent + WorkListDetailsComponent, + WorklistMainPRComponent // WorklistMainComponent ], providers:[WorklistService,WorklistMainService, WorklistAttachService] diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html index 14b1091b..0dc37eb2 100644 --- a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html @@ -11,6 +11,7 @@ +

{{getTextNote}}

diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss index e69de29b..6a5e667f 100644 --- a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss @@ -0,0 +1,9 @@ +.ion-modal{ +width: 90%; +height: 50%; +top: 20%; +left: 5%; +right: 5%; +bottom: 5%; +border: solid 1px red; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts index 357b7ec5..79bee7b5 100644 --- a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts @@ -10,11 +10,15 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service export class ViewNoteModalComponent implements OnInit { getTextNote: any; + getSenderNote:any; constructor(private modalCtrl: ModalController, private cs: CommonService) { } ngOnInit() { + console.log("Notes"); this.getTextNote = this.cs.sharedService.getSharedData('ViewNoteModalPage'); + this.getSenderNote = this.cs.sharedService.getSharedData('ViewNoteModalPageSender'); + } closeModal() { diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html new file mode 100644 index 00000000..41816b7c --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -0,0 +1,400 @@ + + + {{ts.trPK('worklistMain','title')}} + + + + + + + + + + {{ts.trPK('worklistMain','info')}} + + + + {{ts.trPK('worklistMain','itemReq')}} + + + + + {{'worklistMain, actionHis' | translate}} + + + + + + {{'general, attachment' | translate}} + + + + + + + + + + + + +
{{pInformation}}
+ + + + + + + + +
+ + +
+
+ + + + +
+ + + +
+
+ + + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + + +
+ + + +
+
+ + + +
+ + + + + + +
+ + +
+
+ +
+
+ + + + + + + +
+ +
+ + + +
+ +
+
+ +
+ + {{'actionHis, action' | translate}} + + + {{notificationButtons.BUTTON_LABEL}} + + +
+
+ + +
+ + + + + +
+ + + + + + + + + + +
+ + +
+ + + + +
+ + +
+
+ + + + +
+ + +
+ + + + +
+ + + +
+
+ + + + + +
+ + +
+ + + + + +
+ + +
+ +
+ +
+ +
+
+
+
+ + + + +
+ + +
+ + +
+ + +
+
+
+
+ + {{actionHistory.ACTION}} + {{actionHistory.NAME}} + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + +
+
+
+
+
+ +
+ + + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + +
+ + +
+
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + +
+ + + +
+
+ +
+ + +
+
+
+
+ +
+ + + +
+ + +
+ {{ts.trPK('general','submit')}} + +
+
+ + {{'worklistMain, skip' | translate}} + +
+ + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss new file mode 100644 index 00000000..9c12760b --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss @@ -0,0 +1,231 @@ + +.cardContent{ + width:100%; + margin-top: 33px +} +.colItemReq{ + color: var(--dark); + font-weight: bold; + font-size: 15px; + text-align: left; + +} + +.colItemReqHeader{ +text-align: left; +color: var(--primary); +font-weight: bold; +} +.labelTotal{ + color: var(--danger); + font-weight: bold; + font-size: 17px; + + +} +.labelAction{ +color:var(--customnavy) !important; +font-weight:bold; +} + +.segmentPR{ + + // --background-hover: rgba(var(--ion-color-contrast-rgb),0.04); + // --background-activated: var(--danger); + // --color: rgba(--primary); + --color-checked: var(--secondary); + --indicator-color-checked: var(--secondary); + + + +} + +.ion-modal#ion-overlay-1 { + width: 90%; + height: 50%; + top: 20%; + left: 5%; + right: 5%; + bottom: 5%; + border: solid 1px red; + +} + +// .swiper-pagination.swiper-pagination-bullets{ +// top: 6px; +// bottom: inherit; +// } + + + +.swiper-pagination.swiper-pagination-bullets { + top: 6px !important; + bottom: 0px !important; + } + + .swiper-pagination { + top: 6px; + } + + +.bar-stable { + background-color: var(--cusgray) !important; + } + .tabs{ + background-color: var(--cusgray) !important; + } + .icon-size-lg { + font-size: 40px; + } + + /*Timeline*/ + + .pos-absolute-right { + position: absolute; + right: 8px; + } + + .timeline { + position: relative; + margin: 15px 0 0 0; + } + + .timeline:before { + + content: ''; + position: absolute; + top: 0; + bottom: 0; + width: 4px; + background: #e4e4e4; + z-index: 1; + left: 62px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 50px; + z-index: 2; + position: absolute; + left: 38px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + width: 50px; + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 50px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + transform: scale(0.3); + } + + + + .timeline .timeline-item { + width: 50px; + + } + + .timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + + } + + + .divider-title { + background: #e4e4e4; + padding: 5px 15px; + } + + + .color-red { + color: var(--danger) !important; + } + + .bg-color-dot { + // background-color: #ff3b30 !important; + background: var(--primary); + background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + + + } + +.notification-list{ +ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 55px; + font-size: 14px; + font-weight: bold; + + text-align: center; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 0; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + +} +} +.input-wrapper { +--flex:none; +} +ion-input ,ion-datetime{ +border-bottom: #dedede 1px solid; +} +.left { +.timeline:before{ +left: 62px; +} +.notification-list ion-item{ + padding-left: 3px; +} +.timeline-thumb{ + left: 37px; +} +} +.right { +.timeline:before{ + right: 62px; + } + .notification-list ion-item{ + padding-right: 3px; + } + .timeline-thumb{ + right: 37px; + } +} + + diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.spec.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.spec.ts new file mode 100644 index 00000000..31ca61be --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistMainPRComponent } from './worklist-main-pr.component'; + +describe('WorklistMainPRComponent', () => { + let component: WorklistMainPRComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistMainPRComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistMainPRComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts new file mode 100644 index 00000000..32059678 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -0,0 +1,699 @@ +import { Component, OnInit, ElementRef } 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'; +@Component({ + selector: 'app-worklist-main-pr', + templateUrl: './worklist-main-pr.component.html', + styleUrls: ['./worklist-main-pr.component.scss'], +}) +export class WorklistMainPRComponent implements OnInit { + + 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_ACTION_MODE = "passActionMode"; + 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 = false; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + + + 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 + ) { + + //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); + this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + } + + ngOnInit() { + this.WorkListAttachObj = new WorkListButtonRequest(); + + this.intializeNotificationDetail(); + + let segment = document.querySelector('ion-segment'); + let slides = document.querySelector('ion-slides'); + + segment.addEventListener('ionChange', (ev) => onSegmentChange(ev)); + slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev)); + + // On Segment change slide to the matching slide + function onSegmentChange(ev) { + console.log("ev.detail.value"+ev.detail.value); + slideTo(ev.detail.value); + } + + function slideTo(index) { + console.log("index: "+index); + + slides.slideTo(index); + } + + // On Slide change update segment to the matching value + async function onSlideDidChange(ev) { + var index = await slides.getActiveIndex(); + console.log("index: "+index); + clickSegment(index); + } + + function clickSegment(index) { + + segment.value = index; + } + + + + } + + + intializeNotificationDetail() { + document.getElementById("notificationDynamicFields").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 = this.P_PAGE_NUM;; + 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 = this.P_PAGE_NUM; + 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 == "EIT") { + this.getEITNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { + this.getAbsenceNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ + this.getPONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO"){ + this.getMONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR"){ + this.getPRNotificationDetails(this.WorkListBodyObj); + } + } + + getPRNotificationDetails(notificationBodyObj){ + this.worklistMainService + .getPRNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "PR"); + }); + } + + getMONotificationDetails(notificationBodyObj){ + this.worklistMainService + .getMONotificationBody(notificationBodyObj) + .subscribe((result: MONotificatonBodyResponse) => { + //this.handleWorkListBodyResult(result, "MO"); + }); + } + + getPONotificationDetails(notificationBodyObj){ + this.worklistMainService + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + // this.handleWorkListBodyResult(result, "PO"); + }); + } + + getEITNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getEITNotificationBody(notificationBodyObj) + .subscribe((result: EITNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "EIT"); + }); + } + + getAbsenceNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getAbsencesNotificationBody(notificationBodyObj) + .subscribe((result: AbsenceNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "ABSENCE"); + }); + } + + 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; + + this.notificationBodyRes = + result.GetPrNotificationBodyList; + } + } + } + } //End handleWorkListBodyResult + + + + getNotificationButtons(notificationButtonsObj) { + this.worklistMainService + .getNotificationButtons(notificationButtonsObj) + .subscribe((result: NotificatonButtonResponse) => { + this.handleWorkListButtonsResult(result); + }); + } + + handleWorkListButtonsResult(result) { + if (this.common.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetNotificationButtonsList != null) { + this.notificationButtonRes = result.GetNotificationButtonsList; + } // if result == null + } // valid it + } // End handleWorkListButtonsResult + + applyAction(WorkListActionObj) { + this.worklistMainService + .actionButton(WorkListActionObj) + .subscribe((result: any) => { + this.handleApplayActionResult(result); + }); + } + + handleApplayActionResult(result) { + if (this.common.validResponse(result)) { + if (result.MessageStatus == 1) { + // this.navCtrl.push("HomePage"); + //this.common.openHome(); + //this.common.openNotificationPage(); + // for( var i = 0; i < this.notificationArray.length; i++){ + // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { + // this.notificationArray.splice(i, 1); + // } + // } + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); + } + } // 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(); + // } + } + } + + actionButton() { + let ButtonAction: string = this.actionType; + var responseAttrDic = this.notExampleJsonObject; + this.P_RESPOND_ATTRIBUTES_TBL = []; + for (let i=0;i 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, + WorklistMainPRComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistHistoryPage(); + } + + + + openSupportDocuments() { + // this.navCtrl.push("WorkListAttachPage", { + // passNotificationInfo: this.getPassNotificationDetails + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainPRComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistAttachPage(); + } + + getNotificationResAttr(notificationButtonsObj) { + 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.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; + if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); + } // valid it + } // End handleWorkListButtonsResult + + notificationDynamicFields(notificationAttr){ + const containerId = 'notificationDynamicFields'; + for(let i=0;i { + 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.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 = false; + 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++; + 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; + } + } + } + } + } + + 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) { + if (!this.IsReachEnd) { + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.worklistService.getActionHistory(this.WorkListActionHistoryObj). + subscribe((result: any) => { + if (this.common.validResponse(result)) { + if (result.GetActionHistoryList != undefined) { + 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(); + } + + +} diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index eb25bdf2..80c31789 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1436,28 +1436,7 @@ "en": "Location services must be enabled to use this service", "ar": "يجب تمكين خدمات تحديد الموقع لاستخدام هذه الخدمة" } - }, - "workListMain": { - "suppDoc": { - "en": "Support Documents", - "ar": "مستندات الدعم" - }, - "skip": { - "en": "skip", - "ar": "تخطى" - }, - "rfc": { - "en": "Return for correction", - "ar": "عودة لتصحيح" - }, - "actionHis":{ - "en":"Action History", - "ar":"تاريخ العمل" - }, - "notfDetails":{ - "en":"Notification Details", - "ar":"تفاصيل الإخطار" - } + }, "actionHis": { "name":{ @@ -1684,6 +1663,42 @@ "actionRequird":{ "en":"Action is required", "ar":"اختر حركة" + }, + "approvalSeq":{ + "en":"Approval Sequence", + "ar":"تسلسل الموافقة" + }, + "description":{ + "en":"Description", + "ar":"وصف" + }, + "price":{ + "en":"Price", + "ar":"السعر" + }, + "unit":{ + "en":"Unit", + "ar":"الوحدة" + }, + "cost-center":{ + "en":"Cost Center", + "ar":"Cost Center" + }, + "skip": { + "en": "skip", + "ar": "تخطى" + }, + "quantity": { + "en": "Quantity", + "ar": "الكمية" + }, + "code": { + "en": "Code", + "ar": "رمز" + }, + "itemReq":{ + "en": "Items Requsted", + "ar":"العناصر المطلوبة" } }, "payslip": { diff --git a/Mohem/src/imgs/noteLarge.png b/Mohem/src/imgs/noteLarge.png new file mode 100644 index 0000000000000000000000000000000000000000..44aeee2b60a4bf5fcc8f600a589aaa86f216f014 GIT binary patch literal 1468 zcmV;t1w;CYP)2Kmwp1MUd~iY0V$`Tkzo#cz~}yK0cr+Nmfh& zVCr$1xBYyahTJyEiUk1Nc$|{%=i|4Kdo|(uOxF=oA3ToViC;MIUPA1h$ML!Nj|{w5 zFu$~Y!=b=pi8xm%@MVN?Iq2LAeP=H&C3XS;e_!a{t#I|_uYYc^LukU(vqNc@dc-(&f(U8vwl29J6Q;i;dXC=KJ~h z(e)xpRy=lC?8|;Wu52U?a%w9a3W#8_M6g&QSS%4NmIxM0#JNVd-Z1y=B8ORER%ID*7t6<+J*=P|*dfCv^#L}(r>%GGaU_yrA!k|XkY zu+YxyHsVtEuWfX^90~$RvSOWNMdcGaM6oW}%)9N?H_3_>0Q@0ZeU;qMQ1F6}RCG8l z*jOtfAF-@8$K|Hq@khU+-06NkF4f<3;EcPcts%Uu!jGfP}C!*YERW6JDpS31c4Rae@$Kb+IZs-fb zts3BCVm}|3)*Hwd21TlTnw!aJTxm9b$BsH5H(We9tl4H;J2FVFGc3T zp};KlRg?ORF<2b8thm%t?i>=@VhC#sF5&8oyx%)MWC}(7+{M{HL0J2 zCkCmX11eevW*b8&NrfSa#TfZJe)N^9X9|*yZO6Moh*dfs(4>x(WmI)iX9lU(O^SLi zwnl1>`KKy%W{`TTtz)Z{3K!gWs}(eBMG=@+`Z(FQE>e3=Lh12nZ zLsO~HSFuXoDftxWAQfc(YLL2fl?r_nTaylLYozL#f;xsU^Z6dV5?dt|L&Kee)RAel z%eQ)_H)0*6iqP;)`L_|3ROpLXgVZO3RMGLQpggApODe=F)?r5Vd!1A~&oKq$L#@J%F4%5`fWL^z$$`tMG}%u7mzSj1|}eohvZpsXkDl-xGj)fTa|Shcco zhOekca5PITD^=5`jn5AG=OUJ2LshKosN|m$oMNmsRa!ew{+*i`#RAIxx8it_*RI=s z{8c(H7UOH(8__$))h(_fy!a*+F|=4)<@l?V+18d%KEx!pbFH$97{qQdUPiTcxAS5z z*#R|y*Le}aVu@g}M6g&QSS%4NmIzzACH6q+^B(~whg&QWES3lsOT=}bHg)I>0Pr7= Wd?i!gN^OGx0000eFdl|h;o9uD{hnO0=|KZG2R4>Ad31SRWJMi1BOgWpNGTY%xHBu9H>u8*<2G* z(KW+=MR~Jc_$Ivp?b?w^+3>Z;5QJUNKy>h0`CTZ0 z*gAuTmN$+Xt=NZF{~PqY^r3YI4XxhIgkT>-d!yBE%zb^kKG=!W5+9?ZjNk+P7K*H; z=dlxdL5)_6<(od8ebl2~A5F@JQ_HQ<>a|uoB_FMlvdP%mM8qz);lk2rb*w&4#YZ2A zsK&=mqHmJ2VUF!7_-FwO*OsO2isA@+3O*{3gd+2vh+c^3(w^W0bybXWb+jg$8v>aD zatAB_#`PEP(ogMb3{g@xR~BT74aAT+uHWMOCA;9P2E+_V4nLIznPayLq=Y42{s&Ip z7tfvmS)-pIkkkSB1CYn?v?%CE$Ug!}b9+w{AvyGX2HYAuy_O9oknNLe5zr3E6djTj zzPiKjuaHKo{owHw;hmc z3zGE(r;<}qd=%*#L;gY_FA$On_-AfGej=jp80SRk`HVQ^4nL-s(Q0(l!B$XEoayYFwb7~?FlDfUg5qRxzSNqdbAL3n-YmWA)pcYI u3ixdwUGkmiC^0C9jac>j7`fvs5&Z+h?Cl3sGfEr)0000