Remission improvements

This commit is contained in:
Adrian Toczydlowski
2020-02-05 02:44:15 +01:00
parent ff8795bba0
commit 9284100715
8 changed files with 125 additions and 23 deletions

View File

@@ -22,7 +22,7 @@ import { ReloadGoodsIn } from '../actions/goods-in.actions';
import { ReloadBranchProcess } from '../actions/branch-process.actions'; import { ReloadBranchProcess } from '../actions/branch-process.actions';
import { ReloadRemission } from '../actions/remission.actions'; import { ReloadRemission } from '../actions/remission.actions';
export const SYNC_DATA_VERSION = 176; export const SYNC_DATA_VERSION = 177;
export class AppStateModel { export class AppStateModel {
currentProcesssId: number; currentProcesssId: number;

View File

@@ -115,8 +115,8 @@ export class RemissionState {
) { ) {
const state = ctx.getState(); const state = ctx.getState();
const currentRemission = state.remission; const currentRemission = state.remission;
const { remissionProcess, target } = currentRemission;
let remission: Remission; let remission: Remission;
const target = currentRemission.target;
const selectedFilters: any = { const selectedFilters: any = {
[filterId]: { [filterId]: {
filterGroups, filterGroups,
@@ -127,28 +127,32 @@ export class RemissionState {
remission = { remission = {
...currentRemission, ...currentRemission,
remissionProcess: { remissionProcess: {
...currentRemission.remissionProcess, ...remissionProcess,
zentral: { zentral: remissionProcess.zentral
...currentRemission.remissionProcess.zentral, ? {
...remissionProcess.zentral,
[target]: { [target]: {
...currentRemission.remissionProcess.zentral[target], ...remissionProcess.zentral[target],
...selectedFilters ...selectedFilters
} }
} }
: initialTargetValue
} }
}; };
} else { } else {
remission = { remission = {
...currentRemission, ...currentRemission,
remissionProcess: { remissionProcess: {
...currentRemission.remissionProcess, ...remissionProcess,
ueberlauf: { ueberlauf: remissionProcess.ueberlauf
...currentRemission.remissionProcess.ueberlauf, ? {
...remissionProcess.ueberlauf,
[target]: { [target]: {
...currentRemission.remissionProcess.ueberlauf[target], ...remissionProcess.ueberlauf[target],
...selectedFilters ...selectedFilters
} }
} }
: initialTargetValue
} }
}; };
} }

View File

@@ -68,8 +68,8 @@ $tablet-height: 283px;
} }
.option-name { .option-name {
margin-left: 14px; padding-left: 14px;
margin-top: 3px; padding-top: 3px;
width: 100%; width: 100%;
} }

View File

@@ -30,7 +30,12 @@
<ng-container *ngTemplateOutlet="supplierAndFilter"></ng-container <ng-container *ngTemplateOutlet="supplierAndFilter"></ng-container
></ng-container> ></ng-container>
<ng-template #spinner> <ng-template #spinner>
<div class="spinner"></div> <div class="content-container">
<div class="first-row"></div>
<div class="second-row"></div>
<div class="third-row"></div>
<div class="fourth-row"></div>
</div>
</ng-template> </ng-template>
</div> </div>
<ng-template #supplierAndFilter> <ng-template #supplierAndFilter>

View File

@@ -151,3 +151,46 @@
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.content-container {
display: flex;
flex-direction: column;
align-items: center;
opacity: 1;
margin-top: 20px;
animation: load 0.75s linear infinite;
.first-row {
height: 20px;
width: 135px;
background-color: #ffffff;
}
.second-row {
height: 20px;
width: 150px;
background-color: #ffffff;
margin-top: 2px;
}
.third-row {
height: 20px;
width: 90px;
background-color: #ffffff;
margin-top: 2px;
}
.fourth-row {
height: 20px;
width: 200px;
background-color: #ffffff;
margin-top: 2px;
}
}
@keyframes load {
50% {
opacity: 0.3;
}
100% {
opacity: 1;
}
}

View File

@@ -202,6 +202,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
this.remissionProcessStatuses = remissionProcessStatuses; this.remissionProcessStatuses = remissionProcessStatuses;
this.remissionProcess$ = !this.remissionProcessStatuses.created ? this.createProcess() : this.continueProcess(); this.remissionProcess$ = !this.remissionProcessStatuses.created ? this.createProcess() : this.continueProcess();
this.remissionProcess$.pipe(takeUntil(this.destroy$)).subscribe(remissionProcess => { this.remissionProcess$.pipe(takeUntil(this.destroy$)).subscribe(remissionProcess => {
console.log('remissionProcess', remissionProcess);
(!isNullOrUndefined(remissionProcess.capacities)).ifTrue(() => this.capacitiesBinder(remissionProcess.capacities)); (!isNullOrUndefined(remissionProcess.capacities)).ifTrue(() => this.capacitiesBinder(remissionProcess.capacities));
}); });
@@ -479,7 +480,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
this.remissionService this.remissionService
.searchProduct({ ean: input }) .searchProduct({ ean: input })
.pipe(take(1)) .pipe(take(1))
.subscribe(this.searchProductResultHandler); .subscribe(this.searchProductResultHandler, () => this.invalidBarcodeDialog.openDialog());
} }
searchProductResultHandler = (remissionProduct: RemissionProduct) => { searchProductResultHandler = (remissionProduct: RemissionProduct) => {
@@ -489,6 +490,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
} }
this.store.dispatch(new SetRemissionSearchedProduct(remissionProduct)); this.store.dispatch(new SetRemissionSearchedProduct(remissionProduct));
this.searchedRemissionProduct = remissionProduct; this.searchedRemissionProduct = remissionProduct;
this.resourceTypeChange(RESOURCE_TYPE_SWITCH);
setTimeout(() => { setTimeout(() => {
this.addProductToRemissionDialog.openDialog(); this.addProductToRemissionDialog.openDialog();
}, 40); }, 40);

View File

@@ -54,7 +54,12 @@
<ng-container *ngTemplateOutlet="supplierAndFilter"></ng-container> <ng-container *ngTemplateOutlet="supplierAndFilter"></ng-container>
</ng-container> </ng-container>
<ng-template #spinner> <ng-template #spinner>
<div class="spinner"></div> <div class="content-container">
<div class="first-row"></div>
<div class="second-row"></div>
<div class="third-row"></div>
<div class="fourth-row"></div>
</div>
</ng-template> </ng-template>
</div> </div>
<ng-template #supplierAndFilter> <ng-template #supplierAndFilter>

View File

@@ -227,3 +227,46 @@
margin-top: 25px; margin-top: 25px;
} }
} }
.content-container {
display: flex;
flex-direction: column;
align-items: center;
opacity: 1;
margin-top: 20px;
animation: load 0.75s linear infinite;
.first-row {
height: 20px;
width: 135px;
background-color: #ffffff;
}
.second-row {
height: 20px;
width: 150px;
background-color: #ffffff;
margin-top: 2px;
}
.third-row {
height: 20px;
width: 90px;
background-color: #ffffff;
margin-top: 2px;
}
.fourth-row {
height: 20px;
width: 200px;
background-color: #ffffff;
margin-top: 2px;
}
}
@keyframes load {
50% {
opacity: 0.3;
}
100% {
opacity: 1;
}
}