bug fixes

enad-pre-live
Sultan Khan 4 years ago
parent 2a6f520d2b
commit 43c8feeb4e

@ -5,8 +5,6 @@
backlink="false" backlink="false"
[headerText]="'general,filter-offers' | translate"> [headerText]="'general,filter-offers' | translate">
</app-generic-header> </app-generic-header>
<ion-content> <ion-content>
<div class="container-icon" *ngIf="categories.length>0"> <div class="container-icon" *ngIf="categories.length>0">
@ -15,14 +13,12 @@
{{key.title}} {{key.title}}
</ion-label> </ion-label>
<ion-label *ngIf="direction =='rtl'"> <ion-label *ngIf="direction =='rtl'">
{{key.title_ar}} {{key.title_Ar}}
</ion-label> </ion-label>
<ion-thumbnail slot="start"> <ion-thumbnail slot="start">
<div class="top-filter" [innerHTML]="key.content | sanitizeHTMLPipe"></div> <div class="top-filter" [innerHTML]="key.content | sanitizeHTMLPipe"></div>
</ion-thumbnail> </ion-thumbnail>
</ion-item> </ion-item>
</div> </div>
<ion-footer > <ion-footer >

@ -527,3 +527,6 @@ select option[data-default] {
.button-native { .button-native {
box-shadow: none!important; box-shadow: none!important;
} }
.gridAH{
text-align: justify;
}

@ -54,9 +54,9 @@ export class HrRequestFormComponent implements OnInit {
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;
@ -73,14 +73,14 @@ export class HrRequestFormComponent implements OnInit {
"application/vnd.ms-excel", "application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
]; ];
projctid:any; projctid: any;
employeeNumber:any; employeeNumber: any;
ticketType: any =[]; ticketType: any = [];
public direction: string; public direction: string;
HRServices = ''; HRServices = '';
Complaints=''; Complaints = '';
Inquiry=''; Inquiry = '';
input = document.getElementById ("firstLabel"); input = document.getElementById("firstLabel");
@ -100,7 +100,7 @@ export class HrRequestFormComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.projectCode = this.cs.sharedService.getSharedData("projcet-code",false); this.projectCode = this.cs.sharedService.getSharedData("projcet-code", false);
this.getTicketTypes(); this.getTicketTypes();
this.getProject(); this.getProject();
@ -110,10 +110,10 @@ export class HrRequestFormComponent implements OnInit {
public isValidForm(): boolean { public isValidForm(): boolean {
if (this.depType && this.SelectedServiceType && this.secType && this.topicType) { if (this.depType && this.SelectedServiceType && this.secType && this.topicType) {
return false; return false;
} }
return true; return true;
} }
onSelectChange(event, type) { onSelectChange(event, type) {
@ -121,20 +121,20 @@ export class HrRequestFormComponent implements OnInit {
console.log(value); console.log(value);
// this.topicTypeList =[]; // this.topicTypeList =[];
// this.sectionTypeList =[]; // this.sectionTypeList =[];
if(type==1){ if (type == 1) {
this.depType = value; this.depType = value;
this.sectionTypeList =[]; this.sectionTypeList = [];
this.topicTypeList =[]; this.topicTypeList = [];
this.getDepartmentSections(value); this.getDepartmentSections(value);
}else if(type==2){ } else if (type == 2) {
this.getSectionTopics(value); this.getSectionTopics(value);
this.topicTypeList =[]; this.topicTypeList = [];
} }
} }
onFileSelectedclick(event){ onFileSelectedclick(event) {
event.target.value = ''; event.target.value = '';
} }
@ -158,7 +158,7 @@ export class HrRequestFormComponent implements OnInit {
}) })
} }
handlegetTicketTypesResult(result) { handlegetTicketTypesResult(result) {
this.ticketType =result.Mohemm_Itg_TicketTypesList; this.ticketType = result.Mohemm_Itg_TicketTypesList;
} }
@ -177,11 +177,11 @@ export class HrRequestFormComponent implements OnInit {
} }
handlegetProjectResult(result) { handlegetProjectResult(result) {
this.Projectresult = result.Mohemm_Itg_ProjectsList; this.Projectresult = result.Mohemm_Itg_ProjectsList;
this.projctid=this.Projectresult[0].projectId; this.projctid = this.Projectresult[0].projectId;
this.getProjectDepartments(); this.getProjectDepartments();
} }
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
getProjectDepartments() { getProjectDepartments() {
const request = { const request = {
EmployeeNumber: "", EmployeeNumber: "",
@ -204,7 +204,7 @@ export class HrRequestFormComponent implements OnInit {
getDepartmentSections(value) { getDepartmentSections(value) {
const request = { const request = {
EmployeeNumber: "", EmployeeNumber: "",
ItgProjectDepartmentId: value ?value : this.departTypeList.projectDepartmentId, ItgProjectDepartmentId: value ? value : this.departTypeList.projectDepartmentId,
}; };
@ -218,11 +218,11 @@ export class HrRequestFormComponent implements OnInit {
// this.getSectionTopics(); // this.getSectionTopics();
} }
getSectionTopics(value=null) { getSectionTopics(value = null) {
const request = { const request = {
EmployeeNumber: "", EmployeeNumber: "",
// ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId, // ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
ItgDepartmentSectionId: value ?value : this.sectionTypeList.departmentSectionId, ItgDepartmentSectionId: value ? value : 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) => {
@ -238,41 +238,57 @@ export class HrRequestFormComponent implements OnInit {
} }
/*******************Create Ticket Function*************/ /*******************Create Ticket Function*************/
CreateTicket() { CreateTicket() {
var authUser =this.authService.getAuthenticatedRequest(); var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading(); this.cs.startLoading();
var request = new FormData(); // var request = new FormData();
request.append('ticketTypeId', this.SelectedServiceType); // request.append('ticketTypeId', this.SelectedServiceType);
request.append('projectId', this.projctid); // request.append('projectId', this.projctid);
request.append('departmentId', this.depType); // request.append('departmentId', this.depType);
request.append('sectionId', this.secType); // request.append('sectionId', this.secType);
request.append('sectionTopicId', this.topicType); // request.append('sectionTopicId', this.topicType);
request.append('description', this.Description); // request.append('description', this.Description);
console.log("TEST:______")
console.log(this.selectedFile); // if(this.selectedFile && this.selectedFile !== undefined){
if(this.selectedFile && this.selectedFile !== undefined){ // request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name); // }
} // request.append('employeeNumber', authUser.P_USER_NAME);
request.append('employeeNumber', authUser.P_USER_NAME); // request.append('ticketStatus', 'new');
request.append('ticketStatus', 'new'); // request.append('channelId', '3');
request.append('channelId', '3'); // request.append('Channel', authUser.Channel.toString());
request.append('Channel', authUser.Channel.toString()); // request.append('LogInToken', authUser.LogInTokenID);
request.append('LogInToken', authUser.LogInTokenID); // request.append('Token', authUser.TokenID);
request.append('Token', authUser.TokenID); // request.append('EmployeeNumber', authUser.P_USER_NAME);
request.append('EmployeeNumber', authUser.P_USER_NAME); // request.append('MobileNo', authUser.MobileNumber);
request.append('MobileNo', authUser.MobileNumber);
var request = {
"TokenID": authUser.LogInTokenID, "EmployeeNumber": authUser.P_USER_NAME, "ItgImageCollList": this.addAttachRequest,
"ticketTypeId": this.SelectedServiceType,
"projectId": this.projctid,
"departmentId": this.depType,
"sectionId": this.secType,
"sectionTopicId": this.topicType,
"description": this.Description,
"employeeNumber": authUser.P_USER_NAME,
"ticketStatus": "new",
"channelId": 3,
"Channel": authUser.Channel.toString(),
"LogInToken": authUser.LogInTokenID,
"Token": authUser.TokenID,
"MobileNo": authUser.MobileNumber,
}
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if(this.cs.validResponse(result)){ if (this.cs.validResponse(result)) {
this.cs.stopLoading(); this.cs.stopLoading();
this.checkERM('After Service Submission'); this.checkERM('After Service Submission');
this.cs.greenToastPK("general", "success-create"); this.cs.greenToastPK("general", "success-create");
this.cs.openMyRequestPage(); this.cs.openMyRequestPage();
}else{ } else {
this.cs.stopLoading(); this.cs.stopLoading();
this.cs.redToastPK("general", "try-again"); this.cs.redToastPK("general", "try-again");
} }
@ -355,11 +371,14 @@ export class HrRequestFormComponent implements OnInit {
let attachType: string = array[array.length - 1]; let attachType: string = array[array.length - 1];
this.addAttachRequest.push({ this.addAttachRequest.push({
AttachmentID: this.indexLastObj, // AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1], // P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1], // P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0], // P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID // P_TRANSACTION_ID: this.TransactionID
Base64Data: fileData.split(",")[1],
FileName: name,
ContentType: 'image/' + attachType
}); });
} catch (e) { } } catch (e) { }
} }

@ -19,7 +19,7 @@ export class MowadhafiService {
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_CreateTicketMobile';
constructor( constructor(
public con: ConnectorService, public con: ConnectorService,
@ -108,16 +108,17 @@ export class MowadhafiService {
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;
const HttpUploadOptions = { return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel);
headers: new HttpHeaders({ "Content-Type": "multipart/form-data", }) // const HttpUploadOptions = {
} // headers: new HttpHeaders({ "Content-Type": "multipart/form-data", })
// }
// return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); // return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel);
return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, { //return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, {
// reportProgress: true, // reportProgress: true,
// observe: 'events' // observe: 'events'
} //}
) // )
} }
} }

@ -115,11 +115,17 @@ export class HomeComponent implements AfterViewInit {
if (data['data']) { if (data['data']) {
var parseJSON = data['data']; var parseJSON = data['data'];
var offers = JSON.parse(parseJSON); var offers = JSON.parse(parseJSON);
this.offersData = offers; console.log(offers);
this.offersData = this.filterActiveItems(offers);
console.log(this.offersData);
this.tempSearch = this.offersData; this.tempSearch = this.offersData;
} }
} }
filterActiveItems(offers) {
return offers.filter((res) => {
return res['IsActive'] == 'True';
});
}
filterOffers(key) { filterOffers(key) {
if (this.direction === 'ltr') { if (this.direction === 'ltr') {
this.activeClass = key.categoryName_en; this.activeClass = key.categoryName_en;
@ -181,7 +187,8 @@ export class HomeComponent implements AfterViewInit {
this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter, this.itemType).subscribe((res) => { this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter, this.itemType).subscribe((res) => {
const data = JSON.parse(res['Mohemm_ITG_ResponseItem']); const data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
if (data['result']) { if (data['result']) {
const allItem = JSON.parse(data.result['data']); var allItem = JSON.parse(data.result['data']);
allItem = this.filterActiveItems(allItem);
if (allItem) { if (allItem) {
allItem.forEach(element => { allItem.forEach(element => {
this.offersData.push(element); this.offersData.push(element);

Loading…
Cancel
Save