diff --git a/BBWY.Client/APIServices/QiKu/PackServiceService.cs b/BBWY.Client/APIServices/QiKu/PackServiceService.cs deleted file mode 100644 index 3c19f318..00000000 --- a/BBWY.Client/APIServices/QiKu/PackServiceService.cs +++ /dev/null @@ -1,49 +0,0 @@ -using BBWY.Client.Models.APIModel.Response.PackTask; -using BBWY.Client.Models.PackTask; -using BBWY.Common.Http; -using BBWY.Common.Models; -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Text; - -namespace BBWY.Client.APIServices -{ - public class PackServiceService : BaseApiService,IDenpendency - { - public PackServiceService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) - { - } - - public ApiResponse SearchAll() - { - return SendRequest(globalContext.QKApiHost, "api/PackService/SearchAll", - null - , null, HttpMethod.Get); - } - - public ApiResponse Add(PackServiceDTO consumable) - { - return SendRequest(globalContext.QKApiHost, "api/PackService/Add", - consumable - , null, HttpMethod.Post); - } - public ApiResponse Edit(PackServiceDTO consumable) - { - return SendRequest(globalContext.QKApiHost, "api/PackService/Edit", - consumable - , null, HttpMethod.Post); - } - - - public ApiResponse Deleted(long id) - { - return SendRequest(globalContext.QKApiHost, "api/PackService/Deleted", - new - { - id = id - } - , null, HttpMethod.Get); - } - } -} diff --git a/BBWY.Client/APIServices/QiKu/PackTaskAbortService.cs b/BBWY.Client/APIServices/QiKu/PackTaskAbortService.cs new file mode 100644 index 00000000..385468a5 --- /dev/null +++ b/BBWY.Client/APIServices/QiKu/PackTaskAbortService.cs @@ -0,0 +1,62 @@ +using BBWY.Client.Models; +using BBWY.Client.Models.APIModel.Response.PackTask; +using BBWY.Common.Http; +using BBWY.Common.Models; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; + +namespace BBWY.Client.APIServices.QiKu +{ + public class PackTaskAbortService : BaseApiService, IDenpendency + { + public PackTaskAbortService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) + { + } + + + + public ApiResponse AbortPackTask(long TaskId, int TaskExceptionType, string RemarkMsg, TaskState AbortTaskState, string ShelvesNumber, int? FloorNumber) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTaskAbort/AbortPackTask?taskId={TaskId}", + new + { + TaskId, + TaskExceptionType, + RemarkMsg, + UserName = globalContext.User.Name, + AbortTaskState, + ShelvesNumber, + FloorNumber + } + , null, HttpMethod.Post); + } + + public ApiResponse DisposedPackTask(long TaskId) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTaskAbort/DisposedPackTask?taskId={TaskId}", + new { + TaskId, + UserName = globalContext.User.Name + + } + , null, HttpMethod.Post); + } + + public ApiResponse UpdateAbortPackTask(long TaskId, TaskState TaskState, string ShelvesNumber,int? FloorNumber) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTaskAbort/UpdateAbortPackTask", + new + { + TaskId, + TaskState, + ShelvesNumber, + FloorNumber, + UserName = globalContext.User.Name + + } + , null, HttpMethod.Post); + } + } +} diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index adfeac47..1c48f40a 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -442,7 +442,7 @@ namespace BBWY.Client.APIServices } - public ApiResponse SplitPackTask(long nowTaskId, int ExceptionCount, TaskExceptionType TaskExceptionType, string RemarkMsg, TaskState AbortTaskState) + public ApiResponse SplitPackTask(long nowTaskId, int ExceptionCount,TaskState AbortTaskState) { return SendRequest(globalContext.QKApiHost, "api/PackTask/SplitPackTask", new @@ -450,17 +450,23 @@ namespace BBWY.Client.APIServices UserName = globalContext.User.Name, nowTaskId, ExceptionCount, - TaskExceptionType, - RemarkMsg, - AbortTaskState - + AbortTaskState, } , null, HttpMethod.Post); } + /// + /// 创建任务 新版 + /// + /// + /// + public ApiResponse GetTaskAbortEnum() + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/GetTaskAbortEnum",null , null, HttpMethod.Get); + } + - } diff --git a/BBWY.Client/APIServices/QiKu/QualityTaskService.cs b/BBWY.Client/APIServices/QiKu/QualityTaskService.cs index dec66c46..488704d7 100644 --- a/BBWY.Client/APIServices/QiKu/QualityTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/QualityTaskService.cs @@ -54,19 +54,7 @@ namespace BBWY.Client.APIServices.QiKu - public ApiResponse QualityTaskException(long TaskId, TaskExceptionType TaskExceptionType, string RemarkMsg, TaskState AbortTaskState) - { - return SendRequest(globalContext.QKApiHost, $"api/QualityTask/QualityTaskException", - new - { - TaskId, - TaskExceptionType, - RemarkMsg, - UserName = globalContext.User.Name, - AbortTaskState - } - , null, HttpMethod.Post); - } + diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index dd2644bb..95b6510d 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -73,12 +73,12 @@ namespace BBWY.Client //齐越琳琳 - // userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjY4NDI2OTQyNTY0NTM2MzIwIiwidGVhbUlkIjoiMTUxNjcxNTM3MjQ0NTcwMDA5NiIsInNvblRlYW1JZHMiOiIxNzE4NTQxMDYzMzk3ODM4ODQ4LDE1MTY3MTUzNzI0NDU3MDAwOTYiLCJleHAiOjE3MzAyODcxNjh9.6vXadZWQfhnxbR3320RloKv3LqqbNdZ7wDDfO3tY_5U"; + //userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjY4NDI2OTQyNTY0NTM2MzIwIiwidGVhbUlkIjoiMTUxNjcxNTM3MjQ0NTcwMDA5NiIsInNvblRlYW1JZHMiOiIxNzE4NTQxMDYzMzk3ODM4ODQ4LDE1MTY3MTUzNzI0NDU3MDAwOTYiLCJleHAiOjE3MzAyODcxNjh9.6vXadZWQfhnxbR3320RloKv3LqqbNdZ7wDDfO3tY_5U"; //齐越季夏 // userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjIyNzY3NTkzODM0MTU2MDMyIiwidGVhbUlkIjoiMTUxNjcxNTM3MjQ0NTcwMDA5NiIsInNvblRlYW1JZHMiOiIxNTE2NzE1MzcyNDQ1NzAwMDk2LDE3MTg1NDEwNjMzOTc4Mzg4NDgiLCJleHAiOjE3MzAyODcxNjh9.ZGBU0MoJbKdkgqe9x2e3l6q-AVZwfAkUwa3oB47PWhY"; //店铺自打包 - //userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNzE5Nzc5OTU4MTYwNjI1NjY0IiwidGVhbUlkIjoiMTU0MDg4NTU3MDYyNzA0NzQyNCIsInNvblRlYW1JZHMiOiIxNzE4NTQxMDYzMzk3ODM4ODQ4IiwiZXhwIjoxNzMxNzI1NDA2fQ.VV6k8nDqTtQOY6_ma6QcX6geMU_kaswl16BGXF89so8"; + // userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNzE5Nzc5OTU4MTYwNjI1NjY0IiwidGVhbUlkIjoiMTU0MDg4NTU3MDYyNzA0NzQyNCIsInNvblRlYW1JZHMiOiIxNzE4NTQxMDYzMzk3ODM4ODQ4IiwiZXhwIjoxNzMxNzI1NDA2fQ.VV6k8nDqTtQOY6_ma6QcX6geMU_kaswl16BGXF89so8"; #else //var uid = e.Args.Count() > 0 ? e.Args.LastOrDefault(args => args.StartsWith("uid:")) : string.Empty; //if (string.IsNullOrEmpty(uid)) diff --git a/BBWY.Client/Converters/MultiStateConverter.cs b/BBWY.Client/Converters/MultiStateConverter.cs new file mode 100644 index 00000000..a44595fb --- /dev/null +++ b/BBWY.Client/Converters/MultiStateConverter.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows.Data; + +namespace BBWY.Client.Converters +{ + public class MultiStateConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + + var param = parameter?.ToString(); + + var parms = param.Split(":"); + + + if (values == null||values.Count()<2) return null; + + string taskState = values[0]?.ToString(); + string exceptState = values[1]?.ToString(); + + + if (taskState != param) + { + return taskState ; + } + else + { + return exceptState; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs b/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs index bc347744..9c774608 100644 --- a/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs @@ -11,49 +11,49 @@ namespace BBWY.Client.Models.APIModel.Request /// 任务id /// public long TaskId { get; set; } - /// - /// 拳探订单id - /// - public string OrderId { get; set; } - /// - /// skuid - /// - public string SkuId { get; set; } - /// - /// 备注信息 - /// - public string MarkMessage { get; set; } - /// - /// 配件数 - /// - public int GoodsNumber { get; set; } - /// - /// sku配件名称 - /// - public string SkuGoodsTitle { get; set; } + ///// + ///// 拳探订单id + ///// + //public string OrderId { get; set; } + ///// + ///// skuid + ///// + //public string SkuId { get; set; } + ///// + ///// 备注信息 + ///// + //public string MarkMessage { get; set; } + ///// + ///// 配件数 + ///// + //public int GoodsNumber { get; set; } + ///// + ///// sku配件名称 + ///// + //public string SkuGoodsTitle { get; set; } - /// - /// 增量1() - /// - public string Increment1 { get; set; } - /// - /// 基础包装(快递袋=0,纸箱=1,麻袋=2) - /// - public BasicPack BasicPack { get; set; } + ///// + ///// 增量1() + ///// + //public string Increment1 { get; set; } + ///// + ///// 基础包装(快递袋=0,纸箱=1,麻袋=2) + ///// + //public BasicPack BasicPack { get; set; } - /// - /// 打包类型(单件=0,多件=1) - /// - public PackType PackType { get; set; } + ///// + ///// 打包类型(单件=0,多件=1) + ///// + //public PackType PackType { get; set; } /// /// 货号品名(手写上传) /// public string BrandName { get; set; } - /// - /// 合格证位置(外部包装=0,产品包装=1) - /// - public CertificatePosition CertificatePosition { get; set; } + ///// + ///// 合格证位置(外部包装=0,产品包装=1) + ///// + //public CertificatePosition CertificatePosition { get; set; } /// /// 合格证id @@ -63,15 +63,15 @@ namespace BBWY.Client.Models.APIModel.Request /// 显示的条码Id /// public long? BarcodeId { get; set; } - /// - /// 到货数量 - /// - public int ArrivalQuantity { get; set; } + ///// + ///// 到货数量 + ///// + //public int ArrivalQuantity { get; set; } - /// - /// 良品数量 - /// - public int GoodProductQuantity { get; set; } + ///// + ///// 良品数量 + ///// + //public int GoodProductQuantity { get; set; } /// /// 品牌标签类型 diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/TaskAbortEnumResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/TaskAbortEnumResponse.cs new file mode 100644 index 00000000..20e9e3df --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/PackTask/TaskAbortEnumResponse.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class TaskAbortEnumResponse + { + + /// + /// 货架列表 + /// + public List ShelvesNumberList { get; set; } + + /// + /// 层数列表 + /// + public List FloorNumberList { get; set; } + + ///// + ///// 异常类型列表 + ///// + //public List TaskExceptionTypeList { get; set; } + /// + /// 是否能包装类型 + /// + public List IsCanPackModelList { get; set; } + } + + public class IsContinuePackageModel + { + /// + /// 可继续包装类型 + /// + public string Name { get; set; } + /// + /// 索引 + /// + public int Index { get; set; } + + /// + /// 异常类型列表 + /// + public List TaskExceptionTypeList { get; set; } + + } +} diff --git a/BBWY.Client/Models/APIModel/Response/PackagingTask/SearchPackagingTaskListResponse.cs b/BBWY.Client/Models/APIModel/Response/PackagingTask/SearchPackagingTaskListResponse.cs index f5842864..d9db54eb 100644 --- a/BBWY.Client/Models/APIModel/Response/PackagingTask/SearchPackagingTaskListResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackagingTask/SearchPackagingTaskListResponse.cs @@ -1,4 +1,5 @@ -using System; +using BBWY.Client.Models.APIModel.Response.PackTask; +using System; using System.Collections.Generic; using System.Text; @@ -223,5 +224,30 @@ namespace BBWY.Client.Models.APIModel /// 包装人 /// public string[] PackUserName { get; set; } + + + public FeesItemResponse FeesItemResponse { get; set; } + + /// + /// 异常类型 + /// + public string TaskExceptionType { get; set; } + + /// + /// 货架编号 + /// + public string ShelvesNumber { get; set; } + + /// + /// 货架层数 + /// + public int? FloorNumber { get; set; } + + /// + /// 挂起异常备注 + /// + public string AbortRemark { get; set; } + + public string OrderId { get; set; } } } diff --git a/BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs b/BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs index da16dd3c..2e4372c6 100644 --- a/BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs @@ -200,5 +200,31 @@ namespace BBWY.Client.Models.APIModel /// 任务挂起时间 /// public DateTime? TaskAbortTime { get; set; } + + + /// + /// 异常类型 + /// + public string TaskExceptionType { get; set; } + + /// + /// 货架编号 + /// + public string ShelvesNumber { get; set; } + + /// + /// 货架层数 + /// + public int? FloorNumber { get; set; } + + /// + /// 挂起异常备注 + /// + public string AbortRemark { get; set; } + + /// + /// 验收异常状态 + /// + public QualityTaskExceptionState? QualityTaskExceptionState { get; set; } } } diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs index 60a92508..fcfc0c3c 100644 --- a/BBWY.Client/Models/Enums.cs +++ b/BBWY.Client/Models/Enums.cs @@ -225,7 +225,9 @@ 未到货 = 0, 部分到货 = 1, 待验收 = 2,//已到货 + 待验收_挂起 = 21,//异常挂起 待包装 = 3, + 待包装_挂起 = 31,//异常挂起 待封箱 = 4, 待出库 = 5, 已完成 = 6, diff --git a/BBWY.Client/Models/PackTask/EnumModel.cs b/BBWY.Client/Models/PackTask/EnumModel.cs new file mode 100644 index 00000000..c13c00fe --- /dev/null +++ b/BBWY.Client/Models/PackTask/EnumModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models +{ + public class EnumModel + { + public string Name { get; set; } + public int Index { get; set; } + } +} diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs index 28efbdf0..35c26940 100644 --- a/BBWY.Client/Models/PackTask/PackTaskModel.cs +++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs @@ -1,4 +1,5 @@ using BBWY.Client.APIServices; +using BBWY.Client.APIServices.QiKu; using BBWY.Client.Models.APIModel; using BBWY.Client.Models.APIModel.Response.PackTask; using BBWY.Client.ViewModels; @@ -6,7 +7,10 @@ using BBWY.Client.ViewModels.PackTask; using BBWY.Client.Views.PackTask; using BBWY.Client.Views.QualityTask; using BBWY.Client.Views.QualityTipWindows; +using BBWY.Client.Views.SplitTask; +using BBWY.Client.Views.StorePickSelf; using GalaSoft.MvvmLight.Command; +using Microsoft.Extensions.DependencyInjection; using NPOI.Util; using System; using System.Collections.Generic; @@ -14,6 +18,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; +using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Input; @@ -29,7 +34,6 @@ namespace BBWY.Client.Models - private string taskIdRemark; /// ///任务备注(原任务:10000 子任务:10000-1) @@ -72,6 +76,31 @@ namespace BBWY.Client.Models /// public ICommand UpdateTaskCommand { get; set; } + /// + /// 任务拆分 + /// + public ICommand TaskSplitCommand { get; set; } + + /// + /// 挂起 + /// + public ICommand PackagingTaskExceptionCommand { get; set; } + + /// + /// 商家自取 + /// + public ICommand StoreGetBySelfCommand { get; set; } + /// + /// 包装任务释放挂起 + /// + public ICommand DisposeTaskCommand { get; set; } + + + /// + /// 删除任务 + /// + public ICommand DeletedTaskCommand { get; set; } + public Action ReflashTask { get; set; } private void UpdateTask() { @@ -106,20 +135,125 @@ namespace BBWY.Client.Models } - + private IServiceProvider sp; public PackTaskModel() { + sp = (App.Current as App).ServiceProvider; + + using (var ss = sp.CreateScope()) + { + packTaskService = ss.ServiceProvider.GetRequiredService(); + packTaskAbortService = ss.ServiceProvider.GetRequiredService(); + + } + + PrintBarcodeCommand = new RelayCommand(PrintBarcode); PrintCerCommand = new RelayCommand(PrintCer); LookBarCommand = new RelayCommand(LookBar); LookCerCommand = new RelayCommand(LookCer); SetServiceCommand = new RelayCommand(SetService); UpdateTaskCommand = new RelayCommand(UpdateTask); + DeletedTaskCommand = new RelayCommand(DeletedTask); + DisposeTaskCommand = new RelayCommand(DisposeTask); + StoreGetBySelfCommand = new RelayCommand(StoreGetBySelf); + PackagingTaskExceptionCommand = new RelayCommand(PackagingTaskException); + TaskSplitCommand = new RelayCommand(TaskSplit); + } + + PackTaskService packTaskService; + PackTaskAbortService packTaskAbortService; + private void PackagingTaskException(long taskId) + { + + var wareVm = (App.Current as App).ServiceProvider.GetRequiredService(); + AddExceptionWindow addExceptionWindow = new AddExceptionWindow(packTaskAbortService, taskId, Models.TaskState.待包装, ReflashTask, wareVm.IsCanPackModelList, wareVm.ShelvesNumberList, wareVm.FloorNumberList); + addExceptionWindow.ShowDialog(); } + private void TaskSplit(PackTaskModel model) + { + + SplitTaskWindow addExceptionWindow = new SplitTaskWindow(packTaskService, model.TaskId, model.TaskState, ReflashTask); + addExceptionWindow.ShowDialog(); + } + + + public void StoreGetBySelf(long taskId) + { + + //MessageBoxResult result = System.Windows.MessageBox.Show($"确定商家自取,任务id:{taskId}?", "提示", + // MessageBoxButton.YesNo, + // MessageBoxImage.Warning); + //if (result != MessageBoxResult.Yes) return; + + var data = packTaskService.GetStoreGetSelfData(taskId); + if (!data.Success) + { + MessageBox.Show(data?.Msg); + return; + } + + StorePickProductWindow sorePickProductWindow = new StorePickProductWindow(data.Data, (count, UserName) => + { + + var res = packTaskService.StoreGetBySelfV3(taskId, count, UserName); + if (res == null) + { + return false; + } + if (!res.Success) + { + System.Windows.MessageBox.Show(res.Msg, "错误信息"); + return false; + } + + + Task.Factory.StartNew(() => ReflashTask?.Invoke()); + + return true; + }, false); + sorePickProductWindow.ShowDialog(); + + + + } + /// + /// 手动释放挂起 + /// + /// + private void DisposeTask(long taskId) + { + if (System.Windows.MessageBox.Show("是否释放挂起?", "提示", + MessageBoxButton.YesNo, + MessageBoxImage.Warning) != MessageBoxResult.Yes) + return; + var res = packTaskAbortService.DisposedPackTask(taskId); + if (res == null || !res.Success) + { + System.Windows.MessageBox.Show(res?.Msg); + return; + } + + ReflashTask?.Invoke(); + } + + private void DeletedTask(object obj) + { + + + var packTaskmodel = (PackTaskModel)obj; + MessageBoxResult result = System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskIdRemark}?", "提示", + MessageBoxButton.YesNo, + MessageBoxImage.Warning); + if (result != MessageBoxResult.Yes) return; + packTaskService.DeletedTask(packTaskmodel.TaskId); + Task.Factory.StartNew(() => ReflashTask?.Invoke()); + } + private void SetService() { @@ -394,10 +528,18 @@ namespace BBWY.Client.Models public FeesItemResponse FeesItemResponse { get => feesItemResponse; set { Set(ref feesItemResponse, value); } } + private QualityTaskExceptionState? qualityTaskExceptionState; + + public QualityTaskExceptionState? QualityTaskExceptionState { get => qualityTaskExceptionState; set { Set(ref qualityTaskExceptionState, value); } } + + + private PackagingTaskExceptionState packagingTaskExceptionState; + /// /// 包装任务状态 /// - public Models.PackagingTaskExceptionState PackagingTaskExceptionState { get; set; } + public Models.PackagingTaskExceptionState PackagingTaskExceptionState { get => packagingTaskExceptionState; set { Set(ref packagingTaskExceptionState, value); } } + /// @@ -543,6 +685,29 @@ namespace BBWY.Client.Models /// 发送信息不全时间 /// public DateTime? SendToSetSkuConfigureTime { get; set; } + + + + + /// + /// 异常类型 + /// + public string TaskExceptionType { get; set; } + + /// + /// 货架编号 + /// + public string ShelvesNumber { get; set; } + + /// + /// 货架层数 + /// + public int? FloorNumber { get; set; } + + /// + /// 挂起异常备注 + /// + public string AbortRemark { get; set; } } public class SkuMessage : NotifyObject diff --git a/BBWY.Client/Models/PackTask/ShopTotal.cs b/BBWY.Client/Models/PackTask/ShopTotal.cs index 40dfcb09..30114d12 100644 --- a/BBWY.Client/Models/PackTask/ShopTotal.cs +++ b/BBWY.Client/Models/PackTask/ShopTotal.cs @@ -20,6 +20,8 @@ namespace BBWY.Client.Models.PackTask private bool taskChecked; public bool TaskChecked { get => taskChecked; set { Set(ref taskChecked, value); } } + + public string TaskIdRemark { get; set; } /// /// 任务id /// diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 1300b9c7..edf95e5f 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -36,6 +36,8 @@ using NPOI.SS.Util; using System.Text; using BBWY.Client.Views.SplitTask; using BBWY.Client.Extensions; +using BBWY.Client.Views.PackTaskAbort; +using System.Windows.Controls; namespace BBWY.Client.ViewModels.PackTask { @@ -728,10 +730,6 @@ namespace BBWY.Client.ViewModels.PackTask public ICommand DeletedTaskCommand { get; set; } - /// - /// 商家自取 - /// - public ICommand StoreGetBySelfCommand { get; set; } /// @@ -778,16 +776,40 @@ namespace BBWY.Client.ViewModels.PackTask /// public ICommand QualityTaskCommand { get; set; } + /// + /// 任务拆分 + /// public ICommand TaskSplitCommand { get; set; } + /// + /// 挂起 + /// public ICommand PackagingTaskExceptionCommand { get; set; } + /// + /// 商家自取 + /// + public ICommand StoreGetBySelfCommand { get; set; } + /// + /// 包装任务释放挂起 + /// + public ICommand DisposeTaskCommand { get; set; } + + /// + /// 修改货架号 + /// + public ICommand UpdateShelvesNumberCommand { get; set; } - public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService, PackUserService packUserService, MarkMessageService markMessageService, QualityTaskService qualityTaskService, PackagingTaskService packagingTaskService) - { + /// + /// 打印异常任务信息 + /// + public ICommand PrintShelvesNumberCommand { get; set; } + public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService, PackUserService packUserService, MarkMessageService markMessageService, QualityTaskService qualityTaskService, PackagingTaskService packagingTaskService, PackTaskAbortService packTaskAbortService) + { + this.packTaskAbortService = packTaskAbortService; this.globalContext = globalContext; this.sealBoxService = sealBoxService; this.packTaskService = packTaskService; @@ -857,7 +879,7 @@ namespace BBWY.Client.ViewModels.PackTask SearchTaskList(); else PageIndex = 1; - + }); @@ -915,16 +937,82 @@ namespace BBWY.Client.ViewModels.PackTask PackagingTaskExceptionCommand = new RelayCommand(PackagingTaskException); + DisposeTaskCommand = new RelayCommand(DisposeTask); + + + + if (IsCanPackModelList == null) + { + var res = packTaskService.GetTaskAbortEnum(); + if (res.Success) + { + IsCanPackModelList = res.Data.IsCanPackModelList; + ShelvesNumberList = res.Data.ShelvesNumberList; + FloorNumberList = res.Data.FloorNumberList; + } + } + + UpdateShelvesNumberCommand = new RelayCommand(UpdateShelvesNumber); + + PrintShelvesNumberCommand = new RelayCommand(PrintShelvesNumber); } - private void PackagingTaskException(long taskId) + private void PrintShelvesNumber(PackTaskModel model) { + PrintExceptionTaskWindow window = new PrintExceptionTaskWindow(model); + window.ShowDialog(); + } - AddExceptionWindow addExceptionWindow = new AddExceptionWindow(qualityTaskService, taskId, Models.TaskState.待包装, ReflashTask); - addExceptionWindow.ShowDialog(); + private void UpdateShelvesNumber(PackTaskModel model) + { + UpdateShelvesNumberWindow window = new UpdateShelvesNumberWindow(packTaskAbortService, model, ReflashTask, ShelvesNumberList, FloorNumberList); + + + window.ShowDialog(); } - private void TaskSplit(PackTaskModel model) + /// + /// 手动释放挂起 + /// + /// + public void DisposeTask(long taskId) + { + if (System.Windows.MessageBox.Show("是否释放挂起?", "提示", + MessageBoxButton.YesNo, + MessageBoxImage.Warning) != MessageBoxResult.Yes) + return; + var res = packTaskAbortService.DisposedPackTask(taskId); + if (res == null || !res.Success) + { + MessageBox.Show(res?.Msg); + return; + } + + ReflashTask(); + } + + public List IsCanPackModelList { get; set; } + public List ShelvesNumberList { get; set; } + public List FloorNumberList { get; set; } + public void PackagingTaskException(long taskId) + { + + + try + { + AddExceptionWindow addExceptionWindow = new AddExceptionWindow(packTaskAbortService, taskId, Models.TaskState.待包装, ReflashTask, IsCanPackModelList, ShelvesNumberList, FloorNumberList); + addExceptionWindow.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + + } + + + } + + public void TaskSplit(PackTaskModel model) { SplitTaskWindow addExceptionWindow = new SplitTaskWindow(packTaskService, model.TaskId, model.TaskState, ReflashTask); @@ -985,19 +1073,19 @@ namespace BBWY.Client.ViewModels.PackTask bool? isCer3CValid = null; - new QualityProductWindow("商品合格证情况", "商品包装有合格证信息", "商品包装无合格证信息", (ishaveCer) => + new QualityProductWindow("商品合格证情况", "包装是否有合格证?", "有", "无", (ishaveCer) => { if (ishaveCer)//验收商品 有合格证 { if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14 { - new QualityProductWindow("商品合格证情况", "商品包装合格证上有品牌信息", "商品包装合格证上无品牌信息", (iscerhavebrand) => + new QualityProductWindow("商品合格证情况", "合格证是否有品牌信息?", "有", "无", (iscerhavebrand) => { if (iscerhavebrand) { - new QualityProductWindow("商品合格证情况", $"商品包装合格证上的品牌是{skuAttsDetail.Brand}", $"商品包装合格证上的品牌不是{skuAttsDetail.Brand}", (istruebrand) => + new QualityProductWindow("商品合格证情况", $"合格证品牌:{skuAttsDetail.Brand}?", $"是", $"不是", (istruebrand) => { if (!istruebrand) { @@ -1031,7 +1119,7 @@ namespace BBWY.Client.ViewModels.PackTask return; } //todo: 判断是否首次验收 只支持供应链 有采购方案的 - new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (ishave3c) => + new QualityProductWindow("商品合格证情况", "合格证是否有3C标?", "有", "无", (ishave3c) => { if (ishave3c) { @@ -1093,6 +1181,14 @@ namespace BBWY.Client.ViewModels.PackTask if (sendCer3CValidMsgModel != null) { + + if (model.TaskAbortTime != null)// + { + MessageBox.Show($"任务异常未处理,{sendCer3CValidMsgModel}"); + return; + } + + var res = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, sendCer3CValidMsgModel.Value); if (res == null || !res.Success) @@ -1107,21 +1203,20 @@ namespace BBWY.Client.ViewModels.PackTask MessageBox.Show(res.Msg); ReflashTask();//刷新任务 } - } if (isqualityCer)//合格证验收完毕 { bool isqualityBrand = false; - new QualityProductWindow("商品品牌情况", "商品包装有品牌信息", "商品包装无品牌信息", (ishavebrand) => + new QualityProductWindow("商品品牌情况", "包装是否有品牌商标?", "有", "无", (ishavebrand) => { if (ishavebrand)//有品牌且品牌不是集团的 { if (!skuAttsDetail.IsTeamBrand) { - new QualityProductWindow($"商品品牌情况", $"商品包装品牌是{skuAttsDetail.Brand}", $"商品包装品牌不是{skuAttsDetail.Brand}", (istruebrand) => + new QualityProductWindow($"商品品牌情况", $"包装品牌:{skuAttsDetail.Brand}", $"是", $"不是", (istruebrand) => { @@ -1145,9 +1240,6 @@ namespace BBWY.Client.ViewModels.PackTask markType = BrandMarkType.需遮盖;//有品牌 但任务sku所属的品牌是集团品牌 isqualityBrand = true; } - - - } else { @@ -1157,11 +1249,27 @@ namespace BBWY.Client.ViewModels.PackTask } }).ShowDialog(); + + if (isqualityBrand) { - QualityWindow service = new QualityWindow(model, ReflashTask, IsNeedCer, markType, packTaskRes.Data); - service.ShowDialog(); + + if (IsNeedCer == Need.需要) + { + QualityWindow service = new QualityWindow(model, ReflashTask, IsNeedCer, markType, packTaskRes.Data); + service.ShowDialog(); + } + else + { + BatchPrintWindow window = new BatchPrintWindow(markType, IsNeedCer, model.TaskId, model.BrandName, model.SkuCount, model.CertificateModel, model.BarCodeModel, qualityTaskService, + ReflashTask + ); + window.ShowDialog(); + } + + + } @@ -1174,9 +1282,17 @@ namespace BBWY.Client.ViewModels.PackTask private void QualityTaskException(long taskId) { + try + { + AddExceptionWindow addExceptionWindow = new AddExceptionWindow(packTaskAbortService, taskId, Models.TaskState.待验收, ReflashTask, IsCanPackModelList, ShelvesNumberList, FloorNumberList); + addExceptionWindow.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); - AddExceptionWindow addExceptionWindow = new AddExceptionWindow(qualityTaskService, taskId, Models.TaskState.待验收, ReflashTask); - addExceptionWindow.ShowDialog(); + } + } MarkMessageService markMessageService; @@ -1479,9 +1595,12 @@ namespace BBWY.Client.ViewModels.PackTask AddOneItemWeightWindow addOneItemWeightWindow = new AddOneItemWeightWindow(ReflashTask, packUserService, model.TaskId); addOneItemWeightWindow.ShowDialog(); } - private void StoreGetBySelf(long taskId) + public void StoreGetBySelf(long taskId) { + + + //MessageBoxResult result = System.Windows.MessageBox.Show($"确定商家自取,任务id:{taskId}?", "提示", // MessageBoxButton.YesNo, // MessageBoxImage.Warning); @@ -1555,7 +1674,7 @@ namespace BBWY.Client.ViewModels.PackTask private void DeletedTask(object obj) { var packTaskmodel = (PackTaskModel)obj; - MessageBoxResult result = System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskId}?", "提示", + MessageBoxResult result = System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskIdRemark}?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.Yes) return; @@ -1815,7 +1934,7 @@ namespace BBWY.Client.ViewModels.PackTask private Thread waitTransportOverTimeThread = null; QualityTaskService qualityTaskService; - + PackTaskAbortService packTaskAbortService; private string packagingTaskExceptionCount; /// @@ -2396,74 +2515,72 @@ namespace BBWY.Client.ViewModels.PackTask } - if (PackagingTaskExceptionState == Models.PackagingTaskExceptionState.待包装) + + var packCompletedTasks = PackTaskList.Where(p => p.TaskState == Models.TaskState.待包装 && p.PackCompletionOverTime != null && p.TaskAbortTime == null).ToList(); + if (packCompletedTasks.Count() > 0) { - var packCompletedTasks = PackTaskList.Where(p => p.TaskState == Models.TaskState.待包装 && p.PackCompletionOverTime != null && p.TaskAbortTime == null).ToList(); - if (packCompletedTasks.Count() > 0) - { - packOverTimeThread = new Thread(() => + packOverTimeThread = new Thread(() => + { + IsStartThread = true; + while (IsStartThread) { - IsStartThread = true; - while (IsStartThread) + App.Current.Dispatcher.BeginInvoke(new Action(() => { - App.Current.Dispatcher.BeginInvoke(new Action(() => + foreach (var item in packCompletedTasks) { - foreach (var item in packCompletedTasks) + var datetime = item.PackCompletionOverTime.Value.Subtract(DateTime.Now); + if (datetime.TotalMilliseconds > 0) { - var datetime = item.PackCompletionOverTime.Value.Subtract(DateTime.Now); - if (datetime.TotalMilliseconds > 0) - { - item.IsPackOverTime = false; - item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); - } - else - { - item.IsPackOverTime = true; - item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); - } - + item.IsPackOverTime = false; + item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); + } + else + { + item.IsPackOverTime = true; + item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); } - })); - Thread.Sleep(1000); - } - }); - //任务倒计时数据 - packOverTimeThread.IsBackground = true; - packOverTimeThread.Start(); + } + })); + Thread.Sleep(1000); + } + + }); + //任务倒计时数据 + packOverTimeThread.IsBackground = true; + packOverTimeThread.Start(); - } } - if (PackagingTaskExceptionState == Models.PackagingTaskExceptionState.挂起任务) + + + var packtasks = PackTaskList.Where(p => p.TaskState == Models.TaskState.待包装 && p.TaskAbortTime != null).ToList(); + App.Current.Dispatcher.BeginInvoke(new Action(() => { - var packtasks = PackTaskList.Where(p => p.TaskState == Models.TaskState.待包装 && p.TaskAbortTime != null).ToList(); - App.Current.Dispatcher.BeginInvoke(new Action(() => + foreach (var item in packtasks) { - foreach (var item in packtasks) + TimeSpan datetime; + datetime = item.PackCompletionOverTime.Value.Subtract(item.TaskAbortTime.Value); + item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); + if (datetime.TotalMilliseconds > 0) { - TimeSpan datetime; - datetime = item.PackCompletionOverTime.Value.Subtract(item.TaskAbortTime.Value); - item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); - if (datetime.TotalMilliseconds > 0) - { - item.IsPackOverTime = false; - - } - else - { - item.IsPackOverTime = true; - } + item.IsPackOverTime = false; } - })); - } + else + { + item.IsPackOverTime = true; + } + + } + })); + @@ -2727,10 +2844,6 @@ namespace BBWY.Client.ViewModels.PackTask }); item.ExpressOrderList = expressData.Data; })); - - - - } } } @@ -2836,7 +2949,10 @@ namespace BBWY.Client.ViewModels.PackTask PageIndex = pageIndex;// SearchTaskList(); } - public void ReflashTask()//刷新界面 + /// + /// 刷新界面 + /// + public void ReflashTask() { SearchTaskList(); } diff --git a/BBWY.Client/ViewModels/PackerTask/PackerTaskViewModel.cs b/BBWY.Client/ViewModels/PackerTask/PackerTaskViewModel.cs index baf07cd8..5f1d43c9 100644 --- a/BBWY.Client/ViewModels/PackerTask/PackerTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackerTask/PackerTaskViewModel.cs @@ -460,20 +460,24 @@ namespace BBWY.Client.ViewModels.PackerTask PackagingTaskExceptionCommand = new RelayCommand(PackagingTaskException); this.qualityTaskService = qualityTaskService; + + + } QualityTaskService qualityTaskService; private void PackagingTaskException(long taskId) { - AddExceptionWindow addExceptionWindow = new AddExceptionWindow(qualityTaskService, taskId, Models.TaskState.待包装, ReflashTask); - addExceptionWindow.ShowDialog(); + + //AddExceptionWindow addExceptionWindow = new AddExceptionWindow(qualityTaskService, taskId, Models.TaskState.待包装, ReflashTask); + //addExceptionWindow.ShowDialog(); } private void TaskSplit(PackerTaskModel model) { - SplitTaskWindow addExceptionWindow = new SplitTaskWindow(packTaskService, model.TaskId, model.TaskState.Value, ReflashTask); - addExceptionWindow.ShowDialog(); + //SplitTaskWindow addExceptionWindow = new SplitTaskWindow(packTaskService, model.TaskId, model.TaskState.Value, ReflashTask); + //addExceptionWindow.ShowDialog(); } private void PrintCer(CertificateModel[] certificateModel) @@ -689,7 +693,7 @@ namespace BBWY.Client.ViewModels.PackerTask { - + diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs index 727e4e89..2311a770 100644 --- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs +++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs @@ -24,6 +24,7 @@ using WebSocketSharp; using BBWY.Client.APIServices.QiKu; using BarcodeLib; using System.Runtime.ConstrainedExecution; +using BBWY.Client.Models.APIModel; namespace BBWY.Client.ViewModels { @@ -397,7 +398,7 @@ namespace BBWY.Client.ViewModels public ICommand QualityTaskExceptionCommand { get; set; } #endregion - public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService, MarkMessageService markMessageService, QualityTaskService qualityTaskService) + public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService, MarkMessageService markMessageService, QualityTaskService qualityTaskService, PackTaskAbortService packTaskAbortService) { this.packPurchaseTaskService = packPurchaseTaskService; this.productService = productService; @@ -407,6 +408,7 @@ namespace BBWY.Client.ViewModels this.packTaskService = packTaskService; this.markMessageService = markMessageService; this.qualityTaskService = qualityTaskService; + this.packTaskAbortService = packTaskAbortService; OpenSkuDetailCommand = new RelayCommand(OpenSkuDetail); SetBarCodeCommand = new RelayCommand(SetBarCode); @@ -425,13 +427,29 @@ namespace BBWY.Client.ViewModels } QualityTaskExceptionCommand = new RelayCommand(QualityTaskException); - } + if (IsCanPackModelList == null) + { + var res = packTaskService.GetTaskAbortEnum(); + if (res.Success) + { + IsCanPackModelList = res.Data.IsCanPackModelList; + ShelvesNumberList = res.Data.ShelvesNumberList; + FloorNumberList = res.Data.FloorNumberList; + } + } + + } + List IsCanPackModelList { get; set; } + List ShelvesNumberList { get; set; } + List FloorNumberList { get; set; } + PackTaskAbortService packTaskAbortService; #region 方法 private void QualityTaskException(object obj) { - AddExceptionWindow addExceptionWindow = new AddExceptionWindow(qualityTaskService, TaskId, Models.TaskState.待验收, () => { + AddExceptionWindow addExceptionWindow = new AddExceptionWindow(packTaskAbortService, TaskId, Models.TaskState.待验收, () => + { var window = obj as BWindow; App.Current.Dispatcher.Invoke(new Action(() => @@ -439,69 +457,86 @@ namespace BBWY.Client.ViewModels window.Close(); })); ReflashWindow?.Invoke(); - }); + }, IsCanPackModelList, ShelvesNumberList, FloorNumberList); addExceptionWindow.ShowDialog(); } private void CompeteQualityTask(object obj) { - if (ArrivalQuantity == null) - { - MessageBox.Show($"请输入到货数量"); - return; - } - if (GoodProductQuantity == null) - { - MessageBox.Show($"请输入良品数量"); - return; - } + //if (ArrivalQuantity == null) + //{ + // MessageBox.Show($"请输入到货数量"); + // return; + //} + //if (GoodProductQuantity == null) + //{ + // MessageBox.Show($"请输入良品数量"); + // return; + //} - //if (FloorDragNumber <= 0) + //if (GoodProductQuantity > ArrivalQuantity) //{ - // MessageBox.Show($"请选择摆放地拖编号"); + // MessageBox.Show($"良品数量不能大于到货数量"); // return; //} + // + //if (GoodProductQuantity < SkuCount) + //{ + // MessageBox.Show($"良品数量不能低于任务数"); + // return; + // //if (MessageBox.Show("良品数小于任务数,确认则任务将异常挂起,是否确认?", "任务异常", MessageBoxButton.OKCancel, MessageBoxImage.Question) != MessageBoxResult.OK) + // //{ + // // return; + // //} + + // //var res = qualityTaskService.QualityTaskException(TaskId, 0 , "良品数量小于任务数", TaskState.待验收); + // //if (res == null || !res.Success) + // //{ + // // MessageBox.Show(res?.Msg); + // // return; + // //} + // //App.Current.Dispatcher.Invoke(new Action(() => + // //{ + // // window.Close(); + // //})); - if (GoodProductQuantity > ArrivalQuantity) - { - MessageBox.Show($"良品数量:{GoodProductQuantity}不能大于到货数量:{ArrivalQuantity}"); - return; - } - if (ArrivalQuantity == 0) - { - MessageBox.Show($"到货数量不能:{ArrivalQuantity}!"); - return; - } + //} + + + //if (ArrivalQuantity == 0) + //{ + // MessageBox.Show($"到货数量不能为0!"); + // return; + //} var request = new Models.APIModel.Request.QualityTaskRequest { - BasicPack = BasicPack, - ArrivalQuantity = ArrivalQuantity.Value, - GoodProductQuantity = GoodProductQuantity.Value, - Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)), + //BasicPack = BasicPack, + // ArrivalQuantity = SkuCount, + // GoodProductQuantity = SkuCount, + // Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)), BrandName = BrandName, - CertificatePosition = CertificatePosition, - OrderId = OrderId, - PackType = PackType, - GoodsNumber = GoodsNumber, - SkuGoodsTitle = SkuTitle, - SkuId = SkuId, + //CertificatePosition = CertificatePosition, + //OrderId = OrderId, + //PackType = PackType, + //GoodsNumber = GoodsNumber, + //SkuGoodsTitle = SkuTitle, + //SkuId = SkuId, TaskId = TaskId, - BrandMarkType= BrandMarkType + BrandMarkType = BrandMarkType }; - if (CreateTime > Convert.ToDateTime("2023-08-21")) + if (IsNeedBarCode == Need.需要) { - if (IsNeedBarCode == Need.需要) + if (BarCodeModel == null || BarCodeModel.Id <= 0) { - if (BarCodeModel == null || BarCodeModel.Id <= 0) - { - MessageBox.Show("条形码不能为空"); - return; - } - request.BarcodeId = BarCodeModel.Id; + MessageBox.Show("条形码不能为空"); + return; } - if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer)) //(IsNeedCertificateModel == Need.需要) + request.BarcodeId = BarCodeModel.Id; + } + if (IsNeedPrintCer == Need.需要) + if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer)) { //if () //{ @@ -527,7 +562,6 @@ namespace BBWY.Client.ViewModels request.CerId = string.Join(",", PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO.Id)); } - } try { @@ -542,18 +576,22 @@ namespace BBWY.Client.ViewModels MessageBox.Show(competeRes.Msg); return; } - BatchPrintWindow batchPrint = new BatchPrintWindow(BrandMarkType, IsNeedPrintCer, GoodProductQuantity.Value, + BatchPrintWindow batchPrint = new BatchPrintWindow(BrandMarkType, IsNeedPrintCer, TaskId,BrandName, GoodProductQuantity.Value, PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO != null && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() - , BarCodeModel); + , BarCodeModel, qualityTaskService,()=> { + + ReflashWindow?.Invoke(); + var window = obj as BWindow; + App.Current.Dispatcher.Invoke(new Action(() => + { + window.Close(); + })); + }); batchPrint.ShowDialog(); - if (ReflashWindow != null) ReflashWindow(); - var window = obj as BWindow; - App.Current.Dispatcher.Invoke(new Action(() => - { - window.Close(); - })); + + } catch (Exception ex) @@ -734,7 +772,7 @@ namespace BBWY.Client.ViewModels ShowMarkMessage = string.Join("\r\n", resShow.Data.Select(d => d.ToString())); } - + StoreGetSelfCount = qualityTaskResponse.StoreGetSelfCount; SkuPurchaseSchemeId = qualityTaskResponse.SkuPurchaseSchemeId; diff --git a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml index 62968e2f..72d0b5dc 100644 --- a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml +++ b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml @@ -84,7 +84,6 @@ - @@ -550,7 +549,7 @@ - + diff --git a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs index 38885f60..c9b7a61d 100644 --- a/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs +++ b/BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs @@ -136,8 +136,7 @@ namespace BBWY.Client.Views.PackTask MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机 PrintDialog printDialog = new PrintDialog(); - printDialog.PrintTicket.PageOrientation = PageOrientation.ReversePortrait;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 - //设置纸张大小 + printDialog.PrintTicket.PageOrientation = PageOrientation.ReversePortrait;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 //设置纸张大小 var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); diff --git a/BBWY.Client/Views/PackTask/PackTaskTotal.xaml b/BBWY.Client/Views/PackTask/PackTaskTotal.xaml index baec44bc..9900b7af 100644 --- a/BBWY.Client/Views/PackTask/PackTaskTotal.xaml +++ b/BBWY.Client/Views/PackTask/PackTaskTotal.xaml @@ -220,9 +220,9 @@ - diff --git a/BBWY.Client/Views/PackTask/TaskList.xaml b/BBWY.Client/Views/PackTask/TaskList.xaml index 26e6671e..7eb84df1 100644 --- a/BBWY.Client/Views/PackTask/TaskList.xaml +++ b/BBWY.Client/Views/PackTask/TaskList.xaml @@ -68,7 +68,7 @@ - + @@ -177,7 +177,7 @@