mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Warenausgabe Details Sticky Buttons & setArrivedAndPrint function angepasst
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<app-shelf-order-details-shelf-tags #shelfDetailsTag></app-shelf-order-details-shelf-tags>
|
||||
</div>
|
||||
|
||||
<div class="isa-my-28 isa-text-center">
|
||||
<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"
|
||||
(click)="setArrivedAndPrint(shelfDetailsTag.selected)">
|
||||
eingetroffen und Drucken
|
||||
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="isa-my-28 isa-text-center" *ngIf="showPickUpCta$ | async">
|
||||
<div class="cta-sticky isa-my-28 isa-text-center" *ngIf="showPickUpCta$ | async">
|
||||
<button *ngIf="(showPickUpPartialCollectCta$ | async) && !partialPickup" type="button"
|
||||
class="isa-btn isa-btn-outline-primary isa-btn-pill isa-btn-medium isa-mr-10" (click)="activatePartialPickup()">
|
||||
Teilabholung
|
||||
@@ -59,4 +59,6 @@
|
||||
<button type="button" class="isa-btn isa-btn-primary isa-btn-pill isa-btn-medium" (click)="setPickedUp()">
|
||||
abgeholt
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cta-spacer"></div>
|
||||
@@ -7,3 +7,14 @@
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 288px);
|
||||
}
|
||||
|
||||
.cta-sticky {
|
||||
bottom: 80px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.cta-spacer {
|
||||
min-height: 100px !important;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ export class ShelfOrderDetailsComponent {
|
||||
}
|
||||
|
||||
async changeProcessingStatus(status: OrderItemProcessingStatusValue) {
|
||||
console.log(status);
|
||||
const items = await this.orderItems$.pipe(first()).toPromise();
|
||||
await this.detailsFacade.setProcessingStatus({ items, status }).toPromise();
|
||||
|
||||
@@ -131,19 +130,19 @@ export class ShelfOrderDetailsComponent {
|
||||
});
|
||||
}
|
||||
|
||||
setArrivedAndPrint(compartmentInfo: string) {
|
||||
this.orderItems$
|
||||
.pipe(
|
||||
first(),
|
||||
flatMap((items) => this.detailsFacade.setArrivedAndPrint({ items, compartmentInfo }))
|
||||
)
|
||||
.subscribe({
|
||||
next: (items) => {
|
||||
this.shelfNavigationService.navigateToDetailsFromOrderToCompartment({
|
||||
compartmentCode: items[0].response.body.result.item1.compartmentCode,
|
||||
});
|
||||
},
|
||||
async setArrivedAndPrint(compartmentInfo: string) {
|
||||
const items = await this.orderItems$.pipe(first()).toPromise();
|
||||
|
||||
const changes = await this.detailsFacade.setArrivedAndPrint({
|
||||
items,
|
||||
compartmentInfo,
|
||||
});
|
||||
|
||||
if (!!changes) {
|
||||
this.shelfNavigationService.navigateToDetailsFromOrderToCompartment({
|
||||
compartmentCode: changes.compartmentCode,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
activatePartialPickup() {
|
||||
|
||||
@@ -116,20 +116,45 @@ export class DetailsFacade {
|
||||
return forkJoin(changes$$);
|
||||
}
|
||||
|
||||
setArrivedAndPrint(data: {
|
||||
async setArrivedAndPrint(data: {
|
||||
items: Array<{ orderId?: number; orderItemId?: number; orderItemSubsetId?: number }>;
|
||||
compartmentInfo?: string;
|
||||
}) {
|
||||
const changes$$ = data.items.map((item) =>
|
||||
this.changeStatus({
|
||||
const firstItem = data.items[0];
|
||||
|
||||
if (!!!firstItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
const changeFirstItem = await this.changeStatus({
|
||||
orderId: firstItem.orderId,
|
||||
orderItemId: firstItem.orderItemId,
|
||||
orderItemSubsetId: firstItem.orderItemSubsetId,
|
||||
data: { processingStatus: 128, compartmentInfo: data.compartmentInfo },
|
||||
}).toPromise();
|
||||
|
||||
if (!changeFirstItem.response.ok) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const item of data.items.filter((i) => i.orderItemId !== firstItem.orderItemId)) {
|
||||
await this.changeStatus({
|
||||
orderId: item.orderId,
|
||||
orderItemId: item.orderItemId,
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
data: { processingStatus: 128, compartmentInfo: data.compartmentInfo },
|
||||
})
|
||||
);
|
||||
data: {
|
||||
processingStatus: 128,
|
||||
compartmentInfo: data.compartmentInfo,
|
||||
compartmentNumber: changeFirstItem.response.body.result.item1.compartmentCode,
|
||||
},
|
||||
}).toPromise();
|
||||
}
|
||||
|
||||
return forkJoin(changes$$);
|
||||
return {
|
||||
items: data.items,
|
||||
compartmentInfo: data.compartmentInfo,
|
||||
compartmentCode: changeFirstItem.response.body.result.item1.compartmentCode,
|
||||
};
|
||||
}
|
||||
|
||||
setEstimatedShippingDate({
|
||||
|
||||
Reference in New Issue
Block a user