diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index 80a670c9..2427bde4 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -19,8 +19,6 @@ namespace BBWY.Client.APIServices public class PackTaskService : BaseApiService, IDenpendency { - - public PackTaskService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { } @@ -286,11 +284,6 @@ namespace BBWY.Client.APIServices }, null, HttpMethod.Post); } - public ApiResponse StoreGetBySelf(long taskId) - { - - return SendRequest(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelf?TaskId={taskId}", null, null, HttpMethod.Post); - } public ApiResponse CompletedPackTask(long taskId) { @@ -366,23 +359,28 @@ namespace BBWY.Client.APIServices }, null, HttpMethod.Post); } - //public ApiResponse QikuPublishOrderSkuPackConfigState(string orderId, string skuId, PackConfigState packConfigState) - //{ - // return SendRequest("http://bbwyb.qiyue666.com", $"Api/Order/QikuPublishOrderSkuPackConfigState", new - // { - // orderId, - // skuId, - // packConfigState, - // }, null, HttpMethod.Post); - //} - public ApiResponse SendToSetSkuConfigure(long taskId) { return SendRequest(globalContext.QKApiHost, $"api/PackTask/SendToSetSkuConfigure?taskid={taskId}", null, null, HttpMethod.Post); } + public ApiResponse GetStoreGetSelfData(long taskId) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTask/GetStoreGetSelfData?taskid={taskId}", null, null, HttpMethod.Get); + } + + + public ApiResponse StoreGetBySelfV2(long taskId, int storeGetCount, string PickerUserName) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelfV2?TaskId={taskId}", new { + taskId, + storeGetCount, + PickerUserName, + OperatorUserName= globalContext.User.Name + }, null, HttpMethod.Post); + } } public class CompeteSealBox @@ -400,15 +398,12 @@ namespace BBWY.Client.APIServices } - public class AddConsumableRequest { public long TaskId { get; set; } public long[] ConsumableIds { get; set; } } - - public class PackTaskDetailRequest { /// /// 任务id @@ -549,22 +544,7 @@ namespace BBWY.Client.APIServices /// 服务数量 /// public int? ServiceCount { get; set; } - ///// - ///// 增值服务ids - ///// - //public string IncreateServiceIds { get; set; } - ///// - ///// 增值服务数量 - ///// - //public string IncreateServiceNos { get; set; } - ///// - ///// 工序ids - ///// - //public string WorkProcessIds { get; set; } - ///// - ///// 工序数量 - ///// - //public string WorkProcessNos { get; set; } + /// /// @@ -586,8 +566,6 @@ namespace BBWY.Client.APIServices public ServiceType ServiceType { get; set; } } - - public class ConsumableTaskModel { public decimal Price { get; set; } @@ -601,7 +579,6 @@ namespace BBWY.Client.APIServices public int? ConsumableCount { get; set; } } - public class PackServiceMemberModel { public decimal Price { get; set; } @@ -620,7 +597,4 @@ namespace BBWY.Client.APIServices } - - - } diff --git a/BBWY.Client/Models/PackTask/StoreGetSelfResponse.cs b/BBWY.Client/Models/PackTask/StoreGetSelfResponse.cs new file mode 100644 index 00000000..ad6336d7 --- /dev/null +++ b/BBWY.Client/Models/PackTask/StoreGetSelfResponse.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace BBWY.Client.Models.PackTask +{ + public class StoreGetSelfResponse:NotifyObject + { /// + /// 团队用户列表(取件人) + /// + private ObservableCollection departmentUsers; + + /// + /// 团队用户列表(取件人) + /// + public ObservableCollection DepartmentUsers { get=> departmentUsers; set { Set(ref departmentUsers, value); } } + + /// + /// 可取的最大数 + /// + public int PickMaxCount { get; set; } + + /// + /// 提示消息 + /// + public string ShowMessage { get; set; } + } + public class DepartmentUser:NotifyObject + { + /// + /// 用户id + /// + public string UserId { get; set; } + + + + + private string userName; + /// + /// 名称 + /// + public string UserName { get => userName; set { Set(ref userName, value); } } // + } +} diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 2385464a..a495b205 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -1,24 +1,16 @@ using BBWY.Client.APIServices; -using BBWY.Client.Models.APIModel.Response.PackTask; using BBWY.Client.Models; -using BBWY.Client.Views.PackTask; using BBWY.Common.Models; using BBWY.Controls; using GalaSoft.MvvmLight.Command; using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Text; using System.Threading.Tasks; using System.Windows.Input; using System.Linq; -using System.Windows.Controls; -using System.ComponentModel; -using HandyControl.Controls; 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; using BBWY.Client.Views.SealBox; @@ -27,8 +19,8 @@ using BBWY.Client.Models.FallWare; using WebSocketSharp; using System.Threading; using BBWY.Client.Helpers; -using System.Diagnostics.Eventing.Reader; using BBWY.Client.Views.TaskOverTime; +using BBWY.Client.Views.StorePickSelf; namespace BBWY.Client.ViewModels.PackTask { @@ -856,17 +848,34 @@ namespace BBWY.Client.ViewModels.PackTask System.Windows.MessageBox.Show(res.Msg); return; } + + Task.Factory.StartNew(() => SearchTaskList()); } private void StoreGetBySelf(long taskId) { - MessageBoxResult result = System.Windows.MessageBox.Show($"确定商家自取,任务id:{taskId}?", "提示", - MessageBoxButton.YesNo, - MessageBoxImage.Warning); - if (result != MessageBoxResult.Yes) return; - var res = packTaskService.StoreGetBySelf(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); + sorePickProductWindow.ShowDialog(); + if (sorePickProductWindow.DialogResult == null || !sorePickProductWindow.DialogResult.Value) + { + return; + } + + var res = packTaskService.StoreGetBySelfV2(taskId, sorePickProductWindow.Count, sorePickProductWindow.UserName); if (res == null) { return; @@ -876,6 +885,8 @@ namespace BBWY.Client.ViewModels.PackTask System.Windows.MessageBox.Show(res.Msg, "错误信息"); return; } + sorePickProductWindow.Close(); + Task.Factory.StartNew(() => SearchTaskList()); } @@ -1211,13 +1222,13 @@ namespace BBWY.Client.ViewModels.PackTask public void SetTaskState(TaskState? taskState) { - if (!(TaskState== Models.TaskState.未到货&&TaskState== Models.TaskState.待验收)) + if (!(TaskState == Models.TaskState.未到货 && TaskState == Models.TaskState.待验收)) { SearchSkuTitle = ""; SearchSpuTitle = ""; } - - + + TaskState = taskState; @@ -1550,7 +1561,7 @@ namespace BBWY.Client.ViewModels.PackTask PackTaskList = new ObservableCollection();//初始化数据 var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName, - PageIndex, PageSize,SearchSkuTitle,SearchSpuTitle); + PageIndex, PageSize, SearchSkuTitle, SearchSpuTitle); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; diff --git a/BBWY.Client/ViewModels/ServiceOrder/ServiceOrderViewModel.cs b/BBWY.Client/ViewModels/ServiceOrder/ServiceOrderViewModel.cs index b286832e..f3f4e305 100644 --- a/BBWY.Client/ViewModels/ServiceOrder/ServiceOrderViewModel.cs +++ b/BBWY.Client/ViewModels/ServiceOrder/ServiceOrderViewModel.cs @@ -47,9 +47,6 @@ namespace BBWY.Client.ViewModels public ICommand SetServiceOrderStateCommand { get; set; } public ICommand SetReturnDirectionCommand { get; set; } public ICommand OnPageIndexChangedCommand { get; set; } - - public ICommand CopyTextCommand { get; set; } - public ICommand SetSearchDateCommand { get; set; } public ICommand SearchServiceOrderCommand { get; set; } diff --git a/BBWY.Client/Views/PackTask/PrintWindow.xaml.cs b/BBWY.Client/Views/PackTask/PrintWindow.xaml.cs index 7f91e2a0..0eb7a853 100644 --- a/BBWY.Client/Views/PackTask/PrintWindow.xaml.cs +++ b/BBWY.Client/Views/PackTask/PrintWindow.xaml.cs @@ -1,28 +1,12 @@ using BBWY.Client.Helpers; using BBWY.Client.Models; using BBWY.Controls; -using NPOI.SS.UserModel; using System; -using System.Collections.Generic; using System.Drawing; using System.Drawing.Printing; -using System.IO; using System.Linq; -using System.Printing; -using System.Runtime.ConstrainedExecution; -using System.Text; using System.Threading.Tasks; using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Interop; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Shapes; -using System.Drawing.Printing; using System.Collections.ObjectModel; using BBWY.Client.Extensions; diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml index d99b7c6e..ab4b54b1 100644 --- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml @@ -275,8 +275,10 @@ > + + diff --git a/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml index bc3876e7..eba2ef4e 100644 --- a/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml +++ b/BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml @@ -6,7 +6,7 @@ xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" WindowStartupLocation="CenterScreen" CloseButtonVisibility="Visible" - xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:hc="https://handyorg.github.io/handycontrol" CloseButtonColor="{StaticResource WindowButtonColor}" MinButtonVisibility="Collapsed" MaxButtonVisibility="Collapsed" diff --git a/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml b/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml new file mode 100644 index 00000000..183ce15a --- /dev/null +++ b/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs b/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs new file mode 100644 index 00000000..a603a207 --- /dev/null +++ b/BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs @@ -0,0 +1,54 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models.PackTask; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace BBWY.Client.Views.StorePickSelf +{ + /// + /// StorePickProductWindow.xaml 的交互逻辑 + /// + public partial class StorePickProductWindow : BWindow + { + public StorePickProductWindow(StoreGetSelfResponse model) + { + StoreGetSelfResponse=model; + InitializeComponent(); + this.DataContext = this; + } + private string userName; + /// + /// 用户名 + /// + public string UserName { get => userName; set { Set(ref userName, value); } } + + private int count; + + public int Count { get => count; set { Set(ref count, value); } } + + private StoreGetSelfResponse storeGetSelfResponse; + + public StoreGetSelfResponse StoreGetSelfResponse { get=> storeGetSelfResponse; set {Set(ref storeGetSelfResponse,value); } } + private void BButton_Click(object sender, RoutedEventArgs e) + { + this.DialogResult = true; + + } + + private void BButton_Click_1(object sender, RoutedEventArgs e) + { + Count = StoreGetSelfResponse.PickMaxCount; + } + } +}