This commit is contained in:
mmrbnjd
2024-10-14 17:38:18 +03:30
parent 831e5fafec
commit 595a9ea5d8
2 changed files with 12 additions and 2 deletions

View File

@@ -42,7 +42,7 @@
<input @bind-value="itemsearch.ZipCode" placeholder="کد پستی" style="text-align:center" dir="ltr" class="form-control" type="number">
</div>
<div class="col-auto">
<button @onclick="() => LoadCus(1)" type="submit" class="btn btn-primary">جستجو</button>
<Button Disabled="SpinnerVisible" @onclick="() => LoadCus(1)" Color="ButtonColor.Primary">جستجو</Button>
</div>
<div class="col-auto">
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />

View File

@@ -54,7 +54,10 @@
OnChanged="(ForCustomerSearch customer) => OnAutoCompleteChanged(customer)" />
</div>
<div class="col-auto">
<button @onclick="() => LoadInvoice(1)" type="submit" class="btn btn-primary">جستجو</button>
<Button Disabled="SpinnerVisible" @onclick="() => LoadInvoice(1)" Color="ButtonColor.Primary">جستجو</Button>
</div>
<div class="col-auto">
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
</div>
</div>
</li>
@@ -120,6 +123,7 @@
@layout PanelLayout
@code {
public bool SpinnerVisible { get; set; } = false;
private string? customerName;
public IEnumerable<ForCustomerSearch>? customers;
public List<IdName<int>> Patterns { get; set; }
@@ -147,6 +151,7 @@
protected override async Task OnParametersSetAsync()
{
SpinnerVisible = true;
if (PageIndex == null) PageIndex = 1;
if (!string.IsNullOrEmpty(input))
{
@@ -158,6 +163,7 @@
}
await LoadInvoice(PageIndex.Value);
SpinnerVisible = false;
await base.OnParametersSetAsync();
}
}
@@ -178,6 +184,7 @@
}
public async Task LoadInvoice(int pi)
{
SpinnerVisible = true;
if (ItemSearchInvoicetype == 100 || ItemSearchInvoicetype == null)
itemsearch.invoiceType = null;
else
@@ -200,6 +207,7 @@
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
}
PreloadService.Hide();
SpinnerVisible = false;
}
public async Task CallBackInvoiceItem(ActionInResultComponent result)
{
@@ -260,6 +268,7 @@
//------------------------
private async Task<List<ForCustomerSearch>> GetCustomers()
{
SpinnerVisible = true;
return await fv.GetCustomers();
// var rsp = await hc.Get("Customer/GetAllForidName");
// if (rsp.IsSuccessStatusCode)
@@ -267,6 +276,7 @@
// return await rsp.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
// }
// return new List<ForCustomerSearch>();
SpinnerVisible = false;
}
private void OnAutoCompleteChanged(ForCustomerSearch customer)