Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
d08a424e34
  1. 2
      BBWY.Client/App.xaml.cs
  2. 26
      BBWY.Client/Helpers/MyPrintHelper.cs
  3. 1
      BBWY.Client/Models/MappingProfile.cs
  4. 1
      BBWY.Client/Models/Order/Order.cs
  5. 19
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  6. 4
      BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs
  7. 2
      BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs
  8. 1
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  9. 20
      BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
  10. 2
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  11. 41
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  12. 2
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  13. 8
      BBWY.Client/Views/FallWare/WaitFallWareControl.xaml
  14. 2
      BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs
  15. 2
      BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs
  16. 95
      BBWY.Client/Views/PackTask/PersonList.xaml
  17. 135
      BBWY.Client/Views/PackTask/PersonList.xaml.cs
  18. 18
      BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs

2
BBWY.Client/App.xaml.cs

@ -126,7 +126,7 @@ namespace BBWY.Client
serviceCollection.AddTransient<SealBoxConfigureViewModel>();
serviceCollection.AddTransient<PublishTaskViewModel>();
serviceCollection.AddTransient<QualityViewModel>();
//serviceCollection.AddScoped<PackServiceViewModel>();
serviceCollection.AddScoped<PackServiceViewModel>();
#region 注册拳探SDK相关类
serviceCollection.AddSingleton<QuanTanProductClient>();

26
BBWY.Client/Helpers/MyPrintHelper.cs

@ -1,6 +1,7 @@
using BarcodeLib;
using BBWY.Client.Extensions;
using BBWY.Client.Models;
using BBWY.Client.Models.FallWare;
using BBWY.Client.Models.PackTask;
using NPOI.XSSF.UserModel;
using Spire.Xls;
@ -623,6 +624,14 @@ namespace BBWY.Client.Helpers
}
/// <summary>
/// 打印封箱
/// </summary>
/// <param name="sealBoxModel"></param>
/// <param name="printName"></param>
/// <param name="boxCount"></param>
/// <param name="printCount"></param>
public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount)
{
// 100*180
@ -630,11 +639,6 @@ namespace BBWY.Client.Helpers
UnitConverHelper unitConverHelper = new UnitConverHelper();
var data = unitConverHelper.MmToPx(100, 180);
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNamePath = $"{applicationPath}/printSealName.init";
if (File.Exists(printNamePath))
@ -659,11 +663,8 @@ namespace BBWY.Client.Helpers
XSSFWorkbook wb2 = new XSSFWorkbook();
//wb2.CreateSheet("Sheet1");
sheet.CopyTo(wb2, "Sheet1", true, false);
var sheet2 = wb2.GetSheet("Sheet1");
var nameCell2 = sheet2.GetRow(0).GetCell(1);
nameCell2.SetCellValue(sealBoxModel.ShopName);
@ -711,6 +712,15 @@ namespace BBWY.Client.Helpers
print.Print();
}
/// <summary>
/// 打印京东箱唛
/// </summary>
public static void PrintJDBoxWareData(JDWareBoxModel jDWareBoxModel,string printName)
{
}
public static void SetDefaultPrint(string printName)
{

1
BBWY.Client/Models/MappingProfile.cs

@ -1,4 +1,5 @@
using AutoMapper;
using BBWY.Client.Models.Statistics.AfterSaleOrder;
namespace BBWY.Client.Models
{

1
BBWY.Client/Models/Order/Order.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BBWY.Client.Models.Statistics.AfterSaleOrder;
namespace BBWY.Client.Models
{

19
BBWY.Client/Models/PackTask/PackTaskModel.cs

@ -101,26 +101,9 @@ namespace BBWY.Client.Models
private void SetService()
{
ServiceWindow service = new ServiceWindow();
//加载数据
ViewModelLocator viewModelLocator = (ViewModelLocator)App.Current.Resources["Locator"];
var serviceViewModel = viewModelLocator.PackServiceList;
serviceViewModel.PackTaskModel = this;
serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection<PackTaskModel> { this };
serviceViewModel.FloorDragNumber = this.FloorDragNumber;
serviceViewModel.TaskCount = SkuCount;
serviceViewModel.TaskId = TaskId;
serviceViewModel.OrderId = OrderId;
serviceViewModel.SkuId = SkuId;
serviceViewModel.PackUserName = this.PackUser?.Replace("\r\n", ",")?.Replace("\n", ",")?.Replace("\r", ",");
serviceViewModel.LoadPackDatas();
serviceViewModel.SetAllFees = new Action(() =>
{
if (ReflashTask != null) ReflashTask();
});
ServiceWindow service = new ServiceWindow(this, ReflashTask);
service.Show();
}

4
BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs → BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs

@ -1,6 +1,6 @@
using System;
namespace BBWY.Client.Models
namespace BBWY.Client.Models.Statistics.AfterSaleOrder
{
public class AfterSaleOrder : NotifyObject, ICloneable
{
@ -146,7 +146,7 @@ namespace BBWY.Client.Models
public object Clone()
{
return this.MemberwiseClone();
return MemberwiseClone();
}
}
}

2
BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs → BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models
namespace BBWY.Client.Models.Statistics.AfterSaleOrder
{
public class AfterSaleOrderGroup
{

1
BBWY.Client/ViewModels/Order/OrderListViewModel.cs

@ -1,6 +1,7 @@
using BBWY.Client.APIServices;
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.Models.Statistics.AfterSaleOrder;
using BBWY.Client.Views.Order;
using BBWY.Common.Extensions;
using BBWY.Common.Models;

20
BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs

@ -32,7 +32,7 @@ using System.Windows.Media.Imaging;
namespace BBWY.Client.ViewModels.PackTask
{
public class PackServiceViewModel : BaseVM, IDenpendency
public class PackServiceViewModel : BaseVM
{
@ -132,7 +132,7 @@ namespace BBWY.Client.ViewModels.PackTask
readonly PackTaskService packTaskService;
readonly ConsumableService consumableService;
readonly PackDetailService packDetailService;
readonly BatchPurchaseService batchPurchaseService;
private ObservableCollection<PackItemModel> increateList = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> IncreateList { get => increateList; set { Set(ref increateList, value); } } //
@ -179,7 +179,7 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ObservableCollection<PackServiceDTO> BasicPackServiceList { get; set; } = new ObservableCollection<PackServiceDTO>();
private readonly PackServiceService packServiceService;
/// <summary>
/// 加载原数据
@ -236,14 +236,14 @@ namespace BBWY.Client.ViewModels.PackTask
}
public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackServiceService packServiceService, PackDetailService packDetailService, BatchPurchaseService batchPurchaseService)//, long taskId
public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackDetailService packDetailService)//, long taskId
{
//TaskId = taskId;
this.consumableService = consumableService;
this.packTaskService = packTaskService;
this.packServiceService = packServiceService;
this.packDetailService = packDetailService;
this.batchPurchaseService = batchPurchaseService;
AddIncreateServiceCommand = new RelayCommand(AddIncreateService);
@ -630,15 +630,15 @@ namespace BBWY.Client.ViewModels.PackTask
// new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
if (SetAllFees != null)
SetAllFees();
if (ReflashWindow != null)
ReflashWindow();
win.Close();
}
/// <summary>
/// 更新 打包员 和费用数据
/// 刷新界面
/// </summary>
public Action SetAllFees { get; set; }
public Action ReflashWindow { get; set; }
private void AddPackService()
{

2
BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs

@ -652,6 +652,7 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
IsLoadSealBoxCount();
IsLoadCount();
}
catch (Exception ex)
{
@ -723,6 +724,7 @@ namespace BBWY.Client.ViewModels.PackTask
}
IsLoadFallWareCount();
IsLoadCount();
}
catch (Exception ex)

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

@ -263,9 +263,6 @@ namespace BBWY.Client.ViewModels.PackTask
//加载数据
SetTaskState(null);
UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState);
CompeteSealBoxCommand = new RelayCommand<object>(CompeteSealBox);
@ -285,6 +282,40 @@ namespace BBWY.Client.ViewModels.PackTask
LookBoxConfigureCommand = new RelayCommand<object>(LookBoxConfigure);
PrintBoxConfigureCommand = new RelayCommand<object>(PrintBoxConfigure);
}
/// <summary>
/// todo: 打印数据
/// </summary>
/// <param name="obj"></param>
private void PrintBoxConfigure(object obj)
{
var fallware = obj as WaitFallWareModel;
JDWareBoxModel model = new JDWareBoxModel
{
ShopName = globalContext.User.Shop.ShopName,
WareName = fallware.WareName,
SealBoxId = fallware.SealBoxId,
ProductCount = fallware.ProductCount,
BoxCount = fallware.SealBoxCount,
PrewOrder = fallware.BoxConfigureData.PrewOrder,
ProductTitle = fallware.BoxConfigureData.ProductTitle,
PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder,
WaybillNo = fallware.BoxConfigureData.WaybillNo
};
if (fallware.WareType == WareType.)
{
//加载模板数据
}
if (fallware.WareType == WareType.)
{
}
//打印
}
private void LookBoxConfigure(object obj)
@ -408,6 +439,10 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand SetSealBoxCommand { get; set; }
/// <summary>
/// 打印封箱数据
/// </summary>
public ICommand PrintBoxConfigureCommand { get; set; }

2
BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs

@ -663,7 +663,7 @@ namespace BBWY.Client.ViewModels
IsNeedCertificateModel = Need.;
return;
}
var skus = PurchaseSkuList.SingleOrDefault(p => p.PurchaseSkuId == s.PurchaseSkuId);
var skus = PurchaseSkuList.SingleOrDefault(p =>p.cerDTO!=null&& p.cerDTO.PurchaseSkuId == s.PurchaseSkuId);
skus.CerDTO = s;
skus.IsSetCertificate = false;
skus.IsNeedCer = PackCerState == PackCerState.;

8
BBWY.Client/Views/FallWare/WaitFallWareControl.xaml

@ -249,9 +249,13 @@
Command="{Binding DataContext.LookBoxConfigureCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding}"
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="打印"
Command="{Binding DataContext.PrintBoxConfigureCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding}"
Visibility="Collapsed"
/>
</StackPanel>
<TextBlock Style="{StaticResource middleTextBlock}" Text="未上传"
<TextBlock Style="{StaticResource middleTextBlock}" Text="未配置"
Visibility="{Binding BoxConfigureData,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>

2
BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs

@ -1,4 +1,4 @@
using BBWY.Client.Models;
using BBWY.Client.Models.Statistics.AfterSaleOrder;
using BBWY.Controls;
using System.Windows;

2
BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs

@ -1,4 +1,4 @@
using BBWY.Client.Models;
using BBWY.Client.Models.Statistics.AfterSaleOrder;
using BBWY.Controls;
namespace BBWY.Client.Views.Order

95
BBWY.Client/Views/PackTask/PersonList.xaml

@ -1,95 +0,0 @@
<Page x:Class="BBWY.Client.Views.PackTask.PersonList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding WareHouseList,Source={StaticResource Locator}}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="2048"
Title="TaskList">
<Page.Resources>
<sys:Int32 x:Key="d0">0</sys:Int32>
<sys:Int32 x:Key="d1">1</sys:Int32>
<sys:Int32 x:Key="d3">2</sys:Int32>
<sys:Int32 x:Key="d7">6</sys:Int32>
<sys:Int32 x:Key="d15">14</sys:Int32>
<sys:Int32 x:Key="d30">29</sys:Int32>
</Page.Resources>
<Grid>
<StackPanel Panel.ZIndex="10" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="810,15,0,0">
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
</ListBox>
</StackPanel>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" Width="1100">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30">
<StackPanel.Resources>
<Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/>
</Style>
</StackPanel.Resources>
<TextBlock Text="提交时间:" VerticalAlignment="Center" Margin="11,0,0,0"/>
<DatePicker SelectedDate="{Binding StartTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<DatePicker SelectedDate="{Binding EndTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<TextBlock Text="花名:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="" Text="{Binding SearchSkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="任务ID:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark=""/>
<TextBlock Text="部门:" VerticalAlignment="Center" Margin="16,0,0,0"/>
</StackPanel>
<Grid Grid.Column="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="5,0,0,0"
Command="{Binding SearchTaskCommand}"
Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
</Grid>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
Grid.Row="3"
HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers>
<b:EventTrigger EventName="OnPageIndexChanged">
<b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:PageControl>
</Grid>
</Grid>
</Page>

135
BBWY.Client/Views/PackTask/PersonList.xaml.cs

@ -1,135 +0,0 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models.PackTask;
using BBWY.Common.Models;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
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.Navigation;
using System.Windows.Shapes;
using System.Linq;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// PersonList.xaml 的交互逻辑
/// </summary>
public partial class PersonList : Page
{
public PersonList()
{
InitializeComponent();
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var builder = new ConfigurationBuilder().SetBasePath(applicationPath).AddJsonFile("BBWYAppSettings.json", false, true);
var Configuration = builder.Build();
QKApiHost = Configuration.GetSection("QKApiHost").Value;
}
/// <summary>
/// 主机域名
/// </summary>
string QKApiHost = "";
public void SelectionChangeCommand(object sender, SelectionChangedEventArgs e)
{
try
{
var list = (ListBox)sender;
if (list.Items.Count <= 0)
{
return;
}
var value = (ListBoxItem)list.SelectedValue;
var content = (Label)value.Content;
tb.Text = content.Content.ToString();
tipBox.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
}
}
List<string> departments = new List<string>();
private void tb_TextChanged(object sender, TextChangedEventArgs e)
{
try
{
var textBoxt = (TextBox)sender;
//创建一个ListBox
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
if (departments.Count <= 0)
{
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
var data = helper.Get(url);
var res = JsonConvert.DeserializeObject<ApiResponse<UserDepartment[]>>(data);
//创建一个ListBoxIem
if (res.Success)
{
if (res.Data != null && res.Data.Count() > 0)
{
foreach (var department in res.Data)
{
if (!departments.Contains(department.DePartmentName))
{
departments.Add(department.DePartmentName);
}
}
}
}
}
if (string.IsNullOrEmpty(textBoxt.Text))
{
tipBox.Visibility = Visibility.Collapsed;
return;
}
foreach (var department in departments)
{
if (department.Contains(textBoxt.Text))
{
ListBoxItem item = new ListBoxItem();
Label lb = new Label();
lb.Content = department;
item.Content = lb;
tipBox.Items.Add(item);
}
}
tipBox.Visibility = Visibility.Visible;
}
catch (Exception)
{
}
}
}
}

18
BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs

@ -1,6 +1,7 @@
using BarcodeLib;
using BBWY.Client.APIServices;
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Controls;
@ -15,6 +16,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@ -31,9 +33,23 @@ namespace BBWY.Client.Views.PackTask
/// </summary>
public partial class ServiceWindow : BWindow
{
public ServiceWindow()
public ServiceWindow(PackTaskModel model,Action reflashWindow)
{
InitializeComponent();
var serviceViewModel= this.DataContext as PackServiceViewModel;
//加载数据
serviceViewModel.PackTaskModel = model;
serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection<PackTaskModel> { model };
serviceViewModel.FloorDragNumber = model.FloorDragNumber;
serviceViewModel.TaskCount = model.SkuCount;
serviceViewModel.TaskId = model. TaskId;
serviceViewModel.OrderId = model. OrderId;
serviceViewModel.SkuId = model. SkuId;
serviceViewModel.PackUserName = model.PackUser?.Replace("\r\n", ",")?.Replace("\n", ",")?.Replace("\r", ",");
serviceViewModel.LoadPackDatas();
if (reflashWindow != null)
serviceViewModel.ReflashWindow = reflashWindow;
}
private void BButton_Click(object sender, RoutedEventArgs e)
{

Loading…
Cancel
Save