hr request

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 5 years ago
parent cdc81881f5
commit 8a5e9f25e7

@ -145,7 +145,7 @@
<ion-footer >
<div class="centerDiv">
<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>
</ion-footer>

@ -95,7 +95,7 @@ export class HrRequestFormComponent implements OnInit {
this.getTicketsByEmployee();
this.getTicketTypes();
this.getProject();
this.getCreateTicket();
//this.getCreateTicket();
}
@ -112,11 +112,11 @@ export class HrRequestFormComponent implements OnInit {
EmployeeNumber: "",
};
this.MowadhafiService.getTicketTypes(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.MowadhafiService.getTicketTypes(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetTicketTypesResult(result);
}) }
})
}
handlegetTicketTypesResult(result) {
this.HR = result.Mohemm_Itg_TicketTypesList[0].typeName;
this.complaints = result.Mohemm_Itg_TicketTypesList[1].typeName;
@ -130,11 +130,11 @@ getProject(){
ItgProjectCode: this.projectCode
};
this.MowadhafiService.getProject(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.MowadhafiService.getProject(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetProjectResult(result);
}) }
})
}
handlegetProjectResult(result) {
this.Projectresult = result.Mohemm_Itg_ProjectsList;
this.getProjectDepartments();
@ -148,11 +148,11 @@ getProjectDepartments(){
};
this.MowadhafiService.getProjectDepartments(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.MowadhafiService.getProjectDepartments(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetProjectDepartmentsResult(result);
}) }
})
}
handlegetProjectDepartmentsResult(result) {
this.departTypeList = result.Mohemm_ITG_ProjectDepartmentsList;
this.getDepartmentSections();
@ -166,11 +166,11 @@ getDepartmentSections(){
};
this.MowadhafiService.getDepartmentSections(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.MowadhafiService.getDepartmentSections(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetDepartmentSectionsResult(result);
}) }
})
}
handlegetDepartmentSectionsResult(result) {
this.sectionTypeList = result.Mohemm_ITG_DepartmentSectionsList;
@ -183,11 +183,11 @@ getSectionTopics(){
ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
};
this.MowadhafiService.getSectionTopics(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetSectionTopicsResult(result);
}) }
})
}
handlegetSectionTopicsResult(result) {
// this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName
this.topicTypeList = result.Mohemm_ITG_SectionTopicsList;
@ -273,28 +273,27 @@ getSectionTopics(){
// };
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('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.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetCreateTicketResult(result);
}) }
})
}
handlegetCreateTicketResult(result) {
@ -336,10 +335,10 @@ public uploader: FileUploader = new FileUploader({
});
onFileSelectedclick(event){
//event.target.value = '';
this.selectedFile = event;
}
// onFileSelected(event) {
// //event.target.value = '';
// this.selectedFile = event;
// }
onFileSelected(input) {
@ -351,7 +350,7 @@ onFileSelected(input) {
} // 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 =>

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { HttpClient, HttpHeaders } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
@ -23,7 +23,8 @@ export class MowadhafiService {
constructor(
public con: ConnectorService,
private authService: AuthenticationService
private authService: AuthenticationService,
public http: HttpClient
) { }
public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string) {
const request = absence;
@ -105,6 +106,16 @@ export class MowadhafiService {
const request = absence;
this.authService.authenticateRequest(request);
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