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

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

@ -7,8 +7,8 @@
<ion-content padding>
<!-- <div #containerDiv id="containerDiv">
</div> -->
<div #containerDiv id="containerDiv">
</div>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, tip" | translate'></div>
<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 { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { Router } from '@angular/router';
import { ButtonInput } from 'src/app/uI-elements/button.input';
@Component({
selector: 'app-home',
@ -23,7 +24,7 @@ export class HomeComponent implements OnInit {
IsReachEnd: boolean = false;
RespondAttributeList: any;
// button: ButtonInput;
button: ButtonInput;
// dateTime: DateTimeInput;
// date: DateInput;
// numberInput: NumberInput;
@ -36,7 +37,7 @@ export class HomeComponent implements OnInit {
this.P_PAGE_NUM = 1;
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.date = new DateInput('Start Date', 'SDate', '', '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();
// let elem = document.getElementById('btnSubmit');
// const elemDiv = document.createElement('div');
//elemDiv.id = this.elementID;
// elemDiv.className = '';
const elemDiv = document.createElement('div');
// elemDiv.id = this.elementID;
elemDiv.className = '';
// elemDiv.innerHTML = this.button.getTemplate();
elemDiv.innerHTML = this.button.getTemplate();
// elemDiv.innerHTML = this.dateTime.getTemplate();
// elemDiv.innerHTML = this.date.getTemplate();
// elemDiv.innerHTML = this.numberInput.getTemplate();
@ -67,14 +68,14 @@ export class HomeComponent implements OnInit {
// elemDiv.innerHTML = this.textAreaInput.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);
// elem.addEventListener("click", (e) => {
// this.showAlert();
// e.stopImmediatePropagation();
// });
elem.addEventListener("click", (e) => {
this.showAlert();
e.stopImmediatePropagation();
});
}

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

Loading…
Cancel
Save