Fix update testata x cambio TAVOLA

This commit is contained in:
Samuele Locatelli
2023-12-19 15:53:22 +01:00
parent 6428c8bff6
commit b0ce091765
10 changed files with 160 additions and 123 deletions
+4
View File
@@ -10,6 +10,9 @@ namespace MP_TAB3.Components
{
#region Public Properties
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
[Parameter]
public EventCallback<bool> E_Updated { get; set; }
@@ -131,6 +134,7 @@ namespace MP_TAB3.Components
await doUpdate();
isProcessing = false;
await Task.Delay(1);
await E_MachSel.InvokeAsync(selIdxMacc);
}
protected async Task SetOdl(int selIdxOdl)
+12 -9
View File
@@ -11,6 +11,9 @@ namespace MP_TAB3.Components
{
#region Public Properties
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
[Parameter]
public MappaStatoExpl? RecMSE { get; set; } = null;
@@ -44,15 +47,11 @@ namespace MP_TAB3.Components
protected List<RegistroDichiarazioniModel> ListComplete { get; set; } = new List<RegistroDichiarazioniModel>();
protected List<RegistroDichiarazioniModel> ListPaged { get; set; } = new List<RegistroDichiarazioniModel>();
protected void SetEdit(RegistroDichiarazioniModel selRec)
{
CurrRec = selRec;
}
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
@@ -96,6 +95,11 @@ namespace MP_TAB3.Components
UpdateTable();
}
protected void SetEdit(RegistroDichiarazioniModel selRec)
{
CurrRec = selRec;
}
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
@@ -104,6 +108,7 @@ namespace MP_TAB3.Components
await doUpdate();
isProcessing = false;
await Task.Delay(1);
await E_MachSel.InvokeAsync(selIdxMacc);
}
protected async Task SetOdl(int selIdxOdl)
@@ -139,8 +144,6 @@ namespace MP_TAB3.Components
#region Private Fields
private RegistroDichiarazioniModel? CurrRec { get; set; } = null;
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool isProcessing = false;
private int NumRecPage = 10;
@@ -153,7 +156,7 @@ namespace MP_TAB3.Components
#region Private Properties
private Periodo CurrPeriodo { get; set; } = new Periodo();
private RegistroDichiarazioniModel? CurrRec { get; set; } = null;
private string IdxMaccSel { get; set; } = "";
private int IdxOdl { get; set; } = 0;
+71 -71
View File
@@ -92,81 +92,81 @@
</div>
}
@if (!confProdActive)
{
<div class="row textCondens mt-2">
<div class="col-12 py-0 text-start text-uppercase lh-1 fw-bold">
Dati Globali ODL
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2 shadows" style=" background-color: #fff3cd; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[A] NUOVI Pz.Prod</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzProdotti2Rec</span>
}
</div>
<div class="row textCondens mt-2">
<div class="col-12 py-0 text-start text-uppercase lh-1 fw-bold">
Dati Globali ODL
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2 shadows" style=" background-color: #fff3cd; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[A] NUOVI Pz.Prod</span>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #cff4fc; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">Pz Prodotti TOT [A+B+C]</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzProdotti</span>
}
</div>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #f8d7da; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[B] Scarti VERS.</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzScaConf</span>
}
</div>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #d1e7dd; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[C] Pz Buoni VERS.</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzBuoniConf</span>
}
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzProdotti2Rec</span>
}
</div>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #cff4fc; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">Pz Prodotti TOT [A+B+C]</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzProdotti</span>
}
</div>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #f8d7da; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[B] Scarti VERS.</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzScaConf</span>
}
</div>
</div>
</div>
<div class="col-6 col-sm-3 py-1">
<div class="text-center h-100 px-2" style=" background-color: #d1e7dd; border-radius: .5rem;">
<div class="text-truncate lh-sm pt-1">
<span class="text-dark small">[C] Pz Buoni VERS.</span>
</div>
<div class="text-dark d-flex align-items-center text-center justify-content-center">
@if (isProcessing)
{
<i class="fa-solid fa-spinner span"></i>
}
else
{
<span class="fw-bold fs-3">@numPzBuoniConf</span>
}
</div>
</div>
</div>
</div>
@if (!confProdActive)
{
<div class="row textCondens mt-1 py-1">
<div class="col-6">
<a class="btn btn-info btn-sm w-100 py-2 " style="min-width: 6rem;" href="scrap"><i class="fa fa-bug"></i> Reg. SCARTI</a>
+34 -32
View File
@@ -10,47 +10,20 @@ namespace MP_TAB3.Components
{
#region Public Properties
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
[Parameter]
public MappaStatoExpl? RecMSE { get; set; } = null;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Aggiorno valori produzione alla data richiesta...
/// </summary>
/// <param name="newDate"></param>
protected async Task ReloadData()
{
isProcessing = true;
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListComplete = await TabDServ.RegScartiGetFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
}
isProcessing = false;
await Task.Delay(1);
}
protected async Task ForceReload(bool DoClose)
{
if (DoClose)
{
selItem = null;
}
await ReloadData();
}
#endregion Public Methods
#region Protected Properties
protected bool enableScarti { get; set; } = true;
protected List<RegistroScartiModel> ListComplete { get; set; } = new List<RegistroScartiModel>();
protected List<RegistroScartiModel> ListPaged { get; set; } = new List<RegistroScartiModel>();
[Inject]
@@ -66,6 +39,15 @@ namespace MP_TAB3.Components
#region Protected Methods
protected async Task ForceReload(bool DoClose)
{
if (DoClose)
{
selItem = null;
}
await ReloadData();
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
@@ -90,6 +72,25 @@ namespace MP_TAB3.Components
}
}
/// <summary>
/// Aggiorno valori produzione alla data richiesta...
/// </summary>
/// <param name="newDate"></param>
protected async Task ReloadData()
{
isProcessing = true;
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListComplete = await TabDServ.RegScartiGetFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
}
isProcessing = false;
await Task.Delay(1);
}
protected void SaveNumRec(int newNum)
{
NumRecPage = newNum;
@@ -115,6 +116,7 @@ namespace MP_TAB3.Components
await ReloadData();
isProcessing = false;
await Task.Delay(1);
await E_MachSel.InvokeAsync(selIdxMacc);
}
protected async Task SetOdl(int selIdxOdl)
+2 -2
View File
@@ -8,6 +8,6 @@
else
{
<CheckControls RecMSE="CurrMSE"></CheckControls>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ControlsMan RecMSE="CurrMSE" E_Updated="ForceReload"></ControlsMan>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<ControlsMan RecMSE="CurrMSE" E_Updated="ForceReload" E_MachSel="SetMacc"></ControlsMan>
}
+16 -5
View File
@@ -18,6 +18,13 @@ namespace MP_TAB3.Pages
#region Protected Methods
protected async Task ForceReload()
{
IsLoading = true;
await Task.Delay(50);
IsLoading = false;
}
protected override async Task OnInitializedAsync()
{
await ReloadData();
@@ -41,16 +48,20 @@ namespace MP_TAB3.Pages
await InvokeAsync(StateHasChanged);
}
protected async Task ForceReload()
protected void SetMacc(string selIdxMacc)
{
IsLoading = true;
await Task.Delay(50);
IsLoading = false;
IdxMaccSubSel = selIdxMacc;
}
private bool IsLoading = false;
#endregion Protected Methods
#region Private Fields
private string IdxMaccSubSel = "";
private bool IsLoading = false;
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
+2 -2
View File
@@ -8,6 +8,6 @@
else
{
<CheckControls RecMSE="CurrMSE"></CheckControls>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<DeclarMan RecMSE="CurrMSE"></DeclarMan>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<DeclarMan RecMSE="CurrMSE" E_MachSel="SetMacc"></DeclarMan>
}
+11
View File
@@ -41,8 +41,19 @@ namespace MP_TAB3.Pages
await InvokeAsync(StateHasChanged);
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
}
#endregion Protected Methods
#region Private Fields
private string IdxMaccSubSel = "";
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
+2 -2
View File
@@ -8,6 +8,6 @@
else
{
<CheckControls RecMSE="CurrMSE"></CheckControls>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ScrapMan RecMSE="CurrMSE"></ScrapMan>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<ScrapMan RecMSE="CurrMSE" E_MachSel="SetMacc"></ScrapMan>
}
+6
View File
@@ -59,5 +59,11 @@ namespace MP_TAB3.Pages
}
#endregion Private Methods
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
}
private string IdxMaccSubSel = "";
}
}