* Added fields for scanning barcodes
This commit is contained in:
@@ -20,6 +20,16 @@
|
||||
<SfTextBox ID="textBox" Placeholder="Wprowadź adresy..." @bind-Value="@EmailAddresses" CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard>
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Wprowadź numer palety:</label>
|
||||
<SfTextBox ID="palletNumber" Type="InputType.Number" @bind-Value="@PalletNumber" CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowana wartość:</label>
|
||||
<SfTextBox ID="scannedValue" @onkeydown="ScanValue" @bind-Value="ScannedValue" CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowane wartości:</label>
|
||||
<SfTextBox ID="scannedText" Multiline="true" @bind-Value="@ScannedValues" Readonly="true" CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
@@ -107,7 +117,14 @@
|
||||
|
||||
private bool Visibility { get; set; }
|
||||
|
||||
private string EmailAddresses { get; set; } = string.Empty;
|
||||
private string? EmailAddresses { get; set; } = string.Empty;
|
||||
private string PalletNumber { get; set; } = "0";
|
||||
private string ScannedValues { get; set; } = string.Empty;
|
||||
|
||||
private IDictionary<string, string?> ScannedValuesWithItems { get; set; } = new Dictionary<string, string?>();
|
||||
|
||||
private string LastScannedValue { get; set; } = string.Empty;
|
||||
private string ScannedValue { get; set; } = string.Empty;
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
@@ -121,6 +138,8 @@
|
||||
_wzHeader = await WarehouseService.GetWzHeaderByIdAsync(WzHeader);
|
||||
_wzRowsMeyle = await WarehouseService.GetWzRowsByWzHeaderId(WzHeader);
|
||||
|
||||
_wzRowsMeyle.ToList().ForEach(x => ScannedValuesWithItems.Add(x.ItemNumber.Replace(" ", ""), null));
|
||||
|
||||
EmailAddresses = _wzHeader.EmailAddresses;
|
||||
|
||||
StateHasChanged();
|
||||
@@ -166,4 +185,21 @@
|
||||
|
||||
Visibility = true;
|
||||
}
|
||||
|
||||
private void ScanValue(KeyboardEventArgs obj)
|
||||
{
|
||||
if (obj.Key != "Enter") return;
|
||||
|
||||
LastScannedValue = ScannedValue.Trim();
|
||||
|
||||
if (!ScannedValuesWithItems.ContainsKey(ScannedValues.Replace(" ", "").Trim()) && ScannedValuesWithItems.ContainsKey(LastScannedValue.Replace(" ", "").Trim()))
|
||||
{
|
||||
ScannedValuesWithItems[LastScannedValue] = ScannedValue.Trim();
|
||||
ScannedValues += $"{ScannedValue})\n";
|
||||
}
|
||||
else if(!string.IsNullOrWhiteSpace(ScannedValue))
|
||||
{
|
||||
ScannedValues += $"{ScannedValue}: ";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user