...
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
@inject HttpClientController hc;
|
||||
@inject Fixedvalues fv;
|
||||
<ConfirmDialog @ref="dialog" />
|
||||
<Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
|
||||
<form>
|
||||
@* alert *@
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<Modal @ref="modal" />
|
||||
<Preload LoadingText="در حال بارگذاری..." />
|
||||
<ConfirmDialog @ref="dialog" />
|
||||
|
||||
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
<form>
|
||||
@* alert *@
|
||||
<div class="row">
|
||||
@@ -19,7 +19,28 @@
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
||||
{
|
||||
<div class="row g-3">
|
||||
<div class="col-md-1">
|
||||
<Button Color="ButtonColor.Success" Outline="true"> فاکتور </Button>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<Button Color="ButtonColor.Info" Disabled="true" Outline="true"> برگشت از فروش </Button>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<Button Color="ButtonColor.Primary" Disabled="true" Outline="true"> اصلاح </Button>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<Button Color="ButtonColor.Danger" Disabled="true" Outline="true"> ابطال </Button>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<Button Color="ButtonColor.Dark" Outline="true"> لغو </Button>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<hr class="hr" />
|
||||
}
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-2">
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputTitle">عنوان</label>
|
||||
@@ -124,12 +145,11 @@
|
||||
</div>
|
||||
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
||||
{
|
||||
|
||||
<br /> <hr class="hr" />
|
||||
<div class="row g-3">
|
||||
<Tabs NavStyle="NavStyle.VerticalUnderline">
|
||||
@* <Tabs NavStyle="NavStyle.VerticalUnderline">
|
||||
<Tab Title="آیتم ها" IsActive="true">
|
||||
<Content>
|
||||
<Content> *@
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-11">
|
||||
@if (InvoiceID.HasValue && invoice.items.Count > 0)
|
||||
@@ -146,8 +166,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Content>
|
||||
</Tab>
|
||||
@* </Content>
|
||||
</Tab> *@
|
||||
@* <Tab Title="پرداختی ها">
|
||||
<Content>
|
||||
<div class="row g-3">
|
||||
@@ -166,11 +186,25 @@
|
||||
</Content>
|
||||
</Tab> *@
|
||||
|
||||
</Tabs>
|
||||
@* </Tabs> *@
|
||||
</div>
|
||||
|
||||
}
|
||||
<br />
|
||||
<hr class="hr" />
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-4">
|
||||
<label class="col-sm-6 col-form-label">مجموع تخفیف</label>
|
||||
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tdis" Locale="fa-Ir" Placeholder="مجموع تخفیف" readonly />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="col-sm-6 col-form-label">مجموع مالیات</label>
|
||||
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tvam" Locale="fa-Ir" Placeholder="مجموع مالیات" readonly />
|
||||
</div> <div class="form-group col-md-4">
|
||||
<label class="col-sm-6 col-form-label">مجموع صورتحساب</label>
|
||||
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tbill" Locale="fa-Ir" Placeholder="مجموع صورتحساب" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-6">
|
||||
@@ -211,7 +245,7 @@
|
||||
|
||||
|
||||
@code {
|
||||
[Inject] ToastService ToastService { get; set; } = default!;
|
||||
List<ToastMessage> messages = new List<ToastMessage>();
|
||||
private ConfirmDialog dialog = default!;
|
||||
private Modal modal = default!;
|
||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||
@@ -261,6 +295,14 @@
|
||||
}
|
||||
}
|
||||
@functions {
|
||||
private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg));
|
||||
|
||||
private ToastMessage CreateToastMessage(ToastType toastType, string msg)
|
||||
=> new ToastMessage
|
||||
{
|
||||
Type = toastType,
|
||||
Message = msg,
|
||||
};
|
||||
private async Task NewItemClick()
|
||||
{
|
||||
if (InvoiceID.HasValue)
|
||||
@@ -382,7 +424,7 @@
|
||||
|
||||
if (request)
|
||||
{
|
||||
ToastService.Notify(new ToastMessage(ToastType.Success, $"عملیات با موفقیت انجام شد"));
|
||||
ShowSuccessAlert("ویرایش با موفقیت انجام شد");
|
||||
|
||||
}
|
||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
@@ -495,8 +537,8 @@
|
||||
{ ShowDangerAlert("تاریخ صدور نمی تواند از امروز جلوتر باشد"); return false; }
|
||||
}
|
||||
|
||||
if (invoice.PatternID.HasValue)
|
||||
if (invoice.PatternID <= 0 || !Patterns.Any(w => w.ID == invoice.PatternID.Value))
|
||||
if (invoice.PatternID.HasValue && invoice.PatternID > 0)
|
||||
if (!Patterns.Any(w => w.ID == invoice.PatternID.Value))
|
||||
{ ShowDangerAlert("شناسه الگو صحیح نمی باشد"); return false; }
|
||||
|
||||
if (invoice.CustomerID == null || invoice.CustomerID <= 0 || !Cus.Any(w => w.ID == invoice.CustomerID))
|
||||
@@ -519,7 +561,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
ToastService.Notify(new ToastMessage(ToastType.Secondary, $"عملیات حذف متوقف شد"));
|
||||
ShowMessage(ToastType.Secondary, "عملیات حذف متوقف شد");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user