b0804c78e7
- fix calcolo qta - fix display - fix stored ricerca
192 lines
9.4 KiB
Plaintext
192 lines
9.4 KiB
Plaintext
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-2">
|
|
<div class="d-flex">
|
|
<div class="px-0">
|
|
<h3>Materiali</h3>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" role="switch" @bind="ShowRemn">
|
|
<label class="form-check-label">@remnMessage</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="d-flex">
|
|
<div class="px-2">
|
|
@if (CurrItem == null)
|
|
{
|
|
@if (FiltType == 0)
|
|
{
|
|
<button class="btn btn-secondary px-3" disabled title="Selezionare Beam/Wall per aggiungere"><i class="fa-solid fa-square-plus"></i> Select →</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-success px-3" @onclick="()=>CreateNew()"><i class="fa-solid fa-square-plus"></i> Add New</button>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-warning px-5" @onclick="()=> ForceReload(true)"><i class="fa-solid fa-ban"></i> Cancel</button>
|
|
}
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group">
|
|
<span class="input-group-text" id="basic-addon1">Tipo Mat.</span>
|
|
<select class="form-select" @bind="@FiltType">
|
|
<option value="0">--- Tutti ---</option>
|
|
<option value="1">Beam</option>
|
|
<option value="2">Wall</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@if (CurrItem != null || FiltType > 0)
|
|
{
|
|
<hr />
|
|
<MaterialEdit CurrRecord="CurrItem" KeyNum="@KeyNum" EC_update="ForceReload" MatType="@FiltType" IsEditRec="@IsEdit" IsBeamRec="@IsBeam"></MaterialEdit>
|
|
}
|
|
</div>
|
|
<div class="card-body p-1">
|
|
@if (ListRecords == null || isLoading)
|
|
{
|
|
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-info">Nessun record trovato</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="table table-striped table-sm text-start">
|
|
<thead>
|
|
<tr class="">
|
|
<th>
|
|
<button class="btn btn-primary btn-sm" @onclick="() => ForceReload(true)"><i class="fa-solid fa-rotate"></i></button>
|
|
</th>
|
|
<th>ID <Sorter ParamName="MatId" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
|
|
<th>Mat.Code <Sorter ParamName="MatCode" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
|
|
<th>Descr. <Sorter ParamName="MatDesc" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
|
|
<th class="text-end"><Sorter ParamName="W" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter> W (mm)</th>
|
|
<th class="text-end"><Sorter ParamName="H" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter> H (mm)</th>
|
|
@if (MaterialId == 0)
|
|
{
|
|
<th class="text-end"><Sorter ParamName="SizeNum" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter> Var.</th>
|
|
<th class="text-end"><Sorter ParamName="QtyTot" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter> Qty</th>
|
|
}
|
|
<AuthorizeView Roles="SuperAdmin, Admin, SuperUser">
|
|
<Authorized>
|
|
<th></th>
|
|
</Authorized>
|
|
</AuthorizeView>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
<tr class="align-middle @CheckSel(item)">
|
|
<td>
|
|
@if (CurrItem == null)
|
|
{
|
|
<button class="btn btn-info btn-sm" @onclick="() => DoSelect(item)"><i class="fa-solid fa-search"></i></button>
|
|
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fa-solid fa-edit"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-search"></i></button>
|
|
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-edit"></i></button>
|
|
}
|
|
</td>
|
|
<td>
|
|
<div class="fw-bold">
|
|
@($"{item.MatCloudId:000000}")
|
|
|
|
</div>
|
|
@if (item.IsBeam)
|
|
{
|
|
<span class="border border-primary rounded px-1">
|
|
<i class="fa-solid fa-lines-leaning"></i>
|
|
</span>
|
|
}
|
|
else if (@item.IsWall)
|
|
{
|
|
<span class="border border-info rounded px-1">
|
|
<i class="fa-solid fa-draw-polygon"></i>
|
|
</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
@item.MatCode
|
|
</td>
|
|
<td>
|
|
@item.MatDesc
|
|
</td>
|
|
<td class="text-end">
|
|
@if (item.IsBeam)
|
|
{
|
|
@if (hasDecimal(item.WMm))
|
|
{
|
|
@($"{item.WMm:N2}")
|
|
}
|
|
else
|
|
{
|
|
@($"{item.WMm:N0}")
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<span>-</span>
|
|
}
|
|
</td>
|
|
<td class="text-end">
|
|
@if (hasDecimal(item.HMm))
|
|
{
|
|
@($"{item.HMm:N2}")
|
|
}
|
|
else
|
|
{
|
|
@($"{item.HMm:N0}")
|
|
}
|
|
</td>
|
|
@if (MaterialId == 0)
|
|
{
|
|
<td class="text-end">
|
|
@item.SizeNum
|
|
</td>
|
|
<td class="text-end">
|
|
@($"{item.QtyTot:N1} {item.UM}")
|
|
</td>
|
|
}
|
|
<AuthorizeView Roles="SuperAdmin, Admin, SuperUser">
|
|
<Authorized>
|
|
<td class="text-end">
|
|
@if (item.QtyTot == 0)
|
|
{
|
|
<button class="btn btn-danger btn-sm" @onclick="() => DeleteRecord(item)"><i class="fa-solid fa-trash"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-trash"></i></button>
|
|
}
|
|
</td>
|
|
</Authorized>
|
|
</AuthorizeView>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
|
|
</div>
|
|
<div class="card-footer">
|
|
<EgwCoreLib.Razor.DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading"></EgwCoreLib.Razor.DataPager>
|
|
</div>
|
|
</div>
|
|
|
|
|