Files
BackOffice/src/BackOffice/Pages/UserOrder/Components/UserOrderDetailsDialog.razor
masoodafar-web 5cec4e9313 feat: Implement role-based access control and manual payment management
- Added role-based permission checks in NavMenu for dashboard and management links.
- Created ManualPaymentDialog for creating and managing manual payments.
- Implemented TransactionDetailsDialog for displaying transaction details.
- Developed Transactions page for viewing and filtering transactions.
- Introduced RolePermissionsDialog for managing role permissions.
- Established AuthorizationService to handle permission checks and user roles.
- Enhanced UI components with MudBlazor for better user experience.
2025-12-05 17:27:23 +03:30

172 lines
9.4 KiB
Plaintext

@using BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder
@using BackOffice.Common.BaseComponents
<MudDialog>
<DialogContent>
<MudStack Spacing="2">
@if (_isLoading)
{
<MudProgressLinear Indeterminate="true" Color="Color.Primary" />
}
else if (_model is null)
{
<MudText Typo="Typo.body1" Color="Color.Error">
خطا در دریافت اطلاعات سفارش.
</MudText>
}
else
{
<MudStack Spacing="2">
<MudText Typo="Typo.h6">جزئیات سفارش شماره @_model.Id</MudText>
<MudText Typo="Typo.body2">
کاربر: @_model.UserFullName (@_model.UserNationalCode)
</MudText>
<MudPaper Class="pa-3">
<MudStack Spacing="2">
<MudText Typo="Typo.subtitle2">خلاصه سفارش</MudText>
<MudDivider />
<MudText Typo="Typo.body2">مبلغ: @_model.Amount.ToString("N0") تومان</MudText>
<MudText Typo="Typo.body2">شناسه پرداخت: @_model.TransactionId</MudText>
<MudText Typo="Typo.body2">
تاریخ پرداخت:
@_model.PaymentDate.ToDateTime().ToLocalTime().MiladiToJalaliWithTime()
</MudText>
<MudText Typo="Typo.body2">
روش پرداخت:
@GetPaymentMethodText(_model.PaymentMethod.GetHashCode())
</MudText>
<MudText Typo="Typo.body2">
وضعیت پرداخت:
@if (_model.PaymentStatus==PaymentStatus.Success)
{
<MudChip T="string" Color="Color.Success" Size="Size.Small">پرداخت شده</MudChip>
}else if (_model.PaymentStatus==PaymentStatus.Pending)
{
<MudChip T="string" Color="Color.Success" Size="Size.Small">در انتظار پرداخت</MudChip>
}
else
{
<MudChip T="string" Color="Color.Error" Size="Size.Small">پرداخت نشده</MudChip>
}
</MudText>
@if (_model.VatAmount > 0)
{
<MudDivider Class="my-2" />
<MudText Typo="Typo.subtitle2">جزئیات مالیات بر ارزش افزوده</MudText>
<MudText Typo="Typo.body2">
مبلغ کالا (قبل از مالیات): @_model.VatBaseAmount.ToString("N0") تومان
</MudText>
<MudText Typo="Typo.body2">
مالیات (@_model.VatPercentage.ToString("0")٪): @_model.VatAmount.ToString("N0") تومان
</MudText>
<MudText Typo="Typo.body2">
مبلغ نهایی (شامل مالیات): @_model.VatTotalAmount.ToString("N0") تومان
</MudText>
}
<MudDivider Class="my-2" />
<MudText Typo="Typo.subtitle2">Timeline وضعیت</MudText>
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Center">
@foreach (var step in _timelineSteps)
{
<MudStack Spacing="0" AlignItems="AlignItems.Center">
<MudAvatar Color="@GetStepColor(step.State)"
Size="Size.Small">
@step.Icon
</MudAvatar>
<MudText Typo="Typo.caption">@step.Title</MudText>
</MudStack>
}
</MudStack>
<MudDivider Class="my-2" />
<MudText Typo="Typo.body2">
وضعیت ارسال:
<MudSelect T="int"
Label="وضعیت ارسال"
Dense="true"
Variant="Variant.Outlined"
@bind-Value="_deliveryStatusValue">
<MudSelectItem T="int" Value="0">بدون ارسال / نامشخص</MudSelectItem>
<MudSelectItem T="int" Value="1">در انتظار ارسال</MudSelectItem>
<MudSelectItem T="int" Value="2">تحویل پست</MudSelectItem>
<MudSelectItem T="int" Value="3">تحویل به مشتری</MudSelectItem>
<MudSelectItem T="int" Value="4">مرجوع شده</MudSelectItem>
</MudSelect>
</MudText>
<MudTextField T="string"
Label="کد رهگیری"
Variant="Variant.Outlined"
Dense="true"
@bind-Value="_trackingCode" />
<MudTextField T="string"
Label="توضیحات ارسال"
Variant="Variant.Outlined"
Dense="true"
Lines="3"
@bind-Value="_deliveryDescription" />
</MudStack>
</MudPaper>
<MudPaper Class="pa-3">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2">آدرس تحویل</MudText>
<MudDivider />
@if (!string.IsNullOrWhiteSpace(_model.UserAddressText))
{
<MudText Typo="Typo.body2">@_model.UserAddressText</MudText>
}
else
{
<MudText Typo="Typo.caption">آدرسی ثبت نشده است.</MudText>
}
</MudStack>
</MudPaper>
<MudPaper Class="pa-3">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2">اقلام فاکتور</MudText>
<MudDivider />
@if (_model.FactorDetails != null && _model.FactorDetails.Count > 0)
{
<MudTable Items="_model.FactorDetails" Dense="true">
<HeaderContent>
<MudTh>تصویر</MudTh>
<MudTh>محصول</MudTh>
<MudTh>قیمت واحد</MudTh>
<MudTh>تعداد</MudTh>
<MudTh>تخفیف واحد</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>
<Image Src="@context.ProductThumbnailPath" Height="50" Width="50" />
</MudTd>
<MudTd>@context.ProductTitle</MudTd>
<MudTd>@context.UnitPrice?.ToString("N0")</MudTd>
<MudTd>@context.Count</MudTd>
<MudTd>@context.UnitDiscountPrice?.ToString("N0")</MudTd>
</RowTemplate>
</MudTable>
}
else
{
<MudText Typo="Typo.caption">آیتمی برای این سفارش ثبت نشده است.</MudText>
}
</MudStack>
</MudPaper>
</MudStack>
}
</MudStack>
</DialogContent>
<DialogActions>
<MudButton Variant="Variant.Outlined" Color="Color.Default" OnClick="Close">
بستن
</MudButton>
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="SaveAsync">
ثبت تغییرات
</MudButton>
</DialogActions>
</MudDialog>