added logic for eit basic details

Fatima-Q2-June
umasoodch 5 years ago
parent a945acd441
commit 7b75303583

@ -1116,6 +1116,9 @@ export class CommonService {
public openEditProfile() {
this.nav.navigateForward(['/profile/editprofile']);
}
public openAddBasicDetails() {
this.nav.navigateForward(['/profile/addBasicDetails']);
}
public openAccuralPage() {
this.nav.navigateForward(['/accrual-balances/home']);
}

@ -123,11 +123,6 @@
</ion-label>
<h3 class="result-label-text-form">{{personalInfo.EMPLOYMENT_CATEGORY_MEANING}}</h3>
<br>
<!-- <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('userProfile','address')}}</h3>
</ion-label>
<h3 class="result-label-text-form">DR.Sulaiman Alhabib Medical Group</h3>
<br> -->
<ion-label>
<h3 class="type-label-text-form">{{ts.trPK('userProfile','phone-no')}}</h3>
</ion-label>
@ -158,7 +153,7 @@
<ion-col size="2">
<img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png"
(click)="allowEdit(1)">
(click)="allowEdit('basic')">
</ion-col>
</ion-row>
</ion-grid>
@ -184,186 +179,6 @@
<h3 class="result-label-text-form">{{civilIdentityNumber}}</h3>
<br>
</ion-card-content>
<ion-card-content *ngIf="editBasic" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<ion-label>
<h1 class="header-label-text-form">{{ts.trPK('general','basic-details')}}</h1>
</ion-label>
<ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','effective-date')}}</h3>
</ion-label>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>MMMM</ion-label>
<ion-datetime displayFormat="MMMM" value="2012-12-15T13:47:20.789"></ion-datetime>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','title')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="mr">Mr</ion-select-option>
<ion-select-option value="ms">Miss</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','family-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 >
{{ts.trPK('userProfile','preferred-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','previous-family-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','father-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','grand-father-name')}}
</h3>
</ion-label>
<ion-input class="login-input" required type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','arabic-first-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','arabic-father-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','arabic-grand-father-name')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
</ion-card-content>
</ion-card>
<ion-card [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<ion-card-content *ngIf="editBasic">
<ion-label>
<h1 class="header-label-text-form">{{ts.trPK('general','other')}}</h1>
</ion-label>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','gender')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="m">Male</ion-select-option>
<ion-select-option value="f">Female</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','marital-status')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="s">Singal</ion-select-option>
<ion-select-option value="m">Married</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','nationality')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="mr">Mr</ion-select-option>
<ion-select-option value="ms">Miss</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','religion')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="i">Islam</ion-select-option>
<ion-select-option value="o">Other</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','education-level')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="u">University</ion-select-option>
<ion-select-option value="o">other</ion-select-option>
</ion-select>
</ion-item>
<br>
</ion-card-content>
</ion-card>
<ion-card *ngIf="addressSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
@ -378,7 +193,7 @@
<ion-col size="2">
<img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png"
(click)="allowEdit(2)">
(click)="allowEdit('address')">
</ion-col>
</ion-row>
</ion-grid>
@ -414,96 +229,9 @@
<h3 class="result-label-text-form">11416</h3>
<br>
</ion-card-content>
<ion-card-content *ngIf="editAddress">
<ion-label>
<h1 class="header-label-text-form">{{ts.trPK('general','address')}}</h1>
</ion-label>
<ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','effective-date')}}</h3>
</ion-label>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>MMMM</ion-label>
<ion-datetime displayFormat="MMMM" value="2012-12-15T13:47:20.789"></ion-datetime>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label>
<h3 class="type-label-text-form">
{{ts.trPK('general','nationality')}}
</h3>
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="mr">Mr</ion-select-option>
<ion-select-option value="ms">Miss</ion-select-option>
</ion-select>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','address')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','street')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','area')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','p-o-box')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','city')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
<br>
<ion-item lines="none" class="item-input-login" style="--background: white">
<ion-label position="floating">
<h3 class="type-label-text-form">
{{ts.trPK('userProfile','postal-code')}}
</h3>
</ion-label>
<ion-input class="login-input" type="text"></ion-input>
</ion-item>
</ion-card-content>
</ion-card>
<ion-footer *ngIf="editBasic||editAddress">
<!-- <ion-footer *ngIf="editBasic||editAddress">
<ion-grid>
<ion-row>
<ion-col>
@ -515,6 +243,6 @@
</ion-col>
</ion-row>
</ion-grid>
</ion-footer>
</ion-footer> -->
</ion-content>

@ -11,6 +11,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { EditDetailProfileComponent } from '../modal/edit-detail-profile/edit-detail-profile.component';
import { ProfileService } from '../service/profile.service'
import { ActivatedRoute } from '@angular/router';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
@Component({
selector: 'app-home',
@ -37,6 +38,10 @@ export class HomeComponent implements OnInit {
public maritalStatus: string;
public birthDate: any;
public civilIdentityNumber: any;
public menuEntries: any;
public basicDetailsSubMenu: any;
public addressSubMenu: any;
transactionNo = 0;
constructor(
public ts: TranslatorService,
@ -71,6 +76,35 @@ export class HomeComponent implements OnInit {
ngOnInit() {
this.getProfile();
this.menuEntries = this.cs.sharedService.getSharedData('menuEntries', false);
if (this.menuEntries) {
this.setMenuEntries();
}
}
public setMenuEntries() {
let personalInformationChildren: any;
let personalInfoNestedChildren: any;
for( let i = 0; i < this.menuEntries.length; i++ ) {
if (this.menuEntries[i].MENU_NAME === 'MBL_E_PROFESSIONALS_01') {
personalInformationChildren = this.menuEntries[i].children;
for( let j = 0; j < personalInformationChildren.length; j++ ) {
if (personalInformationChildren[j].MENU_NAME = 'MBL_PERINFO_SS' && personalInformationChildren[j].ENTRY_SEQUENCE === 15) {
personalInfoNestedChildren = personalInformationChildren[j].children;
for( let k = 0; k < personalInfoNestedChildren.length; k++ ) {
if (personalInfoNestedChildren[k].REQUEST_TYPE === 'BASIC_DETAILS') {
this.basicDetailsSubMenu = personalInfoNestedChildren[k];
}
if (personalInfoNestedChildren[k].REQUEST_TYPE === 'ADDRESS') {
this.addressSubMenu = personalInfoNestedChildren[k];
}
}
}
}
}
}
console.log(this.basicDetailsSubMenu);
console.log(this.addressSubMenu);
}
public getBasicDetails() {
@ -178,14 +212,24 @@ export class HomeComponent implements OnInit {
}
}
public allowEdit(allowVal){
switch(allowVal){
case 1:
this.editBasic = true;
break;
case 2:
this.editAddress = true;
break;
public getFunction (value: string) {
}
public allowEdit(allowVal: string){
let selMenu: MenuResponse = new MenuResponse();
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = allowVal === 'basic' ? this.basicDetailsSubMenu : this.addressSubMenu;
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (allowVal === 'basic') {
this.transactionNo++;
// tslint:disable-next-line: max-line-length
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddBasicDetails();
} else {
// this.cs.openProfile('address');
}
}

@ -1,8 +1,8 @@
import { Request } from '../../hmg-common/services/models/request';
export class EITTransactionsRequest extends Request{
public static SUBMIT_EIT_ACTION='submit-eit-action';
public static SHARED_DATA='submit_eit_obj';
public static SUBMIT_EIT_ACTION='submit-basic-action';
public static SHARED_DATA='submit_basic_obj';
public P_PAGE_NUM : Number;
public P_PAGE_LIMIT : Number;
public P_MENU_TYPE:String;

@ -1,7 +1,7 @@
import { EitTransactionModel } from './eit.transaction.model';
export class EitRequest {
public static SHARED_DATA = 'eit-request';
export class BasicRequest {
public static SHARED_DATA = 'basic-request';
public P_MENU_TYPE: string;
public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_FUNCTION_NAME: string;

@ -6,6 +6,7 @@ import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { IonicModule } from '@ionic/angular';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { DatePicker } from "@ionic-native/date-picker/ngx";
@ -16,6 +17,7 @@ import {ProfileImageComponent} from './profile-image/profile-image.component'
import {PerformanceEvaluationComponent} from './performance-evaluation/performance-evaluation.component'
import { from } from 'rxjs';
import { EditDetailProfileComponent } from './modal/edit-detail-profile/edit-detail-profile.component';
import { AddBasicDetailsComponent } from './add-basic-details/add-basic-details.component';
const routes: Routes = [
{
@ -62,6 +64,17 @@ const routes: Routes = [
],
},
{
path: '',
component: ProfilePage,
children: [
{
path: 'addBasicDetails',
component: AddBasicDetailsComponent
}
],
}
];
@NgModule({
@ -73,7 +86,17 @@ const routes: Routes = [
NgxChartsModule,
RouterModule.forChild(routes)
],
declarations: [ProfilePage ,EditDetailProfileComponent, HomeComponent,ProfileImageComponent,EditProfileComponent,PerformanceEvaluationComponent],
providers: [
DatePicker
],
declarations: [
ProfilePage,
EditDetailProfileComponent,
HomeComponent,
ProfileImageComponent,
EditProfileComponent,
PerformanceEvaluationComponent,
AddBasicDetailsComponent],
entryComponents:[EditDetailProfileComponent]
})
export class ProfilePageModule {}

@ -8,9 +8,26 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio
export class ProfileService {
public static updateEmpImage ="Services/ERP.svc/REST/UPDATE_EMPLOYEE_IMAGE";
public static getEmployeeBasicDetails ="Services/ERP.svc/REST/GET_EMPLOYEE_BASIC_DETAILS";
/* EIT Services URLs */
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS';
public static getBASICDFFStrutre = 'Services/ERP.svc/REST/GET_BASIC_DET_DFF_STRUCTURE';
public static getBASICCOLStructure = 'Services/ERP.svc/REST/GET_BASIC_DET_COLS_STRUCTURE';
public static getSetValue = 'Services/ERP.svc/REST/GET_VALUE_SET_VALUES';
public static getDefaultValue = 'Services/ERP.svc/REST/GET_DEFAULT_VALUE';
public static validateEITTransctions = 'Services/ERP.svc/REST/VALIDATE_EIT_TRANSACTION';
public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION';
public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS';
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
constructor(
public api: ConnectorService,
public con: ConnectorService,
public authService: AuthenticationService
) {}
@ -18,7 +35,7 @@ export class ProfileService {
): Observable<any> {
const request = updateImgRequest;
this.authService.authenticateRequest(request);
return this.api.post(
return this.con.post(
ProfileService.updateEmpImage,
request,
onError,
@ -29,6 +46,37 @@ export class ProfileService {
public getEmployeeBasicDetails(basicEmployeeDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
const request = basicEmployeeDetailsRequest;
this.authService.authenticateRequest(request);
return this.api.post(ProfileService.getEmployeeBasicDetails, request, onError, errorLabel);
return this.con.post(ProfileService.getEmployeeBasicDetails, request, onError, errorLabel);
}
public getBasicDFFStrutre(BASICDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = BASICDFFStrutreReq;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.getBASICDFFStrutre, request, onError, errorLabel);
}
public getColumnStructure(body: any, onError?: any, errorLabel?: string): Observable<any> {
const request = body;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.getBASICCOLStructure, request, onError, errorLabel);
}
public getDefaultValue(DefaultValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = DefaultValueReq;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.getDefaultValue, request, onError, errorLabel);
}
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = SetValueReq;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.getSetValue, request, onError, errorLabel);
}
public submitEit(eit: any, onError?: any, errorLabel?: string): Observable<any> {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.submitEit, request, onError, errorLabel);
}
}
Loading…
Cancel
Save