disattivo input field dopo lettura codice

This commit is contained in:
zaccaria.majid
2022-12-06 15:09:48 +01:00
parent 04fb635d2f
commit 63ccb976be
3 changed files with 26 additions and 10 deletions
+5 -2
View File
@@ -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>
+8
View File
@@ -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();
}
}
+13 -8
View File
@@ -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);