Creata pagina step della commessa
This commit is contained in:
@@ -1,24 +1,68 @@
|
||||
@using salesbook.Shared.Core.Dto.JobProgress
|
||||
@using salesbook.Shared.Core.Dto.PageState
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@inject JobSteps JobSteps
|
||||
|
||||
<div style="margin-top: 1rem;" class="activity-card">
|
||||
<div @onclick="OpenPageCommessa" class="activity-card">
|
||||
<div class="activity-left-section">
|
||||
<div class="activity-body-section">
|
||||
<div class="title-section">
|
||||
<MudText Class="activity-title" Typo="Typo.body1" HtmlTag="h3">@Commessa.Descrizione</MudText>
|
||||
<MudText Class="activity-title" Typo="Typo.body1" HtmlTag="h3">@Commessa.CodJcom</MudText>
|
||||
<div class="activity-hours-section">
|
||||
<span class="activity-hours">
|
||||
@Commessa.CodJcom
|
||||
</span>
|
||||
@if (LastUpd is not null)
|
||||
{
|
||||
<span class="activity-hours">Aggiornato il @($"{LastUpd:d}")</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<span class="activity-title">@Commessa.Descrizione</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="activity-info-section">
|
||||
<MudChip T="string" Icon="@IconConstants.Chip.User" Size="Size.Small">Stato</MudChip>
|
||||
@if (Stato is not null)
|
||||
{
|
||||
<MudChip T="string" Variant="Variant.Outlined" Icon="@IconConstants.Chip.Stato" Size="Size.Small">@Stato</MudChip>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public JtbComt Commessa { get; set; } = new();
|
||||
[Parameter] public string RagSoc { get; set; } = "";
|
||||
[Parameter] public List<CRMJobStepDTO>? Steps { get; set; }
|
||||
|
||||
private string? Stato { get; set; }
|
||||
private DateTime? LastUpd { get; set; }
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
GetStepInfo();
|
||||
}
|
||||
|
||||
private void GetStepInfo()
|
||||
{
|
||||
if (Steps is null) return;
|
||||
|
||||
var lastBeforeSkip = Steps
|
||||
.TakeWhile(s => s.Status is { Skip: false })
|
||||
.LastOrDefault();
|
||||
|
||||
if (lastBeforeSkip is not null) Stato = lastBeforeSkip.StepName;
|
||||
|
||||
LastUpd = Steps
|
||||
.Where(s => s.Date.HasValue)
|
||||
.Select(s => s.Date!.Value)
|
||||
.DefaultIfEmpty()
|
||||
.Max();
|
||||
|
||||
if (LastUpd.Equals(DateTime.MinValue)) LastUpd = null;
|
||||
}
|
||||
|
||||
private void OpenPageCommessa()
|
||||
{
|
||||
JobSteps.Steps = Steps;
|
||||
NavigationManager.NavigateTo($"commessa/{Commessa.CodJcom}/{RagSoc}");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,8 +28,9 @@
|
||||
}
|
||||
|
||||
.activity-hours {
|
||||
font-weight: 700;
|
||||
color: var(--mud-palette-text-primary);
|
||||
color: var(--mud-palette-gray-darker);
|
||||
font-weight: 600;
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
.activity-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
|
||||
@@ -40,13 +41,18 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title-section ::deep > .activity-title {
|
||||
.activity-title {
|
||||
font-weight: 800 !important;
|
||||
margin: 0 !important;
|
||||
line-height: normal !important;
|
||||
color: var(--mud-palette-text-primary);
|
||||
}
|
||||
|
||||
.title-section ::deep > .activity-title {
|
||||
font-weight: 600;
|
||||
color: var(--mud-palette-text-primary);
|
||||
}
|
||||
|
||||
.activity-body-section ::deep > .activity-subtitle {
|
||||
color: var(--mud-palette-gray-darker);
|
||||
margin: .2rem 0 !important;
|
||||
@@ -55,5 +61,7 @@
|
||||
|
||||
.activity-info-section {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: .25rem;
|
||||
}
|
||||
Reference in New Issue
Block a user