hr request

zohaib-huawei-q2
Sultan Khan 5 years ago
parent cdc81881f5
commit 8a5e9f25e7

@ -145,7 +145,7 @@
<ion-footer > <ion-footer >
<div class="centerDiv"> <div class="centerDiv">
<button class="gridCancelBtn" ion-button (click)="cancelRequest()">{{ts.trPK('general','cancel')}}</button> <button class="gridCancelBtn" ion-button (click)="cancelRequest()">{{ts.trPK('general','cancel')}}</button>
<button class="gridSubmitBtn" ion-button (click)="submitRequest()">{{ts.trPK('general','submit')}}</button> <button class="gridSubmitBtn" ion-button (click)="getCreateTicket()">{{ts.trPK('general','submit')}}</button>
</div> </div>
</ion-footer> </ion-footer>

@ -17,52 +17,52 @@ import { FileUploader } from 'ng2-file-upload';
styleUrls: ['./hr-request-form.component.scss'], styleUrls: ['./hr-request-form.component.scss'],
}) })
export class HrRequestFormComponent implements OnInit { export class HrRequestFormComponent 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;
public projectDetial:any; public projectDetial: any;
public projectDep:any; public projectDep: any;
public sectionDep:any; public sectionDep: any;
public projectCode; public projectCode;
public SelectedServiceType:any; public SelectedServiceType: any;
public depType:any; public depType: any;
public secType:any; public secType: any;
public topicType:any; public topicType: any;
indexLastObj: any; indexLastObj: any;
addAttachRequest: any = []; addAttachRequest: any = [];
TransactionID: any; TransactionID: any;
public teckitDetial:any; public teckitDetial: any;
public teckitInfo:any; public teckitInfo: any;
public Description:any; public Description: any;
public selectedFile: any; public selectedFile: any;
filterAllowedType: any = [ filterAllowedType: any = [
"application/pdf", "application/pdf",
@ -75,27 +75,27 @@ export class HrRequestFormComponent implements OnInit {
]; ];
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.projectCode = this.cs.sharedService.getSharedData("projcet-code"); this.projectCode = this.cs.sharedService.getSharedData("projcet-code");
this.getTicketsByEmployee(); this.getTicketsByEmployee();
this.getTicketTypes(); this.getTicketTypes();
this.getProject(); this.getProject();
this.getCreateTicket(); //this.getCreateTicket();
} }
@ -103,302 +103,301 @@ export class HrRequestFormComponent implements OnInit {
goback() { goback() {
this.location.back(); this.location.back();
} }
showSelectedField(){}
getTicketTypes(){ showSelectedField() { }
const request = {
EmployeeNumber:"",
}; getTicketTypes() {
this.MowadhafiService.getTicketTypes(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> const request = {
{ EmployeeNumber: "",
this.handlegetTicketTypesResult(result);
}) } };
handlegetTicketTypesResult(result){ this.MowadhafiService.getTicketTypes(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.HR = result.Mohemm_Itg_TicketTypesList[0].typeName; this.handlegetTicketTypesResult(result);
this.complaints = result.Mohemm_Itg_TicketTypesList[1].typeName;
this.inquiry = result.Mohemm_Itg_TicketTypesList[2].typeName;
}
})
}
handlegetTicketTypesResult(result) {
this.HR = result.Mohemm_Itg_TicketTypesList[0].typeName;
this.complaints = result.Mohemm_Itg_TicketTypesList[1].typeName;
this.inquiry = result.Mohemm_Itg_TicketTypesList[2].typeName;
}
getProject(){
const request = {
EmployeeNumber:"",
ItgProjectCode: this.projectCode
}; getProject() {
this.MowadhafiService.getProject(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> const request = {
{ EmployeeNumber: "",
this.handlegetProjectResult(result); ItgProjectCode: this.projectCode
}) } };
handlegetProjectResult(result){ this.MowadhafiService.getProject(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.Projectresult=result.Mohemm_Itg_ProjectsList; this.handlegetProjectResult(result);
this.getProjectDepartments();
}
})
}
handlegetProjectResult(result) {
this.Projectresult = result.Mohemm_Itg_ProjectsList;
this.getProjectDepartments();
}
getProjectDepartments(){
const request = {
EmployeeNumber:"",
ItgProjectId:this.Projectresult[0].projectId,
getProjectDepartments() {
const request = {
EmployeeNumber: "",
ItgProjectId: this.Projectresult[0].projectId,
};
this.MowadhafiService.getProjectDepartments(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.handlegetProjectDepartmentsResult(result);
}) } };
handlegetProjectDepartmentsResult(result){ this.MowadhafiService.getProjectDepartments(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.departTypeList= result.Mohemm_ITG_ProjectDepartmentsList; this.handlegetProjectDepartmentsResult(result);
this.getDepartmentSections();
} })
}
handlegetProjectDepartmentsResult(result) {
this.departTypeList = result.Mohemm_ITG_ProjectDepartmentsList;
this.getDepartmentSections();
getDepartmentSections(){ }
const request = {
EmployeeNumber:"",
ItgProjectDepartmentId:this.departTypeList.projectDepartmentId,
getDepartmentSections() {
const request = {
EmployeeNumber: "",
ItgProjectDepartmentId: this.departTypeList.projectDepartmentId,
};
this.MowadhafiService.getDepartmentSections(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.handlegetDepartmentSectionsResult(result);
}) } };
handlegetDepartmentSectionsResult(result){ this.MowadhafiService.getDepartmentSections(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.sectionTypeList= result.Mohemm_ITG_DepartmentSectionsList; this.handlegetDepartmentSectionsResult(result);
this.getSectionTopics(); })
} }
handlegetDepartmentSectionsResult(result) {
this.sectionTypeList = result.Mohemm_ITG_DepartmentSectionsList;
getSectionTopics(){ this.getSectionTopics();
const request = { }
EmployeeNumber:"",
ItgDepartmentSectionId:this.sectionTypeList.departmentSectionId,
}; getSectionTopics() {
this.MowadhafiService.getSectionTopics(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> const request = {
{ EmployeeNumber: "",
this.handlegetSectionTopicsResult(result); ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
}) } };
handlegetSectionTopicsResult(result){ this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
// this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName this.handlegetSectionTopicsResult(result);
this.topicTypeList= result.Mohemm_ITG_SectionTopicsList;
})
}
handlegetSectionTopicsResult(result) {
// this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName
this.topicTypeList = result.Mohemm_ITG_SectionTopicsList;
}
}
// getTicketDetails(){
// const request = {
// EmployeeNumber:'',
// ItgTicketId:this.teckitDetial.ticketId,
// }; // getTicketDetails(){
// this.MowadhafiService.getTicketDetails(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> // const request = {
// { // EmployeeNumber:'',
// this.handlegetTicketDetailsResult(result); // ItgTicketId:this.teckitDetial.ticketId,
// }) } // };
// handlegetTicketDetailsResult(result){ // this.MowadhafiService.getTicketDetails(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
// {
// this.handlegetTicketDetailsResult(result);
// let res; // }) }
// if(this.cs.validResponse(result)){ // handlegetTicketDetailsResult(result){
// res = JSON.parse(result.Mohemm_ITG_ResponseItem);
// console.log(res);
// this.teckitInfo = res.result.data;
// } // let res;
// if(this.cs.validResponse(result)){
// res = JSON.parse(result.Mohemm_ITG_ResponseItem);
// console.log(res);
// this.teckitInfo = res.result.data;
// } // }
getTicketsByEmployee() { // }
const request = {
// TokenID:"xxx",
EmployeeNumber: "",
ItgPageSize: 10,
ItgPageNo: 1
}; getTicketsByEmployee() {
this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { const request = {
this.handlegetTicketsByEmployeeResult(result); // TokenID:"xxx",
EmployeeNumber: "",
ItgPageSize: 10,
ItgPageNo: 1
}) };
} this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetTicketsByEmployeeResult(result);
handlegetTicketsByEmployeeResult(result){ })
let x; }
if(this.cs.validResponse(result)){
x = JSON.parse(result.Mohemm_ITG_ResponseItem);
console.log(x);
this.teckitInfo=x.result.data;
// for (let i = 0; i < this.ticketsInfo.length; i++) {
// console.log(i + ' : ' + this.ticketsInfo[i].ticketTypeName)
// }
console.log("getTicketsByEmployee()-------------------------------------------------------");
console.log(this.teckitInfo);
console.log("Type Id" + this.teckitInfo[0].ticketTypeId);
}
}
handlegetTicketsByEmployeeResult(result) {
let x;
if (this.cs.validResponse(result)) {
x = JSON.parse(result.Mohemm_ITG_ResponseItem);
console.log(x);
this.teckitInfo = x.result.data;
// for (let i = 0; i < this.ticketsInfo.length; i++) {
// console.log(i + ' : ' + this.ticketsInfo[i].ticketTypeName)
getCreateTicket(){ // }
// const request = { console.log("getTicketsByEmployee()-------------------------------------------------------");
// // EmployeeNumber:"", console.log(this.teckitInfo);
// // ticketTypeId:this.teckitInfo[0].ticketTypeId, console.log("Type Id" + this.teckitInfo[0].ticketTypeId);
// // projectId:this.teckitInfo[0].projectId,
// // departmentId:this.teckitInfo[0].departmentId,
// // sectionId:this.teckitInfo[0].sectionId,
// // sectionTopicId:this.teckitInfo[0].topicId,
// // description:this.teckitInfo[0].description,
// // fileColl:this.
// // employeeNumber:this.teckitInfo[0].employeeNumber,
// // ticketStatus:this.teckitInfo[0].ticketStatusName,
}
}
// // channelId:this.teckitInfo.channelId, getCreateTicket() {
// const request = {
// // EmployeeNumber:"",
// // ticketTypeId:this.teckitInfo[0].ticketTypeId,
// // projectId:this.teckitInfo[0].projectId,
// // departmentId:this.teckitInfo[0].departmentId,
// // sectionId:this.teckitInfo[0].sectionId,
// // sectionTopicId:this.teckitInfo[0].topicId,
// // description:this.teckitInfo[0].description,
// // fileColl:this.
// // employeeNumber:this.teckitInfo[0].employeeNumber,
// // ticketStatus:this.teckitInfo[0].ticketStatusName,
// }; // // channelId:this.teckitInfo.channelId,
var request = new FormData();
request.append('EmployeeNumber',"" );
request.append('ticketTypeId', this.teckitInfo[0].ticketTypeId );
request.append('projectId',this.teckitInfo[0].projectId);
request.append('departmentId',this.teckitInfo[0].departmentId );
request.append('sectionId',this. teckitInfo[0].sectionId );
request.append('sectionTopicId', this.teckitInfo[0].topicId );
request.append('description',this.teckitInfo[0].description );
request.append('fileColl',this.selectedFile[0],this.selectedFile[0].name );
request.append('employeeNumber',this.teckitInfo[0].employeeNumber );
request.append('ticketStatus',this.teckitInfo[0].ticketStatusName );
//request.append('file', this.uploadForm.get('profile').value); // };
var request = new FormData();
request.append('ticketTypeId', '1');
request.append('projectId', '11');
request.append('departmentId', '1');
request.append('sectionId', '1');
request.append('sectionTopicId', '1');
request.append('description', this.Description);
//request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
request.append('employeeNumber', '13777');
request.append('ticketStatus', 'new');
request.append('channel', '31');
//request.append('file', this.uploadForm.get('profile').value);
this.MowadhafiService.getCreateTicket(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.handlegetCreateTicketResult(result);
}) }
handlegetCreateTicketResult(result){
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetCreateTicketResult(result);
} })
}
handlegetCreateTicketResult(result) {
}
public cancelRequest() {
this.cs.openMyRequestPage();
// this.menu.toggle();
}
/*******************Add attchement Functions*************/ public cancelRequest() {
public uploader: FileUploader = new FileUploader({ this.cs.openMyRequestPage();
allowedMimeType: [ // this.menu.toggle();
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
} }
});
onFileSelectedclick(event){ /*******************Add attchement Functions*************/
//event.target.value = ''; public uploader: FileUploader = new FileUploader({
this.selectedFile = event; allowedMimeType: [
} "application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
onFileSelected(input) { // onFileSelected(event) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { // //event.target.value = '';
let msg: string = ""; // this.selectedFile = event;
msg = this.ts.trPK("general", "noFileSelect"); // }
this.cs.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
// console.log(file);
this.getBase64(file).then(data => onFileSelected(input) {
this.pushObject(data, file.name, file.type) if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
); let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.cs.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
this.selectedFile = input.target.files;
// console.log(file);
this.getBase64(file).then(data =>
this.pushObject(data, file.name, file.type)
);
}
} }
}
getBase64(file) { getBase64(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const reader = new FileReader(); const reader = new FileReader();
reader.readAsDataURL(file); reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result); reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error); reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
// console.log("before push: "+ this.index);
this.indexLastObj++;
try {
let array = name.split(".");
let attachType: string = array[array.length - 1];
this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
}); });
} catch (e) {} }
}
removeFile(objectitem) { pushObject(fileData, name, type) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem); // console.log("before push: "+ this.index);
this.uploader.queue.splice(objIndex1, 1); this.indexLastObj++;
let objIndex = this.addAttachRequest.findIndex( try {
item => item.AttachmentID == objectitem.AttachmentID let array = name.split(".");
); let attachType: string = array[array.length - 1];
this.addAttachRequest.splice(objIndex, 1);
} this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
});
} catch (e) { }
}
removeFile(objectitem) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
this.uploader.queue.splice(objIndex1, 1);
let objIndex = this.addAttachRequest.findIndex(
item => item.AttachmentID == objectitem.AttachmentID
);
this.addAttachRequest.splice(objIndex, 1);
}
submitRequest(){ submitRequest() {
} }
} }

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { HttpClient, HttpHeaders } from '@angular/common/http';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@ -9,102 +9,113 @@ export class MowadhafiService {
public static EMPLOYEE_SHARED_DATA = 'employee'; public static EMPLOYEE_SHARED_DATA = 'employee';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES'; public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS'; public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
public static getUserInfo ='Services/ERP.svc/REST/Get_UserInformation'; public static getUserInfo = 'Services/ERP.svc/REST/Get_UserInformation';
public static getTicketTypes ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTypes'; public static getTicketTypes = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTypes';
public static getProject ='Services/COCWS.svc/REST/Mohemm_ITG_GetProjects'; public static getProject = 'Services/COCWS.svc/REST/Mohemm_ITG_GetProjects';
public static getProjectDepartments ='Services/COCWS.svc/REST/Mohemm_ITG_GetProjectDepartments'; public static getProjectDepartments = 'Services/COCWS.svc/REST/Mohemm_ITG_GetProjectDepartments';
public static getDepartmentSections ='Services/COCWS.svc/REST/Mohemm_ITG_GetDepartmentSections'; public static getDepartmentSections = 'Services/COCWS.svc/REST/Mohemm_ITG_GetDepartmentSections';
public static getSectionTopics ='Services/COCWS.svc/REST/Mohemm_ITG_GetSectionTopics'; public static getSectionTopics = 'Services/COCWS.svc/REST/Mohemm_ITG_GetSectionTopics';
public static getTicketsByEmployee ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketsByEmployee'; public static getTicketsByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketsByEmployee';
public static getTicketStatisticsByEmp ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee'; public static getTicketStatisticsByEmp = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee';
public static getTicketTransaction ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction'; public static getTicketTransaction = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction';
public static getTicketDetails ='Services/COCWS.svc/REST/Mohemm_ITG_GetTicketDetails'; public static getTicketDetails = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketDetails';
public static getCreateTicket = 'Services/COCWS.svc/REST/Mohemm_ITG_CreateTicket'; public static getCreateTicket = 'Services/COCWS.svc/REST/Mohemm_ITG_CreateTicket';
constructor( constructor(
public con: ConnectorService, public con: ConnectorService,
private authService: AuthenticationService private authService: AuthenticationService,
public http: HttpClient
) { } ) { }
public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string){ public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post(MowadhafiService.getMyTeam, request, onError, errorLabel); return this.con.post(MowadhafiService.getMyTeam, request, onError, errorLabel);
} }
public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){ public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post(MowadhafiService.getSuborinateStatus, request, onError, errorLabel); return this.con.post(MowadhafiService.getSuborinateStatus, request, onError, errorLabel);
} }
public getUserInfo(absence: any, onError?: any, errorLabel?: string){ public getUserInfo(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post(MowadhafiService.getUserInfo, request, onError, errorLabel); return this.con.post(MowadhafiService.getUserInfo, request, onError, errorLabel);
} }
public getTicketTypes(absence: any, onError?: any, errorLabel?: string){ public getTicketTypes(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
console.log(request); console.log(request);
return this.con.post(MowadhafiService.getTicketTypes, request, onError, errorLabel); return this.con.post(MowadhafiService.getTicketTypes, request, onError, errorLabel);
} }
public getProject(absence: any, onError?: any, errorLabel?: string){ public getProject(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
// request.ItgProjectCode = request.projectCode; // request.ItgProjectCode = request.projectCode;
return this.con.post(MowadhafiService.getProject, request, onError, errorLabel); return this.con.post(MowadhafiService.getProject, request, onError, errorLabel);
} }
public getProjectDepartments(absence: any, onError?: any, errorLabel?: string){ public getProjectDepartments(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getProjectDepartments, request, onError, errorLabel); return this.con.post(MowadhafiService.getProjectDepartments, request, onError, errorLabel);
} }
public getDepartmentSections(absence: any, onError?: any, errorLabel?: string){ public getDepartmentSections(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getDepartmentSections, request, onError, errorLabel); return this.con.post(MowadhafiService.getDepartmentSections, request, onError, errorLabel);
} }
public getSectionTopics(absence: any, onError?: any, errorLabel?: string){ public getSectionTopics(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getSectionTopics, request, onError, errorLabel); return this.con.post(MowadhafiService.getSectionTopics, request, onError, errorLabel);
} }
public getTicketsByEmployee(absence: any, onError?: any, errorLabel?: string){ public getTicketsByEmployee(absence: any, onError?: any, errorLabel?: string) {
let request = absence; let request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getTicketsByEmployee, request, onError, errorLabel); return this.con.post(MowadhafiService.getTicketsByEmployee, request, onError, errorLabel);
} }
public getTicketStatisticsByEmp(absence: any, onError?: any, errorLabel?: string){ public getTicketStatisticsByEmp(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post(MowadhafiService.getTicketStatisticsByEmp, request, onError, errorLabel); return this.con.post(MowadhafiService.getTicketStatisticsByEmp, request, onError, errorLabel);
} }
public getTicketTransaction(absence: any, onError?: any, errorLabel?: string){ public getTicketTransaction(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getTicketTransaction, request, onError, errorLabel); return this.con.post(MowadhafiService.getTicketTransaction, request, onError, errorLabel);
} }
public getTicketDetails(absence: any, onError?: any, errorLabel?: string){ public getTicketDetails(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getTicketDetails, request, onError, errorLabel); return this.con.post(MowadhafiService.getTicketDetails, request, onError, errorLabel);
} }
public getCreateTicket(absence: any, onError?: any, errorLabel?: string){ public getCreateTicket(absence: any, onError?: any, errorLabel?: string) {
const request = absence; const request = absence;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME; request.EmployeeNumber = request.P_USER_NAME;
return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); const HttpUploadOptions = {
headers: new HttpHeaders({ "Content-Type": "multipart/form-data", })
}
// return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel);
return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, {
reportProgress: true,
observe: 'events'
}
)
} }
} }
Loading…
Cancel
Save