gestione scansione x udc,

lotto,
codice già scansionato
This commit is contained in:
zaccaria.majid
2022-12-05 18:28:39 +01:00
parent 1923ce960e
commit a4669bd670
10 changed files with 195 additions and 50 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
<div class="input-group input-group-sm">
<input @bind="LastScan" class="fs-6 text-center mb-2 form-control @cssHide" @ref="@target" style="width: 17rem;" />
<input @bind="LastScan" class="fs-6 text-center mb-2 form-control" @ref="@target" style="width: 17rem;" />
</div>
-1
View File
@@ -54,7 +54,6 @@ namespace MP.INVE.Components
}
}
protected string cssHide { get; set; } = "";
private void saveSel(string scanToSend)
{
+46 -11
View File
@@ -8,20 +8,20 @@
<li>totalmente ignoto</li>
</ul>*@
@if (currUdc != null)
@if (currUdc != null || currLotto != null)
{
<ul class="p-0">
<li class="list-group-item">
Lotto:
<div class="input-group input-group-sm">
<input class="form-control" value="@currUdc.lottoNav.Lotto" disabled />
<input class="form-control" value="@lottoScan" disabled />
<span class="input-group-text" id="basic-addon1">@tipo</span>
</div>
</li>
<li class="list-group-item">
Articolo:
<div class="input-group input-group-sm">
<input class="form-control @reqArtMod" @bind-value="@currUdc.lottoNav.CodArt" type="text" />
<input class="form-control @reqArtMod" @bind-value="@articoloScan" type="text" />
@if (canMod != "false")
{
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary">
@@ -33,7 +33,7 @@
<li class="list-group-item">
Quantità:
<div class="input-group input-group-sm">
<input class="form-control @reqQtaMod" @bind-value="@currUdc.Qta" type="number" />
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
@if (canMod != "false")
{
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
@@ -45,22 +45,57 @@
<li class="list-group-item">
Note:
<div class="input-group input-group-sm">
<input class="form-control " @bind-value="@currUdc.Note" type="text" />
<input class="form-control " @bind-value="@noteScan" type="text" />
</div>
</li>
</ul>
<div class="btn-group col-12" role="group" aria-label="Basic example">
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
<button type="button" class="btn btn-danger col-6">Annulla</button>
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
</div>
}
else if (alreadyScan != null)
{
<ul class="p-0">
<li class="list-group-item">
Codice Scannerizzato:
<div class="input-group input-group-sm">
<input class="form-control" value="@alreadyScan.ScanValue" disabled />
</div>
</li>
<li class="list-group-item">
Articolo:
<div class="input-group input-group-sm">
<input class="form-control @reqArtMod" @bind-value="@alreadyScan.CodArticolo" type="text" />
<button title="Mod articolo" @onclick="@cssDisableArt" class="btn btn-sm btn-primary">
<i class="fa-solid fa-pen-to-square"></i>
</button>
</div>
</li>
<li class="list-group-item">
Quantità:
<div class="input-group input-group-sm">
<input class="form-control @reqQtaMod" @bind-value="@alreadyScan.Qty" type="number" />
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
<i class="fa-solid fa-pen-to-square"></i>
</button>
</div>
</li>
<li class="list-group-item">
Note:
<div class="input-group input-group-sm">
<input class="form-control " @bind-value="@noteScan" type="text" />
</div>
</li>
</ul>
<div class="btn-group col-12" role="group" aria-label="Basic example">
<button type="button" class="btn btn-success col-6" @onclick="()=>updateScansione(alreadyScan)">Conferma</button>
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
</div>
}
else
{
<div class="alert alert-danger" role="alert">
<span class="fw-bold fs-3">
CODICE ERRATO
</span>
</div>
<div class="alert bg-danger">NO RECORD FOUND</div>
}
+129 -23
View File
@@ -40,43 +40,84 @@ namespace MP.INVE.Components
private string tipo { get; set; } = "";
private string canMod = "false";
protected List<AnagUdcModel>? searchrecords;
protected List<AnagUdcModel>? searchRecordsUDC;
protected List<AnagLottoModel>? searchRecordsLotto;
protected List<ScanDataModel>? elencoScansioni;
protected AnagUdcModel? udc;
protected AnagLottoModel? lotto;
protected ScanDataModel? alreadyScan;
protected AnagUdcModel? currUdc;
protected AnagLottoModel? currLotto;
protected override async Task OnParametersSetAsync()
{
await MIService.ConfigResetCache();
var result = await MIService.tryGetConfig("MAG_SmartUdcEdit");
if (result != null)
{
canMod = result;
}
await Task.Delay(1);
searchrecords = MIService.ElencoUDC();
udc = searchrecords.Where(x => x.UDC == lastScan).FirstOrDefault();
elencoScansioni = MIService.ScanList();
var exists = elencoScansioni.Select(x => x.ScanValue).Contains(lastScan);
if (udc != null)
if (exists)
{
currUdc = udc;
if (udc.UDC.Contains("MFI"))
var alert = await JSRuntime.InvokeAsync<bool>("confirm", $"L'oggetto {lastScan} è già stato scannerizzato, si desidera modificarlo?");
if (alert)
{
tipo = "FINITO";
alreadyScan = elencoScansioni.Where(x => x.ScanValue == lastScan).FirstOrDefault();
}
}
else
{
await MIService.ConfigResetCache();
var result = await MIService.tryGetConfig("MAG_SmartUdcEdit");
if (result != null)
{
canMod = result;
}
await Task.Delay(1);
searchRecordsUDC = MIService.ElencoUDC();
udc = searchRecordsUDC.Where(x => x.UDC == lastScan).FirstOrDefault();
if (udc != null && !udc.UDC.Contains("MSL"))
{
currUdc = udc;
tipo = "UDC";
lottoScan = udc.lottoNav.Lotto;
articoloScan = udc.lottoNav.CodArt;
quantitaScan = udc.Qta;
noteScan = udc.Note;
}
else
{
searchRecordsLotto = MIService.ElencoLotti();
lotto = searchRecordsLotto.Where(x => x.Lotto == lastScan).FirstOrDefault();
if (lotto != null)
{
currLotto = lotto;
tipo = "LOTTO";
lottoScan = lotto.Lotto;
articoloScan = lotto.CodArt;
}
else
{
lottoScan = "";
articoloScan = "";
quantitaScan = 0;
noteScan = "";
}
}
}
}
protected bool isForced = false;
protected decimal qtaLotto = 0;
protected async void insertScan()
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler salvare la seguente scansione per la sessione {sessID}?");
if (currUdc != null)
if (alert)
{
if (alert)
if (currUdc != null)
{
if((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta))
if ((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta))
{
isForced = true;
}
@@ -97,19 +138,84 @@ namespace MP.INVE.Components
IsUnique = true,
InveSessID = sessID
};
await MIService.InsertNewScansione(newScan);
NavManager.NavigateTo(NavManager.Uri, true);
}
else if (currLotto != null)
{
ScanDataModel newScan = new ScanDataModel()
{
DtScan = DateTime.Now,
UserScan = userScan,
ScanValue = lastScan,
IsForced = true,
CodArticolo = currLotto.CodArt,
Lotto = currLotto.Lotto,
RifExt = currLotto.RifExt,
Qty = qtaLotto,
Note = currLotto.Note,
IsKnown = true,
IsUnique = true,
InveSessID = sessID
};
await MIService.InsertNewScansione(newScan);
NavManager.NavigateTo(NavManager.Uri, true);
}
}
else
{
NavManager.NavigateTo(NavManager.Uri, true);
}
}
protected async void updateScansione(ScanDataModel modScan)
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler modificare la seguente scansione {modScan.ScanValue}?");
if (alert)
{
if (alreadyScan != null)
{
modScan.CodArticolo = alreadyScan.CodArticolo;
modScan.Qty = alreadyScan.Qty;
modScan.Note = alreadyScan.Note;
}
await MIService.UpdateScan(modScan);
}
}
public void resetAll()
{
NavManager.NavigateTo(NavManager.Uri, true);
}
protected string reqArtMod = "disabilita";
protected string reqQtaMod = "disabilita";
protected string _lotto = "";
protected string lottoScan
{
get => _lotto;
set => _lotto = value;
}
protected string _articolo = "";
protected string articoloScan
{
get => _articolo;
set => _articolo = value;
}
protected decimal _qta = 0;
protected decimal quantitaScan
{
get => _qta;
set => _qta = value;
}
protected string _note = "";
protected string noteScan
{
get => _note;
set => _note = value;
}
protected void cssDisableArt()
{
reqArtMod = "";
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.INVE</RootNamespace>
<Version>6.16.2212.515</Version>
<Version>6.16.2212.518</Version>
</PropertyGroup>
<ItemGroup>
+9 -5
View File
@@ -4,14 +4,18 @@
<div class="mb-2">
<div class="d-flex justify-content-between">
<h3 class="fw-bold">Acquisizione</h3>
<button class="btn btn-sm btn-danger"><i class="fa-solid fa-trash-can"></i></button>
<h3 class="fw-bold">Acquisizione</h3>
</div>
</div>
<div class="col-12">
<CodeScan lastRawScan="saveScan"></CodeScan>
</div>
<div class="card mb-3">
<div class="card mb-5">
<div class="card-header">
<div class="col-12">
Last scan: <b>@rawScan</b>
</div>
</div>
<div class="card-body">
@*if (rawScan != null)
{
@@ -22,8 +26,8 @@
</div>
<div class="card-footer">
<div class="col-12">
Last scan: @rawScan
<div>
Scansioni per la sessione @sessionId: @nScansioniTot
</div>
</div>
</div>
+6 -5
View File
@@ -33,10 +33,12 @@ namespace MP.INVE.Pages
private SelectScanParams currParams = new SelectScanParams();
private bool logged { get;set; } = false;
private bool logged { get; set; } = false;
protected string rawScan { get; set; } = null!;
protected string idOPeratore { get; set; } = null!;
protected int sessionId { get; set; } = 0;
protected int nScansioniTot { get; set; } = 0;
protected List<ScanDataModel>? eleScansioni;
//protected AnagUdcModel currUdc{ get; set; } = null!;
protected override async Task OnInitializedAsync()
{
@@ -46,15 +48,14 @@ namespace MP.INVE.Pages
{
idOPeratore = _matrOpr;
sessionId = int.Parse(_inveSessionId);
eleScansioni = MIService.ScanBySession(sessionId);
nScansioniTot = eleScansioni.Count();
}
}
protected void saveScan(string newScan)
{
rawScan = newScan;
}
//protected void saveUdc(AnagUdcModel newUdc)
//{
// currUdc = newUdc;
//}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2212.515</h4>
<h4>Versione: 6.16.2212.518</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2212.515
6.16.2212.518
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2212.515</version>
<version>6.16.2212.518</version>
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>