diff --git a/BBWY.Client/App.xaml b/BBWY.Client/App.xaml index 0b5c1eed..fe8e1f96 100644 --- a/BBWY.Client/App.xaml +++ b/BBWY.Client/App.xaml @@ -24,6 +24,8 @@ + + diff --git a/BBWY.Client/Converters/TaskStateToBooleanConvert.cs b/BBWY.Client/Converters/TaskStateToBooleanConvert.cs new file mode 100644 index 00000000..571f912a --- /dev/null +++ b/BBWY.Client/Converters/TaskStateToBooleanConvert.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows.Data; + +namespace BBWY.Client.Converters +{ + public class TaskStateToBooleanConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string[] parray = parameter.ToString().ToLower().Split(':');//参数拆分 + string valueStr = value == null ? string.Empty : value.ToString().ToLower(); + string returnValue = string.Empty; + try + { + if (string.IsNullOrEmpty(valueStr)) + { + returnValue = parray[0].Contains("#null") ? parray[1] : parray[2]; + } + else if (parray[0].Contains("|")) + { + returnValue = parray[0].Split('|').Contains(valueStr) ? parray[1] : parray[2]; + } + else + { + returnValue = parray[0].Equals(valueStr) ? parray[1] : parray[2]; + } + if (returnValue.Equals("#source", StringComparison.CurrentCultureIgnoreCase)) + return value; + return returnValue; + } + catch (Exception ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"ObjectConverter {ex.Message} {parameter}"); + Console.ResetColor(); + } + return parray[2]; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + var returnValue = "otherValue"; + string[] parray = parameter.ToString().ToLower().Split(':'); + if (value == null) + return returnValue; + var valueStr = value.ToString().ToLower(); + if (valueStr != parray[1]) + return returnValue; + else + { + var resData = parray[0].Contains('|') ? parray[0].Split('|')[0] : parray[0]; + if (resData == "#null") + { + return null; + } + return resData; + } + + } + } +} diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index b1901f46..0038ddfd 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10134"; + ClientVersion = "10135"; } private User user; diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index d8df6827..1e1c5dea 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -123,13 +123,13 @@ namespace BBWY.Client.ViewModels.PackTask private string searchSkuId; public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } - public TaskState? taskState; + private TaskState? taskState; /// /// 任务状态 /// public TaskState? TaskState { - get => taskState; private set + get => taskState; set { Set(ref taskState, value); } @@ -578,7 +578,7 @@ namespace BBWY.Client.ViewModels.PackTask } else { - MessageBox.Show("查不到数据"); + if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } IsLoadCount(); diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 479ece99..9f917b6b 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -121,13 +121,13 @@ namespace BBWY.Client.ViewModels.PackTask private string searchSkuId; public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } - public TaskState? taskState; + private TaskState? taskState; /// /// 任务状态 /// public TaskState? TaskState { - get => taskState; private set + get => taskState; set { Set(ref taskState, value); } @@ -266,6 +266,7 @@ namespace BBWY.Client.ViewModels.PackTask IsLoading = false; SetTaskStatusCommand = new RelayCommand(SetTaskStatus); + TaskState = null; //加载数据 SetTaskState(null); @@ -277,15 +278,15 @@ namespace BBWY.Client.ViewModels.PackTask CompeteFallWareCommand = new RelayCommand(CompeteFallWare); SealBoxConfigureType = SealBoxConfigureType.待配置; PositionState = PositionState.待落仓; - SetSealBoxConfigureTypeCommand = new RelayCommand(s => - { - PageIndex = 1; - SealBoxConfigureType = s; - PositionState = s == SealBoxConfigureType.已配置 ? PositionState.已配置待落仓 : PositionState.待落仓; - Task.Factory.StartNew(() => SearchTaskList()); - }); + SetSealBoxConfigureTypeCommand = new RelayCommand(s => + { + PageIndex = 1; + SealBoxConfigureType = s; + PositionState = s == SealBoxConfigureType.已配置 ? PositionState.已配置待落仓 : PositionState.待落仓; + Task.Factory.StartNew(() => SearchTaskList()); + }); + - LookBoxConfigureCommand = new RelayCommand(LookBoxConfigure); @@ -303,10 +304,10 @@ namespace BBWY.Client.ViewModels.PackTask MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.Yes) return; - var res = packTaskService.StoreGetBySelf(packTaskmodel.TaskId); + var res = packTaskService.StoreGetBySelf(packTaskmodel.TaskId); if (!res.Success) { - System.Windows.MessageBox.Show(res.Msg,"错误信息"); + System.Windows.MessageBox.Show(res.Msg, "错误信息"); return; } Task.Factory.StartNew(() => SearchTaskList()); @@ -320,7 +321,7 @@ namespace BBWY.Client.ViewModels.PackTask // System.Windows.MessageBox.Show($"暂不支持删除采购组的任务,如要删除,请到采购列表取消订单:{packTaskmodel.OrderId}"); // return; //} - MessageBoxResult result =System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskId}?", "提示", + MessageBoxResult result = System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskId}?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.Yes) return; @@ -350,13 +351,13 @@ namespace BBWY.Client.ViewModels.PackTask }; if (fallware.WareType == WareType.京仓) { - //加载模板数据 + //加载模板数据 } if (fallware.WareType == WareType.云仓) { - + } - //打印 + //打印 } private void LookBoxConfigure(object obj) @@ -404,11 +405,11 @@ namespace BBWY.Client.ViewModels.PackTask var model = obj as WaitFallWareModel; var res = sealBoxService.WareCompeteFallWare(model.SealBoxId); - if (res != null&&res.Success) + if (res != null && res.Success) { - ReflashTask();return; + ReflashTask(); return; } - if (res==null) + if (res == null) { System.Windows.MessageBox.Show("网络异常"); return; @@ -422,7 +423,7 @@ namespace BBWY.Client.ViewModels.PackTask var model = (SealBoxModel)obj; if (model.SealBoxSkus.Any(s => s.TaskState == Models.TaskState.待质检 || s.TaskState == Models.TaskState.待打包)) { - System.Windows.MessageBox.Show("无法封箱,存在未封箱的任务"); + System.Windows.MessageBox.Show("无法封箱,存在未打包完成的任务"); return; } @@ -480,7 +481,7 @@ namespace BBWY.Client.ViewModels.PackTask /// 设置分箱数量 /// public ICommand SetSealBoxCommand { get; set; } - + /// /// 打印封箱数据 @@ -629,7 +630,7 @@ namespace BBWY.Client.ViewModels.PackTask if (TaskState == Models.TaskState.待落仓) Task.Factory.StartNew(() => { - + WaitFallWareList = new ObservableCollection(); var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); @@ -652,9 +653,9 @@ namespace BBWY.Client.ViewModels.PackTask WareName = item.WareName, SealBoxCount = item.SealBoxCount, SealBoxId = item.SealBoxId, - BoxConfigureData = item.BoxConfigureData, - ProductCount = item.ProductCount, - WareType = item.WareType, + BoxConfigureData = item.BoxConfigureData, + ProductCount = item.ProductCount, + WareType = item.WareType, }); })); @@ -667,17 +668,16 @@ namespace BBWY.Client.ViewModels.PackTask } IsLoadCount(); IsLoadFallWareCount(); - IsLoading = false; + IsLoading = false; }); else if (TaskState == Models.TaskState.待封箱) Task.Factory.StartNew(() => { + //var randNum = new Random().Next(81, 90); + var randNum = 90; - - var randNum = new Random().Next(81, 90); - - if(SealBoxConfigureType== SealBoxConfigureType.已配置) + if (SealBoxConfigureType == SealBoxConfigureType.已配置) { WaitSealBoxModels = new ObservableCollection(); @@ -730,7 +730,7 @@ namespace BBWY.Client.ViewModels.PackTask App.Current.Dispatcher.BeginInvoke(new Action(() => { - WareNoSealBoxModels.Add(new WareNoSealBoxModel + WareNoSealBoxModels.Add(new WareNoSealBoxModel { AcceptUserName = string.Join("|", item.AcceptUserNames), DepartmentName = item.DepartmentName, @@ -742,7 +742,7 @@ namespace BBWY.Client.ViewModels.PackTask }).ToList(), ShopId = item.ShopId, ShopName = item.ShopName, - + }); })); diff --git a/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml index 255e8c8b..eea48f3a 100644 --- a/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml +++ b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml @@ -95,9 +95,15 @@ + + + @@ -137,7 +143,7 @@ Cursor="Hand"> - + @@ -152,7 +158,7 @@ @@ -173,7 +179,7 @@ @@ -214,7 +220,7 @@ - + diff --git a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml index 91578a32..f3e85233 100644 --- a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml +++ b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml @@ -90,9 +90,16 @@ + + + + @@ -130,7 +137,7 @@ Cursor="Hand"> - + @@ -145,7 +152,7 @@ @@ -166,7 +173,7 @@ @@ -201,7 +208,7 @@ - + diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml index d6e718b2..acf9c0e9 100644 --- a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml +++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml @@ -89,22 +89,26 @@ - + + + + - - + + - + - + - + - + - + - + - + - - - + + + +