From 63ccb976be8813e12924e9e2c6f437bb9e17afcb Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 6 Dec 2022 15:09:48 +0100 Subject: [PATCH] disattivo input field dopo lettura codice --- MP.INVE/Components/CodeScan.razor | 7 +++++-- MP.INVE/Components/CodeScan.razor.cs | 8 ++++++++ MP.INVE/Components/ProcSuggestion.razor.cs | 21 +++++++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/MP.INVE/Components/CodeScan.razor b/MP.INVE/Components/CodeScan.razor index d60a1402..c8b47e41 100644 --- a/MP.INVE/Components/CodeScan.razor +++ b/MP.INVE/Components/CodeScan.razor @@ -1,3 +1,6 @@ -
- +
+ +
diff --git a/MP.INVE/Components/CodeScan.razor.cs b/MP.INVE/Components/CodeScan.razor.cs index ad39073a..a924c7b1 100644 --- a/MP.INVE/Components/CodeScan.razor.cs +++ b/MP.INVE/Components/CodeScan.razor.cs @@ -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(); } } diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index 57d284e3..ae0474f4 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -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("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);