...
This commit is contained in:
@@ -8,6 +8,165 @@
|
||||
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
<PageTitle>آماده سازی صورتحساب</PageTitle>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">اطلاعات تکمیلی سرآمد صورتحساب</h5>
|
||||
<div class="card-body">
|
||||
|
||||
<form>
|
||||
@if (invoice?.header != null)
|
||||
{
|
||||
|
||||
<div class="row">
|
||||
@foreach (var item in invoice?.header.filds)
|
||||
{
|
||||
<div class="mb-3 col-md-6">
|
||||
@if (item.ModeID == 1 && item.InputBox != "autofild")
|
||||
{
|
||||
<label style="color:red;" class="form-label">@item.fName</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="form-label">@item.fName</label>
|
||||
}
|
||||
@if (item.InputBox == "fromdb")
|
||||
{
|
||||
|
||||
<select @bind="item.Value" class="form-control" aria-label="Default select example">
|
||||
<option value="100" style="color: #b5b5b5; " selected>@item.fName...</option>
|
||||
@foreach (var itema in item.DefVals)
|
||||
{
|
||||
if (itema.ID == item.Value)
|
||||
{
|
||||
<option value="@itema.ID" selected>@itema.Name</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@itema.ID">@itema.Name</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
|
||||
|
||||
}
|
||||
else if (item.InputBox == "autofild")
|
||||
{
|
||||
<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" />
|
||||
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">اطلاعات تکمیلی بدنه صورتحساب</h5>
|
||||
<div class="card-body">
|
||||
@if (invoice?.Bodys != null)
|
||||
{
|
||||
<Accordion>
|
||||
@foreach (var item in invoice?.Bodys)
|
||||
{<div class="col-md-12">
|
||||
<div class="card mb-4">
|
||||
<AccordionItem Title="@item.filds.Where(w=>w.eName=="sstt").Select(s=>s.Value).First()">
|
||||
<Content>
|
||||
<div class="row">
|
||||
@foreach (var itemB in item.filds)
|
||||
{
|
||||
<div class="mb-3 col-md-6">
|
||||
@if (itemB.ModeID == 1 && itemB.InputBox != "autofild")
|
||||
{
|
||||
<label style="color:red;" class="form-label">@itemB.fName</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="form-label">@itemB.fName</label>
|
||||
}
|
||||
@if (itemB.InputBox == "fromdb")
|
||||
{
|
||||
|
||||
<select @bind="itemB.Value" class="form-control" aria-label="Default select example">
|
||||
<option value="100" style="color: #b5b5b5; " selected>@itemB.fName...</option>
|
||||
@foreach (var itema in itemB.DefVals)
|
||||
{
|
||||
if (itema.ID == itemB.Value)
|
||||
{
|
||||
<option value="@itema.ID" selected>@itema.Name</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@itema.ID">@itema.Name</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
|
||||
|
||||
}
|
||||
else if (itemB.InputBox == "autofild")
|
||||
{
|
||||
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" />
|
||||
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
</Content>
|
||||
</AccordionItem>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</Accordion>
|
||||
|
||||
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* action *@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-2">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-auto">
|
||||
<button type="submit" @onclick="Send" class="btn btn-primary">ارسال</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private ConfirmDialog dialog = default!;
|
||||
[Parameter] public int? InvoiceID { get; set; }
|
||||
@@ -24,10 +183,33 @@
|
||||
{
|
||||
await LoadData();
|
||||
await base.OnParametersSetAsync();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@functions{
|
||||
@functions {
|
||||
public async Task Send()
|
||||
{
|
||||
var rsp = await hc.Post<_TaxPayer.Atemplatefield>($"TaxPayer/PreparationInvoiceBeforeSending", invoice);
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var response = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||
if (response)
|
||||
{
|
||||
ShowSuccessAlert("آماده سازی با موفقیت انجام شد");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowDangerAlert("خطای در آماده سازی اطلاعات رخ داده");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowSuccessAlert(string msg)
|
||||
{
|
||||
Hidealert = false;
|
||||
|
Reference in New Issue
Block a user