add MO item History
parent
2397fc1482
commit
5aeab4b08c
@ -0,0 +1,226 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar-new">
|
||||
<nav-buttons></nav-buttons>
|
||||
<ion-title color="light">
|
||||
{{ts.trPK('worklistMain','ITEM_HIS')}}
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="colorBG">
|
||||
|
||||
<!-- <ion-card>
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle">{{'worklistMain, actionHis' | translate}}</div>
|
||||
</ion-card-header>
|
||||
<ion-card-content> -->
|
||||
|
||||
|
||||
<!-- <ion-card class="cardContent"> -->
|
||||
<!-- <ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
|
||||
</ion-card-header> -->
|
||||
<!-- <ion-card-content> -->
|
||||
|
||||
<div class="noDataDiv" [hidden]="itemHistoryRes && itemHistoryRes.length > 0">
|
||||
<p>{{ 'general, empty' | translate}}</p>
|
||||
</div>
|
||||
<ion-list class="itemeHistoryist" *ngIf="itemHistoryRes && itemHistoryRes.length > 0 ">
|
||||
<ion-grid class="gridItemReq">
|
||||
|
||||
<ion-item class="itemReqContent" *ngFor="let itemHistory of itemHistoryRes; let i=index; ">
|
||||
<div class="itemReqDiv">
|
||||
|
||||
|
||||
<!-- // <ion-row> -->
|
||||
<!-- <ion-col class="colItemReqHeader"> -->
|
||||
<!-- <label for="">{{ts.trPK('worklistMain','description')}}
|
||||
</label> -->
|
||||
<!-- </ion-col>
|
||||
<ion-col> {{itemHistory.OU_NAME}}-->
|
||||
<!-- <label for="">{{i+1}}. </label> -->
|
||||
<!-- </ion-col> -->
|
||||
<!-- </ion-row> -->
|
||||
<ion-row>
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','request_number')}}
|
||||
</label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.REQUEST_NUMBER}} </ion-label>
|
||||
</ion-col>
|
||||
<!-- </ion-row>
|
||||
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','uom')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.UNIT_OF_MEASURE}} </ion-label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.QUANTITY}} </ion-label>
|
||||
</ion-col>
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6"class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Date_Req')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.DATE_REQUIRED}} </ion-label>
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','line_status')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.LINE_STATUS_DIS}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','date_status')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.STATUS_DATE}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','trans_type')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.TRANSACTION_TYPE_NAME}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','organization')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.ORGANIZATION_NAME}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','organization_code')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.ORGANIZATION_CODE}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','operating_unit')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.OPERATING_UNIT_NAME}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','from_subinventory')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.FROM_SUBINVENTORY_CODE}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','from_locator')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.FROM_LOCATOR}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to_subinventory')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.TO_SUBINVENTORY_CODE}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- </ion-row>
|
||||
<ion-row> -->
|
||||
|
||||
<ion-col size="6" class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to_locator')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.TO_LOCATOR}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
|
||||
|
||||
<ion-col class="colItems">
|
||||
<label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipToLocation')}} </label>
|
||||
<br />
|
||||
<!-- </ion-col>
|
||||
<ion-col> -->
|
||||
<ion-label class="labelValue" for="">{{itemHistory.SHIP_TO_LOCATION}} </ion-label>
|
||||
</ion-col>
|
||||
|
||||
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-item>
|
||||
|
||||
</ion-grid>
|
||||
</ion-list>
|
||||
<!-- </ion-card-content>
|
||||
</ion-card> -->
|
||||
|
||||
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||
</ion-infinite-scroll>
|
||||
</ion-content>
|
||||
@ -0,0 +1,20 @@
|
||||
.itemeHistoryist {
|
||||
background: #f0efef;
|
||||
padding: 6px;
|
||||
/* margin-top: 20px; */
|
||||
/* width: 100%;*/
|
||||
}
|
||||
ion-label.labelValue.sc-ion-label-ios-h.sc-ion-label-ios-s.ios.hydrated,
|
||||
ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
|
||||
{
|
||||
white-space: pre-wrap !important;
|
||||
--color: initial;
|
||||
display: block;
|
||||
color: var(--color);
|
||||
font-family: var(--ion-font-family,inherit);
|
||||
font-size: inherit;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MoItemHistoryComponent } from './mo-item-history.component';
|
||||
|
||||
describe('MoItemHistoryComponent', () => {
|
||||
let component: MoItemHistoryComponent;
|
||||
let fixture: ComponentFixture<MoItemHistoryComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MoItemHistoryComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MoItemHistoryComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,123 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WorklistMainService } from '../service/work-list.main.service';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { WorklistService } from '../service/worklist.service';
|
||||
import { MOItemHistoryReq } from '../models/MOItemHistoryReq';
|
||||
import { MOItemHistoryRes } from '../models/MOItemHistoryRes';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mo-item-history',
|
||||
templateUrl: './mo-item-history.component.html',
|
||||
styleUrls: ['./mo-item-history.component.scss'],
|
||||
})
|
||||
export class MoItemHistoryComponent implements OnInit {
|
||||
getPassMOInfo: any;
|
||||
itemHistoryRes: any;
|
||||
IsReachEnd: boolean = false;
|
||||
P_PAGE_NUM: number = 1;
|
||||
P_PAGE_LIMIT: number = 50;
|
||||
MOItemHistoryReq: any;
|
||||
|
||||
constructor(
|
||||
public worklistMainService: WorklistMainService,
|
||||
private cs: CommonService,
|
||||
private ts: TranslatorService,
|
||||
public worklistService: WorklistService
|
||||
) {
|
||||
this.getPassMOInfo = this.cs.sharedService.getSharedData('passMOReq');
|
||||
|
||||
this.MOItemHistoryReq = new MOItemHistoryReq();
|
||||
this.MOItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
this.MOItemHistoryReq.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
|
||||
this.MOItemHistoryReq.P_ITEM_ID= this.getPassMOInfo.P_ITEM_ID;
|
||||
this.MOItemHistoryReq.P_ORG_ID= this.getPassMOInfo.P_ORG_ID;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.getMOItemHistory(this.getPassMOInfo.P_ITEM_ID,this.getPassMOInfo.P_ORG_ID);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
getMOItemHistory(itemID ,orgID) {
|
||||
console.log(itemID);
|
||||
this.IsReachEnd = false;
|
||||
const request = new MOItemHistoryReq();
|
||||
request.P_ITEM_ID = parseInt(itemID);
|
||||
request.P_PAGE_LIMIT = 100;
|
||||
request.P_PAGE_NUM = 1;
|
||||
request.P_ORG_ID= parseInt(orgID);
|
||||
|
||||
|
||||
|
||||
this.worklistMainService.getMOItemHistory(request).
|
||||
subscribe((result: MOItemHistoryRes) => {
|
||||
|
||||
this.handleItemHistoryResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
handleItemHistoryResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (this.cs.hasData(result.GetMoItemHistoryList)) {
|
||||
this.itemHistoryRes = result.GetMoItemHistoryList;
|
||||
this.P_PAGE_NUM++;
|
||||
this.MOItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
let lastItemIndex = this.itemHistoryRes.length - 1;
|
||||
if (result.GetMoItemHistoryList[lastItemIndex]) {
|
||||
let lastitem = result.GetMoItemHistoryList[lastItemIndex];
|
||||
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
doInfinite(infiniteScroll) {
|
||||
if (!this.IsReachEnd) {
|
||||
// this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
this.worklistMainService.getMOItemHistory(this.MOItemHistoryReq).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.GetMoItemHistoryList != undefined) {
|
||||
this.MOItemHistoryReq.P_PAGE_NUM=this.P_PAGE_NUM++;
|
||||
(result.GetMoItemHistoryList).forEach(element => {
|
||||
if (element.ROW_NUM == element.NO_OF_ROWS) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
this.itemHistoryRes.push(element);
|
||||
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
|
||||
}// 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