Merge branch 'FeaturecloneDossier' into develop
This commit is contained in:
@@ -14,6 +14,7 @@ else if (totalCount == 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- INIZIO: MODIFICA FLUSSO -->
|
||||
@if (currFluxLogDto != null)
|
||||
{
|
||||
<div class="row">
|
||||
@@ -78,6 +79,100 @@ else
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- FINE: MODIFICA FLUSSO -->
|
||||
|
||||
|
||||
|
||||
<!-- INIZIO: NUOVO DOSSIER -->
|
||||
@if (currRecordClone != null)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header bg-primary text-light d-flex justify-content-between">
|
||||
<div>
|
||||
Modifica Parametro
|
||||
</div>
|
||||
<div>
|
||||
@if (isEditing)
|
||||
{
|
||||
<span class="text-light">PENDING CHANGES...</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!--INIZIO PRIMA RIGA-->
|
||||
<div class="row">
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">ARTICOLO</span>
|
||||
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="currRecordClone.CodArticolo " @onclick="()=> enableEditing()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">FASE</span>
|
||||
<select class="form-select">
|
||||
@*<option value="@tradFase(currRecordClone.OdlNav.KeyRichiesta)"></option>*@
|
||||
@if (ListGruppiFase != null)
|
||||
{
|
||||
foreach (var item in ListGruppiFase)
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.CodGruppo | @item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
|
||||
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="currRecordClone.IdxMacchina ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
|
||||
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="currRecordClone.DtRif">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--FINE PRIMA RIGA-->
|
||||
|
||||
|
||||
<div class="row pt-4">
|
||||
<div class="col-3 pe-0">
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="d-grid gap-2">
|
||||
<button @onclick="() => cancelNewDoss()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="d-grid gap-2">
|
||||
<button @onclick="() => newDossier(currRecordClone)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<!-- FINE: NUOVO DOSSIER -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="d-flex justify justify-content-between">
|
||||
<table class="table table-sm table-striped small">
|
||||
@@ -101,8 +196,10 @@ else
|
||||
<td>
|
||||
@if (isEditing == false)
|
||||
{
|
||||
|
||||
<!--SEL RECORD PER VISUALIZZAZIONE FLUSSI-->
|
||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<!--SEL RECORD PER CLONA DOSSIER-->
|
||||
<button @onclick="()=> cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,6 +140,17 @@ namespace MP.SPEC.Components
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
protected async Task cancelNewDoss()
|
||||
{
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare l'aggiunta di un nuovo dossier? i dati saranno ricaricati.");
|
||||
if (alert)
|
||||
{
|
||||
currRecordClone = null;
|
||||
isEditing = false;
|
||||
await Task.Delay(1);
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task update(FluxLogDTO selRec)
|
||||
{
|
||||
@@ -174,11 +185,47 @@ namespace MP.SPEC.Components
|
||||
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
protected async Task newDossier(Dossiers selRec)
|
||||
{
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto");
|
||||
|
||||
if (alert)
|
||||
{
|
||||
|
||||
await Task.Delay(1);
|
||||
if (currRecordClone != null)
|
||||
{
|
||||
// serializzo valore x flux log...
|
||||
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux };
|
||||
string newVal = JsonConvert.SerializeObject(updatedResult);
|
||||
currRecordClone.DataType = selRec.DataType;
|
||||
currRecordClone.DtRif = DateTime.Now;
|
||||
currRecordClone.IdxMacchina = selRec.IdxMacchina;
|
||||
currRecordClone.CodArticolo = selRec.CodArticolo;
|
||||
currRecordClone.IdxODL = selRec.IdxODL;
|
||||
currRecordClone.Valore = selRec.Valore;
|
||||
// METODO PER UPDATE FLUX
|
||||
await MDService.DossiersInsert(currRecordClone);
|
||||
currRecordClone = null;
|
||||
isEditing = false;
|
||||
await Task.Delay(1);
|
||||
StateHasChanged();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
currRecordClone = null;
|
||||
await Task.Delay(1);
|
||||
await JSRuntime.InvokeAsync<bool>("location.reload");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListGruppiFase = await MDService.ElencoGruppiFase();
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
await reloadData(true);
|
||||
}
|
||||
@@ -199,6 +246,23 @@ namespace MP.SPEC.Components
|
||||
listaFlux = MDService.getFluxLog(selRec.Valore);
|
||||
await toggleTableFlux();
|
||||
}
|
||||
protected async Task cloneRecord(Dossiers selRec)
|
||||
{
|
||||
// creo record duplicato...
|
||||
Dossiers newRec = new Dossiers()
|
||||
{
|
||||
IdxDossier = selRec.IdxDossier,
|
||||
DataType = selRec.DataType,
|
||||
DtRif = selRec.DtRif,
|
||||
IdxMacchina = selRec.IdxMacchina,
|
||||
CodArticolo = selRec.CodArticolo,
|
||||
IdxODL = selRec.IdxODL,
|
||||
Valore = selRec.Valore,
|
||||
};
|
||||
currRecordClone = selRec;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
private List<AnagGruppi>? ListGruppiFase;
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
@@ -226,6 +290,7 @@ namespace MP.SPEC.Components
|
||||
private int _totalCount = 0;
|
||||
|
||||
private Dossiers? currRecord = null;
|
||||
private Dossiers? currRecordClone = null;
|
||||
|
||||
private List<Dossiers>? ListRecords;
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
Reference in New Issue
Block a user