-
-
-
+
+
+
+
-
Fashion & Beauty
+
{{category.title}}
+
{{category.title_Ar}}
+
-
-
-
+
+
+
+
+
+
-
-
- Furniture Table
+
+
+ {{item.title}}
+ {{item.title_Ar}}
+
- Keep close to Nature's heart... and break
-
- Used
-
+ {{getDotted(item.description, 60)}}
+ {{getDotted(item.description_Ar, 60)}}
+ {{item.status}}
- 500 SAR
+ {{item.quotePrice}} {{item.currencyCode}}
@@ -114,62 +90,55 @@
-
-
-
-
+
+
+
+
+
- Furniture Table
-
-
-
- Keep close to Nature's heart... and break
-
- New
-
-
-
-
- 500 SAR
-
-
-
-
-
-
-
-
-
-
+
+
{{ts.trPK('general','empty')}}
+
+
+
+
+
-
+
-
+
+
- Furniture Table
-
- Posted on 24 April 2021
-
- good condition only 6th month used
+ {{item.title}}
+ {{item.title_Ar}}
+
+ {{getDate(item.created) }}
+
+ {{getDotted(item.description, 30)}}
+ {{getDotted(item.description_Ar, 30)}}
- Pending Review
+ {{item.status}}
+
-
-
+
+
+
diff --git a/Mohem/src/app/itemforsale/items/items.component.scss b/Mohem/src/app/itemforsale/items/items.component.scss
index bcba7e10..f8c6c061 100644
--- a/Mohem/src/app/itemforsale/items/items.component.scss
+++ b/Mohem/src/app/itemforsale/items/items.component.scss
@@ -7,9 +7,20 @@
background: #259CB8;
top: 0;
}
+.no-dataDiv{
+ position: absolute;
+ left: 0;
+ right: 0;
+ margin: auto;
+}
.header-toolbar{
--background: #259CB8 !important;
}
+.top{
+ position: relative;
+ margin: 5px 10px;
+
+}
.bottom{
height: 100%;
width: 100%;
@@ -51,7 +62,10 @@
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
- font-size: 14px;
+ font-size: 12px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
}
.bottom-icon{
text-overflow: clip;
@@ -69,7 +83,8 @@ ion-card-title{
font-weight: bold;
font-size: 14px;
- padding: 5px
+ padding: 5px;
+ height: 40px;
}
.orange{
color: #CC9B14;
@@ -88,9 +103,9 @@ ion-card-content p{
font-weight: bold;
}
.my-ads ion-item{
- margin: 10px;
+ margin:0px 10px;
--border-radius: 10px;
- padding: 15px 10px 0px 10px;
+ padding: 10px 10px 0px 10px;
width: 100%;
}
.my-ads ion-thumbnail img{
@@ -112,9 +127,10 @@ ion-segment-button{
}
ion-segment-button ion-label{
padding: 0;
- font-size: 16px;
+ font-size: 14px;
white-space: normal;
font-weight: bold;
+ line-height: 1.1;
}
.segment-button-checked ion-label{
color: #fff !important;
@@ -132,6 +148,7 @@ ion-item h3{
color: #000;
font-weight: bold;
font-size: 14px;
+ margin-top:10px;
}
.yellow{
color:#CC9B14;
@@ -145,6 +162,10 @@ ion-item .icon{
position: absolute;
right: 0px;
}
+.edit-ar{
+ position: absolute;
+ left: 0px;
+}
.fab-button{
position: fixed;
bottom: 5%;
@@ -155,7 +176,7 @@ ion-item .icon{
--background: #259CB8;
}
ion-footer{
- position: absolute;
+ position: fixed;
bottom: 0;
}
ion-footer .footer-button{
@@ -219,4 +240,42 @@ ion-fab-button{
}
.grid-row{
margin:10px;
+}
+
+.active .top::before{
+ position: absolute;
+ right: 0px;
+ top: 2px;
+ padding: 0px;
+ background: #3cc353;
+ padding: 2px 3px 4px 3px;
+ border-radius: 60%;
+ font-size: 10px;
+ color: #fff;
+ content: '✓';
+ width: 12px;
+ height: 12px;
+ text-align: center;
+}
+.space{
+ height:100px;
+}
+.loader{
+ display: block;
+ position: absolute;
+ margin: auto;
+ text-align: center;
+ width: 100%;
+}
+.loader img{
+ display: inline-block;
+ margin: auto;
+ width: 25px;
+
+}
+.description-cont{
+ min-height: 60px;
+ height: 65px;
+ overflow: hidden;
+ font-size: 14px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/itemforsale/items/items.component.ts b/Mohem/src/app/itemforsale/items/items.component.ts
index 73fc2398..a98e1105 100644
--- a/Mohem/src/app/itemforsale/items/items.component.ts
+++ b/Mohem/src/app/itemforsale/items/items.component.ts
@@ -1,6 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { ItemForSaleService } from '../services/service.service';
+import { deepCopy } from '@angular-devkit/core/src/utils/object';
+import * as moment from 'moment';
+import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
+import { ActivatedRoute } from '@angular/router';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
@Component({
selector: 'app-items',
@@ -9,17 +15,157 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class ItemsComponent implements OnInit {
segment: any = '1';
- constructor(public ts: TranslatorService, public cs: CommonService,) { }
+ items: any;
+ categories: any = [];
+ direction: string;
+ activeClass: any;
+ pageNo: number = 1;
+ tempSearch: any = [];
+ itemsByEmployee: any = [];
+ allCategory = {
+ categoryID: 0,
+ content: '
',
+ isActive: true,
+ title: "All",
+ title_Ar: "الجميع",
+ }
+ constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService, private authService: AuthenticationService) {
+ this.route
+ .params.subscribe(val => {
+ setTimeout(() => {
+ this.cs.startLoading();
+ var selectedFilter = this.cs.sharedService.getSharedData(ItemForSaleService.selected_filters);
+ if (selectedFilter) {
+ this.selectCategory(selectedFilter);
+ }
+ else {
+ this.getItemsCategories();
+ this.getItemsByEmployee();
+ }
+
+
+ }, 100);
+ });
+
+ }
+
- ngOnInit() { }
- openDetails() {
+ ngOnInit() {
+ this.direction = TranslatorService.getCurrentDirection();
+
+ }
+ getItemsCategories() {
+
+ this.itemService.getCategories({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.categories = this.itemService.parser(result);
+ this.categories.unshift(this.allCategory);
+ this.cs.sharedService.setSharedData(this.categories, ItemForSaleService.CATEGORIES);
+ })
+ this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.items = [];
+ this.items = this.itemService.parser(result);
+ this.tempSearch = deepCopy(this.items);
+ console.log(this.tempSearch);
+ this.cs.stopLoading();
+ })
+ }
+ openDetails(selected) {
+ this.cs.sharedService.setSharedData(selected, ItemForSaleService.ITEMS_SELECTED);
this.cs.navigateForward('/itemforsale/items-details');
}
segmentChanged(value) {
this.segment = value.detail.value;
}
openSale() {
- this.cs.navigateForward('/itemforsale/home');
+ this.cs.openCreateitems();
+ }
+ selectCategory(item) {
+ this.cs.startLoading();
+ this.activeClass = item.categoryID;
+ this.pageNo = 1;
+ this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.items = [];
+ this.items = this.itemService.parser(result);
+ this.tempSearch = deepCopy(this.items);
+ this.cs.stopLoading();
+ })
+ }
+ getDotted(temp: string, valueCount: number) {
+ temp = this.stripHtml(temp);
+ return temp.substring(0, valueCount) + " ...";
+ }
+ stripHtml(html) {
+ var temporalDivElement = document.createElement("div");
+
+ temporalDivElement.innerHTML = html;
+
+ return temporalDivElement.textContent || temporalDivElement.innerText || "";
}
+ loadData(event) {
+ this.pageNo = this.pageNo + 1;
+ this.itemService.getItems({ pageNo: this.pageNo, categoryID: this.activeClass }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.items.concat(this.itemService.parser(result));
+ this.tempSearch = deepCopy(this.items);
+ event.target.complete();
+ })
+ }
+ search(t) {
+ if (t === '') {
+ this.items = this.tempSearch;
+ } else {
+ this.items = this.tempSearch.filter((post) => {
+ if (this.direction == 'ltr')
+ return (post.title.toLowerCase().indexOf(t.toLowerCase()) > -1);
+ else
+ return (post.title_Ar.indexOf(t) > -1);
+ });
+ }
+
+ }
+ getItemsByEmployee() {
+
+ this.cs.startLoading();
+ this.itemService.getItemsByEmployee({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.itemsByEmployee = this.itemService.parser(result);
+
+ this.cs.stopLoading();
+ console.log(this.itemsByEmployee);
+ })
+ }
+
+ getDate(date) {
+ return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
+ }
+
+ getImgContent(imgFile): SafeUrl {
+ return this.sanitizer.bypassSecurityTrustUrl(imgFile);
+ }
+ editItems(items) {
+ this.cs.sharedService.setSharedData(items, ItemForSaleService.EDIT_ITEMS);
+ this.cs.openCreateitems();
+ }
+ deleteItems(item) {
+ var authUser = this.authService.getAuthenticatedRequest();
+ this.cs.startLoading();
+ var request = new FormData();
+ request.append('itemSaleID', item.itemSaleID);
+ request.append('isActive', 'false');
+ 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);
+ request.append('employeeNumber', authUser.P_USER_NAME);
+ this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
+ if (this.cs.validResponse(result)) {
+ this.cs.greenToastPK('itemforsale', 'item-deleted');
+ this.getItemsByEmployee();
+
+ }
+ })
+ }
+ openModel() {
+ this.cs.filterItemforSale();
+ }
}
diff --git a/Mohem/src/app/itemforsale/services/domsafe.ts b/Mohem/src/app/itemforsale/services/domsafe.ts
new file mode 100644
index 00000000..79b677ac
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/domsafe.ts
@@ -0,0 +1,15 @@
+import { Pipe, PipeTransform } from "@angular/core";
+import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
+
+@Pipe({
+ name: 'sanitizeHTMLPipe'
+})
+export class SanitizeHtmlPipe implements PipeTransform {
+
+ constructor(private _sanitizer: DomSanitizer) {
+ }
+
+ transform(v: string): SafeHtml {
+ return this._sanitizer.bypassSecurityTrustHtml(v);
+ }
+}
\ No newline at end of file
diff --git a/Mohem/src/app/itemforsale/services/service.service.spec.ts b/Mohem/src/app/itemforsale/services/service.service.spec.ts
new file mode 100644
index 00000000..99221043
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/service.service.spec.ts
@@ -0,0 +1,12 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ItemForSaleService } from './service.service';
+
+describe('ServiceService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: ItemForSaleService = TestBed.get(ItemForSaleService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/itemforsale/services/service.service.ts b/Mohem/src/app/itemforsale/services/service.service.ts
new file mode 100644
index 00000000..222e776c
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/service.service.ts
@@ -0,0 +1,87 @@
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+import { MowadhafiService } from 'src/app/mowadhafi/mowadhafi.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ItemForSaleService {
+ public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
+ public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
+ public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
+ public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSaleMobile';
+ public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale';
+ public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion';
+ public static ITEMS_SELECTED = 'item-selected';
+ public static CATEGORIES = 'categories';
+ public static EDIT_ITEMS = 'edit-items';
+ public static selected_filters = 'selected_filter';
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService,
+ private http: HttpClient
+ ) { }
+ public getItems(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+ request.ItgPageNo = request.pageNo;
+ request.ItgPageSize = 10;
+ request.ItgStatus = "Approved";
+ return this.con.postNoLoad(ItemForSaleService.getItemForSale, request, onError, errorLabel);
+ }
+
+ public getCategories(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+
+ return this.con.postNoLoad(ItemForSaleService.getCategories, request, onError, errorLabel);
+ }
+
+
+
+ parser(response: any) {
+ try {
+ var result = JSON.parse(response.Mohemm_ITG_ResponseItem);
+ if (result.result)
+ return result.result.data
+ else
+ return {}
+ } catch (res) {
+ console.log(res);
+ }
+ }
+
+ getItemsByEmployee(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+ request.ItgEmployeeNumber = request.UserName; //request.UserName;
+ return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel);
+ }
+ getRegion(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+ request.ItgEmployeeNumber = request.UserName; //request.UserName;
+ return this.con.post(ItemForSaleService.getRegion, request, onError, errorLabel);
+ }
+
+ createItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
+ const request = itemRequest;
+ this.authService.authenticateRequest(request);
+ request.employeeNumber = request.P_USER_NAME;
+ //return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
+ return this.con.post(ItemForSaleService.createItemForSale, request, onError, errorLabel);
+ //}
+ //)
+ }
+ updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
+ const request = itemRequest;
+ this.authService.authenticateRequest(request);
+ request.employeeNumber = request.P_USER_NAME;
+ return this.http.post(ConnectorService.host + ItemForSaleService.updateItemForSale, itemRequest, {
+
+ }
+ )
+ }
+}
diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss
index c0f5006c..60613fd8 100644
--- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss
+++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss
@@ -526,4 +526,7 @@ select option[data-default] {
.button-native {
box-shadow: none!important;
+ }
+ .gridAH{
+ text-align: justify;
}
\ No newline at end of file
diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts
index 70c5c7e0..1ec8c7ed 100644
--- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts
+++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts
@@ -35,7 +35,7 @@ export class HrRequestFormComponent implements OnInit {
public searchKeySelect = 'Complaints';
myColor: string = 'secondary';
public showRequestDetails = false;
- public proID = "HMG"
+ public proID = "CS"
public inquiry: string;
public HR: string;
public complaints: string;
@@ -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,17 +73,17 @@ export class HrRequestFormComponent implements OnInit {
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
];
- projctid:any;
- employeeNumber:any;
- ticketType: any =[];
+ projctid: any;
+ employeeNumber: any;
+ ticketType: any = [];
public direction: string;
HRServices = '';
- Complaints='';
- Inquiry='';
- input = document.getElementById ("firstLabel");
-
-
-
+ Complaints = '';
+ Inquiry = '';
+ input = document.getElementById("firstLabel");
+
+
+
constructor(
public ts: TranslatorService,
public cs: CommonService,
@@ -100,20 +100,20 @@ export class HrRequestFormComponent implements OnInit {
}
ngOnInit() {
- this.projectCode = this.cs.sharedService.getSharedData("projcet-code",false);
+ this.projectCode = this.cs.sharedService.getSharedData("projcet-code", false);
this.getTicketTypes();
this.getProject();
-
+
}
-
+
public isValidForm(): boolean {
if (this.depType && this.SelectedServiceType && this.secType && this.topicType) {
- return false;
+ return false;
}
return true;
-}
+ }
onSelectChange(event, type) {
@@ -121,20 +121,20 @@ export class HrRequestFormComponent implements OnInit {
console.log(value);
// this.topicTypeList =[];
// this.sectionTypeList =[];
- if(type==1){
+ if (type == 1) {
this.depType = value;
- this.sectionTypeList =[];
- this.topicTypeList =[];
+ this.sectionTypeList = [];
+ this.topicTypeList = [];
this.getDepartmentSections(value);
-
- }else if(type==2){
+
+ } else if (type == 2) {
this.getSectionTopics(value);
- this.topicTypeList =[];
+ this.topicTypeList = [];
}
-
- }
- onFileSelectedclick(event){
+ }
+
+ onFileSelectedclick(event) {
event.target.value = '';
}
@@ -158,8 +158,8 @@ export class HrRequestFormComponent implements OnInit {
})
}
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) {
this.Projectresult = result.Mohemm_Itg_ProjectsList;
- this.projctid=this.Projectresult[0].projectId;
+ this.projctid = this.Projectresult[0].projectId;
this.getProjectDepartments();
}
-////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////
getProjectDepartments() {
const request = {
EmployeeNumber: "",
@@ -204,7 +204,7 @@ export class HrRequestFormComponent implements OnInit {
getDepartmentSections(value) {
const request = {
EmployeeNumber: "",
- ItgProjectDepartmentId: value ?value : this.departTypeList.projectDepartmentId,
+ ItgProjectDepartmentId: value ? value : this.departTypeList.projectDepartmentId,
};
@@ -218,11 +218,11 @@ export class HrRequestFormComponent implements OnInit {
// this.getSectionTopics();
}
- getSectionTopics(value=null) {
+ getSectionTopics(value = null) {
const request = {
EmployeeNumber: "",
// 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) => {
@@ -238,41 +238,57 @@ export class HrRequestFormComponent implements OnInit {
}
- /*******************Create Ticket Function*************/
+ /*******************Create Ticket Function*************/
CreateTicket() {
-
- var authUser =this.authService.getAuthenticatedRequest();
+
+ var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
- var request = new FormData();
- 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);
- console.log("TEST:______")
- console.log(this.selectedFile);
- if(this.selectedFile && this.selectedFile !== undefined){
- request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
- }
- request.append('employeeNumber', authUser.P_USER_NAME);
- request.append('ticketStatus', 'new');
- 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);
+ // var request = new FormData();
+ // 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);
+
+ // if(this.selectedFile && this.selectedFile !== undefined){
+ // request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
+ // }
+ // request.append('employeeNumber', authUser.P_USER_NAME);
+ // request.append('ticketStatus', 'new');
+ // 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);
+
+ 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) => {
- if(this.cs.validResponse(result)){
+ if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.checkERM('After Service Submission');
this.cs.greenToastPK("general", "success-create");
this.cs.openMyRequestPage();
- }else{
+ } else {
this.cs.stopLoading();
this.cs.redToastPK("general", "try-again");
}
@@ -329,7 +345,7 @@ export class HrRequestFormComponent implements OnInit {
else {
const file = input.target.files[0];
this.selectedFile = input.target.files;
-
+
this.getBase64(file).then(data =>
this.pushObject(data, file.name, file.type)
@@ -348,18 +364,21 @@ export class HrRequestFormComponent implements OnInit {
}
pushObject(fileData, name, type) {
-
+
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
+ // 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
+ Base64Data: fileData.split(",")[1],
+ FileName: name,
+ ContentType: 'image/' + attachType
});
} catch (e) { }
}
diff --git a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss
index 3999867e..9a786617 100644
--- a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss
+++ b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss
@@ -176,6 +176,7 @@
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
+ line-height: 20px;
}
diff --git a/Mohem/src/app/mowadhafi/mowadhafi.service.ts b/Mohem/src/app/mowadhafi/mowadhafi.service.ts
index 8976393b..2a34d1d8 100644
--- a/Mohem/src/app/mowadhafi/mowadhafi.service.ts
+++ b/Mohem/src/app/mowadhafi/mowadhafi.service.ts
@@ -19,7 +19,7 @@ export class MowadhafiService {
public static getTicketStatisticsByEmp = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee';
public static getTicketTransaction = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction';
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(
public con: ConnectorService,
@@ -108,16 +108,17 @@ export class MowadhafiService {
const request = absence;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
- const HttpUploadOptions = {
- headers: new HttpHeaders({ "Content-Type": "multipart/form-data", })
- }
+ 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'
- }
- )
+ //return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, {
+ // reportProgress: true,
+ // observe: 'events'
+ //}
+ // )
}
}
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts
index 4469f7ec..98955dfd 100644
--- a/Mohem/src/app/my-team/details/details.component.ts
+++ b/Mohem/src/app/my-team/details/details.component.ts
@@ -235,7 +235,7 @@ export class DetailsComponent implements OnInit {
ngOnInit() {
this.common.startLoading();
this.intializeMemberDetail();
- this.showAttendanceTracking();
+ // this.showAttendanceTracking();
// tslint:disable-next-line: max-line-length
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
}
@@ -266,6 +266,7 @@ export class DetailsComponent implements OnInit {
if (this.activeSegment === 'Attendance') {
this.common.startLoading();
this.initAttendance();
+ this.showAttendanceTracking();
}
else if (this.activeSegment != 'Attendance' && this.activeSegment != 'TeamMembers') {
this.activeSegment = 'About';
diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html
index 2280064d..0cbb0cef 100644
--- a/Mohem/src/app/my-team/home/home.component.html
+++ b/Mohem/src/app/my-team/home/home.component.html
@@ -1,5 +1,6 @@
diff --git a/Mohem/src/app/my-team/my-team.module.ts b/Mohem/src/app/my-team/my-team.module.ts
index 49925b71..17fa5ede 100644
--- a/Mohem/src/app/my-team/my-team.module.ts
+++ b/Mohem/src/app/my-team/my-team.module.ts
@@ -10,6 +10,7 @@ import { MyTeamPage } from './my-team.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { from } from 'rxjs';
import { WorklistService } from '../notification/service/worklist.service';
+import { SubordinateLeaveComponent } from './subordinate-leave/subordinate-leave.component';
const routes: Routes = [
@@ -28,7 +29,10 @@ const routes: Routes = [
path: 'details-2',
component: DetailsComponent
},
-
+ {
+ path: 'subordinate-leave',
+ component: SubordinateLeaveComponent
+ }
]
}
@@ -44,7 +48,11 @@ const routes: Routes = [
],
providers: [WorklistService],
- declarations: [MyTeamPage, HomeComponent, DetailsComponent,
+ declarations: [
+ MyTeamPage,
+ HomeComponent,
+ DetailsComponent,
+ SubordinateLeaveComponent
]
})
export class MyTeamPageModule { }
diff --git a/Mohem/src/app/my-team/service/my-team.service.ts b/Mohem/src/app/my-team/service/my-team.service.ts
index 87507d70..81149b41 100644
--- a/Mohem/src/app/my-team/service/my-team.service.ts
+++ b/Mohem/src/app/my-team/service/my-team.service.ts
@@ -7,6 +7,7 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio
export class MyTeamService {
public static EMPLOYEE_SHARED_DATA = 'employee';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
+ public static getSubordintesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS';
// public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
@@ -20,6 +21,13 @@ export class MyTeamService {
return this.con.post(MyTeamService.getMyTeam, request, onError, errorLabel);
}
+ public getEmployeeSubordinatesLeave(absence: any, onError?: any, errorLabel?: string){
+ const request = absence;
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.post(MyTeamService.getSubordintesLeaves, request, onError, errorLabel);
+ }
+
// public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){
// const request = absence;
// this.authService.authenticateRequest(request);
diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html
new file mode 100644
index 00000000..8adf1dde
--- /dev/null
+++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+ {{ts.trPK('myTeam','select-duration')}}
+
+
+
+
+
+ {{ts.trPK('general','from')}}
+
+
+
+
+
+
+
+
+ {{ts.trPK('general','to')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('general','empty')}}
+
+
+
+
+
0'>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{user.EMPLOYEE_NAME}}
+ {{ts.trPK('general','from')}}: {{getDate(user.DATE_START)}}
+ {{ts.trPK('general','to')}}: {{getDate(user.DATE_END)}}
+
+ {{ts.trPK('myTeam','no-of-days')}}: {{diffDays(user)}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('general','submit')}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss
new file mode 100644
index 00000000..6a147428
--- /dev/null
+++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss
@@ -0,0 +1,199 @@
+.confirmEitOkButton{
+ white-space: normal !important;
+ text-transform: capitalize !important;
+ min-height: 45px !important;
+ min-width: 5px !important;
+ margin: 8px !important;
+ --background: #269DB8;
+ width: 80% !important;
+ color: white!important;
+ border-radius: 16px !important;
+ }
+
+ .team-member-container{
+ // background: white;
+ // border-radius: 100px 20px 20px 100px;
+ // margin-top: 15px;
+ // font-family: WorkSans-Regular;
+ // border: 1px solid #ccc;
+ // border-radius: 15px;
+ // padding-bottom: 8px;
+ background: white;
+ /* margin-top: 2px; */
+ font-family: WorkSans-Regular;
+ border: 1px solid #ccc;
+ border-radius: 15px;
+ padding-bottom: 8px;
+ padding-top: 9px;
+ margin-bottom: 7px;
+}
+
+// .user-image-container{
+// position: relative;
+// width: 70px;
+// height: 70px;
+// display: block;
+// margin: 0 auto;
+// &:before{
+// position: absolute;
+// content: "";
+// width: 20px;
+// height: 20px;
+// border-radius: 20px;
+// border: 1px solid white;
+// top: 0;
+// right: 0;
+// background-color: red;
+// z-index: 9;
+// }
+// &.present:before{
+// background-color: green !important;
+// }
+// }
+.user-image{
+ // overflow: hidden;
+ // position: relative;
+ // display: block;
+ // width: 100%;
+ // height: 100%;
+ // border-radius: 80px;
+ // border: 1px solid #ccc;
+ // margin: 0px auto 6px;
+
+ img {
+ // width: 100%;
+ // max-height: 100%;
+ width: 74%;
+ max-height: 74%;
+ margin-top: 7px;
+ margin-left: 6px;
+ }
+}
+
+.employee-name{
+ display: inline-block;
+ width: 80%;
+ .name{
+ // font-size: 16px;
+ // color: black;
+ // // margin: 0;
+ // width: 100%;
+ // text-overflow: ellipsis;
+ // white-space: nowrap;
+ // overflow: hidden;
+ // margin-left: -10px;
+ // margin-top: -5px;
+ // font-family: 'WorkSans-Bold';
+ font-size: 16px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin-left: -10px;
+ margin-top: -5px;
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 25px;
+ letter-spacing: -0.64px;
+ color: #2B353E;
+ opacity: 1;
+ }
+
+ .title{
+ // font-size: 13px;
+ // color: #888;
+ // width: 100%;
+ // text-overflow: ellipsis;
+ // white-space: nowrap;
+ // overflow: hidden;
+ // display: block;
+ // margin-left: -10px;
+ // margin-top: -6px;
+ // color: black;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 12px;
+ letter-spacing: -0.56px;
+ color: #575757;
+ opacity: 1;
+ font-size: 14px;
+ width: 100%;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ display: block;
+ margin-left: -10px;
+ margin-top: -10px;
+ }
+}
+
+.employee-name-ar{
+ display: inline-block;
+ width: 80%;
+ .name{
+ // font-size: 16px;
+ // color: black;
+ // // margin: 0;
+ // width: 100%;
+ // text-overflow: ellipsis;
+ // white-space: nowrap;
+ // overflow: hidden;
+ // margin-left: -10px;
+ // margin-top: -5px;
+ // font-family: 'WorkSans-Bold';
+ font-size: 16px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin-left: -10px;
+ margin-top: -5px;
+ text-align: right;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 25px;
+ letter-spacing: -0.64px;
+ color: #2B353E;
+ opacity: 1;
+ }
+
+ .title{
+ // font-size: 13px;
+ // color: #888;
+ // width: 100%;
+ // text-overflow: ellipsis;
+ // white-space: nowrap;
+ // overflow: hidden;
+ // display: block;
+ // margin-left: -10px;
+ // margin-top: -6px;
+ // color: black;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 12px;
+ letter-spacing: -0.56px;
+ color: #575757;
+ opacity: 1;
+ font-size: 14px;
+ width: 100%;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ display: block;
+ margin-left: -10px;
+ margin-top: -10px;
+ }
+}
+.image-container{
+ width: 20%;
+ display: inline-block;
+ text-align: center;
+ vertical-align: top;
+ margin-top: 5px;
+}
+.swipe-information{
+ color: #888;
+ font-size: 12px;
+ border-top: 1px solid #ccc;
+ padding-top: 6px;
+ margin-top: 6px;
+ .check-in {
+ font-size: 12px;
+ margin-right: 15px;
+ }
+}
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts
new file mode 100644
index 00000000..8b69962b
--- /dev/null
+++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SubordinateLeaveComponent } from './subordinate-leave.component';
+
+describe('SubordinateLeaveComponent', () => {
+ let component: SubordinateLeaveComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SubordinateLeaveComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SubordinateLeaveComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts
new file mode 100644
index 00000000..cdcbd788
--- /dev/null
+++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts
@@ -0,0 +1,57 @@
+import { Component, OnInit } from '@angular/core';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { MyTeamService } from '../service/my-team.service';
+import * as moment from 'moment';
+
+@Component({
+ selector: 'app-subordinate-leave',
+ templateUrl: './subordinate-leave.component.html',
+ styleUrls: ['./subordinate-leave.component.scss'],
+})
+export class SubordinateLeaveComponent implements OnInit {
+ public startDate: any;
+ public endDate: any;
+ public list = [];
+ public noData = true;
+
+ constructor(
+ public ts: TranslatorService,
+ public common: CommonService,
+ public myTeamService: MyTeamService,
+ ) { }
+
+ ngOnInit() {}
+
+ subordinateLeaveList() {
+ const Sdata = this.common.convertDateToJsonDateUpdated(this.startDate);
+ const Edata = this.common.convertDateToJsonDateUpdated(this.endDate);
+ this.myTeamService.getEmployeeSubordinatesLeave({
+ P_DATE_FROM: Sdata,
+ P_DATE_TO: Edata
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ this.list = result.GetSubordinatesLeavesTotalVacationsList;
+ this.noData = false;
+ }
+ });
+ }
+
+ getDate(date) {
+ const newDate = this.common.localizeDate(new Date(this.common.getDateTimeISOFromStringUpdated(date).split(' ')[0]));
+ return newDate;
+ }
+ diffDays(date) {
+ const date1 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_START).split(' ')[0]);
+ const date2 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_END).split(' ')[0]);
+ const diff = Math.abs(date1.getTime() - date2.getTime());
+ const diffDays = Math.ceil(diff / (1000 * 3600 * 24));
+ return diffDays;
+ }
+
+ checkDate() {
+ if (this.startDate && this.endDate) {
+ return false;
+ } else { return true; }
+ }
+}
diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html
index fe0b6141..31eda5f2 100644
--- a/Mohem/src/app/notification/home/home.component.html
+++ b/Mohem/src/app/notification/home/home.component.html
@@ -1,6 +1,7 @@
@@ -10,19 +11,20 @@
{{ts.trPK('work-list','open-analysis')}}
-
-
{{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}}
-
0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}}
-
{{totalRequestCount}}
-
0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}
-
0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}
+
+
{{totalRequestCount}}
+
+
{{ts.trPK('work-list','total')}} {{ts.trPK('work-list','open-reqest')}}
+
-
+
-
+
{{ts.trPK('work-list','clear-search')}}
-
+
{{ts.trPK('work-list','advanced-search')}}
@@ -70,7 +72,6 @@