11 changed files with 201 additions and 25 deletions
@ -0,0 +1,11 @@ |
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class GetJDSupplierNameAndStoreNameResponse |
|||
{ |
|||
public string SupplierName { get; set; } |
|||
|
|||
public string StoreId { get; set; } |
|||
|
|||
public string StoreName { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.FallWare.SetJDWareBoxWindow2" |
|||
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.FallWare" |
|||
mc:Ignorable="d" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
Title="SetJDWareBoxWindow2" Height="250" Width="250" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
CloseButtonVisibility="Visible" |
|||
Style="{StaticResource bwstyle}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="30"/> |
|||
<RowDefinition Height="30"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="箱唛设置" Style="{StaticResource middleTextBlock}"/> |
|||
</Border> |
|||
<StackPanel Grid.Row="1" Background="#F5F7FA" Orientation="Horizontal"> |
|||
<c:BButton Content="京仓" Width="60" Background="White" Foreground="{StaticResource Button.Background}"/> |
|||
<c:BButton Content="云仓" Width="60" Background="#F5F7FA" Foreground="{StaticResource Text.Color}"/> |
|||
</StackPanel> |
|||
<StackPanel Grid.Row="2" Margin="5,0"> |
|||
<Grid Margin="0,10,0,0"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="80"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="入库采购单号" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
|||
<c:BTextBox Grid.Column="1" Margin="5,0,0,0" Height="25" |
|||
Text="{Binding JDWareBoxModel.PurchaseOrder}"/> |
|||
</Grid> |
|||
|
|||
<Grid Margin="0,10,0,0"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="80"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="预约单号" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
|||
<c:BTextBox Grid.Column="1" Margin="5,0,0,0" Height="25" |
|||
Text="{Binding JDWareBoxModel.PrewOrder}"/> |
|||
</Grid> |
|||
|
|||
<Grid Margin="0,10,0,0"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="80"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="商品名称" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
|||
<c:BTextBox Grid.Column="1" Margin="5,0,0,0" Height="25" |
|||
Text="{Binding JDWareBoxModel.ProductTitle}"/> |
|||
</Grid> |
|||
</StackPanel> |
|||
<c:BButton Grid.Row="3" Content="保存" HorizontalAlignment="Right" Width="80" VerticalAlignment="Center" Click="btn_save_Click" |
|||
Name="btn_save" Margin="0,0,5,0"/> |
|||
|
|||
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999" |
|||
WaitText="正在提交中" |
|||
Grid.RowSpan="4"/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,77 @@ |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Models.FallWare; |
|||
using BBWY.Controls; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using System.Windows; |
|||
|
|||
namespace BBWY.Client.Views.FallWare |
|||
{ |
|||
/// <summary>
|
|||
/// SetJDWareBoxWindow2.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class SetJDWareBoxWindow2 : BWindow |
|||
{ |
|||
public JDWareBoxModel JDWareBoxModel { get; set; } |
|||
|
|||
private SealBoxService sealBoxService; |
|||
|
|||
private Action reflashWindow; |
|||
|
|||
private WareType wareType; |
|||
|
|||
public bool IsEnabled { get; set; } |
|||
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|||
|
|||
private bool isLoading; |
|||
|
|||
public SetJDWareBoxWindow2(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true) |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
this.sealBoxService = sealBoxService; |
|||
this.wareType = wareType; |
|||
this.reflashWindow = reflashWindow; |
|||
JDWareBoxModel = model; |
|||
this.IsEnabled = isEnabled; |
|||
this.DataContext = this; |
|||
} |
|||
|
|||
private void btn_save_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
if (string.IsNullOrEmpty(JDWareBoxModel.ProductTitle) || |
|||
string.IsNullOrEmpty(JDWareBoxModel.PrewOrder) || |
|||
string.IsNullOrEmpty(JDWareBoxModel.PurchaseOrder)) |
|||
{ |
|||
MessageBox.Show("信息不完整", "提示"); |
|||
return; |
|||
} |
|||
IsLoading = true; |
|||
Task.Factory.StartNew(() => |
|||
{ |
|||
var getDetailResponse = sealBoxService.GetJDSupplierNameAndStoreName(JDWareBoxModel.PurchaseOrder); |
|||
if (!getDetailResponse.Success) |
|||
{ |
|||
IsLoading = false; |
|||
this.Dispatcher.Invoke(() => MessageBox.Show(getDetailResponse.Msg, "提示")); |
|||
return; |
|||
} |
|||
|
|||
var res = sealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo, getDetailResponse.Data.SupplierName, getDetailResponse.Data.StoreName); |
|||
if (!res.Success) |
|||
{ |
|||
IsLoading = false; |
|||
this.Dispatcher.Invoke(() => MessageBox.Show(res.Msg, "提示")); |
|||
return; |
|||
} |
|||
IsLoading = false; |
|||
this.Dispatcher.Invoke(() => |
|||
{ |
|||
reflashWindow?.Invoke(); |
|||
this.Close(); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue