Aggiunta preview navigazione compilazione offerta
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="card shadow">
|
||||
@* <div class="card shadow">
|
||||
<div class="card-dialog card-xl">
|
||||
<div class="card-content">
|
||||
<div class="card-header">
|
||||
@@ -6,7 +6,7 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="card" aria-label="Close" @onclick="ClosePopup">
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body"> *@
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="form-floating mb-3">
|
||||
@@ -60,16 +60,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-lg btn-success w-100"><i class="fa-solid fa-floppy-disk"></i> Save</button>
|
||||
<button class="btn btn-lg btn-success w-100" @onclick="DoSave"><i class="fa-solid fa-floppy-disk"></i> Save</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-lg btn-warning w-100"><i class="fa-solid fa-ban"></i> Cancel</button>
|
||||
<button class="btn btn-lg btn-warning w-100" @onclick="DoCancel"><i class="fa-solid fa-ban"></i> Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
|
||||
<div class="modal-dialog modal-xl">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Lux.Data.DbModel;
|
||||
using Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
{
|
||||
@@ -14,10 +15,10 @@ namespace Lux.UI.Components.Compo
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_Close { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_Updated { get; set; }
|
||||
public EventCallback<OfferModel> EC_Updated { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
@@ -56,6 +57,19 @@ namespace Lux.UI.Components.Compo
|
||||
#endif
|
||||
}
|
||||
|
||||
private async Task DoCancel()
|
||||
{
|
||||
await EC_Close.InvokeAsync(true);
|
||||
}
|
||||
|
||||
private async Task DoSave()
|
||||
{
|
||||
// fixme todo !!!
|
||||
// effettuare salvataggio record...
|
||||
|
||||
await EC_Updated.InvokeAsync(CurrRecord);
|
||||
}
|
||||
|
||||
private void ReloadData()
|
||||
{
|
||||
CustomersList = DLService.CustomersGetAll();
|
||||
|
||||
@@ -20,11 +20,21 @@
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</th> *@
|
||||
<th>ID</th>
|
||||
@if (DisplayMode == Core.Enum.DisplayMode.Edit)
|
||||
{
|
||||
<th>preview</th>
|
||||
}
|
||||
<th>Codice</th>
|
||||
<th>Descrizione</th>
|
||||
<th class="text-end">Qty</th>
|
||||
<th class="text-end">Importo</th>
|
||||
<th class="text-end">Tot</th>
|
||||
@if(DisplayMode== Core.Enum.DisplayMode.Edit)
|
||||
{
|
||||
<th class="text-end">a</th>
|
||||
<th class="text-end">b</th>
|
||||
<th class="text-end">c</th>
|
||||
}
|
||||
@* <th>Agente/Riv</th>
|
||||
<th>Cliente</th>
|
||||
@if (SelRecord == null)
|
||||
@@ -39,16 +49,28 @@
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.OfferRowID</td>
|
||||
@if (DisplayMode == Core.Enum.DisplayMode.Edit)
|
||||
{
|
||||
<td>
|
||||
<img class="img-fluid" src="images/logoegw.png" width="48" />
|
||||
</td>
|
||||
}
|
||||
@* <td>
|
||||
<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.OfferRowID</td>
|
||||
<td>@item.OfferRowCode</td>
|
||||
<td>@item.Note</td>
|
||||
<td class="text-end">@item.Qty</td>
|
||||
<td class="text-end">@($"{item.Cost:C2}")</td>
|
||||
<td class="text-end fw-bold">@($"{item.TotalCost:C2}")</td>
|
||||
@if (DisplayMode == Core.Enum.DisplayMode.Edit)
|
||||
{
|
||||
<td class="text-end">test a</td>
|
||||
<td class="text-end">test b</td>
|
||||
<td class="text-end">test c</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Lux.Data.DbModel;
|
||||
using Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using static Lux.Core.Enum;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
{
|
||||
@@ -11,8 +12,14 @@ namespace Lux.UI.Components.Compo
|
||||
[Parameter]
|
||||
public int OfferID { get; set; } = 0;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public DisplayMode DisplayMode { get; set; } =DisplayMode.Standard;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
|
||||
@@ -1,100 +1,161 @@
|
||||
@page "/Offers"
|
||||
|
||||
|
||||
@* @if(EditRecord!=null)
|
||||
|
||||
@if (EditRecord != null)
|
||||
{
|
||||
<OfferMan CurrRecord="EditRecord" EC_Close="DoClose"></OfferMan>
|
||||
} *@
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<div class="px-0 fs-3">
|
||||
<b>Offerte</b> <button class="btn btn-success" @onclick="DoAdd"><i class="fa-solid fa-cart-plus"></i> Nuova</button>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
Periodo | ricerca testo
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<div class="card-title fs-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
Edit Offerta <b>@EditRecord.OfferCode</b>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<div class="d-flex">
|
||||
<div class="px-0 row">
|
||||
<div class="col px-0">
|
||||
<span @onclick="() => AdvStep(CompileStep.Header)">
|
||||
<StepArrow ObjId="1" StepText="Testata" BlockStyle="@(ArrowBackCol(CompileStep.Header))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col px-0">
|
||||
<span @onclick="() => AdvStep(CompileStep.Rows)">
|
||||
<StepArrow ObjId="2" StepText="Righe" BlockStyle="@(ArrowBackCol(CompileStep.Rows))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col px-0">
|
||||
<span @onclick="() => AdvStep(CompileStep.FinalCheck)">
|
||||
<StepArrow ObjId="3" StepText="Controlli" BlockStyle="@(ArrowBackCol(CompileStep.FinalCheck))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* <div class="px-0">
|
||||
<button type="button" class="btn-close" data-bs-dismiss="card" aria-label="Close" @onclick="DoReset">
|
||||
</button>
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
@if (currStep == CompileStep.Header)
|
||||
{
|
||||
<OfferMan CurrRecord="EditRecord" EC_Close="DoClose" EC_Updated="() => AdvStep(CompileStep.Rows)"></OfferMan>
|
||||
}
|
||||
else if (currStep == CompileStep.Rows)
|
||||
{
|
||||
<div class="">
|
||||
<OfferRowMan OfferID="@EditRecord.OfferID" DisplayMode="Core.Enum.DisplayMode.Edit"></OfferRowMan>
|
||||
compilazione righe
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.FinalCheck)
|
||||
{
|
||||
<div class="alert alert-info text-center display-4">
|
||||
display check finali
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (EditRecord != null)
|
||||
{
|
||||
<OfferMan CurrRecord="EditRecord" EC_Close="DoClose"></OfferMan>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isLoading || ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-info text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="@DivMainCss">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>Codice</th>
|
||||
<th>Agente/Riv</th>
|
||||
<th>Cliente</th>
|
||||
@if (SelRecord == null)
|
||||
{
|
||||
<th>Descrizione</th>
|
||||
}
|
||||
<th class="text-end"># articoli</th>
|
||||
<th class="text-end">Importo</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr class="@CheckSelect(item)">
|
||||
<td>
|
||||
<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>
|
||||
@* <button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-wand-magic"></i></button> *@
|
||||
</td>
|
||||
<td>@item.OfferID</td>
|
||||
<td>@item.OfferCode</td>
|
||||
<td>
|
||||
@if (item.DealerNav != null)
|
||||
{
|
||||
<div class=""><b>@item.DealerNav.FirstName</b> @item.DealerNav.LastName</div>
|
||||
<div class="small">@item.DealerNav.VAT</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.CustomerNav != null)
|
||||
{
|
||||
<div class=""><b>@item.CustomerNav.FirstName</b> @item.CustomerNav.LastName</div>
|
||||
<div class="small">@item.CustomerNav.VAT</div>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<div class=" d-flex justify-content-between">
|
||||
<div class="px-0 fs-3">
|
||||
<b>Offerte</b> <button class="btn btn-success" @onclick="DoAdd"><i class="fa-solid fa-cart-plus"></i> Nuova</button>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
Periodo | ricerca testo
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isLoading || ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-info text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="@DivMainCss">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>Codice</th>
|
||||
<th>Agente/Riv</th>
|
||||
<th>Cliente</th>
|
||||
@if (SelRecord == null)
|
||||
{
|
||||
<td>@item.Description</td>
|
||||
<th>Descrizione</th>
|
||||
}
|
||||
<td class="text-end">...</td>
|
||||
<td class="text-end">---</td>
|
||||
<th class="text-end"># articoli</th>
|
||||
<th class="text-end">Importo</th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr class="@CheckSelect(item)">
|
||||
<td>
|
||||
<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>
|
||||
@* <button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-wand-magic"></i></button> *@
|
||||
</td>
|
||||
<td>@item.OfferID</td>
|
||||
<td>@item.OfferCode</td>
|
||||
<td>
|
||||
@if (item.DealerNav != null)
|
||||
{
|
||||
<div class=""><b>@item.DealerNav.FirstName</b> @item.DealerNav.LastName</div>
|
||||
<div class="small">@item.DealerNav.VAT</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.CustomerNav != null)
|
||||
{
|
||||
<div class=""><b>@item.CustomerNav.FirstName</b> @item.CustomerNav.LastName</div>
|
||||
<div class="small">@item.CustomerNav.VAT</div>
|
||||
}
|
||||
</td>
|
||||
@if (SelRecord == null)
|
||||
{
|
||||
<td>@item.Description</td>
|
||||
}
|
||||
<td class="text-end">...</td>
|
||||
<td class="text-end">---</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@if (SelRecord != null)
|
||||
{
|
||||
<div class="col-6">
|
||||
<OfferRowMan OfferID="@SelRecord.OfferID"></OfferRowMan>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (SelRecord != null)
|
||||
{
|
||||
<div class="col-6">
|
||||
<OfferRowMan OfferID="@SelRecord.OfferID" DisplayMode="Core.Enum.DisplayMode.Preview"></OfferRowMan>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -8,6 +8,21 @@ namespace Lux.UI.Components.Pages
|
||||
{
|
||||
public partial class Offers
|
||||
{
|
||||
#region Protected Enums
|
||||
|
||||
/// <summary>
|
||||
/// Stato compilazione offerta
|
||||
/// </summary>
|
||||
protected enum CompileStep
|
||||
{
|
||||
Draft = 0,
|
||||
Header = 1,
|
||||
Rows,
|
||||
FinalCheck
|
||||
}
|
||||
|
||||
#endregion Protected Enums
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string DivMainCss
|
||||
@@ -44,6 +59,7 @@ namespace Lux.UI.Components.Pages
|
||||
|
||||
protected void DoEdit(OfferModel curRec)
|
||||
{
|
||||
currStep = CompileStep.Header;
|
||||
EditRecord = curRec;
|
||||
}
|
||||
|
||||
@@ -60,16 +76,27 @@ namespace Lux.UI.Components.Pages
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
SetupArrows();
|
||||
ReloadData();
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
private void SetupArrows()
|
||||
{
|
||||
listBord01 = new();
|
||||
listBord01.Add("");
|
||||
listBord01.Add("White");
|
||||
listBord01.Add("");
|
||||
listBord01.Add("");
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<OfferModel> AllRecords = new List<OfferModel>();
|
||||
private int currPage = 1;
|
||||
private CompileStep currStep = CompileStep.Draft;
|
||||
private OfferModel? EditRecord = null;
|
||||
private bool isLoading = false;
|
||||
private List<OfferModel> ListRecords = new List<OfferModel>();
|
||||
@@ -81,15 +108,12 @@ namespace Lux.UI.Components.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiudo editing
|
||||
/// </summary>
|
||||
/// <param name="force"></param>
|
||||
private void DoClose(bool force)
|
||||
private void DoClose()
|
||||
{
|
||||
EditRecord = null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Legge i dati dei record completi
|
||||
/// </summary>
|
||||
@@ -99,6 +123,34 @@ namespace Lux.UI.Components.Pages
|
||||
totalCount = AllRecords.Count();
|
||||
}
|
||||
|
||||
|
||||
private List<string> listBord01 { get; set; } = new();
|
||||
private string txtStyle = "font-size: 1.2em; font-weight:bold; fill: white;";
|
||||
|
||||
private string ArrowBackCol(CompileStep arrowStep)
|
||||
{
|
||||
string answ = $"fill: #000000;";
|
||||
if (arrowStep == currStep)
|
||||
{
|
||||
answ = $"fill: #123456;";
|
||||
}
|
||||
else if (arrowStep < currStep)
|
||||
{
|
||||
answ = $"fill: #456789;";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"fill: #89ABCD;";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
private void AdvStep(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filtro e paginazione
|
||||
/// </summary>
|
||||
|
||||
@@ -21,5 +21,12 @@
|
||||
/// </summary>
|
||||
Lost
|
||||
}
|
||||
|
||||
public enum DisplayMode
|
||||
{
|
||||
Standard,
|
||||
Preview,
|
||||
Edit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user