diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index f244d15a..d6aa87d1 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10162"; + ClientVersion = "10163"; } private User user; diff --git a/BBWY.Client/Models/Shop/Shop.cs b/BBWY.Client/Models/Shop/Shop.cs index 0ebec5fa..b35a35df 100644 --- a/BBWY.Client/Models/Shop/Shop.cs +++ b/BBWY.Client/Models/Shop/Shop.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace BBWY.Client.Models { @@ -7,7 +8,19 @@ namespace BBWY.Client.Models private bool isSelected; 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; } + /// /// 店铺Id /// diff --git a/BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs b/BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs index ac8146f4..de504727 100644 --- a/BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs +++ b/BBWY.Client/ViewModels/Order/ExportOrderSkuViewModel.cs @@ -27,6 +27,8 @@ namespace BBWY.Client.ViewModels private int pageSize; private long totalCount; private bool isLoading; + private bool isShowAll_Shop; + private bool isShowAll_Department; private OrderService orderService; @@ -56,6 +58,10 @@ namespace BBWY.Client.ViewModels 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) { this.orderService = orderService; @@ -82,7 +88,7 @@ namespace BBWY.Client.ViewModels Value = ((int)p).ToString() }); } - + IsShowAll_Department = IsShowAll_Shop = true; this.globalContext = globalContext; LoadDepartment(); StartDate = DateTime.Now.Date; @@ -112,10 +118,17 @@ namespace BBWY.Client.ViewModels continue; foreach (var s in d.ShopList) { + s.OnIsSelectedChanged = OnShopSelectionChanged; s.IsSelected = false; ShopList.Add(s); } } + IsShowAll_Department = !DepartmentList.Any(d => d.IsSelected); + } + + private void OnShopSelectionChanged() + { + IsShowAll_Shop = !ShopList.Any(s => s.IsSelected); } private void Search() @@ -130,10 +143,18 @@ namespace BBWY.Client.ViewModels int? purchasePlatform = null; if (SelectedPlatform != null) purchasePlatform = int.Parse(SelectedPlatform.Value); + List shopIds = new List(); + 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, EndDate, purchasePlatform, - ShopList.Where(s => s.IsSelected).Select(s => s.ShopId).ToList(), + shopIds, pageIndex, PageSize); IsLoading = false; diff --git a/BBWY.Client/Views/Order/ExportOrderSkuView.xaml b/BBWY.Client/Views/Order/ExportOrderSkuView.xaml index 9e147d35..f752cfbb 100644 --- a/BBWY.Client/Views/Order/ExportOrderSkuView.xaml +++ b/BBWY.Client/Views/Order/ExportOrderSkuView.xaml @@ -12,7 +12,14 @@ mc:Ignorable="d" d:DesignHeight="769" d:DesignWidth="1024" 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"> + + + @@ -34,66 +41,58 @@ - - + - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + -->