mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Layout Fix; Edit Navigation Fix
This commit is contained in:
@@ -39,13 +39,13 @@
|
||||
<span class="menu-item">Kundensuche</span>
|
||||
</ng-template>
|
||||
</div>
|
||||
<!-- <div class="menu-item-grid align-center active" (click)="routeToMenu('/shelf/search', 'shelfsearch')"> -->
|
||||
<div class="menu-item-grid align-center">
|
||||
<div class="menu-item-grid align-center active" (click)="routeToMenu('/shelf/search', 'shelfsearch')">
|
||||
<!-- <div class="menu-item-grid align-center"> -->
|
||||
<div>
|
||||
<lib-icon class="menu-icon" name="{{
|
||||
router.url === '/shelf/search' || router.url.startsWith('/shelf/results') || router.url.startsWith('/shelf/details')
|
||||
? 'Icon_Abholfach'
|
||||
: 'Icon_Abholfach_B_disabled'
|
||||
: 'Icon_Abholfach_inactive'
|
||||
}}" width="34px" height="24px"></lib-icon>
|
||||
</div>
|
||||
<span *ngIf="
|
||||
@@ -53,7 +53,7 @@
|
||||
else shelfSearchLabelElse
|
||||
" class="menu-item selected">Warenausgabe</span>
|
||||
<ng-template #shelfSearchLabelElse>
|
||||
<span class="menu-item " style="color: #e6eff9;">Warenausgabe</span>
|
||||
<span class="menu-item ">Warenausgabe</span>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,67 +1,35 @@
|
||||
<ng-container *ngIf="orderItemForm">
|
||||
<app-shelf-edit-order-item-header
|
||||
[src]="orderItemForm.get('ean')?.value | createImageSourceFromEan"
|
||||
[title]="orderItemForm.get('title')?.value"
|
||||
(expand)="expandGroup($event)"
|
||||
[isOpen]="isGroupOpen"
|
||||
>
|
||||
<app-shelf-edit-order-item-header [src]="orderItemForm.get('ean')?.value | createImageSourceFromEan"
|
||||
[title]="orderItemForm.get('title')?.value" (expand)="expandGroup($event)" [isOpen]="isGroupOpen">
|
||||
</app-shelf-edit-order-item-header>
|
||||
|
||||
<hr class="isa-content-spacer last" />
|
||||
<form [formGroup]="orderItemForm" *ngIf="isGroupOpen">
|
||||
<app-ui-text-input
|
||||
formControlName="quantity"
|
||||
label="Menge"
|
||||
suffix="x"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="quantity" label="Menge" suffix="x"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="price"
|
||||
label="Preis"
|
||||
suffix="EUR"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="price" label="Preis" suffix="EUR"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="ean"
|
||||
label="ISBN/EAN"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="ean" label="ISBN/EAN"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="targetBranch"
|
||||
label="Zielfiliale"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="targetBranch" label="Zielfiliale"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="supplier"
|
||||
label="Lieferant"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="supplier" label="Lieferant"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="ssc"
|
||||
label="Meldenummer"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="ssc" label="Meldenummer"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-select-input
|
||||
*ngIf="vatLabelPipe"
|
||||
formControlName="vat"
|
||||
[options]="vatOptions"
|
||||
[optionsPipe]="vatOptionsPipe"
|
||||
[labelPipe]="{ transform: vatLabelTransform }"
|
||||
[valuePipe]="valuePipe"
|
||||
label="MwSt"
|
||||
>
|
||||
<app-ui-select-input *ngIf="vatLabelPipe" formControlName="vat" [options]="vatOptions"
|
||||
[optionsPipe]="vatOptionsPipe" [labelPipe]="{ transform: vatLabelTransform }" [valuePipe]="valuePipe"
|
||||
label="MwSt">
|
||||
</app-ui-select-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="comment"
|
||||
label="Anmerkung"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="comment" label="Anmerkung"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
</form>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
@@ -1,9 +1,7 @@
|
||||
<h2 class="isa-flex isa-justify-content-space-between">
|
||||
<span>{{ orderDetails?.firstName }} {{ orderDetails?.lastName }}</span>
|
||||
<span
|
||||
>{{ orderDetails?.compartmentCode }}
|
||||
{{ orderDetails?.compartmentInfo }}</span
|
||||
>
|
||||
<span>{{ orderDetails?.compartmentCode }}
|
||||
{{ orderDetails?.compartmentInfo }}</span>
|
||||
</h2>
|
||||
<div class="isa-flex isa-justify-content-space-between">
|
||||
<div class="isa-flex isa-flex-direction-column">
|
||||
@@ -32,49 +30,28 @@
|
||||
<div class="detail">
|
||||
<div class="name">Status</div>
|
||||
<div class="value">
|
||||
<button
|
||||
class="isa-btn isa-p-0 isa-btn-block isa-text-right"
|
||||
(click)="statusDropdown.toggle()"
|
||||
>
|
||||
<lib-icon
|
||||
class="isa-mr-8"
|
||||
[ngClass]="icon"
|
||||
*ngIf="
|
||||
<button class="isa-btn isa-p-0 isa-btn-block isa-text-right isa-white-space-nowrap"
|
||||
(click)="statusDropdown.toggle()">
|
||||
<lib-icon class="isa-mr-8" [ngClass]="icon" *ngIf="
|
||||
orderDetails?.processingStatus | processingStatus: 'icon';
|
||||
let icon
|
||||
"
|
||||
[name]="icon"
|
||||
>
|
||||
" [name]="icon">
|
||||
</lib-icon>
|
||||
<strong>{{
|
||||
orderDetails?.processingStatus | processingStatus
|
||||
}}</strong>
|
||||
<lib-icon
|
||||
class="dp-button-icon"
|
||||
[class.up]="statusDropdown.visible"
|
||||
[class.down]="!statusDropdown.visible"
|
||||
name="Arrow_right"
|
||||
[height]="'16px'"
|
||||
></lib-icon>
|
||||
<lib-icon class="dp-button-icon" [class.up]="statusDropdown.visible" [class.down]="!statusDropdown.visible"
|
||||
name="Arrow_right" [height]="'16px'"></lib-icon>
|
||||
</button>
|
||||
<app-ui-dropdown
|
||||
#statusDropdown
|
||||
[value]="orderDetails?.processingStatus"
|
||||
(valueChange)="changeProcessingStatus.emit($event)"
|
||||
>
|
||||
<ng-container
|
||||
*ngFor="
|
||||
<app-ui-dropdown #statusDropdown [value]="orderDetails?.processingStatus"
|
||||
(valueChange)="changeProcessingStatus.emit($event)">
|
||||
<ng-container *ngFor="
|
||||
let status of processingKeys
|
||||
| keyvalue
|
||||
| processingStatusOptionsKeyValuePipe
|
||||
"
|
||||
>
|
||||
<button
|
||||
appUiDropdownItem
|
||||
class="isa-btn isa-text-left isa-p-16"
|
||||
[value]="status.key"
|
||||
*ngIf="status.key !== orderDetails?.processingStatus"
|
||||
>
|
||||
">
|
||||
<button appUiDropdownItem class="isa-btn isa-text-left isa-p-16" [value]="status.key"
|
||||
*ngIf="status.key !== orderDetails?.processingStatus">
|
||||
{{ status?.value?.value }}
|
||||
</button>
|
||||
</ng-container>
|
||||
@@ -106,29 +83,16 @@
|
||||
<div class="detail">
|
||||
<div class="name">vsl. Lieferdatum</div>
|
||||
<div class="value">
|
||||
<button
|
||||
class="isa-btn isa-p-0 isa-btn-block isa-text-right"
|
||||
(click)="uiDatepicker.toggle()"
|
||||
>
|
||||
<button class="isa-btn isa-p-0 isa-btn-block isa-text-right" (click)="uiDatepicker.toggle()">
|
||||
<strong>
|
||||
{{ orderDetails?.estimatedShippingDate | date: 'dd.MM.yy' }}
|
||||
</strong>
|
||||
<lib-icon
|
||||
class="dp-button-icon"
|
||||
[class.up]="uiDatepicker.opened"
|
||||
[class.down]="!uiDatepicker.opened"
|
||||
name="Arrow_right"
|
||||
[height]="'16px'"
|
||||
></lib-icon>
|
||||
<lib-icon class="dp-button-icon" [class.up]="uiDatepicker.opened" [class.down]="!uiDatepicker.opened"
|
||||
name="Arrow_right" [height]="'16px'"></lib-icon>
|
||||
</button>
|
||||
<app-ui-datepicker
|
||||
#uiDatepicker
|
||||
[right]="'-1rem'"
|
||||
[min]="minDate"
|
||||
[disabledDaysOfWeek]="[0]"
|
||||
<app-ui-datepicker #uiDatepicker [right]="'-1rem'" [min]="minDate" [disabledDaysOfWeek]="[0]"
|
||||
[selected]="orderDetails?.estimatedShippingDate"
|
||||
(save)="changeEstimatedDeliveryDate.emit($event); uiDatepicker.close()"
|
||||
>
|
||||
(save)="changeEstimatedDeliveryDate.emit($event); uiDatepicker.close()">
|
||||
</app-ui-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
@@ -138,36 +102,21 @@
|
||||
<div class="detail">
|
||||
<div class="name">Abholfrist</div>
|
||||
<div class="value">
|
||||
<button
|
||||
class="isa-btn isa-p-0 isa-btn-block isa-text-right"
|
||||
(click)="deadlineDropdown.toggle()"
|
||||
>
|
||||
<button class="isa-btn isa-p-0 isa-btn-block isa-text-right" (click)="deadlineDropdown.toggle()">
|
||||
<strong>
|
||||
{{ orderDetails?.pickupDeadline | date: 'dd.MM.yy' }}
|
||||
</strong>
|
||||
<lib-icon
|
||||
class="dp-button-icon"
|
||||
[class.up]="deadlineDropdown.visible"
|
||||
[class.down]="!deadlineDropdown.visible"
|
||||
name="Arrow_right"
|
||||
[height]="'16px'"
|
||||
></lib-icon>
|
||||
<lib-icon class="dp-button-icon" [class.up]="deadlineDropdown.visible" [class.down]="!deadlineDropdown.visible"
|
||||
name="Arrow_right" [height]="'16px'"></lib-icon>
|
||||
</button>
|
||||
<app-ui-dropdown
|
||||
#deadlineDropdown
|
||||
[value]="orderDetails?.pickupDeadline"
|
||||
(valueChange)="changePickUpDeadline.emit($event)"
|
||||
>
|
||||
<app-ui-dropdown #deadlineDropdown [value]="orderDetails?.pickupDeadline"
|
||||
(valueChange)="changePickUpDeadline.emit($event)">
|
||||
<ng-container *ngFor="let dl of pickupDeadlines | keyvalue">
|
||||
<button
|
||||
appUiDropdownItem
|
||||
class="isa-btn isa-text-left isa-p-16"
|
||||
[value]="dl.value"
|
||||
>
|
||||
<button appUiDropdownItem class="isa-btn isa-text-left isa-p-16" [value]="dl.value">
|
||||
{{ dl.key }}
|
||||
</button>
|
||||
</ng-container>
|
||||
</app-ui-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
@@ -31,8 +31,8 @@ export class ShelfOrderDetailsCardComponent implements OnInit {
|
||||
get pickupDeadlines() {
|
||||
const dedalineMap = new Map<string, Date>();
|
||||
|
||||
let TWO_WEEKS = 1000 * 60 * 60 * 24 * 7;
|
||||
let FOUR_WEEKS = 1000 * 60 * 60 * 24 * 14;
|
||||
let TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
|
||||
let FOUR_WEEKS = 1000 * 60 * 60 * 24 * 28;
|
||||
|
||||
if (this.orderDetails) {
|
||||
TWO_WEEKS += new Date(this.orderDetails.pickupDeadline).getTime();
|
||||
|
||||
@@ -7,88 +7,47 @@
|
||||
<div class="layout-content">
|
||||
<ng-container *ngIf="form">
|
||||
<form [formGroup]="form">
|
||||
<app-ui-text-input
|
||||
formControlName="compartmentCode"
|
||||
label="Abholfachnummer"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="compartmentCode" label="Abholfachnummer"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="orderNumber"
|
||||
label="Vorgang-ID"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="orderNumber" label="Vorgang-ID"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="orderDate"
|
||||
label="Bestelldatum"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="orderDate" label="Bestelldatum"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="clientChannel"
|
||||
label="Bestellkanal"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="clientChannel" label="Bestellkanal"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-text-input
|
||||
formControlName="buyerNumber"
|
||||
label="Kundennummer"
|
||||
></app-ui-text-input>
|
||||
<app-ui-text-input formControlName="buyerNumber" label="Kundennummer"></app-ui-text-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<app-ui-select-input
|
||||
formControlName="processingStatus"
|
||||
label="Status"
|
||||
[options]="
|
||||
<app-ui-select-input formControlName="processingStatus" label="Status" [options]="
|
||||
formService.processingStatus | processingStatusOptionsPipe
|
||||
"
|
||||
[labelPipe]="processingStatusPipe"
|
||||
[optionsPipe]="processingStatusPipe"
|
||||
></app-ui-select-input>
|
||||
" [labelPipe]="processingStatusPipe" [optionsPipe]="processingStatusPipe"></app-ui-select-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
|
||||
<ng-container
|
||||
*ngIf="
|
||||
<ng-container *ngIf="
|
||||
+form.get('processingStatus').value === 16 ||
|
||||
+form.get('processingStatus').value === 8192
|
||||
"
|
||||
>
|
||||
<app-ui-select-input
|
||||
formControlName="estimatedShippingDate"
|
||||
label="Vsl. Lieferdatum"
|
||||
[options]="
|
||||
">
|
||||
<app-ui-select-input formControlName="estimatedShippingDate" label="Vsl. Lieferdatum" [options]="
|
||||
form.get('estimatedShippingDate').value | getExtendPickUpOptions
|
||||
"
|
||||
[labelPipe]="datePipe"
|
||||
[optionsPipe]="dateOptionsPipe"
|
||||
></app-ui-select-input>
|
||||
" [labelPipe]="datePipe" [optionsPipe]="dateOptionsPipe"></app-ui-select-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="+form.get('processingStatus').value === 128">
|
||||
<app-ui-select-input
|
||||
formControlName="pickUpDeadline"
|
||||
label="Abholfrist"
|
||||
[options]="
|
||||
<app-ui-select-input formControlName="pickUpDeadline" label="Abholfrist" [options]="
|
||||
form.get('pickUpDeadline').value | getExtendPickUpOptions
|
||||
"
|
||||
[labelPipe]="datePipe"
|
||||
[optionsPipe]="dateOptionsPipe"
|
||||
></app-ui-select-input>
|
||||
" [labelPipe]="datePipe" [optionsPipe]="dateOptionsPipe"></app-ui-select-input>
|
||||
<hr class="isa-content-spacer" />
|
||||
</ng-container>
|
||||
|
||||
<div formArrayName="items">
|
||||
<ng-container
|
||||
*ngFor="let item of items.controls; let index = index"
|
||||
>
|
||||
<app-shelf-edit-order-item
|
||||
[orderItemForm]="item"
|
||||
[onlyChild]="items.controls.length === 1"
|
||||
[firstChild]="index === 1"
|
||||
[vatOptions]="formService.vats$ | async"
|
||||
></app-shelf-edit-order-item>
|
||||
<ng-container *ngFor="let item of items.controls; let index = index">
|
||||
<app-shelf-edit-order-item [orderItemForm]="item" [onlyChild]="items.controls.length === 1"
|
||||
[firstChild]="index === 0" [vatOptions]="formService.vats$ | async"></app-shelf-edit-order-item>
|
||||
</ng-container>
|
||||
</div>
|
||||
</form>
|
||||
@@ -96,10 +55,6 @@
|
||||
</div>
|
||||
<div class="spacing"></div>
|
||||
</div>
|
||||
<app-shelf-edit-actions
|
||||
[disabled]="!form || !form.valid"
|
||||
(cancel)="onAbortEdit()"
|
||||
(save)="onSubmit()"
|
||||
>
|
||||
<app-shelf-edit-actions [disabled]="!form || !form.valid" (cancel)="onAbortEdit()" (save)="onSubmit()">
|
||||
</app-shelf-edit-actions>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,28 +1,11 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import {
|
||||
filter,
|
||||
map,
|
||||
distinctUntilChanged,
|
||||
shareReplay,
|
||||
take,
|
||||
withLatestFrom,
|
||||
first,
|
||||
} from 'rxjs/operators';
|
||||
import { filter, map, distinctUntilChanged, shareReplay, take, withLatestFrom, first } from 'rxjs/operators';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { ShelfEditFormService } from '../../services';
|
||||
import { FormGroup, FormArray } from '@angular/forms';
|
||||
import {
|
||||
ProcessingStatusPipe,
|
||||
PickUpDateOptionsToDisplayValuesPipe,
|
||||
ProcessingStatusOptionsPipe,
|
||||
} from '../../pipes';
|
||||
import { ProcessingStatusPipe, PickUpDateOptionsToDisplayValuesPipe, ProcessingStatusOptionsPipe } from '../../pipes';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ShelfNavigationService } from '../../shared/services';
|
||||
import { OrderItemProcessingStatusValue } from '@swagger/oms/lib';
|
||||
@@ -63,10 +46,7 @@ export class ShelfEditCompartmentComponent implements OnInit {
|
||||
|
||||
get processingStatus$() {
|
||||
return this.activatedRoute.params.pipe(
|
||||
map(
|
||||
(params) =>
|
||||
Number(params.processingStatus) as OrderItemProcessingStatusValue
|
||||
),
|
||||
map((params) => Number(params.processingStatus) as OrderItemProcessingStatusValue),
|
||||
distinctUntilChanged(),
|
||||
shareReplay()
|
||||
);
|
||||
@@ -77,12 +57,8 @@ export class ShelfEditCompartmentComponent implements OnInit {
|
||||
}
|
||||
|
||||
async loadCompartmentAndInitForm() {
|
||||
const compartmentCode = await this.compartmentCode$
|
||||
.pipe(take(1))
|
||||
.toPromise();
|
||||
const processingStatus = await this.processingStatus$
|
||||
.pipe(take(1))
|
||||
.toPromise();
|
||||
const compartmentCode = await this.compartmentCode$.pipe(take(1)).toPromise();
|
||||
const processingStatus = await this.processingStatus$.pipe(take(1)).toPromise();
|
||||
|
||||
this.populateFormData(compartmentCode, processingStatus);
|
||||
}
|
||||
@@ -90,24 +66,15 @@ export class ShelfEditCompartmentComponent implements OnInit {
|
||||
async onSubmit() {
|
||||
console.log(this.form.valid);
|
||||
|
||||
const compartmentCode = await this.compartmentCode$
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
const processingStatus = await this.processingStatus$
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
const submitResult = await this.formService.submit(
|
||||
this.form,
|
||||
processingStatus
|
||||
);
|
||||
const compartmentCode = await this.compartmentCode$.pipe(first()).toPromise();
|
||||
const processingStatus = await this.processingStatus$.pipe(first()).toPromise();
|
||||
const submitResult = await this.formService.submit(this.form, processingStatus);
|
||||
|
||||
let newValues;
|
||||
if (submitResult) {
|
||||
newValues = {
|
||||
compartmentCode:
|
||||
this.form.get('compartmentCode').value || compartmentCode,
|
||||
processingStatus:
|
||||
this.form.get('processingStatus').value || processingStatus,
|
||||
compartmentCode: this.form.get('compartmentCode').value || compartmentCode,
|
||||
processingStatus: this.form.get('processingStatus').value || processingStatus,
|
||||
};
|
||||
|
||||
this.shelfNavigationService.navigateBackToDetails(newValues, {
|
||||
@@ -118,24 +85,16 @@ export class ShelfEditCompartmentComponent implements OnInit {
|
||||
}
|
||||
|
||||
onAbortEdit() {
|
||||
return this.compartmentCode$
|
||||
.pipe(take(1), withLatestFrom(this.processingStatus$))
|
||||
.subscribe(([compartmentCode, processingStatus]) =>
|
||||
this.shelfNavigationService.navigateToDetails({
|
||||
compartmentCode,
|
||||
processingStatus,
|
||||
})
|
||||
);
|
||||
return this.compartmentCode$.pipe(take(1), withLatestFrom(this.processingStatus$)).subscribe(([compartmentCode, processingStatus]) =>
|
||||
this.shelfNavigationService.navigateBackToDetails({
|
||||
compartmentCode,
|
||||
processingStatus,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private async populateFormData(
|
||||
compartmentCode: string,
|
||||
processingStatus: OrderItemProcessingStatusValue
|
||||
) {
|
||||
this.form = await this.formService.createFormByCompartmentCode(
|
||||
compartmentCode,
|
||||
processingStatus
|
||||
);
|
||||
private async populateFormData(compartmentCode: string, processingStatus: OrderItemProcessingStatusValue) {
|
||||
this.form = await this.formService.createFormByCompartmentCode(compartmentCode, processingStatus);
|
||||
this.items = this.formService.getItemsForm(compartmentCode);
|
||||
this.customerName = this.formService.getCustomerName(compartmentCode);
|
||||
this.cdr.detectChanges();
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { FormGroup, FormArray } from '@angular/forms';
|
||||
import { ShelfEditFormService } from '../../services';
|
||||
import { ShelfNavigationService } from '../../shared/services';
|
||||
import {
|
||||
filter,
|
||||
map,
|
||||
distinctUntilChanged,
|
||||
shareReplay,
|
||||
take,
|
||||
withLatestFrom,
|
||||
first,
|
||||
} from 'rxjs/operators';
|
||||
import { filter, map, distinctUntilChanged, shareReplay, take, withLatestFrom, first } from 'rxjs/operators';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import {
|
||||
ProcessingStatusPipe,
|
||||
PickUpDateOptionsToDisplayValuesPipe,
|
||||
ProcessingStatusOptionsPipe,
|
||||
} from '../../pipes';
|
||||
import { ProcessingStatusPipe, PickUpDateOptionsToDisplayValuesPipe, ProcessingStatusOptionsPipe } from '../../pipes';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { OrderItemProcessingStatusValue } from '@swagger/oms/lib';
|
||||
import { from } from 'rxjs';
|
||||
@@ -62,10 +45,7 @@ export class ShelfEditOrderComponent implements OnInit {
|
||||
|
||||
get processingStatus$() {
|
||||
return this.activatedRoute.params.pipe(
|
||||
map(
|
||||
(params) =>
|
||||
Number(params.processingStatus) as OrderItemProcessingStatusValue
|
||||
),
|
||||
map((params) => Number(params.processingStatus) as OrderItemProcessingStatusValue),
|
||||
distinctUntilChanged(),
|
||||
shareReplay()
|
||||
);
|
||||
@@ -77,9 +57,7 @@ export class ShelfEditOrderComponent implements OnInit {
|
||||
|
||||
async loadOrderNumberAndInitForm() {
|
||||
const orderNumber = await this.orderNumber$.pipe(take(1)).toPromise();
|
||||
const processingStatus = await this.processingStatus$
|
||||
.pipe(take(1))
|
||||
.toPromise();
|
||||
const processingStatus = await this.processingStatus$.pipe(take(1)).toPromise();
|
||||
console.log('loadOrderNumberAndInitForm', {
|
||||
orderNumber,
|
||||
processingStatus,
|
||||
@@ -89,20 +67,14 @@ export class ShelfEditOrderComponent implements OnInit {
|
||||
|
||||
async onSubmit() {
|
||||
const orderNumber = await this.orderNumber$.pipe(first()).toPromise();
|
||||
const processingStatus = await this.processingStatus$
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
const processingStatus = await this.processingStatus$.pipe(first()).toPromise();
|
||||
|
||||
const submitResult = await this.formService.submit(
|
||||
this.form,
|
||||
processingStatus
|
||||
);
|
||||
const submitResult = await this.formService.submit(this.form, processingStatus);
|
||||
|
||||
if (submitResult) {
|
||||
this.shelfNavigationService.navigateBackToDetails({
|
||||
orderNumber,
|
||||
processingStatus:
|
||||
this.form.get('processingStatus').value || processingStatus,
|
||||
processingStatus: this.form.get('processingStatus').value || processingStatus,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -112,21 +84,15 @@ export class ShelfEditOrderComponent implements OnInit {
|
||||
.pipe(take(1), withLatestFrom(this.processingStatus$))
|
||||
|
||||
.subscribe(([orderNumber, processingStatus]) =>
|
||||
this.shelfNavigationService.navigateToDetails({
|
||||
this.shelfNavigationService.navigateBackToDetails({
|
||||
orderNumber,
|
||||
processingStatus,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private async populateFormData(
|
||||
orderNumber: string,
|
||||
processingStatus: OrderItemProcessingStatusValue
|
||||
) {
|
||||
this.form = await this.formService.createFormByOrderNumber(
|
||||
orderNumber,
|
||||
processingStatus
|
||||
);
|
||||
private async populateFormData(orderNumber: string, processingStatus: OrderItemProcessingStatusValue) {
|
||||
this.form = await this.formService.createFormByOrderNumber(orderNumber, processingStatus);
|
||||
console.log({ form: this.form });
|
||||
|
||||
this.items = this.formService.getItemsForm(orderNumber);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.hr {
|
||||
|
||||
452
package-lock.json
generated
452
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user