Browse Source

10056

qianyi
shanji 3 years ago
parent
commit
2f0e03598e
  1. 67
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  2. 2
      BBWY.Client/Views/MainWindow.xaml
  3. 30
      BBWY.Client/Views/Order/SkuRecentSalesConfirmWindow.xaml
  4. 24
      BBWY.Client/Views/Order/SkuRecentSalesConfirmWindow.xaml.cs

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

@ -540,29 +540,54 @@ namespace BBWY.Client.ViewModels
}
else if (storageType == StorageType.)
{
var chooseDFType = new ChooseDFType();
if (chooseDFType.ShowDialog() != true)
return;
if (chooseDFType.DFType == DFType.)
IsLoading = true;
Task.Factory.StartNew(() => statisticsService.GetSkuRecentSales(order.ItemList.Select(osku => osku.Id).ToList())).ContinueWith(t =>
{
var relationPurchaseOrder = new RelationPurchaseOrder(orderId, globalContext.User.Shop.PurchaseAccountList, null, null, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
IsLoading = false;
if (t.Result.Success)
{
Logo = osku.Logo,
ProductId = osku.ProductId,
SkuId = osku.Id,
Quantity = osku.ItemTotal,
Title = osku.Title
}).ToList());
relationPurchaseOrder.Closed += RelationPurchaseOrder_Closed;
relationPurchaseOrder.ShowDialog();
}
else if (chooseDFType.DFType == DFType.线)
{
choosePurchaseSchemeViewModel.SetData(order);
var choosePurchaseScheme = new ChoosePurchaseScheme();
choosePurchaseScheme.ShowDialog();
}
var tartgetSkus = t.Result.Data.Where(s => s.SaleCount >= 5).Select(s => s.SkuId).ToList();
if (tartgetSkus.Count() > 0)
{
bool? dialog = false;
App.Current.Dispatcher.Invoke(() =>
{
var confirmWindow = new SkuRecentSalesConfirmWindow(tartgetSkus);
dialog = confirmWindow.ShowDialog();
});
if (dialog != true)
return;
}
}
App.Current.Dispatcher.Invoke(() =>
{
var chooseDFType = new ChooseDFType();
if (chooseDFType.ShowDialog() != true)
return;
if (chooseDFType.DFType == DFType.)
{
var relationPurchaseOrder = new RelationPurchaseOrder(orderId, globalContext.User.Shop.PurchaseAccountList, null, null, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
{
Logo = osku.Logo,
ProductId = osku.ProductId,
SkuId = osku.Id,
Quantity = osku.ItemTotal,
Title = osku.Title
}).ToList());
relationPurchaseOrder.Closed += RelationPurchaseOrder_Closed;
relationPurchaseOrder.ShowDialog();
}
else if (chooseDFType.DFType == DFType.线)
{
choosePurchaseSchemeViewModel.SetData(order);
var choosePurchaseScheme = new ChoosePurchaseScheme();
choosePurchaseScheme.ShowDialog();
}
});
});
}
}

2
BBWY.Client/Views/MainWindow.xaml

@ -26,7 +26,7 @@
<!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>-->
<TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/>
<TextBlock Text="v10055" Margin="5,0,0,0"/>
<TextBlock Text="v10056" Margin="5,0,0,0"/>
</StackPanel>
</Border>
<Grid Grid.Row="1">

30
BBWY.Client/Views/Order/SkuRecentSalesConfirmWindow.xaml

@ -0,0 +1,30 @@
<c:BWindow x:Class="BBWY.Client.Views.Order.SkuRecentSalesConfirmWindow"
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"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.Order"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
Title="SkuRecentSalesConfirmWindow" Height="150" Width="400"
Style="{StaticResource bwstyle}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="提示" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock x:Name="txtContent" Grid.Row="1" Text=""
VerticalAlignment="Center" TextWrapping="Wrap" Margin="20,0"/>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
<c:BButton Content="继续一件代发" Padding="10,0" Background="{StaticResource Border.Background}" Foreground="{StaticResource Text.Color}" Click="BButton_Click"/>
<c:BButton Content="批量采购" Padding="10,0" Click="BButton_Click"/>
</StackPanel>
</Grid>
</c:BWindow>

24
BBWY.Client/Views/Order/SkuRecentSalesConfirmWindow.xaml.cs

@ -0,0 +1,24 @@
using BBWY.Controls;
using System.Collections.Generic;
using System.Windows;
namespace BBWY.Client.Views.Order
{
/// <summary>
/// SkuRecentSalesConfirmWindow.xaml 的交互逻辑
/// </summary>
public partial class SkuRecentSalesConfirmWindow : BWindow
{
public SkuRecentSalesConfirmWindow(IList<string> skuIds)
{
InitializeComponent();
txtContent.Text = $"SKU {string.Join(',', skuIds)} 最近30天一件代发已超过5件, 建议批量采购入仓,权重更高,推广费用更便宜";
}
private void BButton_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
this.Close();
}
}
}
Loading…
Cancel
Save