Fix assegnazione diretta prodgroup
This commit is contained in:
@@ -79,14 +79,14 @@
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-10">
|
||||
@if (AllProdGroup != null && AllProdGroup.Count > 0)
|
||||
@if (BalancePlantList != null && BalancePlantList.Count > 0)
|
||||
{
|
||||
<div class="row">
|
||||
@foreach (var item in AllProdGroup)
|
||||
@foreach (var item in DictPercReq)
|
||||
{
|
||||
<div class="col input-group">
|
||||
<span class="input-group-text">@item.PlantListJoin</span>
|
||||
<input type="number" class="form-control">
|
||||
<span class="input-group-text">@item.Key</span>
|
||||
<InputPercent CssClass="form-control" Value="@((decimal)item.Value)"></InputPercent>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -126,7 +126,7 @@
|
||||
<div class="row">
|
||||
<div class="col-9">Vincolati: <span class="fw-bold px-1">@DetailRecord.NumOkVin</span></div>
|
||||
<div class="col-3">
|
||||
<button class="btn btn-sm btn-info w-100" @onclick="() => ToggleAssignMode(DetailRecord.ListWorkable, SetMode.AssignOk)">Assegna <i class="fa-solid fa-thumbtack"></i></button>
|
||||
<button class="btn btn-sm btn-info w-100" @onclick="() => ToggleAssignMode(DetailRecord.ListVincolated, SetMode.AssignOk)">Assegna <i class="fa-solid fa-thumbtack"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +156,9 @@
|
||||
foreach (var wld in item.WorkGroupList)
|
||||
{
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-info w-100" @onclick="() => ToggleAssignVincMode(item, SetMode.AssignOk)"><i class="fa-solid fa-thumbtack"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@wld.Key
|
||||
</td>
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace Lux.UI.Components.Compo.WorkLoad
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<string> BalancePlantList = new();
|
||||
private BalanceReqDto cBalanceReq = new BalanceReqDto();
|
||||
|
||||
/// <summary>
|
||||
@@ -205,40 +206,40 @@ namespace Lux.UI.Components.Compo.WorkLoad
|
||||
private void PrepareSendReq()
|
||||
{
|
||||
DictPercReq.Clear();
|
||||
var cList = AllProdGroup;
|
||||
#if false
|
||||
var cList = AllProdGroup;
|
||||
#endif
|
||||
var cList = BalancePlantList;
|
||||
double stdPerc = 1.0;
|
||||
if (cList != null && cList.Count > 1)
|
||||
{
|
||||
stdPerc = 1.0 / (cList.Count - 1);
|
||||
}
|
||||
|
||||
// da rivedere
|
||||
#if false
|
||||
//if (cList != null)
|
||||
//{
|
||||
// // valutare se determinare EXT/manuale in modo diverso da ProdPlantModel
|
||||
// switch (CurrMode)
|
||||
// {
|
||||
// case SetMode.None:
|
||||
// break;
|
||||
if (cList != null)
|
||||
{
|
||||
// valutare se determinare EXT/manuale in modo diverso da ProdPlantModel
|
||||
switch (CurrMode)
|
||||
{
|
||||
case SetMode.None:
|
||||
break;
|
||||
|
||||
// case SetMode.Balance:
|
||||
// DictPercReq = cList.ToDictionary(x => x.ProdPlantCod, x => x.ProdPlantCod != "EXT" ? stdPerc : 0.0);
|
||||
// break;
|
||||
//case SetMode.Balance:
|
||||
// DictPercReq = cList.ToDictionary(x => x.ProdPlantCod, x => x.ProdPlantCod != "EXT" ? stdPerc : 0.0);
|
||||
// break;
|
||||
|
||||
// case SetMode.AssignOk:
|
||||
// DictPercReq = cList.ToDictionary(x => x.ProdPlantCod, x => 0.0);
|
||||
// break;
|
||||
case SetMode.AssignOk:
|
||||
DictPercReq = cList.ToDictionary(x => x, x => stdPerc);
|
||||
break;
|
||||
|
||||
// case SetMode.AssignUnwork:
|
||||
// DictPercReq = cList.ToDictionary(x => x.ProdPlantCod, x => x.ProdPlantCod == "EXT" ? 1.0 : 0.0);
|
||||
// break;
|
||||
//case SetMode.AssignUnwork:
|
||||
// DictPercReq = cList.ToDictionary(x => x.ProdPlantCod, x => x.ProdPlantCod == "EXT" ? 1.0 : 0.0);
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -296,7 +297,7 @@ namespace Lux.UI.Components.Compo.WorkLoad
|
||||
|
||||
private void ToggleAssignMode(List<string> listTag, SetMode reqMode)
|
||||
{
|
||||
// se era gi� attivo --> chiude... altrimenti assegna!
|
||||
// se era gia attivo --> chiude... altrimenti assegna!
|
||||
CurrMode = CurrMode == reqMode ? SetMode.None : reqMode;
|
||||
// ora imposto secondo modo...
|
||||
if (CurrMode == reqMode)
|
||||
@@ -306,6 +307,19 @@ namespace Lux.UI.Components.Compo.WorkLoad
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleAssignVincMode(ProductionGroupModel currGroup, SetMode reqMode)
|
||||
{
|
||||
// se era gia attivo --> chiude... altrimenti assegna!
|
||||
CurrMode = CurrMode == reqMode ? SetMode.None : reqMode;
|
||||
// ora imposto secondo modo...
|
||||
if (CurrMode == reqMode)
|
||||
{
|
||||
cBalanceReq.TagList = currGroup.WorkGroupList.Values.FirstOrDefault()?.TagList ?? new();
|
||||
BalancePlantList = currGroup.PlantList;
|
||||
PrepareSendReq();
|
||||
}
|
||||
}
|
||||
|
||||
private decimal TotMaxTimeRatio(decimal currTime)
|
||||
{
|
||||
return DetailRecord.TotMaxTime > 0 ? currTime / DetailRecord.TotMaxTime : (decimal)0.0;
|
||||
|
||||
Reference in New Issue
Block a user