diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index 832638f2..80a670c9 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -32,13 +32,14 @@ namespace BBWY.Client.APIServices TaskState? TaskState = null, int pageIndex = 1, int pageSize = 10 - + ) { return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { + orderSn, spuId, skuId, @@ -55,12 +56,16 @@ namespace BBWY.Client.APIServices TaskState? TaskState = null, string ShopName = null, int pageIndex = 1, - int pageSize = 10 + int pageSize = 10, + string SkuTitle = null, + string SpuTitle = null ) { return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { + SkuTitle, + SpuTitle, DepartmentName = departmentName, SkuId = skuId, TaskId = taskId, diff --git a/BBWY.Client/APIServices/QiKu/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs index c288ba6a..ded38c51 100644 --- a/BBWY.Client/APIServices/QiKu/SealBoxService.cs +++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs @@ -28,8 +28,8 @@ namespace BBWY.Client.APIServices { ShopId = globalContext.User.Shop.ShopId.ToString(), - TaskId = TaskId, - SkuId = SkuId, + TaskId, + SkuId, SpuId, PageSize, PageIndex, @@ -72,9 +72,9 @@ namespace BBWY.Client.APIServices } - public ApiResponse GetUpdateSealBoxConfigured(long SealBoxId, long[] TaskIds) + public ApiResponse GetUpdateSealBoxConfiguredV2(long SealBoxId, long[] TaskIds) { - return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfigured", + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfiguredV2", new { SealBoxId, diff --git a/BBWY.Client/BBWYAppSettings.json b/BBWY.Client/BBWYAppSettings.json index 9622efaf..ef760e08 100644 --- a/BBWY.Client/BBWYAppSettings.json +++ b/BBWY.Client/BBWYAppSettings.json @@ -4,6 +4,6 @@ "MDSApiHost": "http://mdsapi.qiyue666.com", "JOSApiHost": "", "1688ApiHost": "", - //"QKApiHost": "http://localhost:8080" + // "QKApiHost": "http://localhost:8080" "QKApiHost": "http://qiku.qiyue666.com" } \ No newline at end of file diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index 8fa55316..bf8f6134 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 = "10159"; + ClientVersion = "10160"; } private User user; diff --git a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs index 39369161..6f572728 100644 --- a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs +++ b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs @@ -33,7 +33,7 @@ namespace BBWY.Client.Models public ObservableCollection WorryList { get => worryList; set { Set(ref worryList, value); } } private ObservableCollection positionTypeList = new ObservableCollection { - "商家仓","云仓", "京仓","聚水潭齐越仓"}; + "商家仓","云仓", "京仓","聚水潭"}; public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } private ObservableCollection packTypeList = new ObservableCollection { diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs index 75bb1287..1f1b648d 100644 --- a/BBWY.Client/Models/Enums.cs +++ b/BBWY.Client/Models/Enums.cs @@ -266,7 +266,7 @@ 商家仓 = 0, 云仓 = 1, 京仓 = 2, - 聚水潭齐越仓 = 3 + 聚水潭 = 3 } /// /// 合格证包装位置 @@ -463,7 +463,7 @@ } public enum WareType { - 京仓 = 0, 云仓 = 1, 商家仓 = 2, 聚水潭齐越仓 = 3 + 京仓 = 0, 云仓 = 1, 商家仓 = 2, 聚水潭 = 3 } public enum FeesMode { diff --git a/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs index bf1b757a..b0a12b40 100644 --- a/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs +++ b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs @@ -2,36 +2,65 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; +using System.Windows; namespace BBWY.Client.Models.SealBox { + + /// + /// 待配置 + /// public class SealBoxConfigureModel : NotifyObject { - - /// /// skuid /// public string SkuId { get; set; } + + /// + /// sku标题 + /// + public string SkuName { get; set; } /// /// 任务id /// public long TaskId { get; set; } + + /// + /// 任务状态 + /// + private TaskState? taskState; + /// + /// 任务状态 + /// + public TaskState? TaskState { get => taskState; set { Set(ref taskState, value); } } + + + private int skuCount; /// /// sku任务数 /// - public int SkuCount { get; set; } + public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } + + private int waitConfigureCount; /// - /// sku图片 + /// 待分配数量 /// - public string Logo { get; set; } + public int WaitConfigureCount + { + get + { + return waitConfigureCount; + } + set { Set(ref waitConfigureCount, value); } + } - private int splitCount; /// - /// 份数 + /// sku图片 /// - public int SplitCount { get=>splitCount; set {Set(ref splitCount,value); } } + public string Logo { get; set; } + private ObservableCollection wareHourseDatas = new ObservableCollection(); /// @@ -39,19 +68,48 @@ namespace BBWY.Client.Models.SealBox /// public ObservableCollection WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } } + + private WareType? wareType; + + public WareType? WareType { get => wareType; set { Set(ref wareType, value); } } } + + + + + + /// /// 封箱配置 装箱配置 /// public class SealBoxConfigureWareHourseModel : NotifyObject { - private int index; + public long TaskId { get; set; } - public int Index { get => index; set { Set(ref index, value); } } + public Action TotalWareCount { get; set; } private int count; - public int Count { get=>count; set {Set(ref count,value); } } + public int Count + { + get => count; set + { + Set(ref count, value); + OnCountChanged(); + } + } + + private void OnCountChanged() + { + + if (Count<0) + { + MessageBox.Show("数量不能为负数"); + return; + } + + if (TotalWareCount != null) TotalWareCount(Count, TaskId); + } private string wareId; @@ -63,21 +121,21 @@ namespace BBWY.Client.Models.SealBox public string WareName { get => wareName; set { Set(ref wareName, value); } } - private WareType? wareType; - - public WareType? WareType { get => wareType; set { Set(ref wareType, value); } } + private PositionState? wareState; /// - ///待封箱 = 0, 待落仓 = 1, 待完结 = 2 + ///待封箱 = 0, 待落仓 = 1, 待落仓已配置 = 2,待完结=3 /// - public PositionState? WareState { get; set; } + public PositionState? WareState { get => wareState; set { Set(ref wareState, value); } } /// ///封箱id /// public long? SealBoxId { get; set; } + //private WareType? wareType; + //public WareType? WareType { get => wareType; set { Set(ref wareType, value); } } } } diff --git a/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs b/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs index 0508740c..0e1db8a5 100644 --- a/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs +++ b/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs @@ -27,15 +27,13 @@ namespace BBWY.Client.Models /// public string Logo { get; set; } /// - /// 预计完成时间 - /// - public DateTime? PreCompletedTime { get; set; } - /// /// 任务状态 /// public TaskState? TaskState { get; set; } public string BrandName { get; set; } + public WareType? WareType { get; set; } + } } diff --git a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs index 702a2460..ebf37214 100644 --- a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs @@ -35,7 +35,7 @@ namespace BBWY.Client.ViewModels.PackTask public ObservableCollection WorryList { get => worryList; set { Set(ref worryList, value); } } private ObservableCollection positionTypeList = new ObservableCollection { - "商家仓","云仓", "京仓","聚水潭齐越仓"}; + "商家仓","云仓", "京仓","聚水潭"}; public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } private ObservableCollection packTypeList = new ObservableCollection { diff --git a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs index 1acce909..da00bf51 100644 --- a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs @@ -42,7 +42,7 @@ namespace BBWY.Client.ViewModels.PackTask public ObservableCollection WorryList { get => worryList; set { Set(ref worryList, value); } } private ObservableCollection positionTypeList = new ObservableCollection { - "商家仓","云仓", "京仓","聚水潭齐越仓"}; + "商家仓","云仓", "京仓","聚水潭"}; public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } private ObservableCollection packTypeList = new ObservableCollection { @@ -145,7 +145,7 @@ namespace BBWY.Client.ViewModels.PackTask private PositionType positionType; /// - /// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭齐越仓=3) + /// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3) /// public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index 2ed12c94..ea9b28cc 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -309,20 +309,9 @@ namespace BBWY.Client.ViewModels.PackTask WaybillNo = fallware.WaybillNo }; - //if (fallware.WareType== WareType.京仓) - //{ - - //SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask); - //window.Show(); var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask, fallware.TransportOverTime); w.ShowDialog(); - //} - //if (fallware.WareType == WareType.云仓) - //{ - // SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType.Value, ReflashTask); - // window.Show(); - //} } private void UpdateSealBoxConfigured(SealBoxConfiguredModel model) @@ -330,7 +319,7 @@ namespace BBWY.Client.ViewModels.PackTask var sealBoxId = model.SealBoxId; var taskIds = model.SealBoxConfigureTasks.Select(s => s.TaskId).ToArray(); - var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(sealBoxId, taskIds); + var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfiguredV2(sealBoxId, taskIds); if (updateSealBoxConfig == null) { MessageBox.Show("网络异常,获取不到带封箱数据"); @@ -342,10 +331,10 @@ namespace BBWY.Client.ViewModels.PackTask return; } + SetSealBoxPolicyWindow setSealBoxPolicyWindow = new SetSealBoxPolicyWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId); + setSealBoxPolicyWindow.ShowDialog(); - SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId); - sealBoxConfigureWindow.ShowDialog(); } private void ConfiguredSealBox() @@ -366,24 +355,32 @@ namespace BBWY.Client.ViewModels.PackTask MessageBox.Show("已全部封箱!"); return; } - var taskIds = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(w => w.TaskId).ToArray(); + //var taskIds = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(w => w.TaskId).ToArray(); - var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(0, taskIds); - if (updateSealBoxConfig == null) - { - MessageBox.Show("网络异常,获取不到带封箱数据"); - return; - } - if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null) - { - MessageBox.Show(updateSealBoxConfig.Msg); - return; - } - SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, 0); - sealBoxConfigureWindow.ShowDialog(); + //var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(0, taskIds); + //if (updateSealBoxConfig == null) + //{ + // MessageBox.Show("网络异常,获取不到带封箱数据"); + // return; + //} + //if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null) + //{ + // MessageBox.Show(updateSealBoxConfig.Msg); + // return; + //} + + //SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, 0); + //sealBoxConfigureWindow.ShowDialog(); + var data = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(x => new SealBoxConfigureModel { + Logo = x.Logo, + WareType = x.WareType, SkuCount = x.SkuCount , SkuId = x.SkuId, SkuName = x.SkuName, TaskId = x.TaskId, TaskState =x.TaskState, + WaitConfigureCount= x.SkuCount, + } ).ToList(); + SetSealBoxPolicyWindow setSealBoxPolicyWindow = new SetSealBoxPolicyWindow(data, ReflashTask, 0); + setSealBoxPolicyWindow.ShowDialog(); } private void DeletedTask(object obj) diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 2c0f8e2f..18295996 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -38,6 +38,13 @@ namespace BBWY.Client.ViewModels.PackTask //public RelayCommand SelectCmd => new RelayCommand(str => Growl.Info(str)); #region 属性绑定 + private ObservableCollection selectTitleList = new ObservableCollection { + "SKU名称","标题" + }; + + public ObservableCollection SelectTitleList { get => selectTitleList; set { Set(ref selectTitleList, value); } } + + private ObservableCollection selectExpressList = new ObservableCollection { "物流单号","物流公司名称" @@ -62,8 +69,39 @@ namespace BBWY.Client.ViewModels.PackTask }; public ObservableCollection SelectShopList { get => selectShopList; set { Set(ref selectShopList, value); } } + /// - /// 查询物流 + /// 查询名称 + /// + private string selectTitle = "SKU名称"; + public string SelectTitle + { + get => selectTitle; + + + set + { + Set(ref selectTitle, value); + + OnSelectTitleChanged(SelectTitle); + } + } + + private void OnSelectTitleChanged(string SelectTitle) + { + if (SelectTitle == "SKU名称") + { + SearchSpuTitle = null; + } + if (SelectTitle == "标题") + { + SearchSkuTitle = null; + } + + } + + /// + /// 查询店铺 /// private string selectShop = "店铺"; public string SelectShop @@ -477,6 +515,28 @@ namespace BBWY.Client.ViewModels.PackTask } } + + + public string searchSpuTitle; + public string SearchSpuTitle + { + get => searchSpuTitle; set + { + Set(ref searchSpuTitle, value); + + } + } + + public string searchSkuTitle; + public string SearchSkuTitle + { + get => searchSkuTitle; set + { + Set(ref searchSkuTitle, value); + + } + } + private SealBoxConfigureType sealBoxConfigureType; /// /// 封箱配置状态 @@ -882,7 +942,7 @@ namespace BBWY.Client.ViewModels.PackTask //var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType, ReflashTask, false); //w.ShowDialog(); } - if (fallware.WareType == WareType.云仓 || fallware.WareType == WareType.聚水潭齐越仓) + if (fallware.WareType == WareType.云仓 || fallware.WareType == WareType.聚水潭) { SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, fallware.WareType); window.ShowDialog(); @@ -1151,6 +1211,14 @@ namespace BBWY.Client.ViewModels.PackTask public void SetTaskState(TaskState? taskState) { + if (!(TaskState== Models.TaskState.未到货&&TaskState== Models.TaskState.待验收)) + { + SearchSkuTitle = ""; + SearchSpuTitle = ""; + } + + + TaskState = taskState; if (PageIndex == 1) @@ -1486,7 +1554,7 @@ namespace BBWY.Client.ViewModels.PackTask PackTaskList = new ObservableCollection();//初始化数据 var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName, - PageIndex, PageSize); + PageIndex, PageSize,SearchSkuTitle,SearchSpuTitle); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs index 12a4b4a8..3449aee4 100644 --- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs +++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs @@ -31,18 +31,18 @@ namespace BBWY.Client.ViewModels #region 属性 - public int goodProductQuantity; - public int arrivalQuantity; + public int? goodProductQuantity; + public int? arrivalQuantity; /// /// 到货数量 /// - public int ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } } + public int? ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } } /// /// 良品数量 /// - public int GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } } + public int? GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } } ///// ///// 预计完成时间 @@ -65,7 +65,7 @@ namespace BBWY.Client.ViewModels public ObservableCollection WorryList { get => worryList; set { Set(ref worryList, value); } } private ObservableCollection positionTypeList = new ObservableCollection { - "商家仓","云仓", "京仓","聚水潭齐越仓"}; + "商家仓","云仓", "京仓","聚水潭"}; public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } private ObservableCollection packTypeList = new ObservableCollection { @@ -194,7 +194,7 @@ namespace BBWY.Client.ViewModels private PositionType positionType; /// - /// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭齐越仓=3) + /// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3) /// public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } @@ -395,6 +395,16 @@ namespace BBWY.Client.ViewModels #region 方法 private void CompeteQualityTask(object obj) { + if (ArrivalQuantity==null) + { + MessageBox.Show($"请输入到货数量"); + return; + } + if (GoodProductQuantity == null) + { + MessageBox.Show($"请输入良品数量"); + return; + } if (FloorDragNumber <= 0) { @@ -414,11 +424,15 @@ namespace BBWY.Client.ViewModels return; } + + + + var request = new Models.APIModel.Request.QualityTaskRequest { BasicPack = BasicPack, - ArrivalQuantity = ArrivalQuantity, - GoodProductQuantity = GoodProductQuantity, + ArrivalQuantity = ArrivalQuantity.Value, + GoodProductQuantity = GoodProductQuantity.Value, Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)), BrandName = BrandName, CertificatePosition = CertificatePosition, @@ -488,7 +502,7 @@ namespace BBWY.Client.ViewModels //{ // BarCodeModel.ShopName = OriginShopName; //} - batchPrint.SetData(GoodProductQuantity, + batchPrint.SetData(GoodProductQuantity.Value, PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() , BarCodeModel); batchPrint.ShowDialog(); @@ -653,8 +667,8 @@ namespace BBWY.Client.ViewModels SkuTitle = model.SkuTitle; BasicPack = model.BasicPack; CertificatePosition = model.CertificatePosition; - ArrivalQuantity = 0; - GoodProductQuantity = 0; + //ArrivalQuantity = 0; + //GoodProductQuantity = 0; IncreateList = new ObservableCollection(); string[] increateDatas = model.Increment1?.Split(','); diff --git a/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs index 651e4c8d..5271ce96 100644 --- a/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs +++ b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs @@ -5,89 +5,546 @@ using BBWY.Client.Models.APIModel; using BBWY.Client.Models.QiKu; using BBWY.Client.Models.SealBox; using BBWY.Client.Views.BatchPurchase; +using BBWY.Client.Views.SealBox; using BBWY.Controls; using GalaSoft.MvvmLight.Command; +using NPOI.SS.Formula.Functions; +using NPOI.Util; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; +using System.Threading.Tasks; using System.Windows; +using System.Windows.Documents; using System.Windows.Input; +using WebSocketSharp; namespace BBWY.Client.ViewModels.SealBox { public class SealBoxConfigureViewModel : BaseVM { private IList storeList;//仓库列表 - private LogisticsService logisticsService; + public LogisticsService logisticsService; private SealBoxService sealBoxService; private GlobalContext globalContext; - private ObservableCollection sealBoxConfigureModelList; + private WareType selectWareType = WareType.京仓; + public WareType SelectWareType { get => selectWareType; set { Set(ref selectWareType, value); } } + private string searchSkuId; + public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } + + private List sealBoxConfigureModelList; /// /// 分箱配置列表 /// - public ObservableCollection SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } } + public List SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } } + + private ObservableCollection jdConfigureModelList; + + /// + /// 京仓配置列表 + /// + public ObservableCollection JdConfigureModelList { get => jdConfigureModelList; set { Set(ref jdConfigureModelList, value); } } + + private ObservableCollection cloudConfigureModelList; + /// + /// 云仓配置列表 + /// + public ObservableCollection CloudConfigureModelList { get => cloudConfigureModelList; set { Set(ref cloudConfigureModelList, value); } } + + private ObservableCollection jstConfigureModelList; + /// + /// 聚水潭配置列表 + /// + public ObservableCollection JstConfigureModelList { get => jstConfigureModelList; set { Set(ref jstConfigureModelList, value); } } + + private ObservableCollection storeConfigureModelList; + /// + /// 商家仓配置列表 + /// + public ObservableCollection StoreConfigureModelList { get => storeConfigureModelList; set { Set(ref storeConfigureModelList, value); } } + + + private ObservableCollection jdWareHourseHeaderList; + /// + /// 京仓仓库配置头列表 + /// + public ObservableCollection JdWareHourseHeaderList { get => jdWareHourseHeaderList; set { Set(ref jdWareHourseHeaderList, value); } } + + private ObservableCollection cloudWareHourseHeaderList; + /// + /// 云仓仓库配置头列表 + /// + public ObservableCollection CloudWareHourseHeaderList { get => cloudWareHourseHeaderList; set { Set(ref cloudWareHourseHeaderList, value); } } + + private ObservableCollection jstWareHourseHeaderList; + /// + /// 聚水潭仓库配置头列表 + /// + public ObservableCollection JstWareHourseHeaderList { get => jstWareHourseHeaderList; set { Set(ref jstWareHourseHeaderList, value); } } + + private ObservableCollection storeWareHourseHeaderList; + /// + /// 商家仓仓库配置头列表 + /// + public ObservableCollection StoreWareHourseHeaderList { get => storeWareHourseHeaderList; set { Set(ref storeWareHourseHeaderList, value); } } + + + + + + + + + + public SealBoxConfigureViewModel(LogisticsService logisticsService, SealBoxService sealBoxService, GlobalContext globalContext) { this.logisticsService = logisticsService; this.sealBoxService = sealBoxService; - SetSplitCountCommand = new RelayCommand(SetSplitCount); SetPackCountAndStoreCommand = new RelayCommand(SetPackCountAndStore); SaveCommand = new RelayCommand(Save); - SealBoxConfigureModelList = new ObservableCollection(); + //SealBoxConfigureModelList = new ObservableCollection(); this.globalContext = globalContext; + + SelectWareTypeCommand = new RelayCommand(SearchSku); + + SearchSkuCommand = new RelayCommand(SearchSku); + AddWareCommand = new RelayCommand(AddWare); + + SpliteOtherWareCommand = new RelayCommand(SpliteOtherWare); + + BatchSetWareMaxCountCommand = new RelayCommand(BatchSetWareMaxCount); + + + SetWareMaxCountCommand = new RelayCommand(SetWareMaxCount); + } + + private void SetWareMaxCount(SealBoxConfigureWareHourseModel model) + { + SealBoxConfigureModelList.Where(s => s.WareType == SelectWareType && s.TaskId == model.TaskId) + .ForAll(s => + { + + s.WareHourseDatas?.ForAll(d => + { + if (d.WareId == model.WareId) + { + d.Count += s.WaitConfigureCount; + s.WaitConfigureCount = 0; + } + }); + + }); + } + + private void BatchSetWareMaxCount(string wareId) + { + SealBoxConfigureModelList.Where(s => s.WareType == SelectWareType) + .ForAll(s => + { + + s.WareHourseDatas?.ForAll(d => + { + if (d.WareId == wareId) + { + d.Count += s.WaitConfigureCount; + } + }); + + }); } private long sealBoxId; public long SealBoxId { get => sealBoxId; set { Set(ref sealBoxId, value); } } - public ICommand SetSplitCountCommand { get; set; } - public ICommand SetPackCountAndStoreCommand { get; set; } public ICommand SaveCommand { get; set; } - private void SetSplitCount(SealBoxConfigureModel sealBoxConfigureModel) - { - sealBoxConfigureModel.WareHourseDatas.Where(w => w.WareState == null || w.WareState == PositionState.待封箱).ToList().ForEach( - s => sealBoxConfigureModel.WareHourseDatas.Remove(s) + public ICommand SearchSkuCommand { get; set; } + + public ICommand AddWareCommand { get; set; } + + public ICommand SpliteOtherWareCommand { get; set; } + + public ICommand SelectWareTypeCommand { get; set; } - ); - var otherCount = sealBoxConfigureModel.WareHourseDatas.Count(); - if (sealBoxConfigureModel.SplitCount <= 0 || sealBoxConfigureModel.SplitCount < otherCount) + public ICommand BatchSetWareMaxCountCommand { get; set; } + + + public ICommand SetWareMaxCountCommand { get; set; } + + + private void SearchSku() + { + if (SearchSkuId.IsNullOrEmpty()) { - MessageBox.Show("份数不正确"); - return; + switch (SelectWareType) + { + case WareType.京仓: + JdConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.WareType == WareType.京仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + JdConfigureModelList.Add(s); + })); + }); + + break; + case WareType.云仓: + CloudConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.WareType == WareType.云仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + CloudConfigureModelList.Add(s); + })); + + }); + break; + case WareType.商家仓: + StoreConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.WareType == WareType.商家仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + StoreConfigureModelList.Add(s); + })); + + }); + break; + case WareType.聚水潭: + JstConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.WareType == WareType.聚水潭 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + JstConfigureModelList.Add(s); + })); + + }); + break; + default: + break; + } } + else + { + switch (SelectWareType) + { + case WareType.京仓: + JdConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType.京仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + JdConfigureModelList.Add(s); + })); + + }); + break; + case WareType.云仓: + CloudConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType.云仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + CloudConfigureModelList.Add(s); + })); + + }); + break; + case WareType.商家仓: + StoreConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType.商家仓 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + StoreConfigureModelList.Add(s); + })); + + }); + break; + case WareType.聚水潭: + JstConfigureModelList = new ObservableCollection(); + SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType.聚水潭 && s.SkuCount > 0).ForAll(s => + { + App.Current.Dispatcher.Invoke(new Action(() => + { + JstConfigureModelList.Add(s); + })); + + }); + break; + default: + break; + } - int resetIndex = 1; - foreach (var item in sealBoxConfigureModel.WareHourseDatas) + } + + + + switch (SelectWareType)//加载动态仓库头 { - item.Index = resetIndex; - resetIndex++; + case WareType.京仓: + if (JdConfigureModelList.Count > 0 && JdConfigureModelList[0].WareHourseDatas?.Count > 0) + { + JdWareHourseHeaderList = JdConfigureModelList[0].WareHourseDatas; + } + else + { + JdWareHourseHeaderList = new ObservableCollection(); + } + break; + case WareType.云仓: + if (CloudConfigureModelList.Count > 0 && CloudConfigureModelList[0].WareHourseDatas?.Count > 0) + { + CloudWareHourseHeaderList = CloudConfigureModelList[0].WareHourseDatas; + } + else + { + CloudWareHourseHeaderList = new ObservableCollection(); + } + break; + case WareType.商家仓: + if (StoreConfigureModelList.Count > 0 && StoreConfigureModelList[0].WareHourseDatas?.Count > 0) + { + StoreWareHourseHeaderList = StoreConfigureModelList[0].WareHourseDatas; + } + else + { + StoreWareHourseHeaderList = new ObservableCollection(); + } + break; + case WareType.聚水潭: + if (JstConfigureModelList.Count > 0 && JstConfigureModelList[0].WareHourseDatas?.Count > 0) + { + JstWareHourseHeaderList = JstConfigureModelList[0].WareHourseDatas; + } + else + { + JstWareHourseHeaderList = new ObservableCollection(); + } + break; + default: + break; } - for (var i = 1 + otherCount; i <= sealBoxConfigureModel.SplitCount; i++) + + + + + } + private void AddWare() + { + AddWareListWindow addWareListWindow = new AddWareListWindow(SelectWareType, logisticsService, SealBoxConfigureModelList); + addWareListWindow.AddWareList = AddWareList; + addWareListWindow.ShowDialog(); + } + + void AddWareList(WareType wareType, List storeWares) + { + + var oldList = sealBoxConfigureModelList.Where(s => s.WareType == wareType).SelectMany(s => s.WareHourseDatas).Select(w => w.WareId).Distinct().ToList();//原ids + var newList = storeWares.Select(s => s.WareId).Distinct().ToList(); + var addList = newList.Except(oldList).ToList(); + var deletedList = oldList.Except(newList).ToList(); + + + + + sealBoxConfigureModelList.Where(s => s.WareType == wareType).ForAll(s => { - sealBoxConfigureModel.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel() + + if (s.WareHourseDatas == null) + s.WareHourseDatas = new ObservableCollection { }; + + foreach (var item in addList) { - Index = i, - Count = 0 + s.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel + { + Count = 0, + SealBoxId = null, + WareId = item, + WareName = storeWares.FirstOrDefault(f => f.WareId == item)?.WareName, + TotalWareCount = TotalCount, + TaskId = s.TaskId + }); + } + + foreach (var item in deletedList) + { + var deletedCount = s.WareHourseDatas.Where(w => w.WareId == item).Select(w => w.Count).Sum(); + s.WaitConfigureCount += deletedCount; + + ObservableCollection d = new ObservableCollection(); + + foreach (var WareHourseData in s.WareHourseDatas) + { + if (item == WareHourseData.WareId) + continue; + d.Add(WareHourseData); + } + s.WareHourseDatas = d; + } + + + }); + SearchSku(); + } + + /// + /// + /// + /// + /// + public void TotalCount(int count, long taskId) + { + + var totalSkuItemCount = sealBoxConfigureModelList.Where(s => s.TaskId == taskId && s.WareType == SelectWareType).SelectMany(s => s.WareHourseDatas).Sum(s => s.Count); + + + + sealBoxConfigureModelList.Where(s => s.TaskId == taskId && s.WareType == SelectWareType).ForAll( + + s => + { + if (totalSkuItemCount > s.SkuCount) + { + MessageBox.Show($"总量超过可分配量,请重新分配,任务id:{s.TaskId}"); + } + s.WaitConfigureCount = s.SkuCount - totalSkuItemCount; }); + } + + + + + private void SpliteOtherWare(SealBoxConfigureModel model)// + { + if (model.WaitConfigureCount <= 0) + { + MessageBox.Show($"可分配量不足!当前可分配量:{model.WaitConfigureCount}", "提示"); + return; } + SplitOtherWareWindow splitOtherWareWindow = new SplitOtherWareWindow(model.WaitConfigureCount, SelectWareType, (count, waretype) => + { + model.WaitConfigureCount -= count; + model.SkuCount -= count; + + var type = SealBoxConfigureModelList.SingleOrDefault(s => s.TaskId == model.TaskId && s.WareType == waretype); + if (type != null) + { + type.SkuCount += count; + type.WaitConfigureCount += count; + } + else + { - } + var data = new SealBoxConfigureModel + { + Logo = model.Logo, + WareType = waretype, + SkuCount = count, + SkuId = model.SkuId, + SkuName = model.SkuName, + TaskId = model.TaskId, + TaskState = model.TaskState, + WaitConfigureCount = count, + }; + data.WareHourseDatas = new ObservableCollection(); + switch (waretype) + { + case WareType.京仓: + + if (JdWareHourseHeaderList != null) + foreach (var item in JdWareHourseHeaderList) + { + data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel + { + TaskId = model.TaskId, + SealBoxId = item.SealBoxId, + TotalWareCount = TotalCount, + WareId = item.WareId, + WareName = item.WareName, + //WareType = s.WareType, + WareState = item.WareState + }); + } + break; + case WareType.云仓: + if (CloudWareHourseHeaderList != null) + foreach (var item in CloudWareHourseHeaderList) + { + data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel + { + TaskId = model.TaskId, + SealBoxId = item.SealBoxId, + TotalWareCount = TotalCount, + WareId = item.WareId, + WareName = item.WareName, + //WareType = s.WareType, + WareState = item.WareState + }); + } + + break; + case WareType.商家仓: + if (StoreWareHourseHeaderList != null) + foreach (var item in StoreWareHourseHeaderList) + { + data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel + { + TaskId = model.TaskId, + SealBoxId = item.SealBoxId, + TotalWareCount = TotalCount, + WareId = item.WareId, + WareName = item.WareName, + //WareType = s.WareType, + WareState = item.WareState + }); + } + + break; + case WareType.聚水潭: + if (JstWareHourseHeaderList != null) + foreach (var item in JstWareHourseHeaderList) + { + data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel + { + TaskId = model.TaskId, + SealBoxId = item.SealBoxId, + TotalWareCount = TotalCount, + WareId = item.WareId, + WareName = item.WareName, + //WareType = s.WareType, + WareState = item.WareState + }); + } + + break; + default: + break; + } + SealBoxConfigureModelList.Add(data); + } + SearchSku(); + }); + splitOtherWareWindow.ShowDialog(); + } private StoreResponse store; private void SetPackCountAndStore(object obj) { @@ -110,27 +567,27 @@ namespace BBWY.Client.ViewModels.SealBox { Id = sealBoxConfigureWareHourseModel.WareId, Name = sealBoxConfigureWareHourseModel.WareName, - Type = ToStockType(sealBoxConfigureWareHourseModel.WareType), + //Type = ToStockType(sealBoxConfigureWareHourseModel.WareType), Status = StockStatus.使用 }; } - var w = new PackSkuSplitCountAndStoreWindow(sealBoxConfigureWareHourseModel.Count, store, storeList, sealBoxConfigureWareHourseModel.WareType == WareType.聚水潭齐越仓); - if (w.ShowDialog() == true) - { - store = w.Store; - sealBoxConfigureWareHourseModel.Count = w.Quantity; - IsJST = w.IsJST; - sealBoxConfigureWareHourseModel.WareType = w.IsJST ? WareType.聚水潭齐越仓 : ToWareType(w.Store.Type); - sealBoxConfigureWareHourseModel.WareId = w.IsJST ? "qiyuejushuitan" : w.Store.Id; - sealBoxConfigureWareHourseModel.WareName = w.IsJST ? "齐越聚水潭" : w.Store.Name; + //var w = new PackSkuSplitCountAndStoreWindow(sealBoxConfigureWareHourseModel.Count, store, storeList, sealBoxConfigureWareHourseModel.WareType == WareType.聚水潭); + //if (w.ShowDialog() == true) + //{ + // store = w.Store; + // sealBoxConfigureWareHourseModel.Count = w.Quantity; + // IsJST = w.IsJST; + // // sealBoxConfigureWareHourseModel.WareType = w.IsJST ? WareType.聚水潭 : ToWareType(w.Store.Type); + // sealBoxConfigureWareHourseModel.WareId = w.IsJST ? "qiyuejushuitan" : w.Store.Id; + // sealBoxConfigureWareHourseModel.WareName = w.IsJST ? "齐越聚水潭" : w.Store.Name; - } + //} } /// @@ -138,46 +595,68 @@ namespace BBWY.Client.ViewModels.SealBox /// public bool IsJST { get; set; } - private WareType ToWareType(StockType stockType) - { - switch (stockType) - { - case StockType.商家仓: - return WareType.商家仓; - break; - case StockType.京仓: - return WareType.京仓; - break; - case StockType.云仓: - return WareType.云仓; - break; - default: - break; - } - return WareType.聚水潭齐越仓; - } - - private StockType ToStockType(WareType? wareType) - { - switch (wareType) - { - case WareType.京仓: - return StockType.京仓; - break; - case WareType.云仓: - return StockType.云仓; - break; - case WareType.商家仓: - return StockType.商家仓; - break; - case WareType.聚水潭齐越仓: - break; - default: - break; - } - - return StockType.京仓; - } + //private PositionType ToPositionType(WareType wareType) + //{ + // switch (wareType) + // { + // case WareType.京仓: + // return PositionType.京仓; + // break; + // case WareType.云仓: + // return PositionType.云仓; + // break; + // case WareType.商家仓: + // return PositionType.商家仓; + // break; + // case WareType.聚水潭: + // return PositionType.聚水潭; + // break; + // default: + // break; + // } + // return PositionType.聚水潭; + //} + + //private WareType ToWareType(StockType stockType) + //{ + // switch (stockType) + // { + // case StockType.商家仓: + // return WareType.商家仓; + // break; + // case StockType.京仓: + // return WareType.京仓; + // break; + // case StockType.云仓: + // return WareType.云仓; + // break; + // default: + // break; + // } + // return WareType.聚水潭; + //} + + //private StockType ToStockType(WareType? wareType) + //{ + // switch (wareType) + // { + // case WareType.京仓: + // return StockType.京仓; + // break; + // case WareType.云仓: + // return StockType.云仓; + // break; + // case WareType.商家仓: + // return StockType.商家仓; + // break; + // case WareType.聚水潭: + // break; + // default: + // break; + // } + + // return StockType.京仓; + //} private void Save(object obj) { @@ -187,36 +666,24 @@ namespace BBWY.Client.ViewModels.SealBox SetSealBoxConfiguredRequest setSealBoxConfiguredRequest = new SetSealBoxConfiguredRequest(); setSealBoxConfiguredRequest.ShopId = globalContext.User.Shop.ShopId.ToString(); IList SetSealBoxConfiguredDatas = new List(); + foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) { - if (sealBoxConfigureModel.WareHourseDatas==null|| !sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count>0)) + if (sealBoxConfigureModel.WareHourseDatas == null || !sealBoxConfigureModel.WareHourseDatas.Any(w => w.Count > 0))//未配置 { continue; } - - - //判断存在0的报错 - - if (sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count==0)) + if (sealBoxConfigureModel.WaitConfigureCount != 0) { - System.Windows.MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在未配置的数据"); + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); return; } - - - ////todo: 到分箱界面判断 - //if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count()) - //{ - // MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!"); - // return; - //} - //判断任务数量与分箱数量总和是否相等 - if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) + if (SealBoxConfigureModelList.Where(s => s.TaskId == sealBoxConfigureModel.TaskId).Any(s => s.WaitConfigureCount != 0)) { - MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在部分落仓 未设置数据"); return; } SetSealBoxConfiguredDatas.Add(new SetSealBoxConfiguredData @@ -229,7 +696,7 @@ namespace BBWY.Client.ViewModels.SealBox Count = x.Count, WareId = x.WareId, WareName = x.WareName, - WareType = x.WareType.Value, + WareType = sealBoxConfigureModel.WareType.Value, }).ToList(), }); } @@ -246,7 +713,7 @@ namespace BBWY.Client.ViewModels.SealBox return; } if (ReflashWindow != null) ReflashWindow(); - + var window = obj as BWindow; window.Close(); } @@ -264,32 +731,30 @@ namespace BBWY.Client.ViewModels.SealBox IList UpdateSealBoxConfiguredDatas = new List(); foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) { - - ////todo: 到分箱界面判断 - //if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count()) - //{ - // MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!"); - // return; - //} - //判断任务数量与分箱数量总和是否相等 - if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) + if (sealBoxConfigureModel.WaitConfigureCount != 0) { - MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} 中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); return; } + if (SealBoxConfigureModelList.Where(s => s.TaskId == sealBoxConfigureModel.TaskId).Any(s => s.WaitConfigureCount != 0)) + { + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在部分落仓 未设置数据"); + return; + } + UpdateSealBoxConfiguredDatas.Add(new UpdateSealBoxConfiguredDataRequest { TaskId = sealBoxConfigureModel.TaskId, SkuCount = sealBoxConfigureModel.SkuCount, - SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Select(x => new SealBoxConfiguredWareHourseRequest + SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Where(w => w.Count > 0).Select(x => new SealBoxConfiguredWareHourseRequest { Count = x.Count, WareId = x.WareId, WareName = x.WareName, - WareType = x.WareType.Value, + WareType = sealBoxConfigureModel.WareType.Value, WareState = x.WareState, - SealBoxId=x.SealBoxId + SealBoxId = x.SealBoxId }).ToList(), }); @@ -303,7 +768,7 @@ namespace BBWY.Client.ViewModels.SealBox MessageBox.Show("网络异常"); return; } - if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data) + if (!setSealBoxRes.Success || !setSealBoxRes.Data) { MessageBox.Show(setSealBoxRes.Msg); return; @@ -316,8 +781,7 @@ namespace BBWY.Client.ViewModels.SealBox } - - public Action ReflashWindow { get; set; } + public Action ReflashWindow { get; set; } } } diff --git a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml index f8db9edd..615de2f5 100644 --- a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml +++ b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml @@ -62,7 +62,7 @@ - { diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml index dc9755aa..55c1b65c 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml @@ -71,8 +71,8 @@ - diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs index 68c5aee7..301b73d7 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs @@ -76,7 +76,7 @@ namespace BBWY.Client.Views.FallWare break; case WareType.商家仓: break; - case WareType.聚水潭齐越仓: + case WareType.聚水潭: btn_yuncang.IsEnabled = false; btn_jingcang.IsEnabled = false; panel_jingcang.Visibility = Visibility.Collapsed; @@ -154,7 +154,7 @@ namespace BBWY.Client.Views.FallWare }); return; } - if (wareType == WareType.云仓|| wareType == WareType.聚水潭齐越仓) + if (wareType == WareType.云仓|| wareType == WareType.聚水潭) { if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty()) @@ -163,7 +163,7 @@ namespace BBWY.Client.Views.FallWare return; } - if (wareType == WareType.聚水潭齐越仓) + if (wareType == WareType.聚水潭) { if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty()) { diff --git a/BBWY.Client/Views/PackTask/CerControl.xaml b/BBWY.Client/Views/PackTask/CerControl.xaml index aabf219b..647f6066 100644 --- a/BBWY.Client/Views/PackTask/CerControl.xaml +++ b/BBWY.Client/Views/PackTask/CerControl.xaml @@ -24,9 +24,9 @@ - - - + + + @@ -37,8 +37,8 @@ - - + + @@ -62,8 +62,8 @@ - - + + @@ -74,8 +74,8 @@ - - + + @@ -96,8 +96,8 @@ - - + + @@ -108,8 +108,8 @@ - - + + @@ -137,8 +137,8 @@ - - + + @@ -149,8 +149,8 @@ - - + + diff --git a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml index 0ce797a9..bd67e769 100644 --- a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml +++ b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml @@ -466,7 +466,7 @@ + CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBox}}, Path=ItemsSource}" Content="删除" Grid.Column="4"/> diff --git a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs index cdee28c0..d53bb815 100644 --- a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs +++ b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs @@ -40,14 +40,14 @@ namespace BBWY.Client.Views.PackTask var serviceViewModel = this.DataContext as PackDetailViewModel; if (model.Brand.IsNullOrEmpty()) { - if (!model.BarCodeModel.Brand.IsNullOrEmpty()) + if (model.BarCodeModel!=null&&!model.BarCodeModel.Brand.IsNullOrEmpty()) model.Brand = model.BarCodeModel.Brand; else if (model.CertificateModel != null && model.CertificateModel.Any(c => c.Brand != null)) model.Brand = model.CertificateModel.FirstOrDefault(c => c.Brand != null)?.Brand; } if (model.BrandName.IsNullOrEmpty()) { - if (!model.BarCodeModel.BrandName.IsNullOrEmpty()) + if (model.BarCodeModel != null && !model.BarCodeModel.BrandName.IsNullOrEmpty()) model.BrandName = model.BarCodeModel.BrandName; else if (model.CertificateModel != null && model.CertificateModel.Any(c => c.BrandName != null)) model.BrandName = model.CertificateModel.FirstOrDefault(c => c.BrandName != null)?.BrandName; diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml index 6b598faf..7b59ddbf 100644 --- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml @@ -146,6 +146,24 @@ + + + + + + + + + + + + - + @@ -591,7 +609,6 @@ - diff --git a/BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml b/BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml index 7dd7f3f8..9beb8a7e 100644 --- a/BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml +++ b/BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml @@ -111,37 +111,19 @@ Margin=" 5,0,7,0"/> - - - - - - - diff --git a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml index eb3d22d7..9681be26 100644 --- a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml +++ b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml @@ -2,9 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" - mc:Ignorable="d" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" Background="White" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:ctr="clr-namespace:BBWY.Client.Converters" xmlns:sys="clr-namespace:System;assembly=mscorlib" @@ -143,6 +142,22 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/AddWareListWindow.xaml.cs b/BBWY.Client/Views/SealBox/AddWareListWindow.xaml.cs new file mode 100644 index 00000000..3cc4aab8 --- /dev/null +++ b/BBWY.Client/Views/SealBox/AddWareListWindow.xaml.cs @@ -0,0 +1,163 @@ +using AutoMapper.Internal; +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using BBWY.Client.Models.SealBox; +using BBWY.Controls; +using Org.BouncyCastle.Utilities.Collections; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// AddWareListWindow.xaml 的交互逻辑 + /// + public partial class AddWareListWindow : BWindow + { + public AddWareListWindow(WareType WareType, LogisticsService logisticsService, List SealBoxConfigureModelList) + { + this.WareType = WareType; + InitializeComponent(); + LoadWare(logisticsService, SealBoxConfigureModelList); + this.DataContext = this; + } + + private WareType wareType; + public WareType WareType { get => wareType; set { Set(ref wareType, value); } } + + + + public void LoadWare(LogisticsService logisticsService, List SealBoxConfigureModelList) + { + if (WareType != WareType.聚水潭) + { + var response = logisticsService.GetStoreList();//京仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3 + if (response == null || !response.Success) + { + MessageBox.Show($"加载仓库列表失败,{response?.Msg}"); + return; + } + + var data = response.Data.Where(w => w.Status == StockStatus.使用); + var stockType = StockType.云仓; + switch (WareType) + { + case WareType.京仓: + stockType = StockType.京仓; + break; + case WareType.云仓: + stockType = StockType.云仓; + + break; + case WareType.商家仓: + stockType = StockType.商家仓; + break; + //case WareType.聚水潭: + // WareList = new List { new StoreWare { WareId = "qiyuejushuitan", WareName = "齐越聚水潭", IsSelect = false } }; + // break; + //default: + // break; + } + WareList = new List(); + data.Where(d => d.Type == stockType).ForAll(d => + { + if (SealBoxConfigureModelList.Where(s => s.WareType == WareType &&s.WareHourseDatas!=null).SelectMany(s => s.WareHourseDatas).Any(w => w.WareId == d.Id))//存在 + { + bool isedit = true; + if (SealBoxConfigureModelList.Where(s => s.WareType == WareType && s.WareHourseDatas != null).SelectMany(s => s.WareHourseDatas).Any(s=>s.WareState>0&& s.WareId == d.Id)) + isedit =false; + WareList.Add(new StoreWare + { + IsSelect = true, + WareId = d.Id, + WareName = d.Name, + IsEdit= isedit + }); + } + else + { + WareList.Add(new StoreWare + { + IsSelect = false, + WareId = d.Id, + WareName = d.Name, + IsEdit = true + }); + } + + + }); + + } + else + { + bool isJST = false; + if (SealBoxConfigureModelList.Where(s => s.WareType == WareType).SelectMany(s => s.WareHourseDatas).Any(w => w.WareId == "qiyuejushuitan"))//存在 + isJST = true; + WareList = new List { new StoreWare { WareId = "qiyuejushuitan", WareName = "齐越聚水潭", IsSelect = isJST } }; + } + + } + private List wareList; + public List WareList { get => wareList; set { Set(ref wareList, value); } } + + + public Action> AddWareList { get; set; } + + private void BButton_Click(object sender, RoutedEventArgs e) + { + var selectWare = WareList.Where(w => w.IsSelect).ToList(); + if (AddWareList != null) AddWareList(WareType, selectWare); + this.Close(); + } + private PositionType ToPositionType(WareType wareType) + { + switch (wareType) + { + case WareType.京仓: + return PositionType.京仓; + break; + case WareType.云仓: + return PositionType.云仓; + break; + case WareType.商家仓: + return PositionType.商家仓; + break; + case WareType.聚水潭: + return PositionType.聚水潭; + break; + default: + break; + } + return PositionType.聚水潭; + } + } + + public class StoreWare : NotifyObject + { + private bool isSelect; + public bool IsSelect { get => isSelect; set { Set(ref isSelect, value); } } + + private string wareName; + public string WareName { get => wareName; set { Set(ref wareName, value); } } + + private string wareId; + public string WareId { get => wareId; set { Set(ref wareId, value); } } + + + private bool isEdit=true; + public bool IsEdit { get => isEdit; set { Set(ref isEdit, value); } } + + + } +} diff --git a/BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs b/BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs index 5fbf6eeb..a4d75444 100644 --- a/BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs +++ b/BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs @@ -27,7 +27,7 @@ namespace BBWY.Client.Views.SealBox var sealBoxConfigureViewModel = (SealBoxConfigureViewModel)this.DataContext; sealBoxConfigureViewModel.SealBoxId = sealboxId; - sealBoxConfigureViewModel.SealBoxConfigureModelList = new System.Collections.ObjectModel.ObservableCollection(); + sealBoxConfigureViewModel.SealBoxConfigureModelList = new List(); sealBoxConfigureViewModel.ReflashWindow = ReflashWindow; diff --git a/BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml b/BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml index 70fa4fd9..7886aa41 100644 --- a/BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml +++ b/BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml @@ -180,7 +180,7 @@ - + diff --git a/BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml b/BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml index 3ea29b04..b7e7d690 100644 --- a/BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml +++ b/BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml @@ -152,7 +152,7 @@ - + diff --git a/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml new file mode 100644 index 00000000..d08ef8a8 --- /dev/null +++ b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml.cs b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml.cs new file mode 100644 index 00000000..2002f80a --- /dev/null +++ b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SetSealBoxPolicyWareListControl.xaml 的交互逻辑 + /// + public partial class SetSealBoxPolicyWareListControl : UserControl + { + public SetSealBoxPolicyWareListControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml new file mode 100644 index 00000000..9a75fb68 --- /dev/null +++ b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml @@ -0,0 +1,777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml.cs b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml.cs new file mode 100644 index 00000000..dff5b20b --- /dev/null +++ b/BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml.cs @@ -0,0 +1,196 @@ +using BBWY.Client.Models.SealBox; +using BBWY.Client.ViewModels.SealBox; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Collections.ObjectModel; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using AutoMapper.Internal; +using BBWY.Client.APIServices; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SetSealBoxPolicyWindow.xaml 的交互逻辑 + /// + public partial class SetSealBoxPolicyWindow : BWindow + { + public SetSealBoxPolicyWindow(IList sealBoxWaitConfigureModels, Action ReflashWindow, long sealboxId = 0) + { + InitializeComponent(); + var sealBoxConfigureVM = this.DataContext as SealBoxConfigureViewModel; + sealBoxConfigureVM.SealBoxConfigureModelList = sealBoxWaitConfigureModels.ToList(); + sealBoxConfigureVM.JdConfigureModelList = new ObservableCollection(); + sealBoxConfigureVM.CloudConfigureModelList = new ObservableCollection(); + sealBoxConfigureVM.JstConfigureModelList = new ObservableCollection(); + sealBoxConfigureVM.StoreConfigureModelList = new ObservableCollection(); + sealBoxConfigureVM.SealBoxId = sealboxId; + sealBoxConfigureVM.ReflashWindow = ReflashWindow; + LoadData(sealBoxWaitConfigureModels, sealboxId, sealBoxConfigureVM); + + } + + /// + /// 加载数据 + /// + /// + /// + /// + private void LoadData(IList sealBoxWaitConfigureModels, long sealboxId, SealBoxConfigureViewModel sealBoxConfigureVM) + { + + + if (sealboxId == 0)//设置 + { + sealBoxConfigureVM.JstWareHourseHeaderList = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = "齐越聚水潭",WareId="qiyuejushuitan" + } + }; + var storeListRes = sealBoxConfigureVM.logisticsService.GetStoreList(); + + if (storeListRes.Success) + { + //加载商家仓 全国仓 + var storeList = storeListRes.Data.Where(s=>s.Status== Models.StockStatus.使用); + + var store = storeList.FirstOrDefault(s => s.Id == "0");//商家全国仓 + if (store != null) + { + sealBoxConfigureVM.StoreWareHourseHeaderList = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = store.Name,WareId=store.Id + } + }; + } + + + //加载 泉州齐越云仓3号库 + var cloud = storeList.FirstOrDefault(s => s.Id == "800009450");//商家全国仓 + if (cloud != null) + { + sealBoxConfigureVM.CloudWareHourseHeaderList = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = cloud.Name,WareId=cloud.Id + } + }; + } + } + + //sealBoxConfigureVM.CloudWareHourseHeaderList = new ObservableCollection { + // new SealBoxConfigureWareHourseModel{ + // WareName = "泉州齐越云仓3号库",WareId="800009450" + // } + //}; + } + + + + foreach (var sealBoxWaitConfigureModel in sealBoxWaitConfigureModels) + { + if (sealBoxWaitConfigureModel.WareHourseDatas != null && sealBoxWaitConfigureModel.WareHourseDatas.Count > 0)//修改数据 + { + sealBoxWaitConfigureModel.WaitConfigureCount = 0; + sealBoxWaitConfigureModel.WareHourseDatas.ForAll(w => { w.TotalWareCount = sealBoxConfigureVM.TotalCount; w.TaskId = sealBoxWaitConfigureModel.TaskId; }); + } + else + { + sealBoxWaitConfigureModel.WaitConfigureCount = sealBoxWaitConfigureModel.SkuCount; + } + + + switch (sealBoxWaitConfigureModel.WareType.Value) + { + case Models.WareType.商家仓: + + if (sealboxId == 0) + { + if (sealBoxConfigureVM.StoreWareHourseHeaderList != null && sealBoxConfigureVM.StoreWareHourseHeaderList.Count > 0) + { + sealBoxConfigureVM.StoreWareHourseHeaderList.ForAll(s => + { + + sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = s.WareName, + WareId=s.WareId, + TaskId=sealBoxWaitConfigureModel.TaskId, + TotalWareCount=sealBoxConfigureVM.TotalCount, + + } + }; + + }); + + } + + } + + + sealBoxConfigureVM.StoreConfigureModelList.Add(sealBoxWaitConfigureModel); + sealBoxConfigureVM.StoreWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas; + break; + case Models.WareType.云仓: + if (sealboxId == 0) + { + if (sealBoxConfigureVM.CloudWareHourseHeaderList != null && sealBoxConfigureVM.CloudWareHourseHeaderList.Count > 0) + { + sealBoxConfigureVM.CloudWareHourseHeaderList.ForAll(s => + { + + sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = s.WareName, + WareId=s.WareId, + TaskId=sealBoxWaitConfigureModel.TaskId, + TotalWareCount=sealBoxConfigureVM.TotalCount, + + } + }; + + }); + + } + + } + + + sealBoxConfigureVM.CloudConfigureModelList.Add(sealBoxWaitConfigureModel); + sealBoxConfigureVM.CloudWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas; + break; + case Models.WareType.京仓: + sealBoxConfigureVM.JdConfigureModelList.Add(sealBoxWaitConfigureModel); + sealBoxConfigureVM.JdWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas; + break; + case Models.WareType.聚水潭: + sealBoxConfigureVM.JstConfigureModelList.Add(sealBoxWaitConfigureModel); + if (sealboxId == 0) + { + sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection { + new SealBoxConfigureWareHourseModel{ + WareName = "齐越聚水潭",WareId="qiyuejushuitan", TaskId=sealBoxWaitConfigureModel.TaskId, TotalWareCount=sealBoxConfigureVM.TotalCount, + + } + }; + } + + sealBoxConfigureVM.JstWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas; + + + break; + default: + break; + } + + } + } + } +} diff --git a/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml new file mode 100644 index 00000000..bc3876e7 --- /dev/null +++ b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml.cs b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml.cs new file mode 100644 index 00000000..be2c39be --- /dev/null +++ b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml.cs @@ -0,0 +1,64 @@ +using BBWY.Client.Models; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SplitOtherWareWindow.xaml 的交互逻辑 + /// + public partial class SplitOtherWareWindow : BWindow + { + public SplitOtherWareWindow(int waitCount, WareType wareType, Action SplitWare) + { + this. SplitWare = SplitWare; + WaitCount = waitCount; + WareTypeList.Remove(wareType);//移除当前落仓 + InitializeComponent(); + this.DataContext = this; + } + private Action SplitWare { get;set;} + private int waitCount; + public int WaitCount { get => waitCount; set { Set(ref waitCount, value); } } + + private int count; + public int Count { get => count; set { Set(ref count, value); } } + + private WareType selectWareType; + public WareType SelectWareType { get => selectWareType; set { Set(ref selectWareType, value); } } + + + private ObservableCollection wareTypeList=new ObservableCollection { + WareType.京仓, WareType.云仓, WareType.商家仓, WareType.聚水潭 + }; + public ObservableCollection WareTypeList { get => wareTypeList; set { Set(ref wareTypeList, value); } } + + private void BButton_Click(object sender, RoutedEventArgs e) + { + if (WaitCount< Count) + { + MessageBox.Show("可分配量不足!"); + return; + } + if (SplitWare != null) SplitWare(Count, SelectWareType); + + this.Close(); + } + + private void BButton_Click_1(object sender, RoutedEventArgs e) + { + Count = WaitCount; + } + } +} diff --git a/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml b/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml index 67535b76..7837328a 100644 --- a/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml +++ b/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml @@ -210,7 +210,7 @@ - + diff --git a/BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs b/BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs index e52ba4f6..9dad9824 100644 --- a/BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs +++ b/BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs @@ -72,7 +72,7 @@ namespace BBWY.Client.Views.TotalPackTask [:Column:] - + diff --git a/BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml b/BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml index d70639c8..18d5efa1 100644 --- a/BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml +++ b/BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml @@ -74,8 +74,8 @@ -