disattivo input field dopo lettura codice
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
<div class="input-group input-group-sm">
|
||||
<input @bind="LastScan" class="fs-6 text-center mb-2 form-control" @ref="@target" style="width: 17rem;" />
|
||||
<div class="input-group input-group-sm mb-2">
|
||||
<input @bind="LastScan" class="fs-6 text-center form-control @css" @ref="@target" style="width: 17rem;" />
|
||||
<button class="btn btn-sm btn-primary" @onclick="()=>newScan()">
|
||||
<i class="fa-solid fa-qrcode"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace MP.INVE.Components
|
||||
|
||||
public SelectScanParams currParams = new SelectScanParams();
|
||||
protected string _lastScan = "";
|
||||
protected string css = "";
|
||||
protected string LastScan
|
||||
{
|
||||
get => _lastScan;
|
||||
@@ -62,6 +63,13 @@ namespace MP.INVE.Components
|
||||
Task.FromResult(lastRawScan.InvokeAsync(scanToSend));
|
||||
}
|
||||
LastScan = "";
|
||||
css = "disabilita";
|
||||
}
|
||||
|
||||
private async void newScan()
|
||||
{
|
||||
css = "";
|
||||
await target.FocusAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace MP.INVE.Components
|
||||
protected AnagLottoModel? currLotto;
|
||||
protected bool alertScan;
|
||||
protected bool isScannedLotto;
|
||||
protected string firstMsg = "";
|
||||
protected bool firstMsg = false;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
firstMsg = "Iniziare la prima scansione";
|
||||
firstMsg = true;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
@@ -118,20 +118,25 @@ namespace MP.INVE.Components
|
||||
if (lotto != null)
|
||||
{
|
||||
tipo = "LOTTO";
|
||||
#if false
|
||||
var alertMod = await JSRuntime.InvokeAsync<bool>("confirm", $"L'oggetto {lastScan} risulta presente nelle nostre anagrafiche con i seguenti dati: \nTipo: {tipo}\nLotto: {lotto.Lotto}\nArticolo: {lotto.CodArt} \nSi desidera modificarlo?");
|
||||
currLotto = lotto;
|
||||
if (alertMod)
|
||||
{
|
||||
lottoScan = lotto.Lotto;
|
||||
articoloScan = lotto.CodArt;
|
||||
}
|
||||
else
|
||||
{
|
||||
insertScan();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
lottoScan = lotto.Lotto;
|
||||
articoloScan = lotto.CodArt;
|
||||
}
|
||||
else
|
||||
{
|
||||
currLotto = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
lottoScan = "";
|
||||
articoloScan = "";
|
||||
quantitaScan = 0;
|
||||
@@ -192,7 +197,7 @@ namespace MP.INVE.Components
|
||||
Qty = qtaLotto,
|
||||
Note = currLotto.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = true,
|
||||
IsUnique = false,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
@@ -211,8 +216,8 @@ namespace MP.INVE.Components
|
||||
RifExt = alreadyScan.RifExt,
|
||||
Qty = alreadyScan.Qty,
|
||||
Note = alreadyScan.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = true,
|
||||
IsKnown = alreadyScan.IsKnown,
|
||||
IsUnique = alreadyScan.IsUnique,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
|
||||
Reference in New Issue
Block a user