From b1f2b6b87dab81f252ef047c9d7714177399839a Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Wed, 24 May 2023 15:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8C=85=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/APIServices/PackTaskService.cs | 17 ++++++- .../PackTask/WareHouseListViewModel.cs | 45 ++++++++++++++++++- .../Views/PackTask/TaskListControl.xaml | 2 +- .../Views/PackTask/WareHouseListControl.xaml | 21 ++++++++- 4 files changed, 80 insertions(+), 5 deletions(-) diff --git a/BBWY.Client/APIServices/PackTaskService.cs b/BBWY.Client/APIServices/PackTaskService.cs index 37a42620..2ef1068c 100644 --- a/BBWY.Client/APIServices/PackTaskService.cs +++ b/BBWY.Client/APIServices/PackTaskService.cs @@ -99,8 +99,8 @@ namespace BBWY.Client.APIServices public ApiResponse GetAllCount() { - return SendRequest(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount", - new { ShopId = globalContext.User.Shop.ShopId.ToString() } + return SendRequest(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={globalContext.User.Shop.ShopId.ToString()}", + null , null, HttpMethod.Get); } public ApiResponse GetWareAllCount() @@ -168,6 +168,19 @@ namespace BBWY.Client.APIServices , null, HttpMethod.Post); } + + + + public ApiResponse SetPackTaskState(long taskId, PackTaskState packTaskState) + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/SetPackTaskState", new + { + taskId = taskId, + TaskState= packTaskState + } + , null, HttpMethod.Post); + } + public ApiResponse SaveBarCode(BarCodeRequest barCodeModel) { return SendRequest(globalContext.QKApiHost, "api/PackTask/CommitBarCode", barCodeModel diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index b8473407..225a331b 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -232,10 +232,12 @@ namespace BBWY.Client.ViewModels.PackTask this.productService = productService; this.batchPurchaseService = batchPurchaseService; - + UpdateTaskStateCommand = new RelayCommand(UpdateTaskState); } + + #region 事件绑定 public ICommand SetTaskStatusCommand { get; set; } @@ -253,6 +255,10 @@ namespace BBWY.Client.ViewModels.PackTask /// public ICommand SetTaskStateCommand { get; set; } + /// + /// 修改任务状态 + /// + public ICommand UpdateTaskStateCommand { get; set; } /// /// 搜索数据 /// @@ -270,6 +276,43 @@ namespace BBWY.Client.ViewModels.PackTask BatchPurchaseService batchPurchaseService; + + private void UpdateTaskState(object obj) + { + var objList = (object[])obj; + long taskId = (long)objList[0]; + var packTaskState = (PackTaskState)objList[1]; + + ApiResponse res = null; + switch (packTaskState) + { + case PackTaskState.未到货: + break; + case PackTaskState.部分到货: + break; + case PackTaskState.待质检: + break; + case PackTaskState.待打包: + res= packTaskService.SetPackTaskState(taskId, PackTaskState.待封箱); + break; + case PackTaskState.待封箱: + break; + case PackTaskState.待出库: + break; + case PackTaskState.已完成: + break; + case PackTaskState.已取消: + break; + default: + break; + } + if (res!=null&&res.Success) + { + SearchTaskList(); + } + + + } public void SetTaskStatus(object obj) { var objList = (object[])obj; diff --git a/BBWY.Client/Views/PackTask/TaskListControl.xaml b/BBWY.Client/Views/PackTask/TaskListControl.xaml index 84ee9353..39c31f7a 100644 --- a/BBWY.Client/Views/PackTask/TaskListControl.xaml +++ b/BBWY.Client/Views/PackTask/TaskListControl.xaml @@ -121,7 +121,7 @@ + Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="取消" /> diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml index 4e0108bc..3af203f9 100644 --- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml @@ -402,8 +402,27 @@ Command="{Binding QualityTaskCommand}" Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待质检:Visible:Collapsed}" /> + + + + + + + + + + + + + + + +