From 5019dfca60c200c090d1a1ab65e582eee0f79374 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 15 May 2025 16:59:59 +0200 Subject: [PATCH] SPEC: - Aggiunto filtro lanciati o meno --- MP.SPEC/Components/ProdKit/GestKitPodl.razor | 24 +++--- .../Components/ProdKit/GestKitPodl.razor.cs | 75 ++++--------------- MP.SPEC/Components/ProdKit/Manager.razor | 2 +- MP.SPEC/Components/ProdKit/Manager.razor.cs | 7 ++ MP.SPEC/Pages/PODL.razor | 2 +- 5 files changed, 35 insertions(+), 75 deletions(-) diff --git a/MP.SPEC/Components/ProdKit/GestKitPodl.razor b/MP.SPEC/Components/ProdKit/GestKitPodl.razor index 3d9204c4..6c7bf956 100644 --- a/MP.SPEC/Components/ProdKit/GestKitPodl.razor +++ b/MP.SPEC/Components/ProdKit/GestKitPodl.razor @@ -2,7 +2,18 @@
-

KIT e Promesse

+
+
+

KIT e Promesse

+
+
+ Da Produrre +
+ +
+ Lanciati +
+
Attenzione: non associare OPR a più KIT! @@ -28,12 +39,6 @@ - @@ -45,10 +50,7 @@ @foreach (var record in ListRecordsPODL) { - - + diff --git a/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs b/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs index 94033ae1..e79574b7 100644 --- a/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs +++ b/MP.SPEC/Components/ProdKit/GestKitPodl.razor.cs @@ -9,6 +9,9 @@ namespace MP.SPEC.Components.ProdKit { #region Public Properties + [Parameter] + public EventCallback EC_HasOdl { get; set; } + [Parameter] public EventCallback EC_ListUpdated { get; set; } @@ -24,7 +27,6 @@ namespace MP.SPEC.Components.ProdKit public void Dispose() { - EditRecord = null; ListRecordsPODL = null; GC.Collect(); } @@ -72,21 +74,6 @@ namespace MP.SPEC.Components.ProdKit #region Protected Methods - protected string checkSelect(PODLExpModel currRec) - { - string answ = ""; - if (EditRecord != null) - { - try - { - answ = (EditRecord.IdxPromessa == currRec.IdxPromessa) ? "table-info" : ""; - } - catch - { } - } - return answ; - } - protected bool DelEnabled(PODLExpModel reqRec) { bool answ = reqRec.IdxOdl == 0; @@ -100,7 +87,6 @@ namespace MP.SPEC.Components.ProdKit /// protected async Task DoCancel() { - EditRecord = null; ReloadData(); await Task.Delay(1); } @@ -117,7 +103,6 @@ namespace MP.SPEC.Components.ProdKit // da provare... var done = MDService.PodlIstKitDelete(selRec.IdxPromessa); - EditRecord = null; ReloadData(); await EC_ListUpdated.InvokeAsync(true); } @@ -157,27 +142,12 @@ namespace MP.SPEC.Components.ProdKit ReloadData(); } - protected void ResetData() - { - EditRecord = null; - } - protected void ResetParent() { SearchComm = ""; ReloadData(); } - protected void ResetSel() - { - EditRecord = null; - } - - protected void SelRecord(PODLExpModel selRec) - { - EditRecord = selRec; - } - protected void SetNumPage(int newNum) { currPage = newNum; @@ -197,9 +167,14 @@ namespace MP.SPEC.Components.ProdKit } } + protected async Task toggleClosed() + { + hasOdl = !hasOdl; + await EC_HasOdl.InvokeAsync(hasOdl); + } + protected void UpdateData() { - EditRecord = null; ReloadData(); } @@ -212,8 +187,6 @@ namespace MP.SPEC.Components.ProdKit /// private bool doSearchArt = false; - private PODLExpModel? EditRecord = null; - /// /// Elenco singoli podl esplosi /// @@ -253,7 +226,6 @@ namespace MP.SPEC.Components.ProdKit #region Private Properties private int _currPage { get; set; } = 1; - private int _numRecord { get; set; } = 10; private string cssDetail @@ -274,6 +246,8 @@ namespace MP.SPEC.Components.ProdKit } } + private bool hasOdl { get; set; } = false; + private string iconDetail { get => ShowAllDet ? "fa-chevron-up" : "fa-chevron-down"; @@ -335,7 +309,8 @@ namespace MP.SPEC.Components.ProdKit ListRecordsPODL = new List(); ListRecordsPODL = PodlRecords - .Where(x => !string.IsNullOrEmpty(x.KeyRichiesta) && x.Attivabile && x.KeyRichiesta.StartsWith("KIT")) + //.Where(x => !string.IsNullOrEmpty(x.KeyRichiesta)) + .Where(x => !string.IsNullOrEmpty(x.KeyRichiesta) && x.KeyRichiesta.StartsWith("KIT")) .Skip(numRecord * (currPage - 1)) .Take(numRecord) .ToList(); @@ -345,30 +320,6 @@ namespace MP.SPEC.Components.ProdKit isLoading = false; } - - /// - /// Toggle modale ricerca articoli - /// - private void SearchArtToggle() - { - doSearchArt = !doSearchArt; - } - - /// - /// Salva selezione articolo - /// - /// - private void SetCodArtChild(string codArt) - { - if (EditRecord != null) - { -#if false - EditRecord.CodArtChild = codArt; - doSearchArt = false; -#endif - } - } - private void ToggleDetail() { ShowAllDet = !ShowAllDet; diff --git a/MP.SPEC/Components/ProdKit/Manager.razor b/MP.SPEC/Components/ProdKit/Manager.razor index 0bd4f06f..5e8538e2 100644 --- a/MP.SPEC/Components/ProdKit/Manager.razor +++ b/MP.SPEC/Components/ProdKit/Manager.razor @@ -20,7 +20,7 @@ }
- +
} diff --git a/MP.SPEC/Components/ProdKit/Manager.razor.cs b/MP.SPEC/Components/ProdKit/Manager.razor.cs index 2f7b6c4b..d6f85825 100644 --- a/MP.SPEC/Components/ProdKit/Manager.razor.cs +++ b/MP.SPEC/Components/ProdKit/Manager.razor.cs @@ -164,6 +164,13 @@ namespace MP.SPEC.Components.ProdKit await EC_IsComposing.InvokeAsync(false); } + private async Task SetHasOdl(bool setHasOdl) + { + ActFilt.HasOdl = setHasOdl; + await EC_FiltUpdated.InvokeAsync(ActFilt); + ReloadData(); + } + private async Task ForceReset() { // svuoto filtro diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index baea886f..141266db 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -11,7 +11,7 @@
Da Produrre -
+
Lanciati
- @if (EditRecord != null) - { - - } - PODL Kit ID Templ. Kit
- -
@record.IdxPromessa