diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 673eb4a5..0140e19a 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -711,8 +711,9 @@ export class ConfirmLoginComponent implements OnInit { AuthenticationService.servicePrivilage=result.Privilege_List; this.authService.setAuthenticatedUser(result).subscribe(() => { + console.log("insert"); - if (this.platform.is("mobile")) { + if (!this.platform.is("mobile")) { this.insertMobileLogin(); diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index 082181be..520715e4 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -98,7 +98,8 @@ import {Camera,CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx' import {File} from '@ionic-native/file/ngx'; import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component' import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; - +import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; +import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' @NgModule({ imports: [ CommonModule, @@ -162,7 +163,9 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent, - FileUploderProfileComponent + FileUploderProfileComponent, + AccordinTabCustomComponent, + AccordinCustomComponent ], exports: [ NumberRangeComponent, @@ -213,7 +216,9 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent, - FileUploderProfileComponent + FileUploderProfileComponent, + AccordinTabCustomComponent, + AccordinCustomComponent ], providers: [ ConnectorService, 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 cac4d5cb..532e6bd4 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -408,6 +408,50 @@ export class CommonService { // this.alerts.push(alert); await alert.present(); } + async confirmAlertDialogAction( + onAccept: any, + acceptLabel: string, + onCancel: any, + cancelLabel: string, + title: string, + message: string + ) { + this.clearAllAlerts(); + const alert = await this.alertControllerIonic.create({ + header: this.ts.trPK("general", "confirm"), + message: message, + buttons: [ + { + text: cancelLabel, + role: "cancel", + cssClass: "cancelBtn", + handler: () => { + if (onCancel) { + onCancel(); + } + this.alertControllerIonic.dismiss(); + } + }, + { + text: acceptLabel, + role: "Confirm", + + cssClass: "confirmBtn", + + handler: () => { + + if (onAccept) { + onAccept(); + } + this.alertControllerIonic.dismiss(); + } + } + ] + }); + // this.alerts.push(alert); + await alert.present(); + } + public clearAllAlerts() { // custom solutions because of async issue @@ -984,6 +1028,9 @@ export class CommonService { public openWorklistMainPRPage() { this.nav.navigateForward(["/notification/worklist-main-PR"]); } + public openWorklistMainPOPage() { + this.nav.navigateForward(["/notification/worklist-main-PO"]); + } public openWorklistReplacementRollPage() { this.nav.navigateForward(["/notification/work-list-replacement-roll"]); } @@ -1002,6 +1049,15 @@ export class CommonService { public openWorklistRollReplacement() { this.nav.navigateForward(["/notification/work-list-replacement-roll"]); } + public openItemHistoryPage() { + this.nav.navigateForward(["/notification/item-history-PO"]); + } + public openQutationAnalysisPage() { + this.nav.navigateForward(["/notification/qutation-analysis-PO"]); + } + public openWorklistMainMRPage() { + this.nav.navigateForward(["/notification/worklist-main-MR"]); + } public openMySpecialistPage() { this.nav.navigateForward(["/my-specialist/home"]); } diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.html b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.html new file mode 100644 index 00000000..a9164037 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.html @@ -0,0 +1,2 @@ + + diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.scss b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.spec.ts b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.spec.ts new file mode 100644 index 00000000..4d62d93f --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccordinCustomComponent } from './accordin-custom.component'; + +describe('AccordinCustomComponent', () => { + let component: AccordinCustomComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AccordinCustomComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccordinCustomComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.ts b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.ts new file mode 100644 index 00000000..741a8229 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-custom.component.ts @@ -0,0 +1,51 @@ +import { Component, OnInit, ViewChildren, QueryList, Input, AfterViewInit, ContentChildren, AfterContentInit, OnDestroy } from '@angular/core'; +import { AccordinTabCustomComponent } from './accordin-tab-custom/accordin-tab-custom.component'; +@Component({ + selector: 'accordin-custom', + templateUrl: './accordin-custom.component.html', + styleUrls: ['./accordin-custom.component.scss'], +}) +export class AccordinCustomComponent implements OnInit { + @ContentChildren(AccordinTabCustomComponent) tabs !: QueryList; + @Input() activeIndex: number; + private destroyed = false; + constructor() { } + ngOnInit() { + + } + + ngOnDestroy(): void { + this.destroyed = true; + } + ngAfterContentInit() { + this.tabs.notifyOnChanges(); + this.tabs.changes.subscribe(() => { + this.processChildren(); + }); + this.processChildren(); + } + + private processChildren() { + // this.tabs.notifyOnChanges(); + this.tabs.forEach((item: AccordinTabCustomComponent, index) => { + item.setAccordion(this); + if (index === this.activeIndex) { + setTimeout(() => { + if (!this.destroyed) { + item.setVisibility(true); + } + }, 200); + } + }); + } + + public tabClicked(clickedTab: AccordinTabCustomComponent) { + this.tabs.forEach((tab: AccordinTabCustomComponent) => { + if (tab !== clickedTab) { + tab.setVisibility(false); + } else { + } + }); + } + +} diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.html b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.html new file mode 100644 index 00000000..5daf93da --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.html @@ -0,0 +1,43 @@ + + + + +
+ + +

{{header}}

+
+ + + + +

{{header}} + +

+ +

+ {{subHeader}} +

+
+
+ + +
+
+
+
+ + + + + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss new file mode 100644 index 00000000..14151600 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss @@ -0,0 +1,111 @@ +.header { + width: 100%; +} + +.grid { + padding-top: 0;//orign + margin: 10px; + background: #ffffff; + border-radius: 5px; +} + +.tab-header { + padding: 0; + margin: 0; + border-color: transparent;//#e2e2e2; + border-style: solid; + border-width: 0cm 0cm 0.02cm 0cm; + padding-top: 0.2cm; + padding-bottom: 0.2cm; +} + +.icon { + + height: 0.9cm; + display: inline; + vertical-align: middle; + margin-left: 0.1cm; + margin-right: 0.1cm; + float: left; +} +.imgArrow{ + height: 20px; + margin-top: 5px; +} +.left { + float: left; +} + +.right { + float: right; +} + +.title { + margin: 0; + margin-top: 0.2cm; + margin-left: 0.2cm; + margin-right: 0.2cm; + color: var(--dark); + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden !important; + font-size: 0.46cm; + width: 78%; + font-weight: bold; + +} + +.title-subtitle { + margin: 0; + margin-top: 0.2cm; + margin-left: 0.2cm; + margin-right: 0.2cm; + color: var(--dark); + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden !important; + // font-size: 0.36cm; + // width: 78%; + font-size: 0.46cm; + width: 32%; + font-weight: bolder; + +} +.innerheader h6 { + margin: 0em !important; +} + +h6 +{ + margin: 0em !important; +} + +.headerRed{ + color: var(--red); + margin: 0; + margin-top: 0.17cm; + margin-left: 0.2cm; + margin-right: 0.2cm; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden !important; + font-size: 0.56cm; + width: 32%; + font-weight: bolder + // text-align: right; +} +.headerGreen{ + color: var(--green); + margin: 0; + margin-top: 0.17cm; + margin-left: 0.2cm; + margin-right: 0.2cm; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden !important; + font-size: 0.56cm; + width: 32%; + font-weight: bolder + // text-align: right; + +} diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.spec.ts b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.spec.ts new file mode 100644 index 00000000..6655241c --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccordinTabCustomComponent } from './accordin-tab-custom.component'; + +describe('AccordinTabCustomComponent', () => { + let component: AccordinTabCustomComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AccordinTabCustomComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccordinTabCustomComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts new file mode 100644 index 00000000..ac292fa6 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts @@ -0,0 +1,50 @@ +import { Component, OnInit, Output, EventEmitter, Input, Host } from '@angular/core'; +import { AccordinCustomComponent } from '../accordin-custom.component'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +@Component({ + selector: 'accordin-tab-custom', + templateUrl: './accordin-tab-custom.component.html', + styleUrls: ['./accordin-tab-custom.component.scss'], +}) + +export class AccordinTabCustomComponent implements OnInit { + private accordion: AccordinCustomComponent; + + private id: number; + public show = false; + public direction = 'ltr'; + @Input() header: string; + @Input() subHeader: string; + @Input() cache = true; + @Input() color = 'primary'; + @Input() subHeadergreen : true; + + @Output() selected = new EventEmitter(); + + constructor( public ts: TranslatorService + ) { } + + + ngOnInit() { + this.direction = TranslatorService.getCurrentDirection(); + } + + public setVisibility(show: boolean) { + this.show = show; + } + + public setAccordion(accordion: AccordinCustomComponent) { + this.accordion = accordion; + } + + public onClick() { + this.setVisibility(!this.show); + if (this.show) { + if (this.accordion) { + this.accordion.tabClicked(this); + } + } + + } + +} diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index a9c0683d..06bc2bfd 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -84,15 +84,15 @@ -
+
{{notificationList.BEGIN_DATE | dateString }}
-
+
-
+
diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index 084cba3b..bd5af293 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -16,12 +16,12 @@ right: 8px; } - .timeline { + .timelineMain { position: relative; margin: 15px 0 0 0; } - .timeline:before { + .timelineMain:before { content: ''; position: absolute; @@ -35,7 +35,7 @@ /* z-index: 1; */ } - .timeline .timeline-thumb { + .timelineMain .timelineMain-thumb { border-radius: 500px; width: 50px; @@ -52,7 +52,7 @@ top: 0px; } - .timeline .timeline-thumb.timeline-icon { + .timelineMain .timelineMain-thumb.timelineMain-icon { height: 50px; // text-align: center; // color: white; @@ -62,12 +62,12 @@ - .timeline .timeline-item { + .timelineMain .timelineMain-item { width: 50px; } - .timeline .timeline-stats { + .timelineMain .timelineMain-stats { position: relative; font-size: 12px; color: var(--darkgray); @@ -139,14 +139,14 @@ ion-input ,ion-datetime{ } .left { --background: #f0efef; - .timeline:before{ + .timelineMain:before{ left: 21px; } .notification-list ion-item{ padding-left: 3px; margin-left: -12%; } - .timeline-thumb{ + .timelineMain-thumb{ left: 9%; top: 30%; } @@ -154,13 +154,13 @@ ion-input ,ion-datetime{ } .right { --background: #f0efef; - .timeline:before{ + .timelineMain:before{ right: 62px; } .notification-list ion-item{ padding-right: 3px; } - .timeline-thumb{ + .timelineMain-thumb{ right: 37px; } } diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index ae011cbf..845b11ba 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -171,6 +171,13 @@ export class HomeComponent implements OnInit { if(obj.REQUEST_TYPE == "PR"){ this.common.openWorklistMainPRPage(); } + else if(obj.REQUEST_TYPE == "PO"){ + this.common.openWorklistMainPOPage(); + } + else if(obj.REQUEST_TYPE == "MO"){ + this.common.openWorklistMainMRPage(); + } + else{ this.common.openWorklistMainPage(); diff --git a/Mohem/src/app/notification/item-history/item-history.component.html b/Mohem/src/app/notification/item-history/item-history.component.html new file mode 100644 index 00000000..7f71778a --- /dev/null +++ b/Mohem/src/app/notification/item-history/item-history.component.html @@ -0,0 +1,227 @@ + + + + + {{ts.trPK('worklistMain','ITEM_HIS')}} + + + + + + + + + + + + + +
+

{{ 'general, empty' | translate}}

+
+ +
+ + + +
+ + + + + + + + + + + +
+ + {{itemHistory.OU_NAME}} +
+ + + + +
+ + {{itemHistory.PO_NUMBER}} +
+
+ + + + +
+ + {{itemHistory.REVISION_NUM}} +
+ + + + +
+ + {{itemHistory.CREATION_DATE}} + +
+
+ + + + + +
+ + {{itemHistory.SUPPLIER}} +
+ + + + + +
+ + {{itemHistory.BUYER}} +
+ +
+ + + + + +
+ + {{itemHistory.UOM}} +
+ + + + + +
+ + {{itemHistory.QUANTITY_ORDERED}} +
+ +
+ + + + + +
+ + {{itemHistory.QUANTITY_RECEIVED}} +
+ + + + + +
+ + {{itemHistory.BONUS_QUANTITY}} +
+ +
+ + + + + +
+ + {{itemHistory.PURCHASE_PRICE}} +
+ + + + + +
+ + {{itemHistory.DISCOUNT_PERCENTAGE}} +
+ +
+ + + + + +
+ + {{itemHistory.BALANCE_QUANTITY}} +
+ + + + + +
+ + {{itemHistory.NET_PRICE}} +
+ +
+ + + + + +
+ + {{itemHistory.CLOSED_CODE}} +
+ + +
+
+ +
+ +
+
+
+ + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/item-history/item-history.component.scss b/Mohem/src/app/notification/item-history/item-history.component.scss new file mode 100644 index 00000000..95c01568 --- /dev/null +++ b/Mohem/src/app/notification/item-history/item-history.component.scss @@ -0,0 +1,20 @@ +.itemeHistoryist { + background: #f0efef; + padding: 6px; + /* margin-top: 20px; */ + /* width: 100%;*/ +} +ion-label.labelValue.sc-ion-label-ios-h.sc-ion-label-ios-s.ios.hydrated, +ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated +{ + white-space: pre-wrap !important; + --color: initial; + display: block; + color: var(--color); + font-family: var(--ion-font-family,inherit); + font-size: inherit; + text-overflow: ellipsis; + overflow: hidden; + -webkit-box-sizing: border-box; + box-sizing: border-box +} \ No newline at end of file diff --git a/Mohem/src/app/notification/item-history/item-history.component.spec.ts b/Mohem/src/app/notification/item-history/item-history.component.spec.ts new file mode 100644 index 00000000..b0d58241 --- /dev/null +++ b/Mohem/src/app/notification/item-history/item-history.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ItemHistoryComponent } from './item-history.component'; + +describe('ItemHistoryComponent', () => { + let component: ItemHistoryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ItemHistoryComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ItemHistoryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/item-history/item-history.component.ts b/Mohem/src/app/notification/item-history/item-history.component.ts new file mode 100644 index 00000000..f943fc80 --- /dev/null +++ b/Mohem/src/app/notification/item-history/item-history.component.ts @@ -0,0 +1,112 @@ +import { ViewNoteModalComponent } from './../view-note-modal/view-note-modal.component'; +import { WorklistService } from './../service/worklist.service'; +import { Component, OnInit } from '@angular/core'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ModalController } from '@ionic/angular'; +import { POItemHistoryRequest} from '../models/POItemHistoryReq'; +import { WorklistMainService } from '../service/work-list.main.service'; +import { POItemHistoryRes } from '../models/POItemHistoryRes'; + + +@Component({ + selector: 'app-item-history', + templateUrl: './item-history.component.html', + styleUrls: ['./item-history.component.scss'], +}) +export class ItemHistoryComponent implements OnInit { + getPassPOInfo: any; + itemHistoryRes: any; + IsReachEnd: boolean = false; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + POItemHistoryReq:any; + getPassItemHistoreyList: any; + constructor( + public worklistMainService: WorklistMainService, + private cs: CommonService, + private ts: TranslatorService, + private modalCtrl: ModalController, + public worklistService: WorklistService + ) { + this.getPassPOInfo = this.cs.sharedService.getSharedData('passPOInfo'); + this.getPassItemHistoreyList = this.cs.sharedService.getSharedData('passItemHisList'); +//itemHistoryRes + this.POItemHistoryReq = new POItemHistoryRequest(); + this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM; + this.POItemHistoryReq.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.POItemHistoryReq.P_ITEM_ID= this.getPassPOInfo; + + } + ngOnInit() { + + this.getItemHistory(this.getPassPOInfo); + } + getItemHistory(itemID) { + console.log(itemID); + this.IsReachEnd = false; + // const request = new POItemHistoryRequest(); + // request.P_ITEM_ID=parseInt(itemID); + // request.P_PAGE_LIMIT=50; + // request.P_PAGE_NUM=1; + this.worklistMainService.getPOItemHistory( this.POItemHistoryReq). + subscribe((result: POItemHistoryRes) => { + + this.handleItemHistoryResult(result); + }); + } + + + handleItemHistoryResult(result) { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetPoItemHistoryList)) { + this.itemHistoryRes = result.GetPoItemHistoryList; + this.P_PAGE_NUM++; + let lastItemIndex = this.itemHistoryRes.length - 1; + if (result.GetPoItemHistoryList[lastItemIndex]) { + let lastitem = result.GetPoItemHistoryList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + // this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM; + this.worklistMainService.getPOItemHistory(this.POItemHistoryReq). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.GetPoItemHistoryList != undefined) { + this.P_PAGE_NUM++; + (result.GetPoItemHistoryList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.itemHistoryRes.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 + + +} diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index 02f1f52e..df9194f2 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -21,6 +21,10 @@ import { WorkListDetailsComponent } from './work-list-details/work-list-details. import { WorklistAttachService } from '../absence/service/work-list-attach.service'; import { WorklistMainPRComponent } from './worklist-main-pr/worklist-main-pr.component'; import { ApplyActionModalComponent } from './apply-action-modal/apply-action-modal.component'; +import { WorklistMainPoComponent } from './worklist-main-po/worklist-main-po.component'; +import { ItemHistoryComponent } from './item-history/item-history.component'; +import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis.component'; +import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component'; // import { WorklistMainComponent } from './worklist-main/worklist-main.component'; @@ -78,6 +82,22 @@ const routes: Routes = [ { 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 } ] } @@ -104,7 +124,11 @@ const routes: Routes = [ WorkListActionHistoryComponent, WorkListAttachComponent, WorkListDetailsComponent, - WorklistMainPRComponent + WorklistMainPRComponent, + WorklistMainPoComponent, + ItemHistoryComponent, + QutationAnalysisComponent, + WorklistMainMRComponent // WorklistMainComponent ], providers:[WorklistService,WorklistMainService, WorklistAttachService] diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html new file mode 100644 index 00000000..69ab83e9 --- /dev/null +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html @@ -0,0 +1,210 @@ + + + + + {{ts.trPK('worklistMain','QUOTATION_ANALYSIS')}} + + + + + + + + + + + + + +
+

{{ 'general, empty' | translate}}

+
+ +
+ + + +
+ + + + + + + + + + +
+ + {{QutationAnalysis.QUOT_NUM}} +
+ + +
+ + {{QutationAnalysis.VENDOR_NAME}} +
+ +
+ + + + + + +
+ + {{QutationAnalysis.ITEM_CODE}} + +
+ + + +
+ + {{QutationAnalysis.ITEM_DESC}} +
+
+ + + + + + + + +
+ + {{QutationAnalysis.QUOT_QTY}} +
+ + + +
+ + {{QutationAnalysis.QUOT_UOM}} +
+ +
+ + + + + + + + + +
+ + {{QutationAnalysis.QUOT_UNIT_PRICE}} +
+ + + +
+ + {{QutationAnalysis.QUOT_LINE_TOTAL}} +
+
+ + + + + + + + +
+ + {{QutationAnalysis.QUOT_BONUS_QTY}} +
+ + +
+ + {{QutationAnalysis.QUOT_DELIVERY_DATE}} +
+ +
+ + + + + + + + + +
+ + {{QutationAnalysis.QUOT_MFG_PART_NUM}} +
+ + +
+ + {{QutationAnalysis.RFQ_NUM}} +
+
+ + + + + + + + + +
+ + {{QutationAnalysis.RFQ_QTY}} +
+ + +
+ + {{QutationAnalysis.RFQ_UOM}} +
+
+
+ +
+ +
+
+
+ + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.scss b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.scss new file mode 100644 index 00000000..7919e2a7 --- /dev/null +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.scss @@ -0,0 +1,21 @@ +.itemeHistoryist { + background: #f0efef; + padding: 6px; + /* margin-top: 20px; */ + /* width: 100%;*/ +} + +ion-label.labelValue.sc-ion-label-ios-h.sc-ion-label-ios-s.ios.hydrated, +ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated +{ + white-space: pre-wrap !important; + --color: initial; + display: block; + color: var(--color); + font-family: var(--ion-font-family,inherit); + font-size: inherit; + text-overflow: ellipsis; + overflow: hidden; + -webkit-box-sizing: border-box; + box-sizing: border-box +} \ No newline at end of file diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.spec.ts b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.spec.ts new file mode 100644 index 00000000..3c0ca8fa --- /dev/null +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QutationAnalysisComponent } from './qutation-analysis.component'; + +describe('QutationAnalysisComponent', () => { + let component: QutationAnalysisComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QutationAnalysisComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QutationAnalysisComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts new file mode 100644 index 00000000..ed1946e0 --- /dev/null +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts @@ -0,0 +1,125 @@ +import { ViewNoteModalComponent } from './../view-note-modal/view-note-modal.component'; +import { WorklistService } from './../service/worklist.service'; +import { Component, OnInit } from '@angular/core'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ModalController } from '@ionic/angular'; +import { POItemHistoryRequest} from '../models/POItemHistoryReq'; +import { WorklistMainService } from '../service/work-list.main.service'; +import { POItemHistoryRes } from '../models/POItemHistoryRes'; +import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq'; +import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; + +@Component({ + selector: 'app-qutation-analysis', + templateUrl: './qutation-analysis.component.html', + styleUrls: ['./qutation-analysis.component.scss'], +}) +export class QutationAnalysisComponent implements OnInit { + IsReachEnd: boolean = false; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + POQuotationHISReq: QuotationAnalysisRequest; + getPassPOItemID: any; + getPassPOHeaderID: any; + getPassItemHistoreyList: any; + getQutationAnalysis:any; + constructor(public worklistMainService: WorklistMainService, + private cs: CommonService, + private ts: TranslatorService, + private modalCtrl: ModalController, + public worklistService: WorklistService) { + this.getPassPOItemID = this.cs.sharedService.getSharedData('passPOInfo'); + this.getPassPOHeaderID = this.cs.sharedService.getSharedData('passPOHeader'); + this.getPassItemHistoreyList = this.cs.sharedService.getSharedData('passItemHisList'); +//itemHistoryRes +console.log("getPassPOItemID: "+this.getPassPOItemID); +console.log("getPassPOItemID: "+this.getPassPOHeaderID); + + this.POQuotationHISReq = new QuotationAnalysisRequest(); + this.POQuotationHISReq.P_PAGE_NUM = this.P_PAGE_NUM; + this.POQuotationHISReq.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.POQuotationHISReq.P_ITEM_ID= this.getPassPOItemID; + this.POQuotationHISReq.P_PO_HEADER_ID = this.getPassPOHeaderID; + } + + ngOnInit() { + + + + + this.getQutationAnalysisFun( this.getPassPOHeaderID,this.getPassPOItemID); + + + } + public getQutationAnalysisFun(headerID,itemID) { + console.log("itemID"+ itemID+" headerID "+ headerID); + this.IsReachEnd = false; + const request = new QuotationAnalysisRequest(); + request.P_ITEM_ID=parseInt(itemID); + request.P_PO_HEADER_ID=headerID; + request.P_PAGE_LIMIT=50; + request.P_PAGE_NUM=1; + this.worklistMainService.getQutationAnalysis(request). + subscribe((result: QuotationAnalysisResponse) => { + this.handleQutationAnalysisResult(result); + }); + } + handleQutationAnalysisResult(result) { + if (this.cs.validResponse(result)) { + + if (this.cs.hasData(result.GetQuotationAnalysisList)) { + + //open page + //set sheard data + // + this.getQutationAnalysis = result.GetQuotationAnalysisList; + this.P_PAGE_NUM++; + let lastItemIndex = this.getQutationAnalysis.length - 1; + if (result.GetQuotationAnalysisList[lastItemIndex]) { + let lastitem = result.GetQuotationAnalysisList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + + + + doInfinite(infiniteScroll) { + console.log("hello"); + if (!this.IsReachEnd) { + this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM; + this.worklistService.getActionHistory(this.getQutationAnalysis). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.GetQuotationAnalysisList != undefined) { + this.P_PAGE_NUM++; + (result.GetQuotationAnalysisList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.getQutationAnalysis.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 +} 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 066a3462..99799c56 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -136,7 +136,9 @@ export class WorklistMainService { errorLabel?: string ): Observable { const request = POItemHistoryReq; - this.authService.authenticateRequest(request); + this.authService.authenticateRequest(request); + // this.authService.setPublicFields(request); + return this.api.post( WorklistMainService.getPOItemHistory, request, diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html new file mode 100644 index 00000000..3ce0bf61 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -0,0 +1,570 @@ + + + {{ts.trPK('worklistMain','title')}} + + + + + + + + + + {{ts.trPK('worklistMain','info')}} + + + + {{ts.trPK('worklistMain','itemReq')}} + + + + + {{'worklistMain, actionHis' | translate}} + + + + + + {{'general, attachment' | translate}} + + + + + + + + + + + + +
{{pInformation}}
+ + + + + + + + +
+ + +
+
+ + + + +
+ + + +
+
+ + + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + + +
+ + + +
+
+ + + +
+ + + + + + +
+ + +
+
+ +
+
+ + + + +
+ + +
{{totalH}}
+
{{valueH}}
+ +
+ +
{{taxH}}
+
{{taxvalueH}}
+ +
+
+ +
+
+ + + +
+ +
+ + + +
+ +
+
+ +
+ +
+
+ + +
+ + +
+

{{ 'general, empty' | translate}}

+
+ + + +
+ + + +
+ + + + + + + + + + + + +
+ + {{notificationList.ITEM_CODE}} +
+ + + + + +
+ + {{notificationList.UOM}} +
+
+ + + + + + +
+ + {{notificationList.QUANTITY}} + +
+ + +
+ + {{notificationList.DATE_REQUIRED}} +
+
+ + + + + + + + + +
+ + {{notificationList.LINE_STATUS}} +
+ + + +
+ + {{notificationList.STATUS_DATE}} +
+ +
+ + + + + + + +
+ + {{notificationList.TRANSACTION_TYPE_NAME}} +
+ + + +
+ + {{notificationList.OPERATING_UNIT}} +
+ + +
+ + + + + + + +
+ + {{notificationList.ORGANIZATION_CODE}} +
+ + + +
+ + {{notificationList.ORGANIZATION_NAME}} +
+
+ + + + + + + + +
+ + {{notificationList.FROM_SUBINVENTORY}} +
+ + + +
+ + {{notificationList.FROM_LOCATOR}} +
+ + +
+ + + + + + + + +
+ + {{notificationList.TO_SUBINVENTORY}} +
+ + + +
+ + {{notificationList.TO_LOCATOR}} +
+ + +
+ + + + + + + + +
+ + {{notificationList.SHIP_TO_LOCATION}} +
+ +
+ + + + + + +
+
+
+
+
+ +
+ + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+ + + +
+ + +
+ + +
+
+
+ + {{actionHistory.ACTION}} + {{actionHistory.NAME}} + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + +
+
+
+
+
+
+ +
+ + + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + +
+ + +
+ +
+
+
+
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} +
+ +
+
+ +
+ + +
+
+
+
+ +
+ + + +
+ + + + +
+
+
+
+ + + + + + + + + + + {{'actionHis, action' | translate}} + + + {{notificationButtons.BUTTON_LABEL}} + + + + + + + + + {{'worklistMain, skip' | translate}} + + + + + + + + + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.spec.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.spec.ts new file mode 100644 index 00000000..02035c33 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistMainMRComponent } from './worklist-main-mr.component'; + +describe('WorklistMainMRComponent', () => { + let component: WorklistMainMRComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistMainMRComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistMainMRComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts new file mode 100644 index 00000000..14423f3c --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -0,0 +1,779 @@ +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'; +import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; + +@Component({ + selector: 'app-worklist-main-mr', + templateUrl: './worklist-main-mr.component.html', + styleUrls: ['./worklist-main-mr.component.scss'], +}) +export class WorklistMainMRComponent 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; + headerTotal: any; + totalH: any; + valueH: any; + taxH: any; + taxvalueH: any; + NotificationGetRespondAttributesList: any; + confirmMsg: string; + delMsg: string; + closeMsg: string; + + + 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 == "MO") { + if (result.GetMoNotificationBodyList) { + this.notificationBodyRes = + result.GetMoNotificationBodyList; + } + + } + } + } //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 { + 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, + WorklistMainMRComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainMRComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainMRComponent.PASS_RES_ATTR + ); + this.common.openWorklistRFCPage(); + } 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, + WorklistMainMRComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainMRComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainMRComponent.PASS_RES_ATTR + ); + this.common.openWorklistRollReplacement(); + } else if ( + ButtonAction == "DELEGATE" || + ButtonAction == "REQUEST_INFO" || + ButtonAction == "TRANSFER" || + ButtonAction == "TRANSFER_INFO" + ) { + // 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, + WorklistMainMRComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainMRComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainMRComponent.PASS_RES_ATTR + ); + this.common.openWorklistRollReplacement(); + } 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, + WorklistMainMRComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistHistoryPage(); + } + + + + openSupportDocuments() { + // this.navCtrl.push("WorkListAttachPage", { + // passNotificationInfo: this.getPassNotificationDetails + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainMRComponent.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.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; + + this.common.sharedService.setSharedData( + this.NotificationGetRespondAttributesList, + WorklistMainMRComponent.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 = '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(); + } + + + + async openApplyModal(WorkListActionObj) { + // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); + // modalPage.present(); + // console.log("note"+note); + this.common.sharedService.setSharedData( this.getPassNotificationDetails,WorklistMainMRComponent.PASS_NOTIFICATION_INFO); + this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') + // this.common.sharedService.setSharedData( + // this.WorkListActionObj, + // WorklistMainMRComponent.PASS_NOTIFICATION_INFO + // ); + + const modal = await this.modalCtrl.create({ + component: ApplyActionModalComponent, + backdropDismiss:false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data); // Here's your selected user! + }); + + // data => { + // console.log('MODAL DATA', data); + // }); + // const { data } = await this.modalCtrl.onWillDismiss(); + // console.log(data); + return await modal.present(); + + } + +} 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 new file mode 100644 index 00000000..a8a2ce33 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -0,0 +1,694 @@ + + + {{ts.trPK('worklistMain','title')}} + + + + + + + + + {{ts.trPK('worklistMain','info')}} + + + {{ts.trPK('worklistMain','itemReq')}} + + + + {{'worklistMain, actionHis' | translate}} + + + + + {{'general, attachment' | translate}} + + + + + + + + + + + + +
{{pInformation}}
+ + + + + + + + +
+ + +
+
+ + + +
+ + +
+
+ + + + +
+ + +
+
+ + + + +
+ + + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + + +
+ + + +
+
+ + +
+ + + + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + + +
+ + +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+ + + + + + +
+ + +
+
+ + + + +
+ + +
+
+ + +
+
+ + + + +
+ + +
{{totalH}}
+
{{valueH}}
+ +
+ +
{{taxH}}
+
{{taxvalueH}}
+ +
+
+ +
+
+ + + +
+ +
+ + + +
+ +
+
+ +
+ +
+
+ + +
+ + +
+

{{ 'general, empty' | translate}}

+
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + {{Lines.ITEM_CODE}} +
+ + +
+ + {{Lines.MFG}} * +
+ + +
+ + + +
+ + {{Lines.LINE_TYPE}} +
+ + + +
+ + {{Lines.UOM}} +
+ + + + +
+ + + + +
+ + {{Lines.UNIT_PRICE}} + +
+ + +
+ + {{Lines.LINE_AMOUNT}} +
+ + + + +
+ + + + +
+ + {{Lines.QUANTITY}} + +
+ + +
+ + {{Lines.LINE_DISC_PERCENTAGE}} +
+ + + + + +
+ + + + +
+ + {{Lines.NEED_BY_DATE}} + +
+ + +
+ + {{Lines.PROMISED_DATE}} +
+ + + + + +
+ + + + +
+ + {{Lines.DELIVER_TO_LOCATION}} + +
+ + +
+ + {{Lines.PR_NUM}} +
+ + + + + +
+ + + + + +
+ + {{Lines.REQUESTOR}} + +
+ + + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + +
+ + +
+ +
+ +
+ +
+
+ +
+
+
+ +
+ + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + {{actionHistory.ACTION}} + {{actionHistory.NAME}} + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + +
+
+
+
+
+
+ +
+ + + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + +
+ + +
+ +
+
+
+
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} +
+ +
+
+ +
+ + +
+
+
+
+ +
+ + + +
+ + + + +
+
+
+
+ + + + + + + + + + {{'actionHis, action' | translate}} + + + {{notificationButtons.BUTTON_LABEL}} + + + + + + + + {{'worklistMain, skip' | translate}} + + + + + + + + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss new file mode 100644 index 00000000..db039aed --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss @@ -0,0 +1,8 @@ +.itemHISBtn{ + padding: 5px; + color: var(--light); + background: var(--darkgray); + border-radius: 3px; + width: 85%; + height: 40px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.spec.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.spec.ts new file mode 100644 index 00000000..e2d29090 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistMainPoComponent } from './worklist-main-po.component'; + +describe('WorklistMainPoComponent', () => { + let component: WorklistMainPoComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistMainPoComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistMainPoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts new file mode 100644 index 00000000..430383fe --- /dev/null +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -0,0 +1,869 @@ +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'; +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'; + +@Component({ + selector: 'app-worklist-main-po', + templateUrl: './worklist-main-po.component.html', + styleUrls: ['./worklist-main-po.component.scss'], +}) +export class WorklistMainPoComponent 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_PO_INFO = "passPOInfo"; + public static PASS_PO_HEADER_ID = "passPOHeader"; + + 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; + 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; + + 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.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + } + + 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; + } + + + + + + }//ngOn + 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 == "PO"){ + this.getPONotificationDetails(this.WorkListBodyObj); + } + } + getPONotificationDetails(notificationBodyObj){ + this.worklistMainService + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "PO"); + }); + } + + 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; + } + }// + } + } //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 { + 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, + WorklistMainPoComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainPoComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainPoComponent.PASS_RES_ATTR + ); + this.common.openWorklistRFCPage(); + } 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, + WorklistMainPoComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainPoComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainPoComponent.PASS_RES_ATTR + ); + this.common.openWorklistRollReplacement(); + } else if ( + ButtonAction == "DELEGATE" || + ButtonAction == "REQUEST_INFO" || + ButtonAction == "TRANSFER" || + ButtonAction == "TRANSFER_INFO" + ) { + // 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, + WorklistMainPoComponent.PASS_NOTIFICATION_INFO + ); + this.common.sharedService.setSharedData( + ButtonAction, + WorklistMainPoComponent.PASS_ACTION_MODE + ); + this.common.sharedService.setSharedData( + this.P_RESPOND_ATTRIBUTES_TBL, + WorklistMainPoComponent.PASS_RES_ATTR + ); + this.common.openWorklistRollReplacement(); + } 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, + WorklistMainPoComponent.PASS_NOTIFICATION_INFO + ); + this.common.openWorklistHistoryPage(); + } + + + + openSupportDocuments() { + // this.navCtrl.push("WorkListAttachPage", { + // passNotificationInfo: this.getPassNotificationDetails + // }); + this.common.sharedService.setSharedData( + this.getPassNotificationDetails, + WorklistMainPoComponent.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.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; + + this.common.sharedService.setSharedData( + this.NotificationGetRespondAttributesList, + WorklistMainPoComponent.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 = '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(); + } + + getItemHistory(itemID) { + console.log(itemID); + this.IsReachEnd = false; + const request = new POItemHistoryRequest(); + request.P_ITEM_ID=parseInt(itemID); + request.P_PAGE_LIMIT=50; + request.P_PAGE_NUM=1; + this.worklistMainService.getPOItemHistory(request). + subscribe((result: POItemHistoryRes) => { + // this.common.sharedService.setSharedData( + // result.GetItemHistoryList, + // WorklistMainPoComponent.ItemHistoryList + // ); + this.common.sharedService.setSharedData( + itemID, + WorklistMainPoComponent.PASS_PO_INFO + ); + //open page + this.common.openItemHistoryPage(); + //this.handleItemHistoryResult(result); + }); + } + + + handleItemHistoryResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetItemHistoryList)) { + this.itemHistoryRes = result.GetItemHistoryList; + this.P_PAGE_NUM++; + let lastItemIndex = this.itemHistoryRes.length - 1; + if (result.GetItemHistoryList[lastItemIndex]) { + let lastitem = result.GetItemHistoryList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + + 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=50; + request.P_PAGE_NUM=1; + this.worklistMainService.getQutationAnalysis(request). + subscribe((result: QuotationAnalysisResponse) => { + this.common.sharedService.setSharedData( + itemID, + WorklistMainPoComponent.PASS_PO_INFO + ); + this.common.sharedService.setSharedData( + headerID, + WorklistMainPoComponent.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{ + alert("No DATA") + } + + } + } + +//infinite scrolling + +} 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 index 5bb4c206..ebf8c840 100644 --- 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 @@ -130,8 +130,9 @@
- - + + @@ -144,28 +145,28 @@

- + -
- - -
{{totalH}}
-
{{valueH}}
- -
- +
+ + +
{{totalH}}
+
{{valueH}}
+ +
+
{{taxH}}
{{taxvalueH}}
- -
+ +
- +
- - + + + - @@ -193,143 +194,153 @@ - - + - -
-

{{ 'general, empty' | translate}}

-
-
- -
- - - + +
+

{{ 'general, empty' | translate}}

+
+ +
+ + + +
+ + + + - - - - - - - -
- - -
- - - -
- - -
-
- + {{Lines.ITEM_CODE}} + + + - - -
- - -
- - - -
- - + {{Lines.UNIT_PRICE}} -
-
- + + + - - -
- - -
+ {{Lines.LINE_AMOUNT}} + - - - -
- - -
+ {{Lines.QUANTITY}} + -
+ +
-
+ -
- - +
+ + +
-
-

{{ 'general, empty' | translate}}

-
-
- -
- +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ -
- - +
+ + -
+
- -
- + -
-
-
- - {{actionHistory.ACTION}} - {{actionHistory.NAME}} - + + +
+ - {{actionHistory.NOTIFICATION_DATE| dateString }} - - -
- +
+
+
+ + {{actionHistory.ACTION}} + {{actionHistory.NAME}} + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + + +
+
@@ -342,39 +353,46 @@

{{ 'general, notAttch' | translate}}

- - -
- - -
-
-
-
-
-
-
-
- - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} -
- -
-
+ +
- -
@@ -389,55 +407,47 @@
--> - - - -
-
-
-
- - + +
+
+
+
- + + + + + - - - {{'actionHis, action' | translate}} - - - {{notificationButtons.BUTTON_LABEL}} - - + + {{'actionHis, action' | translate}} + + + {{notificationButtons.BUTTON_LABEL}} + + - - - {{'worklistMain, skip' | translate}} - + + + {{'worklistMain, skip' | translate}} + - - + + - - + 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 index 1d9aa14f..a1d96baf 100644 --- 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 @@ -1,306 +1,306 @@ -.colorBG{ - --background: #f0efef; - } - .footerSearchBtn{ - padding: 0px !important; - background: #f0efef !important; -} - -.actionList{ - // position: fixed; - // bottom: 0px; - width: 215px; - border-top-left-radius: 7px; - border-top-right-radius: 7px -} -.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(--dark); - --indicator-color-checked: var(--secondary); - --background: #f0efef; - --background-activated: #f0efef; - --background-hover:#f0efef; - --background-activated:#f0efef; - --background-checked:#f0efef; - - - -} - -.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; +// .colorBG{ +// --background: #f0efef; +// } +// .footerSearchBtn{ +// padding: 0px !important; +// background: #f0efef !important; // } +// .actionList{ +// // position: fixed; +// // bottom: 0px; +// width: 215px; +// border-top-left-radius: 7px; +// border-top-right-radius: 7px +// } +// .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; -// .swiper-pagination.swiper-pagination-bullets { -// top: 6px !important; -// bottom: 0px !important; -// } + +// } +// .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(--dark); +// --indicator-color-checked: var(--secondary); +// --background: #f0efef; +// --background-activated: #f0efef; +// --background-hover:#f0efef; +// --background-activated:#f0efef; +// --background-checked:#f0efef; + + + +// } + +// .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; -// } +// // .swiper-pagination { +// // top: 6px; +// // } -.bar-stable { - background-color: var(--cusgray) !important; - } - .tabs{ - background-color: var(--cusgray) !important; - } - .icon-size-lg { - font-size: 40px; - } +// .bar-stable { +// background-color: var(--cusgray) !important; +// } +// .tabs{ +// background-color: var(--cusgray) !important; +// } +// .icon-size-lg { +// font-size: 40px; +// } - /*Timeline*/ +// /*Timeline*/ - .pos-absolute-right { - position: absolute; - right: 8px; - } +// .pos-absolute-right { +// position: absolute; +// right: 8px; +// } - .timeline { - position: relative; - margin: 15px 0 0 0; - } +// .timeline { +// position: relative; +// margin: 15px 0 0 0; +// } - .timeline:before { +// .timeline:before { - content: ''; - position: absolute; - top: 0; - bottom: 0; - width: 4px; - background: #e4e4e4; - z-index: 1; - left: 66px; - /* margin-left: -10px; */ - /* z-index: 1; */ - } +// content: ''; +// position: absolute; +// top: 0; +// bottom: 0; +// width: 4px; +// background: #e4e4e4; +// z-index: 1; +// left: 66px; +// /* margin-left: -10px; */ +// /* z-index: 1; */ +// } - .timeline .timeline-thumb { +// .timeline .timeline-thumb { - border-radius: 500px; - width: 40px !important; - z-index: 2; - position: absolute; - left: 48px; - // :root[dir="ltr"]{ - // left: 37px; - // } - // :root[dir="rtl"]{ - // right: 37px; - // } - float: right; - top: 9px; - } +// border-radius: 500px; +// width: 40px !important; +// z-index: 2; +// position: absolute; +// left: 48px; +// // :root[dir="ltr"]{ +// // left: 37px; +// // } +// // :root[dir="rtl"]{ +// // right: 37px; +// // } +// float: right; +// top: 9px; +// } - .timeline .timeline-thumb.timeline-icon { - height: 40px; - // text-align: center; - // color: white; - // border: 5px solid #CBD0D3; - // transform: scale(0.2); - } +// .timeline .timeline-thumb.timeline-icon { +// height: 40px; +// // text-align: center; +// // color: white; +// // border: 5px solid #CBD0D3; +// // transform: scale(0.2); +// } - .timeline .timeline-item { - width: 50px; +// .timeline .timeline-item { +// width: 50px; - } +// } - .timeline .timeline-stats { - position: relative; - font-size: 12px; - color: var(--darkgray); +// .timeline .timeline-stats { +// position: relative; +// font-size: 12px; +// color: var(--darkgray); - } +// } - .divider-title { - background: #e4e4e4; - padding: 5px 15px; - } +// .divider-title { +// background: #e4e4e4; +// padding: 5px 15px; +// } - .color-red { - color: var(--danger) !important; - } +// .color-red { +// color: var(--danger) !important; +// } - .bg-color-dot { +// .bg-color-dot { - background: var(--gray); +// background: var(--gray); - /* background: linear-gradient(45deg, var(--primary) 0%, #19a163 36%, var(--secondary) 59%, var(--customnavy) 100%); */ - // border: var(--secondary) solid 1px; - // 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%); +// /* background: linear-gradient(45deg, var(--primary) 0%, #19a163 36%, var(--secondary) 59%, var(--customnavy) 100%); */ +// // border: var(--secondary) solid 1px; +// // 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%); - } +// } - .bg-blue-dot { +// .bg-blue-dot { - border: var(--blue) solid 1px; - background: var(--gray); +// border: var(--blue) solid 1px; +// background: var(--gray); - } - .bg-orange-dot { +// } +// .bg-orange-dot { - border: var(--orange) solid 1px; - background: var(--gray); - } - .bg-red-dot { +// border: var(--orange) solid 1px; +// background: var(--gray); +// } +// .bg-red-dot { - border: var(--red) solid 1px; - background: var(--gray); +// border: var(--red) solid 1px; +// background: var(--gray); - } - .bg-green-dot { +// } +// .bg-green-dot { - border: var(--green) solid 1px; - background: var(--gray); - } +// border: var(--green) solid 1px; +// background: var(--gray); +// } - .bg-blue-txt { +// .bg-blue-txt { - color: var(--blue) !important; - font-weight:bold; +// color: var(--blue) !important; +// font-weight:bold; - } - .bg-orange-txt { - font-weight:bold; +// } +// .bg-orange-txt { +// font-weight:bold; - color: var(--orange) !important; - } - .bg-red-txt { - font-weight:bold; +// color: var(--orange) !important; +// } +// .bg-red-txt { +// font-weight:bold; - color: var(--red) !important; +// color: var(--red) !important; - } - .bg-green-txt { - font-weight:bold; +// } +// .bg-green-txt { +// font-weight:bold; - color: var(--green) !important; - } +// color: var(--green) !important; +// } -.notification-list{ -ion-item{ - // margin-top: 5px; - // margin-bottom: 5px; +// .notification-list{ +// ion-item{ +// // margin-top: 5px; +// // margin-bottom: 5px; - background-color: transparent; - .item-date{ - width: 55px; - font-size: 14px; - font-weight: bold; +// background-color: transparent; +// .item-date{ +// width: 55px; +// font-size: 14px; +// font-weight: bold; - text-align: center; - padding: 0; - margin: 0; +// text-align: center; +// padding: 0; +// margin: 0; - position: absolute; - left: 0; - top: 0; - } - ion-label , [item-end]{ +// 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; - // } +// 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: 66px; -} -.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; - } -} +// } + +// } +// } +// .input-wrapper { +// --flex:none; +// } +// ion-input ,ion-datetime{ +// border-bottom: #dedede 1px solid; +// } +// .left { +// .timeline:before{ +// left: 66px; +// } +// .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.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index c31ae21e..884f5521 100644 --- 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 @@ -218,8 +218,8 @@ export class WorklistMainPRComponent implements OnInit { this.worklistMainService .getPONotificationBody(notificationBodyObj) .subscribe((result: PONotificatonBodyResponse) => { - // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); - // this.handleWorkListBodyResult(result, "PO"); + console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "PO"); }); } @@ -406,7 +406,7 @@ export class WorklistMainPRComponent implements OnInit { } - this.common.confirmAlertDialog( + this.common.confirmAlertDialogAction( () => { this.applyAction(this.WorkListActionObj); }, this.ts.trPK('general', 'ok'), diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index 552601bb..c9965cd0 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -131,6 +131,6 @@ {{ts.trPK('general','submit')}}
- {{ts.trPK('workListMain','skip')}} + {{'worklistMain, skip' | translate}}
\ No newline at end of file diff --git a/Mohem/src/app/payslip/home/home.component.html b/Mohem/src/app/payslip/home/home.component.html index 1f61f828..b6e25a7a 100644 --- a/Mohem/src/app/payslip/home/home.component.html +++ b/Mohem/src/app/payslip/home/home.component.html @@ -6,16 +6,19 @@ {{ts.trPK('payslip','title')}} - + - + choose payslip - {{options.PAYSLIP_CHOICE}} + {{options.PAYSLIP_CHOICE}} + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
- + - + + + +
- + - + - + - + - + - + - + - + - + - + - + - + @@ -138,72 +193,181 @@
- -
- + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + + +
- -
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + - +
\ No newline at end of file diff --git a/Mohem/src/app/payslip/home/home.component.scss b/Mohem/src/app/payslip/home/home.component.scss index e69de29b..3b9e5d21 100644 --- a/Mohem/src/app/payslip/home/home.component.scss +++ b/Mohem/src/app/payslip/home/home.component.scss @@ -0,0 +1,41 @@ +.rowAccordin{ + border: none; + + +} + +.gridAccordin{ + margin: 10px; + background: #ffffff; + border-radius: 5px; +} + +.colPayslip{ + text-align: center; + color: var(--labelColor); + +} +.earingTotH{ + text-align: right; + font-weight: bold; + font-size:20px !important; + padding-right: 15px; +} + +.earingTotG{ + text-align: left; + padding-left: 15px; + font-weight: bold; + font-size: 20px !important; + color: var(--green); + +} + +.earingTotR{ + text-align: left; + padding-left: 15px; + font-weight: bold; + font-size: 20px !important; + color: var(--red); + +} diff --git a/Mohem/src/app/payslip/home/home.component.ts b/Mohem/src/app/payslip/home/home.component.ts index 2c11be94..007c348c 100644 --- a/Mohem/src/app/payslip/home/home.component.ts +++ b/Mohem/src/app/payslip/home/home.component.ts @@ -19,6 +19,10 @@ export class HomeComponent implements OnInit { showPaySlip:any=[]; ActionContextID:any; public static ACTION_CONTEXT_ID = "passActionContectID"; + GetEarningsList: any=''; + GetDeductionsList: any=''; + earingTotal: any; + deductionTotal: any; constructor( public payslipService:PayslipService, @@ -85,7 +89,9 @@ export class HomeComponent implements OnInit { this.ActionContextID=this.GetPayslipList[index].ACTION_CONTEXT_ID; this.common.sharedService.setSharedData(this.ActionContextID,HomeComponent.ACTION_CONTEXT_ID); this.getSummeryOfPayment(this.ActionContextID); - this.getPaymentInfo(this.ActionContextID) + this.getPaymentInfo(this.ActionContextID); + this.getDeduction(this.ActionContextID); + this.getEarings(this.ActionContextID); } @@ -104,6 +110,9 @@ export class HomeComponent implements OnInit { handleSummeryOfPaymentResult(result){ if (result.GetSummaryOfPaymentList != null) { this.GetSummaryOfPaymentList = result.GetSummaryOfPaymentList[0]; + this.earingTotal = this.GetSummaryOfPaymentList.TOTAL_EARNINGS_AMOUNT; + this.deductionTotal = this.GetSummaryOfPaymentList.TOTAL_DEDUCTIONS_AMOUNT; + } } @@ -134,4 +143,52 @@ openDeductions(){ this.common.openDeductionsPage(); } +getEarings(ActionContextID){ + const request = { + P_ACTION_CONTEXT_ID: ActionContextID, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.payslipService.getEarings(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> + { + this.handleGetEaringsResult(result); + } + ); +} + +handleGetEaringsResult(result){ + if (result.GetEarningsList != null) { + this.GetEarningsList = result.GetEarningsList; + } + + + +} + +getDeduction(ActionContextID){ + const request = { + P_ACTION_CONTEXT_ID: ActionContextID, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.payslipService.getDeduction(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> + { + this.handleGetDeductionResult(result); + } + ); + } + + handleGetDeductionResult(result){ + if (result.GetDeductionsList != null) { + this.GetDeductionsList = result.GetDeductionsList; + } + } + + + + + + } diff --git a/Mohem/src/app/payslip/payslip.module.ts b/Mohem/src/app/payslip/payslip.module.ts index be74137e..c191af9d 100644 --- a/Mohem/src/app/payslip/payslip.module.ts +++ b/Mohem/src/app/payslip/payslip.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { Routes, RouterModule } from '@angular/router'; +import { HmgCommonModule } from 'src/app/hmg-common/hmg-common.module'; import { IonicModule } from '@ionic/angular'; import {EarningsComponent}from './earnings/earnings.component' @@ -35,6 +36,7 @@ const routes: Routes = [ CommonModule, FormsModule, IonicModule, + HmgCommonModule, RouterModule.forChild(routes) ], providers:[ diff --git a/Mohem/src/assets/imgs/arrowDown.png b/Mohem/src/assets/imgs/arrowDown.png new file mode 100644 index 00000000..769b67e9 Binary files /dev/null and b/Mohem/src/assets/imgs/arrowDown.png differ diff --git a/Mohem/src/assets/imgs/arrowUp.png b/Mohem/src/assets/imgs/arrowUp.png new file mode 100644 index 00000000..53f27e9e Binary files /dev/null and b/Mohem/src/assets/imgs/arrowUp.png differ diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 5be6f116..6714c2ec 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1727,8 +1727,268 @@ "closeMsg":{ "en": "Are you sure to close this purchase requisition ?", "ar":"العناصر المطلوبة" + }, + "Supplier":{ + "en": "Supplier", + "ar":"Supplier" + }, + "Site":{ + "en": "Site", + "ar":"Site" + }, + "Preparer":{ + "en": "Preparer", + "ar":"Preparer" + }, + "Buyer":{ + "en": "Buyer", + "ar":"Buyer" + }, + "CreationDate":{ + "en": "Creation Date", + "ar":"Creation Date" + }, + "ShipToLocation":{ + "en": "Ship To Location", + "ar":"Ship To Location " + }, + "QuotationNumber":{ + "en": "Quotation Number", + "ar":"Quotation Number" + }, + "QuotationDate":{ + "en": "Quotation Date", + "ar":"Quotation Date" + }, + "PaymentTerms":{ + "en": "Payment Terms", + "ar":"Payment Terms " + }, + "GrossAmount":{ + "en": "Gross Amount", + "ar":"Gross Amount" + }, + "DiscountAmount":{ + "en": "Discount Amount", + "ar":"Discount Amount" + }, + "TotalPODiscount":{ + "en": "Total PO Discount", + "ar":"Total PO Discount" + }, + "VATAmount":{ + "en": "VAT Amount", + "ar":"VAT Amount" + }, + "CustomDuty":{ + "en": "Custom Duty", + "ar":"Custom Duty" + }, + "ShipHandle":{ + "en": "Ship Handle", + "ar":"Ship Handle" + }, + "OtherCharges":{ + "en": "Other Charges", + "ar":"Other Charges" + }, + "TotalPOAmountWithVAT":{ + "en": "Total PO Amount with VAT", + "ar":"Total PO Amount with VAT" + }, + "TotalPOAmountInWords":{ + "en": "Total PO Amount in Words", + "ar":"Total PO Amount in Words" + }, + "Currency":{ + "en": "Currency", + "ar":"Currency" + }, + "PONumber":{ + "en": "PO NUMBER", + "ar":"PO NUMBER" + }, + "des-PO":{ + "en": "Standard Purchase Order", + "ar":"Standard Purchase Order" + }, + "MFG":{ + "en": "MFG", + "ar":"MFG" + }, + "LINE_TYPE":{ + "en": "Line Type", + "ar":"Line Type" + }, + "LINE_DIS":{ + "en": "Line Discount %", + "ar":"Line Discount %" + }, + "LINE_AMOUNT":{ + "en": "Line Amount", + "ar":"Line Amount" + }, + "NEED_TO":{ + "en": "Need By Date", + "ar":"Need By Date" + }, + "PROMISED_DATE":{ + "en": "Promised Date", + "ar":"Promised Date" + }, + "DELIVER_TO":{ + "en": "Deliver To Location", + "ar":"Deliver To Location" + }, + "PR_NO":{ + "en": "Requisition Number", + "ar":"Requisition Number" + }, + "REQUEST":{ + "en": "Requestor", + "ar":"Requestor" + }, + "ITEM_HIS":{ + "en": "Item History", + "ar":"Item History" + }, + "QUOTATION_ANALYSIS":{ + "en": "Quotation Analysis", + "ar":"Quotation Analysis" + }, + "Date_Req":{ + "en": "Date Required", + "ar":"Date Required" + }, + "line_status":{ + "en": "Line Status", + "ar":"Line Status" + }, + "date_status":{ + "en": "Status Date", + "ar":"Status Date" + }, + "trans_type":{ + "en": "Transaction Type", + "ar":"Transaction Type" + }, + "operating_unit":{ + "en": "Operating Unit", + "ar":"Operating Unit" + }, + "to_locator":{ + "en": "To Locator", + "ar":"To Locator" + }, + "to_subinventory":{ + "en": "To Subinventory", + "ar":"To Subinventory" + }, + "from_locator":{ + "en": "From Locator", + "ar":"From Locator" + }, + "from_subinventory":{ + "en": "From Subinventory", + "ar":"From Subinventory" + }, + "organization":{ + "en": "Organization", + "ar":"Organization" + }, + "organization_code":{ + "en": "Organization Code", + "ar":"Organization Code" + }, + "revision":{ + "en": "Revision", + "ar":"Revision " + }, + "uom":{ + "en": "UOM", + "ar":"UOM" + }, + "quantity_ordered":{ + "en": "Quantity Ordered", + "ar":"Quantity Ordered" + }, + "quantity_received":{ + "en": "Quantity Received", + "ar":"Quantity Received" + }, + "bonus_quantity":{ + "en": "Bonus Quantity", + "ar":"Bonus Quantity" + }, + "purchase_price":{ + "en": "Purchase Price", + "ar":"Purchase Price" + }, + + "discount":{ + "en": "Discount %", + "ar":"Discount %" + }, + "balance_quantity":{ + "en": "Balance Quantity", + "ar":"Balance Quantity" + }, + "net_price":{ + "en": "Net Price", + "ar":"Net Price" + }, + "closure_status":{ + "en": "Closure Status", + "ar":"Closure Status" + }, + "vendor_name":{ + "en": "Vendor Name", + "ar":"Vendor Name" + }, + "item_code":{ + "en": "Item Code", + "ar":"Item Code" + }, + "QUOTATION_QTY":{ + "en": "Quotation Qty", + "ar":"Quotation Qty" + }, + "quotation_uom":{ + "en": "Quotation UOM", + "ar":"Quotation UOM" + }, + "quotatio_net_price":{ + "en": "Quotatio Net Price", + "ar":"Quotatio Net Price" + }, + "quotatio_line_tot":{ + "en": "Quotation Line Total", + "ar":"Quotation Line Total" + }, + "quotatio_bonus_quantity":{ + "en": "Quotation Bonus Quantity", + "ar":"Quotation Bonus Quantity" + }, + "quotation_delivery_date":{ + "en": "Quotation Delivery Date", + "ar":"Quotation Delivery Date" + }, + "MFG_part_number":{ + "en": "Quotation MFG Part Number", + "ar":"Quotation MFG Part Number" + }, + "RFQ_number":{ + "en": "RFQ Number", + "ar":"RFQ Number" + }, + "RFQ_qty":{ + "en": "RFQ Qty", + "ar":"RFQ Qty" + }, + "RFQ_UOM":{ + "en": "RFQ UOM", + "ar":"RFQ UOM" } - }, "payslip": { "title":{ @@ -1810,6 +2070,11 @@ "payroll-info":{ "en": "Payroll Processing Information", "ar":"معلومات كشف الراتب " + }, + "total":{ + "en": "Total", + "ar":"المجموع " } + } } \ No newline at end of file diff --git a/Mohem/src/global.scss b/Mohem/src/global.scss index 6543a146..4421a600 100644 --- a/Mohem/src/global.scss +++ b/Mohem/src/global.scss @@ -10,3 +10,4 @@ @import '~@ionic/angular/css/text-transformation.css'; @import '~@ionic/angular/css/flex-utils.css'; @import "theme/styles.scss"; +@import "theme/worklist.scss"; diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 8de24f91..32566988 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -800,6 +800,7 @@ color: var(--dark); // .skipbutton,.button-md, button-ios{ .skipbutton{ + width: 100px; --background: var(--orange); white-space: normal; color: var(--light); @@ -815,27 +816,33 @@ color: var(--dark); } .cancelBtn { - background:var(--red); - white-space: normal; - color:var(--light); - text-transform: capitalize; + background:var(--red) !important; + white-space: normal !important; + color:var(--light) !important; + text-transform: capitalize !important; // min-width: 200px; - min-height: 45px; - border-radius: 5px; - width:125px; + min-height: 45px !important; + border-radius: 5px !important; + width:125px !important; + min-width: 5px !important; + width: 10px !important; + margin: 8px !important; } - .confirmBtn { - background:var(--green); - white-space: normal; - color:var(--light); - text-transform: capitalize; +.confirmBtn { + background:var(--green) !important; + white-space: normal !important; + color:var(--light) !important; + text-transform: capitalize !important; // min-width: 200px; - min-height: 45px; - border-radius: 5px; - width:125px; - + min-height: 45px !important; + border-radius: 5px !important; + width:125px !important; + min-width: 5px !important; + width: 10px !important; + margin: 8px !important; } + // .slides-gray-bullets .swiper-wrapper { // margin-top: 14px !important; // } diff --git a/Mohem/src/theme/variables.scss b/Mohem/src/theme/variables.scss index 454fe9ee..33bb3b43 100644 --- a/Mohem/src/theme/variables.scss +++ b/Mohem/src/theme/variables.scss @@ -68,6 +68,7 @@ --green:#209B48; --red:#BE1E2D; --blue:#223262; + --cyanblue:#1b75bc; // $font-family-base: $fontFamilyMediumEN !default; // $font-family-ios-base: $fontFamilyMediumEN !default; diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss new file mode 100644 index 00000000..48f6c94c --- /dev/null +++ b/Mohem/src/theme/worklist.scss @@ -0,0 +1,368 @@ +.colorBG{ + --background: #f0efef; + } + .footerSearchBtn{ + padding: 0px !important; + background: #f0efef !important; +} + + +.headerRow{ + padding-top: 10px; + padding-bottom: 10px; +} +.itemReqList{ + background: #f0efef; + margin-top: 20px; + width: 95%; + +} +.gridItemReq{ + //width:95%; +} + + +.itemReqContent{ + margin-top: 17px; + margin-bottom: 10px; + border-radius: 7px; + text-align: left; +} +.itemReqDiv{ + padding-bottom: 10px; + padding-top: 10px; +} +.arrowIcon{ +width: 18px !important; + +margin-right: -21px !important; +margin-left: 10px !important; +} +.actionList{ + // position: fixed; + // bottom: 0px; + bottom: -7px; + width: 215px; + border-top-left-radius: 7px; + border-top-right-radius: 7px +} +.cardContent{ + width:100%; + margin-top: 33px +} +.colItemReq{ + color: var(--dark); + font-weight: bold; + font-size: 16px; + text-align: left; + display: contents; + font-family: var(--ion-font-family,inherit); + font-size: inherit; + text-overflow: ellipsis; + white-space: normal; + overflow: hidden; + box-sizing: border-box; + + + + +} + +.colItemReqHeader{ +text-align: justify; +color: var(--cyanblue); +font-weight: bold; +} +.labelTotal{ + color: var(--danger); + font-weight: bold; + font-size: 17px; + + +} +.labelAction{ +color:var(--customnavy) !important; +font-weight:bold; +} +.colItems{ +padding-bottom: 10px +} + + +ion-label.labelValue.sc-ion-label-ios-h.sc-ion-label-ios-s.ios.hydrated, +ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated +{ + white-space: pre-wrap !important; + --color: initial; + display: contents; + color: var(--color); + font-family: var(--ion-font-family,inherit); + font-size: inherit; + text-overflow: ellipsis; + overflow: hidden; + -webkit-box-sizing: border-box; + box-sizing: border-box +} + +.segmentPR{ + + // --background-hover: rgba(var(--ion-color-contrast-rgb),0.04); + // --background-activated: var(--danger); + // --color: rgba(--primary); + --color-checked: var(--dark); + --indicator-color-checked: var(--secondary); + --background: #f0efef; + --background-activated: #f0efef; + --background-hover:#f0efef; + --background-activated:#f0efef; + --background-checked:#f0efef; + + + +} + +.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: 66px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 40px !important; + z-index: 2; + position: absolute; + left: 48px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 40px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); + } + + + + .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: var(--gray); + + /* background: linear-gradient(45deg, var(--primary) 0%, #19a163 36%, var(--secondary) 59%, var(--customnavy) 100%); */ + // border: var(--secondary) solid 1px; + // 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%); + + + } + + .bg-blue-dot { + + border: var(--blue) solid 1px; + background: var(--gray); + + } + .bg-orange-dot { + + border: var(--orange) solid 1px; + background: var(--gray); + } + .bg-red-dot { + + border: var(--red) solid 1px; + background: var(--gray); + + } + .bg-green-dot { + + border: var(--green) solid 1px; + background: var(--gray); + } + + + .bg-blue-txt { + + color: var(--blue) !important; + font-weight:bold; + + } + .bg-orange-txt { + font-weight:bold; + + color: var(--orange) !important; + } + .bg-red-txt { + font-weight:bold; + + color: var(--red) !important; + + + } + .bg-green-txt { + font-weight:bold; + + color: var(--green) !important; + } + + + + + +.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: 66px; +} +.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; + } +} + +