Browse Source

刷单组界面完善

qianyi
shanji 3 years ago
parent
commit
9fa4ea280a
  1. 4
      BBWY.Client/APIServices/StatisticsService.cs
  2. 4
      BBWY.Client/App.xaml.cs
  3. 4
      BBWY.Client/Resources/Themes/Path.xaml
  4. 17
      BBWY.Client/ViewModels/MainViewModel.cs
  5. 24
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  6. 6
      BBWY.Client/ViewModels/Order/OrderListViewModel_SDGroup.cs
  7. 18
      BBWY.Client/Views/Order/SDGroup.xaml
  8. 62
      BBWY.Client/Views/SelectShop/SelectShopDialog.xaml
  9. 66
      BBWY.Client/Views/SelectShop/SelectShopDialog.xaml.cs
  10. 2
      BBWY.Client/Views/SelectShop/SelectShopW.xaml
  11. 4
      BBWY.Client/Views/SelectShop/SelectShopW.xaml.cs

4
BBWY.Client/APIServices/StatisticsService.cs

@ -17,11 +17,11 @@ namespace BBWY.Client.APIServices
/// 今日业绩统计
/// </summary>
/// <returns></returns>
public ApiResponse<ToDayOrderAchievementResponse> GetTodayAchievementStatistics(DateTime startTime, DateTime endTime)
public ApiResponse<ToDayOrderAchievementResponse> GetTodayAchievementStatistics(DateTime startTime, DateTime endTime,long shopId)
{
return SendRequest<ToDayOrderAchievementResponse>(globalContext.BBYWApiHost, "Api/Statistics/GetOrderAchievementStatistics", new
{
globalContext.User.Shop.ShopId,
shopId,
startTime,
endTime
},

4
BBWY.Client/App.xaml.cs

@ -31,10 +31,10 @@ namespace BBWY.Client
string userToken = string.Empty;
#if DEBUG
//齐越山鸡
userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw";
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw";
//刷单组测试
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs";
userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs";
//齐越愉辰
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNDM5OTEyNDU1MzExNDYyNDAwIiwidGVhbUlkIjoiMTQzOTg5ODYxNzM1ODg0ODAwMCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUwNDA0ODZ9.0TvEhPzTeKvpQY31E5YhgfvRBJHYdvwWRrEHNnF9kkA";
//齐越悠仁

4
BBWY.Client/Resources/Themes/Path.xaml

@ -34,4 +34,8 @@
<Style x:Key="path_list" TargetType="Path" BasedOn="{StaticResource basePath}">
<Setter Property="Data" Value="M8,23.000008L32,23.000008 32,25.000008 8,25.000008z M0,22L4,22 4,26 0,26z M8,12L32,12 32,14 8,14z M0,11L4,11 4,15 0,15z M8,1L32,1 32,3 8,3z M0,0L4,0 4,4 0,4z"/>
</Style>
<Style x:Key="path_arrowDown" TargetType="Path" BasedOn="{StaticResource basePath}">
<Setter Property="Data" Value="M32,0L32,8.4920026 21.291016,17.120999 21.200989,17.195005 21.247009,17.232999 15.978027,21.478999 10.708008,17.232999 0,8.6020032 0,0.11100769 12.151001,9.904997 15.93103,12.947995 16.020996,12.874997 19.846008,9.7920056z"/>
</Style>
</ResourceDictionary>

17
BBWY.Client/ViewModels/MainViewModel.cs

@ -192,11 +192,13 @@ namespace BBWY.Client.ViewModels
CreateMenu();
if (GlobalContext.User.TeamName == "刷单组")
return;
//if (GlobalContext.User.TeamName == "刷单组")
// return;
IList<Department> departmentList = null;
if (managerDepartment.Contains(GlobalContext.User.TeamName) || managerDepartment.Any(m => GlobalContext.User.SonDepartmentNames.Contains(m)))
if (GlobalContext.User.TeamName == "刷单组" ||
managerDepartment.Contains(GlobalContext.User.TeamName) ||
managerDepartment.Any(m => GlobalContext.User.SonDepartmentNames.Contains(m)))
{
ShowShopChoosePanel = true;
var response = shopService.GetDepartmentList();
@ -221,11 +223,14 @@ namespace BBWY.Client.ViewModels
else
ShowShopChoosePanel = true;
}
GlobalContext.User.DepartmentList = departmentList;
if (GlobalContext.User.TeamName == "刷单组")
return;
App.Current.Dispatcher.Invoke(() =>
{
var selectShop = new SelectShop(departmentList);
var selectShop = new SelectShopW(departmentList);
if (selectShop.ShowDialog() == true)
{
ChooseShop(selectShop.Shop, true);
@ -250,7 +255,7 @@ namespace BBWY.Client.ViewModels
{
try
{
var selectShop = new SelectShop(GlobalContext.User.DepartmentList);
var selectShop = new SelectShopW(GlobalContext.User.DepartmentList);
if (selectShop.ShowDialog() == true)
{
ChooseShop(selectShop.Shop, true);

24
BBWY.Client/ViewModels/Order/OrderListViewModel.cs

@ -45,7 +45,7 @@ namespace BBWY.Client.ViewModels
private bool excludeCanceled;
private bool onlyUnhandle;
private Random random;
private GlobalContext globalContext;
public GlobalContext globalContext { get; set; }
private bool? includeAfterOrder;
private bool includeExceptionOrder;
private decimal currentConditionsTotalProfit;
@ -181,7 +181,6 @@ namespace BBWY.Client.ViewModels
{
PageIndex = 1;
Task.Factory.StartNew(() => LoadOrder(1)); //手动点击查询订单
Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate));
});
SyncOrderCommand = new RelayCommand(SyncOrder);
CopyTextCommand = new RelayCommand<string>(s =>
@ -205,12 +204,10 @@ namespace BBWY.Client.ViewModels
StartDate = DateTime.Now.Date.AddDays(d * -1);
PageIndex = 1;
Task.Factory.StartNew(() => LoadOrder(1)); //点击日期查询订单
Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate));
});
OrderPageIndexChangedCommand = new RelayCommand<PageArgs>(p =>
{
Task.Factory.StartNew(() => LoadOrder(p.PageIndex));
Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate));
});
DecodeConsigneeCommand = new RelayCommand<Order>(DecodeConsignee);
ChooseStorageTypeCommand = new RelayCommand<object>(ChooseStorageType);
@ -353,7 +350,16 @@ namespace BBWY.Client.ViewModels
LoadAfterSaleOrder(pageIndex);
else
LoadNormalOrder(pageIndex);
LoadOrderCount();
if (!IsSDGroup)
{
Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate, queryShopId.Value));
Task.Factory.StartNew(() => LoadOrderCount(StartDate, EndDate, queryShopId.Value));
}
else
{
}
}
private void LoadNormalOrder(int pageIndex)
@ -434,17 +440,17 @@ namespace BBWY.Client.ViewModels
IsLoading = false;
}
private void LoadTodayAchievement(DateTime startTime, DateTime endTime)
private void LoadTodayAchievement(DateTime startTime, DateTime endTime, long shopId)
{
var response = statisticsService.GetTodayAchievementStatistics(startTime, endTime);
var response = statisticsService.GetTodayAchievementStatistics(startTime, endTime, shopId);
if (!response.Success)
return;
_ = response.Data.Map(ToDayOrderAchievement);
}
private void LoadOrderCount()
private void LoadOrderCount(DateTime startDate, DateTime endDate, long shopId)
{
var response = statisticsService.GetOrderCountStatistics(globalContext.User.Shop.ShopId, StartDate, EndDate);
var response = statisticsService.GetOrderCountStatistics(shopId, startDate, endDate);
if (!response.Success)
return;
WaitPurchaseOrderCount = response.Data.WaitPurchaseCount;

6
BBWY.Client/ViewModels/Order/OrderListViewModel_SDGroup.cs

@ -1,4 +1,5 @@
using GalaSoft.MvvmLight.Command;
using BBWY.Client.Models;
using GalaSoft.MvvmLight.Command;
using System.Windows.Input;
namespace BBWY.Client.ViewModels
@ -6,11 +7,14 @@ namespace BBWY.Client.ViewModels
public partial class OrderListViewModel
{
private int sdGroupButtonIndex;
private Shop sdGroupSelectedShop;
public int SDGroupButtonIndex { get => sdGroupButtonIndex; set { Set(ref sdGroupButtonIndex, value); }}
public ICommand SetSDButtinIndexCommand { get; set; }
public Shop SdGroupSelectedShop { get => sdGroupSelectedShop; set { Set(ref sdGroupSelectedShop, value); } }
private void SDGroupInit()
{

18
BBWY.Client/Views/Order/SDGroup.xaml

@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.Order"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:selectShop="clr-namespace:BBWY.Client.Views.SelectShop"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
@ -27,7 +28,6 @@
<RowDefinition Height="5"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
@ -44,7 +44,19 @@
Command="{Binding SetSDButtinIndexCommand}" CommandParameter="{StaticResource d1}"/>
</StackPanel>
<Grid Grid.Row="2" Background="{StaticResource Border.Background}">
<Grid Grid.Row="2" Background="{StaticResource Border.Background}" Height="40"
Visibility="{Binding SDGroupButtonIndex,ConverterParameter=0:Visible:Collapsed,Converter={StaticResource objConverter}}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="店铺:" VerticalAlignment="Center" Margin="5,0,0,0"/>
<selectShop:SelectShopDialog DepartmentList="{Binding globalContext.User.DepartmentList}" Height="30"/>
<TextBlock Text="订单号:" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="150" Height="30" Margin="5,0,0,0" Text="{Binding SearchOrderId}" WaterRemark="精确匹配"/>
<c:BButton Content="拉取" Height="30" Margin="5,0,0,0" Width="60"/>
</StackPanel>
</Grid>
<Grid Grid.Row="2" Background="{StaticResource Border.Background}"
Visibility="{Binding SDGroupButtonIndex,ConverterParameter=1:Visible:Collapsed,Converter={StaticResource objConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="5"/>
@ -110,6 +122,8 @@
Visibility="{Binding Visibility,ElementName=listbox_order}"/>
</StackPanel>
</Grid>
<local:OrderListControl Grid.Row="4"/>
</Grid>
</Grid>
</Page>

62
BBWY.Client/Views/SelectShop/SelectShopDialog.xaml

@ -0,0 +1,62 @@
<UserControl x:Class="BBWY.Client.Views.SelectShop.SelectShopDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.SelectShop"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
x:Name="uc"
d:DesignHeight="200" d:DesignWidth="300">
<Grid>
<Border x:Name="bd" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" MinWidth="100" Height="{Binding ActualHeight,ElementName=uc}" Background="White" Margin="5,0,0,0"
PreviewMouseLeftButtonDown="bd_PreviewMouseLeftButtonDown">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="txtShopName" Text="" Margin="5,0,0,0" VerticalAlignment="Center"/>
<!--<c:BButton Grid.Column="1" Background="Transparent" HorizontalAlignment="Right" Margin="5,0">
</c:BButton>-->
<Path Style="{StaticResource path_arrowDown}"
Width="10" Grid.Column="1" Margin="5,0"/>
</Grid>
</Border>
<Popup x:Name="popup" Placement="Bottom" PlacementTarget="{Binding ElementName=bd}" StaysOpen="True"
AllowsTransparency="True">
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Background="White">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal">
<TextBlock Text="团队" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<ComboBox x:Name="cbx_department"
ItemsSource="{Binding DepartmentList,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
SelectedIndex="0"
DisplayMemberPath="Name"
Width="150" Height="25"
HorizontalAlignment="Left" VerticalContentAlignment="Center"
Grid.Column="1" Margin="5,0,0,0"
SelectionChanged="cbx_department_SelectionChanged"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Text="店铺" HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Center" />
<ComboBox x:Name="cbx_shop" Width="150" Height="25"
SelectedIndex="0"
HorizontalAlignment="Left" VerticalContentAlignment="Center"
DisplayMemberPath="ShopName"
Grid.Column="1" Grid.Row="1" Margin="5,0,0,0"/>
</StackPanel>
<c:BButton x:Name="btn_ok" Content="确定" Grid.Row="2" Width="60" Height="25" HorizontalAlignment="Right"
Click="btn_ok_Click" Margin="0,10,0,0"/>
</StackPanel>
</Border>
</Popup>
</Grid>
</UserControl>

66
BBWY.Client/Views/SelectShop/SelectShopDialog.xaml.cs

@ -0,0 +1,66 @@
using BBWY.Client.Models;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace BBWY.Client.Views.SelectShop
{
/// <summary>
/// SelectShopDialog.xaml 的交互逻辑
/// </summary>
public partial class SelectShopDialog : UserControl
{
public Shop Shop { get; set; }
public static readonly DependencyProperty DepartmentListProperty = DependencyProperty.Register("DepartmentList", typeof(IList<Department>), typeof(SelectShopDialog));
public static readonly RoutedEvent OnShopChangedEvent = EventManager.RegisterRoutedEvent("OnShopChanged", RoutingStrategy.Bubble, typeof(EventHandler<OnShopChangedEventArgs>), typeof(SelectShopDialog));
public IList<Department> DepartmentList
{
get { return GetValue(DepartmentListProperty) as IList<Department>; }
set { SetValue(DepartmentListProperty, value); }
}
public event RoutedEventHandler OnShopChanged
{
add { this.AddHandler(OnShopChangedEvent, value); }
remove { this.RemoveHandler(OnShopChangedEvent, value); }
}
public SelectShopDialog()
{
InitializeComponent();
}
private void cbx_department_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var d = cbx_department.SelectedItem as Department;
cbx_shop.ItemsSource = d.ShopList;
cbx_shop.SelectedIndex = 0;
}
private void btn_ok_Click(object sender, RoutedEventArgs e)
{
popup.IsOpen = false;
Shop = cbx_shop.SelectedItem as Shop;
txtShopName.Text = Shop.ShopName;
var args = new OnShopChangedEventArgs(OnShopChangedEvent, this);
args.SelectedShop = Shop;
this.RaiseEvent(args);
}
private void bd_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
popup.IsOpen = true;
}
}
public class OnShopChangedEventArgs : RoutedEventArgs
{
public OnShopChangedEventArgs(RoutedEvent routedEvent, object source) : base(routedEvent, source) { }
public Shop SelectedShop { get; set; }
}
}

2
BBWY.Client/Views/SelectShop.xaml → BBWY.Client/Views/SelectShop/SelectShopW.xaml

@ -1,4 +1,4 @@
<c:BWindow x:Class="BBWY.Client.Views.SelectShop"
<c:BWindow x:Class="BBWY.Client.Views.SelectShopW"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

4
BBWY.Client/Views/SelectShop.xaml.cs → BBWY.Client/Views/SelectShop/SelectShopW.xaml.cs

@ -9,12 +9,12 @@ namespace BBWY.Client.Views
/// <summary>
/// SelectShop.xaml 的交互逻辑
/// </summary>
public partial class SelectShop : BWindow
public partial class SelectShopW : BWindow
{
public IList<Department> DepartmentList { get; set; }
public Shop Shop { get; set; }
public SelectShop(IList<Department> departmentList)
public SelectShopW(IList<Department> departmentList)
{
InitializeComponent();
this.DepartmentList = departmentList;
Loading…
Cancel
Save