Update display articoli
This commit is contained in:
@@ -80,7 +80,15 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public Task<List<AnagArticoli>> ArticoliGetSearch(int numRecord, string azienda, string searchVal)
|
||||
{
|
||||
return Task.FromResult(dbController.ArticoliGetSearch(numRecord,azienda, searchVal));
|
||||
return Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice elenco aziende
|
||||
/// <returns></returns>
|
||||
public Task<List<AnagGruppi>> ElencoAziende()
|
||||
{
|
||||
return Task.FromResult(dbController.AnagGruppiAziende());
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -4,8 +4,24 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary p-1">
|
||||
@* <SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter" chartVisible="ShowCharts" chartsToggle="ToggleChart" ChartEnabled="true"></SelectionFilter>*@
|
||||
<h2>Articoli</h2>
|
||||
@* <SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter" chartVisible="ShowCharts" chartsToggle="ToggleChart" ChartEnabled="true"></SelectionFilter>*@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<h2>Articoli</h2>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<select @bind="@selAzienda" class="form-select form-select-sm">
|
||||
@if (ListAziende != null)
|
||||
{
|
||||
foreach (var item in ListAziende)
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body py-0 px-1">
|
||||
@if (ListRecords == null)
|
||||
@@ -23,39 +39,31 @@
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>Commessa/ODL</th>
|
||||
<th>Articolo</th>
|
||||
<th>Esito</th>
|
||||
<th>Note</th>
|
||||
<th>Operatore</th>
|
||||
<th>Disegno</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Tipo</th>
|
||||
<th>Azienda</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
@*<tr class="@checkSelect(@record.IdxControllo)">
|
||||
<tr class="@checkSelect(@record.CodArticolo)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
<div>@record.CodArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataOra.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataOra.ToString("ddd HH:mm.ss")</div>
|
||||
<div class="small">@record.Disegno</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.KeyRichiesta</div>
|
||||
<div class="small">@record.IdxOdl</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div class="small">@record.DescArticolo</div>
|
||||
</td>
|
||||
<td>@record.EsitoOk</td>
|
||||
<td>@record.Note</td>
|
||||
<td class="text-right">@record.Cognome @record.Nome (@record.MatrOpr)</td>
|
||||
</tr>*@
|
||||
<td>
|
||||
<div>@record.Tipo</div>
|
||||
</td>
|
||||
<td>@record.Azienda</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -22,11 +22,30 @@ namespace MP.SPEC.Pages
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private MP.Data.DatabaseModels.AnagArticoli currRecord = null;
|
||||
private MP.Data.DatabaseModels.AnagArticoli? currRecord = null;
|
||||
private string _selAzienda = "*";
|
||||
private string selAzienda
|
||||
{
|
||||
get => _selAzienda;
|
||||
set {
|
||||
if (value != _selAzienda)
|
||||
{
|
||||
_selAzienda = value;
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await reloadData();
|
||||
//await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string fileName = "Controlli.csv";
|
||||
private List<MP.Data.DatabaseModels.AnagArticoli> ListRecords;
|
||||
private List<MP.Data.DatabaseModels.AnagArticoli> SearchRecords;
|
||||
private List<MP.Data.DatabaseModels.AnagArticoli>? ListRecords;
|
||||
private List<MP.Data.DatabaseModels.AnagArticoli>? SearchRecords;
|
||||
private List<MP.Data.DatabaseModels.AnagGruppi>? ListAziende;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -141,7 +160,7 @@ namespace MP.SPEC.Pages
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ArticoliGetSearch(100000, "", MessageService.SearchVal);
|
||||
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
isLoading = false;
|
||||
}
|
||||
@@ -176,11 +195,8 @@ namespace MP.SPEC.Pages
|
||||
clearFile();
|
||||
numRecord = 10;
|
||||
MessageService.ShowSearch = false;
|
||||
#if false
|
||||
MessageService.PageName = "Registro Controlli";
|
||||
MessageService.PageIcon = "oi oi-beaker";
|
||||
#endif
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user