Completato display composizione KIT in ODL/POD di spec e in TAB3
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
{
|
||||
@if (CheckIsKit(CurrOdl.CodArticolo))
|
||||
{
|
||||
<button class="mx-2 btn btn-sm btn-info small" @onclick="() => KitToggleDetail(CurrOdl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(CurrOdl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
@CurrOdl.DescArticolo
|
||||
}
|
||||
@@ -98,7 +98,7 @@
|
||||
{
|
||||
@if (CheckIsKit(CurrPodl.CodArticolo))
|
||||
{
|
||||
<button class="mx-2 btn btn-sm btn-info small" @onclick="() => KitToggleDetail(CurrPodl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(CurrPodl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
@CurrPodl.DescArticolo
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
@if (ListRecords == null)
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
@@ -10,6 +9,10 @@ else if (totalCount == 0)
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
@if (showKitDetail)
|
||||
{
|
||||
<MP.SPEC.Components.ProdKit.KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></MP.SPEC.Components.ProdKit.KitDetailModal>
|
||||
}
|
||||
@if (currRecord != null && !showStats && isCurrOdl)
|
||||
{
|
||||
<div class="col-6 col-lg-8">
|
||||
@@ -102,7 +105,13 @@ else
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div>
|
||||
@record.CodArticolo
|
||||
@if (CheckIsKit(record.CodArticolo))
|
||||
{
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="small textConsensed text-secondary">@record.DescArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -182,6 +182,7 @@ namespace MP.SPEC.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
ListArtKit = MDService.ArticoliGetByTipo("KIT", "*");
|
||||
string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest");
|
||||
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
|
||||
{
|
||||
@@ -368,5 +369,42 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
|
||||
/// </summary>
|
||||
/// <param name="CodArticolo"></param>
|
||||
/// <returns></returns>
|
||||
protected bool CheckIsKit(string CodArticolo)
|
||||
{
|
||||
bool answ = false;
|
||||
if (ListArtKit != null && ListArtKit.Count > 0)
|
||||
{
|
||||
answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
protected void KitToggleDetail(string? selCodArt)
|
||||
{
|
||||
CodArtParent = selCodArt ?? "";
|
||||
if (!string.IsNullOrEmpty(CodArtParent))
|
||||
{
|
||||
ListKitTemplate = MDService.TemplateKitFilt(CodArtParent, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
ListKitTemplate = null;
|
||||
}
|
||||
showKitDetail = !showKitDetail;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco articoli tipo KIT
|
||||
/// </summary>
|
||||
private List<AnagArticoliModel>? ListArtKit;
|
||||
|
||||
private List<TemplateKitModel>? ListKitTemplate = null;
|
||||
private bool showKitDetail = false;
|
||||
private string CodArtParent = "";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Components.ProdKit
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null || isLoading)
|
||||
@@ -16,7 +15,7 @@ else
|
||||
<div class="@mainCss">
|
||||
@if (showKitDetail)
|
||||
{
|
||||
<KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></KitDetailModal>
|
||||
<MP.SPEC.Components.ProdKit.KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></MP.SPEC.Components.ProdKit.KitDetailModal>
|
||||
}
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
@@ -118,7 +117,7 @@ else
|
||||
@record.CodArticolo
|
||||
@if (CheckIsKit(record.CodArticolo))
|
||||
{
|
||||
<button class="mx-2 btn btn-sm btn-info small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="small textConsensed text-secondary">@record.DescArticolo</div>
|
||||
|
||||
Reference in New Issue
Block a user