update monthly-attendance

monthly-attendance
enadhilal 6 years ago
parent f3fdc1454f
commit a2acf0dcbd

@ -4,6 +4,7 @@ import { TranslatorService } from '../../hmg-common/services/translator/translat
import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service';
import { GetSubordinatesAttdStatusRequest } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; import { GetSubordinatesAttdStatusRequest } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { GetSubordinatesAttdStatusResponse } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
@Component({ @Component({
@ -12,22 +13,22 @@ import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbore
styleUrls: ['./monthly-attendance.component.scss'], styleUrls: ['./monthly-attendance.component.scss'],
}) })
export class MonthlyAttendanceComponent implements OnInit { export class MonthlyAttendanceComponent implements OnInit {
gaugeType = "full";
constructor(
private cs: CommonService,
public ts: TranslatorService,
public sharedData: SharedDataService,
public DS: DashboredService) { }
gaugeType = 'full';
gaugeValue = 28.3; gaugeValue = 28.3;
gaugeLabel = "Days"; gaugeLabel = 'Days';
// gaugeAppendText = "km/hr"; // gaugeAppendText = "km/hr";
currentMonth: any; currentMonth: any;
currentDate; todayYear: any;
todayMonth: any;
constructor(private cs: CommonService, public ts: TranslatorService, public sharedData: SharedDataService, public DS :DashboredService) { } public options = {
ngOnInit() {}
ionViewWillEnter(){
this.currentMonth = this.sharedData.getSharedData("currentMonth");
}
public options = {
cutoutPercentage: 80, cutoutPercentage: 80,
@ -39,43 +40,62 @@ export class MonthlyAttendanceComponent implements OnInit {
public data = { public data = {
datasets: [ datasets: [
{ {
data: [120,50], data: [120, 50],
backgroundColor: [ backgroundColor: [
'#22c6b3', '#22c6b3',
'#094875', '#094875',
], ],
borderWidth: 2 borderWidth: 2
}] }]
}; };
ngOnInit() { }
ionViewWillEnter() {
this.currentMonth = this.sharedData.getSharedData("currentMonth");
console.log(this.currentMonth);
let day = this.currentMonth.split(" ");
this.todayMonth =day[0];
this.todayYear = day[1];
this.todayYear = parseInt(this.todayYear);
console.log("MONTH: " +this.todayMonth);
console.log("YEAR: " +this.todayYear);
this.getSubordinatesAttStatus()
}
getSubordinatesAttStatus(){ getSubordinatesAttStatus() {
let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM="/Date(1578603600000+0300)/"; //test // request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; //test
request.P_SCHEDULE_DATE_TO="/Date(1576011600000+0300)/";//test // request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/";//test
console.log(this.currentMonth);
this.DS.getSubordinatesAttStatus( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesAttdStatusResponse)=>{ request.SearchMonth = this.todayMonth;
request.SearchYear = 2019//this.todayYear;
this.DS.getSubordinatesAttStatus(request, () => { console.log("Error "); }).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
console.log("response"); console.log("response");
console.log(result); console.log(result);
} }
}); });
} }
x(){
console.log("ENAD CHANge")
}
} }

@ -2,6 +2,9 @@ import { Request } from '../../../services/models/request'
export class GetSubordinatesAttdStatusRequest extends Request{ export class GetSubordinatesAttdStatusRequest extends Request{
//public static SHARED_DATA = ''; //public static SHARED_DATA = '';
public P_SCHEDULE_DATE_FROM :any; public P_SCHEDULE_DATE_FROM: any;
public P_SCHEDULE_DATE_TO :any; public P_SCHEDULE_DATE_TO: any;
public SearchMonth: string;
public SearchYear: number;
} }

@ -938,8 +938,9 @@ border:0px
.monthview-selected { .monthview-selected {
background-color: #76cfb7 !important; background-color: gray !important;
color: #fff !important; color: #fff !important;
} }

Loading…
Cancel
Save