This commit is contained in:
mmrbnjd
2024-08-08 18:20:21 +03:30
parent cd95332a3d
commit 70df7d48b4
5 changed files with 119 additions and 19 deletions

View File

@@ -4,6 +4,7 @@
@using Shared.DTOs
@layout PanelLayout
@inject HttpClientController hc;
@inject Fixedvalues fv;
<Preload LoadingText="در حال بارگذاری..." />
<ConfirmDialog @ref="dialog" />
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
@@ -74,11 +75,11 @@ else
{
if (item.Des != null && item.Des.Count() > 0 && !FullInvoice)
{
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label style="color:red;" class="form-label">@item.fName</label>
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label style="color:red;" class="form-label">@item.fName</label>
}
else
{
@@ -90,10 +91,10 @@ else
{
if (item.Des != null && item.Des.Count() > 0 && !FullInvoice)
{
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label class="form-label">@item.fName</label>
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label class="form-label">@item.fName</label>
}
else
{
@@ -122,7 +123,48 @@ else
}
else if (item.InputBox == "autofild")
{
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
if (item.eName.ToLower() == "inty")
{
var bill = BillTypes.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
if (bill != null)
{
item.Value = bill;
}
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
}
else if (item.eName.ToLower() == "inp")
{
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
if (patt != null)
{
item.Value = patt;
}
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
}
else if (item.eName.ToLower() == "ins")
{
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
if (patt != null)
{
item.Value = patt;
}
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
}
else
{
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
}
}
@@ -167,8 +209,8 @@ else
{
if (itemB.Des != null && itemB.Des.Count() > 0 && !FullInvoice)
{
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label style="color:red;" class="form-label">@itemB.fName</label>
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label style="color:red;" class="form-label">@itemB.fName</label>
}
else
{
@@ -179,8 +221,8 @@ else
{
if (itemB.Des != null && itemB.Des.Count() > 0 && !FullInvoice)
{
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label class="form-label">@itemB.fName</label>
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
<label class="form-label">@itemB.fName</label>
}
else
{
@@ -212,6 +254,8 @@ else
{
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
}
else
{
@@ -269,6 +313,8 @@ else
@code {
private List<IdName<int>>? Patterns = new List<IdName<int>>();
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
private Modal modal = default!;
private ConfirmDialog dialog = default!;
[Parameter] public int? InvoiceID { get; set; }
@@ -285,6 +331,9 @@ else
protected override async Task OnParametersSetAsync()
{
PreloadService.Show(SpinnerColor.Dark);
Patterns = await fv.GetPatternsbyinp();
BillTypes = await fv.GetBillTypes();
await LoadData();
PreloadService.Hide();
@@ -352,7 +401,7 @@ else
}
else
{
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
}
}
else