fix(OrderHomePage) , fix(OrderInvoiceGenerate)

- Fix order home page ui
- Fix get orders in order home page
- Fix order status filter
- Fix order invoice url
release
Amir Hossein Khademi 2024-06-01 13:42:03 +03:30
parent 0fbe6492ee
commit fdfe778a7a
17 changed files with 196 additions and 97 deletions

View File

@ -0,0 +1,12 @@
<MudList Clickable="false">
<MudListItem>
<div class="mx-auto flex w-full flex-row">
<MudProgressCircular class="my-auto -ml-4 mr-1" Size="Size.Small" Indeterminate="true" />
<p class="text-md mx-auto my-1 font-bold">منتظر بمانید</p>
</div>
</MudListItem>
</MudList>
@code {
}

View File

@ -15,22 +15,27 @@
</style>
<div class="editor"></div>
<script type="text/javascript">
function destroyEditor() {
// document.querySelector('.editor').ckeditorInstance.destroy();
window.editor = null;
}
function setData(data) {
if (window.editor.data != data) {
window.editor.setData(data);
}
}
function lunchEditor(data) {
if (!document.querySelector('.editor')) return
if (window.editor) return
ClassicEditor.create(document.querySelector('.editor'), {
// Editor configuration.
htmlSupport: {
allow: [
{
name: 'iframe',
attributes: true,
classes: true,
styles: true
}
]
}
})
.then(editor => {
window.editor = editor;
@ -59,6 +64,12 @@
console.error(message);
console.error(error);
}
function setData(data) {
if (!!window.editor.date && window.editor.data != data) {
window.editor.setData(data);
}
}
</script>
@ -87,8 +98,15 @@
{
if (!string.IsNullOrEmpty(Text) && !isTextSeted)
{
await JsRuntime.InvokeVoidAsync("window.setData", Text);
isTextSeted = true;
try
{
await JsRuntime.InvokeVoidAsync("window.setData", Text);
isTextSeted = true;
}
catch (Exception e)
{
}
}
await base.OnParametersSetAsync();
}

View File

@ -7,10 +7,11 @@
@inject IDialogService DialogService
@inject IPrintingService PrintingService
@inject IJSRuntime JsRuntime
@inject IConfiguration Configuration
<MudDialog class="w-full">
<DialogContent>
<MudStack class="max-h-[50rem] w-full mt-4" Style="overflow-y: scroll">
<MudStack class="max-h-[50rem] mt-4 w-full" Style="overflow-y: scroll">
<MudGrid class="w-full">
<MudItem xs="12" md="9">
<MudStack>
@ -19,7 +20,7 @@
<MudText Typo="Typo.h6" class="my-auto"><b>اطلاعات سفارش</b></MudText>
<MudSpacer />
<MudPaper Elevation="0" class="bg-blue-500 px-4 py-2 my-auto">
<MudPaper Elevation="0" class="my-auto bg-blue-500 px-4 py-2">
<MudText Typo="Typo.body2" class="text-white">@ViewModel.PageDto.OrderStatus.ToDisplay()</MudText>
</MudPaper>
</MudStack>
@ -52,7 +53,7 @@
<MudText Typo="Typo.h6"><b>کالاهای این سفارش</b></MudText>
<MudSpacer />
<MudPaper Elevation="0" class="border-dashed border-violet-400 border-2 px-3 py-1 my-auto">
<MudPaper Elevation="0" class="border-2 my-auto border-dashed border-violet-400 px-3 py-1">
<MudText Typo="Typo.caption" class="text-violet-500"><b>@ViewModel.PageDto.OrderProducts.Sum(op => op.Count) قلم کالا</b></MudText>
</MudPaper>
</MudStack>
@ -63,7 +64,7 @@
T="OrderProductSDto" Items="@ViewModel.PageDto.OrderProducts"
Filterable="false" Loading="@ViewModel.IsProcessing"
SortMode="@SortMode.None" Groupable="false"
class="border-solid border-2 border-gray-200">
class="border-2 border-solid border-gray-200">
<Columns>
<TemplateColumn T="OrderProductSDto" Title="نام کالا">
@ -184,24 +185,24 @@
</MudStack>
</DialogContent>
<DialogActions>
<MudGrid Row="true" class="w-full h-fit mx-4 mb-3 bottom-0">
<MudGrid Row="true" class="bottom-0 mx-4 mb-3 h-fit w-full">
<MudItem xs="12" sm="6" md="6">
<BaseButtonUi class="w-full h-12 rounded-md" IsProcessing="@ViewModel.IsProcessing"
<BaseButtonUi class="h-12 w-full 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"
<BaseButtonUi class="h-12 w-full 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"
<BaseButtonUi class="my-auto h-12 w-full rounded-md" IsProcessing="@ViewModel.IsProcessing"
Icon="@Icons.Material.Outlined.Print"
Size="Size.Small"
Variant="Variant.Outlined" Color="Color.Info"
@ -209,7 +210,7 @@
Content="چاپــ فاکتور" />
</MudItem>
<MudItem xs="12" sm="6" md="1">
<BaseButtonUi class="w-full h-12 rounded-md my-auto" IsProcessing="@ViewModel.IsProcessing"
<BaseButtonUi class="my-auto h-12 w-full rounded-md" IsProcessing="@ViewModel.IsProcessing"
Size="Size.Small"
Variant="Variant.Outlined" Color="Color.Error"
OnClickCallback="@ViewModel.Cancel"
@ -232,9 +233,9 @@
protected override async Task OnInitializedAsync()
{
if (Order == null)
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, PrintingService, JsRuntime);
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, PrintingService, JsRuntime,Configuration);
else
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, Order, PrintingService, JsRuntime);
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, Order, PrintingService, JsRuntime,Configuration);
await ViewModel.InitializeAsync();
await base.OnInitializedAsync();
}

View File

@ -13,13 +13,16 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
private readonly MudDialogInstance _mudDialog;
private readonly IPrintingService _printingService;
private readonly IJSRuntime _jsRuntime;
private readonly IConfiguration _configuration;
public OrderActionDialogBoxViewModel(ISnackbar snackbar,
IRestWrapper restWrapper,
IUserUtility userUtility,
IDialogService dialogService,
MudDialogInstance mudDialog,
IPrintingService printingService, IJSRuntime jsRuntime) : base(userUtility)
IPrintingService printingService,
IJSRuntime jsRuntime,
IConfiguration configuration) : base(userUtility)
{
_snackbar = snackbar;
_restWrapper = restWrapper;
@ -28,6 +31,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
_mudDialog = mudDialog;
_printingService = printingService;
_jsRuntime = jsRuntime;
_configuration = configuration;
}
public OrderActionDialogBoxViewModel(ISnackbar snackbar,
IRestWrapper restWrapper,
@ -36,7 +40,8 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
MudDialogInstance mudDialog,
OrderSDto order,
IPrintingService printingService,
IJSRuntime jsRuntime) : base(userUtility)
IJSRuntime jsRuntime,
IConfiguration configuration) : base(userUtility)
{
_snackbar = snackbar;
_restWrapper = restWrapper;
@ -47,6 +52,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
IsEditing = true;
_printingService = printingService;
_jsRuntime = jsRuntime;
_configuration = configuration;
}
@ -123,7 +129,8 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
if (token == null)
throw new Exception("Token is null");
IsProcessing = true;
string fileUrl = $"{Address.OrderController}/{PageDto.Id}/invoice?access_token={token.Split("Bearer").Last().Trim()}";
var apiUrl = _configuration.GetValue<string>("ApiUrl");
string fileUrl = $"{apiUrl}{Address.OrderController}/{PageDto.Id}/invoice?access_token={token.Split("Bearer").Last().Trim()}";
PdfStringFormat format = new PdfStringFormat(PdfTextAlignment.Left);

View File

@ -45,7 +45,7 @@
</MudHidden>
<RadzenGravatar class="w-14 h-14" Email="@_user?.Email"/>
<RadzenGravatar class="h-14 w-14" Email="@_user?.Email"/>
<MudStack class="mr-2" Spacing="0">
<MudText Color="Color.Inherit" Typo="Typo.body1"><b>@_user?.FullName</b></MudText>
<MudText Color="Color.Inherit" Typo="Typo.caption">@_user?.PhoneNumber</MudText>

View File

@ -5,8 +5,8 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<AssemblyVersion>0.27.37.59</AssemblyVersion>
<FileVersion>0.27.37.59</FileVersion>
<AssemblyVersion>1.0.1.2</AssemblyVersion>
<FileVersion>1.0.1.2</FileVersion>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
</PropertyGroup>
@ -82,6 +82,7 @@
<Using Include="Netina.Common.Models.Exception" />
<Using Include="Netina.Domain.CommandQueries.Commands" />
<Using Include="Netina.Domain.Dtos.DashboardDtos" />
<Using Include="Netina.Domain.Dtos.FilterDtos" />
<Using Include="Netina.Domain.Dtos.LargDtos" />
<Using Include="Netina.Domain.Dtos.RequestDtos" />
<Using Include="Netina.Domain.Dtos.ResponseDtos" />

View File

@ -6,6 +6,8 @@
@inject ISnackbar Snackbar
@inject IUserUtility UserUtility
@inject IRestWrapper RestWrapper
@inject IConfiguration Configuration
@inject IJSRuntime JsRuntime
<MudStack class="w-full p-8 h-screen bg-[--mud-palette-background-grey]">
<MudGrid>
@ -41,6 +43,12 @@
<TemplateColumn CellClass="d-flex justify-end">
<CellTemplate>
<MudStack Row="true">
<MudIconButton Icon="@Icons.Material.Filled.Link"
Size="@Size.Small"
Variant="@Variant.Outlined"
Color="@Color.Surface"
OnClick="async()=>await ShowBlog(context.Item)" />
<MudIconButton Icon="@Icons.Material.Filled.Edit"
Size="@Size.Small"
Variant="@Variant.Outlined"
@ -78,4 +86,11 @@
await ViewModel.InitializeAsync();
await base.OnInitializedAsync();
}
private async Task ShowBlog(BlogSDto item)
{
var webUrl = Configuration.GetValue<string>("WebSiteUrl") ?? string.Empty;
var url = $"{webUrl}/blogs/{item.Id}/{item.Slug}";
await JsRuntime.InvokeAsync<object>("open", url, "_blank");
}
}

View File

@ -14,7 +14,12 @@ public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
public int CurrentPage = 0;
public int PageCount = 1;
public int TotalItems = 0;
public BlogsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
public BlogsPageViewModel(NavigationManager navigationManager,
ISnackbar snackbar,
IUserUtility userUtility,
IRestWrapper restWrapper,
IDialogService dialogService) : base(userUtility)
{
_navigationManager = navigationManager;
_snackbar = snackbar;
@ -178,4 +183,5 @@ public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
IsProcessing = false;
}
}
}

View File

@ -25,16 +25,16 @@
color: white !important
}
</style> *@
<div class="w-screen h-screen bg-[#EEEEEE] p-0 flex flex-col-reverse md:flex-row overflow-hidden">
<div class="bg-white h-full basis-full md:basis-1/2 md:rounded-tr-none md:rounded-bl-xl md:rounded-tl-xl flex md:px-10 lg:px-20 py-8 px-4">
<MudStack class="my-auto mx-auto">
<div class="bg-[#EEEEEE] flex h-screen w-screen flex-col-reverse overflow-hidden p-0 md:flex-row">
<div class="flex h-full basis-full bg-white px-4 py-8 md:basis-1/2 md:rounded-tr-none md:rounded-bl-xl md:rounded-tl-xl md:px-10 lg:px-20">
<MudStack class="mx-auto my-auto">
<div>
<MudText Typo="Typo.h5" class="text-lg text-center"><b>ورود با شماره تلفن همراه</b></MudText>
<MudText Typo="Typo.h5" class="text-center text-lg"><b>ورود با شماره تلفن همراه</b></MudText>
<MudText Typo="Typo.caption" Align="Align.Center">برای ورود به پنل ادمین شماره تلفن همراه خود را وارد کنید ، میتوانید با رمز عبور نیز وارد شوید</MudText>
</div>
@*<p class="text-lg sm:mt-6 mb-3 font-extrabold">شماره تلفن شما</p>
@*<p class="mb-3 text-lg font-extrabold sm:mt-6">شماره تلفن شما</p>
<input class="bg-transparent text-[1.8rem] sm:py-3 font-extrabold text-center border rounded-md shadow-sm focus:border-teal-500 focus:ring-teal-500"
<input class="text-[1.8rem] rounded-md border bg-transparent text-center font-extrabold shadow-sm focus:border-teal-500 focus:ring-teal-500 sm:py-3"
type="text"
maxlength="11"
pattern="[0-9]"
@ -57,23 +57,17 @@
OnClickCallback="@ViewModel.SubmitAsync"
Color="Color.Info"
IsProcessing="@ViewModel.IsProcessing"
class="text-xl py-3"
class="py-3 text-xl"
Content="تایید و ادامه"></BaseButtonUi>
<p class="mx-3 text-justify">
با تایید شماره تلفن همراه با همه شرایط <a class="text-blue-500">
حریم
خصوصی
</a> اپلیکیشن داکیومد موافقت می کنم
</p>
</MudStack>
</div>
<div class="h-full basis-full md:basis-1/2 md:rounded-tr-none md:rounded-bl-xl md:rounded-tl-xl flex md:px-10 lg:px-20 py-8 px-4">
<div class="flex h-full basis-full px-4 py-8 md:basis-1/2 md:rounded-tr-none md:rounded-bl-xl md:rounded-tl-xl md:px-10 lg:px-20">
@if (StatConfigs.IsShop)
{
<div class="mx-auto my-auto">
<dotlottie-player src="https://lottie.host/235bcb2d-0f2c-4f06-9c36-7e6677b82e00/9tGECPkU5J.json"
background="transparent" speed="1" class="mx-auto w-64 h-64 lg:w-96 lg:h-96" loop autoplay />
background="transparent" speed="1" class="mx-auto h-64 w-64 lg:w-96 lg:h-96" loop autoplay />
<MudText Typo="Typo.h5" Align="Align.Center"><b>داشبورد تخصصی وسمه</b></MudText>
<MudText Align="Align.Center">شما میتوانید با ورود به داشبورد تخصصی نتینا فروشگاه خود را مدیریت کنید </MudText>
@ -85,7 +79,7 @@
<div class="mx-auto my-auto">
<dotlottie-player src="https://s3.ir-thr-at1.arvanstorage.ir/amir-content/Lotties/SEO-strategy-animation_management.json"
background="transparent" speed="1" class="mx-auto w-64 h-64 lg:w-96 lg:h-96" loop autoplay />
background="transparent" speed="1" class="mx-auto h-64 w-64 lg:w-96 lg:h-96" loop autoplay />
<MudText Typo="Typo.h5" Align="Align.Center"><b>داشبورد وب سایت شما</b></MudText>
<MudText Align="Align.Center">شما میتوانید با ورود به داشبورد ، وب سایت خود را مدیریت کنید </MudText>

View File

@ -8,36 +8,36 @@
@inject IRestWrapper RestWrapper
<MudStack class="px-3 md:p-5 lg:px-8 w-full h-screen overflow-x-hidden overflow-y-scroll bg-[--mud-palette-background-grey]">
<MudStack class="bg-[--mud-palette-background-grey] h-screen w-full overflow-x-hidden overflow-y-scroll px-3 md:p-5 lg:px-8">
<MudHidden Breakpoint="Breakpoint.Xs">
<MudGrid>
<MudItem xs="12" sm="6" lg="3">
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-4">سفارشات امروز</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-amber-600"><b>@ViewModel.PageDto.TodayOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" lg="3">
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-4">سفارشات در انتظار تایید</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-blue-600"><b>@ViewModel.PageDto.PayedOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" lg="3">
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-4">سفارشات ارسال نشده</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-lime-600"><b>@ViewModel.PageDto.UnSendOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" lg="3">
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-4">مجموع سفارش ماه</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-rose-600"><b>@ViewModel.PageDto.ThisMonthOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
</MudItem>
</MudGrid>
@ -45,30 +45,30 @@
<MudHidden Breakpoint="Breakpoint.SmAndUp">
<MudStack Row="true" class="whitespace-nowrap overflow-x-scroll w-screen no-scrollbar">
<MudStack Row="true" class="no-scrollbar w-screen overflow-x-scroll whitespace-nowrap">
<MudPaper class="w-fit p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 w-fit rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-6 ml-16">سفارشات امروز</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-amber-600"><b>@ViewModel.PageDto.TodayOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
<MudPaper class="w-fit p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 w-fit rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-6 ml-16">سفارشات در انتظار تایید</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-blue-600"><b>@ViewModel.PageDto.PayedOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
<MudPaper class="w-fit p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 w-fit rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-6 ml-16">سفارشات ارسال نشده</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-lime-600"><b>@ViewModel.PageDto.UnSendOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
<MudPaper class="w-fit p-3 m-2 rounded-md" Elevation="2">
<MudPaper class="m-2 w-fit rounded-md p-3" Elevation="2">
<MudText Typo="Typo.body1" class="mb-6 ml-16">مجموع سفارش ماه</MudText>
<MudText Typo="Typo.h3" Align="Align.Center" class="text-rose-600"><b>@ViewModel.PageDto.ThisMonthOrdersCount</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
<MudText Typo="Typo.h6" Align="Align.Center" class="-mt-1 mb-4"><b>عدد</b></MudText>
</MudPaper>
</MudStack>
</MudHidden>
@ -90,24 +90,32 @@
OnAdornmentClick="@ViewModel.SearchAsync"></MudTextField>
</MudItem>
<MudItem xs="12" sm="6">
<MudSelect class="-mt-0.5" T="OrderStatus" Label="وظعیت سفارش" ToStringFunc="status => status.ToDisplay()" ValueChanged="@ViewModel.OrderStatusSearchChanged" Clearable="true" AnchorOrigin="Origin.BottomCenter">
<MudSelectItem Value="OrderStatus.Paid" />
<MudSelectItem Value="OrderStatus.Submitted" />
<MudSelectItem Value="OrderStatus.Delivered" />
<MudSelectItem Value="OrderStatus.Done" />
<MudSelectItem Value="OrderStatus.Canceled" />
</MudSelect>
<MudAutocomplete ToStringFunc="arg => arg.Title" ValueChanged="@ViewModel.SearchByOrderStatusAsync"
Value="@ViewModel.OrderStatusSearch"
SearchFunc="@ViewModel.OrderStatusSearchAsync"
T="FilterOptionDto<OrderStatus>"
class="-mt-0.5"
OnClearButtonClick="async () => await ViewModel.SearchByOrderStatusAsync(null)"
Clearable="true"
Label="وظعیت سفارش">
<ProgressIndicatorInPopoverTemplate>
<AutocompleteUi />
</ProgressIndicatorInPopoverTemplate>
<ItemTemplate Context="e">
<p>@e.Title</p>
</ItemTemplate>
</MudAutocomplete>
</MudItem>
</MudGrid>
</MudHidden>
<MudPaper class="!max-h-[80vh] overflow-auto">
<MudPaper >
<MudDataGrid FixedFooter="true" FixedHeader="true" Striped="true"
T="OrderSDto" Items="@ViewModel.MainOrders" CurrentPage="@ViewModel.MainGridCurrentPage"
RowsPerPage="20" Filterable="false" Loading="@ViewModel.IsProcessing"
SortMode="@SortMode.None" Groupable="false">
<ToolBarContent>
<MudGrid class="md:visible collapse">
<MudGrid class="collapse md:visible">
<MudItem md="6">
<MudTextField T="string" Placeholder="جست جو بر اساس کد فاکتور" OnClearButtonClick="@ViewModel.SearchAsync"
Adornment="Adornment.Start"
@ -120,13 +128,21 @@
OnAdornmentClick="@ViewModel.SearchAsync"></MudTextField>
</MudItem>
<MudItem md="6">
<MudSelect class="-mt-0.5" T="OrderStatus" Label="وظعیت سفارش" ToStringFunc="status => status.ToDisplay()" ValueChanged="@ViewModel.OrderStatusSearchChanged" Clearable="true" AnchorOrigin="Origin.BottomCenter">
<MudSelectItem Value="OrderStatus.Paid" />
<MudSelectItem Value="OrderStatus.Submitted" />
<MudSelectItem Value="OrderStatus.Delivered" />
<MudSelectItem Value="OrderStatus.Done" />
<MudSelectItem Value="OrderStatus.Canceled" />
</MudSelect>
<MudAutocomplete ToStringFunc="arg => arg.Title" ValueChanged="@ViewModel.SearchByOrderStatusAsync"
Value="@ViewModel.OrderStatusSearch"
SearchFunc="@ViewModel.OrderStatusSearchAsync"
T="FilterOptionDto<OrderStatus>"
class="-mt-0.5"
OnClearButtonClick="async () => await ViewModel.SearchByOrderStatusAsync(null)"
Clearable="true"
Label="وظعیت سفارش">
<ProgressIndicatorInPopoverTemplate>
<AutocompleteUi />
</ProgressIndicatorInPopoverTemplate>
<ItemTemplate Context="e">
<p>@e.Title</p>
</ItemTemplate>
</MudAutocomplete>
</MudItem>
</MudGrid>
</ToolBarContent>
@ -205,7 +221,7 @@
<MudStack Row="true" class="w-full">
<MudPagination Rectangular="true" Variant="Variant.Filled" Count="@ViewModel.MainGridPageCount"
SelectedChanged="@ViewModel.ChangePageAsync" class="my-4 mx-auto" />
SelectedChanged="@ViewModel.ChangePageAsync" class="mx-auto my-4" />
</MudStack>
</PagerContent>

View File

@ -18,7 +18,7 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
ISnackbar snackbar,
IUserUtility userUtility,
IRestWrapper restWrapper,
IDialogService dialogService) : base(userUtility,"Cached")
IDialogService dialogService) : base(userUtility)
{
_navigationManager = navigationManager;
_snackbar = snackbar;
@ -39,7 +39,7 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
throw new Exception("Token is null");
IsProcessing = true;
MainOrders.Clear();
var dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage,null, null, null, null,token);
var dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage, token);
dto.ForEach(d => MainOrders.Add(d));
if (MainOrders.Count == 15)
MainGridPageCount = 2;
@ -82,7 +82,8 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
throw new Exception("Token is null");
var dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage,FactorCodeSearch, null, _orderStatusSearch, null, token);
var dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage, FactorCodeSearch, null,
OrderStatusSearch?.Value, null, token);
dto.ForEach(d => MainOrders.Add(d));
if (MainOrders.Count == 15)
MainGridPageCount = MainGridCurrentPage + 2;
@ -119,8 +120,6 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
}
public string? FactorCodeSearch { get; set; } = null;
private OrderStatus? _orderStatusSearch;
public async Task SearchAsync()
{
try
@ -130,7 +129,11 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
throw new Exception("Token is null");
IsProcessing = true;
MainOrders.Clear();
var dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage, FactorCodeSearch,null, _orderStatusSearch, null, token);
List<OrderSDto> dto;
dto = await _restWrapper.OrderRestApi.ReadAll(MainGridCurrentPage, FactorCodeSearch, null,
OrderStatusSearch?.Value, null, token);
dto.ForEach(d => MainOrders.Add(d));
if (MainOrders.Count == 15)
MainGridPageCount = 2;
@ -159,9 +162,27 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
}
}
public async Task OrderStatusSearchChanged(OrderStatus arg)
public FilterOptionDto<OrderStatus>? OrderStatusSearch;
public List<FilterOptionDto<OrderStatus>> OrderStatusFilterOptions = new List<FilterOptionDto<OrderStatus>>
{
_orderStatusSearch = arg;
new FilterOptionDto<OrderStatus>{Title = OrderStatus.Paid.ToDisplay(),Value = OrderStatus.Paid},
new FilterOptionDto<OrderStatus>{Title = OrderStatus.Submitted.ToDisplay(),Value = OrderStatus.Submitted},
new FilterOptionDto<OrderStatus>{Title = OrderStatus.Delivered.ToDisplay(),Value = OrderStatus.Delivered},
new FilterOptionDto<OrderStatus>{Title = OrderStatus.Done.ToDisplay(),Value = OrderStatus.Done},
new FilterOptionDto<OrderStatus>{Title = OrderStatus.Canceled.ToDisplay(),Value = OrderStatus.Canceled},
};
public async Task<IEnumerable<FilterOptionDto<OrderStatus>>> OrderStatusSearchAsync(string orderStatus)
{
if (orderStatus.IsNullOrEmpty())
return OrderStatusFilterOptions;
return OrderStatusFilterOptions.Where(o => o.Title == orderStatus).ToList();
}
public async Task SearchByOrderStatusAsync(FilterOptionDto<OrderStatus>? arg)
{
OrderStatusSearch = arg;
await SearchAsync();
}
}

View File

@ -5,6 +5,10 @@ public interface IOrderRestApi
[Get("")]
Task<List<OrderSDto>> ReadAll([Query]int page, [Query] string? factorCode, [Query] long? selectedDate, [Query] OrderStatus? orderStatus, [Query] OrderQueryDateFilter? dateFilter, [Header("Authorization")] string authorization);
[Get("")]
Task<List<OrderSDto>> ReadAll([Query] int page, [Header("Authorization")] string authorization);
[Get("/{id}")]
Task<OrderLDto> ReadOne(Guid id, [Header("Authorization")] string authorization);

View File

@ -18,6 +18,7 @@
"@ckeditor/ckeditor5-font": "41.0.0",
"@ckeditor/ckeditor5-heading": "41.0.0",
"@ckeditor/ckeditor5-horizontal-line": "41.0.0",
"@ckeditor/ckeditor5-html-support": "^41.0.0",
"@ckeditor/ckeditor5-image": "41.0.0",
"@ckeditor/ckeditor5-indent": "41.0.0",
"@ckeditor/ckeditor5-link": "41.0.0",
@ -163,6 +164,15 @@
"ckeditor5": "41.0.0"
}
},
"node_modules/@ckeditor/ckeditor5-html-support": {
"version": "41.0.0",
"resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-html-support/-/ckeditor5-html-support-41.0.0.tgz",
"integrity": "sha512-aw9U5WWAw1On32xCzqylZPlHPZGgmat1u8JP10FQt+z+u7qjl7sPkKfiXtheLoLVr+Ol84JeskEDDZZH72RS5w==",
"dependencies": {
"ckeditor5": "41.0.0",
"lodash-es": "4.17.21"
}
},
"node_modules/@ckeditor/ckeditor5-image": {
"version": "41.0.0",
"resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-image/-/ckeditor5-image-41.0.0.tgz",

View File

@ -9,6 +9,7 @@
"@ckeditor/ckeditor5-font": "41.0.0",
"@ckeditor/ckeditor5-heading": "41.0.0",
"@ckeditor/ckeditor5-horizontal-line": "41.0.0",
"@ckeditor/ckeditor5-html-support": "^41.0.0",
"@ckeditor/ckeditor5-image": "41.0.0",
"@ckeditor/ckeditor5-indent": "41.0.0",
"@ckeditor/ckeditor5-link": "41.0.0",

View File

@ -1,6 +1,6 @@
{
"version": "0.25.28.49",
"versionNumber": 0.252849,
"version": "1.0.1.2",
"versionNumber": "1.012",
"versionName": "چرتکه",
"description": "",
"features": [

View File

@ -11,8 +11,8 @@
"WebSiteUrl": "https://vesmeh.com",
"AdminPanelBaseUrl": "https://admin.vesmeh.com",
"StorageBaseUrl": "https://storage.vesmeh.com/",
"ApiUrl": "https://api.vesmeh.com/api"
//"ApiUrl": "http://192.168.1.12:32770/api"
//"ApiUrl": "https://api.vesmeh.com/api"
"ApiUrl": "http://localhost:32770/api"
//"WebSiteUrl": "https://hamyanedalat.com",
//"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",

View File

@ -1719,9 +1719,6 @@ input:checked + .toggle-bg {
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.align-bottom {
vertical-align: bottom;
}
@ -1766,10 +1763,6 @@ input:checked + .toggle-bg {
--tw-text-opacity: 1;
color: rgb(217 119 6 / var(--tw-text-opacity));
}
.text-blue-500 {
--tw-text-opacity: 1;
color: rgb(63 131 248 / var(--tw-text-opacity));
}
.text-blue-600 {
--tw-text-opacity: 1;
color: rgb(28 100 242 / var(--tw-text-opacity));