Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
7d4ae26954
  1. 58
      BBWY.Client/APIServices/QiKu/PackTaskService.cs
  2. 45
      BBWY.Client/Models/PackTask/StoreGetSelfResponse.cs
  3. 49
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  4. 3
      BBWY.Client/ViewModels/ServiceOrder/ServiceOrderViewModel.cs
  5. 16
      BBWY.Client/Views/PackTask/PrintWindow.xaml.cs
  6. 2
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  7. 2
      BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml
  8. 83
      BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml
  9. 54
      BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs

58
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<bool> StoreGetBySelf(long taskId)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelf?TaskId={taskId}", null, null, HttpMethod.Post);
}
public ApiResponse<bool> CompletedPackTask(long taskId)
{
@ -366,23 +359,28 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
//public ApiResponse<object> QikuPublishOrderSkuPackConfigState(string orderId, string skuId, PackConfigState packConfigState)
//{
// return SendRequest<object>("http://bbwyb.qiyue666.com", $"Api/Order/QikuPublishOrderSkuPackConfigState", new
// {
// orderId,
// skuId,
// packConfigState,
// }, null, HttpMethod.Post);
//}
public ApiResponse<object> SendToSetSkuConfigure(long taskId)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/PackTask/SendToSetSkuConfigure?taskid={taskId}", null, null, HttpMethod.Post);
}
public ApiResponse<StoreGetSelfResponse> GetStoreGetSelfData(long taskId)
{
return SendRequest<StoreGetSelfResponse>(globalContext.QKApiHost, $"api/PackTask/GetStoreGetSelfData?taskid={taskId}", null, null, HttpMethod.Get);
}
public ApiResponse<object> StoreGetBySelfV2(long taskId, int storeGetCount, string PickerUserName)
{
return SendRequest<object>(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
{ /// <summary>
/// 任务id
@ -549,22 +544,7 @@ namespace BBWY.Client.APIServices
/// 服务数量
/// </summary>
public int? ServiceCount { get; set; }
///// <summary>
///// 增值服务ids
///// </summary>
//public string IncreateServiceIds { get; set; }
///// <summary>
///// 增值服务数量
///// </summary>
//public string IncreateServiceNos { get; set; }
///// <summary>
///// 工序ids
///// </summary>
//public string WorkProcessIds { get; set; }
///// <summary>
///// 工序数量
///// </summary>
//public string WorkProcessNos { get; set; }
/// <summary>
///
@ -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
}
}

45
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
{ /// <summary>
/// 团队用户列表(取件人)
/// </summary>
private ObservableCollection<DepartmentUser> departmentUsers;
/// <summary>
/// 团队用户列表(取件人)
/// </summary>
public ObservableCollection<DepartmentUser> DepartmentUsers { get=> departmentUsers; set { Set(ref departmentUsers, value); } }
/// <summary>
/// 可取的最大数
/// </summary>
public int PickMaxCount { get; set; }
/// <summary>
/// 提示消息
/// </summary>
public string ShowMessage { get; set; }
}
public class DepartmentUser:NotifyObject
{
/// <summary>
/// 用户id
/// </summary>
public string UserId { get; set; }
private string userName;
/// <summary>
/// 名称
/// </summary>
public string UserName { get => userName; set { Set(ref userName, value); } } //
}
}

49
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<PackTaskModel>();//初始化数据
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;

3
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; }

16
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;

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

@ -275,8 +275,10 @@
>
<!-- -->
<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}"
Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="取消"/>-->
</StackPanel>
</Grid>
<Grid Grid.Row="1">

2
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"

83
BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml

@ -0,0 +1,83 @@
<c:BWindow x:Class="BBWY.Client.Views.StorePickSelf.StorePickProductWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.StorePickSelf"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
xmlns:hc="https://handyorg.github.io/handycontrol"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="384" Height="300" ResizeMode="NoResize"
RightButtonGroupMargin="0,5,5,0">
<!--CloseButtonColor="{StaticResource WindowButtonColor}" -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="39"/>
<RowDefinition/>
<RowDefinition Height="36"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="添加落仓" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" Margin="50 20 50 20">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Text="剩余良品数量:"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding StoreGetSelfResponse.PickMaxCount}"/>
</StackPanel>
<Grid Grid.Row="1" Height="30">
<Rectangle Width="260" HorizontalAlignment="Left" Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<StackPanel Orientation="Horizontal" Height="30" >
<Label HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="60" Content="取件人:"/>
<Grid Grid.Column="1" Grid.ColumnSpan="3">
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<ComboBox Height="30" Width="200" ItemsSource="{Binding StoreGetSelfResponse.DepartmentUsers}" DisplayMemberPath="UserName" Text="{Binding UserName}" BorderThickness="0" Margin="1" >
<ComboBox.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries >
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ComboBox.Resources>
</ComboBox>
</Grid>
</StackPanel>
</Grid>
<Grid Grid.Row="2" Height="30">
<Rectangle Width="260" HorizontalAlignment="Left" Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<StackPanel Orientation="Horizontal" Height="30" >
<Label HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="60" Content="自取数量:"/>
<StackPanel Orientation="Horizontal">
<c:BTextBox Height="30" Width="150" Text="{Binding Count}" BorderThickness="1"/>
<c:BButton Style="{StaticResource LinkButton}" Content="MAX" BorderThickness="0" Height="30" Width="50" Foreground="{StaticResource Border.Brush}" Click="BButton_Click_1"/>
</StackPanel>
</StackPanel>
</Grid>
<TextBlock VerticalAlignment="Center" Grid.Row="3" Text="{Binding StoreGetSelfResponse.ShowMessage}" Foreground="Orange"/>
</Grid>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="2" VerticalAlignment="Top"/>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

54
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
{
/// <summary>
/// StorePickProductWindow.xaml 的交互逻辑
/// </summary>
public partial class StorePickProductWindow : BWindow
{
public StorePickProductWindow(StoreGetSelfResponse model)
{
StoreGetSelfResponse=model;
InitializeComponent();
this.DataContext = this;
}
private string userName;
/// <summary>
/// 用户名
/// </summary>
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;
}
}
}
Loading…
Cancel
Save