@ -15,10 +15,29 @@ import { HomeComponent } from "src/app/notification/home/home.component";
import { TextInput } from 'src/app/uI-elements/text.input' ;
import { TextInput } from 'src/app/uI-elements/text.input' ;
import { TextAreaInput } from 'src/app/uI-elements/text-area.input' ;
import { TextAreaInput } from 'src/app/uI-elements/text-area.input' ;
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service' ;
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service' ;
import { Events } from '@ionic/angular' ;
import { Events , ModalController } from '@ionic/angular' ;
import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes' ;
import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes' ;
import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes' ;
import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes' ;
import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes' ;
import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes' ;
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes' ;
import { WorklistAttachService } from 'src/app/absence/service/work-list-attach.service' ;
import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq' ;
import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes' ;
import { WorklistService } from '../service/worklist.service' ;
import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component' ;
import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component' ;
import { GetSubordinatesLeavesRequest } from '../../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest' ;
import { DashboredService } from '../../hmg-common/services/dashbored/dashbored.service'
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service' ;
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user' ;
import { WorklistsubmitterInfoResponse } from '../models/WorklistsubmitterInfoRes' ;
import { WorkListSubmitterInfoRequest } from '../models/WorklistsubmitterInfoReq' ;
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component' ;
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component' ;
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component' ;
@Component ( {
@Component ( {
selector : "app-worklist-main" ,
selector : "app-worklist-main" ,
templateUrl : "./worklist-main.component.html" ,
templateUrl : "./worklist-main.component.html" ,
@ -51,29 +70,85 @@ export class WorklistMainComponent implements OnInit {
selEmployeeID : any ;
selEmployeeID : any ;
actionType : string = "" ;
actionType : string = "" ;
notificationArray : any ;
notificationArray : any ;
notificationDynamicAttributeArr :any ;
notificationDynamicAttributeArr : any ;
private textInput : TextInput ;
private textInput : TextInput ;
private textArea : TextAreaInput ;
private textArea : TextAreaInput ;
private WorkListAttachObj : WorkListButtonRequest ;
P_PAGE_NUM : number = 1 ;
P_PAGE_LIMIT : number = 100 ;
notificationCount : any ;
notificationCount : any ;
activeSegment : any = "info" ;
lines_note_limit : any = 15 ;
attachmentRes : any ;
private WorkListActionHistoryObj : WorkListActionHistoryRequest ;
IsReachEnd : boolean = false ;
notiActionBtnMore : any = [ ] ;
messageSuccess : boolean = false ;
confirmMsg : string ;
newArr : any = [ ] ;
selEmp : any ;
subordinatesleaveList : any ;
private WorkListSubmitterInfoObj : WorkListSubmitterInfoRequest ;
submitterInfoRes : any ;
approveDis : boolean = false ;
rejectDis : boolean = false ;
requestDis : boolean = false ;
moreDisabled : boolean = true ;
constructor (
constructor (
public worklistService : WorklistService ,
public common : CommonService ,
public common : CommonService ,
public ts : TranslatorService ,
public ts : TranslatorService ,
public worklistMainService : WorklistMainService ,
public worklistMainService : WorklistMainService ,
public elementRef : ElementRef ,
public elementRef : ElementRef ,
public menuService : MenuService ,
public menuService : MenuService ,
public events : Events ,
public events : Events ,
) { }
public worklistAttachService : WorklistAttachService ,
private modalCtrl : ModalController ,
public dashboredService : DashboredService ,
public authService : AuthenticationService
) {
this . WorkListActionHistoryObj = new WorkListActionHistoryRequest ( ) ;
this . WorkListActionHistoryObj . P_PAGE_NUM = this . P_PAGE_NUM ;
this . WorkListActionHistoryObj . P_PAGE_LIMIT = this . P_PAGE_LIMIT ;
}
ngOnInit() {
ngOnInit() {
this . selEmp = this . common . sharedService . getSharedData (
MenuResponse . SHARED_SEL_EMP ,
false
) ;
if ( this . selEmp ) { } else {
this . authService . loadAuthenticatedUser ( ) . subscribe ( ( user : AuthenticatedUser ) = > {
if ( user ) {
this . selEmp = user . ASSIGNMENT_NUMBER ;
}
} ) ;
}
console . log ( " this.selEmp" + this . selEmp ) ;
this . intializeNotificationDetail ( ) ;
this . intializeNotificationDetail ( ) ;
}
public segmentChanged ( event : any ) {
this . activeSegment = event . detail . value ;
console . log ( " event.detail.value: " + event . detail . value ) ;
}
}
intializeNotificationDetail() {
intializeNotificationDetail() {
document . getElementById ( "notificationDynamicFields" ) . innerHTML = "" ;
if ( this . messageSuccess ) {
document . getElementById ( "notificationDynamicFields" ) . innerHTML = "" ;
}
this . getPassNotificationDetails = this . common . sharedService . getSharedData (
this . getPassNotificationDetails = this . common . sharedService . getSharedData (
HomeComponent . NOTIFICATION_DATA ,
HomeComponent . NOTIFICATION_DATA ,
false
false
) ;
) ;
console . log ( this . getPassNotificationDetails . ROW_NUM ) ;
console . log ( this . getPassNotificationDetails . ROW_NUM ) ;
this . notificationArray = this . common . sharedService . getSharedData (
this . notificationArray = this . common . sharedService . getSharedData (
HomeComponent . NOTIFICATION_ARR ,
HomeComponent . NOTIFICATION_ARR ,
@ -81,6 +156,8 @@ export class WorklistMainComponent implements OnInit {
) ;
) ;
this . WorkListBodyObj = new WorkListBodyRequest ( ) ;
this . WorkListBodyObj = new WorkListBodyRequest ( ) ;
this . WorkListButtonsObj = new WorkListButtonRequest ( ) ;
this . WorkListButtonsObj = new WorkListButtonRequest ( ) ;
this . WorkListAttachObj = new WorkListButtonRequest ( ) ;
this . WorkListSubmitterInfoObj = new WorkListSubmitterInfoRequest ( ) ;
this . WorkListActionObj = new WorkListActionRequest ( ) ;
this . WorkListActionObj = new WorkListActionRequest ( ) ;
@ -96,23 +173,43 @@ export class WorklistMainComponent implements OnInit {
this . WorkListActionObj . P_ACTION_MODE = "" ;
this . WorkListActionObj . P_ACTION_MODE = "" ;
this . WorkListActionObj . P_COMMENTS = "" ;
this . WorkListActionObj . P_COMMENTS = "" ;
this . WorkListActionObj . P_APPROVER_INDEX = null ;
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 . WorkListSubmitterInfoObj . P_PAGE_LIMIT = this . P_PAGE_LIMIT ;
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 . getNotificationButtons ( this . WorkListButtonsObj ) ;
this . getNotificationButtons ( this . WorkListButtonsObj ) ;
this . getNotificationResAttr ( this . WorkListButtonsObj ) ;
this . getNotificationResAttr ( this . WorkListButtonsObj ) ;
this . getAttachmentNotification ( this . WorkListAttachObj ) ;
this . getActionHistory ( this . WorkListActionHistoryObj ) ;
if ( this . getPassNotificationDetails . REQUEST_TYPE == "EIT" ) {
if ( this . getPassNotificationDetails . REQUEST_TYPE == "EIT" ) {
this . getEITNotificationDetails ( this . WorkListBodyObj ) ;
this . getEITNotificationDetails ( this . WorkListBodyObj ) ;
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "ABSENCE" ) {
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "ABSENCE" ) {
this . getAbsenceNotificationDetails ( this . WorkListBodyObj ) ;
this . getAbsenceNotificationDetails ( this . WorkListBodyObj ) ;
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "PO" ) {
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "PO" ) {
this . getPONotificationDetails ( this . WorkListBodyObj ) ;
this . getPONotificationDetails ( this . WorkListBodyObj ) ;
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "MO" ) {
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "MO" ) {
this . getMONotificationDetails ( this . WorkListBodyObj ) ;
this . getMONotificationDetails ( this . WorkListBodyObj ) ;
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "PR" ) {
} else if ( this . getPassNotificationDetails . REQUEST_TYPE == "PR" ) {
this . getPRNotificationDetails ( this . WorkListBodyObj ) ;
this . getPRNotificationDetails ( this . WorkListBodyObj ) ;
}
}
}
}
getPRNotificationDetails ( notificationBodyObj ) {
getPRNotificationDetails ( notificationBodyObj ) {
this . worklistMainService
this . worklistMainService
. getPRNotificationBody ( notificationBodyObj )
. getPRNotificationBody ( notificationBodyObj )
. subscribe ( ( result : PRNotificatonBodyResponse ) = > {
. subscribe ( ( result : PRNotificatonBodyResponse ) = > {
@ -120,7 +217,7 @@ export class WorklistMainComponent implements OnInit {
} ) ;
} ) ;
}
}
getMONotificationDetails ( notificationBodyObj ) {
getMONotificationDetails ( notificationBodyObj ) {
this . worklistMainService
this . worklistMainService
. getMONotificationBody ( notificationBodyObj )
. getMONotificationBody ( notificationBodyObj )
. subscribe ( ( result : MONotificatonBodyResponse ) = > {
. subscribe ( ( result : MONotificatonBodyResponse ) = > {
@ -128,7 +225,7 @@ export class WorklistMainComponent implements OnInit {
} ) ;
} ) ;
}
}
getPONotificationDetails ( notificationBodyObj ) {
getPONotificationDetails ( notificationBodyObj ) {
this . worklistMainService
this . worklistMainService
. getPONotificationBody ( notificationBodyObj )
. getPONotificationBody ( notificationBodyObj )
. subscribe ( ( result : PONotificatonBodyResponse ) = > {
. subscribe ( ( result : PONotificatonBodyResponse ) = > {
@ -167,8 +264,17 @@ export class WorklistMainComponent implements OnInit {
if ( result . GetAbsenceCollectionNotificationBodyList ) {
if ( result . GetAbsenceCollectionNotificationBodyList ) {
this . notificationBodyRes =
this . notificationBodyRes =
result . GetAbsenceCollectionNotificationBodyList ;
result . GetAbsenceCollectionNotificationBodyList ;
// getDimensions(this.notificationBodyRes) {
let obj = ( this . notificationBodyRes [ 0 ] . Collection_Notification ) . filter ( function ( list ) {
return list . SEGMENT_NAME === "END_DATE" || list . SEGMENT_NAME === "START_DATE" ;
} ) ;
// return obj;
// }
this . getSubordinatesleave ( obj )
}
}
} else if ( Type == "PR" ) {
} else if ( Type == "PR" ) {
if ( result . GetAbsenceCollectionNotificationBodyList ) {
if ( result . GetAbsenceCollectionNotificationBodyList ) {
this . notificationBodyRes =
this . notificationBodyRes =
result . GetAbsenceCollectionNotificationBodyList ;
result . GetAbsenceCollectionNotificationBodyList ;
@ -192,8 +298,27 @@ export class WorklistMainComponent implements OnInit {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if ( result . GetNotificationButtonsList != null ) {
if ( result . GetNotificationButtonsList != null ) {
this . notificationButtonRes = result . GetNotificationButtonsList ;
this . notificationButtonRes = result . GetNotificationButtonsList ;
this . common . sharedService . setSharedData ( this . notificationButtonRes , "passActionMore" ) ;
console . log ( "test" + this . notificationButtonRes . length ) ;
for ( let i = 0 ; i < this . notificationButtonRes . length ; i ++ ) {
if ( this . notificationButtonRes [ i ] . BUTTON_ACTION == "APPROVED" ) {
this . approveDis = true ;
} else
if ( this . notificationButtonRes [ i ] . BUTTON_ACTION == "REJECTED" ) {
this . rejectDis = true ;
} else
if ( this . notificationButtonRes [ i ] . BUTTON_ACTION == "REQUEST_INFO" ) {
this . requestDis = true ;
} // if result == null
} // if result == null
else (
this . notificationButtonRes [ i ] . BUTTON_ACTION != "APPROVED" && this . notificationButtonRes [ i ] . BUTTON_ACTION != "REJECTED" && this . notificationButtonRes [ i ] . BUTTON_ACTION != "REQUEST_INFO" )
{
this . moreDisabled = false ;
}
} // valid it
} // valid it
}
}
} // End handleWorkListButtonsResult
} // End handleWorkListButtonsResult
applyAction ( WorkListActionObj ) {
applyAction ( WorkListActionObj ) {
@ -215,6 +340,13 @@ export class WorklistMainComponent implements OnInit {
// this.notificationArray.splice(i, 1);
// this.notificationArray.splice(i, 1);
// }
// }
// }
// }
this . messageSuccess = true ;
setTimeout ( ( ) = > {
this . messageSuccess = false ;
} , 5000 ) ;
this . getNotificationCountAfterSubmit ( ) ;
this . getNotificationCountAfterSubmit ( ) ;
this . nextNotfification ( ) ;
this . nextNotfification ( ) ;
}
}
@ -242,11 +374,12 @@ export class WorklistMainComponent implements OnInit {
}
}
}
}
actionButton() {
actionButton ( action ) {
let ButtonAction : string = this . actionType ;
//let ButtonAction: string = this.actionType;
let ButtonAction : string = action ;
var responseAttrDic = this . notExampleJsonObject ;
var responseAttrDic = this . notExampleJsonObject ;
this . P_RESPOND_ATTRIBUTES_TBL = [ ] ;
this . P_RESPOND_ATTRIBUTES_TBL = [ ] ;
for ( let i = 0 ; i < this.notificationDynamicAttributeArr.length ; i + + ) {
for ( let i = 0 ; i < this . notificationDynamicAttributeArr . length ; i ++ ) {
let obj : any = { } ;
let obj : any = { } ;
obj . ATTRIBUTE_NAME = this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_NAME ;
obj . ATTRIBUTE_NAME = this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_NAME ;
if ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_TYPE === "number" ) {
if ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_TYPE === "number" ) {
@ -255,8 +388,8 @@ export class WorklistMainComponent implements OnInit {
// else if (isDate(responseAttrDic[key])) {
// else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// }
// }
else if ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_TYPE == "VARCHAR2" ) {
else if ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_TYPE == "VARCHAR2" ) {
obj . ATTRIBUTE_TEXT_VALUE = ( document . getElementById ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_NAME ) as HTMLInputElement ) . value ;
obj . ATTRIBUTE_TEXT_VALUE = ( document . getElementById ( this . notificationDynamicAttributeArr [ i ] . ATTRIBUTE_NAME ) as HTMLInputElement ) . value ;
}
}
this . P_RESPOND_ATTRIBUTES_TBL . push ( obj ) ;
this . P_RESPOND_ATTRIBUTES_TBL . push ( obj ) ;
}
}
@ -278,17 +411,54 @@ export class WorklistMainComponent implements OnInit {
this . WorkListActionObj . P_ACTION_MODE = ButtonAction ;
this . WorkListActionObj . P_ACTION_MODE = ButtonAction ;
this . WorkListActionObj . P_COMMENTS = "" ;
this . WorkListActionObj . P_COMMENTS = "" ;
this . WorkListActionObj . RespondAttributeList = this . P_RESPOND_ATTRIBUTES_TBL ;
this . WorkListActionObj . RespondAttributeList = this . P_RESPOND_ATTRIBUTES_TBL ;
this . common . sharedService . setSharedData (
this . getPassNotificationDetails ,
WorklistMainComponent . PASS_NOTIFICATION_INFO
) ;
this . common . sharedService . setSharedData (
ButtonAction ,
WorklistMainComponent . PASS_ACTION_MODE
) ;
this . common . sharedService . setSharedData (
this . P_RESPOND_ATTRIBUTES_TBL ,
WorklistMainComponent . PASS_RES_ATTR
) ;
// this.applyAction(this.WorkListActionObj);
if ( ButtonAction === "APPROVED" ) {
this . confirmMsg = this . ts . trPK ( 'worklistMain' , 'approveMsg' )
}
else if ( ButtonAction === "REJECTED" ) {
this . confirmMsg = this . ts . trPK ( 'worklistMain' , 'rejectMsg' )
}
else if ( ButtonAction === "DEL" ) {
this . confirmMsg = this . ts . trPK ( 'worklistMain' , 'delMsg' )
}
else if ( ButtonAction === "CLOSE" ) {
this . confirmMsg = this . ts . trPK ( 'worklistMain' , 'closeMsg' )
}
this . common . confirmAlertDialogAction (
( ) = > {
this . applyAction ( this . WorkListActionObj ) ;
this . applyAction ( this . WorkListActionObj ) ;
} , this . ts . trPK ( 'general' , 'ok' ) ,
( ) = > { } , this . ts . trPK ( 'general' , 'cancel' ) ,
this . ts . trPK ( 'vacation-rule' , 'confirmation' ) ,
this . confirmMsg )
// this.openApplyModal(this.WorkListActionObj);
}
}
if ( ButtonAction == "RFC" ) {
if ( ButtonAction == "RFC" ) {
// alert("Return For Correction");
// alert("Return For Correction");
this . WorkListActionObj . P_ACTION_MODE = ButtonAction ;
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 . common . sharedService . setSharedData (
this . getPassNotificationDetails ,
this . getPassNotificationDetails ,
WorklistMainComponent . PASS_NOTIFICATION_INFO
WorklistMainComponent . PASS_NOTIFICATION_INFO
@ -301,7 +471,8 @@ export class WorklistMainComponent implements OnInit {
this . P_RESPOND_ATTRIBUTES_TBL ,
this . P_RESPOND_ATTRIBUTES_TBL ,
WorklistMainComponent . PASS_RES_ATTR
WorklistMainComponent . PASS_RES_ATTR
) ;
) ;
this . common . openWorklistRFCPage ( ) ;
//this.common.openWorklistRFCPage();
this . openRFCModal ( ) ;
} else if ( ButtonAction == "ANSWER_INFO" ) {
} else if ( ButtonAction == "ANSWER_INFO" ) {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
// pQuestion: this.pQuestion,
@ -322,7 +493,8 @@ export class WorklistMainComponent implements OnInit {
this . P_RESPOND_ATTRIBUTES_TBL ,
this . P_RESPOND_ATTRIBUTES_TBL ,
WorklistMainComponent . PASS_RES_ATTR
WorklistMainComponent . PASS_RES_ATTR
) ;
) ;
this . common . openWorklistRollReplacement ( ) ;
//this.common.openWorklistRollReplacement();
this . openRepRolModal ( ) ;
} else if (
} else if (
ButtonAction == "DELEGATE" ||
ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" ||
ButtonAction == "REQUEST_INFO" ||
@ -348,7 +520,8 @@ export class WorklistMainComponent implements OnInit {
this . P_RESPOND_ATTRIBUTES_TBL ,
this . P_RESPOND_ATTRIBUTES_TBL ,
WorklistMainComponent . PASS_RES_ATTR
WorklistMainComponent . PASS_RES_ATTR
) ;
) ;
this . common . openWorklistRollReplacement ( ) ;
// this.common.openWorklistRollReplacement();
this . openRepRolModal ( ) ;
} else if (
} else if (
ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION"
ButtonAction == "CONTINUE_ACTION"
@ -440,21 +613,21 @@ export class WorklistMainComponent implements OnInit {
this . hideForwordEmployee = result . NotificationRespondRolesList [ 0 ] ;
this . hideForwordEmployee = result . NotificationRespondRolesList [ 0 ] ;
}
}
this . notificationDynamicFields ( result . NotificationGetRespondAttributesList ) ;
this . notificationDynamicFields ( result . NotificationGetRespondAttributesList ) ;
this . notificationDynamicAttributeArr = result . NotificationGetRespondAttributesList ;
this . notificationDynamicAttributeArr = result . NotificationGetRespondAttributesList ;
if ( result . P_Schema ) this . schemaNotific = JSON . parse ( result . P_Schema ) ;
if ( result . P_Schema ) this . schemaNotific = JSON . parse ( result . P_Schema ) ;
} // valid it
} // valid it
} // End handleWorkListButtonsResult
} // End handleWorkListButtonsResult
notificationDynamicFields ( notificationAttr ) {
notificationDynamicFields ( notificationAttr ) {
const containerId = 'notificationDynamicFields' ;
const containerId = 'notificationDynamicFields' ;
for ( let i = 0 ; i < notificationAttr.length ; i + + ) {
for ( let i = 0 ; i < notificationAttr . length ; i ++ ) {
if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "VARCHAR2" ) {
if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "VARCHAR2" ) {
this . textArea = new TextAreaInput ( notificationAttr [ i ] . ATTRIBUTE_DISPLAY_NAME , notificationAttr [ i ] . ATTRIBUTE_NAME , "" , containerId , "" , "" , "" ) ;
this . textArea = new TextAreaInput ( notificationAttr [ i ] . ATTRIBUTE_DISPLAY_NAME , notificationAttr [ i ] . ATTRIBUTE_NAME , "" , containerId , "" , "" , "" ) ;
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "ROLE" ) {
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "ROLE" ) {
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "DATE" ) {
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "DATE" ) {
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "NUMBER" ) {
} else if ( notificationAttr [ i ] . ATTRIBUTE_TYPE == "NUMBER" ) {
}
}
}
}
@ -483,7 +656,6 @@ export class WorklistMainComponent implements OnInit {
AbsenceNotificatonBodyResponse . NOT_WORKLIST
AbsenceNotificatonBodyResponse . NOT_WORKLIST
) ;
) ;
this . common . sharedService . setSharedData ( "ABSENCE" , "NotBodyType" ) ;
this . common . sharedService . setSharedData ( "ABSENCE" , "NotBodyType" ) ;
//this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
this . common . openNotificationDetailsPage ( ) ;
this . common . openNotificationDetailsPage ( ) ;
}
}
}
}
@ -501,4 +673,277 @@ export class WorklistMainComponent implements OnInit {
}
}
} ) ;
} ) ;
}
}
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 ++ ;
this . WorkListActionHistoryObj . P_PAGE_NUM = this . P_PAGE_NUM ;
let lastItemIndex = this . actionHistoryRes . length - 1 ;
if ( result . GetActionHistoryList [ lastItemIndex ] ) {
let lastitem = result . GetActionHistoryList [ lastItemIndex ] ;
if ( lastitem . NO_OF_ROWS == lastitem . ROW_NUM ) {
this . IsReachEnd = true ;
} else {
this . IsReachEnd = false ;
}
}
this . turnCateFun ( this . actionHistoryRes ) ;
}
}
}
public checkLines ( note ) {
if ( note && note != null ) {
return ( note . length > this . lines_note_limit ) ? true : false ;
}
return false ;
} ;
public turnCateFun ( actionHis ) {
for ( let i = 0 ; i < actionHis . length ; i ++ ) {
actionHis [ i ] . visible = false ;
}
this . actionHistoryRes = actionHis ;
console . log ( "test" ) ;
}
async openMoreActions() {
const modal = await this . modalCtrl . create ( {
component : MoreActionModalComponent ,
backdropDismiss : false ,
} ) ;
modal . cssClass = 'note-modal' ;
modal . onDidDismiss ( )
. then ( ( data ) = > {
console . log ( data . data ) ;
if ( data . data == "cancel" || data . data == undefined ) {
return ;
} else {
// this.selectedAction = data.data;
this . actionType = data . data . BUTTON_ACTION ;
console . log ( this . actionType ) ;
///call Action button
this . actionButton ( this . actionType ) ;
}
} ) ;
return await modal . present ( ) ;
}
async OpenAttachFiles ( value , Type ) {
this . common . sharedService . setSharedData ( { displayData : value , TypeData : Type } , 'WorkListAttachViewPage' )
const modal = await this . modalCtrl . create ( {
component : WorkListAttachViewComponent
} ) ;
return await modal . present ( ) ;
}
///calling getSubleave
getSubordinatesleave ( list ) {
console . log ( list ) ;
let to ;
let from ;
for ( let i = 0 ; i < list . length ; i ++ ) {
if ( list [ i ] . SEGMENT_NAME == "END_DATE" )
to = list [ i ] . DATE_VALUE ;
else if ( list [ i ] . SEGMENT_NAME == "START_DATE" ) {
from = list [ i ] . DATE_VALUE ;
}
}
console . log ( new Date ( to ) ) ;
console . log ( new Date ( from ) ) ;
const request = new GetSubordinatesLeavesRequest ( ) ;
request . P_DATE_FROM = "/Date(" + Date . parse ( from ) + ")/" ; //new Date(from);
request . P_DATE_TO = "/Date(" + Date . parse ( to ) + ")/" //new Date(to);
request . P_SELECTED_EMPLOYEE_NUMBER = this . selEmp ;
// ="'/Date(" + Date.parse(from) + ")'"
this . dashboredService . getSubordinatesLeaves ( request ) .
subscribe ( ( result : any ) = > {
this . handleSubordinatesLeavesResult ( result ) ;
} ) ;
}
public handleSubordinatesLeavesResult ( result ) {
if ( this . common . validResponse ( result ) ) {
// GetSubordinatesLeavesList it used in dashbored
// if (this.common.hasData(result.GetSubordinatesLeavesList)) {
if ( this . common . hasData ( result . SubordinatesOnLeavesList ) ) {
this . subordinatesleaveList = result . SubordinatesOnLeavesList ;
}
}
}
getsubmitterInfo ( notificationSubmitterInfoObj ) {
this . worklistMainService . getSubmitterInfo ( notificationSubmitterInfoObj ) .
subscribe ( ( result : WorklistsubmitterInfoResponse ) = > {
this . handleSubmitterInfoResult ( result ) ;
} ) ;
}
handleSubmitterInfoResult ( result ) {
if ( this . common . validResponse ( result ) ) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if ( this . common . hasData ( result . MemberInformationList ) ) {
//if (result.MemberInformationList != null) {
this . submitterInfoRes = result . MemberInformationList ;
} // if result == null
} // valid it
} // End handleWorkListButtonsResult
async openRepRolModal() {
const modal = await this . modalCtrl . create ( {
component : WorkListReplacementRollComponent ,
backdropDismiss : false ,
} ) ;
modal . cssClass = 'replaceRoll-modal' ;
modal . onDidDismiss ( )
. then ( ( data ) = > {
console . log ( data . data ) ;
if ( data . data == "cancel" || data . data == undefined ) {
return ;
} else {
}
} ) ;
return await modal . present ( ) ;
}
async openRFCModal() {
const modal = await this . modalCtrl . create ( {
component : WorkListRfcComponent ,
backdropDismiss : false ,
} ) ;
modal . cssClass = 'replaceRoll-modal' ;
modal . onDidDismiss ( )
. then ( ( data ) = > {
console . log ( data . data ) ;
if ( data . data == "cancel" || data . data == undefined ) {
return ;
} else {
}
} ) ;
return await modal . present ( ) ;
}
async openApplyModal ( WorkListActionObj ) {
this . common . sharedService . setSharedData ( this . getPassNotificationDetails , WorklistMainComponent . PASS_NOTIFICATION_INFO ) ;
this . common . sharedService . setSharedData ( WorkListActionObj , 'ApplyActionModalPage' )
// this.common.sharedService.setSharedData(
// this.WorkListActionObj,
// WorklistMainPRComponent.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!
} ) ;
return await modal . present ( ) ;
}
}
}