Inizio inserimento pagina PODL
This commit is contained in:
@@ -9,6 +9,12 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool isActive { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string StatoSel
|
||||
{
|
||||
@@ -18,8 +24,11 @@ namespace MP.SPEC.Components
|
||||
if (_statoSel != value)
|
||||
{
|
||||
_statoSel = value;
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
pUpd.Wait();
|
||||
if (isActive)
|
||||
{
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,9 +97,6 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
private string _statoSel = "*";
|
||||
|
||||
private ODLModel? currRecord = null;
|
||||
@@ -140,11 +146,18 @@ namespace MP.SPEC.Components
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListODLFilt(true, SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
if (isActive)
|
||||
{
|
||||
SearchRecords = await MDService.ListODLFilt(true, SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay(1);
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool isActive { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string StatoSel
|
||||
{
|
||||
@@ -18,8 +24,11 @@ namespace MP.SPEC.Components
|
||||
if (_statoSel != value)
|
||||
{
|
||||
_statoSel = value;
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
pUpd.Wait();
|
||||
if (isActive)
|
||||
{
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,9 +97,6 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
private string _statoSel = "*";
|
||||
|
||||
private PODLModel? currRecord = null;
|
||||
@@ -140,11 +146,18 @@ namespace MP.SPEC.Components
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
if (isActive)
|
||||
{
|
||||
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay(1);
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
+192
-8
@@ -2,11 +2,20 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
<h2>Ordini Di Lavoro </h2>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<h2>Ordini Di Lavoro </h2>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-success" disabled="!@addEnabled" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<div class="col-2">
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
ODL Programmati / In Corso
|
||||
@@ -30,19 +39,194 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (reqNew)
|
||||
{
|
||||
<div class="d-flex justify-content-around">
|
||||
<div class="px-2">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">Azienda</span>
|
||||
<select @bind="@currAzienda" class="form-select">
|
||||
@if (ListAziende != null)
|
||||
{
|
||||
foreach (var item in ListAziende.Where(x => x.CodGruppo != "*").ToList())
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">Art Search</span>
|
||||
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-around">
|
||||
<div class="px-2">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">Articolo</span>
|
||||
<select @bind="@currAzienda" class="form-select">
|
||||
@if (ListAziende != null)
|
||||
{
|
||||
foreach (var item in ListAziende.Where(x => x.CodGruppo != "*").ToList())
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</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)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-light">Modifica PODL</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>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (showCurrent)
|
||||
@if (showODL)
|
||||
{
|
||||
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListODL>
|
||||
<ListODL StatoSel="@selStato" PagerResetReq="pgResetReq" isActive="@showODL"></ListODL>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListPODL StatoSel="@selStato" PagerResetReq="pgResetReq"></ListPODL>
|
||||
<ListPODL StatoSel="@selStato" PagerResetReq="pgResetReq" isActive="@(!showODL)"></ListPODL>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -43,16 +43,60 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private MP.Data.DatabaseModels.ODLModel? currRecordOdl = null;
|
||||
private MP.Data.DatabaseModels.PODLModel? currRecordPOdl = null;
|
||||
|
||||
/// <summary>
|
||||
/// Crea nuovo record e va in editing...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task addNew()
|
||||
{
|
||||
currRecordPOdl = new MP.Data.DatabaseModels.PODLModel()
|
||||
{
|
||||
CodArticolo = $"_NEW_{DateTime.Now:yyyyMMdd.HHmmss}"
|
||||
};
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected async Task cancel()
|
||||
{
|
||||
currRecordOdl = null;
|
||||
currRecordPOdl = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected DataPager pagerODL;
|
||||
|
||||
protected bool reqNew = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Crea nuovo record e va in editing...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task reqNewPODL()
|
||||
{
|
||||
reqNew = !reqNew;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// abilito ricerca...
|
||||
MessageService.ShowSearch = true;
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
// carico dati
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
private string currAzienda { get; set; } = "*";
|
||||
|
||||
private List<MP.Data.DatabaseModels.AnagGruppi>? ListAziende;
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -78,12 +122,36 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
|
||||
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 showCurrent { get; set; } = false;
|
||||
private bool showODL { get; set; } = false;
|
||||
|
||||
private bool addEnabled = false;
|
||||
|
||||
private string textToggle
|
||||
{
|
||||
get => showCurrent ? "In Corso" : "Programmati";
|
||||
get => showODL ? "In Corso" : "Programmati";
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
@@ -99,13 +167,13 @@ namespace MP.SPEC.Pages
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task toggleCurrent()
|
||||
{
|
||||
showCurrent = !showCurrent;
|
||||
showODL = !showODL;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@page "/PODL"
|
||||
|
||||
|
||||
<h3>PODL</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user