mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#581 Show Eingetroffen CtA On Status Abgeholt
This commit is contained in:
@@ -103,7 +103,8 @@
|
||||
"
|
||||
(click)="
|
||||
changeProcessingStatus(128, {
|
||||
compartmentInfo: shelfDetailsTag.selected
|
||||
compartmentInfo: shelfDetailsTag.selected,
|
||||
shouldPrint: true
|
||||
})
|
||||
"
|
||||
>
|
||||
@@ -112,6 +113,34 @@
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<!-- CTAs für Eingetroffen -->
|
||||
<ng-container *ngIf="showArrivedCta$ | async">
|
||||
<div class="isa-card isa-mt-2 isa-border-top-radius-0">
|
||||
<app-shelf-order-details-shelf-tags
|
||||
#shelfDetailsTag
|
||||
></app-shelf-order-details-shelf-tags>
|
||||
</div>
|
||||
|
||||
<div class="cta-sticky isa-my-28 isa-text-center">
|
||||
<button
|
||||
type="button"
|
||||
class="isa-btn isa-btn-primary isa-btn-pill isa-btn-medium"
|
||||
[disabled]="
|
||||
shelfDetailsTag.selected === shelfDetailsTag.customValue.value &&
|
||||
shelfDetailsTag.customValue.invalid
|
||||
"
|
||||
(click)="
|
||||
changeProcessingStatus(128, {
|
||||
compartmentInfo: shelfDetailsTag.selected,
|
||||
shouldPrint: false
|
||||
})
|
||||
"
|
||||
>
|
||||
eingetroffen
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="cta-sticky isa-my-28 isa-text-center">
|
||||
<button
|
||||
*ngIf="(showPickUpPartialCollectCta$ | async) && !partialPickup"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, ViewChild } from '@angular/core';
|
||||
import { DetailsFacade } from '@shelf-store/details';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {
|
||||
map,
|
||||
@@ -13,7 +12,6 @@ import {
|
||||
takeUntil,
|
||||
withLatestFrom,
|
||||
} from 'rxjs/operators';
|
||||
import { OrderDetailsCardInput } from '../../components/order-details-card';
|
||||
import {
|
||||
OrderItemProcessingStatusValue,
|
||||
OrderItemListItemDTO,
|
||||
@@ -25,6 +23,8 @@ import { race, combineLatest } from 'rxjs';
|
||||
import { AppService } from '@sales/core-services';
|
||||
import { OMSPrintService, PrintService } from '@swagger/print';
|
||||
import { PrinterSelectionComponent } from 'apps/sales/src/app/components/printer-selection/printer-selection.component';
|
||||
import { OrderDetailsCardInput } from '../../components/order-details-card';
|
||||
import { DetailsFacade } from '@shelf-store/details';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shelf-order-details',
|
||||
@@ -121,6 +121,10 @@ export class ShelfOrderDetailsComponent {
|
||||
) // wenn bestellt(=16) oder nachbestellt(=8192)
|
||||
);
|
||||
|
||||
showArrivedCta$ = this.orderDetailsCard$.pipe(
|
||||
map((details) => details.processingStatus === 256)
|
||||
); // wenn abgeholt(=256)
|
||||
|
||||
showPickUpCta$ = this.orderDetailsCard$.pipe(
|
||||
map((details) => details.processingStatus === 128) // wenn eingetroffen(=128)
|
||||
);
|
||||
@@ -185,7 +189,7 @@ export class ShelfOrderDetailsComponent {
|
||||
|
||||
async changeProcessingStatus(
|
||||
status: OrderItemProcessingStatusValue,
|
||||
data: { compartmentInfo?: string } = {}
|
||||
data: { compartmentInfo?: string; shouldPrint?: boolean } = {}
|
||||
) {
|
||||
let items = await this.orderItems$.pipe(first()).toPromise();
|
||||
let results: ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO[];
|
||||
@@ -208,9 +212,11 @@ export class ShelfOrderDetailsComponent {
|
||||
results = await this.detailsFacade.reorder(items);
|
||||
} else if (status === 128) {
|
||||
results = await this.detailsFacade.arrived(items, data.compartmentInfo);
|
||||
this.printAbholfachetikett(
|
||||
items.map(({ orderItemSubsetId }) => orderItemSubsetId)
|
||||
);
|
||||
if (data.shouldPrint) {
|
||||
this.printAbholfachetikett(
|
||||
items.map(({ orderItemSubsetId }) => orderItemSubsetId)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const payloads = items.map(
|
||||
({ orderId, orderItemId, orderItemSubsetId }) => ({
|
||||
|
||||
Reference in New Issue
Block a user