-
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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{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','info')}}
+
+
+
+ {{ts.trPK('worklistMain','itemReq')}}
+
+
+
+
+ {{'worklistMain, actionHis' | translate}}
+
+
+
+
+
+ {{'general, attachment' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{pInformation}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{totalH}}
+ {{valueH}}
+
+
+
+ {{taxH}}
+ {{taxvalueH}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{actionHistory.ACTION}}
+ {{actionHistory.NAME}}
+
+
+ {{actionHistory.NOTIFICATION_DATE| dateString }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, notAttch' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+

+
+ 
+
+
+

+
+
+

+
+
+ {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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','info')}}
+
+
+ {{ts.trPK('worklistMain','itemReq')}}
+
+
+
+ {{'worklistMain, actionHis' | translate}}
+
+
+
+
+ {{'general, attachment' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{pInformation}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{totalH}}
+ {{valueH}}
+
+
+
+ {{taxH}}
+ {{taxvalueH}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{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}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{actionHistory.ACTION}}
+ {{actionHistory.NAME}}
+
+
+ {{actionHistory.NOTIFICATION_DATE| dateString }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, notAttch' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+

+
+ 
+
+
+

+
+
+

+
+
+ {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
-
-
+
-
- 0">
-
{{ 'general, empty' | translate}}
-
-
+
+
+
- 0">
-
{{ 'general, empty' | translate}}
-
- 0 ">
-
-
-
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
-
-
-
+
+
+
-
+
-
-
+

-
-
-
-
- {{actionHistory.ACTION}}
- {{actionHistory.NAME}}
-
+
+
+
+
-
{{actionHistory.NOTIFICATION_DATE| dateString }}
-
-
-
-
+
+
+
+
+ {{actionHistory.ACTION}}
+ {{actionHistory.NAME}}
+
+
+ {{actionHistory.NOTIFICATION_DATE| dateString }}
+
+
+
+
@@ -342,39 +353,46 @@
{{ 'general, notAttch' | translate}}
0 ">
-
-
-
-
-
- 
-
- 
-
- 
-
- 
-
-
- {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}}
-
-
-
-
+
+
-
-
@@ -389,55 +407,47 @@