absence page
parent
a3d58d4b1c
commit
628cc89189
@ -0,0 +1,66 @@
|
||||
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 { Observable } from 'rxjs';
|
||||
import {AbsenceTransaction} from '../models/absence.transaction'
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class SubmitAbsenceService {
|
||||
public static submitAbsence='Services/ERP.svc/REST/SUBMIT_ABSENCE_TRANSACTION';
|
||||
public static getAbsDffStructure='Services/ERP.svc/REST/GET_ABSENCE_DFF_STRUCTURE';
|
||||
public static getAbsenceTypes='Services/ERP.svc/REST/GET_ABSENCE_ATTENDANCE_TYPES';
|
||||
public static getCalc='Services/ERP.svc/REST/CALCULATE_ABSENCE_DURATION';
|
||||
public static validateAbsence='Services/ERP.svc/REST/VALIDATE_ABSENCE_TRANSACTION';
|
||||
public static getSetValue='Services/ERP.svc/REST/GET_VALUE_SET_VALUES';
|
||||
public static getDefaultValue='Services/ERP.svc/REST/GET_DEFAULT_VALUE';
|
||||
public static resubmitAbsence='Services/ERP.svc/REST/RESUBMIT_ABSENCE_TRANSACTION'
|
||||
constructor(
|
||||
public api: ConnectorService,
|
||||
public authService: AuthenticationService,
|
||||
|
||||
) { }
|
||||
|
||||
public submitAbsence(absence: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.submitAbsence, request, onError, errorLabel);
|
||||
}
|
||||
public getAbsenceDffStructure(absence: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.getAbsDffStructure, request, onError, errorLabel);
|
||||
}
|
||||
public getAbsenceType(absence: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.getAbsenceTypes, request, onError, errorLabel);
|
||||
}
|
||||
public getCalc(absence: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.getCalc, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
public validateAbsenceTransaction (validateAbsReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = validateAbsReq;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.validateAbsence, request, onError, errorLabel);
|
||||
}
|
||||
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = SetValueReq;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.getSetValue, request, onError, errorLabel);
|
||||
}
|
||||
public getDefaultValue(DefaultValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = DefaultValueReq;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.getDefaultValue, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
public resubmitAbsence(absence: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(SubmitAbsenceService.resubmitAbsence, request, onError, errorLabel);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
<ion-header >
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-title color="light"> {{ts.trPK('submitAbsence','submitAbsence')}}</ion-title>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button color="light" class="btnBack" defaultHref=""></ion-back-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<ion-item>
|
||||
<ion-label class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </ion-label>
|
||||
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required>
|
||||
<!-- let item of AbsenceType; let i=index; -->
|
||||
<ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label class="colBold requiredClass">{{ts.trPK('submitAbsence','startDate')}} </ion-label>
|
||||
<ion-datetime (ionChange)="calcDay()" [(ngModel)]="startDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item *ngIf="hoursOrDay!='D'">
|
||||
<ion-label class="colBold requiredClass">{{ts.trPK('submitAbsence','startTime')}} </ion-label>
|
||||
<ion-datetime displayFormat="HH:mm" [(ngModel)]="startTime" required></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label class="colBold requiredClass">{{ts.trPK('submitAbsence','endDate')}}</ion-label>
|
||||
<ion-datetime (ionChange)="calcDay()" [(ngModel)]="endDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required ></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item *ngIf="hoursOrDay!='D'">
|
||||
<ion-label class="colBold requiredClass">{{ts.trPK('submitAbsence','endTime')}}</ion-label>
|
||||
<ion-datetime displayFormat="HH:mm" [(ngModel)]="endTime" required></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label class="colBold" >{{ts.trPK('submitAbsence','totalDays')}} </ion-label>
|
||||
<ion-label end style="text-align: center;">{{totalDays}}</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
|
||||
<ion-input placeholder="{{ts.trPK('searchForReplacment','searchForReplacment')}}" type="text" [(ngModel)]="employeeSel">
|
||||
</ion-input>
|
||||
<button ion-button class="search-button" icon-only (click)="SearchReplacment()" clear type="button" item-end >
|
||||
<ion-icon name="search" ></ion-icon>
|
||||
</button>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label class="colBold">{{ts.trPK('submitAbsence','comments')}}</ion-label>
|
||||
<ion-textarea [(ngModel)]="absComments"></ion-textarea>
|
||||
</ion-item>
|
||||
<div id="dynamic-abs-container" >
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button color="customnavy" (click)="validateAbcenseTransaction()">{{ts.trPK('general','next')}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,5 @@
|
||||
.search-button{
|
||||
background: transparent;
|
||||
font-size: 25px;
|
||||
color: #7F8C8D;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SubmitAbsenceComponent } from './submit-absence.component';
|
||||
|
||||
describe('SubmitAbsenceComponent', () => {
|
||||
let component: SubmitAbsenceComponent;
|
||||
let fixture: ComponentFixture<SubmitAbsenceComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SubmitAbsenceComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SubmitAbsenceComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue