Browse Source

10163

AddValidOverTime
shanji 2 years ago
parent
commit
1cc322975c
  1. 2
      BBWY.Client/GlobalContext.cs
  2. 17
      BBWY.Client/Models/Shop/Shop.cs
  3. 25
      BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs
  4. 93
      BBWY.Client/Views/Order/ExportOrderSkuView.xaml

2
BBWY.Client/GlobalContext.cs

@ -13,7 +13,7 @@ namespace BBWY.Client
{ {
ShopServiceGroupList = new List<string>(); ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>(); ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10162"; ClientVersion = "10163";
} }
private User user; private User user;

17
BBWY.Client/Models/Shop/Shop.cs

@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
namespace BBWY.Client.Models namespace BBWY.Client.Models
{ {
@ -7,7 +8,19 @@ namespace BBWY.Client.Models
private bool isSelected; private bool isSelected;
private string shopName; private string shopName;
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } public bool IsSelected
{
get => isSelected; set
{
if (Set(ref isSelected, value))
{
OnIsSelectedChanged?.Invoke();
}
}
}
public Action OnIsSelectedChanged { get; set; }
/// <summary> /// <summary>
/// 店铺Id /// 店铺Id
/// </summary> /// </summary>

25
BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs

@ -27,6 +27,8 @@ namespace BBWY.Client.ViewModels
private int pageSize; private int pageSize;
private long totalCount; private long totalCount;
private bool isLoading; private bool isLoading;
private bool isShowAll_Shop;
private bool isShowAll_Department;
private OrderService orderService; private OrderService orderService;
@ -56,6 +58,10 @@ namespace BBWY.Client.ViewModels
public long TotalCount { get => totalCount; set { Set(ref totalCount, value); } } public long TotalCount { get => totalCount; set { Set(ref totalCount, value); } }
public bool IsShowAll_Shop { get => isShowAll_Shop; set { Set(ref isShowAll_Shop, value); } }
public bool IsShowAll_Department { get => isShowAll_Department; set { Set(ref isShowAll_Department, value); } }
public ExportOrderSkuViewModel(GlobalContext globalContext, OrderService orderService) public ExportOrderSkuViewModel(GlobalContext globalContext, OrderService orderService)
{ {
this.orderService = orderService; this.orderService = orderService;
@ -82,7 +88,7 @@ namespace BBWY.Client.ViewModels
Value = ((int)p).ToString() Value = ((int)p).ToString()
}); });
} }
IsShowAll_Department = IsShowAll_Shop = true;
this.globalContext = globalContext; this.globalContext = globalContext;
LoadDepartment(); LoadDepartment();
StartDate = DateTime.Now.Date; StartDate = DateTime.Now.Date;
@ -112,10 +118,17 @@ namespace BBWY.Client.ViewModels
continue; continue;
foreach (var s in d.ShopList) foreach (var s in d.ShopList)
{ {
s.OnIsSelectedChanged = OnShopSelectionChanged;
s.IsSelected = false; s.IsSelected = false;
ShopList.Add(s); ShopList.Add(s);
} }
} }
IsShowAll_Department = !DepartmentList.Any(d => d.IsSelected);
}
private void OnShopSelectionChanged()
{
IsShowAll_Shop = !ShopList.Any(s => s.IsSelected);
} }
private void Search() private void Search()
@ -130,10 +143,18 @@ namespace BBWY.Client.ViewModels
int? purchasePlatform = null; int? purchasePlatform = null;
if (SelectedPlatform != null) if (SelectedPlatform != null)
purchasePlatform = int.Parse(SelectedPlatform.Value); purchasePlatform = int.Parse(SelectedPlatform.Value);
List<long> shopIds = new List<long>();
if (ShopList.Count() > 0)
{
if (ShopList.Any(s => s.IsSelected))
shopIds.AddRange(ShopList.Where(s => s.IsSelected).Select(s => s.ShopId));
else
shopIds.AddRange(ShopList.Select(s => s.ShopId));
}
var response = orderService.QueryOrderSkuList(StartDate, var response = orderService.QueryOrderSkuList(StartDate,
EndDate, EndDate,
purchasePlatform, purchasePlatform,
ShopList.Where(s => s.IsSelected).Select(s => s.ShopId).ToList(), shopIds,
pageIndex, pageIndex,
PageSize); PageSize);
IsLoading = false; IsLoading = false;

93
BBWY.Client/Views/Order/ExportOrderSkuView.xaml

@ -12,7 +12,14 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="769" d:DesignWidth="1024" d:DesignHeight="769" d:DesignWidth="1024"
DataContext="{Binding ExportOrderSkuVM,Source={StaticResource Locator}}" DataContext="{Binding ExportOrderSkuVM,Source={StaticResource Locator}}"
Title="ExportOrderSkuView"> Title="ExportOrderSkuView"
xmlns:converter="clr-namespace:HandyControl.Tools.Converter;assembly=HandyControl"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
xmlns:ex="clr-namespace:HandyControl.Tools.Extension;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControl.Properties.Langs;assembly=HandyControl">
<Page.Resources>
</Page.Resources>
<Grid> <Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> <c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0"> <Grid Margin="5,0">
@ -34,66 +41,58 @@
</ResourceDictionary> </ResourceDictionary>
</Grid.Resources> </Grid.Resources>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5,0"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5,0">
<Grid>
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding DepartmentList}" <hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding DepartmentList}"
ShowClearButton="True" ShowClearButton="True"
MinWidth="150" MinWidth="150"
Height="30"> Height="30">
<hc:CheckComboBox.ItemTemplate> <hc:CheckComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2.5"> <StackPanel Orientation="Horizontal" Margin="5,2.5">
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</hc:CheckComboBox.ItemTemplate> </hc:CheckComboBox.ItemTemplate>
<hc:CheckComboBox.ItemContainerStyle> <hc:CheckComboBox.ItemContainerStyle>
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}"> <Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Style> </Style>
</hc:CheckComboBox.ItemContainerStyle> </hc:CheckComboBox.ItemContainerStyle>
</hc:CheckComboBox> </hc:CheckComboBox>
<TextBlock Text="全部" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"
Visibility="{Binding IsShowAll_Department,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}"/>
</Grid>
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding ShopList}" <Grid>
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding ShopList}"
ShowClearButton="True" ShowClearButton="True"
MinWidth="150" MinWidth="150"
Margin="5,0,0,0"> Margin="5,0,0,0">
<hc:CheckComboBox.ItemTemplate> <hc:CheckComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2.5"> <StackPanel Orientation="Horizontal" Margin="5,2.5">
<CheckBox Content="{Binding ShopName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <CheckBox Content="{Binding ShopName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</hc:CheckComboBox.ItemTemplate> </hc:CheckComboBox.ItemTemplate>
<hc:CheckComboBox.ItemContainerStyle> <hc:CheckComboBox.ItemContainerStyle>
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}"> <Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Style> </Style>
</hc:CheckComboBox.ItemContainerStyle> </hc:CheckComboBox.ItemContainerStyle>
</hc:CheckComboBox> </hc:CheckComboBox>
<TextBlock Text="全部" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"
Visibility="{Binding IsShowAll_Shop,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}"/>
</Grid>
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding PlatformList}" <!--<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding PlatformList}"
ShowClearButton="True" ShowClearButton="True"
MinWidth="150" MinWidth="150"
Margin="5,0,0,0" Margin="5,0,0,0"
SelectionMode="Single" SelectionMode="Single"
SelectedItem="{Binding SelectedPlatform,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedPlatform,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="Key"> DisplayMemberPath="Key">
<!--<hc:CheckComboBox.ItemTemplate> </hc:CheckComboBox>-->
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2.5">
-->
<!--<CheckBox Content="{Binding Key}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>-->
<!--
<TextBlock Text="{Binding Key}"/>
</StackPanel>
</DataTemplate>
</hc:CheckComboBox.ItemTemplate>-->
<!--<hc:CheckComboBox.ItemContainerStyle>
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Style>
</hc:CheckComboBox.ItemContainerStyle>-->
</hc:CheckComboBox>
<DatePicker Height="30" Margin="5,0,0,0" SelectedDate="{Binding StartDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <DatePicker Height="30" Margin="5,0,0,0" SelectedDate="{Binding StartDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<DatePicker Height="30" Margin="5,0,0,0" SelectedDate="{Binding EndDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <DatePicker Height="30" Margin="5,0,0,0" SelectedDate="{Binding EndDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>

Loading…
Cancel
Save