154 lines
6.8 KiB
Plaintext
154 lines
6.8 KiB
Plaintext
@page "/MeasuringIn"
|
|
@using AyCode.Utils.Extensions
|
|
@using DevExpress.Blazor
|
|
@using DevExpress.Blazor.Internal
|
|
@using FruitBank.Common.Entities
|
|
@using FruitBank.Common.SignalRs
|
|
@using FruitBankHybrid.Shared.Components
|
|
@using FruitBankHybrid.Shared.Services
|
|
@using Mango.Nop.Core.Dtos
|
|
|
|
<h3>Bejövő mérés</h3>
|
|
|
|
<div style="margin-top: 50px;">
|
|
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
|
|
<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" : "")">
|
|
<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>
|
|
}
|
|
}
|
|
|
|
</DayCellTemplate>
|
|
</DxDateEdit>
|
|
</DxFormLayoutItem>
|
|
|
|
<DxFormLayoutItem Caption="Kamion rendszáma:" ColSpanMd="2" CaptionCssClass="@(SelectedShipping?.IsAllMeasured == true ? "text-success" : "")">
|
|
<DxComboBox Data="@NotMeasuredShippings"
|
|
@bind-Value="@SelectedShipping"
|
|
Text="Select licence plate"
|
|
ValueFieldName="@nameof(Shipping.Id)"
|
|
TextFieldName="@nameof(Shipping.LicencePlate)"
|
|
CssClass="cw-480"
|
|
DropDownBodyCssClass="dd-body-class"
|
|
Context="ctxShipping"
|
|
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<Shipping> args) => OnSelectedShippingChanged(args))"
|
|
InputId="cbNotMeasuredShippings">
|
|
<ItemDisplayTemplate>
|
|
<span class="@(ctxShipping.DataItem.IsAllMeasured ? "text-success" : "")">@ctxShipping.DisplayText</span>
|
|
</ItemDisplayTemplate>
|
|
</DxComboBox>
|
|
</DxFormLayoutItem>
|
|
|
|
<DxFormLayoutItem Caption="Partner:" ColSpanMd="3" CaptionCssClass="@(SelectedShippingDocument?.IsAllMeasured == true ? "text-success" : "")">
|
|
<DxComboBox Data="@SelectedShipping?.ShippingDocuments"
|
|
@bind-Value="@SelectedShippingDocument"
|
|
Text="Select partner"
|
|
ValueFieldName="@nameof(ShippingDocument.Id)"
|
|
TextFieldName="@(nameof(ShippingDocument.Partner) + '.' + nameof(Partner.Name))"
|
|
CssClass="cw-480"
|
|
DropDownBodyCssClass="dd-body-class"
|
|
Context="ctxShippingDocument"
|
|
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<ShippingDocument> args) => OnSelectedShippingDocumentChanged(args))"
|
|
InputId="cbShippingDocument">
|
|
<ItemDisplayTemplate>
|
|
<span class="@(ctxShippingDocument.DataItem.IsAllMeasured ? "text-success" : "")">@ctxShippingDocument.DisplayText</span>
|
|
</ItemDisplayTemplate>
|
|
</DxComboBox>
|
|
</DxFormLayoutItem>
|
|
|
|
<DxFormLayoutItem Caption="Termék:" ColSpanMd="5" CaptionCssClass="@(SelectedShippingItem?.IsMeasured == true ? "text-success" : "")">
|
|
<DxComboBox Data="@SelectedShippingDocument?.ShippingItems"
|
|
@bind-Value="@SelectedShippingItem"
|
|
Text="Select item"
|
|
ValueFieldName="@nameof(ShippingItem.Id)"
|
|
TextFieldName="@(nameof(ShippingItem.Name))"
|
|
CssClass="cw-480"
|
|
DropDownBodyCssClass="dd-body-class"
|
|
Context="ctxShippingitem"
|
|
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<ShippingItem> args) => OnSelectedShippingItemChanged(args))"
|
|
InputId="cbShippingItem">
|
|
<ItemDisplayTemplate>
|
|
@* <div class="combobox-item-template">
|
|
<img src="/images/ok_green_lt.jpg" alt="" />
|
|
<span class="icon counter-icon" aria-hidden="true"></span>
|
|
<div class="combobox-item-template-text">
|
|
<span>@ctxShippingitem.DisplayText</span>
|
|
</div>
|
|
</div>
|
|
*@
|
|
<span class="@(ctxShippingitem.DataItem.IsMeasured ? "text-success" : "")">@ctxShippingitem.DisplayText)</span>
|
|
</ItemDisplayTemplate>
|
|
</DxComboBox>
|
|
</DxFormLayoutItem>
|
|
</DxFormLayout>
|
|
</div>
|
|
|
|
<div style="margin-top: 50px;">
|
|
@if (SelectedShippingItem != null && SelectedShippingItem.ProductId.GetValueOrDefault(0) > 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/>
|
|
</DxFormLayoutItem> *@
|
|
|
|
@if (!_errorText.IsNullOrWhiteSpace())
|
|
{
|
|
<DxFormLayoutItem ColSpanMd="12" BeginRow="true">
|
|
<text>HIBA! @_errorText</text>
|
|
</DxFormLayoutItem>
|
|
//_errorText = string.Empty;
|
|
}
|
|
</DxFormLayout>
|
|
}
|
|
</div>
|