From 8658ae91c0fe9ebd1909ffda2603c0a764e16bbb Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Mon, 7 Aug 2023 17:00:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E6=A0=BC=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIServices/QiKu/PackTaskService.cs | 18 +- .../PackTask/SearchStoreGetSelfResponse.cs | 83 +++++ .../Models/PackTask/CertificateModel.cs | 4 +- .../Models/SealBox/WareNoSealBoxModel.cs | 7 +- .../PackTask/StorePickSelfViewModel.cs | 11 + .../ViewModels/PackTask/TaskListViewModel.cs | 56 ++- .../PackTask/UpdatePurchaseTaskViewModel.cs | 173 ++++----- .../PackTask/WareHouseListViewModel.cs | 166 +++++++-- BBWY.Client/ViewModels/ViewModelLocator.cs | 10 + .../Views/PackTask/PackDetailWindow.xaml | 9 +- BBWY.Client/Views/PackTask/PackTaskTotal.xaml | 14 +- .../Views/PackTask/SetCerWindow.xaml.cs | 2 +- BBWY.Client/Views/PackTask/TaskList.xaml | 20 +- BBWY.Client/Views/PackTask/WareHouseList.xaml | 6 +- .../Views/PackTask/WareHouseListControl.xaml | 1 - .../SealBox/SealBoxConfiguredControl.xaml | 2 +- .../SealBox/SealBoxNoConfigureControl.xaml | 68 ++-- .../SealBox/SealBoxNoConfigureControl.xaml.cs | 28 +- .../Views/SealBox/WaitSealBoxControl.xaml | 2 +- .../ShopStorePickSelfControl.xaml | 347 ++++++++++++++++++ .../ShopStorePickSelfControl.xaml.cs | 26 ++ .../StorePickSelf/StorePickSelfControl.xaml | 347 ++++++++++++++++++ .../StorePickSelfControl.xaml.cs | 253 +++++++++++++ .../TotalPackTask/ShopPackTaskTotal.xaml | 4 +- 24 files changed, 1456 insertions(+), 201 deletions(-) create mode 100644 BBWY.Client/Models/APIModel/Response/PackTask/SearchStoreGetSelfResponse.cs create mode 100644 BBWY.Client/ViewModels/PackTask/StorePickSelfViewModel.cs create mode 100644 BBWY.Client/Views/StorePickSelf/ShopStorePickSelfControl.xaml create mode 100644 BBWY.Client/Views/StorePickSelf/ShopStorePickSelfControl.xaml.cs create mode 100644 BBWY.Client/Views/StorePickSelf/StorePickSelfControl.xaml create mode 100644 BBWY.Client/Views/StorePickSelf/StorePickSelfControl.xaml.cs diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index 2427bde4..a404013c 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -374,13 +374,29 @@ namespace BBWY.Client.APIServices public ApiResponse StoreGetBySelfV2(long taskId, int storeGetCount, string PickerUserName) { - return SendRequest(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelfV2?TaskId={taskId}", new { + return SendRequest(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelfV2", new { taskId, storeGetCount, PickerUserName, OperatorUserName= globalContext.User.Name }, null, HttpMethod.Post); } + + public ApiResponse SearchStoreGetSelfList(string taskId, string OrderSn, string SpuId, string SkuId,string DepartmentName, string ShopName, int? pageIndex, int pageSize, string ShopId) + { + + return SendRequest(globalContext.QKApiHost, $"api/PackTask/SearchStoreGetSelfList", new + { + taskId, + OrderSn, + SpuId, + SkuId, + DepartmentName, ShopName, + ShopId , pageIndex, pageSize, + }, null, HttpMethod.Post); + } + + } public class CompeteSealBox diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchStoreGetSelfResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchStoreGetSelfResponse.cs new file mode 100644 index 00000000..eaad8a64 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchStoreGetSelfResponse.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SearchStoreGetSelfResponse + { + /// + /// 总条数 + /// + public int TotalCount { get; set; } + + /// + /// 商家自取记录列表 + /// + public List StoreGetSelfResponseList { get; set; } + + } + + /// + /// 单挑自取记录数据 + /// + public class StoreGetSelfData:NotifyObject + { + /// + /// 打包任务id + /// + public long TaskId { get; set; } + ///// + ///// 取货时间 + ///// + //public DateTime OperatorTime { get; set; } + + /// + /// 取货人 + /// + public string PickerUserName { get; set; } + + /// + /// 自取数量 + /// + public int StoreGetCount { get; set; } + + #region 任务信息 + + /// + /// 任务创建时间 + /// + public DateTime? CreateTime { get; set; } + + /// + /// 店铺 + /// + public string ShopName { get; set; } + + /// + /// 团队 + /// + public string DepartmentName { get; set; } + /// + /// 商品sku + /// + public string SkuId { get; set; } + + /// + /// 图片 + /// + public string Logo { get; set; } + + /// + /// 商品sku标题名称 + /// + public string SkuName { get; set; } + + /// + /// 商品品名 + /// + public string BrandName { get; set; } + + #endregion + } +} diff --git a/BBWY.Client/Models/PackTask/CertificateModel.cs b/BBWY.Client/Models/PackTask/CertificateModel.cs index 90fe2664..30981c69 100644 --- a/BBWY.Client/Models/PackTask/CertificateModel.cs +++ b/BBWY.Client/Models/PackTask/CertificateModel.cs @@ -134,11 +134,11 @@ namespace BBWY.Client.Models - private long goodsNumber = 1; + private long? goodsNumber = 1; /// /// 配件序号 /// - public long GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } + public long? GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } diff --git a/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs b/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs index 94e1dab4..2f1deee5 100644 --- a/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs +++ b/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs @@ -31,6 +31,11 @@ namespace BBWY.Client.Models /// /// 封箱sku列表 /// - public List SealBoxSkus { get; set; } + private List sealBoxSkus; + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get=> sealBoxSkus; set {Set(ref sealBoxSkus, value); } } } } diff --git a/BBWY.Client/ViewModels/PackTask/StorePickSelfViewModel.cs b/BBWY.Client/ViewModels/PackTask/StorePickSelfViewModel.cs new file mode 100644 index 00000000..0ce4ca24 --- /dev/null +++ b/BBWY.Client/ViewModels/PackTask/StorePickSelfViewModel.cs @@ -0,0 +1,11 @@ +using BBWY.Common.Models; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.ViewModels.PackTask +{ + public class StorePickSelfViewModel:BaseVM,IDenpendency + { + } +} diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index ea9b28cc..5d18077f 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -237,6 +237,12 @@ namespace BBWY.Client.ViewModels.PackTask public ObservableCollection PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } } #endregion + private ObservableCollection storeGetSelfDataList; + /// + /// 商家自取记录任务列表 + /// + public ObservableCollection StoreGetSelfDataList { get => storeGetSelfDataList; set { Set(ref storeGetSelfDataList, value); } } + public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService) @@ -373,11 +379,17 @@ namespace BBWY.Client.ViewModels.PackTask //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(); + 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(); @@ -494,7 +506,7 @@ namespace BBWY.Client.ViewModels.PackTask } private List waitSealBoxTaskStates = new List { - Models.TaskState.待落仓, Models.TaskState.待封箱, Models.TaskState.待出库 + Models.TaskState.待落仓, Models.TaskState.待封箱, Models.TaskState.待出库, Models.TaskState.商家自取 };//配置封箱的任务状态范围 @@ -1045,6 +1057,38 @@ namespace BBWY.Client.ViewModels.PackTask IsLoading = false; }); } + if (TaskState == Models.TaskState.商家自取) + { + Task.Factory.StartNew(() => + { + StoreGetSelfDataList = new ObservableCollection(); + var datas = packTaskService.SearchStoreGetSelfList(SearchTaskId, SearchOrderSn, SearchSpuId, SearchSkuId, null, null, PageIndex, PageSize, globalContext.User.Shop.ShopId.ToString()); + if (datas != null && datas.Data != null && datas.Success) + { + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.StoreGetSelfResponseList) + { + App.Current.Dispatcher.Invoke(new Action(() => + { + StoreGetSelfDataList.Add(item); + })); + + } + + } + else + { + App.Current.Dispatcher.Invoke(new Action(() => + { + MessageBox.Show(datas?.Msg); + })); + + } + IsLoading = false; + }); + + } } diff --git a/BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs index 305ab8bb..c85ef211 100644 --- a/BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs @@ -525,108 +525,111 @@ namespace BBWY.Client.ViewModels.PackTask Brand = productApiResponse.Data.Items[0].BrandName; } - var productSku = packPurchaseTaskService.GetConfigPack(SkuId, "", OrderId); + } + else + { - if (productSku == null || !productSku.Success || productSku.Data == null) - { - MessageBox.Show(productSku.Msg); - return false; - } + App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku失败")); + } + var productSku = packPurchaseTaskService.GetConfigPack(SkuId, "", OrderId); - SkuPurchaseSchemeId = productSku.Data.SkuPurchaseSchemeId; - BarCodeModel = productSku.Data.BarCode; - if (BarCodeModel == null) - { - BarCodeModel = new BarCodeModel(); + if (productSku == null || !productSku.Success || productSku.Data == null) + { + MessageBox.Show(productSku.Msg); + return false; + } + + + SkuPurchaseSchemeId = productSku.Data.SkuPurchaseSchemeId; + BarCodeModel = productSku.Data.BarCode; + if (BarCodeModel == null) + { + BarCodeModel = new BarCodeModel(); + } + if (!string.IsNullOrEmpty(Brand)) + BarCodeModel.Brand = Brand; + if (!string.IsNullOrEmpty(BrandName)) + BarCodeModel.BrandName = BrandName; + BarCodeModel.ProductNo = ProductNo; + BarCodeModel.SkuId = SkuId; + BarCodeModel.SkuName = SkuName; + PurchaseSkuList = new ObservableCollection(); + foreach (var item in productSku.Data.PurchaseSkus) + { + var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); + if (list == null || !list.Success || list.Data == null) + continue; + var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); + if (skuItem == null) + { + MessageBox.Show($"{item.PurchaseProductId}采购商品列表不存在skuid:{item.PurchaseSkuId},sku商品可能被下架了."); + //return false; } - if (!string.IsNullOrEmpty(Brand)) - BarCodeModel.Brand = Brand; - if (!string.IsNullOrEmpty(BrandName)) - BarCodeModel.BrandName = BrandName; - BarCodeModel.ProductNo = ProductNo; - BarCodeModel.SkuId = SkuId; - BarCodeModel.SkuName = SkuName; - PurchaseSkuList = new ObservableCollection(); - foreach (var item in productSku.Data.PurchaseSkus) + App.Current.Dispatcher.Invoke(new Action(() => { - var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); - if (list == null ||!list.Success|| list.Data == null) - continue; - var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); - if (skuItem == null) + PurchaseSkuList.Add(new PurchaseSku { - MessageBox.Show($"{item.PurchaseProductId}采购商品列表不存在skuid:{item.PurchaseSkuId},sku商品可能被下架了."); - //return false; + Logo = skuItem?.Logo, + Title = skuItem?.Title, + IsNeedCer = item.IsNeedCer, + PurchaseSkuId = item.PurchaseSkuId, + CerDTO = item.CerDTO, + IsSetCertificate = item.CerDTO == null ? true : false, + }); + })); + } + + IsNeedBarCode = Need.需要; + IsSetBarCode = true; + IsSetCertificate = true; + if (productSku.Data.PackConfig != null) + { + var config = productSku.Data.PackConfig; + SkuTitle = config.SkuGoodsTitle; + BrandName = config.BrandName; + GoodsNumber = config.GoodsNumber; + PackType = (PackType)config.PackType; + BasicPack = (BasicPack)config.BasicPack; + //MarkMessage = config.MarkMessage; + CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无需合格证 : (CertificatePosition)config.CertificatePosition.Value; + // Increment1 = config.Increment1; + + IsNeedBarCode = config.NeedBar ? Need.需要 : Need.不需要; + IsNeedCertificateModel = config.NeedCer ? Need.需要 : Need.不需要; + + IsSetBarCode = !config.NeedBar; + IsSetCertificate = !config.NeedCer; + + string[] increateDatas = config.Increment1?.Split(','); + bool isSelected = false; + + IncreateList = new ObservableCollection(); + foreach (var item in increates) + { + isSelected = false; + if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) + { + isSelected = true; } - App.Current.Dispatcher.Invoke(new Action(() => + App.Current.Dispatcher.Invoke(() => { - PurchaseSkuList.Add(new PurchaseSku + IncreateList.Add(new IncreateModel { - Logo = skuItem?.Logo, - Title = skuItem?.Title, - IsNeedCer = item.IsNeedCer, - PurchaseSkuId = item.PurchaseSkuId, - CerDTO = item.CerDTO, - IsSetCertificate = item.CerDTO == null ? true : false, + IncreateName = item, + IsSelected = isSelected }); - })); + }); } - IsNeedBarCode = Need.需要; - IsSetBarCode = true; - IsSetCertificate = true; - if (productSku.Data.PackConfig != null) - { - var config = productSku.Data.PackConfig; - SkuTitle = config.SkuGoodsTitle; - BrandName = config.BrandName; - GoodsNumber = config.GoodsNumber; - PackType = (PackType)config.PackType; - BasicPack = (BasicPack)config.BasicPack; - //MarkMessage = config.MarkMessage; - CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无需合格证 : (CertificatePosition)config.CertificatePosition.Value; - // Increment1 = config.Increment1; - - IsNeedBarCode = config.NeedBar ? Need.需要 : Need.不需要; - IsNeedCertificateModel = config.NeedCer ? Need.需要 : Need.不需要; - - IsSetBarCode = !config.NeedBar; - IsSetCertificate = !config.NeedCer; - - string[] increateDatas = config.Increment1?.Split(','); - bool isSelected = false; - - IncreateList = new ObservableCollection(); - foreach (var item in increates) - { - isSelected = false; - if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) - { - isSelected = true; - } - App.Current.Dispatcher.Invoke(() => - { - IncreateList.Add(new IncreateModel - { - IncreateName = item, - IsSelected = isSelected - }); - }); - } + } + + - } - return true; - } - else - { - App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku")); - return false; - } return true; //加载配置文件 } diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index a495b205..7f02373f 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -21,6 +21,8 @@ using System.Threading; using BBWY.Client.Helpers; using BBWY.Client.Views.TaskOverTime; using BBWY.Client.Views.StorePickSelf; +using System.Diagnostics.Eventing.Reader; +using BBWY.Client.Models.SealBox; namespace BBWY.Client.ViewModels.PackTask { @@ -323,6 +325,15 @@ namespace BBWY.Client.ViewModels.PackTask /// public ObservableCollection WareNoSealBoxModels { get => wareNoSealBoxModels; set { Set(ref wareNoSealBoxModels, value); } } + /// + /// 分箱列表 + /// + public List WaitSealBoxModelList { get; set; } + + + + + private ObservableCollection waitSealBoxModels; /// @@ -338,6 +349,12 @@ namespace BBWY.Client.ViewModels.PackTask + private ObservableCollection storeGetSelfDataList; + /// + /// 商家自取记录任务列表 + /// + public ObservableCollection StoreGetSelfDataList { get => storeGetSelfDataList; set { Set(ref storeGetSelfDataList, value); } } + private string searchShopName; public string SearchShopName { @@ -625,6 +642,24 @@ namespace BBWY.Client.ViewModels.PackTask SendToSetSkuConfigureCommand = new RelayCommand(SendToSetSkuConfigure); SelectSku = "SKU"; SelectExpress = "物流单号"; + LoadSkuDataCommand = new RelayCommand(LoadSkuData); + } + + private void LoadSkuData(WareNoSealBoxModel model) + { + + if (model.SealBoxSkus==null|| model.SealBoxSkus.Count<=0) + { + var skuDatas =WaitSealBoxModelList.SingleOrDefault(w => w.ShopId == model.ShopId); + WareNoSealBoxModels.SingleOrDefault(w => w.ShopId == model.ShopId).SealBoxSkus = skuDatas.SealBoxSkus; + } + else + { + WareNoSealBoxModels.SingleOrDefault(w => w.ShopId == model.ShopId).SealBoxSkus = new List(); + } + + + } private void SendToSetSkuConfigure(PackTaskModel model) @@ -849,7 +884,7 @@ namespace BBWY.Client.ViewModels.PackTask return; } - + Task.Factory.StartNew(() => SearchTaskList()); } @@ -1010,6 +1045,7 @@ namespace BBWY.Client.ViewModels.PackTask #region 事件绑定 + /// /// 推送sku配置状态 /// @@ -1111,6 +1147,13 @@ namespace BBWY.Client.ViewModels.PackTask /// 商家自取 /// public ICommand StoreGetBySelfCommand { get; set; } + + + /// + /// 加载事件 + /// + public ICommand LoadSkuDataCommand { get; set; } + /// /// 完成封箱 /// @@ -1244,6 +1287,7 @@ namespace BBWY.Client.ViewModels.PackTask private Thread sealboxOverTimeThread = null; private Thread fallwareOverTimeThread = null; private Thread waitTransportOverTimeThread = null; + /// /// 搜索任务列表 /// @@ -1295,8 +1339,6 @@ namespace BBWY.Client.ViewModels.PackTask { if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } - IsLoadCount(); - IsLoading = false; } else if (TaskState == Models.TaskState.已超时) @@ -1321,8 +1363,7 @@ namespace BBWY.Client.ViewModels.PackTask { if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } - IsLoadCount(); - IsLoading = false; + } else if (TaskState == Models.TaskState.待转运) @@ -1387,10 +1428,12 @@ namespace BBWY.Client.ViewModels.PackTask { if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } - IsLoadCount(); - IsLoadWaitTransportCount(); - IsLoading = false; + + Task.Factory.StartNew(() => + { + IsLoadWaitTransportCount(); + }); } else if (TaskState == Models.TaskState.待落仓) { @@ -1430,10 +1473,12 @@ namespace BBWY.Client.ViewModels.PackTask { if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } - IsLoadCount(); - IsLoadFallWareCount(); - IsLoading = false; + + Task.Factory.StartNew(() => + { + IsLoadFallWareCount(); + }); } else if (TaskState == Models.TaskState.待封箱) { @@ -1521,29 +1566,29 @@ namespace BBWY.Client.ViewModels.PackTask } if (SealBoxConfigureType == SealBoxConfigureType.待配置) { - WareNoSealBoxModels = new ObservableCollection(); + WareNoSealBoxModels = new ObservableCollection(); var datas = sealBoxService.GetWareSealBoxWaitConfigureList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; OrderCount = dataModel.TotalCount; - foreach (var item in dataModel.WaitSealBoxModels) - { + WaitSealBoxModelList = dataModel.WaitSealBoxModels; - App.Current.Dispatcher.Invoke(new Action(() => + foreach (var item in WaitSealBoxModelList) + { + App.Current.Dispatcher.Invoke(new Action(() => { + WareNoSealBoxModels.Add(new WareNoSealBoxModel { - WareNoSealBoxModels.Add(new WareNoSealBoxModel - { - AcceptUserName = string.Join("|", item.AcceptUserNames), - DepartmentName = item.DepartmentName, - SealBoxSkus = item.SealBoxSkus, - ShopId = item.ShopId, - ShopName = item.ShopName, + AcceptUserName = string.Join("|", item.AcceptUserNames), + DepartmentName = item.DepartmentName, + SealBoxSkus = new List(), + // SealBoxSkus = item.SealBoxSkus, + ShopId = item.ShopId, + ShopName = item.ShopName, - }); + }); })); - } } else @@ -1551,9 +1596,35 @@ namespace BBWY.Client.ViewModels.PackTask if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } } - IsLoadSealBoxCount(); - IsLoadCount(); - IsLoading = false; + + Task.Factory.StartNew(() => + { + IsLoadSealBoxCount(); + }); + + } + else if (taskState == Models.TaskState.商家自取) + { + StoreGetSelfDataList = new ObservableCollection(); + var datas = packTaskService.SearchStoreGetSelfList(SearchTaskId, SearchOrderSn, SearchSpuId, SearchSkuId, SearchDepartment, SearchShopName, PageIndex, PageSize, null); + if (datas != null && datas.Data != null && datas.Success) + { + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.StoreGetSelfResponseList) + { + App.Current.Dispatcher.Invoke(new Action(() => + { + StoreGetSelfDataList.Add(item); + })); + + } + + } + else + { + MessageBox.Show(datas?.Msg); + } } else @@ -1809,25 +1880,38 @@ namespace BBWY.Client.ViewModels.PackTask else { } - IsLoadCount(); - IsLoading = false; } + + Task.Factory.StartNew(() => + { + IsLoadCount(); + }); + + IsLoading = false; + }); } + + + private void IsLoadWaitTransportCount() { var res = sealBoxService.GetWareTransportCounts(); if (res != null && res.Success && res.Data != null) { - WaitTransportCloudWareCount = res.Data.WaitTransportCloudWareCount; - WaitTransportJuShuiTanCount = res.Data.WaitTransportJuShuiTanCount; - WaitTransportStoreWareCount = res.Data.WaitTransportStoreWareCount; - WaitTransportJDWareCount = res.Data.WaitTransportJDWareCount; + App.Current.Dispatcher.Invoke(new Action(() => + { + WaitTransportCloudWareCount = res.Data.WaitTransportCloudWareCount; + WaitTransportJuShuiTanCount = res.Data.WaitTransportJuShuiTanCount; + WaitTransportStoreWareCount = res.Data.WaitTransportStoreWareCount; + WaitTransportJDWareCount = res.Data.WaitTransportJDWareCount; + })); } + } private void IsLoadSealBoxCount() @@ -1835,8 +1919,12 @@ namespace BBWY.Client.ViewModels.PackTask var res = sealBoxService.GetWareSealBoxConfigureCounts(); if (res != null && res.Success && res.Data != null) { - FallWareWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString(); - FallWareConfiguredCount = res.Data.SealBoxConfiguredCount.ToString(); + App.Current.Dispatcher.Invoke(new Action(() => + { + FallWareWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString(); + FallWareConfiguredCount = res.Data.SealBoxConfiguredCount.ToString(); + })); + } } @@ -1845,8 +1933,12 @@ namespace BBWY.Client.ViewModels.PackTask var res = sealBoxService.GetFallWareConfigureCounts(null); if (res != null && res.Success && res.Data != null) { - FallWareWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString(); - FallWareConfiguredCount = res.Data.FallWareConfiguredCount.ToString(); + App.Current.Dispatcher.Invoke(new Action(() => + { + FallWareWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString(); + FallWareConfiguredCount = res.Data.FallWareConfiguredCount.ToString(); + })); + } } private void IsLoadCount() diff --git a/BBWY.Client/ViewModels/ViewModelLocator.cs b/BBWY.Client/ViewModels/ViewModelLocator.cs index 73bd50ee..f3ec012a 100644 --- a/BBWY.Client/ViewModels/ViewModelLocator.cs +++ b/BBWY.Client/ViewModels/ViewModelLocator.cs @@ -367,6 +367,16 @@ namespace BBWY.Client.ViewModels } } + public StorePickSelfViewModel StorePickSelfVM + { + get + { + using var s = sp.CreateScope(); + return s.ServiceProvider.GetRequiredService(); + } + } + + //public ShopSealBoxListViewModel ShopSealBoxListVM //{ // get diff --git a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml index bd67e769..e6e0e354 100644 --- a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml +++ b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml @@ -96,14 +96,7 @@ - - - - - - - - + diff --git a/BBWY.Client/Views/PackTask/PackTaskTotal.xaml b/BBWY.Client/Views/PackTask/PackTaskTotal.xaml index ad9cd1b4..baec44bc 100644 --- a/BBWY.Client/Views/PackTask/PackTaskTotal.xaml +++ b/BBWY.Client/Views/PackTask/PackTaskTotal.xaml @@ -38,7 +38,7 @@ - + @@ -87,23 +87,19 @@ /> - + - - - -