* Added divs to containers
This commit is contained in:
@@ -11,121 +11,127 @@
|
||||
@using SelectionType = Syncfusion.Blazor.Grids.SelectionType
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<h5>Zamówienia Klienta EDI</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label for="checked" style="padding: 10px 10px 10px 0">Pokaż wszystkie</label>
|
||||
<SfSwitch @bind-Checked="_filter" ValueChange="FilterChanged" TChecked="bool?" OnLabel="Pokaż tylko Wysłanr do SL" OffLabel="Pokaż wszystkie" />
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
@if (_isVisible)
|
||||
{
|
||||
<div class="container-fluid h-100">
|
||||
<h5>Zamówienia Klienta EDI</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<SfButton @onclick="SendOrderToSyteLine">@_text</SfButton>
|
||||
<label for="checked" style="padding: 10px 10px 10px 0">Pokaż wszystkie</label>
|
||||
<SfSwitch @bind-Checked="_filter" ValueChange="FilterChanged" TChecked="bool?"
|
||||
OnLabel="Pokaż tylko Wysłanr do SL" OffLabel="Pokaż wszystkie"/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
}
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="EdiCustomerOrderDto"
|
||||
DataSource="@_ediCustomerOrders"
|
||||
EnableAdaptiveUI="true">
|
||||
<GridTemplates>
|
||||
<DetailTemplate>
|
||||
@{
|
||||
var order = context as EdiCustomerOrderDto;
|
||||
<SfCard>
|
||||
<CardContent>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<u>Numer zamówienia EDI:</u> <b>@order?.CustomerOrderNumber</b><br/>
|
||||
<u>Numer zamówienia Klienta:</u> <b>@order?.CustomerPoNumber</b><br/>
|
||||
<u>Numer klienta:</u> <b>@order?.CustomerNumber</b><br/>
|
||||
<u>Klient:</u> <b>@order?.CustomerName</b><br/>
|
||||
<u>Numer odbiorcy:</u> <b>@(order?.CustomerSequence?.ToString() ?? "N/A")</b><br/>
|
||||
<u>Data
|
||||
otrzymania:</u> <b>@(order?.RecivedDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
<u>Wysłano do
|
||||
Syteline?:</u> <b>@((order?.Posted?.ToString() ?? "0") == "0" ? "NIE" : "TAK")</b><br/>
|
||||
<u>Data wysyłki do
|
||||
Syteline:</u> <b>@(order?.PostedDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
<u>Data zamówienia:</u> <b>@(order?.OrderDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
@if (_isVisible)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<SfButton @onclick="SendOrderToSyteLine">@_text</SfButton>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
}
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="EdiCustomerOrderDto"
|
||||
DataSource="@_ediCustomerOrders"
|
||||
EnableAdaptiveUI="true">
|
||||
<GridTemplates>
|
||||
<DetailTemplate>
|
||||
@{
|
||||
var order = context as EdiCustomerOrderDto;
|
||||
<SfCard>
|
||||
<CardContent>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<u>Numer zamówienia EDI:</u> <b>@order?.CustomerOrderNumber</b><br/>
|
||||
<u>Numer zamówienia Klienta:</u> <b>@order?.CustomerPoNumber</b><br/>
|
||||
<u>Numer klienta:</u> <b>@order?.CustomerNumber</b><br/>
|
||||
<u>Klient:</u> <b>@order?.CustomerName</b><br/>
|
||||
<u>Numer
|
||||
odbiorcy:</u> <b>@(order?.CustomerSequence?.ToString() ?? "N/A")</b><br/>
|
||||
<u>Data
|
||||
otrzymania:</u> <b>@(order?.RecivedDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
<u>Wysłano do
|
||||
Syteline?:</u> <b>@((order?.Posted?.ToString() ?? "0") == "0" ? "NIE" : "TAK")</b><br/>
|
||||
<u>Data wysyłki do
|
||||
Syteline:</u> <b>@(order?.PostedDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
<u>Data
|
||||
zamówienia:</u> <b>@(order?.OrderDate?.ToString("dd.MM.yyyy") ?? "N/A")</b><br/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<u>Cena:</u> <b>@(order?.Price?.ToString("F2") ?? "N/A")</b><br/>
|
||||
<u>Waga:</u> <b>@(order?.Weight?.ToString("F2") ?? "N/A")</b><br/>
|
||||
<u>Magazyn:</u> <b>@order?.Warehouse</b><br/>
|
||||
<u>Gate:</u> <b>@order?.Gate</b><br/>
|
||||
<u>Kod odbiorcy:</u> <b>@order?.RecipientCode</b><br/>
|
||||
<u>Kod wysyłającego:</u> <b>@order?.SenderCode</b><br/>
|
||||
<u>Kod sprzedawcy:</u> <b>@order?.SellerCode</b><br/>
|
||||
<u>Kod kupującego:</u> <b>@order?.BuyerCode</b><br/>
|
||||
<u>Typ dokumentu:</u> <b>@order?.DocType</b><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<u>Cena:</u> <b>@(order?.Price?.ToString("F2") ?? "N/A")</b><br/>
|
||||
<u>Waga:</u> <b>@(order?.Weight?.ToString("F2") ?? "N/A")</b><br/>
|
||||
<u>Magazyn:</u> <b>@order?.Warehouse</b><br/>
|
||||
<u>Gate:</u> <b>@order?.Gate</b><br/>
|
||||
<u>Kod odbiorcy:</u> <b>@order?.RecipientCode</b><br/>
|
||||
<u>Kod wysyłającego:</u> <b>@order?.SenderCode</b><br/>
|
||||
<u>Kod sprzedawcy:</u> <b>@order?.SellerCode</b><br/>
|
||||
<u>Kod kupującego:</u> <b>@order?.BuyerCode</b><br/>
|
||||
<u>Typ dokumentu:</u> <b>@order?.DocType</b><br/>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
}
|
||||
</DetailTemplate>
|
||||
</GridTemplates>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerOrderNumber) HeaderText="Numer Zamówienia"
|
||||
Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerPoNumber) HeaderText="Zamówienie Klienta"
|
||||
Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerNumber) HeaderText="Numer Klienta"
|
||||
Width="90"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerSequence) HeaderText="Odbiorca" Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CreateDate) HeaderText="Data Otrzymania"
|
||||
TextAlign="TextAlign.Center" Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.SlOrderNumber) HeaderText="Zamówienie SL"
|
||||
Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.SentToSl) HeaderText="Wysłane do SL"
|
||||
TextAlign="TextAlign.Center" Width="80"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="10"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Multiple"/>
|
||||
<GridEvents TValue="EdiCustomerOrderDto" OnRecordDoubleClick="OnRowDoubleClick" RowSelected="RowSelected" />
|
||||
</SfGrid>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
}
|
||||
</DetailTemplate>
|
||||
</GridTemplates>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerOrderNumber) HeaderText="Numer Zamówienia"
|
||||
Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerPoNumber) HeaderText="Zamówienie Klienta"
|
||||
Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerNumber) HeaderText="Numer Klienta"
|
||||
Width="90"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CustomerSequence) HeaderText="Odbiorca"
|
||||
Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.CreateDate) HeaderText="Data Otrzymania"
|
||||
TextAlign="TextAlign.Center" Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.SlOrderNumber) HeaderText="Zamówienie SL"
|
||||
Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(EdiCustomerOrderDto.SentToSl) HeaderText="Wysłane do SL"
|
||||
TextAlign="TextAlign.Center" Width="80"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="10"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Multiple"/>
|
||||
<GridEvents TValue="EdiCustomerOrderDto" OnRecordDoubleClick="OnRowDoubleClick" RowSelected="RowSelected"/>
|
||||
</SfGrid>
|
||||
|
||||
<SfDialog Width="500px" Title="@_text" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_responses.Any(x => x.Status == 1))
|
||||
{
|
||||
foreach (ResponseDto response in _responses.Where(x => x.Status == 1))
|
||||
<SfDialog Width="500px" Title="@_text" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_responses.Any(x => x.Status == 1))
|
||||
{
|
||||
<p>Zamówienie EDI @response.Identifier zostało poprawnie zaksięgowane w Zamówieniach klienta pod
|
||||
numerem '@response.ExternalIdentifier'</p>
|
||||
foreach (ResponseDto response in _responses.Where(x => x.Status == 1))
|
||||
{
|
||||
<p>Zamówienie EDI @response.Identifier zostało poprawnie zaksięgowane w Zamówieniach klienta pod
|
||||
numerem '@response.ExternalIdentifier'</p>
|
||||
}
|
||||
}
|
||||
}
|
||||
@if (_responses.Any(x => x.Status == 0))
|
||||
{
|
||||
foreach (ResponseDto response in _responses.Where(x => x.Status == 0))
|
||||
@if (_responses.Any(x => x.Status == 0))
|
||||
{
|
||||
<p>Błąd: Zamówienie EDI @response.Identifier nie zostało poprawnie zaksięgowane w Zamówieniach
|
||||
klienta.<br/>Lista błędów:<br/>@response.Message</p>
|
||||
foreach (ResponseDto response in _responses.Where(x => x.Status == 0))
|
||||
{
|
||||
<p>Błąd: Zamówienie EDI @response.Identifier nie zostało poprawnie zaksięgowane w Zamówieniach
|
||||
klienta.<br/>Lista błędów:<br/>@response.Message</p>
|
||||
}
|
||||
}
|
||||
}
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private bool Visibility { get; set; }
|
||||
|
||||
|
||||
private SfGrid<EdiCustomerOrderDto>? _grid;
|
||||
|
||||
|
||||
private IEnumerable<EdiCustomerOrderDto> _ediCustomerOrders = [];
|
||||
private List<EdiCustomerOrderDto> _selectedEdiCustomerOrders = new();
|
||||
|
||||
@@ -167,13 +173,13 @@
|
||||
}
|
||||
|
||||
Visibility = true;
|
||||
|
||||
|
||||
await LoadData();
|
||||
|
||||
|
||||
_grid?.Refresh();
|
||||
|
||||
_isVisible = false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -185,7 +191,7 @@
|
||||
private async Task RowSelected(RowSelectEventArgs<EdiCustomerOrderDto> obj)
|
||||
{
|
||||
List<EdiCustomerOrderDto> selectedRecords = await _grid.GetSelectedRecordsAsync();
|
||||
|
||||
|
||||
_isVisible = false;
|
||||
|
||||
if (!selectedRecords.Any()) return;
|
||||
@@ -210,9 +216,10 @@
|
||||
{
|
||||
_ediCustomerOrders = _ediCustomerOrders.Where(x => x.Posted == 0).ToList();
|
||||
}
|
||||
|
||||
|
||||
_ediCustomerOrders = _ediCustomerOrders.OrderByDescending(x => x.CreateDate).ToList();
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user