diff --git a/BBWY.Client/APIServices/PackTaskService.cs b/BBWY.Client/APIServices/PackTaskService.cs index 8ec75749..fc3b76c0 100644 --- a/BBWY.Client/APIServices/PackTaskService.cs +++ b/BBWY.Client/APIServices/PackTaskService.cs @@ -62,7 +62,7 @@ namespace BBWY.Client.APIServices ShopId = globalContext.User.Shop.ShopId.ToString() }, null, HttpMethod.Post); } - public ApiResponse GetWareHouseList(int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null, + public ApiResponse GetWareHouseList(string WayBillNo=null,string SourceExpressName=null, int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null, DateTime? startTime = null, DateTime? endTime = null, PackTaskState? TaskState = null, @@ -91,6 +91,8 @@ namespace BBWY.Client.APIServices PageIndex = pageIndex, PageSize = pageSize, ShopName = ShopName, + WayBillNo= WayBillNo, + SourceExpressName=SourceExpressName, }, null, HttpMethod.Post); } @@ -277,7 +279,7 @@ namespace BBWY.Client.APIServices } /// - /// 取消拳探任务 + /// 统计打包人员工资明细 /// /// /// @@ -294,9 +296,54 @@ namespace BBWY.Client.APIServices }, null, HttpMethod.Post); } + /// + /// 获取封箱列表 + /// + /// + /// + public ApiResponse SearchWaitSealBoxList(string ShopName = null, long? TaskId=null, string SkuId = null, int PageIndex = 1 + , int PageSize = 10) + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchWaitSealBoxList", new + { + ShopName, + TaskId, + SkuId, + PageIndex, + PageSize + }, null, HttpMethod.Post); + } + + /// + /// 获取封箱列表 + /// + /// + /// + public ApiResponse CompeteSealBox( List CompeteSealBoxs) + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", new + { + CompeteSealBoxs + }, null, HttpMethod.Post); + } + } + + public class CompeteSealBox + { + /// + /// 任务Id + /// + public long TaskId { get; set; } + /// + /// 仓库Id + /// + public string WareId { get; set; } + } + + public class AddConsumableRequest { public long TaskId { get; set; } diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs new file mode 100644 index 00000000..97988b82 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SearchWaitSealBoxResponse + { + /// + /// 数量 + /// + public int TotalCount { get; set; } + + /// + /// 分箱列表 + /// + public List WaitSealBoxModels { get; set; } + } + + public class WaitSealBoxModel + { + /// + /// 店铺Id + /// + public string ShopId { get; set; } + /// + /// 仓库Id(同一个店铺 唯一) + /// + public string WareId { get; set; } + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + /// + /// 仓库名 + /// + public string WareName { get; set; } + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public List AcceptUserNames { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + } + + public class AcceptUser + { + /// + /// 用户Id + /// + public string Id { get; set; } + /// + /// 用户名 + /// + public string UserName { get; set; } + } + + public class SealBoxSku + { + + /// + /// 任务Id + /// + public long TaskId { get; set; } + /// + /// 图片链接 + /// + public string Logo { get; set; } + /// + /// skuid + /// + public string SkuId { get; set; } + /// + /// sku标题 + /// + public string SkuTitle { get; set; } + /// + /// 品名 + /// + public string BrandName { get; set; } + /// + /// 货号 + /// + public string ProductNo { get; set; } + /// + /// 打包sku产品数量 + /// + public int SkuCount { get; set; } + } +} diff --git a/BBWY.Client/Models/PackTask/SealBoxModel.cs b/BBWY.Client/Models/PackTask/SealBoxModel.cs new file mode 100644 index 00000000..7611a399 --- /dev/null +++ b/BBWY.Client/Models/PackTask/SealBoxModel.cs @@ -0,0 +1,43 @@ +using BBWY.Client.Models.APIModel; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.PackTask +{ + public class SealBoxModel + { + + /// + /// 店铺Id + /// + public string ShopId { get; set; } + /// + /// 仓库Id(同一个店铺 唯一) + /// + public string WareId { get; set; } + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + /// + /// 仓库名 + /// + public string WareName { get; set; } + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public string AcceptUserName { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + } +} diff --git a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs index 7fb2af60..295452a3 100644 --- a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs @@ -21,8 +21,8 @@ namespace BBWY.Client.ViewModels.PackTask { public class PublishTaskViewModel : BaseVM, IDenpendency { - - #region 属性 + + #region 属性 private string searchSkuId; public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } @@ -435,16 +435,12 @@ namespace BBWY.Client.ViewModels.PackTask } Logo = skuResponse.Data[0].Logo.Replace("80x80", "200x200"); SkuName = skuResponse.Data[0].Title; - SpuId = skuResponse.Data[0].ProductId; - productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1); - if (productApiResponse.Success) { if (productApiResponse.Data.Count == 0) { - return; } @@ -455,7 +451,8 @@ namespace BBWY.Client.ViewModels.PackTask var productSku = packTaskService.GetProductSku(skuid); if (productSku == null || !productSku.Success || productSku.Data == null) return; - BrandName = productSku.Data.BrandName; + if (TaskId <= 0) + BrandName = productSku.Data.BrandName; CertificateModel = productSku.Data.Cers; if (CertificateModel == null) { @@ -485,18 +482,22 @@ namespace BBWY.Client.ViewModels.PackTask BarCodeModel.SkuId = skuid; BarCodeModel.SkuName = SkuName; + if (TaskId <= 0) + { - IsNeedBarCode = Need.需要; - IsSetBarCode = true; - IsSetCertificate = true; - if (productSku.Data.PackConfig != null) + + IsNeedBarCode = Need.需要; + IsSetBarCode = true; + IsSetCertificate = true; + } + if (productSku.Data.PackConfig != null&&TaskId<=0) { var config = productSku.Data.PackConfig; SkuTitle = config.SkuGoodsTitle; GoodsNumber = config.GoodsNumber; PackType = (PackType)config.PackType; BasicPack = (BasicPack)config.BasicPack; - Availability = (TaskState)config.Availability; + //Availability = (TaskState)config.Availability; MarkMessage = config.MarkMessage; CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; // Increment1 = config.Increment1; @@ -633,21 +634,21 @@ namespace BBWY.Client.ViewModels.PackTask { } - + PackType = model.PackType; BasicPack = model.BasicPack; IsNeedBarCode = model.BarCodeModel == null ? Need.不需要 : Need.需要; IsNeedCertificateModel = model.CertificateModel == null ? Need.不需要 : Need.需要; CertificatePosition = model.CertificatePosition; TaskId = model.TaskId; - + string[] increateDatas = model.Increment1?.Split(','); bool isTrue = false; foreach (var item in increates) { isTrue = false; - if (increateDatas!=null&& increateDatas .Count()>0&& increateDatas.Contains(item)) + if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) { isTrue = true; } @@ -703,7 +704,7 @@ namespace BBWY.Client.ViewModels.PackTask var createTaskModel = new Models.APIModel.Request.CreateTaskRequest { ProductNo = ProductNo, - Logo = Logo.Replace( "200x200", "80x80"), + Logo = Logo.Replace("200x200", "80x80"), SkuName = SkuName, TaskId = TaskId, BrandName = BrandName, diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 2c1af9a4..955b182e 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -19,6 +19,8 @@ using System.Windows; using System.Collections; using NPOI.SS.Formula.Functions; using GalaSoft.MvvmLight.Messaging; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.PackTask; namespace BBWY.Client.ViewModels.PackTask { @@ -27,6 +29,33 @@ namespace BBWY.Client.ViewModels.PackTask { #region 属性绑定 + + private string searchWayBillNo; + public string SearchWayBillNo + { + get => searchWayBillNo; set + { + Set(ref searchWayBillNo, value); + } + } + private string searchExpressName; + public string SearchExpressName + { + get => searchExpressName; set + { + Set(ref searchExpressName, value); + } + } + + + private ObservableCollection waitSealBoxModels; + /// + /// 分箱列表 + /// + public ObservableCollection WaitSealBoxModels { get => waitSealBoxModels; set { Set(ref waitSealBoxModels, value); } } + + + /// /// 查询时间段 /// @@ -36,11 +65,6 @@ namespace BBWY.Client.ViewModels.PackTask private DateTime endTime; public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } } - - - - - private string searchShopName; public string SearchShopName { @@ -211,7 +235,9 @@ namespace BBWY.Client.ViewModels.PackTask { try { - Clipboard.SetText(s.ToString()); + if (s != null) + + Clipboard.SetText(s.ToString()); } catch (Exception ex) { @@ -234,11 +260,13 @@ namespace BBWY.Client.ViewModels.PackTask UpdateTaskStateCommand = new RelayCommand(UpdateTaskState); - + CompeteSealBoxCommand = new RelayCommand(CompeteSealBox); } - #region 事件绑定 + #region 事件绑定 + + public ICommand CompeteSealBoxCommand { get; set; } public ICommand SetTaskStatusCommand { get; set; } /// @@ -277,6 +305,32 @@ namespace BBWY.Client.ViewModels.PackTask BatchPurchaseService batchPurchaseService; + private void CompeteSealBox(object obj) + { + var objList = obj as SealBoxModel; + + List CompeteSealBoxs = new List(); + string wareId = objList.WareId; + foreach (var item in objList.SealBoxSkus) + { + + CompeteSealBoxs.Add(new APIServices.CompeteSealBox + { + WareId = wareId, + TaskId = item.TaskId, + + }); + + } + var res = packTaskService.CompeteSealBox(CompeteSealBoxs); + if (res != null && res.Success) + { + SearchTaskList(); + } + + + } + private void UpdateTaskState(object obj) { var objList = (object[])obj; @@ -379,121 +433,165 @@ namespace BBWY.Client.ViewModels.PackTask /// public void SearchTaskList() { + long? taskId = null; try { if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim())) - Convert.ToInt64(SearchTaskId); + taskId = Convert.ToInt64(SearchTaskId); } catch { - System.Windows.MessageBox.Show("任务id必须为数字"); - return; + taskId = null; } - //string shopId = null; - //if (!string.IsNullOrEmpty(SearchShopName)) - //{ - // var searchShop = globalContext.User.ShopList.FirstOrDefault(g => g.ShopName == SearchShopName); - // if (searchShop != null) shopId = searchShop.ShopId.ToString(); - //} + IsLoading = true; - Task.Factory.StartNew(() => - { - PackTaskList = new ObservableCollection();//初始化数据 - var datas = packTaskService.GetWareHouseList(IsWorry, SearchDepartment, SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), SearchShopName, - PageIndex, PageSize); - if (datas != null && datas.Data != null && datas.Success) + if (TaskState == PackTaskState.待封箱) + Task.Factory.StartNew(() => + { + + + WaitSealBoxModels = new ObservableCollection(); + var datas = packTaskService.SearchWaitSealBoxList(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) + { + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + WaitSealBoxModels.Add(new SealBoxModel + { + AcceptUserName = string.Join("|", item.AcceptUserNames.Select(a => a.UserName)), + DepartmentName = item.DepartmentName, + SealBoxSkus = item.SealBoxSkus, + ShopId = item.ShopId, + ShopName = item.ShopName, + WareId = item.WareId, + WareName = item.WareName, + + }); + })); + + } + } + else + { + //App.Current.Dispatcher.BeginInvoke(new Action(() => + //{ + // new TipsWindow("查不到数据").Show(); + //})); + } + IsLoadCount(); + IsLoading = false; + + }); + else + + Task.Factory.StartNew(() => { - var dataModel = datas.Data; - OrderCount = dataModel.TotalCount; - foreach (var item in dataModel.Items) + PackTaskList = new ObservableCollection();//初始化数据 + + var datas = packTaskService.GetWareHouseList(SearchWayBillNo,SearchExpressName,IsWorry, SearchDepartment, SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), SearchShopName, + PageIndex, PageSize); + if (datas != null && datas.Data != null && datas.Success) { - var data = new PackTaskModel() + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.Items) { - AcceptName = item.UserName, - Availability = (TaskState)item.Availability, - BasicPack = (BasicPack)item.BasicPack, - DepartmentName = item.DepartmentName, - CertificatePosition = (CertificatePosition)item.CertificatePosition, - - GoodsNumber = item.GoodsNumber, - Increment1 = item.Increment1, - ItemList = new List() { new SkuMessage + var data = new PackTaskModel() + { + AcceptName = item.UserName, + Availability = (TaskState)item.Availability, + BasicPack = (BasicPack)item.BasicPack, + DepartmentName = item.DepartmentName, + CertificatePosition = (CertificatePosition)item.CertificatePosition, + + GoodsNumber = item.GoodsNumber, + Increment1 = item.Increment1, + ItemList = new List() { new SkuMessage { BrandName = item.BrandName, GoodsNo = item.ProductItemNum, Logo= item.Logo, ShopName = item.ShopName, SkuName = item.SkuName, Id = item.SkuId } }, - MarkMessage = item.MarkMessage, - PackType = (PackType)item.PackType, - TaskState = item.TaskState, - PositionType = item.PositionType, - SkuCount = item.SkuCount, - SkuTitle = item.SkuGoodsTitle, - TaskId = item.TaskId, - EndTime = item.CreateTime, - OrderId = item.OrderId, - SkuId = item.SkuId, - SkuName = item.SkuName, - - }; - if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) - { - - data.BarCodeModel = item.BarCodeDTO; - - } - if (item.Cers != null) - { - data.CertificateModel = item.Cers; + MarkMessage = item.MarkMessage, + PackType = (PackType)item.PackType, + TaskState = item.TaskState, + PositionType = item.PositionType, + SkuCount = item.SkuCount, + SkuTitle = item.SkuGoodsTitle, + TaskId = item.TaskId, + EndTime = item.CreateTime, + OrderId = item.OrderId, + SkuId = item.SkuId, + SkuName = item.SkuName, + + }; + if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) + { + + data.BarCodeModel = item.BarCodeDTO; + + } + if (item.Cers != null) + { + data.CertificateModel = item.Cers; + + } + + data.ReflashTask = ReflashTask; + + if (item.FeesItemResponse != null) + { + data.FeesItemResponse = item.FeesItemResponse; + data.FeesMoney = item.FeesItemResponse.SingleFees; + + data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * + item.FeesItemResponse.disCount; + data.IsShowFees = data.FeesMoney > 0 ? true : false; + + } + else + { + data.IsShowFees = false; + } + + if (item.PackUserName != null && item.PackUserName.Count() > 0) + { + data.PackUser = string.Join("\r\n", item.PackUserName); + } + + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + PackTaskList.Add(data); + })); } + } + else + { + //App.Current.Dispatcher.BeginInvoke(new Action(() => + //{ + // new TipsWindow("查不到数据").Show(); + //})); + } + IsLoadCount(); + IsLoading = false; + }); - data.ReflashTask = ReflashTask; - - if (item.FeesItemResponse != null) - { - data.FeesItemResponse = item.FeesItemResponse; - data.FeesMoney = item.FeesItemResponse.SingleFees; - - data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * - item.FeesItemResponse.disCount; - data.IsShowFees = data.FeesMoney > 0 ? true : false; - } - else - { - data.IsShowFees = false; - } - if (item.PackUserName != null && item.PackUserName.Count() > 0) - { - data.PackUser = string.Join("\r\n", item.PackUserName); - } - App.Current.Dispatcher.BeginInvoke(new Action(() => - { - PackTaskList.Add(data); - })); - } - } - else - { - //App.Current.Dispatcher.BeginInvoke(new Action(() => - //{ - // new TipsWindow("查不到数据").Show(); - //})); - } - IsLoadCount(); - IsLoading = false; - }); } private void IsLoadCount() diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs index 2478023f..1c2ad88f 100644 --- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs +++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs @@ -599,12 +599,10 @@ namespace BBWY.Client.ViewModels OrderId =model.OrderId; SkuId = model.SkuId; SkuName = model.ItemList[0].SkuName; - Logo = model.ItemList[0].Logo.Replace("80x80", "200x200").Replace("200x200", "150x150"); + Logo = model.ItemList[0].Logo.Replace("80x80", "200x200"); BrandName = model.ItemList[0].BrandName; - SkuCount = model.SkuCount; brand = model.Brand; - ProductNo = model.ProductNo; MarkMessage = model.MarkMessage; PackType = model.PackType; @@ -613,6 +611,9 @@ namespace BBWY.Client.ViewModels BasicPack = model.BasicPack; CertificatePosition = model.CertificatePosition; + ArrivalQuantity = 0; + GoodProductQuantity = 0; + string[] increateDatas = model.Increment1?.Split(','); bool isSelected = false; diff --git a/BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml b/BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml new file mode 100644 index 00000000..3fe553c7 --- /dev/null +++ b/BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml.cs b/BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml.cs new file mode 100644 index 00000000..ebc5fcce --- /dev/null +++ b/BBWY.Client/Views/PackTask/WaitSealBoxControl.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.PackTask +{ + /// + /// WaitSealBoxControl.xaml 的交互逻辑 + /// + public partial class WaitSealBoxControl : UserControl + { + public WaitSealBoxControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/PackTask/WareHouseList.xaml b/BBWY.Client/Views/PackTask/WareHouseList.xaml index df7c406b..c05d5d70 100644 --- a/BBWY.Client/Views/PackTask/WareHouseList.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseList.xaml @@ -10,7 +10,7 @@ xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:sys="clr-namespace:System;assembly=mscorlib" DataContext="{Binding WareHouseList,Source={StaticResource Locator}}" - mc:Ignorable="d" + mc:Ignorable="d" Background="White" d:DesignHeight="450" d:DesignWidth="2048" Title="TaskList"> @@ -69,7 +69,8 @@ - + @@ -86,11 +87,16 @@ + + + + + - +