自动拍单功能
This commit is contained in:
1 parent
5906a1623f
commit
e755da09a6
6 files changed
+141
-80
No files matched your search
@@ -614,19 +614,18 @@
|
||||
MinWidth="48"
|
||||
Margin="8,0,4,0"
|
||||
Padding="4,0"
|
||||
c:DebugVisibility.Enable="True"
|
||||
Click="btnAutoBuy_Click"
|
||||
Content="自动拍单"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<!-- c:DebugVisibility.Enable="true" -->
|
||||
<Button
|
||||
x:Name="btnAutoBuyIntorduction"
|
||||
Width="Auto"
|
||||
Height="22"
|
||||
MinWidth="48"
|
||||
Margin="0,0,4,0"
|
||||
Margin="0,0,8,0"
|
||||
Padding="4,0"
|
||||
c:DebugVisibility.Enable="True"
|
||||
Click="btnAutoBuyIntroduction_Click"
|
||||
Content="自动拍单设置说明"
|
||||
FontSize="12"
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
/// </summary>
|
||||
public partial class OrderListCtrl : UserControl, INotifyPropertyChanged
|
||||
{
|
||||
public static bool IsAutoBuy { get; set; } = false;
|
||||
public CheckBox chkSelectAll = null;
|
||||
OrderFilterConfig _orderFilterConfig;
|
||||
public OrderFilterConfig orderFilterConfig
|
||||
@@ -2716,11 +2717,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
IsAutoBuy = true;
|
||||
foreach (var order in buyOrders)
|
||||
{
|
||||
var orderItem = order.orderItems.FirstOrDefault();
|
||||
await OrderListRowItemCtrl.BuyOrder(orderItem, true);
|
||||
if (IsAutoBuy == false)
|
||||
break;
|
||||
}
|
||||
IsAutoBuy = false;
|
||||
}
|
||||
|
||||
private void btnAutoBuyIntroduction_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -323,17 +323,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
if (orderItem == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单信息为空");
|
||||
if (!isAutoBuy)
|
||||
BaseMsgWindow.ShowError("订单信息为空");
|
||||
return;
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("请选择买手号");
|
||||
if (!isAutoBuy)
|
||||
BaseMsgWindow.ShowError("请选择买手号");
|
||||
return;
|
||||
}
|
||||
if (orderItem.ItemOrder.orderItems.Count > 1)
|
||||
{
|
||||
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
|
||||
if (!isAutoBuy)
|
||||
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -342,7 +345,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
OrderListCtrl.InitOrderItemObservableProp(orderItem);
|
||||
MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.ItemOrder);
|
||||
BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
|
||||
if (!isAutoBuy)
|
||||
BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -590,6 +594,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (isAbnormalOrder)
|
||||
buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
|
||||
buyOrderForm.ShowDialog();
|
||||
OrderListCtrl.IsAutoBuy = buyOrderForm.IsAutoBuy;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user