- Modifica modale per stampa file
- Modifica componente filtro - Modifica interfaccia risorse e cicli
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2608.2817</Version>
|
||||
<Version>1.1.2609.0214</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,20 +16,24 @@
|
||||
{
|
||||
@if (repType.Equals("MaterialReqOrd"))
|
||||
{
|
||||
<div class="row gap-2 align-items-center mb-2">
|
||||
<div class="input-group w-auto">
|
||||
<label class="input-group-text">@Traduci("gruppo")</label>
|
||||
<select class="form-select" @bind="SelectCodGroup">
|
||||
<option value="" selected>--- @Traduci("tutti") ---</option>
|
||||
@foreach(var group in listGroup)
|
||||
{
|
||||
<option value="@group">@group</option>
|
||||
}
|
||||
</select>
|
||||
<div class="row text-center mb-2">
|
||||
<div class="col-4">
|
||||
<div class="input-group w-auto">
|
||||
<label class="input-group-text">@Traduci("gruppo")</label>
|
||||
<select class="form-select" @bind="SelectCodGroup">
|
||||
<option value="" selected>--- @Traduci("tutti") ---</option>
|
||||
@foreach(var group in listGroup)
|
||||
{
|
||||
<option value="@group">@group</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@if (!string.IsNullOrEmpty(SelectCodGroup))
|
||||
{
|
||||
<a href="@(DoPrint("MaterialReqOrd_01"))" target="_blank" class="btn btn-primary w-auto">Lista materiale @Descrizione(SelectCodGroup)</a>
|
||||
<div class="col-4">
|
||||
<a href="@(DoPrint("MaterialReqOrd_01"))" target="_blank" class="btn btn-primary w-auto">Lista materiale @Descrizione(SelectCodGroup)</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@inherits BaseComp
|
||||
|
||||
<div class="row align-items-center g-2">
|
||||
<div class="@searchDim()">
|
||||
<div class="row align-items-center w-100 g-2">
|
||||
<div class="col-2">
|
||||
<div class="input-group shadow-sm" title="@Traduci("ricerca")">
|
||||
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
||||
<input type="text" class="form-control" accesskey="/" placeholder="Cerca [/] (3+ char)" @bind="@SearchVal">
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
@if (ShowItemsBuy)
|
||||
{
|
||||
<div class="col-5">
|
||||
<div class="col-3">
|
||||
<div class="input-group shadow-sm">
|
||||
<span class="input-group-text bg-opacity-50 px-2">@Traduci("gruppo")</span>
|
||||
<select @bind="@SelCodGroup" class="form-select">
|
||||
@@ -22,7 +22,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-2">
|
||||
<div class="input-group shadow-sm">
|
||||
<span class="input-group-text bg-opacity-50 px-2">@Traduci("tipo")</span>
|
||||
<select @bind="@SelType" class="form-select">
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-6">
|
||||
<div class="col-2">
|
||||
<div class="input-group shadow-sm">
|
||||
<span class="input-group-text">@Traduci("ambiente")</span>
|
||||
<select @bind="@SelEnvir" class="form-select">
|
||||
@@ -51,13 +51,13 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (AddEnabled())
|
||||
{
|
||||
<div class="px-0">
|
||||
<button class="btn btn-success shadow-sm rounded-4 px-3" @onclick="DoAdd">
|
||||
<i class="fa-solid fa-cart-plus"></i>
|
||||
@Traduci("nuovo")
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@if (AddEnabled)
|
||||
{
|
||||
<div class="col-auto ms-auto">
|
||||
<button class="btn btn-success shadow-sm rounded-4 px-3" @onclick="DoAdd">
|
||||
<i class="fa-solid fa-cart-plus"></i>
|
||||
@Traduci("nuovo")
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -33,20 +33,6 @@
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
private bool AddEnabled()
|
||||
{
|
||||
bool answ = false;
|
||||
if (ShowItemsBuy)
|
||||
{
|
||||
answ = (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = (SelEnvir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.NULL);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
@@ -104,6 +90,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
private bool AddEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (ShowItemsBuy)
|
||||
{
|
||||
answ = (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = (SelEnvir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.NULL);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -127,16 +130,6 @@
|
||||
get => string.IsNullOrEmpty(CurrFilt.SearchVal) ? "btn-outline-secondary" : "btn-primary";
|
||||
}
|
||||
|
||||
private string searchDim()
|
||||
{
|
||||
string ans = "";
|
||||
if (ShowItemsBuy)
|
||||
ans = "col-4";
|
||||
else
|
||||
ans = "col-6";
|
||||
return ans;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -101,19 +101,16 @@
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-1">
|
||||
<th>
|
||||
<button class="btn btn-sm btn-primary" title="@Traduci("reset")" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</th>
|
||||
|
||||
<th class="col-1">@Traduci("ord")</th>
|
||||
<th>@Traduci("ord")</th>
|
||||
<th class="col-2">@Traduci("cicli_fase")</th>
|
||||
<th class="col-2">@Traduci("cicli_risorsa")</th>
|
||||
<th class="col-2">@Traduci("descrizione")</th>
|
||||
<th class="col-3 text-center">@Traduci("cicli_tags")</th>
|
||||
<th class="col-1 text-center">@Traduci("cicli_resa")</th>
|
||||
<th>
|
||||
@* <button class="btn btn-sm btn-success" @onclick="ToggleAdd"><i class="fa-solid fa-plus"></i></button> *@
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -152,14 +149,14 @@
|
||||
<td class="text-end">
|
||||
<InputPercent Decimals="1" CssClass="form-control form-control-sm text-end" @bind-Value="@ProductivityRateProxy" />
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-warning" title="@Traduci("annulla")" @onclick="DoCancel"><i class="fa-solid fa-ban"></i></button>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td class="text-start text-nowrap">
|
||||
<button class="btn btn-sm btn-primary" @onclick="() => DoSelect(item)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
@* <button class="btn btn-sm btn-primary" @onclick="() => DoSelect(item)"><i class="fa-solid fa-magnifying-glass"></i></button> *@
|
||||
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pencil"></i></button>
|
||||
</td>
|
||||
<td>@item.Index</td>
|
||||
@@ -175,8 +172,7 @@
|
||||
<td class="text-end">
|
||||
@($"{item.ProductivityRate:P2}")
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-danger" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash-can"></i></button>
|
||||
</td>
|
||||
}
|
||||
|
||||
@@ -21,9 +21,11 @@ else
|
||||
<th>@Traduci("cod")</th>
|
||||
<th>@Traduci("nome")</th>
|
||||
<th>@Traduci("risorsa_driver")</th>
|
||||
<th class="text-center">
|
||||
<button class="btn btn-sm btn-success" @onclick="DoAdd" title="@Traduci("nuovo")"><i class="fa-solid fa-plus"></i></button>
|
||||
</th>
|
||||
@if (selRecord == null)
|
||||
{
|
||||
<th class="text-end">Prezzo unitario</th>
|
||||
<th class="text-end">Costo unitario</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -36,6 +38,11 @@ else
|
||||
<td>@item.CodResource</td>
|
||||
<td>@item.Name</td>
|
||||
<td>@item.DriverNav.Name</td>
|
||||
@if (selRecord == null)
|
||||
{
|
||||
<td class="text-end">@($"{item.BasePrice:C2}")</td>
|
||||
<td class="text-end">@($"{item.BaseRockBottomCost:C2}")</td>
|
||||
}
|
||||
<td class="text-center">
|
||||
@if (!item.IsUsed)
|
||||
{
|
||||
@@ -49,6 +56,16 @@ else
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@if (totalCount > numRecord)
|
||||
{
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="15">
|
||||
<EgwCoreLib.Razor.DataPager currPage="@currPage" PageSize="@numRecord" totalCount="@totalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
@if (selRecord != null)
|
||||
@@ -59,9 +76,9 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-6 mt-5">
|
||||
@* <div class="col-6 mt-5">
|
||||
← selezionare una risorsa per visualizzare dettaglio costing e simulazione
|
||||
</div>
|
||||
</div> *@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -9,11 +9,17 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
[Parameter]
|
||||
public string CurrSearch { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public List<ResourceModel> AllRecords { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_Update { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected List<ResourceModel> AllRecords = new List<ResourceModel>();
|
||||
//protected List<ResourceModel> AllRecords = new List<ResourceModel>();
|
||||
protected List<CostDriverModel> ListCostDriver = new List<CostDriverModel>();
|
||||
protected List<ResourceModel> ListRecords = new List<ResourceModel>();
|
||||
protected List<ResourceModel> SearchRecords = new List<ResourceModel>();
|
||||
@@ -39,10 +45,6 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
|
||||
private int currPage = 1;
|
||||
|
||||
#if false
|
||||
private ResourceModel? editRecord = null;
|
||||
#endif
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
private int numRecord = 10;
|
||||
@@ -72,7 +74,7 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
|
||||
private string mainCss
|
||||
{
|
||||
get => selRecord == null ? "col-6" : "col-4";
|
||||
get => selRecord == null ? "col-12" : "col-4";
|
||||
}
|
||||
|
||||
[Inject]
|
||||
@@ -97,33 +99,34 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task DoAdd()
|
||||
{
|
||||
mTitle = "Attenzione";
|
||||
mMessage = "Confermi di voler aggiungere un nuovo record risorsa?";
|
||||
mMode = BootstrapModal.ModalMode.Confirm;
|
||||
modalOpt = new();
|
||||
modalOpt.Add(true, "Si");
|
||||
modalOpt.Add(false, "No");
|
||||
if (!await Modal!.ShowAsync<bool>())
|
||||
return;
|
||||
//private async Task DoAdd()
|
||||
//{
|
||||
// mTitle = "Attenzione";
|
||||
// mMessage = "Confermi di voler aggiungere un nuovo record risorsa?";
|
||||
// mMode = BootstrapModal.ModalMode.Confirm;
|
||||
// modalOpt = new();
|
||||
// modalOpt.Add(true, "Si");
|
||||
// modalOpt.Add(false, "No");
|
||||
// if (!await Modal!.ShowAsync<bool>())
|
||||
// return;
|
||||
|
||||
isLoading = true;
|
||||
var newRecord = new ResourceModel()
|
||||
{
|
||||
Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}",
|
||||
CostDriverID = 1
|
||||
};
|
||||
// isLoading = true;
|
||||
// var newRecord = new ResourceModel()
|
||||
// {
|
||||
// Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}",
|
||||
// CostDriverID = 1
|
||||
// };
|
||||
|
||||
await ResService.UpsertAsync(newRecord);
|
||||
AllRecords = new List<ResourceModel>();
|
||||
await Task.Delay(100);
|
||||
await ReloadBaseData();
|
||||
ReloadData();
|
||||
}
|
||||
// await ResService.UpsertAsync(newRecord);
|
||||
// AllRecords = new List<ResourceModel>();
|
||||
// await Task.Delay(100);
|
||||
// await ReloadBaseData();
|
||||
// ReloadData();
|
||||
//}
|
||||
|
||||
private async Task DoDelete(ResourceModel rec2del)
|
||||
{
|
||||
|
||||
mTitle = "Attenzione";
|
||||
mMessage = $"Confermi di voler eliminare il record {rec2del.Name}?";
|
||||
mMode = BootstrapModal.ModalMode.Confirm;
|
||||
@@ -136,8 +139,7 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
isLoading = true;
|
||||
// elimino e ricarico...
|
||||
await ResService.DeleteAsync(rec2del);
|
||||
await ReloadBaseData();
|
||||
ReloadData();
|
||||
await EC_Update.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,7 +184,7 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
|
||||
private async Task ReloadBaseData()
|
||||
{
|
||||
AllRecords = await ResService.GetAllAsync();
|
||||
//AllRecords = await ResService.GetAllAsync();
|
||||
ListCostDriver = await CDService.GetAllAsync();
|
||||
}
|
||||
|
||||
@@ -211,6 +213,18 @@ namespace Lux.UI.Components.Compo.JobTask
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private void SaveNumRec(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ReloadData();
|
||||
}
|
||||
|
||||
private void SavePage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
ReloadData();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
@if (EnableEdit)
|
||||
{
|
||||
<span class="@spanCss @BaseCss small me-1 mb-1" @onclick="ToggleEdit">+</span>
|
||||
<button class="btn badge rounded-pill @BaseCss small me-1 mb-1" @onclick="ToggleEdit">+</button>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<TemplateRowMan CurrRecord="EditRecord" EC_Close="DoClose" EC_Updated="DoSave" ListSellinglItems="ListSellItems"></TemplateRowMan>
|
||||
<TemplateRowMan CurrRecord="EditRecord" ApiUrl="@apiUrl" ImgBasePath="@imgBasePath" EC_Close="DoClose" EC_Updated="DoSave" ListSellinglItems="ListSellItems"></TemplateRowMan>
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -121,32 +121,9 @@ else
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@* <ul class="list-group">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start align-items-center px-2 py-1 condensed fw-bold">
|
||||
@item.Name
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start align-items-center px-2 py-1">
|
||||
<div class="small text-secondary">@item.SellingItemNav?.Description</div>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start align-items-center px-2 py-1">
|
||||
<div class="condensed">@item.TemplateRowUID</div>
|
||||
</li>
|
||||
@if (item.HasFile)
|
||||
{
|
||||
@if (item.Envir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW || !string.IsNullOrEmpty(item.FileName))
|
||||
{
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start px-2 py-1 small">
|
||||
<div class="mx-0">
|
||||
<div class="">@item.FileName</div>
|
||||
</div>
|
||||
<span class="small">@fSize(item.FileSize)</span>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul> *@
|
||||
<b>@item.Name</b>
|
||||
<div class="small text-secondary">@item.SellingItemNav?.Description</div>
|
||||
<div class="condensed mt-1">@item.TemplateRowUID</div>
|
||||
<div class="condensed mt-1">@item.TemplateRowUID</div>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-danger" title="@Traduci("elimina")" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash"></i></button>
|
||||
|
||||
@@ -1,37 +1,48 @@
|
||||
@using EgwCoreLib.Lux.Core
|
||||
@using static EgwCoreLib.Lux.Core.Enums
|
||||
@inherits BaseComp
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="form-floating mb-3">
|
||||
<select @bind="@CurrRecord.SellingItemID" class="form-select">
|
||||
<option value="0">--- Sel. Prodotto ---</option>
|
||||
@foreach (var item in ListSellinglItems)
|
||||
{
|
||||
<option value="@item.SellingItemID">@item.Description | @item.SourceType</option>
|
||||
}
|
||||
</select>
|
||||
<label class="small">@Traduci("cataloghi_prod")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div class="form-floating mb-3">
|
||||
<textarea @bind="@CurrRecord.Name" class="form-control" type="text"></textarea>
|
||||
<label class="small">@Traduci("nome")</label>
|
||||
</div>
|
||||
</div>
|
||||
@if (ShowImgUpload(CurrRecord.SellingItemID))
|
||||
@if (CurrRecord.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
{
|
||||
<div class="col-8">
|
||||
<div class="form-floating mb-3">
|
||||
<InputFile class="form-control" OnChange="UploadFile" />
|
||||
<label class="small bg-opacity-50">@Traduci("caricaImmagine")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 mb-3">
|
||||
<button class="btn btn-lg btn-info w-100" @onclick="() => DoClearImg()"><i class="fa-solid fa-eraser"></i> @Traduci("cataloghi_cancImm")</button>
|
||||
<div class="col-3 text-center">
|
||||
<img class="img-fluid p-1" src="@imgSrc(CurrRecord.ImgUrl)" width="100" title="@Traduci("noModifica")" />
|
||||
</div>
|
||||
}
|
||||
<div class="col-9">
|
||||
<div class="row g-0">
|
||||
<div class="form-floating mb-2">
|
||||
<select @bind="@CurrRecord.SellingItemID" class="form-select">
|
||||
<option value="0">--- Sel. Prodotto ---</option>
|
||||
@foreach (var item in ListSellinglItems)
|
||||
{
|
||||
<option value="@item.SellingItemID">@item.Description | @item.SourceType</option>
|
||||
}
|
||||
</select>
|
||||
<label class="small">@Traduci("cataloghi_prod")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-0">
|
||||
<div class="form-floating mb-2">
|
||||
<textarea @bind="@CurrRecord.Name" class="form-control" type="text"></textarea>
|
||||
<label class="small">@Traduci("nome")</label>
|
||||
</div>
|
||||
</div>
|
||||
@if (ShowImgUpload(CurrRecord.SellingItemID))
|
||||
{
|
||||
<div class="row g-0 mb-2">
|
||||
<div class="col-8">
|
||||
<div>
|
||||
<InputFile class="form-control" OnChange="UploadFile"/>
|
||||
@* <label class="small bg-opacity-50">@Traduci("caricaImmagine")</label> *@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button class="btn btn-info w-100 mx-1 px-2" @onclick="() => DoClearImg()"><i class="fa-solid fa-eraser"></i> @Traduci("cataloghi_cancImm")</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-lg btn-success w-100" @onclick="() => DoSave()"><i class="fa-solid fa-floppy-disk"></i> @Traduci("salva")</button>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,18 @@
|
||||
[Parameter]
|
||||
public List<SellingItemModel> ListSellinglItems { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Modello dell'offerta corrente (bindato dal genitore).
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string ApiUrl { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Modello dell'offerta corrente (bindato dal genitore).
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string ImgBasePath { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Fields
|
||||
@@ -66,6 +78,16 @@
|
||||
return EC_Updated.InvokeAsync(CurrRecord);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola src immagine direttamente da modello dati + base path
|
||||
/// </summary>
|
||||
/// <param name="imgUrl"></param>
|
||||
/// <returns></returns>
|
||||
private string imgSrc(string imgUrl)
|
||||
{
|
||||
return $"{ApiUrl}/{ImgBasePath}/{imgUrl}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check visibilità upload dato il selling item ID corrente
|
||||
/// </summary>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<button class="btn btn-success shadow-sm rounded-4 px-3" @onclick="ToggleAdd"><i class="fa-solid fa-plus"></i> Aggiungi ciclo</button>
|
||||
<button class="btn btn-success shadow-sm rounded-4 px-3" @onclick="ToggleAdd"><i class="fa-solid fa-plus"></i> Nuovo</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-2 py-1">
|
||||
@@ -59,9 +59,9 @@
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div>
|
||||
@* <div>
|
||||
<h5><b>@Traduci("cicli_elencoCicliAtt")</b></h5>
|
||||
</div>
|
||||
</div> *@
|
||||
<div class="@mainCss">
|
||||
<JobTaskListMan ListAllTags="ListTagsAvailable" CurrRecords="ListJobTask" CostDriverLists="ListCostDrivers" ResourceLists="ListResources" CurrSearch="@searchVal" EC_Selected="ShowDetail" EC_Updated="ForceReloadAsync"></JobTaskListMan>
|
||||
</div>
|
||||
|
||||
@@ -3,26 +3,8 @@
|
||||
|
||||
<div class="p-2 shadow">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="input-group input-group shadow-sm" style="width:35em;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">Da:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.AddHours(-1).ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtFrom" />
|
||||
|
||||
<span class="input-group-text">A:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtTo" />
|
||||
|
||||
<button class="btn btn-sm @btnReload" @onclick="DoReload">
|
||||
Carica <i class="fa-solid fa-arrows-rotate"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<PeriodoSel E_PeriodoSel="SetPeriodo" CurrPeriodo="PeriodoSel" PeriodoLabel="@Traduci("periodo")" DictSelect="CustomSelDict"></PeriodoSel>
|
||||
</div>
|
||||
<a href="@NavigationManager.ToAbsoluteUri("Offers")" class="btn btn-primary shadow-sm rounded-4 px-3">
|
||||
<i class="fa-solid fa-list me-1"></i>
|
||||
|
||||
@@ -1,13 +1,43 @@
|
||||
|
||||
using EgwCoreLib.Razor;
|
||||
|
||||
namespace Lux.UI.Components.Pages
|
||||
{
|
||||
public partial class OffStats
|
||||
{
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
return ReloadDataAsync();
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
// preparo sel periodo custom (traduzioni)...
|
||||
CustomSelDict = Enum.GetValues(typeof(DtUtils.PeriodSet))
|
||||
.Cast<DtUtils.PeriodSet>()
|
||||
.ToDictionary(e => e, e => Traduci("periodo_" + e.ToString()));
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
private List<OfferModel> AllOfferRecords { get; set; } = new();
|
||||
private List<OfferModel> WinOffRecords { get; set; } = new();
|
||||
|
||||
private DtUtils.Periodo PeriodoSel = new DtUtils.Periodo(DtUtils.PeriodSet.ThisYear);
|
||||
|
||||
/// <summary>
|
||||
/// Periodo custom selezione valori
|
||||
/// </summary>
|
||||
private Dictionary<DtUtils.PeriodSet, string>? CustomSelDict = new();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
@@ -17,56 +47,28 @@ namespace Lux.UI.Components.Pages
|
||||
[Inject]
|
||||
private NavigationManager NavigationManager { get; set; } = null!;
|
||||
|
||||
private List<OfferModel> AllOfferRecords { get; set; } = new();
|
||||
private List<OfferModel> WinOffRecords { get; set; } = new();
|
||||
#endregion Private Properties
|
||||
|
||||
private bool needReload = false;
|
||||
private DtUtils.Periodo periodoLimit = new DtUtils.Periodo(DtUtils.PeriodSet.LastYear);
|
||||
////private EgwCoreLib.Utils.DtUtils.Periodo periodoSel = new EgwCoreLib.Utils.DtUtils.Periodo(DateTime.Today.AddHours(DateTime.Now.Hour - 24 * 7), DateTime.Today.AddHours(DateTime.Now.Hour + 1));
|
||||
private DtUtils.Periodo periodoSel = new DtUtils.Periodo(DateTime.Today.AddMonths(-5), DateTime.Today.AddHours(DateTime.Now.Hour + 1));
|
||||
|
||||
private string btnReload => needReload ? "btn-primary" : "btn-secondary";
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadDataAsync()
|
||||
{
|
||||
await OffService.CheckExpiredAsync();
|
||||
AllOfferRecords = await OffService.GetFiltAsync(periodoSel.Inizio, periodoSel.Fine);
|
||||
AllOfferRecords = await OffService.GetFiltAsync(PeriodoSel.Inizio, PeriodoSel.Fine);
|
||||
WinOffRecords = AllOfferRecords.Where(x => x.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Caricamento dati
|
||||
/// Imposta periodo da filtro
|
||||
/// </summary>
|
||||
/// <param name="newPeriod"></param>
|
||||
/// <returns></returns>
|
||||
private Task DoReload()
|
||||
private Task SetPeriodo(DtUtils.Periodo newPeriod)
|
||||
{
|
||||
PeriodoSel = newPeriod;
|
||||
return ReloadDataAsync();
|
||||
}
|
||||
|
||||
private DateTime dtFrom
|
||||
{
|
||||
get => periodoSel.Inizio;
|
||||
set
|
||||
{
|
||||
if (periodoSel.Inizio != value)
|
||||
{
|
||||
periodoSel.Inizio = value;
|
||||
needReload = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime dtTo
|
||||
{
|
||||
get => periodoSel.Fine;
|
||||
set
|
||||
{
|
||||
if (periodoSel.Fine != value)
|
||||
{
|
||||
periodoSel.Fine = value;
|
||||
needReload = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,21 @@
|
||||
<input type="text" class="form-control" accesskey="/" placeholder="Cerca [/] (3+ char)" @bind="@SearchVal">
|
||||
<button class="btn @btnResetCss" @onclick="ResetSearch"><i class="fas fa-ban"></i></button>
|
||||
</div>
|
||||
<div class="ms-auto">
|
||||
<button class="btn btn-success shadow-sm rounded-4 px-3" @onclick="DoAdd"><i class="fa-solid fa-plus"></i> Nuova</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-1">
|
||||
<h5><b>@Traduci("risorsa_configAttive")</b></h5>
|
||||
<ResourcesMan CurrSearch="@searchVal"></ResourcesMan>
|
||||
<div class="my-2 py-1">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
@* <h5><b>@Traduci("risorsa_configAttive")</b></h5> *@
|
||||
<ResourcesMan AllRecords="AllRecords" CurrSearch="@searchVal" EC_Update="DoDelete"></ResourcesMan>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<BootstrapModal @ref=Modal Title=@mTitle Message=@mMessage Mode="mMode" UserOptions=@modalOpt></BootstrapModal>
|
||||
|
||||
@@ -1,10 +1,40 @@
|
||||
using EgwCoreLib.Lux.Data.Services.General;
|
||||
using EgwCoreLib.Razor;
|
||||
using Radzen.Blazor.Markdown;
|
||||
|
||||
namespace Lux.UI.Components.Pages
|
||||
{
|
||||
public partial class Resources
|
||||
{
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
return ReloadDataAsync();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<ResourceModel> AllRecords = new List<ResourceModel>();
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
private BootstrapModal Modal = new();
|
||||
private string mTitle = "";
|
||||
private string mMessage = "";
|
||||
private BootstrapModal.ModalMode mMode = BootstrapModal.ModalMode.ND;
|
||||
private Dictionary<bool, string> modalOpt = new Dictionary<bool, string>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IResourceService ResService { get; set; } = null!;
|
||||
|
||||
private string searchVal { get; set; } = string.Empty;
|
||||
|
||||
private string btnResetCss
|
||||
@@ -28,11 +58,44 @@ namespace Lux.UI.Components.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadDataAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
AllRecords = await ResService.GetAllAsync();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private void ResetSearch()
|
||||
{
|
||||
SearchVal = "";
|
||||
}
|
||||
|
||||
private async Task DoAdd()
|
||||
{
|
||||
mTitle = "Attenzione";
|
||||
mMessage = "Confermi di voler aggiungere un nuovo record risorsa?";
|
||||
mMode = BootstrapModal.ModalMode.Confirm;
|
||||
modalOpt = new();
|
||||
modalOpt.Add(true, "Si");
|
||||
modalOpt.Add(false, "No");
|
||||
if (!await Modal!.ShowAsync<bool>())
|
||||
return;
|
||||
|
||||
var newRecord = new ResourceModel()
|
||||
{
|
||||
Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}",
|
||||
CostDriverID = 1
|
||||
};
|
||||
|
||||
await ResService.UpsertAsync(newRecord);
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
private Task DoDelete(bool args)
|
||||
{
|
||||
return ReloadDataAsync();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<div class="p-2 shadow">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="row">
|
||||
<div class="row mb-2">
|
||||
<div class="col-4">
|
||||
<div class="input-group" title="@Traduci("ricerca")">
|
||||
<span class="input-group-text">@Traduci("ambiente")</span>
|
||||
@@ -16,7 +16,6 @@
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>1.1.2608.2817</Version>
|
||||
<Version>1.1.2609.0214</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 1.1.2608.2817</h4>
|
||||
<h4>Versione: 1.1.2609.0214</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2608.2817
|
||||
1.1.2609.0214
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2608.2817</version>
|
||||
<version>1.1.2609.0214</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user