Skip to content

Commit f42f782

Browse files
committed
STYLE: split stages in tables
1 parent b9a12af commit f42f782

File tree

5 files changed

+60
-22
lines changed

5 files changed

+60
-22
lines changed

Src/Apps/Tablet/Pl.Tablet.Client/Source/Pages/Create/CompleteCreateDialog.razor

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@using Pl.Tablet.Client.Source.Shared.Constants
21
@using Blazor.Heroicons.Outline
32

43
@implements IDialogContentComponent

Src/Apps/Tablet/Pl.Tablet.Client/Source/Pages/Create/CreatePage.razor

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
@using TscZebra.Plugin.Abstractions.Enums
2-
@using Pl.Tablet.Models.Features.Pallets.Output
3-
42
@implements IDisposable
53

64
@attribute [Route($"{Routes.Create}")]
75

86
<div class="size-full flex flex-col">
97
<PageHeader Title="Формирование паллеты" />
108
<div class="size-full max-w-screen-md mx-auto flex flex-col p-6">
11-
<div class="w-full flex flex-col shrink-0 gap-2 pb-6">
12-
<div class="flex flex-col border-b gap-1 pb-3 mb-3">
13-
<h2 class="text-2xl font-semibold">Документ паллеты</h2>
14-
<h3 class="text-muted-foreground">
15-
Отсканируйте с помощью камеры штрихкод документа паллеты или введите значение штрихкода самостоятельно
16-
</h3>
17-
</div>
18-
<InputDocumentNumber @bind-Value="@DocumentNumber" Disabled="@Pallets.Any()"/>
19-
</div>
20-
<div class="w-full flex flex-col max-h-full overflow-hidden">
21-
<PalletDataGrid @bind-Value="Pallets" DocumentNumber="@DocumentNumber"/>
22-
</div>
23-
<div class="w-full shrink-0 flex justify-end pt-3">
24-
<Button OnClick="@ShowCreateCompleteDialog">
25-
Завершить
26-
</Button>
27-
</div>
9+
@if (CurrentTabIndex == 1)
10+
{
11+
<DocumentStage
12+
@bind-Value="@DocumentNumber"
13+
OnSubmitAction="@(() => CurrentTabIndex = 2)"/>
14+
}
15+
else if (CurrentTabIndex == 2)
16+
{
17+
<PalletsStage
18+
DocumentNumber="@DocumentNumber"
19+
OnSubmitAction="@ShowCreateCompleteDialog"
20+
/>
21+
}
2822
</div>
2923
</div>
3024

3125
@code {
3226
[Inject] private IDialogService DialogService { get; set; } = default!;
3327
[Inject] private IPrinterService PrinterService { get; set; } = default!;
3428

35-
private List<PalletDto> Pallets { get; set; } = [];
29+
private int CurrentTabIndex { get; set; } = 1;
3630
private string DocumentNumber { get; set; } = string.Empty;
3731

3832
protected override async Task OnInitializedAsync()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<div class="w-full flex shrink-0 flex-col gap-2">
2+
<div class="flex flex-col border-b gap-1 pb-3 mb-3">
3+
<h2 class="text-2xl font-semibold">Документ паллеты</h2>
4+
<h3 class="text-muted-foreground">
5+
Отсканируйте с помощью камеры штрихкод документа паллеты или введите значение штрихкода самостоятельно
6+
</h3>
7+
</div>
8+
<InputDocumentNumber
9+
@bind-Value="@Value"
10+
@bind-Value:after="@OnValueChanged"
11+
/>
12+
</div>
13+
<div class="size-full flex grow items-end justify-end pb-4">
14+
<Button
15+
OnClick="@OnSubmitAction"
16+
Disabled="@string.IsNullOrEmpty(Value)"
17+
>
18+
Продолжить
19+
</Button>
20+
</div>
21+
22+
@code {
23+
[Parameter, EditorRequired] public string Value { get; set; } = string.Empty;
24+
[Parameter] public EventCallback<string> ValueChanged { get; set; }
25+
[Parameter] public EventCallback OnSubmitAction { get; set; }
26+
27+
private async Task OnValueChanged() => await ValueChanged.InvokeAsync(Value);
28+
}

Src/Apps/Tablet/Pl.Tablet.Client/Source/Pages/Create/PalletDataGrid.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@using Pl.Tablet.Client.Source.Pages.Create.CreatePalletDialog
33
@using Pl.Tablet.Models.Features.Pallets.Output
44

5-
<div class="w-full flex flex-col gap-0.5 pb-3 border-b mb-5">
5+
<div class="w-full flex flex-col gap-1 pb-3 border-b mb-5">
66
<div class="flex w-full gap-2 items-center justify-between">
77
<h2 class="font-semibold text-2xl">Сформированные паллеты</h2>
88
<Button
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@using Pl.Tablet.Models.Features.Pallets.Output
2+
3+
<div class="w-full flex flex-col max-h-full overflow-hidden">
4+
<PalletDataGrid @bind-Value="Pallets" DocumentNumber="@DocumentNumber"/>
5+
</div>
6+
<div class="w-full shrink-0 flex grow items-end justify-end pt-3">
7+
<Button OnClick="@OnSubmitAction">
8+
Завершить
9+
</Button>
10+
</div>
11+
12+
@code {
13+
[Parameter, EditorRequired] public string DocumentNumber { get; set; } = string.Empty;
14+
[Parameter] public EventCallback OnSubmitAction { get; set; }
15+
16+
private List<PalletDto> Pallets { get; set; } = [];
17+
}

0 commit comments

Comments
 (0)