production
Sultan Khan 7 years ago
parent ceb4968a69
commit aee81e59ae

@ -6,12 +6,12 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { Geolocation } from '@ionic-native/geolocation/ngx'; import { Geolocation } from "@ionic-native/geolocation/ngx";
import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx'; import { ZBar, ZBarOptions } from "@ionic-native/zbar/ngx";
import { Device } from '@ionic-native/device/ngx'; import { Device } from "@ionic-native/device/ngx";
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request'; import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request";
import { Response } from "src/app/hmg-common/services/models/response"; import { Response } from "src/app/hmg-common/services/models/response";
import { AttendanceService } from './services/attendance.services'; import { AttendanceService } from "./services/attendance.services";
@Component({ @Component({
selector: "app-home", selector: "app-home",
@ -22,10 +22,10 @@ export class HomePage implements OnInit {
userData: any = {}; userData: any = {};
user_image: any = "../assets/imgs/profile.png"; user_image: any = "../assets/imgs/profile.png";
menuList: any = []; menuList: any = [];
zbarOptions:any; zbarOptions: any;
scannedResult:any; scannedResult: any;
lat : any; lat: any;
longt : any; longt: any;
deviceID: string; deviceID: string;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -36,33 +36,38 @@ export class HomePage implements OnInit {
public events: Events, public events: Events,
private device: Device, private device: Device,
private zbar: ZBar, private zbar: ZBar,
private geolocation: Geolocation, private geolocation: Geolocation,
private attendance_service:AttendanceService private attendance_service: AttendanceService
) {} ) {}
ngOnInit() { ngOnInit() {
this.getUserDetails(); this.getUserDetails();
this.getMenu(); this.getMenu();
this.geolocation.getCurrentPosition().then((resp) => { this.geolocation
// resp.coords.latitude .getCurrentPosition()
// resp.coords.longitude .then(resp => {
console.log(resp.coords.latitude); // resp.coords.latitude
console.log(resp.coords.longitude); // resp.coords.longitude
}).catch((error) => { console.log(resp.coords.latitude);
console.log('Error getting location', error); console.log(resp.coords.longitude);
}); })
.catch(error => {
console.log("Error getting location", error);
});
} }
ionViewDidLoad() ionViewDidLoad() {
{ this.geolocation
this.geolocation.getCurrentPosition().then((resp) => { .getCurrentPosition()
// resp.coords.latitude .then(resp => {
// resp.coords.longitude // resp.coords.latitude
console.log(resp.coords.latitude); // resp.coords.longitude
console.log(resp.coords.longitude); console.log(resp.coords.latitude);
}).catch((error) => { console.log(resp.coords.longitude);
console.log('Error getting location', error); })
}); .catch(error => {
console.log("Error getting location", error);
});
} }
private openMenu() { private openMenu() {
this.menu.toggle(); this.menu.toggle();
@ -116,55 +121,59 @@ export class HomePage implements OnInit {
//this.getMenuEntries(item); //this.getMenuEntries(item);
} }
} }
private Change_password(){ private Change_password() {
this.common.openChangePassword(); this.common.openChangePassword();
} }
private attendance(){ private attendance() {
this.zbarOptions = { this.zbarOptions = {
flash: 'off', flash: "off",
drawSight: false drawSight: false
} };
console.log("your currnt location is"); console.log("your currnt location is");
this.scanCode(); this.scanCode();
} }
scanCode(){ scanCode() {
this.zbar.scan(this.zbarOptions) this.zbar
.then(result => { .scan(this.zbarOptions)
console.log(result); // Scanned code .then(result => {
let strResult = JSON.parse(result); console.log(result); // Scanned code
console.log(strResult.QRValue); let strResult = JSON.parse(result);
this.scannedResult = result; console.log(strResult.QRValue);
this.deviceID = this.device.uuid; this.scannedResult = result;
this.swipeAttendance(); this.deviceID = this.device.uuid;
}) this.swipeAttendance();
.catch(error => { })
alert(error); // Error message .catch(error => {
}); alert(error); // Error message
});
} }
swipeAttendance(){ swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat; request.Latitude = this.lat;
request.Longitude = this.longt; request.Longitude = this.longt;
request.QRValue = this.scannedResult; request.QRValue = this.scannedResult;
request.UID = this.deviceID; request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER; request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request"); console.log("request");
console.log(JSON.stringify(request)); console.log(JSON.stringify(request));
this.attendance_service.attendanceSwipeScanner( this.attendance_service
request,()=>{ .attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance"); console.log("Error inside in swipe attendance");
}). })
subscribe((result: Response) => { .subscribe((result: Response) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log("response"); console.log("response");
console.log(result); console.log(result);
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess')); this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
} else { } else {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed')); this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
} }
}); });
} }
openPersonalInfo() {
this.common.openProfile();
}
} }

@ -44,11 +44,11 @@ export class DetailsComponent implements OnInit {
false false
); );
console.log(this.employee); console.log(this.employee);
// this.selMenu = this.common.sharedService.getSharedData( this.selMenu = this.common.sharedService.getSharedData(
// MenuResponse.SHARED_DATA, MenuResponse.SHARED_DATA,
// true false
// ); );
// this.headerTitle = this.selMenu.List_Menu.MENU_NAME; this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
// this.isSpecialist = this.navParams.get("isSpecialist") // this.isSpecialist = this.navParams.get("isSpecialist")
// ? this.navParams.get("isSpecialist") // ? this.navParams.get("isSpecialist")
// : false; // : false;

@ -44,8 +44,7 @@ export class HomeComponent implements OnInit {
this.selEmpNo = this.selMenu.userid; this.selEmpNo = this.selMenu.userid;
this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch; this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch;
// this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false; // this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false;
if(!this.isSearch) if (!this.isSearch) this.getEmpSubordinate();
this.getEmpSubordinate();
} }
getEmpSubordinate() { getEmpSubordinate() {
this.pageNum = 1; this.pageNum = 1;
@ -164,7 +163,6 @@ export class HomeComponent implements OnInit {
} }
} }
getDetails(index) { getDetails(index) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.empSubordinate[index], this.empSubordinate[index],
MyTeamService.EMPLOYEE_SHARED_DATA MyTeamService.EMPLOYEE_SHARED_DATA
@ -174,11 +172,19 @@ export class HomeComponent implements OnInit {
this.selMenu, this.selMenu,
MenuResponse.SHARED_DATA MenuResponse.SHARED_DATA
); );
this.close().then(() => {
this.common.openMyTeamDetails(); this.common.openMyTeamDetails();
this.modalController.dismiss(); });
//this.modalController.dismiss();
//this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]}); //this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]});
} }
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
toggleSearch() { toggleSearch() {
this.isSearch = !this.isSearch; this.isSearch = !this.isSearch;
} }
@ -192,7 +198,7 @@ export class HomeComponent implements OnInit {
component: HomeComponent, component: HomeComponent,
keyboardClose: true, keyboardClose: true,
animated: false, animated: false,
componentProps:{isSearch:true} componentProps: { isSearch: true }
}); });
let dismissed = modal.onDidDismiss(); let dismissed = modal.onDidDismiss();
dismissed.then(() => { dismissed.then(() => {
@ -200,7 +206,7 @@ export class HomeComponent implements OnInit {
}); });
return await modal.present(); return await modal.present();
} }
dismiss(){ dismiss() {
this.modalController.dismiss({ this.modalController.dismiss({
dismissed: true dismissed: true
}); });

@ -7,8 +7,8 @@
<ion-content padding> <ion-content padding>
<!-- <div #containerDiv id="containerDiv"> <div #containerDiv id="containerDiv">
</div> --> </div>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, tip" | translate'></div> <div style="padding: 0 10px;" [innerHTML]='"vacation-rule, tip" | translate'></div>
<ion-card *ngFor="let item of GetVacationRulesList; let i = index;"> <ion-card *ngFor="let item of GetVacationRulesList; let i = index;">

@ -7,6 +7,7 @@ import { VacationRuleRequest } from './../model/VacationRuleRequest';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ButtonInput } from 'src/app/uI-elements/button.input';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -23,7 +24,7 @@ export class HomeComponent implements OnInit {
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
RespondAttributeList: any; RespondAttributeList: any;
// button: ButtonInput; button: ButtonInput;
// dateTime: DateTimeInput; // dateTime: DateTimeInput;
// date: DateInput; // date: DateInput;
// numberInput: NumberInput; // numberInput: NumberInput;
@ -36,7 +37,7 @@ export class HomeComponent implements OnInit {
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50; this.P_PAGE_LIMIT = 50;
// this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y'); this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y');
// this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y'); // this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');
// this.date = new DateInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y'); // this.date = new DateInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');
// this.numberInput = new NumberInput('Roll No.:', 'rollNo', '', 'containerDiv', 'Y', 'Y', 'Y'); // this.numberInput = new NumberInput('Roll No.:', 'rollNo', '', 'containerDiv', 'Y', 'Y', 'Y');
@ -55,11 +56,11 @@ export class HomeComponent implements OnInit {
this.getVacationRules(); this.getVacationRules();
// let elem = document.getElementById('btnSubmit'); // let elem = document.getElementById('btnSubmit');
// const elemDiv = document.createElement('div'); const elemDiv = document.createElement('div');
//elemDiv.id = this.elementID; // elemDiv.id = this.elementID;
// elemDiv.className = ''; elemDiv.className = '';
// elemDiv.innerHTML = this.button.getTemplate(); elemDiv.innerHTML = this.button.getTemplate();
// elemDiv.innerHTML = this.dateTime.getTemplate(); // elemDiv.innerHTML = this.dateTime.getTemplate();
// elemDiv.innerHTML = this.date.getTemplate(); // elemDiv.innerHTML = this.date.getTemplate();
// elemDiv.innerHTML = this.numberInput.getTemplate(); // elemDiv.innerHTML = this.numberInput.getTemplate();
@ -67,14 +68,14 @@ export class HomeComponent implements OnInit {
// elemDiv.innerHTML = this.textAreaInput.getTemplate(); // elemDiv.innerHTML = this.textAreaInput.getTemplate();
// elemDiv.innerHTML = this.timeInput.getTemplate(); // elemDiv.innerHTML = this.timeInput.getTemplate();
// document.getElementById('containerDiv').appendChild(elemDiv); document.getElementById('containerDiv').appendChild(elemDiv);
// let elem = document.getElementById("btnSubmit"); let elem = document.getElementById("btnSubmit");
// console.log(elem); // console.log(elem);
// elem.addEventListener("click", (e) => { elem.addEventListener("click", (e) => {
// this.showAlert(); this.showAlert();
// e.stopImmediatePropagation(); e.stopImmediatePropagation();
// }); });
} }

@ -736,12 +736,11 @@ color: var(--dark);
box-shadow: none; box-shadow: none;
-webkit-box-shadow: none; -webkit-box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
width: 150px; width: 100px !important;
margin: auto; margin: auto;
} }
.progress-loading-page .loading-gif { .progress-loading-page .loading-gif {
margin-top: 0.42cm; margin-top: 0.42cm;
width:100%; width:100%;
margin-left: 0.4cm; margin-left: 0.4cm;

Loading…
Cancel
Save