diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs index 3577158a..57b8638d 100644 --- a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs @@ -4,16 +4,18 @@ using System.Text; namespace BBWY.Client.Models.APIModel { - public class GetWareWaitTransportResponse + public class GetWareWaitTransportResponse : NotifyObject { /// <summary> /// 数量 /// </summary> 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; @@ -60,11 +62,14 @@ namespace BBWY.Client.Models.APIModel /// </summary> public string AcceptUserNames { get; set; } - /// <summary> /// sku列表 /// </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 { diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index fe4798ba..0858d256 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -25,6 +25,7 @@ using System.Diagnostics.Eventing.Reader; using BBWY.Client.Models.SealBox; using Newtonsoft.Json; using System.Diagnostics; +using BBWY.Client.Extensions; namespace BBWY.Client.ViewModels.PackTask { @@ -308,12 +309,18 @@ namespace BBWY.Client.ViewModels.PackTask /// 待完结列表 /// </summary> public ObservableCollection<WareWaitCompleted> WaitCompletedList { get => waitCompletedList; set { Set(ref waitCompletedList, value); } } + + private ObservableCollection<WareWaitTransport> waitTransportList; /// <summary> /// 待转运列表 /// </summary> public ObservableCollection<WareWaitTransport> WaitTransportList { get => waitTransportList; set { Set(ref waitTransportList, value); } } + public List<WareWaitTransport> WareWaitTransports { get; set; } + + + private ObservableCollection<WaitFallWareModel> waitFallWareList; /// <summary> /// 待落仓列表 @@ -662,8 +669,25 @@ namespace BBWY.Client.ViewModels.PackTask LoadSealBoxSkuDataCommand = new RelayCommand<SealBoxModel>(LoadSealBoxSkuData); 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) { if (model.SealBoxSkus == null || model.SealBoxSkus.Count <= 0) @@ -1026,7 +1050,7 @@ namespace BBWY.Client.ViewModels.PackTask JDWareBoxModel model = new JDWareBoxModel { - ShopName = globalContext.User.Shop.ShopName, + ShopName = fallware.ShopName, WareName = fallware.WareName, SealBoxId = fallware.SealBoxId, ProductCount = fallware.ProductCount, @@ -1220,6 +1244,11 @@ namespace BBWY.Client.ViewModels.PackTask /// </summary> public ICommand LoadFallWareSkuDataCommand { get; set; } + /// <summary> + /// 转运 + /// </summary> + public ICommand LoadTransportSkuDataCommand { get; set; } + /// <summary> /// 完成封箱 /// </summary> @@ -1438,7 +1467,7 @@ namespace BBWY.Client.ViewModels.PackTask } else if (TaskState == Models.TaskState.待转运) { - + PageSize = 20; WaitTransportList = new ObservableCollection<WareWaitTransport>(); var datas = sealBoxService.GetWareWaitTransportList(SelectWareType, PageSize, PageIndex); @@ -1446,11 +1475,15 @@ namespace BBWY.Client.ViewModels.PackTask { var dataModel = datas.Data; OrderCount = dataModel.TotalCount; + WareWaitTransports = dataModel.WareWaitTransports; foreach (var item in dataModel.WareWaitTransports) { + + var skuItem = item.Copy(); + skuItem.WaitTransportSkus = null;//默认不加载 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.待落仓) { - + PageSize = 20; WaitFallWareList = new ObservableCollection<WaitFallWareModel>(); 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.待封箱) { - + PageSize = 20; if (SealBoxConfigureType == SealBoxConfigureType.已配置) { WaitSealBoxModels = new ObservableCollection<SealBoxModel>(); @@ -1699,12 +1732,8 @@ namespace BBWY.Client.ViewModels.PackTask else { PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据 - - var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName, PageIndex, PageSize, SearchSkuTitle, SearchSpuTitle); - - stopwatch.Stop(); App.Current.Dispatcher.BeginInvoke(new Action(() => { diff --git a/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml b/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml index 7f973ade..94ae4607 100644 --- a/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml +++ b/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml @@ -77,10 +77,10 @@ <ListBox.ItemTemplate> <DataTemplate> <Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}" - MinHeight="100"> + > <Grid.RowDefinitions> <RowDefinition Height="30"/> - <RowDefinition MinHeight="90"/> + <RowDefinition /> </Grid.RowDefinitions> <Grid Background="#F2F2F2" > <Grid.ColumnDefinitions> @@ -119,10 +119,21 @@ <TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="{Binding AcceptUserNames}" Margin="5,0,0,0" /> + + </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.Row="1"> + <Grid Grid.Row="1" Visibility="{Binding WaitTransportSkus,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="400"/> <ColumnDefinition Width="80"/> @@ -133,11 +144,11 @@ </Grid.ColumnDefinitions> <ListBox x:Name="listbox_orerSku" ItemsSource="{Binding WaitTransportSkus}" - Style="{StaticResource NoScrollViewListBoxStyle}" + Style="{StaticResource NoScrollViewListBoxStyle}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" > <ListBox.ItemTemplate> <DataTemplate> - <Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_orerSku}"> + <Grid Width="{Binding ActualWidth,ElementName=listbox_orerSku}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="90"/>