Merge branch 'MOHEMM-Q2-DEV' into enad-Q1

zohaib-huawei-q2
umasoodch 5 years ago
commit 93762ccfe8

@ -137,8 +137,8 @@ export class AppComponent implements OnInit {
this.authService.checkAds({ this.authService.checkAds({
EmployeeNumber: '', EmployeeNumber: '',
ItgEnableAt: "Before Service Initiation", //After Service Submission ItgEnableAt: "After Service Submission", //After Service Submission
ItgServiceName: "Ticket" ItgServiceName: "Login"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => { }, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data; var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;

@ -169,11 +169,11 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true); let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
this.platform.backButton.subscribeWithPriority(9999, () => { // this.platform.backButton.subscribeWithPriority(9999, () => {
if (this.router.isActive('/home', true)) { // if (this.router.isActive('/home', true)) {
this.common.openHome(); // this.common.openHome();
} // }
}); // });
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header'); this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule'); this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');

@ -95,6 +95,7 @@ export class HrRequestFormComponent implements OnInit {
this.getTicketsByEmployee(); this.getTicketsByEmployee();
this.getTicketTypes(); this.getTicketTypes();
this.getProject(); this.getProject();
//this.getCreateTicket(); //this.getCreateTicket();
@ -295,6 +296,7 @@ export class HrRequestFormComponent implements OnInit {
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.cs.stopLoading(); this.cs.stopLoading();
this.handlegetCreateTicketResult(result); this.handlegetCreateTicketResult(result);
this.checkERM('After Service Submission');
}) })
} }
@ -404,4 +406,44 @@ export class HrRequestFormComponent implements OnInit {
} }
checkERM(status) {
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: status, //After Service Submission
ItgServiceName: "Ticket"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;
this.cs.sharedService.setSharedData(
result,
AuthenticationService.SERVEY_DATA
)
if (!CommonService.SKIP && result) {
if (result.notificationType == 'Survey') {
this.cs.navigateForward('/erm-channel/survey');
} else {
this.authService.adsDetails({
"ItgNotificationMasterId": result['notificationMasterId']
},
() => { }, this.ts.trPK('general', 'ok')
).subscribe((result) => {
var data = result.Mohemm_ITG_ResponseItem;
if (data) {
this.cs.sharedService.setSharedData(
JSON.parse(data),
AuthenticationService.ADS_DATA
);
this.cs.navigateForward('/erm-channel/home');
}
})
}
}
})
}
} }

@ -19,108 +19,145 @@ import { FileUploader } from 'ng2-file-upload';
}) })
export class HRRequestComponent implements OnInit { export class HRRequestComponent implements OnInit {
public EmpName : string; public EmpName: string;
public EmpNum : string; public EmpNum: string;
public EmpGroup : string; public EmpGroup: string;
public EmpMobile : string; public EmpMobile: string;
public EmpJob : string; public EmpJob: string;
public EmpOrgName : string; public EmpOrgName: string;
public EmpPayrol : string; public EmpPayrol: string;
public EmpPosition : string; public EmpPosition: string;
public EmpEmail: string; public EmpEmail: string;
public EmpCatMeaning:string; public EmpCatMeaning: string;
public EmpGRADENAME : string; public EmpGRADENAME: string;
public EmpLocation : string; public EmpLocation: string;
public EmpImg : string; public EmpImg: string;
public userImage: any = '../assets/imgs/profile.png'; public userImage: any = '../assets/imgs/profile.png';
public loginData = new LoginModel(); public loginData = new LoginModel();
public searchKeySelect = 'Complaints'; public searchKeySelect = 'Complaints';
myColor: string = 'secondary'; myColor: string = 'secondary';
public showRequestDetails = false; public showRequestDetails = false;
public proID= "CS" public proID = "CS"
public inquiry: string; public inquiry: string;
public HR : string; public HR: string;
public complaints:string; public complaints: string;
public Projectresult:any; public Projectresult: any;
public EmpRelations:any; public EmpRelations: any;
public Hr:any; public Hr: any;
public Payroll:any; public Payroll: any;
public GovRelation:any; public GovRelation: any;
public projName:any; public projName: any;
public topicName:any; public topicName: any;
public departTypeList: any; public departTypeList: any;
public topicTypeList:any; public topicTypeList: any;
public sectionTypeList:any; public sectionTypeList: any;
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
public projectDetial:any; public projectDetial: any;
public projectDep:any; public projectDep: any;
public sectionDep:any; public sectionDep: any;
public direction: string; public direction: string;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
public cs: CommonService, public cs: CommonService,
public authService: AuthenticationService, public authService: AuthenticationService,
public sharedData: SharedDataService, public sharedData: SharedDataService,
public events: Events, public events: Events,
public MowadhafiService: MowadhafiService, public MowadhafiService: MowadhafiService,
private location: Location, private location: Location,
private menu: MenuController, private menu: MenuController,
) { ) {
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
} }
ngOnInit() { ngOnInit() {
this.getUserInformation(); this.getUserInformation();
this.checkERM('Before Service Initiation');
} }
goback() { goback() {
this.location.back(); this.location.back();
} }
getUserInformation(){ getUserInformation() {
const request = { const request = {
// P_SELECTED_EMPLOYEE_NUMBER:"121816", // P_SELECTED_EMPLOYEE_NUMBER:"121816",
P_SELECTED_RESP_ID:-999, P_SELECTED_RESP_ID: -999,
P_PAGE_NUM:1, P_PAGE_NUM: 1,
P_PAGE_LIMIT:1 P_PAGE_LIMIT: 1
}; };
this.MowadhafiService.getUserInfo(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> this.MowadhafiService.getUserInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
{
this.handleUserInfoResult(result); this.handleUserInfoResult(result);
}) })
} }
handleUserInfoResult(result){ handleUserInfoResult(result) {
this.EmpName = result.MemberInformationList[0].EMPLOYEE_NAME; this.EmpName = result.MemberInformationList[0].EMPLOYEE_NAME;
console.log("____________" + this.EmpName); console.log("____________" + this.EmpName);
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER; this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME; this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER; this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER;
this.EmpJob = result.MemberInformationList[0].JOB_NAME; this.EmpJob = result.MemberInformationList[0].JOB_NAME;
this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME; this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME; this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME;
this.EmpPosition = result.MemberInformationList[0].POSITION_NAME; this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS; this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING; this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME; this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME;
this.EmpLocation = result.MemberInformationList[0].LOCATION_NAME; this.EmpLocation = result.MemberInformationList[0].LOCATION_NAME;
this.EmpImg = result.MemberInformationList[0].EMPLOYEE_IMAGE this.EmpImg = result.MemberInformationList[0].EMPLOYEE_IMAGE
// console.log("total no "+this.EmpTotal) // console.log("total no "+this.EmpTotal)
} }
public createRequest() { public createRequest() {
this.cs.openHRRequestFormPage(); this.cs.openHRRequestFormPage();
// this.menu.toggle(); // this.menu.toggle();
} }
checkERM(status) {
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: status, //After Service Submission
ItgServiceName: "Ticket"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;
this.cs.sharedService.setSharedData(
result,
AuthenticationService.SERVEY_DATA
)
if (!CommonService.SKIP && result) {
if (result.notificationType == 'Survey') {
this.cs.navigateForward('/erm-channel/survey');
} else {
this.authService.adsDetails({
"ItgNotificationMasterId": result['notificationMasterId']
},
() => { }, this.ts.trPK('general', 'ok')
).subscribe((result) => {
var data = result.Mohemm_ITG_ResponseItem;
if (data) {
this.cs.sharedService.setSharedData(
JSON.parse(data),
AuthenticationService.ADS_DATA
);
this.cs.navigateForward('/erm-channel/home');
}
})
}
}
})
}
} }

Loading…
Cancel
Save