- FIX Selezione stato comemssa e filtraggio
This commit is contained in:
Samuele Locatelli
2022-09-13 14:40:54 +02:00
parent 681aa44b32
commit 00a0fc81ce
8 changed files with 80 additions and 176 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
<div class="col-5">
<div class="d-flex justify-content-between">
<div class="px-2">
<h2>Ordini Di Lavoro </h2>
<h4><b>ODL</b></h4>
</div>
<div class="px-2">
<button class="btn btn-success" disabled="!@addEnabled" @onclick="() => reqNewPODL()">Nuovo ODL <i class="bi bi-plus-square"></i></button>
@@ -218,7 +218,7 @@
}
</div>
<div class="card-body">
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq" isActive="true"></ListODL>
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListODL>
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
+3 -71
View File
@@ -7,7 +7,7 @@
<div class="col-5">
<div class="d-flex justify-content-between">
<div class="px-2">
<h2>Ordini Di Lavoro </h2>
<h4><b>P</b>romesse <b>ODL</b></h4>
</div>
<div class="px-2">
<button class="btn btn-success" disabled="!@addEnabled" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
@@ -80,75 +80,7 @@
</div>
</div>
}
else if (currRecordOdl != null)
{
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header bg-primary text-light">Modifica ODL</div>
<div class="card-body">
@*<div class="row">
<div class="col-4">
<div class="input-group">
<span class="input-group-text">Codice</span>
<input type="text" class="form-control" placeholder="Articolo" @bind-value="@currRecord.CodArticolo">
</div>
</div>
<div class="col-4">
<div class="input-group">
<span class="input-group-text">Disegno</span>
<input type="text" class="form-control" placeholder="Disegno" @bind-value="@currRecord.Disegno">
</div>
</div>
<div class="col-1">
<div class="input-group" title="Tipo">
<select @bind="@currRecord.Tipo" class="form-select text-end">
@if (ListTipoArt != null)
{
foreach (var item in ListTipoArt)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
<div class="col-3">
<div class="input-group" title="Azienda">
<select @bind="@currRecord.Azienda" class="form-select text-end">
@if (ListAziende != null)
{
foreach (var item in ListAziende.Where(x => x.CodGruppo != "*").ToList())
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>
</div>
</div>
</div>
<div class="row mt-2">
<div class="col-8">
<input type="text" class="form-control" placeholder="Descrizione Articolo" @bind-value="@currRecord.DescArticolo">
</div>
<div class="col-2">
<div class="d-grid gap-2">
<button class="btn btn-warning" @onclick="() => cancel()">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-2">
<div class="d-grid gap-2">
<button class="btn btn-success" @onclick="() => update(currRecord)">Salva <i class="bi bi-save"></i></button>
</div>
</div>
</div>*@
</div>
</div>
</div>
</div>
}
else if (currRecordPOdl != null)
else if (currRecord != null)
{
<div class="row">
<div class="col-12">
@@ -219,7 +151,7 @@
}
</div>
<div class="card-body">
<ListPODL StatoSel="@selStato" PagerResetReq="pgResetReq" isActive="true"></ListPODL>
<ListPODL PagerResetReq="pgResetReq"></ListPODL>
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
+8 -36
View File
@@ -44,8 +44,7 @@ namespace MP.SPEC.Pages
}
private MP.Data.DatabaseModels.ODLModel? currRecordOdl = null;
private MP.Data.DatabaseModels.PODLModel? currRecordPOdl = null;
private MP.Data.DatabaseModels.PODLModel? currRecord = null;
/// <summary>
/// Crea nuovo record e va in editing...
@@ -53,7 +52,7 @@ namespace MP.SPEC.Pages
/// <returns></returns>
protected async Task addNew()
{
currRecordPOdl = new MP.Data.DatabaseModels.PODLModel()
currRecord = new MP.Data.DatabaseModels.PODLModel()
{
CodArticolo = $"_NEW_{DateTime.Now:yyyyMMdd.HHmmss}"
};
@@ -62,8 +61,7 @@ namespace MP.SPEC.Pages
protected async Task cancel()
{
currRecordOdl = null;
currRecordPOdl = null;
currRecord = null;
await reloadData();
await Task.Delay(1);
}
@@ -123,38 +121,14 @@ namespace MP.SPEC.Pages
set => MsgService.numRecord = value;
}
private string selStato { get; set; } = "*";
#if false
private string selStato
{
get => _selStato;
set
{
if (!_selStato.Equals(value))
{
_selStato = value;
addEnabled = selStato != "*";
////StateHasChanged();
//var pUpd = Task.Run(async () =>
//{
// //await reloadData();
// await Task.Delay(1);
// await InvokeAsync(() => StateHasChanged());
//});
//pUpd.Wait();
}
}
}
#endif
//private bool showPODL { get; set; } = false;
get => MsgService.StateSel;
set => MsgService.StateSel = value;
}
private bool addEnabled = false;
//private string textToggle
//{
// get => showPODL ? "In Corso" : "Programmati";
//}
private int totalCount
{
@@ -173,12 +147,10 @@ namespace MP.SPEC.Pages
isLoading = false;
}
//private async Task toggleCurrent()
//{
// NavManager.NavigateTo("/ODL");
//}
private async Task navToODL()
{
await Task.Delay(1);
NavManager.NavigateTo("/ODL");
}