Browse Source

添加打包时间统计

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
b1f2b6b87d
  1. 17
      BBWY.Client/APIServices/PackTaskService.cs
  2. 45
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  3. 2
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  4. 21
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml

17
BBWY.Client/APIServices/PackTaskService.cs

@ -99,8 +99,8 @@ namespace BBWY.Client.APIServices
public ApiResponse<ProductSkuCountsResponse> GetAllCount()
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount",
new { ShopId = globalContext.User.Shop.ShopId.ToString() }
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={globalContext.User.Shop.ShopId.ToString()}",
null
, null, HttpMethod.Get);
}
public ApiResponse<ProductSkuCountsResponse> GetWareAllCount()
@ -168,6 +168,19 @@ namespace BBWY.Client.APIServices
, null, HttpMethod.Post);
}
public ApiResponse<object> SetPackTaskState(long taskId, PackTaskState packTaskState)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/SetPackTaskState", new
{
taskId = taskId,
TaskState= packTaskState
}
, null, HttpMethod.Post);
}
public ApiResponse<long> SaveBarCode(BarCodeRequest barCodeModel)
{
return SendRequest<long>(globalContext.QKApiHost, "api/PackTask/CommitBarCode", barCodeModel

45
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -232,10 +232,12 @@ namespace BBWY.Client.ViewModels.PackTask
this.productService = productService;
this.batchPurchaseService = batchPurchaseService;
UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState);
}
#region 事件绑定
public ICommand SetTaskStatusCommand { get; set; }
@ -253,6 +255,10 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ICommand SetTaskStateCommand { get; set; }
/// <summary>
/// 修改任务状态
/// </summary>
public ICommand UpdateTaskStateCommand { get; set; }
/// <summary>
/// 搜索数据
/// </summary>
@ -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<object> 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;

2
BBWY.Client/Views/PackTask/TaskListControl.xaml

@ -121,7 +121,7 @@
<c:BButton Command="{Binding UpdateTaskCommand}"
Style="{StaticResource LinkButton}" Content="修改" />
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding TaskId}"
Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="删除" />
Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="取消" />
</StackPanel>
</Grid>

21
BBWY.Client/Views/PackTask/WareHouseListControl.xaml

@ -402,8 +402,27 @@
Command="{Binding QualityTaskCommand}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待质检:Visible:Collapsed}"
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}"
>
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="TaskId" />
<Binding Path="TaskState"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BButton>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱:Visible:Collapsed}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待出库:Visible:Collapsed}"
>
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">

Loading…
Cancel
Save