From f5505856eb4cb12e29879a8a41b7a3470f0f2c79 Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Tue, 4 Jul 2023 20:28:27 +0800
Subject: [PATCH] 1
---
.../APIServices/QiKu/PackTaskService.cs | 5 +-
.../APIServices/QiKu/SealBoxService.cs | 23 +-
BBWY.Client/BBWY.Client.csproj | 12 +
BBWY.Client/Helpers/MyPrintHelper.cs | 38 +-
BBWY.Client/Models/Enums.cs | 11 +
BBWY.Client/Models/FallWare/JDWareBoxModel.cs | 5 +
.../PackTask/PackServiceViewModel.cs | 7 -
.../ViewModels/PackTask/TaskListViewModel.cs | 2 +-
.../PackTask/WareHouseListViewModel.cs | 79 ++-
.../Views/FallWare/PrintBoxWindow.xaml | 62 ++
.../Views/FallWare/PrintBoxWindow.xaml.cs | 120 ++++
.../Views/FallWare/SetCloudWareBoxWindow.xaml | 54 +-
.../FallWare/SetCloudWareBoxWindow.xaml.cs | 76 +-
.../Views/FallWare/SetJDWareBoxWindow.xaml | 144 ++--
.../Views/FallWare/SetJDWareBoxWindow.xaml.cs | 92 ++-
.../Views/FallWare/WaitFallWareControl.xaml | 3 +-
.../FallWare/WareFallWareListControl.xaml | 84 ++-
.../FallWare/WareFallWareListControl.xaml.cs | 105 ++-
BBWY.Client/Views/PackTask/TaskList.xaml | 81 +--
.../Views/PackTask/TaskListControl.xaml | 5 -
.../Views/PackTask/WaitCompletedControl.xaml | 376 +++++-----
.../PackTask/WaitCompletedControl.xaml.cs | 101 ++-
.../Views/PackTask/WaitPackageControl.xaml | 655 ++++++++++--------
.../Views/PackTask/WaitPackageControl.xaml.cs | 195 +++++-
BBWY.Client/Views/PackTask/WareHouseList.xaml | 78 +--
.../Views/PackTask/WareHouseList.xaml.cs | 231 ------
.../Views/PackTask/WareHouseListControl.xaml | 604 ++++++++--------
.../PackTask/WareHouseListControl.xaml.cs | 193 +++++-
.../Views/QualityTask/WaitQualityControl.xaml | 615 ++++++++--------
.../QualityTask/WaitQualityControl.xaml.cs | 195 +++++-
.../TaskOverTime/WareTaskOverTimeControl.xaml | 39 +-
31 files changed, 2704 insertions(+), 1586 deletions(-)
create mode 100644 BBWY.Client/Views/FallWare/PrintBoxWindow.xaml
create mode 100644 BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs
diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs
index f6133700..4a4fedb1 100644
--- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs
+++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs
@@ -293,7 +293,7 @@ namespace BBWY.Client.APIServices
///
///
///
- public ApiResponse SearchOverTimeTaskList(string ShopId, DateTime? StartTime, DateTime? EndTime, OverTimeTaskType? OverTimeTaskType, int? PageIndex, int? PageSize=20)
+ public ApiResponse SearchOverTimeTaskList(string ShopId, DateTime? StartTime, DateTime? EndTime,OverTimeTaskState overTimeTaskState, OverTimeTaskType? OverTimeTaskType, int? PageIndex, int? PageSize=20)
{
return SendRequest(globalContext.QKApiHost, $"api/PackTask/SearchOverTimeTaskList", new {
ShopId,
@@ -301,7 +301,8 @@ namespace BBWY.Client.APIServices
EndTime,
OverTimeTaskType,
PageIndex,
- PageSize
+ PageSize,
+ overTimeTaskState
}, null, HttpMethod.Post);
}
diff --git a/BBWY.Client/APIServices/QiKu/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs
index 8febd8d2..c66b54c0 100644
--- a/BBWY.Client/APIServices/QiKu/SealBoxService.cs
+++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs
@@ -88,7 +88,7 @@ namespace BBWY.Client.APIServices
, null, HttpMethod.Post);
}
- public ApiResponse GetWareSealBoxList(string ShopName, long? TaskId, string SkuId, int? PageIndex, int? PageSize)
+ public ApiResponse GetWareSealBoxList(string ShopName, long? TaskId, string SkuId,long? SealBoxId, int? PageIndex, int? PageSize)
{
return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxList",
new
@@ -97,7 +97,8 @@ namespace BBWY.Client.APIServices
TaskId,
SkuId,
PageIndex,
- PageSize
+ PageSize,
+ SealBoxId
}
, null, HttpMethod.Post);
}
@@ -124,7 +125,7 @@ namespace BBWY.Client.APIServices
///
///
///
- public ApiResponse SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1
+ public ApiResponse SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null,long?sealBoxId=null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest(globalContext.QKApiHost, $"api/SealBox/SearchWareFallWareConfigureList",
@@ -135,7 +136,8 @@ namespace BBWY.Client.APIServices
SkuId,
PageIndex,
PageSize,
- positionState
+ positionState,
+ sealBoxId
}
, null, HttpMethod.Post);
}
@@ -169,7 +171,7 @@ namespace BBWY.Client.APIServices
- public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "")
+ public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "",string WareCity="")
{
return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure",
new
@@ -180,7 +182,8 @@ namespace BBWY.Client.APIServices
PrewOrder,
WaybillNo,
providerName,
- wareName
+ wareName,
+ WareCity
}
, null, HttpMethod.Post);
}
@@ -264,13 +267,17 @@ namespace BBWY.Client.APIServices
null, null, HttpMethod.Post);
}
- public ApiResponse GetWareWaitCompletedList(string shopId, int? PageIndex, int? PageSize)
+ public ApiResponse GetWareWaitCompletedList(string shopId, string ShopName , long? TaskId , string SkuId , long? sealBoxId , int? PageIndex, int? PageSize)
{
return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareWaitCompletedList",
new {
shopId,
PageIndex,
- PageSize
+ PageSize,
+ ShopName,
+ TaskId,
+ SkuId,
+ sealBoxId
}, null, HttpMethod.Post);
}
diff --git a/BBWY.Client/BBWY.Client.csproj b/BBWY.Client/BBWY.Client.csproj
index 2643c69f..36e0e5dc 100644
--- a/BBWY.Client/BBWY.Client.csproj
+++ b/BBWY.Client/BBWY.Client.csproj
@@ -84,6 +84,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BBWY.Client/Helpers/MyPrintHelper.cs b/BBWY.Client/Helpers/MyPrintHelper.cs
index d9fbd559..bac14d65 100644
--- a/BBWY.Client/Helpers/MyPrintHelper.cs
+++ b/BBWY.Client/Helpers/MyPrintHelper.cs
@@ -52,10 +52,7 @@ namespace BBWY.Client.Helpers
default:
break;
}
-
}
-
-
private static void SetBar(BarCodeModel barCode, ref PrintPageEventArgs args, Font font, int heightSpace)
{
@@ -106,10 +103,6 @@ namespace BBWY.Client.Helpers
topHeigth += (50 + 5);
args.Graphics.DrawString(barcodeSku, font, System.Drawing.Brushes.Black, new PointF((236 - size.Width) / 2, topHeigth));
}
-
-
-
-
///
/// 标准
///
@@ -159,7 +152,6 @@ namespace BBWY.Client.Helpers
args.Graphics.DrawString(barcodeSku, font, System.Drawing.Brushes.Black, new PointF((236 - size.Width) / 2, 130));
args.Graphics.DrawImage(img, 1, 68, 234, 60);
}
-
public static void PrintCertificate(ref PrintPageEventArgs args, CertificateModel certificate, Font font)
{
@@ -194,7 +186,6 @@ namespace BBWY.Client.Helpers
}
-
private static void SetCerStander(ref PrintPageEventArgs args, CertificateModel certificate, Font font)
{
@@ -579,7 +570,6 @@ namespace BBWY.Client.Helpers
}
-
public static void SaveImage(PrintPageEventArgs args)
{
args.Graphics.Save();
@@ -593,9 +583,13 @@ namespace BBWY.Client.Helpers
}
-
-
-
+ ///
+ /// 字符串生成条形码 图片
+ ///
+ ///
+ ///
+ ///
+ ///
public static BitmapImage GetBarcodeImage(string printStr, int width, int height)
{
Bitmap image = new Bitmap(width, height);
@@ -606,6 +600,24 @@ namespace BBWY.Client.Helpers
return bitmapToBitmapImage(image);
}
+ ///
+ /// 字符串生成条形码 图片
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static BitmapImage GetBarcodeImageV2(string printStr, int width, int height)
+ {
+ Bitmap image = new Bitmap(width, height);
+ Graphics graphics2 = Graphics.FromImage(image);
+ Barcode barcode = new Barcode();
+ System.Drawing.Image img = barcode.Encode(TYPE.CODE128, printStr, width, height);
+ graphics2.DrawImage(img, 0, 0, width, height);
+ return bitmapToBitmapImage(image);
+ }
+
+
static BitmapImage bitmapToBitmapImage(Bitmap bitmap)
{
using (var stream = new MemoryStream())
diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs
index 9f5f5dbc..f74b9bc1 100644
--- a/BBWY.Client/Models/Enums.cs
+++ b/BBWY.Client/Models/Enums.cs
@@ -538,6 +538,17 @@
待落仓 = 8,
待转运 = 11,
}
+
+ ///
+ /// 超时任务状态
+ ///
+ public enum OverTimeTaskState
+ {
+ 未完成 = 0,
+ 已完成 = 1,
+ 全部=2
+
+ }
public enum TaskMessageType
{
任务ID = 0,
diff --git a/BBWY.Client/Models/FallWare/JDWareBoxModel.cs b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs
index c3483d75..2f51f68d 100644
--- a/BBWY.Client/Models/FallWare/JDWareBoxModel.cs
+++ b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs
@@ -58,5 +58,10 @@ namespace BBWY.Client.Models.FallWare
/// 供应商
///
public string ProviderName { get; set; }
+
+ ///
+ /// 仓库城市
+ ///
+ public string WareCity { get; set; }
}
}
diff --git a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
index bc724769..d8512662 100644
--- a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
@@ -60,13 +60,6 @@ namespace BBWY.Client.ViewModels.PackTask
public int IncrementPartTaskCount { get => incrementPartTaskCount; set { Set(ref incrementPartTaskCount, value); } }
-
- //public ObservableCollection incrementPartCountList = new ObservableCollection() {
- //"0","1","2","3","4件以上"
- //};
-
- //public ObservableCollection IncrementPartCountList { get => incrementPartCountList; set { Set(ref incrementPartCountList, value); } }
-
private int incrementPartCount;
///
/// 配件数量
diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
index 96b1d83c..ac7e5f88 100644
--- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
@@ -942,7 +942,7 @@ namespace BBWY.Client.ViewModels.PackTask
Task.Factory.StartNew(() =>
{
WaitCompletedList = new ObservableCollection();
- var datas = sealBoxService.GetWareWaitCompletedList(globalContext.User.Shop.ShopId.ToString(), PageIndex, PageSize);
+ var datas = sealBoxService.GetWareWaitCompletedList(globalContext.User.Shop.ShopId.ToString(), null, taskId, SearchSkuId, null, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
index 6e657193..06b1adba 100644
--- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
@@ -64,11 +64,27 @@ namespace BBWY.Client.ViewModels.PackTask
///
public ObservableCollection OverTimeTaskTypeList { get => overTimeTaskTypeList; set { Set(ref overTimeTaskTypeList, value); } }
- private OverTimeTaskType overTimeTaskState = OverTimeTaskType.全部;
+ private ObservableCollection overTimeTaskStateList = new ObservableCollection {
+ Models.OverTimeTaskState.未完成 , Models.OverTimeTaskState.已完成, OverTimeTaskState.全部
+ };
+ ///
+ ///超时任务类型
+ ///
+ public ObservableCollection OverTimeTaskStateList { get => overTimeTaskStateList; set { Set(ref overTimeTaskStateList, value); } }
+
+
+
+ private OverTimeTaskType overTimeTaskType = OverTimeTaskType.全部;
///
/// 任务类型(超时)
///
- public OverTimeTaskType OverTimeTaskState { get => overTimeTaskState; set { Set(ref overTimeTaskState, value); } }
+ public OverTimeTaskType OverTimeTaskType { get => overTimeTaskType; set { Set(ref overTimeTaskType, value); } }
+
+ private OverTimeTaskState overTimeTaskState = OverTimeTaskState.全部;
+ ///
+ /// 任务类型(超时)
+ ///
+ public OverTimeTaskState OverTimeTaskState { get => overTimeTaskState; set { Set(ref overTimeTaskState, value); } }
@@ -171,6 +187,18 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
+ ///
+ /// 查询任务id
+ ///
+ private string searchSealBoxId;
+ public string SearchSealBoxId
+ {
+ get => searchSealBoxId; set
+ {
+ Set(ref searchSealBoxId, value);
+ }
+ }
+
///
/// 查询Sku
///
@@ -496,16 +524,14 @@ namespace BBWY.Client.ViewModels.PackTask
PrewOrder = fallware.BoxConfigureData.PrewOrder,
ProductTitle = fallware.BoxConfigureData.ProductTitle,
PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder,
- WaybillNo = fallware.BoxConfigureData.WaybillNo
+ WaybillNo = fallware.BoxConfigureData.WaybillNo,
+ ProviderName = fallware.BoxConfigureData.ProviderName
};
- if (fallware.WareType == WareType.京仓)
- {
+
+ PrintBoxWindow printBox = new PrintBoxWindow(model, fallware.WareType);
+ printBox.ShowDialog();
//加载模板数据
- }
- if (fallware.WareType == WareType.云仓)
- {
-
- }
+
//打印
}
@@ -527,14 +553,14 @@ namespace BBWY.Client.ViewModels.PackTask
};
if (fallware.WareType == WareType.京仓)
{
- SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false);
+ SetJDWareBoxWindow window = new SetJDWareBoxWindow(model);
window.Show();
//var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType, ReflashTask, false);
//w.ShowDialog();
}
if (fallware.WareType == WareType.云仓 || fallware.WareType == WareType.聚水潭齐越仓)
{
- SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false);
+ SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, fallware.WareType);
window.Show();
}
@@ -714,12 +740,26 @@ namespace BBWY.Client.ViewModels.PackTask
case Models.TaskState.未到货:
case Models.TaskState.部分到货:
+
+ if (!model.OrderId.IsNullOrEmpty())
+ {
+ if (model.ExpressOrderList==null||model.ExpressOrderList.Count<=0)
+ {
+ System.Windows.MessageBox.Show("该任务采购单未进行发货,请联系业务进行发货后在确认收货", "提示");
+ return;
+ }
+ }
if (System.Windows.MessageBox.Show("是否确认收货?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
res = packTaskService.SetPackTaskState(taskId, Models.TaskState.待验收);
+ if (res != null && res.Success)
+ {
+
+ //todo:手动发货上传B端数据
+ }
break;
case Models.TaskState.待验收:
break;
@@ -782,10 +822,17 @@ namespace BBWY.Client.ViewModels.PackTask
PageSize = 10;
IsStartThread = false;
long? taskId = null;
+ long? sealBoxId = null;
try
{
if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim()))
taskId = Convert.ToInt64(SearchTaskId);
+
+ var istrue = long.TryParse(SearchSealBoxId, out long sealboxid);
+ if (istrue)
+ {
+ sealBoxId = sealboxid;
+ }
}
catch
{
@@ -800,7 +847,7 @@ namespace BBWY.Client.ViewModels.PackTask
Task.Factory.StartNew(() =>
{
WaitCompletedList = new ObservableCollection();
- var datas = sealBoxService.GetWareWaitCompletedList(null, PageIndex, PageSize);
+ var datas = sealBoxService.GetWareWaitCompletedList(null, SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
@@ -828,7 +875,7 @@ namespace BBWY.Client.ViewModels.PackTask
Task.Factory.StartNew(() =>
{
OverTimeTaskList = new ObservableCollection();
- var datas = packTaskService.SearchOverTimeTaskList(null, StartTime, EndTime, OverTimeTaskState, PageIndex, PageSize);
+ var datas = packTaskService.SearchOverTimeTaskList(null, StartTime, EndTime, OverTimeTaskState,OverTimeTaskType, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
@@ -923,7 +970,7 @@ namespace BBWY.Client.ViewModels.PackTask
WaitFallWareList = new ObservableCollection();
- var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
+ var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId,sealBoxId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
@@ -1014,7 +1061,7 @@ namespace BBWY.Client.ViewModels.PackTask
{
WaitSealBoxModels = new ObservableCollection();
- var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
+ var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
diff --git a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml
new file mode 100644
index 00000000..0dbcf4ce
--- /dev/null
+++ b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs
new file mode 100644
index 00000000..9d55e9a1
--- /dev/null
+++ b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs
@@ -0,0 +1,120 @@
+using BBWY.Client.APIServices;
+using BBWY.Client.Models;
+using BBWY.Client.Models.FallWare;
+using BBWY.Controls;
+using NPOI.Util;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Drawing.Printing;
+using System.IO;
+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.Shapes;
+
+namespace BBWY.Client.Views.FallWare
+{
+ ///
+ /// PrintBoxWindow.xaml 的交互逻辑
+ ///
+ public partial class PrintBoxWindow : BWindow
+ {
+ public PrintBoxWindow(JDWareBoxModel model, WareType WareType)
+ {
+ JDWareBoxModel =model ; this.WareType = WareType;
+ InitializeComponent();
+ this.DataContext = this;
+ InitPrintList();
+ }
+ public void InitPrintList()
+ {
+ //TaskImage = MyPrintHelper.GetBarcodeImage(TaskId.ToString(), 300, 60);
+
+ //BarcodeImage = MyPrintHelper.GetBarcodeImage(SkuId, 300, 60);
+
+
+ PrintList = new ObservableCollection();
+ var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据
+ int index = -1;
+ int selectIndex = 0;
+ foreach (string name in printingNames)
+ {
+ if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax")
+ {
+ continue;
+ }
+ index++;
+ if (name.Contains("Deli"))
+ {
+ selectIndex = index;
+ }
+ PrintList.Add(name);
+ }
+ try
+ {
+ var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
+ if (File.Exists(printNames))
+ {
+ PrintName = File.ReadAllText(printNames);
+ }
+ else
+ {
+ if (PrintList.Count > 0)
+ {
+ PrintName = PrintList[0].ToString();
+ }
+ }
+ }
+ catch (Exception)
+ {
+
+
+ }
+
+ }
+
+ public string PrintName { get; set; }
+ public int PrintCount { get; set; } = 1;
+
+
+
+ public JDWareBoxModel JDWareBoxModel { get; set; }
+
+ ///
+ /// 箱唛类型
+ ///
+ public WareType WareType { get; set; }
+ ///
+ /// 打印机列表
+ ///
+ public ObservableCollection PrintList { get; set; }
+
+ private void BButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (WareType== WareType.京仓)
+ {
+ SetJDWareBoxWindow jdWindow = new SetJDWareBoxWindow(JDWareBoxModel);
+ jdWindow.Show();
+ //jdWindow.WindowState = WindowState.Maximized;
+ jdWindow.PrintBox(PrintName);
+ }
+
+ if (WareType== WareType.云仓|| WareType== WareType.聚水潭齐越仓)
+ {
+ SetCloudWareBoxWindow cloudWareWindow = new SetCloudWareBoxWindow(JDWareBoxModel, WareType);
+ cloudWareWindow.Visibility = Visibility.Hidden;
+ cloudWareWindow.Show();
+
+ cloudWareWindow.PrintBox(PrintName);
+ }
+ }
+ }
+}
diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml
index edd95a9e..f695c01b 100644
--- a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml
+++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml
@@ -16,7 +16,7 @@
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
- Width="450" Height="330"
+ Width="450" Height="380"
RightButtonGroupMargin="0,5,5,0">
@@ -45,12 +45,12 @@
Background="{StaticResource Border.Background}">
-
+
-
-
-
-
+
+
+
+
@@ -59,37 +59,41 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
+
+
diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs
index cc441b07..a7488555 100644
--- a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs
+++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs
@@ -14,6 +14,10 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WebSocketSharp;
+using BBWY.Client.Helpers;
+using System.Printing;
+using System.Reflection;
+using System.IO;
namespace BBWY.Client.Views.FallWare
{
@@ -22,51 +26,71 @@ namespace BBWY.Client.Views.FallWare
///
public partial class SetCloudWareBoxWindow : BWindow
{
- public SetCloudWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true)
+ public SetCloudWareBoxWindow(JDWareBoxModel model, WareType wareType)
{
- if (SealBoxService == null) this.SealBoxService = sealBoxService;
- WareType = wareType;
- ReflashWindow = reflashWindow;
+ WareType = wareType;
JDWareBoxModel = model;
InitializeComponent();
- this.DataContext =this ;
- if (!isEnabled)
- {
- //this.jd_box.IsEnabled = isEnabled;
- //this.btn_save.Visibility = Visibility.Collapsed;
- }
+ PurchaseOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50);
+ this.DataContext = this;
+
}
public JDWareBoxModel JDWareBoxModel { get; set; }
-
- private SealBoxService SealBoxService { get; set; }
-
- private Action ReflashWindow { get; set; }
-
+ ///
+ /// 采购单号条形码
+ ///
+ public BitmapImage PurchaseOrderImage { get; set; }
public WareType WareType { get; set; }
- private void BButton_Click(object sender, RoutedEventArgs e)
+ public int PrintCount { get; set; } = 1;
+
+ public void PrintBox(string printName)
{
- if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
+ var localPrintServer = new LocalPrintServer();
+ if (string.IsNullOrEmpty(printName))
{
- MessageBox.Show("采购单号不能为空");
return;
}
- if (JDWareBoxModel.PrewOrder.IsNullOrEmpty() && WareType == WareType.京仓)
+ var printQueue = localPrintServer.GetPrintQueue(printName);
+ if (printQueue.IsInError)
{
- MessageBox.Show("预约单号不能为空");
+ System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
- var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo);
+ MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
+ PrintDialog printDialog = new PrintDialog();
- if (res != null && res.Success)
+ printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向
+
+ for (int i = 1; i <= JDWareBoxModel.BoxCount; i++)
{
- if (ReflashWindow != null) ReflashWindow();
- this.Close();
+ PrintCount = i;
+ //设置纸张大小
+ var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
+ var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
+ printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
- return;
+
+ this.Height = pageHeight + 39;
+ this.Width = pageWidth;
+ this.FontSize = 30;
+ this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight)));
+ //794 429 Width="478" Height="440"
+ //this.jd_box.Arrange(new Rect(new Point((pageWidth - jd_box.DesiredSize.Width) / 2, (pageHeight - jd_box.DesiredSize.Height) / 2), new Size(jd_box.DesiredSize.Width, jd_box.DesiredSize.Height)));
+
+ printDialog.PrintVisual(this.jd_box, "打印任务");
+
+
+ }
+ var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
+ if (File.Exists(printNames))
+ {
+ File.Delete(printNames);
}
- if (res != null) MessageBox.Show(res.Msg);
+ System.IO.File.WriteAllText(printNames, printName);
+ this.Close();
}
}
}
diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml
index eb41b156..acfb7497 100644
--- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml
+++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml
@@ -10,13 +10,13 @@
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
-
+ xmlns:hc="https://handyorg.github.io/handycontrol"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
- Width="450" Height="500"
+ Width="480" Height="480"
RightButtonGroupMargin="0,5,5,0">
@@ -29,13 +29,13 @@
-
+
-
-
+
+
@@ -45,69 +45,77 @@
Background="{StaticResource Border.Background}">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs
index 1102aee2..000f38a1 100644
--- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs
+++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs
@@ -1,10 +1,18 @@
using BBWY.Client.APIServices;
+using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.Models.FallWare;
using BBWY.Controls;
+using HandyControl.Controls;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Drawing.Printing;
+using System.IO;
+using System.Printing;
+using System.Reflection;
using System.Text;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@@ -22,54 +30,82 @@ namespace BBWY.Client.Views.FallWare
///
public partial class SetJDWareBoxWindow : BWindow
{
- public SetJDWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService,WareType wareType, Action reflashWindow,bool isEnabled = true)
+ public SetJDWareBoxWindow(JDWareBoxModel model)
{
- if (SealBoxService == null) this.SealBoxService = sealBoxService;
- WareType = wareType;
- ReflashWindow = reflashWindow;
-
JDWareBoxModel = model;
InitializeComponent();
- this.DataContext = JDWareBoxModel;
- if (!isEnabled)
- {
- //this.jd_box.IsEnabled = isEnabled;
- //this.btn_save.Visibility = Visibility.Collapsed;
- }
-
-
-
+ PurchaseOrderImage= MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50);
+ PrewOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PrewOrder, 350, 50);
+ this.DataContext =this;
}
public JDWareBoxModel JDWareBoxModel { get; set; }
- private SealBoxService SealBoxService { get; set; }
- private Action ReflashWindow { get; set; }
+ ///
+ /// 采购单号条形码
+ ///
+ public BitmapImage PurchaseOrderImage { get; set; }
+
+
+ ///
+ /// 预约单号条形码
+ ///
+ public BitmapImage PrewOrderImage { get; set; }
+
+
+ public int PrintCount { get; set; } = 1;
+
+
+
- private WareType WareType { get; set; }
- private void BButton_Click(object sender, RoutedEventArgs e)
+
+ public void PrintBox(string printName)
{
- if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
+ var localPrintServer = new LocalPrintServer();
+ if (string.IsNullOrEmpty(printName))
{
- MessageBox.Show("采购单号不能为空");
return;
}
- if (JDWareBoxModel.PrewOrder.IsNullOrEmpty()&& WareType== WareType.京仓)
+ var printQueue = localPrintServer.GetPrintQueue(printName);
+ if (printQueue.IsInError)
{
- MessageBox.Show("预约单号不能为空");
+ System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
- var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle,JDWareBoxModel.PurchaseOrder,JDWareBoxModel.PrewOrder,JDWareBoxModel.WaybillNo);
+ MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
+ PrintDialog printDialog = new PrintDialog();
+
+ printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向
- if (res!=null&&res.Success)
+ for (int i = 1; i <= JDWareBoxModel.BoxCount; i++)
{
- if (ReflashWindow != null) ReflashWindow();
- this.Close();
+ PrintCount = i;
+ //设置纸张大小
+ var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
+ var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
+ printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
- return;
+
+ this.Height = pageHeight + 39;
+ this.Width = pageWidth;
+ this.FontSize = 30;
+ this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight)));
+ //794 429 Width="478" Height="440"
+ //this.jd_box.Arrange(new Rect(new Point((pageWidth - jd_box.DesiredSize.Width) / 2, (pageHeight - jd_box.DesiredSize.Height) / 2), new Size(jd_box.DesiredSize.Width, jd_box.DesiredSize.Height)));
+
+ printDialog.PrintVisual(this.jd_box, "打印任务");
+
+
+ }
+ var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
+ if (File.Exists(printNames))
+ {
+ File.Delete(printNames);
}
- if (res != null) MessageBox.Show(res.Msg);
+ System.IO.File.WriteAllText(printNames, printName);
+ this.Close();
}
}
}
diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml
index bf3d47d6..fda3766c 100644
--- a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml
+++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml
@@ -255,10 +255,9 @@
Command="{Binding DataContext.LookBoxConfigureCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding}"
/>
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
+
-
-
+
-
-
+
\ No newline at end of file
diff --git a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs
index 365095e9..07b08064 100644
--- a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs
+++ b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs
@@ -1,5 +1,10 @@
-using System;
+using BBWY.Client.Helpers;
+using BBWY.Client.ViewModels;
+using BBWY.Common.Models;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -10,6 +15,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using WebSocketSharp;
namespace BBWY.Client.Views.FallWare
{
@@ -21,6 +27,103 @@ namespace BBWY.Client.Views.FallWare
public WareFallWareListControl()
{
InitializeComponent();
+ this.Loaded += Load;
+ }
+ GlobalContext globalContext;
+
+ public void LoadShops(GlobalContext globalContext)
+ {
+ this.globalContext = globalContext;
+ shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
+
+ }
+
+ private void Load(object sender, RoutedEventArgs e)
+ {
+
+ try
+ {
+ var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
+
+ LoadShops(model.GlobalContext);
+ }
+ catch
+ {
+
+
+ }
+ }
+ public string QKApiHost { get; set; }
+
+
+ List shops = new List();
+
+
+ private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
+ {
+ tipBoxShop.Items.Clear();
+
+ }
+
+ if (shops.Count <= 0)
+ {
+ if (globalContext != null)
+ LoadShops(globalContext);
+ }
+
+ if (string.IsNullOrEmpty(textBoxt.Text))
+ {
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ return;
+ }
+ foreach (var department in shops)
+ {
+ if (department.Contains(textBoxt.Text))
+ {
+ ListBoxItem item = new ListBoxItem();
+ Label lb = new Label();
+ lb.Content = department;
+ item.Content = lb;
+ tipBoxShop.Items.Add(item);
+ }
+
+ }
+ if (tipBoxShop != null)
+ tipBoxShop.Visibility = Visibility.Visible;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
+
+ private void tipBoxShop_SelectionChanged(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;
+ tbShop.Text = content.Content.ToString();
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ }
+ catch (Exception)
+ {
+
+
+ }
}
}
}
diff --git a/BBWY.Client/Views/PackTask/TaskList.xaml b/BBWY.Client/Views/PackTask/TaskList.xaml
index 5b2158c1..a990f555 100644
--- a/BBWY.Client/Views/PackTask/TaskList.xaml
+++ b/BBWY.Client/Views/PackTask/TaskList.xaml
@@ -66,45 +66,17 @@
-
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
diff --git a/BBWY.Client/Views/PackTask/TaskListControl.xaml b/BBWY.Client/Views/PackTask/TaskListControl.xaml
index 00392f59..d17aa491 100644
--- a/BBWY.Client/Views/PackTask/TaskListControl.xaml
+++ b/BBWY.Client/Views/PackTask/TaskListControl.xaml
@@ -115,11 +115,6 @@
-
diff --git a/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml b/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml
index e4ba54ee..b9027e45 100644
--- a/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml
+++ b/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml
@@ -25,38 +25,89 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- -->
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
-
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
-
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
diff --git a/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml.cs b/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml.cs
index da24e913..6b5a206e 100644
--- a/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml.cs
+++ b/BBWY.Client/Views/PackTask/WaitCompletedControl.xaml.cs
@@ -1,5 +1,7 @@
-using System;
+using BBWY.Client.ViewModels;
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -21,6 +23,103 @@ namespace BBWY.Client.Views.PackTask
public WaitCompletedControl()
{
InitializeComponent();
+ this.Loaded += Load;
+ }
+ GlobalContext globalContext;
+
+ public void LoadShops(GlobalContext globalContext)
+ {
+ this.globalContext = globalContext;
+ shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
+
+ }
+
+ private void Load(object sender, RoutedEventArgs e)
+ {
+
+ try
+ {
+ var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
+
+ LoadShops(model.GlobalContext);
+ }
+ catch
+ {
+
+
+ }
+ }
+ public string QKApiHost { get; set; }
+
+
+ List shops = new List();
+
+
+ private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
+ {
+ tipBoxShop.Items.Clear();
+
+ }
+
+ if (shops.Count <= 0)
+ {
+ if (globalContext != null)
+ LoadShops(globalContext);
+ }
+
+ if (string.IsNullOrEmpty(textBoxt.Text))
+ {
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ return;
+ }
+ foreach (var department in shops)
+ {
+ if (department.Contains(textBoxt.Text))
+ {
+ ListBoxItem item = new ListBoxItem();
+ Label lb = new Label();
+ lb.Content = department;
+ item.Content = lb;
+ tipBoxShop.Items.Add(item);
+ }
+
+ }
+ if (tipBoxShop != null)
+ tipBoxShop.Visibility = Visibility.Visible;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
+
+ private void tipBoxShop_SelectionChanged(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;
+ tbShop.Text = content.Content.ToString();
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ }
+ catch (Exception)
+ {
+
+
+ }
}
}
}
diff --git a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml
index 21583003..763d50ed 100644
--- a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml
+++ b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml
@@ -27,213 +27,269 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
+
-
+
-
-
-
+
-
-
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
-
-
-
-
-
+
+
+
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
diff --git a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs
index 48a5a2de..90ce0a37 100644
--- a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs
+++ b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs
@@ -1,5 +1,11 @@
-using System;
+using BBWY.Client.Helpers;
+using BBWY.Client.Models.PackTask;
+using BBWY.Client.ViewModels;
+using BBWY.Common.Models;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -10,6 +16,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using WebSocketSharp;
namespace BBWY.Client.Views.PackTask
{
@@ -21,6 +28,192 @@ namespace BBWY.Client.Views.PackTask
public WaitPackageControl()
{
InitializeComponent();
+ this.Loaded += Load;
+ }
+ GlobalContext globalContext;
+
+ public void LoadShops(GlobalContext globalContext)
+ {
+ this.globalContext = globalContext;
+ shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
+ departments = globalContext.User.DepartmentList.Select(s => s.Name).ToList();
+
+ }
+
+ private void Load(object sender, RoutedEventArgs e)
+ {
+
+ try
+ {
+ var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
+
+ LoadShops(model.GlobalContext);
+ }
+ catch
+ {
+
+
+ }
+ }
+ public string QKApiHost { get; set; }
+ 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 departments = new List();
+
+ List shops = new List();
+ private void tb_TextChanged(object sender, TextChangedEventArgs e)
+ {
+
+ if (tipBox != null)
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBox != null && tipBox.Items.Count > 0)
+ {
+ tipBox.Items.Clear();
+
+ }
+
+ if (departments.Count <= 0)
+ {
+ if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
+ HttpClientHelper helper = new HttpClientHelper(QKApiHost);
+
+ string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
+ var data = helper.Get(url);
+
+ var res = JsonConvert.DeserializeObject>(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)
+ {
+
+
+ }
+
+ }
+
+ private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
+ {
+ tipBoxShop.Items.Clear();
+
+ }
+
+ if (shops.Count <= 0)
+ {
+ if (globalContext != null)
+ LoadShops(globalContext);
+ }
+
+ if (string.IsNullOrEmpty(textBoxt.Text))
+ {
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ return;
+ }
+ foreach (var department in shops)
+ {
+ if (department.Contains(textBoxt.Text))
+ {
+ ListBoxItem item = new ListBoxItem();
+ Label lb = new Label();
+ lb.Content = department;
+ item.Content = lb;
+ tipBoxShop.Items.Add(item);
+ }
+
+ }
+ if (tipBoxShop != null)
+ tipBoxShop.Visibility = Visibility.Visible;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
+
+ private void tipBoxShop_SelectionChanged(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;
+ tbShop.Text = content.Content.ToString();
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ }
+ catch (Exception)
+ {
+
+
+ }
}
}
}
diff --git a/BBWY.Client/Views/PackTask/WareHouseList.xaml b/BBWY.Client/Views/PackTask/WareHouseList.xaml
index 89eaa3eb..d8b70073 100644
--- a/BBWY.Client/Views/PackTask/WareHouseList.xaml
+++ b/BBWY.Client/Views/PackTask/WareHouseList.xaml
@@ -68,80 +68,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
@@ -200,10 +138,10 @@
-
-
-
+
+
+
@@ -217,7 +155,7 @@
diff --git a/BBWY.Client/Views/PackTask/WareHouseList.xaml.cs b/BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
index 748c52fb..bb6c86ea 100644
--- a/BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
+++ b/BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
@@ -34,238 +34,7 @@ namespace BBWY.Client.Views.PackTask
public WareHouseList()
{
InitializeComponent();
- this.Loaded += Load;
}
- //private void WareHouseList_Unloaded(object sender, RoutedEventArgs e)
- //{
- // Messenger.Default.Unregister("AcceptGlobalContext");
- //}
-
- GlobalContext globalContext;
-
- public void LoadShops(GlobalContext globalContext)
- {
- this.globalContext = globalContext;
- shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
- departments=globalContext.User.DepartmentList.Select(s=>s.Name).ToList();
-
- }
-
- private void Load(object sender, RoutedEventArgs e)
- {
-
- try
- {
- var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
-
- LoadShops(model.GlobalContext);
- }
- catch
- {
-
-
- }
-
- //try
- //{
- // 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;
-
- // if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
-
-
- // HttpClientHelper helper = new HttpClientHelper(QKApiHost);
-
- // string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
- // var data = helper.Get(url);
-
- // var res = JsonConvert.DeserializeObject>(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);
- // }
- // }
- // }
- // }
- //}
- //catch (Exception)
- //{
-
-
- //}
-
-
- }
- public string QKApiHost { get; set; }
- 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 departments = new List();
-
- List shops = new List();
- private void tb_TextChanged(object sender, TextChangedEventArgs e)
- {
-
- if (tipBox != null)
- try
- {
- var textBoxt = (TextBox)sender;
- //创建一个ListBox
-
- if (tipBox != null && tipBox.Items.Count > 0)
- {
- tipBox.Items.Clear();
-
- }
-
- if (departments.Count <= 0)
- {
- if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
- HttpClientHelper helper = new HttpClientHelper(QKApiHost);
-
- string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
- var data = helper.Get(url);
-
- var res = JsonConvert.DeserializeObject>(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)
- {
-
-
- }
-
- }
-
- private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
- {
- try
- {
- var textBoxt = (TextBox)sender;
- //创建一个ListBox
-
- if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
- {
- tipBoxShop.Items.Clear();
-
- }
-
- if (shops.Count <= 0)
- {
- if (globalContext != null)
- LoadShops(globalContext);
- }
-
- if (string.IsNullOrEmpty(textBoxt.Text))
- {
- tipBoxShop.Visibility = Visibility.Collapsed;
- return;
- }
- foreach (var department in shops)
- {
- if (department.Contains(textBoxt.Text))
- {
- ListBoxItem item = new ListBoxItem();
- Label lb = new Label();
- lb.Content = department;
- item.Content = lb;
- tipBoxShop.Items.Add(item);
- }
-
- }
- if (tipBoxShop != null)
- tipBoxShop.Visibility = Visibility.Visible;
- }
- catch (Exception)
- {
-
-
- }
- }
-
- private void tipBoxShop_SelectionChanged(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;
- tbShop.Text = content.Content.ToString();
- tipBoxShop.Visibility = Visibility.Collapsed;
- }
- catch (Exception)
- {
-
-
- }
- }
}
}
diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
index a43deca3..85f6b0ea 100644
--- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
+++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
@@ -24,195 +24,252 @@
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
+
-
-
-
+
+
+
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
-
+
-
+ >
+
-
-
-
+
+
-
-
-
+
+
+
-
+
-
+
+
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs
index c8055f2d..77ffcd33 100644
--- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs
+++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs
@@ -1,6 +1,12 @@
-using BBWY.Client.ViewModels.PackTask;
+using BBWY.Client.Helpers;
+using BBWY.Client.Models.PackTask;
+using BBWY.Client.ViewModels;
+using BBWY.Client.ViewModels.PackTask;
+using BBWY.Common.Models;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -11,6 +17,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using WebSocketSharp;
namespace BBWY.Client.Views.PackTask
{
@@ -23,8 +30,192 @@ namespace BBWY.Client.Views.PackTask
public WareHouseListControl()
{
InitializeComponent();
+ this.Loaded += Load;
}
+ GlobalContext globalContext;
+ public void LoadShops(GlobalContext globalContext)
+ {
+ this.globalContext = globalContext;
+ shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
+ departments = globalContext.User.DepartmentList.Select(s => s.Name).ToList();
+
+ }
+
+ private void Load(object sender, RoutedEventArgs e)
+ {
+
+ try
+ {
+ var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
+
+ LoadShops(model.GlobalContext);
+ }
+ catch
+ {
+
+
+ }
+ }
+ public string QKApiHost { get; set; }
+ 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 departments = new List();
+
+ List shops = new List();
+ private void tb_TextChanged(object sender, TextChangedEventArgs e)
+ {
+
+ if (tipBox != null)
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBox != null && tipBox.Items.Count > 0)
+ {
+ tipBox.Items.Clear();
+
+ }
+
+ if (departments.Count <= 0)
+ {
+ if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
+ HttpClientHelper helper = new HttpClientHelper(QKApiHost);
+
+ string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
+ var data = helper.Get(url);
+
+ var res = JsonConvert.DeserializeObject>(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)
+ {
+
+
+ }
+
+ }
+
+ private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
+ {
+ tipBoxShop.Items.Clear();
+
+ }
+
+ if (shops.Count <= 0)
+ {
+ if (globalContext != null)
+ LoadShops(globalContext);
+ }
+
+ if (string.IsNullOrEmpty(textBoxt.Text))
+ {
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ return;
+ }
+ foreach (var department in shops)
+ {
+ if (department.Contains(textBoxt.Text))
+ {
+ ListBoxItem item = new ListBoxItem();
+ Label lb = new Label();
+ lb.Content = department;
+ item.Content = lb;
+ tipBoxShop.Items.Add(item);
+ }
+
+ }
+ if (tipBoxShop != null)
+ tipBoxShop.Visibility = Visibility.Visible;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
+
+ private void tipBoxShop_SelectionChanged(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;
+ tbShop.Text = content.Content.ToString();
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
}
}
diff --git a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
index 17b04a4a..9f4a1814 100644
--- a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
+++ b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
@@ -24,206 +24,263 @@
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
+
+
+
-
-
-
-
-
+
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs
index 4d8c52de..bbcfbdd0 100644
--- a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs
+++ b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs
@@ -1,5 +1,11 @@
-using System;
+using BBWY.Client.Helpers;
+using BBWY.Client.Models.PackTask;
+using BBWY.Client.ViewModels;
+using BBWY.Common.Models;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -10,6 +16,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using WebSocketSharp;
namespace BBWY.Client.Views.QualityTask
{
@@ -21,6 +28,192 @@ namespace BBWY.Client.Views.QualityTask
public WaitQualityControl()
{
InitializeComponent();
+ this.Loaded += Load;
+ }
+ GlobalContext globalContext;
+
+ public void LoadShops(GlobalContext globalContext)
+ {
+ this.globalContext = globalContext;
+ shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
+ departments = globalContext.User.DepartmentList.Select(s => s.Name).ToList();
+
+ }
+
+ private void Load(object sender, RoutedEventArgs e)
+ {
+
+ try
+ {
+ var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
+
+ LoadShops(model.GlobalContext);
+ }
+ catch
+ {
+
+
+ }
+ }
+ public string QKApiHost { get; set; }
+ 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 departments = new List();
+
+ List shops = new List();
+ private void tb_TextChanged(object sender, TextChangedEventArgs e)
+ {
+
+ if (tipBox != null)
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBox != null && tipBox.Items.Count > 0)
+ {
+ tipBox.Items.Clear();
+
+ }
+
+ if (departments.Count <= 0)
+ {
+ if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
+ HttpClientHelper helper = new HttpClientHelper(QKApiHost);
+
+ string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
+ var data = helper.Get(url);
+
+ var res = JsonConvert.DeserializeObject>(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)
+ {
+
+
+ }
+
+ }
+
+ private void tbShop_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ try
+ {
+ var textBoxt = (TextBox)sender;
+ //创建一个ListBox
+
+ if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
+ {
+ tipBoxShop.Items.Clear();
+
+ }
+
+ if (shops.Count <= 0)
+ {
+ if (globalContext != null)
+ LoadShops(globalContext);
+ }
+
+ if (string.IsNullOrEmpty(textBoxt.Text))
+ {
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ return;
+ }
+ foreach (var department in shops)
+ {
+ if (department.Contains(textBoxt.Text))
+ {
+ ListBoxItem item = new ListBoxItem();
+ Label lb = new Label();
+ lb.Content = department;
+ item.Content = lb;
+ tipBoxShop.Items.Add(item);
+ }
+
+ }
+ if (tipBoxShop != null)
+ tipBoxShop.Visibility = Visibility.Visible;
+ }
+ catch (Exception)
+ {
+
+
+ }
+ }
+
+ private void tipBoxShop_SelectionChanged(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;
+ tbShop.Text = content.Content.ToString();
+ tipBoxShop.Visibility = Visibility.Collapsed;
+ }
+ catch (Exception)
+ {
+
+
+ }
}
}
}
diff --git a/BBWY.Client/Views/TaskOverTime/WareTaskOverTimeControl.xaml b/BBWY.Client/Views/TaskOverTime/WareTaskOverTimeControl.xaml
index 7a64bd4d..cceb7fe7 100644
--- a/BBWY.Client/Views/TaskOverTime/WareTaskOverTimeControl.xaml
+++ b/BBWY.Client/Views/TaskOverTime/WareTaskOverTimeControl.xaml
@@ -32,20 +32,29 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+