|
|
|
|
@ -54,9 +54,9 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
public sectionDep: any;
|
|
|
|
|
public projectCode;
|
|
|
|
|
public SelectedServiceType: any;
|
|
|
|
|
public depType: any;
|
|
|
|
|
public secType: any;
|
|
|
|
|
public topicType: any;
|
|
|
|
|
public depType: any ="";
|
|
|
|
|
public secType: any = "";
|
|
|
|
|
public topicType: any="";
|
|
|
|
|
indexLastObj: any;
|
|
|
|
|
addAttachRequest: any = [];
|
|
|
|
|
TransactionID: any;
|
|
|
|
|
@ -73,8 +73,17 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
"application/vnd.ms-excel",
|
|
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
projctid:any;
|
|
|
|
|
employeeNumber:any;
|
|
|
|
|
ticketType: any =[];
|
|
|
|
|
public direction: string;
|
|
|
|
|
HRServices = '';
|
|
|
|
|
Complaints='';
|
|
|
|
|
Inquiry='';
|
|
|
|
|
input = document.getElementById ("firstLabel");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public cs: CommonService,
|
|
|
|
|
@ -91,16 +100,42 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.projectCode = this.cs.sharedService.getSharedData("projcet-code");
|
|
|
|
|
this.getTicketsByEmployee();
|
|
|
|
|
this.projectCode = this.cs.sharedService.getSharedData("projcet-code",false);
|
|
|
|
|
this.getTicketTypes();
|
|
|
|
|
this.getProject();
|
|
|
|
|
|
|
|
|
|
//this.getCreateTicket();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onSelectChange(event, type) {
|
|
|
|
|
const value = event.target.value;
|
|
|
|
|
this.depType = value;
|
|
|
|
|
console.log(value);
|
|
|
|
|
// this.topicTypeList =[];
|
|
|
|
|
// this.sectionTypeList =[];
|
|
|
|
|
if(type==1){
|
|
|
|
|
this.getDepartmentSections(value);
|
|
|
|
|
this.sectionTypeList =[];
|
|
|
|
|
this.topicTypeList =[];
|
|
|
|
|
|
|
|
|
|
}else if(type==2){
|
|
|
|
|
this.getSectionTopics(value);
|
|
|
|
|
this.topicTypeList =[];
|
|
|
|
|
|
|
|
|
|
}else if(type==3){
|
|
|
|
|
|
|
|
|
|
}else{}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onFileSelectedclick(event){
|
|
|
|
|
event.target.value = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
goback() {
|
|
|
|
|
this.location.back();
|
|
|
|
|
|
|
|
|
|
@ -119,11 +154,11 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
this.ticketType =result.Mohemm_Itg_TicketTypesList;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
getProject() {
|
|
|
|
|
const request = {
|
|
|
|
|
@ -138,10 +173,11 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
handlegetProjectResult(result) {
|
|
|
|
|
this.Projectresult = result.Mohemm_Itg_ProjectsList;
|
|
|
|
|
this.projctid=this.Projectresult[0].projectId
|
|
|
|
|
this.getProjectDepartments();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////
|
|
|
|
|
getProjectDepartments() {
|
|
|
|
|
const request = {
|
|
|
|
|
EmployeeNumber: "",
|
|
|
|
|
@ -156,14 +192,15 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
handlegetProjectDepartmentsResult(result) {
|
|
|
|
|
this.departTypeList = result.Mohemm_ITG_ProjectDepartmentsList;
|
|
|
|
|
this.getDepartmentSections();
|
|
|
|
|
// this.getDepartmentSections();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
getDepartmentSections() {
|
|
|
|
|
getDepartmentSections(value=null) {
|
|
|
|
|
const request = {
|
|
|
|
|
EmployeeNumber: "",
|
|
|
|
|
ItgProjectDepartmentId: this.departTypeList.projectDepartmentId,
|
|
|
|
|
ItgProjectDepartmentId: value ?value : this.departTypeList.projectDepartmentId,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
@ -175,13 +212,14 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
handlegetDepartmentSectionsResult(result) {
|
|
|
|
|
this.sectionTypeList = result.Mohemm_ITG_DepartmentSectionsList;
|
|
|
|
|
|
|
|
|
|
this.getSectionTopics();
|
|
|
|
|
// this.getSectionTopics();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getSectionTopics() {
|
|
|
|
|
getSectionTopics(value=null) {
|
|
|
|
|
const request = {
|
|
|
|
|
EmployeeNumber: "",
|
|
|
|
|
ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
|
|
|
|
|
// ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
|
|
|
|
|
ItgDepartmentSectionId: value ?value : this.sectionTypeList.departmentSectionId,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
@ -197,107 +235,37 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************Create Ticket Function*************/
|
|
|
|
|
|
|
|
|
|
// getTicketDetails(){
|
|
|
|
|
// const request = {
|
|
|
|
|
// EmployeeNumber:'',
|
|
|
|
|
// ItgTicketId:this.teckitDetial.ticketId,
|
|
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
// this.MowadhafiService.getTicketDetails(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
|
|
|
|
// {
|
|
|
|
|
// this.handlegetTicketDetailsResult(result);
|
|
|
|
|
|
|
|
|
|
// }) }
|
|
|
|
|
// handlegetTicketDetailsResult(result){
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
CreateTicket() {
|
|
|
|
|
|
|
|
|
|
var authUser =this.authService.getAuthenticatedRequest();
|
|
|
|
|
this.cs.startLoading();
|
|
|
|
|
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('ticketTypeId', this.SelectedServiceType);
|
|
|
|
|
request.append('projectId', this.projctid);
|
|
|
|
|
request.append('departmentId', this.depType);
|
|
|
|
|
request.append('sectionId', this.secType);
|
|
|
|
|
request.append('sectionTopicId', this.topicType);
|
|
|
|
|
request.append('description', this.Description);
|
|
|
|
|
request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
|
|
|
|
|
request.append('employeeNumber', '13777');
|
|
|
|
|
request.append('employeeNumber', authUser.P_USER_NAME);
|
|
|
|
|
request.append('ticketStatus', 'new');
|
|
|
|
|
request.append('Channel', '31');
|
|
|
|
|
request.append('channelId', '1');
|
|
|
|
|
request.append('LogInToken', 'test');
|
|
|
|
|
request.append('Token', '@dm!n');
|
|
|
|
|
request.append('EmployeeNumber', '13777');
|
|
|
|
|
request.append('MobileNo', '0567');
|
|
|
|
|
request.append('channelId', '3');
|
|
|
|
|
request.append('Channel', authUser.Channel.toString());
|
|
|
|
|
request.append('LogInToken', authUser.LogInTokenID);
|
|
|
|
|
request.append('Token', authUser.TokenID);
|
|
|
|
|
request.append('EmployeeNumber', authUser.P_USER_NAME);
|
|
|
|
|
request.append('MobileNo', authUser.MobileNumber);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
this.handlegetCreateTicketResult(result);
|
|
|
|
|
this.checkERM('After Service Submission');
|
|
|
|
|
//hear you have to redirect page
|
|
|
|
|
|
|
|
|
|
this.cs.openMyRequestPage();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
handlegetCreateTicketResult(result) {
|
|
|
|
|
@ -341,10 +309,6 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// onFileSelected(event) {
|
|
|
|
|
// //event.target.value = '';
|
|
|
|
|
// this.selectedFile = event;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onFileSelected(input) {
|
|
|
|
|
@ -357,7 +321,7 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
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)
|
|
|
|
|
@ -376,7 +340,7 @@ export class HrRequestFormComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pushObject(fileData, name, type) {
|
|
|
|
|
// console.log("before push: "+ this.index);
|
|
|
|
|
|
|
|
|
|
this.indexLastObj++;
|
|
|
|
|
try {
|
|
|
|
|
let array = name.split(".");
|
|
|
|
|
|