This commit is contained in:
Adam 2025-10-21 09:03:49 +02:00
commit fb2d7fbe59
7 changed files with 199 additions and 160 deletions

View File

@ -35,7 +35,8 @@
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.SignalR.Core"> <Reference Include="Microsoft.AspNetCore.SignalR.Core">
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.9\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath> <!--<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.9\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>-->
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.10\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mango.Nop.Core"> <Reference Include="Mango.Nop.Core">
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath> <HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>

View File

@ -5,16 +5,29 @@ namespace FruitBankHybrid.Shared.Extensions;
public static class DevextremeComponentExtension public static class DevextremeComponentExtension
{ {
public static async Task ShowMessageBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle, MessageBoxType messageBoxType = MessageBoxType.Alert) public static async Task ShowMessageBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{
var messageBoxOptions = CreateMessageBoxOptions(title, text, messageBoxRenderStyle);
await messageBox.AlertAsync(messageBoxOptions);
}
public static async Task<bool> ShowConfirmBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{
var messageBoxOptions = CreateMessageBoxOptions(title, text, messageBoxRenderStyle);
return await messageBox.ConfirmAsync(messageBoxOptions);
}
private static MessageBoxOptions CreateMessageBoxOptions(string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{ {
var messageBoxOptions = new MessageBoxOptions var messageBoxOptions = new MessageBoxOptions
{ {
Title = title, Title = title,
Text = text, Text = text,
RenderStyle = messageBoxRenderStyle, RenderStyle = messageBoxRenderStyle,
ShowIcon = false
}; };
return messageBoxOptions;
if (messageBoxType == MessageBoxType.Alert) await messageBox.AlertAsync(messageBoxOptions);
else await messageBox.ConfirmAsync(messageBoxOptions);
} }
} }

View File

@ -11,51 +11,59 @@
<h3>Bejövő mérés</h3> <h3>Bejövő mérés</h3>
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100"> <DxLoadingPanel @bind-Visible="LoadingPanelVisible"
<DxFormLayoutItem Caption="Érkezés dátuma" ColSpanMd="2" CaptionCssClass="@(SelectedShipping != null && _measuringDates.Where(x => MeasuringService.DaysEqual(x.DateTime, SelectedShipping.ShippingDate)).All(x => x.IsMeasured) ? "text-success" : "")"> IsContentBlocked="true"
<DxDateEdit CssClass="cw-320" ApplyBackgroundShading="true"
DisplayFormat="m" IndicatorAreaVisible="true"
Format="m" IsContentVisible="true"
Context="ctxShippingDate" IndicatorAnimationType="WaitIndicatorAnimationType.Spin"
Date="@(SelectedShipping?.ShippingDate.Date ?? DateTime.Now.Date)" Text="Adatok szinkronizálása folyamatban...">
CustomDisabledDate="@OnCustomDisabledMeasuringDate"
DateChanged="@((DateTime newValue) => OnMeasuringDateChanged(newValue))"
InputId="deDisabledDates">
<DayCellTemplate>
@{
var cssClass = GetMeasuringDateCssClassNames(ctxShippingDate);
if (!cssClass.IsNullOrWhiteSpace())
{
<a class="@GetMeasuringDateCssClassNames(ctxShippingDate)">@ctxShippingDate.Day.ToString()</a>
}
else
{
<a>@ctxShippingDate.Day.ToString()</a>
}
}
</DayCellTemplate> <DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
</DxDateEdit> <DxFormLayoutItem Caption="Érkezés dátuma" ColSpanMd="2" CaptionCssClass="@(SelectedShipping != null && _measuringDates.Where(x => MeasuringService.DaysEqual(x.DateTime, SelectedShipping.ShippingDate)).All(x => x.IsMeasured) ? "text-success" : "")">
</DxFormLayoutItem> <DxDateEdit CssClass="cw-320"
DisplayFormat="m"
Format="m"
Context="ctxShippingDate"
Date="@(SelectedShipping?.ShippingDate.Date ?? DateTime.Now.Date)"
CustomDisabledDate="@OnCustomDisabledMeasuringDate"
DateChanged="@((DateTime newValue) => OnMeasuringDateChanged(newValue))"
InputId="deDisabledDates">
<DayCellTemplate>
@{
var cssClass = GetMeasuringDateCssClassNames(ctxShippingDate);
if (!cssClass.IsNullOrWhiteSpace())
{
<a class="@GetMeasuringDateCssClassNames(ctxShippingDate)">@ctxShippingDate.Day.ToString()</a>
}
else
{
<a>@ctxShippingDate.Day.ToString()</a>
}
}
<DxFormLayoutItem Caption="Kamion rendszáma:" ColSpanMd="2" CaptionCssClass="@(SelectedShipping?.IsAllMeasured == true ? "text-success" : "")"> </DayCellTemplate>
<DxComboBox Data="@NotMeasuredShippings" </DxDateEdit>
@bind-Value="@SelectedShipping" </DxFormLayoutItem>
Text="Select licence plate"
ValueFieldName="@nameof(Shipping.Id)" <DxFormLayoutItem Caption="Kamion rendszáma:" ColSpanMd="2" CaptionCssClass="@(SelectedShipping?.IsAllMeasured == true ? "text-success" : "")">
TextFieldName="@nameof(Shipping.LicencePlate)" <DxComboBox Data="@NotMeasuredShippings"
CssClass="cw-480" @bind-Value="@SelectedShipping"
DropDownBodyCssClass="dd-body-class" Text="Select licence plate"
Context="ctxShipping" ValueFieldName="@nameof(Shipping.Id)"
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<Shipping> args) => OnSelectedShippingChanged(args))" TextFieldName="@nameof(Shipping.LicencePlate)"
InputId="cbNotMeasuredShippings"> CssClass="cw-480"
<ItemDisplayTemplate> DropDownBodyCssClass="dd-body-class"
<span class="@(ctxShipping.DataItem.IsAllMeasured ? "text-success" : "")">@ctxShipping.DisplayText</span> Context="ctxShipping"
</ItemDisplayTemplate> SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<Shipping> args) => OnSelectedShippingChanged(args))"
</DxComboBox> InputId="cbNotMeasuredShippings">
</DxFormLayoutItem> <ItemDisplayTemplate>
<span class="@(ctxShipping.DataItem.IsAllMeasured ? "text-success" : "")">@ctxShipping.DisplayText</span>
@* <DxFormLayoutItem Caption="Partner:" ColSpanMd="3" CaptionCssClass="@(SelectedShippingDocument?.IsAllMeasured == true ? "text-success" : "")"> </ItemDisplayTemplate>
</DxComboBox>
</DxFormLayoutItem>
@* <DxFormLayoutItem Caption="Partner:" ColSpanMd="3" CaptionCssClass="@(SelectedShippingDocument?.IsAllMeasured == true ? "text-success" : "")">
<DxComboBox Data="@SelectedShipping?.ShippingDocuments" <DxComboBox Data="@SelectedShipping?.ShippingDocuments"
@bind-Value="@SelectedShippingDocument" @bind-Value="@SelectedShippingDocument"
Text="Select partner" Text="Select partner"
@ -72,26 +80,26 @@
</DxComboBox> </DxComboBox>
</DxFormLayoutItem> </DxFormLayoutItem>
*@ *@
<DxFormLayoutItem Caption="Termék:" ColSpanMd="5" CaptionCssClass="@(SelectedShippingItem?.IsMeasured == true ? "text-success" : "")"> <DxFormLayoutItem Caption="Termék:" ColSpanMd="5" CaptionCssClass="@(SelectedShippingItem?.IsMeasured == true ? "text-success" : "")">
<DxComboBox Data="@_shippingItemsDataSource" <DxComboBox Data="@_shippingItemsDataSource"
@bind-Value="@SelectedShippingItem" @bind-Value="@SelectedShippingItem"
Text="Select item" Text="Select item"
ValueFieldName="@nameof(ShippingItem.Id)" ValueFieldName="@nameof(ShippingItem.Id)"
TextFieldName="@(nameof(ShippingItem.Name))" TextFieldName="@(nameof(ShippingItem.Name))"
CssClass="cw-480" CssClass="cw-480"
SearchMode="ListSearchMode.AutoSearch" SearchMode="ListSearchMode.AutoSearch"
SearchFilterCondition="ListSearchFilterCondition.Contains" SearchFilterCondition="ListSearchFilterCondition.Contains"
SearchTextParseMode="ListSearchTextParseMode.GroupWordsByAnd" SearchTextParseMode="ListSearchTextParseMode.GroupWordsByAnd"
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
DropDownTriggerMode="DropDownTriggerMode.Click" DropDownTriggerMode="DropDownTriggerMode.Click"
ListRenderMode="ListRenderMode.Entire" ListRenderMode="ListRenderMode.Entire"
ShowDropDownButton="false" ShowDropDownButton="false"
DropDownBodyCssClass="dd-body-class" DropDownBodyCssClass="dd-body-class"
Context="ctxShippingitem" Context="ctxShippingitem"
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<ShippingItem> args) => OnSelectedShippingItemChanged(args))" SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<ShippingItem> args) => OnSelectedShippingItemChanged(args))"
InputId="cbShippingItem"> InputId="cbShippingItem">
<ItemDisplayTemplate> <ItemDisplayTemplate>
@* <div class="combobox-item-template"> @* <div class="combobox-item-template">
<img src="/images/ok_green_lt.jpg" alt="" /> <img src="/images/ok_green_lt.jpg" alt="" />
<span class="icon counter-icon" aria-hidden="true"></span> <span class="icon counter-icon" aria-hidden="true"></span>
<div class="combobox-item-template-text"> <div class="combobox-item-template-text">
@ -100,76 +108,77 @@
</div> </div>
*@ *@
<span class="@(ctxShippingitem.DataItem.IsMeasured ? "text-success" : "")">@ctxShippingitem.DisplayText)</span> <span class="@(ctxShippingitem.DataItem.IsMeasured ? "text-success" : "")">@ctxShippingitem.DisplayText)</span>
</ItemDisplayTemplate> </ItemDisplayTemplate>
</DxComboBox> </DxComboBox>
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Partner:" ColSpanMd="3" CaptionCssClass="@(SelectedShippingItem?.ShippingDocument?.IsAllMeasured == true ? "text-success" : "")">
@{
var sd = SelectedShippingItem?.ShippingDocument;
if (sd != null)
{
var partnerName = sd.Partner?.Name;
<span class="@(sd.IsAllMeasured == true ? " text-success" : "")">
@($"{partnerName}, {sd.ShippingItems?.Count(si => si.IsMeasured) ?? 0}/{sd.ShippingItems?.Count ?? 0} kész.")
</span>
}
}
</DxFormLayoutItem>
</DxFormLayout>
</div>
<div style="margin-top: 50px;">
@if (SelectedShippingItem is { ProductId: > 0 })
{
<h3 style="margin-bottom: 30px;" class="@(SelectedShippingItem.IsMeasured && SelectedShippingItem.ShippingItemPallets!.All(x => x.IsMeasuredAndValid(SelectedShippingItem.IsMeasurable)) ? "text-success" : "")">
@SelectedShippingItem.Name
</h3>
<DxFormLayout Data="@SelectedShippingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Context="ctxShippingItemFromLayoutItem" ColSpanMd="12">
@for (var index = 0; index < (SelectedShippingItem?.ShippingItemPallets?.Count ?? 0); index++)
{
var localI = index + 1;
var currentShippingItemPallet = SelectedShippingItem!.ShippingItemPallets![index];
<PalletItemComponent IsMeasurable="@SelectedShippingItem.IsMeasurable"
MeasuringIndex="@localI"
PalletItem="@currentShippingItemPallet"
ProductId="@SelectedShippingItem.ProductId!.Value"
AddOrUpdateSignalRTag="SignalRTags.AddOrUpdateMeasuredShippingItemPallet"
OnPalletItemSaved="pallet => OnShippingItemPalletSaved(pallet)"
OnPalletItemValueChanged="pallet => OnShippingItemPalletValueChanged(pallet, SelectedShippingItem)">
</PalletItemComponent>
}
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Context="vfdfgfd" ColSpanMd="12" BeginRow="true"> <DxFormLayoutItem Caption="Partner:" ColSpanMd="3" CaptionCssClass="@(SelectedShippingItem?.ShippingDocument?.IsAllMeasured == true ? "text-success" : "")">
<DxFormLayout CssClass="w-100"> @{
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>TOTAL:</strong></DxFormLayoutItem> var sd = SelectedShippingItem?.ShippingDocument;
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"/> if (sd != null)
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"/> {
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"/> var partnerName = sd.Partner?.Name;
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredQuantity) db</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredGrossWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredNetWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"/>
</DxFormLayout>
</DxFormLayoutItem>
@* <DxFormLayoutItem ColSpanMd="12" BeginRow="true"> <span class="@(sd.IsAllMeasured == true ? " text-success" : "")">
@($"{partnerName}, {sd.ShippingItems?.Count(si => si.IsMeasured) ?? 0}/{sd.ShippingItems?.Count ?? 0} kész.")
</span>
}
}
</DxFormLayoutItem>
</DxFormLayout>
<div style="margin-top: 50px;">
@if (SelectedShippingItem is { ProductId: > 0 })
{
<h3 style="margin-bottom: 30px;" class="@(SelectedShippingItem.IsMeasured && SelectedShippingItem.ShippingItemPallets!.All(x => x.IsMeasuredAndValid(SelectedShippingItem.IsMeasurable)) ? "text-success" : "")">
@SelectedShippingItem.Name
</h3>
<DxFormLayout Data="@SelectedShippingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Context="ctxShippingItemFromLayoutItem" ColSpanMd="12">
@for (var index = 0; index < (SelectedShippingItem?.ShippingItemPallets?.Count ?? 0); index++)
{
var localI = index + 1;
var currentShippingItemPallet = SelectedShippingItem!.ShippingItemPallets![index];
<PalletItemComponent IsMeasurable="@SelectedShippingItem.IsMeasurable"
MeasuringIndex="@localI"
PalletItem="@currentShippingItemPallet"
ProductId="@SelectedShippingItem.ProductId!.Value"
AddOrUpdateSignalRTag="SignalRTags.AddOrUpdateMeasuredShippingItemPallet"
OnPalletItemSaved="pallet => OnShippingItemPalletSaved(pallet)"
OnPalletItemValueChanged="pallet => OnShippingItemPalletValueChanged(pallet, SelectedShippingItem)">
</PalletItemComponent>
}
</DxFormLayoutItem>
<DxFormLayoutItem Context="vfdfgfd" ColSpanMd="12" BeginRow="true">
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>TOTAL:</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="2" BeginRow="false" />
<DxFormLayoutItem ColSpanMd="2" BeginRow="false" />
<DxFormLayoutItem ColSpanMd="1" BeginRow="false" />
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredQuantity) db</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredGrossWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>@(SelectedShippingItem.MeasuredNetWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false" />
</DxFormLayout>
</DxFormLayoutItem>
@* <DxFormLayoutItem ColSpanMd="12" BeginRow="true">
<ValidationSummary/> <ValidationSummary/>
</DxFormLayoutItem> *@ </DxFormLayoutItem> *@
@if (!_errorText.IsNullOrWhiteSpace()) @if (!_errorText.IsNullOrWhiteSpace())
{ {
<DxFormLayoutItem ColSpanMd="12" BeginRow="true"> <DxFormLayoutItem ColSpanMd="12" BeginRow="true">
<text>HIBA! @_errorText</text> <text>HIBA! @_errorText</text>
</DxFormLayoutItem> </DxFormLayoutItem>
//_errorText = string.Empty; //_errorText = string.Empty;
}
</DxFormLayout>
} }
</DxFormLayout> </div>
} </DxLoadingPanel>
</div> </div>

View File

@ -29,6 +29,7 @@ namespace FruitBankHybrid.Shared.Pages
//private ShippingDocument? SelectedShippingDocument { get; set; } //private ShippingDocument? SelectedShippingDocument { get; set; }
private ShippingItem? SelectedShippingItem { get; set; } private ShippingItem? SelectedShippingItem { get; set; }
public bool LoadingPanelVisible { get; set; } = true;
protected bool BtnSaveEnabled { get; set; } protected bool BtnSaveEnabled { get; set; }
private List<ShippingItem>? _shippingItemsDataSource; private List<ShippingItem>? _shippingItemsDataSource;
@ -36,6 +37,8 @@ namespace FruitBankHybrid.Shared.Pages
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
LoadingPanelVisible = true;
_logger = new LoggerClient<MeasuringIn>(LogWriters.ToArray()); _logger = new LoggerClient<MeasuringIn>(LogWriters.ToArray());
_logger.Info("OnInitializedAsync"); _logger.Info("OnInitializedAsync");
@ -51,6 +54,8 @@ namespace FruitBankHybrid.Shared.Pages
NotMeasuredShippings = shippings.Where(shipping => MeasuringService.DaysEqual(shipping.ShippingDate.Date, dateTime)).ToList(); NotMeasuredShippings = shippings.Where(shipping => MeasuringService.DaysEqual(shipping.ShippingDate.Date, dateTime)).ToList();
SelectedShipping = NotMeasuredShippings.FirstOrDefault(); SelectedShipping = NotMeasuredShippings.FirstOrDefault();
LoadingPanelVisible = false;
} }
private static List<ShippingItem>? GetShippingItemsDataSource(Shipping? shipping) private static List<ShippingItem>? GetShippingItemsDataSource(Shipping? shipping)

View File

@ -12,13 +12,14 @@
<DxDialogProvider /> <DxDialogProvider />
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<DxLoadingPanel @bind-Visible="LoadingPanelVisible" <DxLoadingPanel @bind-Visible="LoadingPanelVisible"
IsContentBlocked="true" IsContentBlocked="true"
ApplyBackgroundShading="true" ApplyBackgroundShading="true"
IndicatorAreaVisible="true" IndicatorAreaVisible="true"
IsContentVisible="true" IsContentVisible="true"
IndicatorAnimationType="WaitIndicatorAnimationType.Spin" IndicatorAnimationType="WaitIndicatorAnimationType.Spin"
Text="Adatok betöltése..."> Text="Adatok szinkronizálása folyamatban...">
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100"> <DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Caption="Átvétel dátuma" ColSpanMd="2" <DxFormLayoutItem Caption="Átvétel dátuma" ColSpanMd="2"
@ -69,19 +70,25 @@
</DxComboBox> </DxComboBox>
</DxFormLayoutItem> </DxFormLayoutItem>
@if (HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0) @switch (SelectedOrder)
{ {
<DxFormLayoutItem ColSpanMd="2"> case null:
<DxButton Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0)" Visible="@(SelectedOrder != null)" CssClass="w-100" <DxFormLayoutItem ColSpanMd="2" />
Text="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0 ? "Mérés indítása" : "Mérés folyamatban...")" break;
Click="() => OnStartMeasuringClick()" />
</DxFormLayoutItem> case { MeasurementOwnerId: 0, IsComplete: false } when HasMeasuringAccess:
} <DxFormLayoutItem ColSpanMd="2">
else <DxButton Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0)" Visible="@(SelectedOrder != null)" CssClass="w-100"
{ Text="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0 ? "Mérés indítása" : "Mérés folyamatban...")"
<DxFormLayoutItem ColSpanMd="2" Caption="Mérést indította" CaptionCssClass="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")"> Click="() => OnStartMeasuringClick()" />
<DxTextBox Enabled="false" Text="@(LoggedInModel.MeasuringUsers.FirstOrDefault(x => x.Id == SelectedOrder?.MeasurementOwnerId)?.Email)" /> </DxFormLayoutItem>
</DxFormLayoutItem> break;
default:
<DxFormLayoutItem ColSpanMd="2" Caption="Mérést indította" CaptionCssClass="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")">
<DxTextBox Enabled="false" Text="@(LoggedInModel.MeasuringUsers.FirstOrDefault(x => x.Id == SelectedOrder?.MeasurementOwnerId)?.FullName)" />
</DxFormLayoutItem>
break;
} }
<DxFormLayoutItem ColSpanMd="1"></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="1"></DxFormLayoutItem>
@ -96,7 +103,7 @@
} }
</DxFormLayout> </DxFormLayout>
@if (SelectedOrder == null) @if (SelectedOrder == null || LoadingPanelVisible)
{ {
} }
else if (!HasMeasuringAccess) else if (!HasMeasuringAccess)
@ -110,9 +117,9 @@
//Átvétel dátuma október 23. [AUDITED] 15:51 - Vegetable Kft. Rendelés azonosító: #8 //Átvétel dátuma október 23. [AUDITED] 15:51 - Vegetable Kft. Rendelés azonosító: #8
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<h3 style="margin-bottom: 30px;" class="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")"> <h4 style="margin-bottom: 30px;" class="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")">
Rendelés azonosító: #@(SelectedOrder?.CustomOrderNumber) Rendelés azonosító: #@(SelectedOrder?.CustomOrderNumber)
</h3> </h4>
<DxAccordion Data="@SelectedOrder?.OrderItemDtos" Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId > 0 && !(SelectedOrder?.IsComplete ?? false))" <DxAccordion Data="@SelectedOrder?.OrderItemDtos" Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId > 0 && !(SelectedOrder?.IsComplete ?? false))"
ExpandMode="AccordionExpandMode.SingleOrNone" ExpandMode="AccordionExpandMode.SingleOrNone"

View File

@ -56,7 +56,7 @@ namespace FruitBankHybrid.Shared.Pages
private async Task RefreshOrdersFromDb(DateTime dateTime) private async Task RefreshOrdersFromDb(DateTime dateTime)
{ {
LoadingPanelVisible = true; LoadingPanelVisible = true;
var orders = (await FruitBankSignalRClient.GetPendingOrderDtos() ?? []);//.Where(o => o.HasMeasuringAccess(LoggedInModel.CustomerDto?.Id, LoggedInModel.IsRevisor)).ToList(); var orders = (await FruitBankSignalRClient.GetPendingOrderDtos() ?? []).Where(o => o.HasMeasuringAccess(LoggedInModel.CustomerDto?.Id, LoggedInModel.IsRevisor)).ToList();
_measuringDates = orders.Select(order => new MeasuringDateSelectorModel(order.Id, order.DateOfReceiptOrCreated, order.IsMeasured)).ToList(); _measuringDates = orders.Select(order => new MeasuringDateSelectorModel(order.Id, order.DateOfReceiptOrCreated, order.IsMeasured)).ToList();
@ -140,7 +140,7 @@ namespace FruitBankHybrid.Shared.Pages
selectedOrderItemDto.OrderItemPallets.UpdateCollection(orderItemPallet, false); selectedOrderItemDto.OrderItemPallets.UpdateCollection(orderItemPallet, false);
//MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(SelectedShippingItem); //MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(SelectedShippingItem);
} }
else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt!", MessageBoxRenderStyle.Danger); else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
StateHasChanged(); StateHasChanged();
} }
@ -195,19 +195,22 @@ namespace FruitBankHybrid.Shared.Pages
{ {
if (SelectedOrder != null && LoggedInModel.IsRevisor && SelectedOrder.IsMeasured && SelectedOrder.OrderStatus != OrderStatus.Complete) if (SelectedOrder != null && LoggedInModel.IsRevisor && SelectedOrder.IsMeasured && SelectedOrder.OrderStatus != OrderStatus.Complete)
{ {
var responseOrderDto = await FruitBankSignalRClient.SetOrderStatusToComplete(SelectedOrder.Id, LoggedInModel.CustomerDto!.Id); if (await DialogService.ShowConfirmBoxAsync("Megerősítés", "Biztoan jóváhagyja a rendelést? Jóváhagyás után a mérések nem módosíthatóak!", MessageBoxRenderStyle.Danger))
if (responseOrderDto != null)
{ {
PrepareOrderDto(responseOrderDto); var responseOrderDto = await FruitBankSignalRClient.SetOrderStatusToComplete(SelectedOrder.Id, LoggedInModel.CustomerDto!.Id);
if (responseOrderDto != null)
{
PrepareOrderDto(responseOrderDto);
SelectedDayOrders.UpdateCollection(responseOrderDto, false); SelectedDayOrders.UpdateCollection(responseOrderDto, false);
SelectedOrder = responseOrderDto; SelectedOrder = responseOrderDto;
//await DialogService.ShowMessageBoxAsync("Információ", "Adatok mentése sikeres volt!", MessageBoxRenderStyle.Info); //await DialogService.ShowMessageBoxAsync("Információ", "Adatok mentése sikeres volt!", MessageBoxRenderStyle.Info);
}
else await DialogService.ShowMessageBoxAsync("Hiba", "Rendelés jóváhagyása sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
StateHasChanged();
} }
else await DialogService.ShowMessageBoxAsync("Hiba", "Rendelés jóváhagyása sikertelen volt!", MessageBoxRenderStyle.Danger);
StateHasChanged();
} }
} }

View File

@ -1,5 +1,6 @@
html, body { html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
min-height: 100vh;
} }
a, .btn-link { a, .btn-link {