* Added validation to not generate more than one PackingList to the same WZ
* Added filtering when found more than one item after scanning
This commit is contained in:
@@ -95,6 +95,17 @@
|
|||||||
</DialogButtons>
|
</DialogButtons>
|
||||||
</SfDialog>
|
</SfDialog>
|
||||||
|
|
||||||
|
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityError" AllowPrerender="true">
|
||||||
|
<DialogTemplates>
|
||||||
|
<Content>
|
||||||
|
<p>Błąd: Dla zaznaczonego rekordu istnieje już PackingList!</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>
|
||||||
@@ -115,6 +126,7 @@
|
|||||||
private bool _isVisible;
|
private bool _isVisible;
|
||||||
|
|
||||||
private bool Visibility { get; set; }
|
private bool Visibility { get; set; }
|
||||||
|
private bool VisibilityError { get; set; }
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
@@ -178,12 +190,20 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string wzNumbers = string.Join(", ",selectedRecords.Select(x => x.MTGroupNum).Distinct());
|
||||||
|
|
||||||
|
if (_wzHeaders.Any(x => x.WzNumbers == wzNumbers))
|
||||||
|
{
|
||||||
|
VisibilityError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
WzHeaderDto wzHeader = new WzHeaderDto
|
WzHeaderDto wzHeader = new WzHeaderDto
|
||||||
{
|
{
|
||||||
ID = Guid.NewGuid(),
|
ID = Guid.NewGuid(),
|
||||||
FK_Client = _selectedClient?.ID,
|
FK_Client = _selectedClient?.ID,
|
||||||
CreatedDate = DateTime.Now,
|
CreatedDate = DateTime.Now,
|
||||||
WzNumbers = string.Join(", ",selectedRecords.Select(x => x.MTGroupNum).Distinct())
|
WzNumbers = wzNumbers
|
||||||
};
|
};
|
||||||
|
|
||||||
await WarehouseService.CreateWzHeaderAsync(wzHeader);
|
await WarehouseService.CreateWzHeaderAsync(wzHeader);
|
||||||
@@ -223,5 +243,6 @@
|
|||||||
private void HideModal()
|
private void HideModal()
|
||||||
{
|
{
|
||||||
Visibility = false;
|
Visibility = false;
|
||||||
|
VisibilityError = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
@page "/Warehouse/PackList/{WzHeader:guid}"
|
@page "/Warehouse/PackList/{WzHeader:guid}"
|
||||||
@using System.Diagnostics
|
@using System.Diagnostics
|
||||||
@using OrdersManagement.Models
|
@using OrdersManagement.Models
|
||||||
|
@using Syncfusion.Blazor
|
||||||
@using Syncfusion.Blazor.Cards
|
@using Syncfusion.Blazor.Cards
|
||||||
|
@using Syncfusion.Blazor.Data
|
||||||
@using Syncfusion.Blazor.Grids
|
@using Syncfusion.Blazor.Grids
|
||||||
@using SytelineSaAppEfDataModel.Dtos
|
@using SytelineSaAppEfDataModel.Dtos
|
||||||
@using Syncfusion.Blazor.Navigations
|
@using Syncfusion.Blazor.Navigations
|
||||||
@using Syncfusion.Blazor.Popups
|
@using Syncfusion.Blazor.Popups
|
||||||
@using Syncfusion.Blazor.Inputs
|
@using Syncfusion.Blazor.Inputs
|
||||||
@using Action = System.Action
|
@using Action = System.Action
|
||||||
|
@using FilterType = Syncfusion.Blazor.Grids.FilterType
|
||||||
|
|
||||||
@inject WarehouseService WarehouseService
|
@inject WarehouseService WarehouseService
|
||||||
|
|
||||||
@@ -65,7 +68,7 @@
|
|||||||
<GridColumn Field=@nameof(WzRowMeyleDto.OrderNumber) AllowEditing="false"
|
<GridColumn Field=@nameof(WzRowMeyleDto.OrderNumber) AllowEditing="false"
|
||||||
TextAlign="TextAlign.Center" HeaderText="Numer Zamówienia Meyle"
|
TextAlign="TextAlign.Center" HeaderText="Numer Zamówienia Meyle"
|
||||||
Width="70"></GridColumn>
|
Width="70"></GridColumn>
|
||||||
<GridColumn Field=@nameof(WzRowMeyleDto.FaIndex) AllowEditing="false"
|
<GridColumn Field=@nameof(WzRowMeyleDto.FaIndex) AllowEditing="false" AllowFiltering="true"
|
||||||
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu FA" Width="100"></GridColumn>
|
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu FA" Width="100"></GridColumn>
|
||||||
<GridColumn Field=@nameof(WzRowMeyleDto.ItemNumber) AllowEditing="false"
|
<GridColumn Field=@nameof(WzRowMeyleDto.ItemNumber) AllowEditing="false"
|
||||||
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu Meyle" Width="100"></GridColumn>
|
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu Meyle" Width="100"></GridColumn>
|
||||||
@@ -299,6 +302,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_grid.Query = null;
|
||||||
|
_grid.ClearFilteringAsync();
|
||||||
|
|
||||||
if (materialTransactionByPartNumber != null)
|
if (materialTransactionByPartNumber != null)
|
||||||
{
|
{
|
||||||
SelectedRows.Clear();
|
SelectedRows.Clear();
|
||||||
@@ -386,10 +392,10 @@
|
|||||||
ChangedRecords.Add(record);
|
ChangedRecords.Add(record);
|
||||||
|
|
||||||
int index = WzRowsMeyle.IndexOf(record);
|
int index = WzRowsMeyle.IndexOf(record);
|
||||||
|
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
{
|
{
|
||||||
selectedIndices.Add(index);
|
selectedIndices.Add(index);
|
||||||
Console.WriteLine($"Dodano indeks: {index}"); // Debugowanie
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,6 +403,10 @@
|
|||||||
SelectedRows.Clear();
|
SelectedRows.Clear();
|
||||||
SelectedRows.AddRange(ChangedRecords);
|
SelectedRows.AddRange(ChangedRecords);
|
||||||
|
|
||||||
|
SelectedRow = SelectedRows.FirstOrDefault();
|
||||||
|
|
||||||
|
await ApplyFilter(ChangedRecords);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -541,4 +551,8 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task ApplyFilter(IList<WzRowMeyleDto> selectedRecords)
|
||||||
|
{
|
||||||
|
await _grid.FilterByColumnAsync(nameof(WzRowMeyleDto.FaIndex), "equal", selectedRecords.First().FaIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user