Vario
This commit is contained in:
@@ -27,21 +27,34 @@
|
||||
</div>
|
||||
|
||||
<div class="scheda-card-action">
|
||||
@if (NetworkService.IsNetworkAvailable())
|
||||
@if (Stato != StatusEnum.Completata)
|
||||
{
|
||||
<MudFab Color="Color.Info" Size="Size.Small" StartIcon="@Icons.Material.Rounded.Edit" OnClick="@UpdateScheda"/>
|
||||
<MudFab Color="Color.Error" Size="Size.Small" StartIcon="@Icons.Material.Rounded.Delete" OnClick="@DeleteScheda"/>
|
||||
<MudFab Color="Color.Success" Size="Size.Small" StartIcon="@Icons.Material.Rounded.CloudSync" OnClick="@ExportScheda"/>
|
||||
if (NetworkService.IsNetworkAvailable())
|
||||
{
|
||||
<MudFab Color="Color.Info" Size="Size.Small" StartIcon="@Icons.Material.Rounded.Edit"
|
||||
OnClick="@UpdateScheda"/>
|
||||
<MudFab Color="Color.Error" Size="Size.Small" StartIcon="@Icons.Material.Rounded.Delete"
|
||||
OnClick="@DeleteScheda"/>
|
||||
<MudFab Color="Color.Success" Size="Size.Small" StartIcon="@Icons.Material.Rounded.CloudSync"
|
||||
OnClick="@ExportScheda"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Rounded.Edit"
|
||||
Color="Color.Info" Size="Size.Small" OnClick="@UpdateScheda">
|
||||
Modifica
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Rounded.Delete"
|
||||
Color="Color.Error" Size="Size.Small" OnClick="@DeleteScheda">
|
||||
Cancella
|
||||
</MudButton>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Rounded.Edit"
|
||||
Color="Color.Info" Size="Size.Small" OnClick="@UpdateScheda">
|
||||
Modifica
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Rounded.Delete"
|
||||
Color="Color.Error" Size="Size.Small" OnClick="@DeleteScheda">
|
||||
Cancella
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Rounded.RemoveRedEye"
|
||||
Color="Color.Info" Size="Size.Small" OnClick="@ViewScheda">
|
||||
Visualizza
|
||||
</MudButton>
|
||||
}
|
||||
</div>
|
||||
@@ -55,6 +68,7 @@
|
||||
@code{
|
||||
[Parameter] public string CodMdep { get; set; } = string.Empty;
|
||||
[Parameter] public DateTime Data { get; set; }
|
||||
[Parameter] public StatusEnum Stato { get; set; }
|
||||
[Parameter] public required Scheda Scheda { get; set; }
|
||||
[Parameter] public EventCallback<Scheda> OnSchedaModified { get; set; }
|
||||
[Parameter] public EventCallback<Scheda> OnSchedaDeleted { get; set; }
|
||||
@@ -72,7 +86,7 @@
|
||||
private async Task DeleteScheda()
|
||||
{
|
||||
var result = await _messageBox.ShowAsync();
|
||||
|
||||
|
||||
if (result is true)
|
||||
{
|
||||
VisibleOverlay = true;
|
||||
@@ -80,15 +94,18 @@
|
||||
|
||||
if (Scheda.ActivityId != null)
|
||||
await IntegrySteupService.DeleteScheda(Scheda.ActivityId);
|
||||
|
||||
|
||||
var deleteScheda = await IspezioniService.DeleteSchedaAsync(Scheda.Id);
|
||||
if (deleteScheda) await OnSchedaDeleted.InvokeAsync(Scheda);
|
||||
|
||||
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void ViewScheda() =>
|
||||
_ = Dialog.OpenFormScheda(CodMdep, Data, false, Scheda, true);
|
||||
|
||||
private async Task ExportScheda()
|
||||
{
|
||||
VisibleOverlay = true;
|
||||
@@ -109,12 +126,12 @@
|
||||
ParentActivityId = Scheda.Ispezione?.ActivityId
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
if (apiResponse != null)
|
||||
{
|
||||
Scheda.ActivityId = apiResponse.ActivityIdScheda;
|
||||
SteupDataService.InspectionPageState.Ispezione.ActivityId = apiResponse.ActivityIdIspezione;
|
||||
|
||||
|
||||
await IspezioniService.UpdateActivityIdIspezioneAsync(CodMdep, Data,
|
||||
UserSession.User.Username, apiResponse.ActivityIdIspezione
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<MudDialog Class="customDialog-form">
|
||||
<DialogContent>
|
||||
<MudForm @ref="_form">
|
||||
<MudForm ReadOnly="ReadOnly" @ref="_form">
|
||||
<HeaderLayout Cancel="true" OnCancel="@Cancel" LabelSave="@LabelSave"
|
||||
OnSave="Save" Title="Scheda"/>
|
||||
|
||||
@@ -89,21 +89,24 @@
|
||||
</div>
|
||||
</CardFormModal>
|
||||
}
|
||||
|
||||
<div class="container-button ripple-container">
|
||||
<MudButton Class="button-settings green-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.AttachFile"
|
||||
Size="Size.Medium"
|
||||
OnClick="@OpenAddAttached"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi foto
|
||||
</MudButton>
|
||||
</div>
|
||||
|
||||
@if (!ReadOnly)
|
||||
{
|
||||
<div class="container-button ripple-container">
|
||||
<MudButton Class="button-settings green-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.AttachFile"
|
||||
Size="Size.Medium"
|
||||
OnClick="@OpenAddAttached"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi foto
|
||||
</MudButton>
|
||||
</div>
|
||||
}
|
||||
|
||||
<CardFormModal Title="Articoli">
|
||||
<div class="input-manual-barcode">
|
||||
<MudTextField FullWidth="true" ReadOnly="IsView" T="string?" Variant="Variant.Text"
|
||||
<MudTextField FullWidth="true" T="string?" Variant="Variant.Text"
|
||||
@bind-Value="ManualBarcode" Placeholder="Digita manualmente il codice"/>
|
||||
<MudIconButton Color="Color.Primary" OnClick="@OnManualBarcodeSet"
|
||||
Size="Size.Small" Icon="@Icons.Material.Rounded.Send"/>
|
||||
@@ -129,7 +132,7 @@
|
||||
}
|
||||
</CardFormModal>
|
||||
|
||||
@if (!IsView)
|
||||
@if (NetworkService.ConnectionAvailable && !ReadOnly)
|
||||
{
|
||||
<div class="container-button ripple-container">
|
||||
<MudButton Class="button-settings red-icon"
|
||||
@@ -190,10 +193,9 @@
|
||||
[Parameter] public required string CodMdep { get; set; }
|
||||
[Parameter] public required DateTime Data { get; set; }
|
||||
[Parameter] public bool IsNew { get; set; }
|
||||
[Parameter] public bool ReadOnly { get; set; }
|
||||
[Parameter] public Scheda Scheda { get; set; } = new();
|
||||
|
||||
private bool IsView => !NetworkService.ConnectionAvailable;
|
||||
|
||||
private string? ManualBarcode { get; set; }
|
||||
|
||||
//Overlay
|
||||
@@ -262,7 +264,7 @@
|
||||
SaveSchedaResponseDto? apiResponse = null;
|
||||
try
|
||||
{
|
||||
if (!IsView)
|
||||
if (NetworkService.ConnectionAvailable)
|
||||
{
|
||||
apiResponse = await IntegrySteupService.SaveScheda(
|
||||
new SaveRequestDto
|
||||
|
||||
Reference in New Issue
Block a user