Browse Source

修复打印箱唛闪退bug

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
f9ed63b3f0
  1. 15
      BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs
  2. 47
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  3. 19
      BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml

15
BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs

@ -4,16 +4,18 @@ using System.Text;
namespace BBWY.Client.Models.APIModel namespace BBWY.Client.Models.APIModel
{ {
public class GetWareWaitTransportResponse public class GetWareWaitTransportResponse : NotifyObject
{ {
/// <summary> /// <summary>
/// 数量 /// 数量
/// </summary> /// </summary>
public int TotalCount { get; set; } public int TotalCount { get; set; }
public List<WareWaitTransport> WareWaitTransports { get; set; }
private List<WareWaitTransport> wareWaitTransports;
public List<WareWaitTransport> WareWaitTransports { get => wareWaitTransports; set { Set(ref wareWaitTransports, value); } }
} }
public class WareWaitTransport:NotifyObject public class WareWaitTransport : NotifyObject
{ {
private string transportOverTimeMarkMsg; private string transportOverTimeMarkMsg;
@ -60,11 +62,14 @@ namespace BBWY.Client.Models.APIModel
/// </summary> /// </summary>
public string AcceptUserNames { get; set; } public string AcceptUserNames { get; set; }
/// <summary> /// <summary>
/// sku列表 /// sku列表
/// </summary> /// </summary>
public List<WaitTransportSku> WaitTransportSkus { get; set; } private List<WaitTransportSku> waitTransportSkus;
/// <summary>
/// sku列表
/// </summary>
public List<WaitTransportSku> WaitTransportSkus { get => waitTransportSkus; set { Set(ref waitTransportSkus, value); } }
} }
public class WaitTransportSku public class WaitTransportSku
{ {

47
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -25,6 +25,7 @@ using System.Diagnostics.Eventing.Reader;
using BBWY.Client.Models.SealBox; using BBWY.Client.Models.SealBox;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Diagnostics; using System.Diagnostics;
using BBWY.Client.Extensions;
namespace BBWY.Client.ViewModels.PackTask namespace BBWY.Client.ViewModels.PackTask
{ {
@ -308,12 +309,18 @@ namespace BBWY.Client.ViewModels.PackTask
/// 待完结列表 /// 待完结列表
/// </summary> /// </summary>
public ObservableCollection<WareWaitCompleted> WaitCompletedList { get => waitCompletedList; set { Set(ref waitCompletedList, value); } } public ObservableCollection<WareWaitCompleted> WaitCompletedList { get => waitCompletedList; set { Set(ref waitCompletedList, value); } }
private ObservableCollection<WareWaitTransport> waitTransportList; private ObservableCollection<WareWaitTransport> waitTransportList;
/// <summary> /// <summary>
/// 待转运列表 /// 待转运列表
/// </summary> /// </summary>
public ObservableCollection<WareWaitTransport> WaitTransportList { get => waitTransportList; set { Set(ref waitTransportList, value); } } public ObservableCollection<WareWaitTransport> WaitTransportList { get => waitTransportList; set { Set(ref waitTransportList, value); } }
public List<WareWaitTransport> WareWaitTransports { get; set; }
private ObservableCollection<WaitFallWareModel> waitFallWareList; private ObservableCollection<WaitFallWareModel> waitFallWareList;
/// <summary> /// <summary>
/// 待落仓列表 /// 待落仓列表
@ -662,7 +669,24 @@ namespace BBWY.Client.ViewModels.PackTask
LoadSealBoxSkuDataCommand = new RelayCommand<SealBoxModel>(LoadSealBoxSkuData); LoadSealBoxSkuDataCommand = new RelayCommand<SealBoxModel>(LoadSealBoxSkuData);
LoadFallWareSkuDataCommand = new RelayCommand<WaitFallWareModel>(LoadFallWareSkuData); LoadFallWareSkuDataCommand = new RelayCommand<WaitFallWareModel>(LoadFallWareSkuData);
LoadTransportSkuDataCommand = new RelayCommand<WareWaitTransport>(LoadTransportSkuData);
}
private void LoadTransportSkuData(WareWaitTransport model)
{
if (model.WaitTransportSkus == null || model.WaitTransportSkus.Count <= 0)
{
var skuDatas = WareWaitTransports.SingleOrDefault(w => w.SealBoxId == model.SealBoxId);
WaitTransportList.SingleOrDefault(w => w.SealBoxId == model.SealBoxId).WaitTransportSkus = skuDatas.WaitTransportSkus;
}
else
{
WaitTransportList.SingleOrDefault(w => w.SealBoxId == model.SealBoxId).WaitTransportSkus = null;
} }
}
private void LoadFallWareSkuData(WaitFallWareModel model) private void LoadFallWareSkuData(WaitFallWareModel model)
{ {
@ -1026,7 +1050,7 @@ namespace BBWY.Client.ViewModels.PackTask
JDWareBoxModel model = new JDWareBoxModel JDWareBoxModel model = new JDWareBoxModel
{ {
ShopName = globalContext.User.Shop.ShopName, ShopName = fallware.ShopName,
WareName = fallware.WareName, WareName = fallware.WareName,
SealBoxId = fallware.SealBoxId, SealBoxId = fallware.SealBoxId,
ProductCount = fallware.ProductCount, ProductCount = fallware.ProductCount,
@ -1220,6 +1244,11 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary> /// </summary>
public ICommand LoadFallWareSkuDataCommand { get; set; } public ICommand LoadFallWareSkuDataCommand { get; set; }
/// <summary>
/// 转运
/// </summary>
public ICommand LoadTransportSkuDataCommand { get; set; }
/// <summary> /// <summary>
/// 完成封箱 /// 完成封箱
/// </summary> /// </summary>
@ -1438,7 +1467,7 @@ namespace BBWY.Client.ViewModels.PackTask
} }
else if (TaskState == Models.TaskState.) else if (TaskState == Models.TaskState.)
{ {
PageSize = 20;
WaitTransportList = new ObservableCollection<WareWaitTransport>(); WaitTransportList = new ObservableCollection<WareWaitTransport>();
var datas = sealBoxService.GetWareWaitTransportList(SelectWareType, PageSize, PageIndex); var datas = sealBoxService.GetWareWaitTransportList(SelectWareType, PageSize, PageIndex);
@ -1446,11 +1475,15 @@ namespace BBWY.Client.ViewModels.PackTask
{ {
var dataModel = datas.Data; var dataModel = datas.Data;
OrderCount = dataModel.TotalCount; OrderCount = dataModel.TotalCount;
WareWaitTransports = dataModel.WareWaitTransports;
foreach (var item in dataModel.WareWaitTransports) foreach (var item in dataModel.WareWaitTransports)
{ {
var skuItem = item.Copy();
skuItem.WaitTransportSkus = null;//默认不加载
App.Current.Dispatcher.Invoke(new Action(() => App.Current.Dispatcher.Invoke(new Action(() =>
{ {
WaitTransportList.Add(item); WaitTransportList.Add(skuItem);
})); }));
} }
@ -1507,7 +1540,7 @@ namespace BBWY.Client.ViewModels.PackTask
} }
else if (TaskState == Models.TaskState.) else if (TaskState == Models.TaskState.)
{ {
PageSize = 20;
WaitFallWareList = new ObservableCollection<WaitFallWareModel>(); WaitFallWareList = new ObservableCollection<WaitFallWareModel>();
var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize); var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize);
@ -1554,7 +1587,7 @@ namespace BBWY.Client.ViewModels.PackTask
else if (TaskState == Models.TaskState.) else if (TaskState == Models.TaskState.)
{ {
PageSize = 20;
if (SealBoxConfigureType == SealBoxConfigureType.) if (SealBoxConfigureType == SealBoxConfigureType.)
{ {
WaitSealBoxModels = new ObservableCollection<SealBoxModel>(); WaitSealBoxModels = new ObservableCollection<SealBoxModel>();
@ -1699,12 +1732,8 @@ namespace BBWY.Client.ViewModels.PackTask
else else
{ {
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据 PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName, var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName,
PageIndex, PageSize, SearchSkuTitle, SearchSpuTitle); PageIndex, PageSize, SearchSkuTitle, SearchSpuTitle);
stopwatch.Stop(); stopwatch.Stop();
App.Current.Dispatcher.BeginInvoke(new Action(() => App.Current.Dispatcher.BeginInvoke(new Action(() =>
{ {

19
BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml

@ -77,10 +77,10 @@
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}" <Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="100"> >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
<RowDefinition MinHeight="90"/> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Background="#F2F2F2" > <Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -119,10 +119,21 @@
<TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptUserNames}" Margin="5,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="{Binding AcceptUserNames}" Margin="5,0,0,0" />
</StackPanel> </StackPanel>
<c:BButton Grid.Column="0" Grid.ColumnSpan="6" HorizontalAlignment="Stretch" BorderThickness="0" Panel.ZIndex="-1" Background="Transparent"
Command="{Binding DataContext.LoadTransportSkuDataCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding}"
/>
<Grid Grid.Column="5" Panel.ZIndex="-2">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitTransportSkus,Converter={StaticResource objConverter},ConverterParameter=#null:∧:∨}" FontWeight="Bold"
Foreground="{StaticResource Text.Link.Color}" FontSize="18"
/>
</Grid>
</Grid> </Grid>
<Grid Grid.Row="1"> <Grid Grid.Row="1" Visibility="{Binding WaitTransportSkus,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/>
@ -137,7 +148,7 @@
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" > ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" >
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_orerSku}"> <Grid Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/> <ColumnDefinition Width="90"/>

Loading…
Cancel
Save