From 08171522b946b014b220e1fa7bc2fe27e18885e1 Mon Sep 17 00:00:00 2001 From: trencik91 Date: Mon, 29 Sep 2025 11:11:37 +0200 Subject: [PATCH] * Fixed issue with not correctly filtering grid * Added validation --- .../Marelli/MarelliPackList.razor | 59 ++++++++++++++++++- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/OrdersManagement/Components/Pages/PackingLists/Marelli/MarelliPackList.razor b/OrdersManagement/Components/Pages/PackingLists/Marelli/MarelliPackList.razor index accd200..c934687 100644 --- a/OrdersManagement/Components/Pages/PackingLists/Marelli/MarelliPackList.razor +++ b/OrdersManagement/Components/Pages/PackingLists/Marelli/MarelliPackList.razor @@ -130,6 +130,32 @@ + + + + +

Nie znaleziono indeksu z ilością sztuk ('@IndexWithQty') odpowiadającemu skanowanym wartościom!

+

Znaleziono indeks, który ma ilość sztuk: '@IndexQty'!

+

Uzupełnij numer palety ręcznie i kliknij 'Zapisz'!

+
+
+ + + +
+ + + + +

Na liście nie znaleziono skanowanego numeru partii '@NotFoundItem'!

+
+
+ + + +
FA Krosno Manager © @(DateTime.Now.Year) @@ -154,7 +180,9 @@ private bool _isValid; 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 PalletNumber { get; set; } = "0"; @@ -164,13 +192,22 @@ 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() { Visibility = false; VisibilityPalletNumber = false; - + VisibilityIndexQty = false; + VisibilityNotFound = false; + LastScannedValue = ScannedValue; ScannedValue = string.Empty; + IndexQty = string.Empty; + IndexWithQty = string.Empty; + NotFoundItem = string.Empty; _scanner.FocusAsync(); } @@ -206,6 +243,7 @@ } await _grid.EndEditAsync(); + await _grid.ClearSelectionAsync(); } private async Task OnBatchSave(BeforeBatchSaveArgs obj) @@ -258,6 +296,11 @@ SelectedRows.Clear(); FillPalletNumber(materialTransactionByPartNumber, obj.Value.Trim()); } + else + { + NotFoundItem = ScannedValue; + VisibilityNotFound = true; + } LastScannedValue = ScannedValue; ScannedValue = string.Empty; @@ -285,6 +328,16 @@ 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 record in combination) @@ -406,7 +459,7 @@ private async Task ApplyFilter(IList selectedRecords) { - await _grid.FilterByColumnAsync(nameof(WzRowMarelliDto.FaIndex), "equal", selectedRecords.First().FaIndex); + await _grid.FilterByColumnAsync(nameof(WzRowMarelliDto.ItemNumber), "equal", selectedRecords.First().ItemNumber); } private void ChangeView()