diff --git a/Mohem/config.xml b/Mohem/config.xml index c08cf311..657c60ff 100644 --- a/Mohem/config.xml +++ b/Mohem/config.xml @@ -119,10 +119,10 @@ - + diff --git a/Mohem/package-lock.json b/Mohem/package-lock.json index 2e79c529..0b31f7c7 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -3209,6 +3209,216 @@ "serialize-javascript": "^1.4.0" } }, + "cordova-android": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.4.tgz", + "integrity": "sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g==", + "requires": { + "abbrev": "*", + "android-versions": "1.4.0", + "ansi": "*", + "balanced-match": "*", + "base64-js": "1.2.0", + "big-integer": "1.6.32", + "bplist-parser": "*", + "brace-expansion": "*", + "concat-map": "*", + "cordova-common": "2.2.5", + "cordova-registry-mapper": "*", + "elementtree": "0.1.6", + "glob": "5.0.15", + "inflight": "*", + "inherits": "*", + "minimatch": "*", + "nopt": "3.0.1", + "once": "*", + "path-is-absolute": "1.0.1", + "plist": "2.1.0", + "properties-parser": "0.2.3", + "q": "1.4.1", + "sax": "0.3.5", + "semver": "5.5.0", + "shelljs": "0.5.3", + "underscore": "*", + "unorm": "*", + "wrappy": "*", + "xmlbuilder": "8.2.2", + "xmldom": "*" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "android-versions": { + "version": "1.4.0", + "bundled": true, + "requires": { + "semver": "^5.4.1" + } + }, + "ansi": { + "version": "0.3.1", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "base64-js": { + "version": "1.2.0", + "bundled": true + }, + "big-integer": { + "version": "1.6.32", + "bundled": true + }, + "bplist-parser": { + "version": "0.1.1", + "bundled": true, + "requires": { + "big-integer": "^1.6.7" + } + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "cordova-common": { + "version": "2.2.5", + "bundled": true, + "requires": { + "ansi": "^0.3.1", + "bplist-parser": "^0.1.0", + "cordova-registry-mapper": "^1.1.8", + "elementtree": "0.1.6", + "glob": "^5.0.13", + "minimatch": "^3.0.0", + "plist": "^2.1.0", + "q": "^1.4.1", + "shelljs": "^0.5.3", + "underscore": "^1.8.3", + "unorm": "^1.3.3" + } + }, + "cordova-registry-mapper": { + "version": "1.1.15", + "bundled": true + }, + "elementtree": { + "version": "0.1.6", + "bundled": true, + "requires": { + "sax": "0.3.5" + } + }, + "glob": { + "version": "5.0.15", + "bundled": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "nopt": { + "version": "3.0.1", + "bundled": true, + "requires": { + "abbrev": "1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "plist": { + "version": "2.1.0", + "bundled": true, + "requires": { + "base64-js": "1.2.0", + "xmlbuilder": "8.2.2", + "xmldom": "0.1.x" + } + }, + "properties-parser": { + "version": "0.2.3", + "bundled": true + }, + "q": { + "version": "1.4.1", + "bundled": true + }, + "sax": { + "version": "0.3.5", + "bundled": true + }, + "semver": { + "version": "5.5.0", + "bundled": true + }, + "shelljs": { + "version": "0.5.3", + "bundled": true + }, + "underscore": { + "version": "1.9.1", + "bundled": true + }, + "unorm": { + "version": "1.4.1", + "bundled": true + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "xmlbuilder": { + "version": "8.2.2", + "bundled": true + }, + "xmldom": { + "version": "0.1.27", + "bundled": true + } + } + }, "cordova-browser": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cordova-browser/-/cordova-browser-5.0.4.tgz", diff --git a/Mohem/package.json b/Mohem/package.json index 44c00fdd..f024443c 100644 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -97,7 +97,7 @@ "ng2-pdf-viewer": "^5.3.2", "phonegap-plugin-barcodescanner": "^8.1.0", "phonegap-plugin-multidex": "^1.0.0", - "phonegap-plugin-push": "2.2.3", + "phonegap-plugin-push": "^2.2.3", "primeicons": "^1.0.0", "primeng": "^7.1.3", "run": "1.4.0", @@ -196,7 +196,8 @@ "cordova-android-support-gradle-release": { "ANDROID_SUPPORT_VERSION": "27.+" }, - "cordova-plugin-datepicker": {} + "cordova-plugin-datepicker": {}, + "phonegap-plugin-barcodescanner": {} }, "platforms": [ "browser", diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.html b/Mohem/src/app/eit/add-attach/add-attach.component.html index 515acb5d..6bd3f873 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.html +++ b/Mohem/src/app/eit/add-attach/add-attach.component.html @@ -16,34 +16,49 @@ -
{{"addAttach.title" | translate}}
-
+ + + +
{{'general, addAttach' | translate}}
+
+ +
+
+
+
+ + + - - - + + + - - + + - - + + - + - + - + diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.scss b/Mohem/src/app/eit/add-attach/add-attach.component.scss index e69de29b..e6ced223 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.scss +++ b/Mohem/src/app/eit/add-attach/add-attach.component.scss @@ -0,0 +1,19 @@ +.inputfile { + width: 0.1px; + height: 0.1px; + opacity: 0; + overflow: hidden; + position: absolute; + width: 40px; + height: 40px; + // z-index: -1; +} + +.imgSize { + width: 22px; + height: 22px; +} +.Header { + font-weight: bold; + color: #1a586d; +} diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.ts b/Mohem/src/app/eit/add-attach/add-attach.component.ts index 8afdc22d..b692cf45 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.ts +++ b/Mohem/src/app/eit/add-attach/add-attach.component.ts @@ -24,7 +24,7 @@ export class AddAttachComponent implements OnInit { index: any = 1; dirPage: any; TransactionID: any; - indexLastObj: any + indexLastObj: any = 0; filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.scss b/Mohem/src/app/eit/add-eit/add-eit.component.scss index 44d1bc00..c8182a3b 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.scss +++ b/Mohem/src/app/eit/add-eit/add-eit.component.scss @@ -1,7 +1,23 @@ .footer-button { - border-radius: 2px; - padding: 0 1.1em; - min-height: 45px; - min-width: 200px; - } - \ No newline at end of file + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; +} + +ion-label { + color: var(--customnavy) !important; +} + +.daynamicForm-Label { + font-size: 16px; + color: var(--customnavy) !important; + display: block; + overflow: hidden; + -webkit-flex: 1; + flex: 1; + font-size: inherit; + white-space: normal; + padding: 5px 0px; + margin: 10px auto; +} diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.ts b/Mohem/src/app/eit/add-eit/add-eit.component.ts index 1ef96c0d..94b724e0 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -137,7 +137,6 @@ export class AddEitComponent implements OnInit { const containerId = 'containerDiv'; this.eitVALSettoCall = []; for (let i = 0; i < feildsList.length; i++) { - console.log(feildsList[i]); let defaultVal: string = ""; let defaultValText: string = ""; defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME : ""; @@ -213,7 +212,7 @@ export class AddEitComponent implements OnInit { } } else { if (feildsList[i].READ_ONLY == 'Y') { - this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultValText, containerId, defaultVal, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); + this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, defaultVal, containerId, defaultVal, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, feildsList[i].REQUIRED_FLAG); } else { // dropdown list missing open in differnt page //check this validation since he doesnt check the other default_type @@ -386,11 +385,18 @@ export class AddEitComponent implements OnInit { } bindHtmlElemEvents(id, obj) { - console.log('bindElement: ' + id); const elem = document.getElementById(id); console.log(elem); + console.log(obj); + const elemType = elem.tagName; + let changeEvent = 'ionChange'; + + if (elemType == 'SELECT') + changeEvent = 'change'; + try { - elem.addEventListener("change", (e) => { + // elem.addEventListener("change", (e) => { + elem.addEventListener(changeEvent, (e) => { //console.log("elem change "+elem.id); //let x=e.currentTarget as HTMLInputElement; //let isEmpty:boolean=false; @@ -482,6 +488,7 @@ export class AddEitComponent implements OnInit { this.eitService.getDefaultValue(body).subscribe((result: any) => { let elem = this.getElementByName(segmentName); + console.log(elem); // if(elem.dataset.hiddenval){ // elem.dataset.hiddenval=""; // return false; @@ -490,8 +497,10 @@ export class AddEitComponent implements OnInit { let val = obj.value; let text = obj.text; if (isStandardDate) { + console.log('isStandardDate'); elem.value = this.cs.reverseFormatDate(val); } else if (isStandardTimeDate) { + console.log('isStandardTimeDate'); if (val) { elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); elem.innerHTML = this.cs.reverseFormatStandardDate(val); @@ -500,6 +509,7 @@ export class AddEitComponent implements OnInit { elem.innerHTML = ""; } } else if (isStandardTime) { + console.log('isStandardTime'); if (val) { elem.dataset.dtvalue = val; elem.innerHTML = val; @@ -508,7 +518,11 @@ export class AddEitComponent implements OnInit { elem.innerHTML = ""; } } else { + console.log('else - ' + elem.value); elem.value = val; + elem.innerText = val; + elem.setAttribute('value', val); + console.log('else - ' + elem.value); } if (isHidden || isReadOnlyList) { if (val) @@ -517,7 +531,7 @@ export class AddEitComponent implements OnInit { elem.dataset.colmText = ""; elem.value = text; } - var event = new Event('change'); + var event = new Event('ionChange'); elem.dispatchEvent(event); }); } @@ -635,7 +649,8 @@ export class AddEitComponent implements OnInit { } idColName = val; if (this.eitResponse[j].FORMAT_TYPE == "X") {//date - idColName = this.cs.formatDate(val); + // idColName = this.cs.formatDate(val); + idColName = this.cs.formatDateNew(val); } } parentArr.push({ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, VALUE_COLUMN_NAME: val, DESCRIPTION: "", ID_COLUMN_NAME: idColName, FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME }) diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html index b30c7c36..531ceafe 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html @@ -9,27 +9,27 @@ -
{{"confirmAddEit.approverList" | translate}}
+
{{'confirmAddEit, approverList' | translate}}
- - - - + + + + {{'confirmAddEit, no' | translate}} - - + + {{'confirmAddEit, approver' | translate}} - - + + {{'confirmAddEit, approverCategory' | translate}} - - + + {{'confirmAddEit, approverType' | translate}} - - + + {{'confirmAddEit, status' | translate}} - - - + + + {{item.APPROVER_ORDER_NUMBER}} - - + + {{item.APPROVER}} - - + + {{item.APPROVER_CATEGORY}} - - + + {{item.APPROVER_TYPE}} - - + + {{item.APPROVAL_STATUS}} @@ -112,11 +112,20 @@ -
{{"absenceList, attachList" | translate}}
- + + + + {{"absenceList, attachList" | translate}} + + + + + +
+
diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss index 44d1bc00..94ace281 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss @@ -1,7 +1,26 @@ .footer-button { - border-radius: 2px; - padding: 0 1.1em; - min-height: 45px; - min-width: 200px; - } - \ No newline at end of file + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; +} + +.imgSize { + width: 22px; + height: 22px; +} + +.Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; +} + +.tbData { + font-size: 10px; +} + +.btnBack { + background: transparent; + float: right; +} diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts index b1579cc8..4171b53f 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts @@ -30,7 +30,7 @@ export class ConfirmAddEitComponent implements OnInit { respID: number; selMenu: MenuResponse; getAttachList: any; - attachListDisplay: any; + attachListDisplay: any = []; headerTitle: string = ""; isTrue: any = 0; attachItems: any; @@ -58,9 +58,7 @@ export class ConfirmAddEitComponent implements OnInit { this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false); - this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; - if (this.isResubmitEIT) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); @@ -82,7 +80,6 @@ export class ConfirmAddEitComponent implements OnInit { this.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA); this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY; this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID; - this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; @@ -128,8 +125,8 @@ export class ConfirmAddEitComponent implements OnInit { let request = { AddAttachmentList: this.attachListOver - } + this.eitService.addAttachment( request). subscribe((result: any) => { @@ -217,7 +214,8 @@ export class ConfirmAddEitComponent implements OnInit { // } // this.navCtrl.popToRoot(); - this.cs.openHome(); + // this.cs.openHome(); + this.cs.openNotificationPage(); } } @@ -232,6 +230,9 @@ export class ConfirmAddEitComponent implements OnInit { //open the modal with return data let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; + this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); + const modal = await this.modalController.create({ component: AddAttachComponent }); @@ -252,7 +253,8 @@ export class ConfirmAddEitComponent implements OnInit { //.ATTACHED_DOCUMENT_ID this.updateFile(data, attachDocID); } else { - this.attachListDisplay = data; + console.log(data); + this.attachListDisplay = data.data; this.attachItems = this.attachListDisplay.map(function (el) { var o = Object.assign({}, el); o.isSuccess = false; @@ -260,6 +262,7 @@ export class ConfirmAddEitComponent implements OnInit { }); this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + // this.attachListOver = this.attachListDisplay; } // this.attachListDisplay=data; @@ -268,62 +271,10 @@ export class ConfirmAddEitComponent implements OnInit { // o.isSuccess = false; // return o; // }) - // console.log(this.attachListDisplay); - // console.log(this.attachItems); } }); return await modal.present(); - - // var modalPage = this.modalController.create('AddAttachPage', { indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID, enableBackdropDismiss: false });//enableBackdropDismiss: false ,enableBackdropDismiss: false - - // modalPage.onDidDismiss(data => { - // if (data == "cancel" || data == "undefined") { - - // return; - // } - - // else { - // if (!str) { - - // // this.attachItems = data.map(function(el) { - // // var o = Object.assign({}, el); - // // o.isSuccess = false; - // // return o; - // // }) - // // this.objIndex1 =this.attachmentRes.findIndex(item => item == attachItems); //to use it in remove attach - // //.ATTACHED_DOCUMENT_ID - // this.updateFile(data, attachDocID); - // } - - // else { - // this.attachListDisplay = data; - // this.attachItems = this.attachListDisplay.map(function (el) { - // var o = Object.assign({}, el); - // o.isSuccess = false; - // return o; - // }); - - // this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; - - - // } - - // // this.attachListDisplay=data; - - // // this.attachItems = this.attachListDisplay.map(function(el) { - // // var o = Object.assign({}, el); - // // o.isSuccess = false; - // // return o; - // // }) - // // console.log(this.attachListDisplay); - // // console.log(this.attachItems); - - - // }// end else - // }); - // modalPage.present(); - } removeFile(objectitem) { diff --git a/Mohem/src/app/eit/eit.module.ts b/Mohem/src/app/eit/eit.module.ts index 148cd9db..648bb042 100644 --- a/Mohem/src/app/eit/eit.module.ts +++ b/Mohem/src/app/eit/eit.module.ts @@ -11,6 +11,7 @@ import { EITPage } from './eit.page'; import { HomeComponent } from './home/home.component'; import { EitListComponent } from './eit-list/eit-list.component'; import { DatePicker } from '@ionic-native/date-picker/ngx'; +import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; const routes: Routes = [ @@ -58,6 +59,9 @@ const routes: Routes = [ ConfirmAddEitComponent, AddAttachComponent ], + entryComponents: [ + WorkListAttachViewComponent + ], providers: [ DatePicker ] 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 fce8959a..f2fcc147 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -970,6 +970,19 @@ export class CommonService { public openWorklistMainPage() { this.nav.navigateForward(["/notification/worklist-main"]); } + + public openWorklistReplacementRollPage() { + this.nav.navigateForward(["/notification/work-list-replacement-roll"]); + } +public openNotificationDetailsPage(){ + this.nav.navigateForward(["/notification/work-list-details"]); +} +public openWorklistHistoryPage(){ + this.nav.navigateForward(["/notification/work-list-action-history"]); +} +public openWorklistAttachPage(){ + this.nav.navigateForward(["/notification/work-list-attach"]); +} public reload(url: string, from: string) { console.log("force reload called from:" + from); // window.location.reload(); @@ -1125,6 +1138,7 @@ export class CommonService { } public formatDate(date) { let FormatedDate; + console.log(date); if (date) { FormatedDate = date.replace(/-/g, "/"); FormatedDate = FormatedDate + " 00:00:00"; @@ -1133,4 +1147,19 @@ export class CommonService { } return FormatedDate; } + + public formatDateNew(date) { + let FormatedDate; + console.log(date); + if (date) { + // FormatedDate = date.replace(/-/g, "/"); + FormatedDate = date.split("T")[0]; + FormatedDate = FormatedDate + " 00:00:00"; + console.log(FormatedDate); + } else { + FormatedDate = date; + } + return FormatedDate; + } + } diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index a5af9540..65f7109f 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -1,3 +1,6 @@ +import { WorkListAttachComponent } from './work-list-attach/work-list-attach.component'; +import { ViewNoteModalComponent } from './view-note-modal/view-note-modal.component'; +import { WorkListReplacementRollComponent } from './work-list-replacement-roll/work-list-replacement-roll.component'; import { HmgCommonModule } from './../hmg-common/hmg-common.module'; import { WorkListAttachViewComponent } from './work-list-attach-view/work-list-attach-view.component'; import { HomeComponent } from './home/home.component'; @@ -11,6 +14,13 @@ import { PipesModule } from '../pipes/pipes.module'; import { WorklistService } from './service/worklist.service'; import { WorklistMainComponent } from './worklist-main/worklist-main.component'; import { WorklistMainService } from './service/work-list.main.service'; +import { WorkListRfcComponent } from './work-list-rfc/work-list-rfc.component'; +import { ViewReplacementModalComponent } from './view-replacement-modal/view-replacement-modal.component'; +import { WorkListActionHistoryComponent } from './work-list-action-history/work-list-action-history.component'; +import { WorkListDetailsComponent } from './work-list-details/work-list-details.component'; +import { WorklistAttachService } from '../absence/service/work-list-attach.service'; +// import { WorklistMainComponent } from './worklist-main/worklist-main.component'; + const routes: Routes = [ { @@ -28,7 +38,40 @@ const routes: Routes = [ { path:'worklist-main', component:WorklistMainComponent + }, + { + path: 'work-list-replacement-roll', + component: WorkListReplacementRollComponent + }, + { + path: 'work-list-rfc', + component: WorkListRfcComponent + }, + { + path: 'view-note-modal', + component: ViewNoteModalComponent + }, + { + path: 'view-replacement-modal', + component: ViewReplacementModalComponent + }, + { + path: 'work-list-action-history', + component: WorkListActionHistoryComponent + }, + { + path: 'work-list-attach', + component: WorkListAttachComponent + }, + { + path: 'work-list-details', + component: WorkListDetailsComponent } + + // { + // path:'worklist-main', + // component:WorklistMainComponent + // } ] } ]; @@ -45,8 +88,16 @@ const routes: Routes = [ declarations: [ NotificationPage, HomeComponent, - WorklistMainComponent + WorklistMainComponent, + WorkListReplacementRollComponent, + WorkListRfcComponent, + ViewNoteModalComponent, + ViewReplacementModalComponent, + WorkListActionHistoryComponent, + WorkListAttachComponent, + WorkListDetailsComponent + // WorklistMainComponent ], - providers:[WorklistService,WorklistMainService] + providers:[WorklistService,WorklistMainService, WorklistAttachService] }) export class NotificationPageModule {} diff --git a/Mohem/src/app/notification/service/worklist.service.ts b/Mohem/src/app/notification/service/worklist.service.ts index 32335be1..6dce8f24 100644 --- a/Mohem/src/app/notification/service/worklist.service.ts +++ b/Mohem/src/app/notification/service/worklist.service.ts @@ -1,25 +1,49 @@ -import {Injectable} from '@angular/core'; -import {Http, Response, Headers} from "@angular/http"; +import { Injectable } from '@angular/core'; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; -import {Observable} from 'rxjs'; -import {WorkListRequest} from '../models/workListRequest'; -import {WorKListResponse} from '../models/workListResponse'; +import { Observable } from 'rxjs'; +import { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeReq'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes'; +import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; @Injectable() export class WorklistService { + public static getWorkList = 'Services/ERP.svc/REST/GET_WORKLIST'; - constructor( - public api: ConnectorService, - public authService: AuthenticationService, - - ) { } - - public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string): Observable { - const request = WorkListReq; - this.authService.authenticateRequest(request); - return this.api.post(WorklistService.getWorkList, request, onError, errorLabel); - } + public static getReplacmentEmployeeList = 'Services/ERP.svc/REST/GET_REPLACEMENT_LIST'; + public static getRFCEmployeeList = 'Services/ERP.svc/REST/GET_RFC_EMPLOYEE_LIST'; + public static getActionHistory = 'Services/ERP.svc/REST/GET_ACTION_HISTORY'; + + constructor( + public api: ConnectorService, + public authService: AuthenticationService, + + ) { } + + public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string): Observable { + const request = WorkListReq; + this.authService.authenticateRequest(request); + return this.api.post(WorklistService.getWorkList, request, onError, errorLabel); + } + + public getReplacmentEmployeeList(ReplacmentEmployeeRequest: any, onError?: any, errorLabel?: string): Observable { + const request = ReplacmentEmployeeRequest; + this.authService.authenticateRequest(request); + return this.api.post(WorklistService.getReplacmentEmployeeList, request, onError, errorLabel); + } + + public getRFCEmployeeList(ActionHistoryRequest: any, onError?: any, errorLabel?: string): Observable { + const request = ActionHistoryRequest; + this.authService.authenticateRequest(request); + return this.api.post(WorklistService.getRFCEmployeeList, request, onError, errorLabel); + } + + public getActionHistory(historyActionReq: any, onError?: any, errorLabel?: string): Observable { + const request = historyActionReq; + this.authService.authenticateRequest(request); + return this.api.post(WorklistService.getActionHistory, request, onError, errorLabel); + } } \ No newline at end of file diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html new file mode 100644 index 00000000..14b1091b --- /dev/null +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.html @@ -0,0 +1,17 @@ + + + {{'worklist, note' | translate}} + + + + + + + + + + +
+

{{getTextNote}}

+
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.spec.ts b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.spec.ts new file mode 100644 index 00000000..6a5e32fc --- /dev/null +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewNoteModalComponent } from './view-note-modal.component'; + +describe('ViewNoteModalComponent', () => { + let component: ViewNoteModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ViewNoteModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewNoteModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts new file mode 100644 index 00000000..357b7ec5 --- /dev/null +++ b/Mohem/src/app/notification/view-note-modal/view-note-modal.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; + +@Component({ + selector: 'app-view-note-modal', + templateUrl: './view-note-modal.component.html', + styleUrls: ['./view-note-modal.component.scss'], +}) +export class ViewNoteModalComponent implements OnInit { + + getTextNote: any; + + constructor(private modalCtrl: ModalController, private cs: CommonService) { } + + ngOnInit() { + this.getTextNote = this.cs.sharedService.getSharedData('ViewNoteModalPage'); + } + + closeModal() { + this.modalCtrl.dismiss(); + } + +} diff --git a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.html b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.html new file mode 100644 index 00000000..72e7916b --- /dev/null +++ b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.html @@ -0,0 +1,46 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + {{RepList.USER_NAME}} + {{RepList.EMPLOYEE_DISPLAY_NAME}} + {{RepList.EMAIL_ADDRESS}} + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss new file mode 100644 index 00000000..b4736409 --- /dev/null +++ b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss @@ -0,0 +1,11 @@ +ion-content { + margin-top: 40px !important; + width: 95% !important; + height: 80% !important; + top: 5% !important; + left: 2% !important; + right: 5% !important; + bottom: 5% !important; + padding-top: 30px !important; + border: solid 1px #dedede; +} diff --git a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.spec.ts b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.spec.ts new file mode 100644 index 00000000..d6960f17 --- /dev/null +++ b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewReplacementModalComponent } from './view-replacement-modal.component'; + +describe('ViewReplacementModalComponent', () => { + let component: ViewReplacementModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ViewReplacementModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewReplacementModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.ts b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.ts new file mode 100644 index 00000000..8d1d54e5 --- /dev/null +++ b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.ts @@ -0,0 +1,76 @@ +import { WorklistService } from './../service/worklist.service'; +import { Component, OnInit } from '@angular/core'; +import { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeReq'; +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'; + +@Component({ + selector: 'app-view-replacement-modal', + templateUrl: './view-replacement-modal.component.html', + styleUrls: ['./view-replacement-modal.component.scss'], +}) +export class ViewReplacementModalComponent implements OnInit { + + radioButtonValue: any; + getRepList: any;//WorKListReplacmentEmployeeResponse=new WorKListReplacmentEmployeeResponse(); + IsReachEnd: boolean = false; + private getReplacmentEmployeeReq: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); + + + constructor(private cs: CommonService, private ts: TranslatorService, public modalCtrl: ModalController, public worklistService: WorklistService) { + this.getReplacmentEmployeeReq = this.cs.sharedService.getSharedData('replacmentReqObj'); + this.getRepList = this.cs.sharedService.getSharedData('replacmentResObj'); + } + + ngOnInit() { } + + radioSelect(v) { + this.radioButtonValue = v; + } + + OkBtnModal() { + if (!this.radioButtonValue) { + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.presentAlert(msg); + return; + } else { + let data = this.radioButtonValue; + this.modalCtrl.dismiss(data); + } + } + + closeBtnModal() { + this.modalCtrl.dismiss("cancel"); + } + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + this.getReplacmentEmployeeReq.P_PAGE_NUM++; + this.worklistService.getReplacmentEmployeeList(this.getReplacmentEmployeeReq). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.ReplacementList != undefined) { + (result.ReplacementList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.getRepList.push(element); + }); + }// 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/work-list-action-history/work-list-action-history.component.html b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.html new file mode 100644 index 00000000..daec1cf6 --- /dev/null +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.html @@ -0,0 +1,65 @@ + + + + {{'workListMain, actionHis' | translate}} + + + + + + + +
{{'worklistMain, actionHis' | translate}}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.scss b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.scss new file mode 100644 index 00000000..5f7ccfcc --- /dev/null +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.scss @@ -0,0 +1,55 @@ +ion-card-content.card-content.card-content-md, +ion-card-content.card-content.card-content-ios { + padding: 0px; + margin: 0px; +} +.col { + //border: #dedede solid 1px; + padding: 2px !important; + text-align: center; + font-size: 15px; +} +.item-md.item-block .item-inner, +.item-ios.item-block .item-inner { + padding: 0px !important; +} +.itemAH { + padding: 0px !important + ; + font-size: 13px; +} +.gridAH { + text-align: center; + padding: 5px 5px !important; + border-radius: 5px; +} +.rowAH { + white-space: normal; + .col { + border: 1px solid #d9d9d9; + } +} +.Header { + font-weight: bold; + // font-family: "WorkSans-SemiBold" !important; + color: #1a586d; + // padding: 0px !important; + // margin: 0px !important; +} +.titleH { + //background-color:$custgreen; + //height: 40px; + //line-height: 2; + font-size: 15px; + border: 1px solid #d9d9d9; + border-top-right-radius: 5px; + border-top-left-radius: 5px; + border-bottom: 0px; + .col { + border: 0px; + } +} +ion-label.label.label-md, +ion-label.label.label-ios { + margin: 0px; +} diff --git a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.spec.ts b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.spec.ts new file mode 100644 index 00000000..c214648a --- /dev/null +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListActionHistoryComponent } from './work-list-action-history.component'; + +describe('WorkListActionHistoryComponent', () => { + let component: WorkListActionHistoryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListActionHistoryComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListActionHistoryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts new file mode 100644 index 00000000..286f70c9 --- /dev/null +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts @@ -0,0 +1,107 @@ +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 { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; + +@Component({ + selector: 'app-work-list-action-history', + templateUrl: './work-list-action-history.component.html', + styleUrls: ['./work-list-action-history.component.scss'], +}) +export class WorkListActionHistoryComponent implements OnInit { + + private WorkListActionHistoryObj: WorkListActionHistoryRequest; + getPassNotificationDetails: any; + actionHistoryRes: any; + IsReachEnd: boolean = false; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + + constructor(private cs: CommonService, private ts: TranslatorService, private modalCtrl: ModalController, public worklistService: WorklistService) { + this.getPassNotificationDetails = this.cs.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.getActionHistory(this.WorkListActionHistoryObj); + } + + getActionHistory(WorkListActionHistoryObj) { + this.IsReachEnd = false; + this.worklistService.getActionHistory(WorkListActionHistoryObj). + subscribe((result: WorkListActionHistoryResponse) => { + this.handleWorkListActionHistoryResult(result); + }); + + + } + handleWorkListActionHistoryResult(result) { + if (this.cs.validResponse(result)) { + if (this.cs.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) { + // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); + // modalPage.present(); + + this.cs.sharedService.setSharedData(note, 'ViewNoteModalPage') + + const modal = await this.modalCtrl.create({ + component: ViewNoteModalComponent + }); + + 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.cs.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 + +} diff --git a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html index 59bda499..635bbcb9 100644 --- a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html +++ b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html @@ -1,6 +1,5 @@ - {{'workListMain, suppDoc' | translate}} diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.html b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.html new file mode 100644 index 00000000..ae0df3bb --- /dev/null +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.html @@ -0,0 +1,45 @@ + + + + {{'worklist, note' | translate}} + + + + + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + + +
{{'worklistMain, suppDoc' | translate}}
+
+ + +
+ + +
+
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + +
+ + + +
+
+ +
+
+
+ +
+ +
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.scss b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.scss new file mode 100644 index 00000000..a01032d9 --- /dev/null +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.scss @@ -0,0 +1,7 @@ +ion-card-content.card-content.card-content-md, +ion-card-content.card-content.card-content-ios { + padding: 0px; +} +img.attachImg { + margin: 5px 8px 13px 0; +} diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.spec.ts b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.spec.ts new file mode 100644 index 00000000..c4804d78 --- /dev/null +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListAttachComponent } from './work-list-attach.component'; + +describe('WorkListAttachComponent', () => { + let component: WorkListAttachComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListAttachComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListAttachComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts new file mode 100644 index 00000000..c73997b3 --- /dev/null +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts @@ -0,0 +1,59 @@ +import { WorklistAttachService } from './../../absence/service/work-list-attach.service'; +import { ModalController } from '@ionic/angular'; +import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { WorkListButtonRequest } from 'src/app/eit/models/NotificationButtonReq'; +import { Component, OnInit } from '@angular/core'; +import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; + +@Component({ + selector: 'app-work-list-attach', + templateUrl: './work-list-attach.component.html', + styleUrls: ['./work-list-attach.component.scss'], +}) +export class WorkListAttachComponent implements OnInit { + + private WorkListAttachObj: WorkListButtonRequest; + getPassNotificationDetails: any; + attachmentRes: any; + + constructor(public cs: CommonService, public modalCtrl: ModalController, public worklistAttachService: WorklistAttachService) { + this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); + this.WorkListAttachObj = new WorkListButtonRequest(); + this.WorkListAttachObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + } + + ngOnInit() { + this.getAttachmentNotification(this.WorkListAttachObj); + } + + async OpenAttachFiles(value, Type) { + // let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type }); + // modal.present(); + + this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') + const modal = await this.modalCtrl.create({ + component: WorkListAttachViewComponent + }); + + return await modal.present(); + } + + getAttachmentNotification(WorkListAttachObj) { + + this.worklistAttachService.getAttach(WorkListAttachObj). + subscribe((result: NotificationGetAttachResponse) => { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.cs.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + } + +} diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.html b/Mohem/src/app/notification/work-list-details/work-list-details.component.html new file mode 100644 index 00000000..eefc7a43 --- /dev/null +++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.html @@ -0,0 +1,136 @@ + + + + {{'workListMain, notfDetails' | translate}} + + + + + +
+ + + + +
{{'general, info' | translate}}
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + +
{{'worklistMain, notfDetails' | translate}}
+
+ + +
+ + + + + + + + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.scss b/Mohem/src/app/notification/work-list-details/work-list-details.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.spec.ts b/Mohem/src/app/notification/work-list-details/work-list-details.component.spec.ts new file mode 100644 index 00000000..a561ba66 --- /dev/null +++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListDetailsComponent } from './work-list-details.component'; + +describe('WorkListDetailsComponent', () => { + let component: WorkListDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListDetailsComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.ts b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts new file mode 100644 index 00000000..460148c8 --- /dev/null +++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts @@ -0,0 +1,69 @@ +import { WorklistsubmitterInfoResponse } from './../models/WorklistsubmitterInfoRes'; +import { WorklistMainService } from './../service/work-list.main.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { WorkListSubmitterInfoRequest } from './../models/WorklistsubmitterInfoReq'; +import { Component, OnInit } from '@angular/core'; +import { EITNotificatonBodyResponse } from 'src/app/eit/models/EITNotificationBodyRes'; +import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes'; + +@Component({ + selector: 'app-work-list-details', + templateUrl: './work-list-details.component.html', + styleUrls: ['./work-list-details.component.scss'], +}) +export class WorkListDetailsComponent implements OnInit { + submitterInfoRes: any; + notificationBodyRes: any; + notBodyType: string = ""; + notBodyResult: any; + getPassNotificationDetails: any; + private WorkListSubmitterInfoObj: WorkListSubmitterInfoRequest; + + constructor(public cs: CommonService, public worklistMainService: WorklistMainService) { + this.WorkListSubmitterInfoObj = new WorkListSubmitterInfoRequest(); + this.notBodyType = this.cs.sharedService.getSharedData('NotBodyType', false); + if (this.notBodyType == "EIT") { + this.notBodyResult = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, false); + this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); + } else if (this.notBodyType == "ABSENCE") { + this.notBodyResult = this.cs.sharedService.getSharedData(AbsenceNotificatonBodyResponse.SHARED_DATA, false); + this.getPassNotificationDetails = this.cs.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, false); + } + } + + ngOnInit() { + this.WorkListSubmitterInfoObj.P_PAGE_LIMIT = 100; + this.WorkListSubmitterInfoObj.P_PAGE_NUM = 1; + this.WorkListSubmitterInfoObj.P_SELECTED_EMPLOYEE_NUMBER = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; + this.WorkListSubmitterInfoObj.P_SELECTED_RESP_ID = -999; + this.WorkListSubmitterInfoObj.P_SEARCH_EMAIL_ADDRESS = ""; + this.WorkListSubmitterInfoObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListSubmitterInfoObj.P_SEARCH_USER_NAME = ""; + + this.getsubmitterInfo(this.WorkListSubmitterInfoObj); + this.handleNotificationBody(); + } + + getsubmitterInfo(notificationSubmitterInfoObj) { + this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj). + subscribe((result: WorklistsubmitterInfoResponse) => { + this.handleSubmitterInfoResult(result); + }); + } + handleSubmitterInfoResult(result) { + if (this.cs.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (this.cs.hasData(result.MemberInformationList)) { + //if (result.MemberInformationList != null) { + this.submitterInfoRes = result.MemberInformationList; + } // if result == null + } // valid it + }// End handleWorkListButtonsResult + handleNotificationBody() { + this.notificationBodyRes = {}; + if (this.cs.hasData(this.notBodyResult)) { + this.notificationBodyRes = this.notBodyResult; + } + } + +} diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html new file mode 100644 index 00000000..374df0e2 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -0,0 +1,71 @@ + + + + {{ 'replacementRoll, title' | translate}} + + + + + + + + {{'replacementRoll, searchBy' | translate}} + + {{'addAttach, name' | translate}} + {{'login, username' | translate}} + {{'general, email' | translate}} + + + + + + + + + + + +
+ {{"replacementRoll, question" | translate}} : + {{pQuestion}} ? + {{"replacementRoll, answer" | translate}} + + {{"replacementRoll, enterNote" | translate}} + + + + +
+ + + + + + {{employee.EMPLOYEE_DISPLAY_NAME}}
{{employee.USER_NAME}}
+ {{employee.EMAIL_ADDRESS}}
+ +
+
+ + + + +
+ +
+ + +
+ + {{'general, submit' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss new file mode 100644 index 00000000..d07c1ea2 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss @@ -0,0 +1,10 @@ +button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; +} + +.footer-button { + border-radius: 3px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; +} diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.spec.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.spec.ts new file mode 100644 index 00000000..d91108d5 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListReplacementRollComponent } from './work-list-replacement-roll.component'; + +describe('WorkListReplacementRollComponent', () => { + let component: WorkListReplacementRollComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListReplacementRollComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListReplacementRollComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts new file mode 100644 index 00000000..b9964870 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -0,0 +1,293 @@ +import { ModalController } from '@ionic/angular'; +import { WorklistService } from './../service/worklist.service'; +import { Component, OnInit } from '@angular/core'; +import { WorKListReplacmentEmployeeResponse } from '../models/ReplacmentEmployeeRes'; +import { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeReq'; +import { WorkListActionRequest } from '../models/NotificationActionReq'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { WorklistMainService } from '../service/work-list.main.service'; +import { ViewReplacementModalComponent } from '../view-replacement-modal/view-replacement-modal.component'; + +@Component({ + selector: 'app-work-list-replacement-roll', + templateUrl: './work-list-replacement-roll.component.html', + styleUrls: ['./work-list-replacement-roll.component.scss'], +}) +export class WorkListReplacementRollComponent implements OnInit { + P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = ""; + P_SEARCH_EMAIL_ADDRESS: string = ""; + getPassActionMode: any; + selectedValue: any; + inputSearch: any; + selEmpName: any; + selectedUserInf: any; + userNote: any; + getPassNotificationDetails: any; + isAnswer: boolean = false; + pQuestion: string = ""; + selEmp: any; + P_PAGE_NUM: number; + P_PAGE_LIMIT: number; + ReplacementList: any = []; + searchBy: string = ""; + IsReachEnd: boolean = false; + ReplacmentListRes: WorKListReplacmentEmployeeResponse; + private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); + private WorkListActionObj: WorkListActionRequest; + getpassResAttr: any = []; + + constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { + this.P_PAGE_NUM = 1; + this.P_PAGE_LIMIT = 50; + this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode'); + this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); + this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); + this.pQuestion = this.cs.sharedService.getSharedData('pQuestion'); + if (this.getPassActionMode == "ANSWER_INFO") { + this.isAnswer = true; + } + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + + this.WorkListActionObj = new WorkListActionRequest(); + 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.RespondAttributeList = this.getpassResAttr; + this.WorkListActionObj.P_APPROVER_INDEX = null; + } + + ngOnInit() { } + + getreplacmentemployee() { + this.ReplacementList = []; + this.IsReachEnd = false; + this.P_PAGE_NUM = 1; + if (this.inputSearch) { + switch (this.searchBy) { + case '1': { + + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + + break; + } + case '2': { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + case '3': { + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + break; + } + default: { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + } + } else { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + } + // if(this.selectedValue =="1"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.inputSearch; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=""; + // } + // else if(this.selectedValue =="2"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.inputSearch; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=""; + // } + // else if(this.selectedValue =="3"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=this.inputSearch; + // } + + this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj). + subscribe((result: WorKListReplacmentEmployeeResponse) => { + this.handleWorkListReplacmentEmployeeResult(result); + }); + + }//End replacment Employee + + handleWorkListReplacmentEmployeeResult(result) { + + if (this.cs.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (this.cs.hasData(result.ReplacementList)) { + //this.ReplacmentListRes =result.ReplacementList; + this.ReplacementList = result.ReplacementList; + this.P_PAGE_NUM++; + let lastItemIndex = this.ReplacementList.length - 1; + if (result.ReplacementList[lastItemIndex]) { + let lastitem = result.ReplacementList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } else { + let msg: string = this.ts.trPK('general', 'noResult'); + this.cs.presentAlert(msg); + } + // if(result.ReplacementList.length == 0){ + + // } + + // else if(result.ReplacementList != null) + // { + // this.ReplacmentListRes =result.ReplacementList; + // //open modal + // this.openModale(this.ReplacmentListRes); + + + // } // if result == null + + } // valid it + } + + getValueSelected(Value) { + + this.selectedValue = Value; + } + clear() { + this.selEmpName = ""; + this.selectedUserInf = null; + + } + async openModale(ReplacmentListRes) { + const modal = await this.modalCtrl.create({ + component: ViewReplacementModalComponent + }); + + modal.onDidDismiss() + .then((data) => { + if (data == "cancel" || data == "undefined") { + //this.selEmpName=""; + return; + } else { + this.selectedUserInf = data; + this.selEmpName = this.selectedUserInf.EMPLOYEE_DISPLAY_NAME; + } + }); + + return await modal.present(); + } + + submitAction() { + if (this.selEmp && this.isAnswer == false) { + this.selectedUserInf = this.ReplacementList[this.selEmp]; + + if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { + if (this.userNote) { + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; + this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + + this.workListMainService.actionButton(this.WorkListActionObj). + subscribe((result: any) => { + this.handleApplayActionResult(result); + }); + } else { + let msg: string = this.ts.trPK("replacementRoll", "enterNote"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + + } + } else { + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + } + } else if (this.isAnswer == true) { + if (this.userNote) { + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null; + this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + + this.workListMainService.actionButton(this.WorkListActionObj). + subscribe((result: any) => { + this.handleApplayActionResult(result); + }); + } else { + let msg: string = this.ts.trPK("replacementRoll", "enterNote"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + } + } else { + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + } + } + + handleApplayActionResult(result) { + if (this.cs.validResponse(result)) { + // let msg=this.translate.translate("general.success"); + // this.cs.showAlert(msg); + // this.navCtrl.push("HomePage"); + this.cs.openNotificationPage(); + } // valid it + } + + // cancel() { + // this.navCtrl.pop(); + // } + + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + //const request =new WorkListActionRequest(); + // request.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.P_SEARCH_USER_NAME; + // request.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; + // request.P_SEARCH_EMAIL_ADDRESS=this.P_SEARCH_EMAIL_ADDRESS; + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + // request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp; + + this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.ReplacementList)) { + this.P_PAGE_NUM++; + result.ReplacementList.forEach(vr => { + if (vr.ROW_NUM == vr.NO_OF_ROWS) { + this.IsReachEnd = true; + } + else { + this.IsReachEnd = false; + } + this.ReplacementList.push(vr); + // this.pro.GetVacationRulesList.push(vr); + }); + } else { + this.IsReachEnd = true; + } + } + //this.P_PAGE_NUM++; + if (infiniteScroll) + infiniteScroll.target.complete(); + + + // console.log(resFlag); + }, (Error) => console.log(Error), () => infiniteScroll.target.complete()); + } else { + if (infiniteScroll) + infiniteScroll.target.complete(); + } + } + +} diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html new file mode 100644 index 00000000..f29ecac0 --- /dev/null +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html @@ -0,0 +1,39 @@ + + + + {{ 'workListMain, rfc' | translate}} + + + + + +
+ {{"replacementRoll.msgRFC" | translate}} +
+ + + {{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}} + {{rfcEmployeeList.ACTION}} + + + + + + + + +
+ + + + +
+ +
+ + +
+ + {{'general, submit' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss new file mode 100644 index 00000000..129d608e --- /dev/null +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss @@ -0,0 +1,7 @@ +.footer-button { + border-radius: 3px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.spec.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.spec.ts new file mode 100644 index 00000000..04cb6bbb --- /dev/null +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListRfcComponent } from './work-list-rfc.component'; + +describe('WorkListRfcComponent', () => { + let component: WorkListRfcComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListRfcComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListRfcComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts new file mode 100644 index 00000000..a61b7aed --- /dev/null +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts @@ -0,0 +1,156 @@ +import { WorklistMainService } from './../service/work-list.main.service'; +import { Component, OnInit } from '@angular/core'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { WorkListActionRequest } from '../models/NotificationActionReq'; +import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes'; +import { WorklistService } from '../service/worklist.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-work-list-rfc', + templateUrl: './work-list-rfc.component.html', + styleUrls: ['./work-list-rfc.component.scss'], +}) +export class WorkListRfcComponent implements OnInit { + + private WorkListActionHistoryObj: WorkListActionHistoryRequest; + private WorkListActionObj: WorkListActionRequest; + + getPassNotificationDetails: any; + RFCEmployeeListListRes: any; + radioButtonValue: any; + pageNum: number = 1; + seqNo: any; + //forwordTo:any; + IsReachEnd: boolean = false; + comments: any; + userNote: any; + getpassResAttr: any = []; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + + constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService) { + this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); + this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); + + 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; + + this.WorkListActionObj = new WorkListActionRequest(); + 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.WorkListActionObj.RespondAttributeList = this.getpassResAttr; + } + + ngOnInit() { + this.getRFCEmployee(this.WorkListActionHistoryObj); + } + + getRFCEmployee(WorkListActionHistoryObj) { + this.IsReachEnd = false; + this.worklistService.getRFCEmployeeList(WorkListActionHistoryObj). + subscribe((result: WorKListRFCEmployeeResponse) => { + this.handleWorkListRFCEmployeeResult(result); + }); + } + + handleWorkListRFCEmployeeResult(result) { + + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetRFCEmployeeListList)) { + this.RFCEmployeeListListRes = result.GetRFCEmployeeListList; + this.P_PAGE_NUM++; + let lastItemIndex = this.RFCEmployeeListListRes.length - 1; + if (result.GetRFCEmployeeListList[lastItemIndex]) { + let lastitem = result.GetRFCEmployeeListList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + radioChecked(v) { + let emp: any = this.RFCEmployeeListListRes[v]; + this.seqNo = emp.SEQ; + this.radioButtonValue = emp.USER_NAME; + + } + + submitAction() { + if (this.radioButtonValue) { + if (this.userNote) { + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.radioButtonValue; + this.WorkListActionObj.P_ACTION_MODE = "RFC"; + this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + this.WorkListActionObj.P_APPROVER_INDEX = this.seqNo; + this.workListMainService.actionButton(this.WorkListActionObj). + subscribe((result: any) => { + this.handleApplayActionResult(result); + }); + } else { + let msg: string = this.ts.trPK("replacementRoll", "enterNote"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + + } + } else { + let msg: string = this.ts.trPK("replacementRoll", "msgRFC"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + + } + } + + handleApplayActionResult(result) { + if (this.cs.validResponse(result)) { + if (result.MessageStatus == 1) { + // let msg:string=""; + // msg=this.translate.translate("general.success"); + // this.common.showAlert(msg); + // this.navCtrl.push("HomePage"); + this.cs.openHome(); + } + } // valid it + } + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.worklistService.getRFCEmployeeList(this.WorkListActionHistoryObj). + subscribe((result) => { + if (this.cs.validResponse(result)) { + if (result.RFCEmployeeList != undefined) { + this.P_PAGE_NUM++ + (result.RFCEmployeeList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } + else { + this.IsReachEnd = false; + } + //this.WorkListResObj.push(element); + }); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + infiniteScroll.target.complete(); + }); + } else { + if (infiniteScroll) + infiniteScroll.target.complete(); + } + }//end infiniteScroll + +} diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index 9c840da1..72c5f4d0 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -11,7 +11,7 @@ import { WorkListButtonRequest } from "../models/NotificationButtonReq"; 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 { HomeComponent } from "src/app/notification/home/home.component"; @Component({ selector: "app-worklist-main", templateUrl: "./worklist-main.component.html", @@ -21,6 +21,7 @@ export class WorklistMainComponent implements OnInit { private WorkListBodyObj: WorkListBodyRequest; private WorkListButtonsObj: WorkListButtonRequest; private WorkListActionObj: WorkListActionRequest; + public static PASS_NOTIFICATION_INFO="passNotificationInfo"; getPassNotificationDetails: any; TransactionID: number = -999; notificationBodyRes: any; @@ -47,7 +48,10 @@ export class WorklistMainComponent implements OnInit { ) {} ngOnInit() { - this.getPassNotificationDetails = this.common.sharedService.getSharedData(HomeComponent.NOTIFICATION_DATA, false); + this.getPassNotificationDetails = this.common.sharedService.getSharedData( + HomeComponent.NOTIFICATION_DATA, + false + ); this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListButtonsObj = new WorkListButtonRequest(); @@ -74,19 +78,19 @@ export class WorklistMainComponent implements OnInit { } getEITNotificationDetails(notificationBodyObj) { - this.worklistMainService.getEITNotificationBody( - notificationBodyObj - ).subscribe((result: EITNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "EIT"); - }); + this.worklistMainService + .getEITNotificationBody(notificationBodyObj) + .subscribe((result: EITNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "EIT"); + }); } getAbsenceNotificationDetails(notificationBodyObj) { - this.worklistMainService.getAbsencesNotificationBody( - notificationBodyObj - ).subscribe((result: AbsenceNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "ABSENCE"); - }); + this.worklistMainService + .getAbsencesNotificationBody(notificationBodyObj) + .subscribe((result: AbsenceNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "ABSENCE"); + }); } handleWorkListBodyResult(result, Type) { @@ -109,11 +113,11 @@ export class WorklistMainComponent implements OnInit { } //End handleWorkListBodyResult getNotificationButtons(notificationButtonsObj) { - this.worklistMainService.getNotificationButtons( - notificationButtonsObj - ).subscribe((result: NotificatonButtonResponse) => { - this.handleWorkListButtonsResult(result); - }); + this.worklistMainService + .getNotificationButtons(notificationButtonsObj) + .subscribe((result: NotificatonButtonResponse) => { + this.handleWorkListButtonsResult(result); + }); } handleWorkListButtonsResult(result) { @@ -125,20 +129,18 @@ export class WorklistMainComponent implements OnInit { } // valid it } // End handleWorkListButtonsResult - applyAction(WorkListActionObj) { - this.worklistMainService.actionButton(WorkListActionObj).subscribe( - (result: any) => { + 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.navCtrl.push("HomePage"); } } // valid it } @@ -173,7 +175,6 @@ export class WorklistMainComponent implements OnInit { ButtonAction == "DEL" || ButtonAction == "CLOSE" ) { - this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_COMMENTS = ""; @@ -213,8 +214,6 @@ export class WorklistMainComponent implements OnInit { ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" ) { - - if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { this.common.sharedService.setSharedData( this.notificationBodyRes, @@ -225,8 +224,8 @@ export class WorklistMainComponent implements OnInit { EITNotificatonBodyResponse.NOT_WORKLIST ); // this.navCtrl.push("EitUpdateListPage"); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { - this.common.sharedService.setSharedData( + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { + this.common.sharedService.setSharedData( this.notificationBodyRes, AbsenceNotificatonBodyResponse.SHARED_DATA ); @@ -238,9 +237,8 @@ export class WorklistMainComponent implements OnInit { // dirfromNotificationPage: true, // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification // }); - } - } + } // else if (this.notificationButtonRes.length > 0 && !ButtonAction) { // (this.elementRef.nativeElement.querySelectorAll( // "ion-item" @@ -256,27 +254,30 @@ export class WorklistMainComponent implements OnInit { // } else { // this.navCtrl.pop(); // } - } openActionHistory() { // this.navCtrl.push("WorkListActionHistoryPage", { // passNotificationInfo: this.getPassNotificationDetails // }); + this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO); + this.common.openWorklistHistoryPage(); } openSupportDocuments() { // this.navCtrl.push("WorkListAttachPage", { // passNotificationInfo: this.getPassNotificationDetails // }); + this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO); + this.common.openWorklistAttachPage(); } getNotificationResAttr(notificationButtonsObj) { - this.worklistMainService.notificationResponseAttr( - notificationButtonsObj - ).subscribe((result: NotificatonButtonResponse) => { - this.handleNotificationResAttrResult(result); - }); + this.worklistMainService + .notificationResponseAttr(notificationButtonsObj) + .subscribe((result: NotificatonButtonResponse) => { + this.handleNotificationResAttrResult(result); + }); } handleNotificationResAttrResult(result) { @@ -307,7 +308,9 @@ export class WorklistMainComponent implements OnInit { this.getPassNotificationDetails, EITNotificatonBodyResponse.NOT_WORKLIST ); - // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); + // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); + this.common.sharedService.setSharedData("EIT","NotBodyType"); + this.common.openNotificationDetailsPage(); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.common.sharedService.setSharedData( this.notificationBodyRes, @@ -317,7 +320,9 @@ export class WorklistMainComponent implements OnInit { this.getPassNotificationDetails, AbsenceNotificatonBodyResponse.NOT_WORKLIST ); + this.common.sharedService.setSharedData("ABSENCE","NotBodyType"); //this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" }); + this.common.openNotificationDetailsPage(); } } } diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index a7f6ca2c..571f4b89 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -761,10 +761,6 @@ "en":"", "ar":"" }, - "noData":{ - "en":"There are no requests", - "ar":"لاتوجد طلبات" - }, "confirmation":{ "en":"Confirmation", "ar":"تأكيد" @@ -850,7 +846,7 @@ "ar": "البريد الإلكتروني للمنشأة" }, "name": { - "en": "Emplyee Name", + "en": "Employee Name", "ar": "اسم الموظف " }, "orgName": { @@ -1371,6 +1367,36 @@ "suppDoc": { "en": "Support Documents", "ar": "مستندات الدعم" + }, + "rfc": { + "en": "Return for correction", + "ar": "عودة لتصحيح" + }, + "actionHis":{ + "en":"Action History", + "ar":"تاريخ العمل" + }, + "notfDetails":{ + "en":"Notification Details", + "ar":"تفاصيل الإخطار" + } + }, + "actionHis": { + "name":{ + "en":"Name", + "ar":"الإسم" + }, + "action":{ + "en":"Action", + "ar":"عمل" + }, + "date":{ + "en":"Date", + "ar":"تاريخ" + }, + "note":{ + "en":"Note", + "ar":"ملحوظة" } }, "addAttach":{ @@ -1420,6 +1446,40 @@ "ar":"لايمكن عرض هذا النوع من الملفات" } }, + "replacementRoll": { + "enterNote":{ + "en": "Enter a note", + "ar":"أدخل ملاحظة" + }, + "msg":{ + "en": "Select a replacement", + "ar":"اختيار بديل" + }, + "title":{ + "en": "Replacement Roll", + "ar":"استبدال لفة" + }, + "searchForReplacment":{ + "en": "Search for an employee", + "ar":"ابحث عن موظف" + }, + "searchBy":{ + "en": "Search by", + "ar":"البحث عن طريق" + }, + "question":{ + "en": "Question", + "ar":"سؤال" + }, + "answer":{ + "en": "Answer", + "ar":"جواب" + }, + "msgRFC":{ + "en": "Select a person", + "ar":"اختيار شخص" + } + }, "worklist": { "view":{ "en": "View", @@ -1476,6 +1536,10 @@ "search": { "en":"Search", "ar":"بحث" + }, + "note": { + "en":"Note", + "ar":"مذكرة" } }, "worklistMain": {