shanji 3 years ago
parent
commit
ae72b42d5c
  1. 5
      BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs
  2. 5
      BBWY.Client/Models/Order/Order.cs
  3. 4
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  4. 40
      BBWY.Client/Views/Order/RelationPurchaseOrder.xaml
  5. 28
      BBWY.Client/Views/Order/RelationPurchaseOrder.xaml.cs

5
BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs

@ -171,6 +171,11 @@ namespace BBWY.Client.Models
/// </summary>
public IList<OrderDropShippingResponse> OrderDropShippingList { get; set; }
/// <summary>
/// 历史代发信息
/// </summary>
public IList<OrderDropShippingResponse> HistoryOrderDropShippingList { get; set; }
/// <summary>
/// 售后信息
/// </summary>

5
BBWY.Client/Models/Order/Order.cs

@ -197,6 +197,11 @@ namespace BBWY.Client.Models
/// </summary>
public IList<OrderDropShipping> OrderDropShippingList { get; set; }
/// <summary>
/// 历史代发信息
/// </summary>
public IList<OrderDropShipping> HistoryOrderDropShippingList { get; set; }
/// <summary>
/// 售后信息
/// </summary>

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

@ -524,7 +524,7 @@ namespace BBWY.Client.ViewModels
if (chooseDFType.DFType == DFType.)
{
var relationPurchaseOrder = new RelationPurchaseOrder(orderId, globalContext.User.Shop.PurchaseAccountList, null, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
var relationPurchaseOrder = new RelationPurchaseOrder(orderId, globalContext.User.Shop.PurchaseAccountList, null, null, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
{
Logo = osku.Logo,
ProductId = osku.ProductId,
@ -662,7 +662,7 @@ namespace BBWY.Client.ViewModels
return;
if (order.StorageType == StorageType.)
{
var relationPurchaseOrder = new RelationPurchaseOrder(order.Id, globalContext.User.Shop.PurchaseAccountList, order.OrderDropShippingList, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
var relationPurchaseOrder = new RelationPurchaseOrder(order.Id, globalContext.User.Shop.PurchaseAccountList, order.OrderDropShippingList, order.HistoryOrderDropShippingList, order.ItemList.Select(osku => new RelationPurchaseOrderSku()
{
Logo = osku.Logo,
ProductId = osku.ProductId,

40
BBWY.Client/Views/Order/RelationPurchaseOrder.xaml

@ -23,8 +23,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<!--<RowDefinition Height="130"/>
<RowDefinition Height="1*"/>-->
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="60"/>
<RowDefinition Height="40"/>
@ -34,7 +33,34 @@
<TextBlock Text="{Binding OrderId,StringFormat=关联采购单({0})}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ListBox x:Name="listbox_orderDropShipping" Grid.Row="1" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
<ListBox x:Name="listbox_historyOrderDropShipping" Grid.Row="1"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
Style="{StaticResource NoScrollViewListBoxStyle}"
ItemsSource="{Binding HistoryOrderDropShippingList}"
BorderThickness="1"
BorderBrush="{StaticResource Border.Brush}"
Margin="5,5,5,0"
Visibility="{Binding IsShowHistoryOrderDropShoppingList,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_historyOrderDropShipping,Converter={StaticResource widthConverter},ConverterParameter=10}"
Margin="0,5">
<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<TextBlock Text="历史采购单号"/>
<c:BButton Margin="5,0,0,0" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" Content="{Binding PurchaseOrderId}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"
CommandParameter="{Binding PurchaseOrderId}"/>
</StackPanel>
<TextBlock HorizontalAlignment="Right" Margin="0,0,140,0">
<Run Text="采购总额"/>
<Run Text="{Binding PurchaseAmount}"/>
</TextBlock>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox x:Name="listbox_orderDropShipping" Grid.Row="2" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
ItemsSource="{Binding OrderDropShippingList}">
<ListBox.ItemTemplate>
<DataTemplate>
@ -171,7 +197,7 @@
</ListBox>
<Border Grid.Row="2" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Margin="5,0">
<Border Grid.Row="3" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Margin="5,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<c:BButton x:Name="btn_AddOrderDropShipping"
Style="{StaticResource LinkButton}"
@ -191,16 +217,16 @@
</Border>
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Grid.Row="3" FontSize="16">
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Grid.Row="4" FontSize="16">
<Run Text="采购总额(含运费)"/>
<Run Text="{Binding TotalCost}" Foreground="#EC808D"/>
<Run Text="元"/>
</TextBlock>
<c:BButton x:Name="btn_Save" Content="保存" Width="60" Grid.Row="3" Margin="0,0,5,0"
<c:BButton x:Name="btn_Save" Content="保存" Width="60" Grid.Row="4" Margin="0,0,5,0"
Click="btn_Save_Click" HorizontalAlignment="Right"/>
<Border Grid.Row="1" Background="White" Margin="20" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"
<Border Grid.Row="1" Grid.RowSpan="2" Background="White" Margin="20" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"
Visibility="{Binding IsShowChooseSkuPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}">
<Grid>
<Grid.RowDefinitions>

28
BBWY.Client/Views/Order/RelationPurchaseOrder.xaml.cs

@ -23,9 +23,13 @@ namespace BBWY.Client.Views.Order
public ICommand RePurchaseCommand { get; set; }
public ICommand CopyTextCommand { get; set; }
public IList<OrderDropShipping> OrderDropShippingList { get; set; }
public IList<OrderDropShipping> HistoryOrderDropShippingList { get; set; }
public IList<RelationPurchaseOrderSku> RelationPurchaseOrderSkuList { get; set; }
public IList<RelationPurchaseOrderSku> ChooseRelationPurchaseOrderSkuList { get; set; }
@ -34,6 +38,8 @@ namespace BBWY.Client.Views.Order
public string OrderId { get; set; }
public bool IsShowHistoryOrderDropShoppingList { get; set; }
public decimal TotalCost { get => totalCost; set { Set(ref totalCost, value); } }
public bool IsShowChooseSkuPanel
{
@ -55,7 +61,11 @@ namespace BBWY.Client.Views.Order
public bool IsRePurchase { get; private set; }
public RelationPurchaseOrder(string orderId, IList<PurchaseAccount> purchaseAccountList, IList<OrderDropShipping> orderDropShippingList, IList<RelationPurchaseOrderSku> relationPurchaseOrderSkuList)
public RelationPurchaseOrder(string orderId,
IList<PurchaseAccount> purchaseAccountList,
IList<OrderDropShipping> orderDropShippingList,
IList<OrderDropShipping> historyOrderDropShippingList,
IList<RelationPurchaseOrderSku> relationPurchaseOrderSkuList)
{
InitializeComponent();
this.DataContext = this;
@ -63,6 +73,8 @@ namespace BBWY.Client.Views.Order
this.PurchaseAccountList = purchaseAccountList;
this.OrderId = orderId;
OrderDropShippingList = new ObservableCollection<OrderDropShipping>();
HistoryOrderDropShippingList = historyOrderDropShippingList;
IsShowHistoryOrderDropShoppingList = (historyOrderDropShippingList?.Count() ?? 0) > 0;
if (orderDropShippingList != null)
{
foreach (var ods in orderDropShippingList)
@ -104,6 +116,20 @@ namespace BBWY.Client.Views.Order
this.Close();
}
});
CopyTextCommand = new RelayCommand<string>(s =>
{
try
{
Clipboard.SetText(s);
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(ex);
Console.ResetColor();
}
}
);
}
private void OnSkuAmountChanged()

Loading…
Cancel
Save