171 lines
9.3 KiB
Plaintext
171 lines
9.3 KiB
Plaintext
@if (EditRecord != null)
|
|
{
|
|
<h1>EDITING</h1>
|
|
<h3>@EditRecord.OfferRowUID</h3>
|
|
|
|
<WebWindowComplex.TableComp ListPayload="SetupList"
|
|
LiveData="CurrData"
|
|
EC_OnUpdate="SaveJWD"
|
|
EC_OnClose="CloseEdit">
|
|
</WebWindowComplex.TableComp>
|
|
}
|
|
else
|
|
{
|
|
<div class="card shadow">
|
|
<div class="card-header bg-info bg-opacity-50 bg-gradient d-flex justify-content-between">
|
|
<div class="px-0">Dettaglio Offerta</div>
|
|
<div class="px-0">
|
|
<button class="btn btn-sm btn-primary" @onclick="() => RecalcOffer()">Ricalcola <i class="fa-solid fa-calculator"></i></button>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="cad-body px-2">
|
|
@if (isLoading || ListRecords == null)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-info text-center fs-5">Nessun record trovato</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<tr>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
|
{
|
|
<th>
|
|
<button class="btn btn-sm btn-primary" @onclick="ForceReloadData"><i class="fa-solid fa-rotate-right"></i></button>
|
|
</th>
|
|
<th>img</th>
|
|
}
|
|
else
|
|
{
|
|
<th>ID</th>
|
|
}
|
|
<th>Codice</th>
|
|
<th>Descrizione</th>
|
|
<th class="text-end">Qty</th>
|
|
<th class="text-end">Importo</th>
|
|
<th class="text-end">Totale</th>
|
|
<th class="text-end">Marg.</th>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
|
{
|
|
<th class="text-end" title="Cambio Materiali">Mat.</th>
|
|
}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
<tr>
|
|
<td>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
|
{
|
|
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pencil"></i></button>
|
|
}
|
|
else
|
|
{
|
|
@item.RowNum
|
|
}
|
|
</td>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
|
{
|
|
<td>
|
|
<img class="img-fluid" src="@(imgUrl(item.OfferRowUID, $"{item.Envir}"))" width="48" />
|
|
</td>
|
|
}
|
|
<td class="small">
|
|
<div>@item.OfferRowUID</div>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit && !string.IsNullOrEmpty(item.SerStruct) && item.SerStruct.Length > 2)
|
|
{
|
|
<button class="btn btn-sm btn-primary" @onclick="() => RequestBom(item)" title="Richiesta ricalcolo BOM">
|
|
BOM <i class="fa-solid fa-arrow-right-arrow-left pe-2"></i>
|
|
@if (item.AwaitBom)
|
|
{
|
|
<span class="text-warning spinner-grow spinner-grow-sm" aria-hidden="true"></span>
|
|
}
|
|
</button>
|
|
}
|
|
@if (item.Envir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW || !string.IsNullOrEmpty(item.FileName))
|
|
{
|
|
<div class="input-group input-group-sm">
|
|
@if (EditFileRecord != null && EditFileRecord.OfferRowID == item.OfferRowID)
|
|
{
|
|
<span>
|
|
<InputFile class="form-control" OnChange="UploadFile" style="width: 24rem;" />
|
|
</span>
|
|
<button class="btn btn-sm btn-info" @onclick="() => ToggleFileEdit(null)"><i class="fa-solid fa-floppy-disk"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<span class="input-group-text small"><b>@item.FileName</b> | @fSize(item.FileSize)</span>
|
|
<button class="btn btn-sm btn-primary" @onclick="() => ToggleFileEdit(item)"><i class="fa-solid fa-floppy-disk"></i></button>
|
|
}
|
|
</div>
|
|
}
|
|
</td>
|
|
<td>@item.Note</td>
|
|
<td class="text-end">@item.Qty</td>
|
|
<td class="text-end text-nowrap">
|
|
<div class="fw-bold" title="Prezzo Finito">
|
|
@if (!(item.BomOk && item.ItemOk))
|
|
{
|
|
<span class="text-danger me-2" title=""><i class="fa-solid fa-triangle-exclamation"></i></span>
|
|
}
|
|
@if (item.AwaitPrice)
|
|
{
|
|
<span class="text-warning spinner-grow spinner-grow-sm" aria-hidden="true"></span>
|
|
}
|
|
@($"{item.UnitPrice:C2}")
|
|
</div>
|
|
<div class="small text-secondary" title="RockBottom Price">(@item.UnitCost.ToString("C2"))</div>
|
|
</td>
|
|
<td class="text-end text-nowrap">
|
|
<div class="fw-bold" title="Prezzo Finito">
|
|
@if (item.AwaitPrice)
|
|
{
|
|
<span class="text-warning spinner-grow spinner-grow-sm" aria-hidden="true"></span>
|
|
}
|
|
@($"{item.TotalPrice:C2}")
|
|
</div>
|
|
<div class="small text-secondary" title="RockBottom Price">(@item.TotalCost.ToString("C2"))</div>
|
|
</td>
|
|
<td class="text-end text-nowrap" title="Margine / Sconto MAX applicabile">
|
|
@item.MaxDiscount.ToString("P2")
|
|
</td>
|
|
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
|
|
{
|
|
<td class="text-end">
|
|
@if (!string.IsNullOrEmpty(item.ItemBOM))
|
|
{
|
|
<button class="btn btn-sm btn-info" title="cambio materiali assegnati" @onclick="() => DoSwapMat(item)"><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
|
|
}
|
|
</td>
|
|
}
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
@if (showChangeMat && EditBomRecord != null)
|
|
{
|
|
<div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
|
|
<div class="modal-dialog modal-xl">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<div class="modal-title fs-4">Cambio Materiali offerta <b>@EditBomRecord.OfferRowUID</b></div>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="ClosePopup">
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<EditBom BomList="@CurrBomList" EC_Updated="UpdateBom"></EditBom>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |