...
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
@inject Fixedvalues fv;
|
||||
@page "/InvoiceDetails/{InvoiceID:int}"
|
||||
@page "/InvoiceDetails"
|
||||
<Modal @ref="modal" />
|
||||
<Preload LoadingText="در حال بارگذاری..." />
|
||||
<form>
|
||||
@* alert *@
|
||||
@@ -125,16 +126,19 @@
|
||||
<Content>
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-11">
|
||||
<LGridInvoiceItem InvoiceItems="invoice.items" />
|
||||
<LGridInvoiceItem OnMultipleOfThree="EventCallback.Factory.Create<string>(this, CallBack)" InvoiceItems="invoice.items" />
|
||||
</div>
|
||||
<div class="form-group col-md-1">
|
||||
<button class="button-8" role="button">+</button>
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="NewItemClick" Outline="true" Type="ButtonType.Button">
|
||||
+
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Content>
|
||||
</Tab>
|
||||
<Tab Title="پرداختی ها">
|
||||
@* <Tab Title="پرداختی ها">
|
||||
<Content>
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-11">
|
||||
@@ -142,15 +146,15 @@
|
||||
</div>
|
||||
<div class="form-group col-md-1">
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Secondary" @onclick="OnClickDelete" Type="ButtonType.Button">
|
||||
پرداخت جدید
|
||||
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="OnClickDelete" Outline="true" Type="ButtonType.Button">
|
||||
+
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</Content>
|
||||
</Tab>
|
||||
</Tab> *@
|
||||
|
||||
</Tabs>
|
||||
</div>
|
||||
@@ -195,6 +199,7 @@
|
||||
|
||||
|
||||
@code {
|
||||
private Modal modal = default!;
|
||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
@@ -211,7 +216,7 @@
|
||||
invoice = new InvoiceDTO();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
@@ -219,14 +224,8 @@
|
||||
Patterns = await fv.GetPatterns();
|
||||
if (InvoiceID != null && InvoiceID > 0)
|
||||
{
|
||||
var rsp = await hc.Get($"Invoice/Get/{InvoiceID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
invoice = await rsp.Content.ReadFromJsonAsync<InvoiceDTO>();
|
||||
}
|
||||
else
|
||||
hc._nav.NavigateTo("/Pael");
|
||||
|
||||
|
||||
await LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -247,6 +246,59 @@
|
||||
}
|
||||
}
|
||||
@functions {
|
||||
private async Task NewItemClick()
|
||||
{
|
||||
var parameters = new Dictionary<string, object>();
|
||||
|
||||
|
||||
parameters.Add("itemDTO", new InvoiceItemDTO());
|
||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBack));
|
||||
await modal.ShowAsync<CUSComponent.InvoiceItem>(title: "آیتم جدید", parameters: parameters);
|
||||
|
||||
}
|
||||
private async Task LoadData()
|
||||
{
|
||||
var rsp = await hc.Get($"Invoice/Get/{InvoiceID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
invoice = await rsp.Content.ReadFromJsonAsync<InvoiceDTO>();
|
||||
}
|
||||
else
|
||||
hc._nav.NavigateTo("/Panel");
|
||||
}
|
||||
public async Task CallBack(ActionInResultComponent result)
|
||||
{
|
||||
string msg = "";
|
||||
if (result.Action == ComponentAction.add)
|
||||
{
|
||||
if (result.Status == ComponentStatus.success)
|
||||
msg = "آیتم جدید با موفقیت اضافه شد";
|
||||
|
||||
}
|
||||
// else if (result.Action == ComponentAction.update)
|
||||
// {
|
||||
// if (result.Status == ComponentStatus.success)
|
||||
// msg = "اطلاعات آیتم با موفقیت ویرایش شد";
|
||||
// }
|
||||
// else if (result.Action == ComponentAction.delete)
|
||||
// {
|
||||
// if (result.Status == ComponentStatus.success)
|
||||
// msg = "آیتم با موفقیت حذف شد";
|
||||
// }
|
||||
await CallBack(msg);
|
||||
// if (result.Status == ComponentStatus.success)
|
||||
// await LoadCod(1);
|
||||
|
||||
await modal.HideAsync();
|
||||
}
|
||||
private async Task CallBack(string result)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
ShowSuccessAlert(result);
|
||||
await LoadData();
|
||||
}
|
||||
}
|
||||
private void ShowSuccessAlert(string msg)
|
||||
{
|
||||
Hidealert = false;
|
||||
|
@@ -1,42 +0,0 @@
|
||||
/* CSS */
|
||||
.button-8 {
|
||||
background-color: #e1ecf4;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #7aa7c7;
|
||||
box-shadow: rgba(255, 255, 255, .7) 0 1px 0 0 inset;
|
||||
box-sizing: border-box;
|
||||
color: #39739d;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-family: -apple-system,system-ui,"Segoe UI","Liberation Sans",sans-serif;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 1.15385;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
padding: 8px .8em;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
touch-action: manipulation;
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.button-8:hover,
|
||||
.button-8:focus {
|
||||
background-color: #b3d3ea;
|
||||
color: #2c5777;
|
||||
}
|
||||
|
||||
.button-8:focus {
|
||||
box-shadow: 0 0 0 4px rgba(0, 149, 255, .15);
|
||||
}
|
||||
|
||||
.button-8:active {
|
||||
background-color: #a0c7e4;
|
||||
box-shadow: none;
|
||||
color: #2c5777;
|
||||
}
|
Reference in New Issue
Block a user