Aggiunta ricerca indirizzo
This commit is contained in:
@@ -1,4 +1,12 @@
|
|||||||
|
.header {
|
||||||
|
min-height: var(--mh-header);
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.header-content {
|
.header-content {
|
||||||
|
width: 100%;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
@using salesbook.Shared.Components.Layout.Spinner
|
||||||
|
@using salesbook.Shared.Core.Dto
|
||||||
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@using salesbook.Shared.Components.Layout.Overlay
|
||||||
|
@inject IIntegryApiService IntegryApiService
|
||||||
|
|
||||||
|
<div class="bottom-sheet-backdrop @(IsSheetVisible ? "show" : "")" @onclick="CloseBottomSheet"></div>
|
||||||
|
|
||||||
|
<div class="bottom-sheet-container @(IsSheetVisible ? "show" : "")">
|
||||||
|
<div style="height: 95vh" class="bottom-sheet pb-safe-area">
|
||||||
|
<div class="title">
|
||||||
|
<MudText Typo="Typo.h6">
|
||||||
|
<b>Cerca indirizzo</b>
|
||||||
|
</MudText>
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="() => CloseBottomSheet()"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-card clearButton">
|
||||||
|
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="Address" DebounceInterval="500" OnDebounceIntervalElapsed="SearchAllAddress" />
|
||||||
|
|
||||||
|
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => Address = null" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
@if (Loading)
|
||||||
|
{
|
||||||
|
<SpinnerLayout />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Addresses != null)
|
||||||
|
{
|
||||||
|
foreach (var address in Addresses)
|
||||||
|
{
|
||||||
|
<b><span @onclick="() => OnSelectAddress(address.PlaceId)">@address.Description</span></b>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<NoDataAvailable Text="Nessun idirizzo trovato" />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public string Region { get; set; }
|
||||||
|
|
||||||
|
[Parameter] public IndirizzoDTO Indirizzo { get; set; }
|
||||||
|
[Parameter] public EventCallback<IndirizzoDTO> IndirizzoChanged { get; set; }
|
||||||
|
|
||||||
|
[Parameter] public bool IsSheetVisible { get; set; }
|
||||||
|
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
||||||
|
|
||||||
|
private bool Loading { get; set; }
|
||||||
|
|
||||||
|
private string? Address { get; set; }
|
||||||
|
private List<AutoCompleteAddressDTO>? Addresses { get; set; }
|
||||||
|
|
||||||
|
private string? Uuid { get; set; }
|
||||||
|
|
||||||
|
//Overlay for save
|
||||||
|
private bool VisibleOverlay { get; set; }
|
||||||
|
private bool SuccessAnimation { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
if (IsSheetVisible)
|
||||||
|
{
|
||||||
|
Uuid = Guid.NewGuid().ToString();
|
||||||
|
Address = null;
|
||||||
|
Addresses = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CloseBottomSheet()
|
||||||
|
{
|
||||||
|
IsSheetVisible = false;
|
||||||
|
IsSheetVisibleChanged.InvokeAsync(IsSheetVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SearchAllAddress()
|
||||||
|
{
|
||||||
|
if (Address == null || Uuid == null) return;
|
||||||
|
|
||||||
|
Loading = true;
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
Addresses = await IntegryApiService.AutoCompleteAddress(Address, Region, Uuid);
|
||||||
|
|
||||||
|
Loading = false;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnSelectAddress(string placeId)
|
||||||
|
{
|
||||||
|
CloseBottomSheet();
|
||||||
|
|
||||||
|
VisibleOverlay = true;
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Indirizzo = await IntegryApiService.PlaceDetails(placeId, Uuid);
|
||||||
|
await IndirizzoChanged.InvokeAsync(Indirizzo);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||||
|
Snackbar.Clear();
|
||||||
|
|
||||||
|
Snackbar.Add("Impossibile selezionare questo indirizzo", Severity.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
VisibleOverlay = false;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@using salesbook.Shared.Components.Layout.Overlay
|
@using salesbook.Shared.Components.Layout.Overlay
|
||||||
@using salesbook.Shared.Core.Entity
|
@using salesbook.Shared.Core.Entity
|
||||||
|
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||||
@inject IManageDataService ManageData
|
@inject IManageDataService ManageData
|
||||||
@inject INetworkService NetworkService
|
@inject INetworkService NetworkService
|
||||||
@inject IIntegryApiService IntegryApiService
|
@inject IIntegryApiService IntegryApiService
|
||||||
@@ -13,141 +14,21 @@
|
|||||||
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : $"{ContactModel.CodContact}")"/>
|
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : $"{ContactModel.CodContact}")"/>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="input-card">
|
<div class="input-card">
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Placeholder="Azienda"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.RagSoc"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-card">
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">P. IVA</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.PartIva"
|
|
||||||
@bind-Value:after="OnAfterChangePIva"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="divider"></div>
|
|
||||||
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Cod. Fiscale</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.CodFisc"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-card">
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Tipo cliente</span>
|
|
||||||
|
|
||||||
@if (VtbTipi.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
<span class="warning-text">Nessun tipo cliente trovato</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || VtbTipi.IsNullOrEmpty())" T="string?" Variant="Variant.Text" @bind-Value="ContactModel.CodVtip" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
|
||||||
@foreach (var tipo in VtbTipi)
|
|
||||||
{
|
|
||||||
<MudSelectItemExtended Class="custom-item-select" Value="@tipo.CodVtip">@($"{tipo.CodVtip} - {tipo.Descrizione}")</MudSelectItemExtended>
|
|
||||||
}
|
|
||||||
</MudSelectExtended>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-card">
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Indirizzo</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
<MudTextField ReadOnly="IsView"
|
||||||
T="string?"
|
T="string?"
|
||||||
|
Placeholder="Azienda"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
Lines="1"
|
Lines="1"
|
||||||
FullWidth="true"
|
@bind-Value="ContactModel.RagSoc"
|
||||||
Class="customIcon-select"
|
|
||||||
@bind-Value="ContactModel.Indirizzo"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
DebounceInterval="500"
|
DebounceInterval="500"
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
<div class="form-container">
|
<span class="disable-full-width">Nazione</span>
|
||||||
<span class="disable-full-width">CAP</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.Cap"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="divider"></div>
|
|
||||||
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Città</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.Citta"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="divider"></div>
|
|
||||||
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Provincia</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.Prov"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="divider"></div>
|
|
||||||
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">Nazione</span>
|
|
||||||
|
|
||||||
@if (Nazioni.IsNullOrEmpty())
|
@if (Nazioni.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
@@ -164,85 +45,215 @@
|
|||||||
}
|
}
|
||||||
</MudSelectExtended>
|
</MudSelectExtended>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-card">
|
|
||||||
<div class="form-container">
|
|
||||||
<span class="disable-full-width">PEC</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.EMailPec"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">P. IVA</span>
|
||||||
|
|
||||||
<div class="form-container">
|
<MudTextField ReadOnly="IsView"
|
||||||
<span class="disable-full-width">E-Mail</span>
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.PartIva"
|
||||||
|
@bind-Value:after="OnAfterChangePIva"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
<div class="divider"></div>
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
<div class="form-container">
|
||||||
FullWidth="true"
|
<span class="disable-full-width">Cod. Fiscale</span>
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
<MudTextField ReadOnly="IsView"
|
||||||
@bind-Value="ContactModel.EMail"
|
T="string?"
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
Variant="Variant.Text"
|
||||||
DebounceInterval="500"
|
FullWidth="true"
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.CodFisc"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Tipo cliente</span>
|
||||||
|
|
||||||
<div class="form-container">
|
@if (VtbTipi.IsNullOrEmpty())
|
||||||
<span class="disable-full-width">Telefono</span>
|
|
||||||
|
|
||||||
<MudTextField ReadOnly="IsView"
|
|
||||||
T="string?"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
FullWidth="true"
|
|
||||||
Class="customIcon-select"
|
|
||||||
Lines="1"
|
|
||||||
@bind-Value="ContactModel.Telefono"
|
|
||||||
@bind-Value:after="OnAfterChangeValue"
|
|
||||||
DebounceInterval="500"
|
|
||||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (IsNew)
|
|
||||||
{
|
|
||||||
<div class="container-chip-persrif">
|
|
||||||
@if (!PersRifList.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
foreach (var item in PersRifList!.Select((p, index) => new { p, index }))
|
|
||||||
{
|
{
|
||||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenPersRifForm(item.index, item.p)" OnClose="() => OnRemovePersRif(item.index)">
|
<span class="warning-text">Nessun tipo cliente trovato</span>
|
||||||
@item.p.PersonaRif
|
|
||||||
</MudChip>
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || VtbTipi.IsNullOrEmpty())" T="string?" Variant="Variant.Text" @bind-Value="ContactModel.CodVtip" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||||
|
@foreach (var tipo in VtbTipi)
|
||||||
|
{
|
||||||
|
<MudSelectItemExtended Class="custom-item-select" Value="@tipo.CodVtip">@($"{tipo.CodVtip} - {tipo.Descrizione}")</MudSelectItemExtended>
|
||||||
|
}
|
||||||
|
</MudSelectExtended>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-button">
|
@if (!IsView)
|
||||||
<MudButton Class="button-settings gray-icon"
|
{
|
||||||
FullWidth="true"
|
<div class="search-address" @onclick="() => OpenSearchAddress = !OpenSearchAddress">
|
||||||
StartIcon="@Icons.Material.Filled.PersonAddAlt1"
|
<span>Cerca indirizzo</span>
|
||||||
Size="Size.Medium"
|
<MudIcon Size="Size.Small" Icon="@Icons.Material.Rounded.Search"/>
|
||||||
OnClick="NewPersRif"
|
</div>
|
||||||
Variant="Variant.Outlined">
|
}
|
||||||
Persona di riferimento
|
|
||||||
</MudButton>
|
|
||||||
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Indirizzo</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
Lines="1"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
@bind-Value="ContactModel.Indirizzo"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">CAP</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.Cap"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Città</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.Citta"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Provincia</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
MaxLength="2"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.Prov"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">PEC</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.EMailPec"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">E-Mail</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.EMail"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Telefono</span>
|
||||||
|
|
||||||
|
<MudTextField ReadOnly="IsView"
|
||||||
|
T="string?"
|
||||||
|
Variant="Variant.Text"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="customIcon-select"
|
||||||
|
Lines="1"
|
||||||
|
@bind-Value="ContactModel.Telefono"
|
||||||
|
@bind-Value:after="OnAfterChangeValue"
|
||||||
|
DebounceInterval="500"
|
||||||
|
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (IsNew)
|
||||||
|
{
|
||||||
|
<div class="container-chip-persrif">
|
||||||
|
@if (!PersRifList.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
foreach (var item in PersRifList!.Select((p, index) => new { p, index }))
|
||||||
|
{
|
||||||
|
<MudChip T="string" Color="Color.Default" OnClick="() => OpenPersRifForm(item.index, item.p)" OnClose="() => OnRemovePersRif(item.index)">
|
||||||
|
@item.p.PersonaRif
|
||||||
|
</MudChip>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-button">
|
||||||
|
<MudButton Class="button-settings gray-icon"
|
||||||
|
FullWidth="true"
|
||||||
|
StartIcon="@Icons.Material.Filled.PersonAddAlt1"
|
||||||
|
Size="Size.Medium"
|
||||||
|
OnClick="NewPersRif"
|
||||||
|
Variant="Variant.Outlined">
|
||||||
|
Persona di riferimento
|
||||||
|
</MudButton>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MudMessageBox MarkupMessage="new MarkupString(VatMessage)" @ref="CheckVat" Class="c-messageBox" Title="Verifica partita iva" CancelText="@(VatAlreadyRegistered ? "" : "Annulla")">
|
<MudMessageBox MarkupMessage="new MarkupString(VatMessage)" @ref="CheckVat" Class="c-messageBox" Title="Verifica partita iva" CancelText="@(VatAlreadyRegistered ? "" : "Annulla")">
|
||||||
@@ -268,6 +279,8 @@
|
|||||||
|
|
||||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||||
|
|
||||||
|
<SearchAddress Region="@ContactModel.Nazione" @bind-IsSheetVisible="OpenSearchAddress" @bind-Indirizzo="Address" @bind-Indirizzo:after="OnAddressSet"/>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||||
|
|
||||||
@@ -292,6 +305,10 @@
|
|||||||
private string VatMessage { get; set; } = "";
|
private string VatMessage { get; set; } = "";
|
||||||
private bool VatAlreadyRegistered { get; set; }
|
private bool VatAlreadyRegistered { get; set; }
|
||||||
|
|
||||||
|
//BottomSeath
|
||||||
|
private bool OpenSearchAddress { get; set; }
|
||||||
|
private IndirizzoDTO Address { get; set; }
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||||
@@ -467,4 +484,12 @@
|
|||||||
|
|
||||||
OnAfterChangeValue();
|
OnAfterChangeValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnAddressSet()
|
||||||
|
{
|
||||||
|
ContactModel.Citta = Address.Citta;
|
||||||
|
ContactModel.Indirizzo = Address.Indirizzo;
|
||||||
|
ContactModel.Prov = Address.Prov;
|
||||||
|
ContactModel.Cap = Address.Cap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,3 +7,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-address {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.65rem;
|
||||||
|
color: var(--mud-palette-primary);
|
||||||
|
font-weight: 600;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
12
salesbook.Shared/Core/Dto/AutoCompleteAddressDTO.cs
Normal file
12
salesbook.Shared/Core/Dto/AutoCompleteAddressDTO.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace salesbook.Shared.Core.Dto;
|
||||||
|
|
||||||
|
public class AutoCompleteAddressDTO
|
||||||
|
{
|
||||||
|
[JsonPropertyName("description")]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("placeId")]
|
||||||
|
public string PlaceId { get; set; }
|
||||||
|
}
|
||||||
36
salesbook.Shared/Core/Dto/IndirizzoDTO.cs
Normal file
36
salesbook.Shared/Core/Dto/IndirizzoDTO.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace salesbook.Shared.Core.Dto;
|
||||||
|
|
||||||
|
public class IndirizzoDTO
|
||||||
|
{
|
||||||
|
[JsonPropertyName("idPosizione")]
|
||||||
|
public int IdPosizione { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("via")]
|
||||||
|
public string? Via { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("numeroCivico")]
|
||||||
|
public string? NumeroCivico { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("indirizzo")]
|
||||||
|
public string? Indirizzo { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("cap")]
|
||||||
|
public string? Cap { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("citta")]
|
||||||
|
public string? Citta { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("prov")]
|
||||||
|
public string? Prov { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("nazione")]
|
||||||
|
public string? Nazione { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("lat")]
|
||||||
|
public decimal? Lat { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("lng")]
|
||||||
|
public decimal? Lng { get; set; }
|
||||||
|
}
|
||||||
@@ -16,4 +16,9 @@ public interface IIntegryApiService
|
|||||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
||||||
Task SaveContact(CRMCreateContactRequestDTO request);
|
Task SaveContact(CRMCreateContactRequestDTO request);
|
||||||
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
|
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
|
||||||
|
|
||||||
|
//Google
|
||||||
|
Task<List<IndirizzoDTO>?> Geocode(string address);
|
||||||
|
Task<List<AutoCompleteAddressDTO>?> AutoCompleteAddress(string address, string language, string uuid);
|
||||||
|
Task<IndirizzoDTO?> PlaceDetails(string placeId, string uuid);
|
||||||
}
|
}
|
||||||
@@ -74,4 +74,38 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
|||||||
|
|
||||||
public Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request) =>
|
public Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request) =>
|
||||||
integryApiRestClient.Post<CheckVatResponseDTO>("checkPartitaIva", request)!;
|
integryApiRestClient.Post<CheckVatResponseDTO>("checkPartitaIva", request)!;
|
||||||
|
|
||||||
|
public Task<List<IndirizzoDTO>?> Geocode(string address)
|
||||||
|
{
|
||||||
|
var queryParams = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{"address", address},
|
||||||
|
{"retrieveAll", true}
|
||||||
|
};
|
||||||
|
|
||||||
|
return integryApiRestClient.Get<List<IndirizzoDTO>>("geocode", queryParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<List<AutoCompleteAddressDTO>?> AutoCompleteAddress(string address, string language, string uuid)
|
||||||
|
{
|
||||||
|
var queryParams = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{"address", address},
|
||||||
|
{"language", language},
|
||||||
|
{"uuid", uuid}
|
||||||
|
};
|
||||||
|
|
||||||
|
return integryApiRestClient.Get<List<AutoCompleteAddressDTO>>("google/places/autoCompleteAddress", queryParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<IndirizzoDTO?> PlaceDetails(string placeId, string uuid)
|
||||||
|
{
|
||||||
|
var queryParams = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ "placeId", placeId },
|
||||||
|
{ "uuid", uuid }
|
||||||
|
};
|
||||||
|
|
||||||
|
return integryApiRestClient.Get<IndirizzoDTO>("google/places/placeDetails", queryParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ a, .btn-link {
|
|||||||
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }
|
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding-top: 1.1rem;
|
/*padding-top: 1.1rem;*/
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -176,6 +176,7 @@ h1:focus { outline: none; }
|
|||||||
.customDialog-form .mud-dialog-content {
|
.customDialog-form .mud-dialog-content {
|
||||||
padding: 0 .75rem;
|
padding: 0 .75rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-item-select { padding: 6px 16px; }
|
.custom-item-select { padding: 6px 16px; }
|
||||||
|
|||||||
@@ -6,5 +6,6 @@
|
|||||||
--exception-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
|
--exception-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
|
||||||
--custom-box-shadow: 1px 2px 5px var(--gray-for-shadow);
|
--custom-box-shadow: 1px 2px 5px var(--gray-for-shadow);
|
||||||
--mud-default-borderradius: 12px !important;
|
--mud-default-borderradius: 12px !important;
|
||||||
--m-page-x: 1.25rem;
|
--m-page-x: 1rem;
|
||||||
|
--mh-header: 4rem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user