View Note Modal, Work List RFC & View Replacement Modal Implemented
parent
f07de65e5c
commit
61275a4c85
@ -0,0 +1,17 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-title color="light">{{'worklist, note' | translate}}</ion-title>
|
||||
<ion-buttons slot="primary">
|
||||
<ion-button style="background: none !important;" (click)="closeModal()">
|
||||
<ion-icon slot="icon-only" name="close"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div>
|
||||
<p class="">{{getTextNote}}</p>
|
||||
</div>
|
||||
</ion-content>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ViewNoteModalComponent } from './view-note-modal.component';
|
||||
|
||||
describe('ViewNoteModalComponent', () => {
|
||||
let component: ViewNoteModalComponent;
|
||||
let fixture: ComponentFixture<ViewNoteModalComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewNoteModalComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ViewNoteModalComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-note-modal',
|
||||
templateUrl: './view-note-modal.component.html',
|
||||
styleUrls: ['./view-note-modal.component.scss'],
|
||||
})
|
||||
export class ViewNoteModalComponent implements OnInit {
|
||||
|
||||
getTextNote: any;
|
||||
|
||||
constructor(private modalCtrl: ModalController, private cs: CommonService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.getTextNote = this.cs.sharedService.getSharedData('textNote');
|
||||
}
|
||||
|
||||
closeModal() {
|
||||
this.modalCtrl.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,3 +1,46 @@
|
||||
<p>
|
||||
view-replacement-modal works!
|
||||
</p>
|
||||
<ion-content padding>
|
||||
<!-- (ionChange)="radioChecked($event)" -->
|
||||
<div>
|
||||
|
||||
<ion-grid style="padding-top: 30px;" class="btnGrid">
|
||||
|
||||
<ion-row>
|
||||
<ion-col col-6 class="gridBtnCol">
|
||||
<button ion-button class="gridBtn" (click)="closeBtnModal()">
|
||||
{{'general, cancel' | translate}}
|
||||
</button>
|
||||
</ion-col>
|
||||
<ion-col col-6 class="gridBtnCol">
|
||||
<button ion-button class="gridBtn" (click)="OkBtnModal()">
|
||||
{{'general. ok' | translate}}
|
||||
</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
<ion-list>
|
||||
<!-- <ion-list-header>
|
||||
Select a Person
|
||||
</ion-list-header> -->
|
||||
<ion-radio-group>
|
||||
|
||||
<ion-item *ngFor="let RepList of getRepList">
|
||||
<!-- <ion-col> -->
|
||||
<ion-label>{{RepList.USER_NAME}}</ion-label>
|
||||
<ion-label>{{RepList.EMPLOYEE_DISPLAY_NAME}}</ion-label>
|
||||
<ion-label>{{RepList.EMAIL_ADDRESS}}</ion-label>
|
||||
<ion-radio value="{{RepList.USER_NAME}}" (ionSelect)="radioSelect(RepList)"></ion-radio>
|
||||
<!-- <ion-radio (ionSelect)="select(item)" [value]="item"></ion-radio> -->
|
||||
|
||||
<!-- </ion-col> -->
|
||||
|
||||
</ion-item>
|
||||
</ion-radio-group>
|
||||
</ion-list>
|
||||
|
||||
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||
</ion-infinite-scroll>
|
||||
</div>
|
||||
</ion-content>
|
||||
@ -0,0 +1,11 @@
|
||||
ion-content {
|
||||
margin-top: 40px !important;
|
||||
width: 95% !important;
|
||||
height: 80% !important;
|
||||
top: 5% !important;
|
||||
left: 2% !important;
|
||||
right: 5% !important;
|
||||
bottom: 5% !important;
|
||||
padding-top: 30px !important;
|
||||
border: solid 1px #dedede;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<nav-buttons></nav-buttons>
|
||||
<ion-title color="light">{{ 'workListMain, rfc' | translate}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<div class="tipsPadding boldTxtNav">
|
||||
{{"replacementRoll.msgRFC" | translate}}
|
||||
</div>
|
||||
<ion-list (ionChange)="radioChecked($event)" radio-group>
|
||||
<ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;">
|
||||
<ion-label>{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</ion-label>
|
||||
<ion-label>{{rfcEmployeeList.ACTION}}</ion-label>
|
||||
<ion-radio value="{{i}}"></ion-radio>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||
</ion-infinite-scroll>
|
||||
|
||||
<div>
|
||||
<label class="boldTxtNav">{{"replacementRoll.enterNote" | translate}}</label>
|
||||
<ion-item>
|
||||
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="footer-button" color="customnavy" ion-button (click)="submitAction()">
|
||||
{{'general, submit' | translate}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,7 @@
|
||||
.footer-button {
|
||||
border-radius: 3px;
|
||||
padding: 0 1.1em;
|
||||
min-height: 45px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WorkListRfcComponent } from './work-list-rfc.component';
|
||||
|
||||
describe('WorkListRfcComponent', () => {
|
||||
let component: WorkListRfcComponent;
|
||||
let fixture: ComponentFixture<WorkListRfcComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WorkListRfcComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(WorkListRfcComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,156 @@
|
||||
import { WorklistMainService } from './../service/work-list.main.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq';
|
||||
import { WorkListActionRequest } from '../models/NotificationActionReq';
|
||||
import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes';
|
||||
import { WorklistService } from '../service/worklist.service';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-work-list-rfc',
|
||||
templateUrl: './work-list-rfc.component.html',
|
||||
styleUrls: ['./work-list-rfc.component.scss'],
|
||||
})
|
||||
export class WorkListRfcComponent implements OnInit {
|
||||
|
||||
private WorkListActionHistoryObj: WorkListActionHistoryRequest;
|
||||
private WorkListActionObj: WorkListActionRequest;
|
||||
|
||||
getPassNotificationDetails: any;
|
||||
RFCEmployeeListListRes: any;
|
||||
radioButtonValue: any;
|
||||
pageNum: number = 1;
|
||||
seqNo: any;
|
||||
//forwordTo:any;
|
||||
IsReachEnd: boolean = false;
|
||||
comments: any;
|
||||
userNote: any;
|
||||
getpassResAttr: any = [];
|
||||
P_PAGE_NUM: number = 1;
|
||||
P_PAGE_LIMIT: number = 50;
|
||||
|
||||
constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService) {
|
||||
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo');
|
||||
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr');
|
||||
|
||||
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
|
||||
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
|
||||
this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
|
||||
|
||||
this.WorkListActionObj = new WorkListActionRequest();
|
||||
this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
|
||||
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
|
||||
this.WorkListActionObj.P_ACTION_MODE = "";
|
||||
this.WorkListActionObj.P_COMMENTS = "";
|
||||
this.WorkListActionObj.P_APPROVER_INDEX = null;
|
||||
this.WorkListActionObj.RespondAttributeList = this.getpassResAttr;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getRFCEmployee(this.WorkListActionHistoryObj);
|
||||
}
|
||||
|
||||
getRFCEmployee(WorkListActionHistoryObj) {
|
||||
this.IsReachEnd = false;
|
||||
this.worklistService.getRFCEmployeeList(WorkListActionHistoryObj).
|
||||
subscribe((result: WorKListRFCEmployeeResponse) => {
|
||||
this.handleWorkListRFCEmployeeResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleWorkListRFCEmployeeResult(result) {
|
||||
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (this.cs.hasData(result.GetRFCEmployeeListList)) {
|
||||
this.RFCEmployeeListListRes = result.GetRFCEmployeeListList;
|
||||
this.P_PAGE_NUM++;
|
||||
let lastItemIndex = this.RFCEmployeeListListRes.length - 1;
|
||||
if (result.GetRFCEmployeeListList[lastItemIndex]) {
|
||||
let lastitem = result.GetRFCEmployeeListList[lastItemIndex];
|
||||
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
radioChecked(v) {
|
||||
let emp: any = this.RFCEmployeeListListRes[v];
|
||||
this.seqNo = emp.SEQ;
|
||||
this.radioButtonValue = emp.USER_NAME;
|
||||
|
||||
}
|
||||
|
||||
submitAction() {
|
||||
if (this.radioButtonValue) {
|
||||
if (this.userNote) {
|
||||
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.radioButtonValue;
|
||||
this.WorkListActionObj.P_ACTION_MODE = "RFC";
|
||||
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
|
||||
this.WorkListActionObj.P_APPROVER_INDEX = this.seqNo;
|
||||
this.workListMainService.actionButton(this.WorkListActionObj).
|
||||
subscribe((result: any) => {
|
||||
this.handleApplayActionResult(result);
|
||||
});
|
||||
} else {
|
||||
let msg: string = this.ts.trPK("replacementRoll", "enterNote");
|
||||
this.cs.showErrorMessageDialog(() => {
|
||||
}, this.ts.trPK('general', 'ok'), msg);
|
||||
|
||||
}
|
||||
} else {
|
||||
let msg: string = this.ts.trPK("replacementRoll", "msgRFC");
|
||||
this.cs.showErrorMessageDialog(() => {
|
||||
}, this.ts.trPK('general', 'ok'), msg);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
handleApplayActionResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.MessageStatus == 1) {
|
||||
// let msg:string="";
|
||||
// msg=this.translate.translate("general.success");
|
||||
// this.common.showAlert(msg);
|
||||
// this.navCtrl.push("HomePage");
|
||||
this.cs.openHome();
|
||||
}
|
||||
} // valid it
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll) {
|
||||
if (!this.IsReachEnd) {
|
||||
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
this.worklistService.getRFCEmployeeList(this.WorkListActionHistoryObj).
|
||||
subscribe((result) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.RFCEmployeeList != undefined) {
|
||||
this.P_PAGE_NUM++
|
||||
(result.RFCEmployeeList).forEach(element => {
|
||||
if (element.ROW_NUM == element.NO_OF_ROWS) {
|
||||
this.IsReachEnd = true;
|
||||
}
|
||||
else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
//this.WorkListResObj.push(element);
|
||||
});
|
||||
}// if list length >0
|
||||
else {
|
||||
this.IsReachEnd = true;
|
||||
}
|
||||
}// if response == 1
|
||||
//this.pageNum++;
|
||||
infiniteScroll.target.complete();
|
||||
});
|
||||
} else {
|
||||
if (infiniteScroll)
|
||||
infiniteScroll.target.complete();
|
||||
}
|
||||
}//end infiniteScroll
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue