shanji 3 years ago
parent
commit
3831d258f3
  1. 3
      BBWY.Client/Resources/Themes/Path.xaml
  2. 10
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  3. 20
      BBWY.Client/Views/Order/RelationPurchaseOrder.xaml
  4. 12
      BBWY.Client/Views/Order/RelationPurchaseOrder.xaml.cs
  5. 4
      BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

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

@ -38,4 +38,7 @@
<Style x:Key="path_arrowDown" TargetType="Path" BasedOn="{StaticResource basePath}"> <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"/> <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> </Style>
<Style x:Key="path_refresh" TargetType="Path" BasedOn="{StaticResource basePath}">
<Setter Property="Data" Value="M1.6819987,14.044979L9.8970004,17.370966 6.3769976,19.284967C8.2400037,22.789972 11.896001,25.193962 16.141995,25.193962 20.631998,25.193962 24.487993,22.521967 26.233004,18.687982L29.466995,18.687982C27.558001,24.216972 22.313997,28.208 16.141995,28.208 10.761998,28.208 6.0890032,25.17498 3.7130042,20.731012L0,22.747003z M16.141995,0C21.460993,1.3985937E-07,26.084002,2.9670097,28.485001,7.3259868L32,5.3049912 30.530991,14.044979 22.236994,10.916013 25.860003,8.8339815C23.983004,5.3789963 20.351999,3.0140068 16.141995,3.0140066 11.653997,3.0140068 7.7980023,5.6860031 6.0520006,9.518979L2.8189999,9.518979C4.7280031,3.9899892,9.9719973,1.3985937E-07,16.141995,0z"/>
</Style>
</ResourceDictionary> </ResourceDictionary>

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

@ -547,10 +547,18 @@ namespace BBWY.Client.ViewModels
private void RelationPurchaseOrder_Closed(object sender, EventArgs e) private void RelationPurchaseOrder_Closed(object sender, EventArgs e)
{ {
var relationPurchaseOrder = sender as RelationPurchaseOrder; var relationPurchaseOrder = sender as RelationPurchaseOrder;
var orderId = relationPurchaseOrder.OrderId;
if (relationPurchaseOrder.IsRePurchase)
{
var order = OrderList.FirstOrDefault(o => o.Id == orderId);
choosePurchaseSchemeViewModel.SetData(order);
var choosePurchaseScheme = new ChoosePurchaseScheme();
choosePurchaseScheme.ShowDialog();
return;
}
if (relationPurchaseOrder.DialogResult != true) if (relationPurchaseOrder.DialogResult != true)
return; return;
var orderDropShippingList = relationPurchaseOrder.OrderDropShippingList; var orderDropShippingList = relationPurchaseOrder.OrderDropShippingList;
var orderId = relationPurchaseOrder.OrderId;
IsLoading = true; IsLoading = true;
Task.Factory.StartNew(() => orderService.RelationPurchaseOrderV2(orderDropShippingList, globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M)) Task.Factory.StartNew(() => orderService.RelationPurchaseOrderV2(orderDropShippingList, globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M))
.ContinueWith(t => .ContinueWith(t =>

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

@ -172,14 +172,22 @@
<Border Grid.Row="2" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Margin="5,0"> <Border Grid.Row="2" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Margin="5,0">
<c:BButton x:Name="btn_AddOrderDropShipping" <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<c:BButton x:Name="btn_AddOrderDropShipping"
Style="{StaticResource LinkButton}" Style="{StaticResource LinkButton}"
Command="{Binding AddOrderDropShippingCommand}"> Command="{Binding AddOrderDropShippingCommand}">
<StackPanel> <StackPanel>
<Path Style="{StaticResource path_add}" Fill="{StaticResource Text.Link.Color}" Width="16"/> <Path Style="{StaticResource path_add}" Fill="{StaticResource Text.Link.Color}" Width="18"/>
<TextBlock Text="添加采购单"/> <TextBlock Text="添加采购单" Margin="0,2,0,0"/>
</StackPanel> </StackPanel>
</c:BButton> </c:BButton>
<c:BButton Style="{StaticResource LinkButton}" Margin="50,0,0,0" Command="{Binding RePurchaseCommand}">
<StackPanel>
<Path Style="{StaticResource path_refresh}" Fill="{StaticResource Text.Link.Color}" Width="19"/>
<TextBlock Text="重新采购" Margin="0,2,0,0"/>
</StackPanel>
</c:BButton>
</StackPanel>
</Border> </Border>

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

@ -21,6 +21,8 @@ namespace BBWY.Client.Views.Order
public ICommand CloseShowChooseSkuPanelCommand { get; set; } public ICommand CloseShowChooseSkuPanelCommand { get; set; }
public ICommand RePurchaseCommand { get; set; }
public IList<OrderDropShipping> OrderDropShippingList { get; set; } public IList<OrderDropShipping> OrderDropShippingList { get; set; }
@ -50,6 +52,7 @@ namespace BBWY.Client.Views.Order
private bool isShowChooseSkuPanel; private bool isShowChooseSkuPanel;
private OrderDropShipping currentOds; private OrderDropShipping currentOds;
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<RelationPurchaseOrderSku> relationPurchaseOrderSkuList)
@ -92,6 +95,15 @@ namespace BBWY.Client.Views.Order
})); }));
AddRelationPurchaseOrderSkuCommand = new RelayCommand<OrderDropShipping>(AddRelationPurchaseOrderSku); AddRelationPurchaseOrderSkuCommand = new RelayCommand<OrderDropShipping>(AddRelationPurchaseOrderSku);
CloseShowChooseSkuPanelCommand = new RelayCommand(() => IsShowChooseSkuPanel = false); CloseShowChooseSkuPanelCommand = new RelayCommand(() => IsShowChooseSkuPanel = false);
RePurchaseCommand = new RelayCommand(() =>
{
if (MessageBox.Show("请确认是否重新采购,确定之后之前的采购单号将无法修改", "提醒", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{
IsRePurchase = true;
this.DialogResult = false;
this.Close();
}
});
} }
private void OnSkuAmountChanged() private void OnSkuAmountChanged()

4
BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -133,8 +133,8 @@ namespace BBWY.Server.Business
var dbOrder = fsql.Select<Order>(createOnlinePurchaseOrderRequest.OrderId).ToOne(); var dbOrder = fsql.Select<Order>(createOnlinePurchaseOrderRequest.OrderId).ToOne();
if (dbOrder == null) if (dbOrder == null)
throw new BusinessException("订单不存在"); throw new BusinessException("订单不存在");
if (dbOrder.OrderState != Model.Enums.OrderState.) if (dbOrder.OrderState != Enums.OrderState. && dbOrder.OrderState != Enums.OrderState.)
throw new BusinessException("只能为等待采购的订单进行采购"); throw new BusinessException("只能为等待采购或待出库的订单进行采购");
var oldPourchaseIdList = fsql.Select<OrderCostDetail>().Where(ocd => ocd.OrderId == dbOrder.Id) var oldPourchaseIdList = fsql.Select<OrderCostDetail>().Where(ocd => ocd.OrderId == dbOrder.Id)
.ToList(ocd => ocd.PurchaseOrderPKId); .ToList(ocd => ocd.PurchaseOrderPKId);

Loading…
Cancel
Save