From d08a424e341e723c9b5869a20bf5dfbed3ec4e82 Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Tue, 20 Jun 2023 11:15:05 +0800 Subject: [PATCH] 1 --- BBWY.Client/App.xaml.cs | 2 +- BBWY.Client/Helpers/MyPrintHelper.cs | 236 +++++++++--------- BBWY.Client/Models/MappingProfile.cs | 1 + BBWY.Client/Models/Order/Order.cs | 1 + BBWY.Client/Models/PackTask/PackTaskModel.cs | 23 +- .../AfterSaleOrder/AfterSaleOrder.cs | 4 +- .../AfterSaleOrder/AfterSaleOrderGroup.cs | 2 +- .../ViewModels/Order/OrderListViewModel.cs | 1 + .../PackTask/PackServiceViewModel.cs | 32 +-- .../ViewModels/PackTask/TaskListViewModel.cs | 2 + .../PackTask/WareHouseListViewModel.cs | 53 +++- .../QualityTask/QualityViewModel.cs | 2 +- .../Views/FallWare/WaitFallWareControl.xaml | 8 +- ...AfterSaleOrderRefundPurchaseAmount.xaml.cs | 2 +- .../Views/Order/EditAfterSaleOrderSku.xaml.cs | 2 +- BBWY.Client/Views/PackTask/PersonList.xaml | 95 ------- BBWY.Client/Views/PackTask/PersonList.xaml.cs | 135 ---------- .../Views/PackTask/ServiceWindow.xaml.cs | 18 +- 18 files changed, 221 insertions(+), 398 deletions(-) rename BBWY.Client/Models/{ => Statistics}/AfterSaleOrder/AfterSaleOrder.cs (97%) rename BBWY.Client/Models/{ => Statistics}/AfterSaleOrder/AfterSaleOrderGroup.cs (85%) delete mode 100644 BBWY.Client/Views/PackTask/PersonList.xaml delete mode 100644 BBWY.Client/Views/PackTask/PersonList.xaml.cs diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index d5bd7c5e..81e519b5 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -126,7 +126,7 @@ namespace BBWY.Client serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); - //serviceCollection.AddScoped(); + serviceCollection.AddScoped(); #region 注册拳探SDK相关类 serviceCollection.AddSingleton(); diff --git a/BBWY.Client/Helpers/MyPrintHelper.cs b/BBWY.Client/Helpers/MyPrintHelper.cs index cb054b7e..3ee35e82 100644 --- a/BBWY.Client/Helpers/MyPrintHelper.cs +++ b/BBWY.Client/Helpers/MyPrintHelper.cs @@ -1,6 +1,7 @@ using BarcodeLib; using BBWY.Client.Extensions; using BBWY.Client.Models; +using BBWY.Client.Models.FallWare; using BBWY.Client.Models.PackTask; using NPOI.XSSF.UserModel; using Spire.Xls; @@ -198,100 +199,100 @@ namespace BBWY.Client.Helpers private static void SetCerStander(ref PrintPageEventArgs args, CertificateModel certificate, Font font) { -//#if DEBUG -// Bitmap bitmap = new Bitmap(236, 157); -// // Bitmap bitmap = new Bitmap(500, 500); -// Graphics graphics = Graphics.FromImage(bitmap); - -// var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域 -// graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置 -// graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域 -// int bigJiange = 20;//合格证与品牌的高度差 -// var heightSpace = 4;//所有行间隔高度 -// if (!string.IsNullOrEmpty(certificate.ProduceDate)) -// { -// bigJiange = 10; heightSpace = 3; -// } - -// int standerSpace = 1;//执行标准之间的 -// if (certificate.IsLogo == 1)//含图标 -// { -// string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); -// string path = appPath + $"/Resources/Images/3c.png"; -// Image image = Image.FromFile(path); -// graphics.DrawImage(image, 190, 7, 28, 21); -// graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28); -// } - -// var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); -// string cerName = "合格证"; -// SizeF bigSize = graphics.MeasureString(cerName, fontBig); - -// float verHeight = bigJiange + bigSize.Height; -// graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); - -// graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); -// if (!string.IsNullOrEmpty(certificate.ProductNo)) -// graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); -// var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度 - -// verHeight += (smallSize.Height + heightSpace); -// graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - -// graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); - -// StringBuilder sb = new StringBuilder(); -// var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries); -// int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数 - -// for (int i = 0; i < excutes.Count(); i++) -// { -// if (i % 2 == 0 && i > 0)//间隔两个换行 -// { -// sb.Append("\n"); -// } -// sb.Append(excutes[i]).Append(" "); -// } -// sb.Remove(sb.Length - 3, 3); -// var rows = sb.ToString().Split('\n'); -// string excuteStander = "执行标准: "; -// smallSize = graphics.MeasureString(excuteStander, font); -// verHeight += (smallSize.Height + heightSpace); -// graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - -// for (int i = 1; i < rows.Count(); i++) -// { -// verHeight += (smallSize.Height + standerSpace); -// graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight)); -// } - -// if (!string.IsNullOrEmpty(certificate.ProduceDate)) -// { -// verHeight += (smallSize.Height + heightSpace) - 3; -// graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); -// } - -// verHeight += (smallSize.Height + heightSpace); -// RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace); -// var productStr = $"生产商: {certificate.ProductShop}"; -// if (graphics.MeasureString(productStr, font).Width <= 220) -// { -// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight); -// verHeight += smallSize.Height + heightSpace; -// } -// else -// { -// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect); -// verHeight += 2 * smallSize.Height + heightSpace; -// } -// var productShop = graphics.MeasureString("生产商", font); -// var adress = graphics.MeasureString("地 址", font); - -// var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); -// graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); - -// var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); -// bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png); + //#if DEBUG + // Bitmap bitmap = new Bitmap(236, 157); + // // Bitmap bitmap = new Bitmap(500, 500); + // Graphics graphics = Graphics.FromImage(bitmap); + + // var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域 + // graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置 + // graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域 + // int bigJiange = 20;//合格证与品牌的高度差 + // var heightSpace = 4;//所有行间隔高度 + // if (!string.IsNullOrEmpty(certificate.ProduceDate)) + // { + // bigJiange = 10; heightSpace = 3; + // } + + // int standerSpace = 1;//执行标准之间的 + // if (certificate.IsLogo == 1)//含图标 + // { + // string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + // string path = appPath + $"/Resources/Images/3c.png"; + // Image image = Image.FromFile(path); + // graphics.DrawImage(image, 190, 7, 28, 21); + // graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28); + // } + + // var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); + // string cerName = "合格证"; + // SizeF bigSize = graphics.MeasureString(cerName, fontBig); + + // float verHeight = bigJiange + bigSize.Height; + // graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); + + // graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + // if (!string.IsNullOrEmpty(certificate.ProductNo)) + // graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + // var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度 + + // verHeight += (smallSize.Height + heightSpace); + // graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + + // graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + + // StringBuilder sb = new StringBuilder(); + // var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries); + // int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数 + + // for (int i = 0; i < excutes.Count(); i++) + // { + // if (i % 2 == 0 && i > 0)//间隔两个换行 + // { + // sb.Append("\n"); + // } + // sb.Append(excutes[i]).Append(" "); + // } + // sb.Remove(sb.Length - 3, 3); + // var rows = sb.ToString().Split('\n'); + // string excuteStander = "执行标准: "; + // smallSize = graphics.MeasureString(excuteStander, font); + // verHeight += (smallSize.Height + heightSpace); + // graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + + // for (int i = 1; i < rows.Count(); i++) + // { + // verHeight += (smallSize.Height + standerSpace); + // graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight)); + // } + + // if (!string.IsNullOrEmpty(certificate.ProduceDate)) + // { + // verHeight += (smallSize.Height + heightSpace) - 3; + // graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + // } + + // verHeight += (smallSize.Height + heightSpace); + // RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace); + // var productStr = $"生产商: {certificate.ProductShop}"; + // if (graphics.MeasureString(productStr, font).Width <= 220) + // { + // graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight); + // verHeight += smallSize.Height + heightSpace; + // } + // else + // { + // graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect); + // verHeight += 2 * smallSize.Height + heightSpace; + // } + // var productShop = graphics.MeasureString("生产商", font); + // var adress = graphics.MeasureString("地 址", font); + + // var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); + // graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); + + // var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + // bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png); int bigJiange = 20;//合格证与品牌的高度差 @@ -322,8 +323,8 @@ namespace BBWY.Client.Helpers args.Graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); args.Graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - if(!string.IsNullOrEmpty(certificate.ProductNo)) - args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + if (!string.IsNullOrEmpty(certificate.ProductNo)) + args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); var smallSize = args.Graphics.MeasureString(certificate.Brand, font);//小字体高度 verHeight += (smallSize.Height + heightSpace); @@ -378,7 +379,7 @@ namespace BBWY.Client.Helpers var productShop = args.Graphics.MeasureString("生产商", font); var adress = args.Graphics.MeasureString("地 址", font); - var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight- 2, 220, smallSize.Height * 3 + heightSpace); + var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); @@ -492,7 +493,7 @@ namespace BBWY.Client.Helpers int bigJiange = 20;//合格证与品牌的高度差 var heightSpace = 4;//所有行间隔高度 int standerSpace = 1;//执行标准之间的 - if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10; + if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10; var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); string cerName = "合格证"; SizeF bigSize = args.Graphics.MeasureString(cerName, fontBig); @@ -551,7 +552,7 @@ namespace BBWY.Client.Helpers } if (!string.IsNullOrEmpty(certificate.ProduceDate)) { - verHeight += (smallSize.Height + heightSpace)-3; + verHeight += (smallSize.Height + heightSpace) - 3; args.Graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); } verHeight += (smallSize.Height + heightSpace); @@ -571,7 +572,7 @@ namespace BBWY.Client.Helpers var productShop = args.Graphics.MeasureString("生产商", font); var adress = args.Graphics.MeasureString("地 址", font); - var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight-2, 220, smallSize.Height * 3 + heightSpace); + var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); @@ -596,7 +597,7 @@ namespace BBWY.Client.Helpers - public static BitmapImage GetBarcodeImage(string printStr,int width,int height) + public static BitmapImage GetBarcodeImage(string printStr, int width, int height) { Bitmap image = new Bitmap(width, height); Graphics graphics2 = Graphics.FromImage(image); @@ -606,7 +607,7 @@ namespace BBWY.Client.Helpers return bitmapToBitmapImage(image); } - static BitmapImage bitmapToBitmapImage(Bitmap bitmap) + static BitmapImage bitmapToBitmapImage(Bitmap bitmap) { using (var stream = new MemoryStream()) { @@ -623,18 +624,21 @@ namespace BBWY.Client.Helpers } - public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount ) + + /// + /// 打印封箱 + /// + /// + /// + /// + /// + public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount) { // 100*180 UnitConverHelper unitConverHelper = new UnitConverHelper(); - var data = unitConverHelper.MmToPx(100, 180); - - - - - + var data = unitConverHelper.MmToPx(100, 180); var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string printNamePath = $"{applicationPath}/printSealName.init"; if (File.Exists(printNamePath)) @@ -659,11 +663,8 @@ namespace BBWY.Client.Helpers XSSFWorkbook wb2 = new XSSFWorkbook(); - //wb2.CreateSheet("Sheet1"); sheet.CopyTo(wb2, "Sheet1", true, false); var sheet2 = wb2.GetSheet("Sheet1"); - - var nameCell2 = sheet2.GetRow(0).GetCell(1); nameCell2.SetCellValue(sealBoxModel.ShopName); @@ -693,7 +694,7 @@ namespace BBWY.Client.Helpers Workbook workbook = new Workbook(); workbook.LoadFromFile(newExccel); - + Worksheet wsheet = workbook.Worksheets[0]; wsheet.PageSetup.PaperSize = PaperSizeType.PaperA4; @@ -711,6 +712,15 @@ namespace BBWY.Client.Helpers print.Print(); } + /// + /// 打印京东箱唛 + /// + public static void PrintJDBoxWareData(JDWareBoxModel jDWareBoxModel,string printName) + { + + } + + public static void SetDefaultPrint(string printName) { diff --git a/BBWY.Client/Models/MappingProfile.cs b/BBWY.Client/Models/MappingProfile.cs index adfde434..79e99062 100644 --- a/BBWY.Client/Models/MappingProfile.cs +++ b/BBWY.Client/Models/MappingProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using BBWY.Client.Models.Statistics.AfterSaleOrder; namespace BBWY.Client.Models { diff --git a/BBWY.Client/Models/Order/Order.cs b/BBWY.Client/Models/Order/Order.cs index d1a22b7e..a93c95dd 100644 --- a/BBWY.Client/Models/Order/Order.cs +++ b/BBWY.Client/Models/Order/Order.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using BBWY.Client.Models.Statistics.AfterSaleOrder; namespace BBWY.Client.Models { diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs index 35f32384..9d46cf3b 100644 --- a/BBWY.Client/Models/PackTask/PackTaskModel.cs +++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs @@ -101,26 +101,9 @@ namespace BBWY.Client.Models private void SetService() { - ServiceWindow service = new ServiceWindow(); - //加载数据 - ViewModelLocator viewModelLocator = (ViewModelLocator)App.Current.Resources["Locator"]; - var serviceViewModel = viewModelLocator.PackServiceList; - - serviceViewModel.PackTaskModel = this; - serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection { this }; - serviceViewModel.FloorDragNumber = this.FloorDragNumber; - serviceViewModel.TaskCount = SkuCount; - serviceViewModel.TaskId = TaskId; - serviceViewModel.OrderId = OrderId; - serviceViewModel.SkuId = SkuId; - serviceViewModel.PackUserName = this.PackUser?.Replace("\r\n", ",")?.Replace("\n", ",")?.Replace("\r", ","); - serviceViewModel.LoadPackDatas(); - - - serviceViewModel.SetAllFees = new Action(() => - { - if (ReflashTask != null) ReflashTask(); - }); + + + ServiceWindow service = new ServiceWindow(this, ReflashTask); service.Show(); } diff --git a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs similarity index 97% rename from BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs rename to BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs index 04785a6d..efcd93b4 100644 --- a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs +++ b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs @@ -1,6 +1,6 @@ using System; -namespace BBWY.Client.Models +namespace BBWY.Client.Models.Statistics.AfterSaleOrder { public class AfterSaleOrder : NotifyObject, ICloneable { @@ -146,7 +146,7 @@ namespace BBWY.Client.Models public object Clone() { - return this.MemberwiseClone(); + return MemberwiseClone(); } } } diff --git a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs similarity index 85% rename from BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs rename to BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs index 49840022..92a26953 100644 --- a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs +++ b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace BBWY.Client.Models +namespace BBWY.Client.Models.Statistics.AfterSaleOrder { public class AfterSaleOrderGroup { diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs index 28946e89..3372a4c3 100644 --- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs +++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs @@ -1,6 +1,7 @@ using BBWY.Client.APIServices; using BBWY.Client.Helpers; using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Client.Views.Order; using BBWY.Common.Extensions; using BBWY.Common.Models; diff --git a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs index a821ab98..bc724769 100644 --- a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs @@ -32,7 +32,7 @@ using System.Windows.Media.Imaging; namespace BBWY.Client.ViewModels.PackTask { - public class PackServiceViewModel : BaseVM, IDenpendency + public class PackServiceViewModel : BaseVM { @@ -132,7 +132,7 @@ namespace BBWY.Client.ViewModels.PackTask readonly PackTaskService packTaskService; readonly ConsumableService consumableService; readonly PackDetailService packDetailService; - readonly BatchPurchaseService batchPurchaseService; + private ObservableCollection increateList = new ObservableCollection(); public ObservableCollection IncreateList { get => increateList; set { Set(ref increateList, value); } } // @@ -179,7 +179,7 @@ namespace BBWY.Client.ViewModels.PackTask /// public ObservableCollection BasicPackServiceList { get; set; } = new ObservableCollection(); - private readonly PackServiceService packServiceService; + /// /// 加载原数据 @@ -236,14 +236,14 @@ namespace BBWY.Client.ViewModels.PackTask } - public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackServiceService packServiceService, PackDetailService packDetailService, BatchPurchaseService batchPurchaseService)//, long taskId + public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackDetailService packDetailService)//, long taskId { //TaskId = taskId; this.consumableService = consumableService; this.packTaskService = packTaskService; - this.packServiceService = packServiceService; + this.packDetailService = packDetailService; - this.batchPurchaseService = batchPurchaseService; + AddIncreateServiceCommand = new RelayCommand(AddIncreateService); @@ -616,7 +616,7 @@ namespace BBWY.Client.ViewModels.PackTask var res = packDetailService.SetPackTaskDetail(packTaskDetail); - if (res==null) + if (res == null) { System.Windows.MessageBox.Show("网络异常!"); return; @@ -627,18 +627,18 @@ namespace BBWY.Client.ViewModels.PackTask return; } - - // new TipsWindow("上传成功!").Show(); - var win = obj as System.Windows.Window; - if (SetAllFees != null) - SetAllFees(); - win.Close(); - + + // new TipsWindow("上传成功!").Show(); + var win = obj as System.Windows.Window; + if (ReflashWindow != null) + ReflashWindow(); + win.Close(); + } /// - /// 更新 打包员 和费用数据 + /// 刷新界面 /// - public Action SetAllFees { get; set; } + public Action ReflashWindow { get; set; } private void AddPackService() { diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index c6e222e3..2bf03a4b 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -652,6 +652,7 @@ namespace BBWY.Client.ViewModels.PackTask } } IsLoadSealBoxCount(); + IsLoadCount(); } catch (Exception ex) { @@ -723,6 +724,7 @@ namespace BBWY.Client.ViewModels.PackTask } IsLoadFallWareCount(); + IsLoadCount(); } catch (Exception ex) diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 37acb084..2159ac70 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -263,9 +263,6 @@ namespace BBWY.Client.ViewModels.PackTask //加载数据 SetTaskState(null); - - - UpdateTaskStateCommand = new RelayCommand(UpdateTaskState); CompeteSealBoxCommand = new RelayCommand(CompeteSealBox); @@ -285,6 +282,40 @@ namespace BBWY.Client.ViewModels.PackTask LookBoxConfigureCommand = new RelayCommand(LookBoxConfigure); + + PrintBoxConfigureCommand = new RelayCommand(PrintBoxConfigure); + } + + + /// + /// todo: 打印数据 + /// + /// + private void PrintBoxConfigure(object obj) + { + var fallware = obj as WaitFallWareModel; + + JDWareBoxModel model = new JDWareBoxModel + { + ShopName = globalContext.User.Shop.ShopName, + WareName = fallware.WareName, + SealBoxId = fallware.SealBoxId, + ProductCount = fallware.ProductCount, + BoxCount = fallware.SealBoxCount, + PrewOrder = fallware.BoxConfigureData.PrewOrder, + ProductTitle = fallware.BoxConfigureData.ProductTitle, + PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder, + WaybillNo = fallware.BoxConfigureData.WaybillNo + }; + if (fallware.WareType == WareType.京仓) + { + //加载模板数据 + } + if (fallware.WareType == WareType.云仓) + { + + } + //打印 } private void LookBoxConfigure(object obj) @@ -406,16 +437,20 @@ namespace BBWY.Client.ViewModels.PackTask /// 设置分箱数量 /// public ICommand SetSealBoxCommand { get; set; } + + /// + /// 打印封箱数据 + /// + public ICommand PrintBoxConfigureCommand { get; set; } - - /// - /// 完成封箱 - /// - /// - private void CompeteSealBox(object obj) + /// + /// 完成封箱 + /// + /// + private void CompeteSealBox(object obj) { var model = (SealBoxModel)obj; diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs index ef1ec561..7f61d55e 100644 --- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs +++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs @@ -663,7 +663,7 @@ namespace BBWY.Client.ViewModels IsNeedCertificateModel = Need.需要; return; } - var skus = PurchaseSkuList.SingleOrDefault(p => p.PurchaseSkuId == s.PurchaseSkuId); + var skus = PurchaseSkuList.SingleOrDefault(p =>p.cerDTO!=null&& p.cerDTO.PurchaseSkuId == s.PurchaseSkuId); skus.CerDTO = s; skus.IsSetCertificate = false; skus.IsNeedCer = PackCerState == PackCerState.合格证信息; diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml index fb4eb870..0603d262 100644 --- a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml +++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml @@ -249,9 +249,13 @@ Command="{Binding DataContext.LookBoxConfigureCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" /> - + - diff --git a/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs b/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs index cfd865a1..2844739a 100644 --- a/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs +++ b/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs @@ -1,4 +1,4 @@ -using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Controls; using System.Windows; diff --git a/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs b/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs index 2ee8b953..15675dcc 100644 --- a/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs +++ b/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs @@ -1,4 +1,4 @@ -using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Controls; namespace BBWY.Client.Views.Order diff --git a/BBWY.Client/Views/PackTask/PersonList.xaml b/BBWY.Client/Views/PackTask/PersonList.xaml deleted file mode 100644 index 0b6eb677..00000000 --- a/BBWY.Client/Views/PackTask/PersonList.xaml +++ /dev/null @@ -1,95 +0,0 @@ - - - 0 - 1 - 2 - 6 - 14 - 29 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -