2024-03-03 11:42:13 +03:30
|
|
|
|
@using Color = MudBlazor.Color
|
|
|
|
|
|
@using Size = MudBlazor.Size
|
2024-04-17 16:19:43 +03:30
|
|
|
|
@using Netina.AdminPanel.PWA.Services.RestServices
|
|
|
|
|
|
@using Netina.AdminPanel.PWA.Utilities
|
2024-03-03 11:42:13 +03:30
|
|
|
|
|
2024-03-01 16:16:05 +03:30
|
|
|
|
@inject ISnackbar Snackbar
|
2024-02-17 15:39:59 +03:30
|
|
|
|
@inject IRestWrapper RestWrapper
|
|
|
|
|
|
@inject IUserUtility UserUtility
|
|
|
|
|
|
@inject IDialogService DialogService
|
2024-03-01 16:16:05 +03:30
|
|
|
|
@inject IPrintingService PrintingService
|
2024-03-03 11:42:13 +03:30
|
|
|
|
@inject IJSRuntime JsRuntime
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
2024-03-03 11:42:13 +03:30
|
|
|
|
<MudDialog class="w-full">
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<DialogContent>
|
2024-03-03 11:42:13 +03:30
|
|
|
|
<MudStack class="max-h-[50rem] w-full mt-4" Style="overflow-y: scroll">
|
|
|
|
|
|
<MudGrid class="w-full">
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudItem xs="12" md="9">
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudStack>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudStack Row="true">
|
2024-04-13 22:20:58 +03:30
|
|
|
|
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.h6" class="my-auto"><b>اطلاعات سفارش</b></MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudPaper Elevation="0" class="bg-blue-500 px-4 py-2 my-auto">
|
|
|
|
|
|
<MudText Typo="Typo.body2" class="text-white">@ViewModel.PageDto.OrderStatus.ToDisplay()</MudText>
|
|
|
|
|
|
</MudPaper>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
|
|
|
|
|
<MudGrid>
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudItem xs="12" sm="4">
|
2024-04-25 02:48:37 +03:30
|
|
|
|
<MudField Variant="Variant.Outlined" Label="نام و نام خانوادگی">@ViewModel.PageDto.CustomerFullName</MudField>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudItem>
|
|
|
|
|
|
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudItem xs="12" sm="4">
|
2024-04-25 02:48:37 +03:30
|
|
|
|
<MudField Variant="Variant.Outlined" Label="شماره تماس">@ViewModel.PageDto.CustomerPhoneNumber</MudField>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudItem>
|
|
|
|
|
|
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudItem xs="12" sm="4">
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudField Variant="Variant.Outlined" Label="کد تخفیف">@ViewModel.PageDto.DiscountCode</MudField>
|
|
|
|
|
|
</MudItem>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudItem xs="12" sm="6">
|
2024-02-26 18:16:29 +03:30
|
|
|
|
<MudField Variant="Variant.Outlined" Label="آدرس">@ViewModel.PageDto?.OrderDelivery?.Address</MudField>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudItem>
|
2024-04-14 12:38:16 +03:30
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudItem xs="12" sm="3">
|
|
|
|
|
|
<MudField Variant="Variant.Outlined" Label="روش ارسال">@ViewModel.PageDto?.OrderDelivery?.ShippingMethod</MudField>
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
<MudItem xs="12" sm="3">
|
|
|
|
|
|
<MudField Variant="Variant.Outlined" Label="کدرهگیری ارسال">@ViewModel.PageDto?.OrderDelivery?.TrackingCode</MudField>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudItem>
|
|
|
|
|
|
</MudGrid>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudStack class="mt-3" Row="true">
|
2024-04-13 22:20:58 +03:30
|
|
|
|
|
|
|
|
|
|
<MudText Typo="Typo.h6"><b>کالاهای این سفارش</b></MudText>
|
|
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudPaper Elevation="0" class="border-dashed border-violet-400 border-2 px-3 py-1 my-auto">
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudText Typo="Typo.caption" class="text-violet-500"><b>@ViewModel.PageDto.OrderProducts.Sum(op => op.Count) قلم کالا</b></MudText>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudPaper>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDataGrid FixedFooter="true" FixedHeader="true" Striped="true"
|
|
|
|
|
|
Elevation="0"
|
|
|
|
|
|
Bordered="true"
|
|
|
|
|
|
T="OrderProductSDto" Items="@ViewModel.PageDto.OrderProducts"
|
|
|
|
|
|
Filterable="false" Loading="@ViewModel.IsProcessing"
|
|
|
|
|
|
SortMode="@SortMode.None" Groupable="false"
|
|
|
|
|
|
class="border-solid border-2 border-gray-200">
|
|
|
|
|
|
<Columns>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<TemplateColumn T="OrderProductSDto" Title="نام کالا">
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<CellTemplate>
|
|
|
|
|
|
<b>@context.Item.ProductName</b>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</CellTemplate>
|
|
|
|
|
|
</TemplateColumn>
|
|
|
|
|
|
|
|
|
|
|
|
<TemplateColumn T="OrderProductSDto" Title="قیمت کالا">
|
|
|
|
|
|
|
|
|
|
|
|
<CellTemplate>
|
|
|
|
|
|
<p>@context.Item.ProductFeeWithDiscount.ToString("N0") ریالــ</p>
|
|
|
|
|
|
</CellTemplate>
|
|
|
|
|
|
</TemplateColumn>
|
|
|
|
|
|
<PropertyColumn Title="تعداد" Property="arg => arg.Count" />
|
|
|
|
|
|
|
|
|
|
|
|
<TemplateColumn T="OrderProductSDto" Title="قیمت کل">
|
|
|
|
|
|
|
|
|
|
|
|
<CellTemplate>
|
|
|
|
|
|
<p>@context.Item.ProductCost.ToString("N0") ریالــ</p>
|
|
|
|
|
|
</CellTemplate>
|
|
|
|
|
|
</TemplateColumn>
|
|
|
|
|
|
</Columns>
|
|
|
|
|
|
</MudDataGrid>
|
|
|
|
|
|
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
|
2024-03-01 16:16:05 +03:30
|
|
|
|
<MudItem xs="12" md="3">
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudText Typo="Typo.h6" class="mb-2"><b>مبــــالغ</b></MudText>
|
|
|
|
|
|
<MudPaper class="bg-[--mud-palette-background-grey] rounded-md">
|
|
|
|
|
|
<MudStack class="p-3">
|
|
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">جمع کالاها : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.TotalProductsPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDivider />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">مالیات : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.TaxesPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDivider />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">بسته بندی : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.PackingPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDivider />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">هزینه ارسال : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.DeliveryPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
|
|
|
|
|
<MudPaper class="mud-theme-dark rounded-md">
|
|
|
|
|
|
|
|
|
|
|
|
<MudStack class="p-3">
|
|
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">جمع کل : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.TotalPriceWithoutDiscount.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDivider />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">مقدار تخفیف : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.DiscountPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudDivider />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
|
|
|
|
|
|
<MudStack Row="true">
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">مبلغ قابل پرداخت : </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudSpacer />
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudText Typo="Typo.body1"><b>@ViewModel.PageDto.TotalPrice.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
</MudPaper>
|
|
|
|
|
|
</MudPaper>
|
|
|
|
|
|
|
|
|
|
|
|
<MudText Typo="Typo.h6" class="mt-3"><b>پرداختــ ها</b></MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
|
2024-02-17 15:39:59 +03:30
|
|
|
|
<MudPaper Elevation="0" class="bg-[--mud-palette-background-grey] rounded-md">
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudStack class="p-3">
|
|
|
|
|
|
|
|
|
|
|
|
@foreach (var item in ViewModel.PageDto.Payments)
|
|
|
|
|
|
{
|
|
|
|
|
|
<MudStack Row="true">
|
2024-03-03 11:42:13 +03:30
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">@item.Type.ToDisplay()</MudText>
|
|
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2"> - </MudText>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudText class="my-auto" Typo="Typo.body2">@item.Status.ToDisplay()</MudText>
|
|
|
|
|
|
<MudSpacer />
|
|
|
|
|
|
<MudText Typo="Typo.body1"><b>@item.Amount.ToString("N0")</b> ریالــ</MudText>
|
|
|
|
|
|
</MudStack>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</MudStack>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</MudPaper>
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
</MudGrid>
|
2024-03-03 11:42:13 +03:30
|
|
|
|
</MudStack>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</DialogContent>
|
|
|
|
|
|
<DialogActions>
|
2024-04-13 22:20:58 +03:30
|
|
|
|
<MudGrid Row="true" class="w-full h-fit mx-4 mb-3 bottom-0">
|
|
|
|
|
|
|
|
|
|
|
|
<MudItem xs="12" sm="6" md="6">
|
|
|
|
|
|
<BaseButtonUi class="w-full h-12 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
|
|
|
|
|
Icon="@Icons.Material.Outlined.AirportShuttle"
|
|
|
|
|
|
Variant="Variant.Filled" Color="Color.Success"
|
|
|
|
|
|
Content="@ViewModel.ConfirmOrderButtonText"
|
|
|
|
|
|
OnClickCallback="ViewModel.SubmitConfirmAsync" />
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
<MudItem xs="12" sm="6" md="2">
|
|
|
|
|
|
<BaseButtonUi class="w-full h-12 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
|
|
|
|
|
Icon="@Icons.Material.Outlined.RemoveCircle"
|
|
|
|
|
|
Variant="Variant.Outlined" Color="Color.Error"
|
|
|
|
|
|
Content="لغو سفارش" />
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
|
|
|
|
|
|
<MudItem xs="12" sm="6" md="3">
|
|
|
|
|
|
<BaseButtonUi class="w-full h-12 rounded-md my-auto" IsProcessing="@ViewModel.IsProcessing"
|
|
|
|
|
|
Icon="@Icons.Material.Outlined.Print"
|
|
|
|
|
|
Size="Size.Small"
|
|
|
|
|
|
Variant="Variant.Outlined" Color="Color.Info"
|
|
|
|
|
|
OnClickCallback="@ViewModel.PrintInvoiceAsync"
|
|
|
|
|
|
Content="چاپــ فاکتور" />
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
<MudItem xs="12" sm="6" md="1">
|
|
|
|
|
|
<BaseButtonUi class="w-full h-12 rounded-md my-auto" IsProcessing="@ViewModel.IsProcessing"
|
|
|
|
|
|
Size="Size.Small"
|
|
|
|
|
|
Variant="Variant.Outlined" Color="Color.Error"
|
|
|
|
|
|
OnClickCallback="@ViewModel.Cancel"
|
|
|
|
|
|
Content="بستن" />
|
|
|
|
|
|
</MudItem>
|
|
|
|
|
|
</MudGrid>
|
2024-02-17 15:39:59 +03:30
|
|
|
|
</DialogActions>
|
|
|
|
|
|
</MudDialog>
|
|
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
|
|
|
|
[CascadingParameter]
|
|
|
|
|
|
MudDialogInstance MudDialog { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
|
public OrderSDto? Order { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public OrderActionDialogBoxViewModel ViewModel { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Order == null)
|
2024-03-03 11:42:13 +03:30
|
|
|
|
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, PrintingService, JsRuntime);
|
2024-02-17 15:39:59 +03:30
|
|
|
|
else
|
2024-04-13 22:20:58 +03:30
|
|
|
|
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, Order, PrintingService, JsRuntime);
|
2024-02-17 15:39:59 +03:30
|
|
|
|
await ViewModel.InitializeAsync();
|
|
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|