#4344 Warenausgabe - Statusänderung via Bestellposten Details Seite wird nur nach Seiten Refresh angezeigt

This commit is contained in:
Lorenz Hilpert
2023-10-09 14:18:55 +02:00
parent bd674a0e14
commit f923fdefa4
2 changed files with 25 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ActivatedRoute, Router } from '@angular/router';
import { PickupShelfDetailsStore, PickupShelfStore } from './store';
import { ActionHandlerService } from './services/action-handler.service';
import { KeyValueDTOOfStringAndString } from '@swagger/oms';
import { KeyValueDTOOfStringAndString, OrderItemProcessingStatusValue } from '@swagger/oms';
import { OrderItemsContext } from '@domain/oms';
export abstract class PickupShelfDetailsBaseComponent {
@@ -39,14 +39,7 @@ export abstract class PickupShelfDetailsBaseComponent {
this.store.setFetchPartial(true);
return;
}
console.log({
action,
items: this.store.selectedOrderItems,
compartmentCode: this.store.latestCompartmentCodeForOrder,
compartmentInfo: this.store.selectedCompartmentInfo || this.store.compartmentInfo,
order: this.store.order,
itemQuantity: this.store.selectedOrderItemQuantity,
});
const ctx = await this.actionHandlerService.handle({
action,
items: this.store.selectedOrderItems,
@@ -60,6 +53,25 @@ export abstract class PickupShelfDetailsBaseComponent {
this.store.resetSelectedOrderItems();
this.store.resetSelectedOrderItemQuantity();
const item = ctx?.items.find((_) => true);
this.store.fetchOrderItems({
orderNumber: item.orderNumber,
compartmentCode: item.processingStatus === 128 ? item.compartmentCode : undefined,
compartmentInfo: item.processingStatus === 128 ? item.compartmentInfo : undefined,
orderItemProcessingStatus: item.processingStatus,
});
ctx.items.forEach((item) => {
this.listStore.patchOrderItem({
orderItemSubsetId: item.orderItemSubsetId,
changes: {
processingStatus: item.processingStatus,
compartmentCode: item.processingStatus === 128 ? item.compartmentCode : undefined,
compartmentInfo: item.processingStatus === 128 ? item.compartmentInfo : undefined,
},
});
});
return ctx;
}
}

View File

@@ -3,7 +3,7 @@ import { PickupShelfDetailsBaseComponent } from '../../pickup-shelf-details-base
import { AsyncPipe, NgFor, NgIf } from '@angular/common';
import { PickUpShelfDetailsHeaderComponent } from '../../shared/pickup-shelf-details-header/pickup-shelf-details-header.component';
import { PickUpShelfDetailsItemComponent } from '../../shared/pickup-shelf-details-item/pickup-shelf-details-item.component';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString, OrderItemProcessingStatusValue } from '@swagger/oms';
import { PickUpShelfOutNavigationService } from '@shared/services';
import { BehaviorSubject } from 'rxjs';
import { map } from 'rxjs/operators';
@@ -76,9 +76,11 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
this.changeActionLoader$.next(action.command);
this.store.setDisableHeaderStatusDropdown(true);
const context = await this.execAction(action);
if (!!context) {
if (action.command.includes('ARRIVED') || action.command.includes('PRINT_PRICEDIFFQRCODELABEL')) {
await this.router.navigate(this._pickupShelfOutNavigationService.defaultRoute({ processId: this.processId }).path);
const nav = this._pickupShelfOutNavigationService.defaultRoute({ processId: this.processId });
await this.router.navigate(nav.path, { queryParams: nav.queryParams, queryParamsHandling: 'preserve' });
} else {
const item = context?.items.find((_) => true);
await this.router.navigate(
@@ -94,10 +96,6 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
}).path,
{ queryParamsHandling: 'preserve' }
);
this.listStore.patchOrderItem({
orderItemSubsetId: item.orderItemSubsetId,
changes: { processingStatus: item.processingStatus },
});
}
}
} catch (error) {