Warehouses #1

Merged
trent merged 159 commits from Warehouses into master 2026-01-10 20:24:17 +00:00
Showing only changes of commit 08171522b9 - Show all commits

View File

@@ -130,6 +130,32 @@
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/> <DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
</DialogButtons> </DialogButtons>
</SfDialog> </SfDialog>
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityIndexQty"
AllowPrerender="true">
<DialogTemplates>
<Content>
<p>Nie znaleziono indeksu z ilością sztuk ('<b>@IndexWithQty</b>') odpowiadającemu skanowanym wartościom!</p>
<p>Znaleziono indeks, który ma ilość sztuk: '<b>@IndexQty</b>'!</p>
<p><b>Uzupełnij numer palety ręcznie i kliknij 'Zapisz'!</b></p>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
</DialogButtons>
</SfDialog>
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityNotFound"
AllowPrerender="true">
<DialogTemplates>
<Content>
<p>Na liście nie znaleziono skanowanego numeru partii '<b>@NotFoundItem</b>'!</p>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
</DialogButtons>
</SfDialog>
<CardFooter> <CardFooter>
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small> <small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
</CardFooter> </CardFooter>
@@ -154,7 +180,9 @@
private bool _isValid; private bool _isValid;
private bool Visibility { get; set; } private bool Visibility { get; set; }
public bool VisibilityPalletNumber { get; set; } private bool VisibilityPalletNumber { get; set; }
private bool VisibilityIndexQty { get; set; }
private bool VisibilityNotFound { get; set; }
private string? EmailAddresses { get; set; } = string.Empty; private string? EmailAddresses { get; set; } = string.Empty;
private string PalletNumber { get; set; } = "0"; private string PalletNumber { get; set; } = "0";
@@ -164,13 +192,22 @@
private bool IsDisabled => SelectedRow == null; private bool IsDisabled => SelectedRow == null;
private string IndexWithQty { get; set; } = string.Empty;
private string IndexQty { get; set; } = string.Empty;
private string NotFoundItem { get; set; } = string.Empty;
private void HideModal() private void HideModal()
{ {
Visibility = false; Visibility = false;
VisibilityPalletNumber = false; VisibilityPalletNumber = false;
VisibilityIndexQty = false;
VisibilityNotFound = false;
LastScannedValue = ScannedValue; LastScannedValue = ScannedValue;
ScannedValue = string.Empty; ScannedValue = string.Empty;
IndexQty = string.Empty;
IndexWithQty = string.Empty;
NotFoundItem = string.Empty;
_scanner.FocusAsync(); _scanner.FocusAsync();
} }
@@ -206,6 +243,7 @@
} }
await _grid.EndEditAsync(); await _grid.EndEditAsync();
await _grid.ClearSelectionAsync();
} }
private async Task OnBatchSave(BeforeBatchSaveArgs<WzRowMarelliDto> obj) private async Task OnBatchSave(BeforeBatchSaveArgs<WzRowMarelliDto> obj)
@@ -258,6 +296,11 @@
SelectedRows.Clear(); SelectedRows.Clear();
FillPalletNumber(materialTransactionByPartNumber, obj.Value.Trim()); FillPalletNumber(materialTransactionByPartNumber, obj.Value.Trim());
} }
else
{
NotFoundItem = ScannedValue;
VisibilityNotFound = true;
}
LastScannedValue = ScannedValue; LastScannedValue = ScannedValue;
ScannedValue = string.Empty; ScannedValue = string.Empty;
@@ -285,6 +328,16 @@
var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0); var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0);
if (!validCombinations.Any() && SelectedRows.Count > 0)
{
IndexWithQty = $"{materialTransactionByPartNumber.ItemNumber}, Qty = {materialTransactionByPartNumber.Quantity}";
IndexQty = SelectedRows.First().Quantity.ToString() ?? "0";
VisibilityIndexQty = true;
await ApplyFilter(SelectedRows);
break;
}
foreach (var combination in validCombinations) foreach (var combination in validCombinations)
{ {
foreach (var record in combination) foreach (var record in combination)
@@ -406,7 +459,7 @@
private async Task ApplyFilter(IList<WzRowMarelliDto> selectedRecords) private async Task ApplyFilter(IList<WzRowMarelliDto> selectedRecords)
{ {
await _grid.FilterByColumnAsync(nameof(WzRowMarelliDto.FaIndex), "equal", selectedRecords.First().FaIndex); await _grid.FilterByColumnAsync(nameof(WzRowMarelliDto.ItemNumber), "equal", selectedRecords.First().ItemNumber);
} }
private void ChangeView() private void ChangeView()