Browse Source

处理冲突

AddValidOverTime
shanji 2 years ago
parent
commit
f6f34d5143
  1. 27
      BBWY.Client/APIServices/DictionaryService.cs
  2. 4
      BBWY.Client/APIServices/LogisticsService.cs
  3. 64
      BBWY.Client/APIServices/PackTaskService.cs
  4. 201
      BBWY.Client/APIServices/SealBoxService.cs
  5. 7
      BBWY.Client/App.xaml.cs
  6. 1
      BBWY.Client/BBWY.Client.csproj
  7. 2
      BBWY.Client/BBWYAppSettings.json
  8. 306
      BBWY.Client/Helpers/MyPrintHelper.cs
  9. 101
      BBWY.Client/Helpers/UnitConverHelper.cs
  10. 39
      BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs
  11. 5
      BBWY.Client/Models/APIModel/Request/CerRequest.cs
  12. 13
      BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs
  13. 61
      BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs
  14. 34
      BBWY.Client/Models/APIModel/Response/Dictionary/GetDictionaryByKeyResponse.cs
  15. 13
      BBWY.Client/Models/APIModel/Response/FallWare/FallWareConfigureCountResponse.cs
  16. 13
      BBWY.Client/Models/APIModel/Response/FallWare/SearchFallWareConfiguredResponse.cs
  17. 10
      BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs
  18. 15
      BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs
  19. 2
      BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
  20. 156
      BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs
  21. 1
      BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs
  22. 90
      BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs
  23. 17
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs
  24. 18
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs
  25. 16
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs
  26. 12
      BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs
  27. 6
      BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
  28. 56
      BBWY.Client/Models/Enums.cs
  29. 44
      BBWY.Client/Models/FallWare/CloudWareBoxModel.cs
  30. 60
      BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs
  31. 36
      BBWY.Client/Models/FallWare/FallWareWaitConfigureModel.cs
  32. 53
      BBWY.Client/Models/FallWare/JDWareBoxModel.cs
  33. 1
      BBWY.Client/Models/MappingProfile.cs
  34. 1
      BBWY.Client/Models/Order/Order.cs
  35. 5
      BBWY.Client/Models/PackTask/CertificateModel.cs
  36. 171
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  37. 13
      BBWY.Client/Models/PackTask/SealBoxModel.cs
  38. 2
      BBWY.Client/Models/QualityTask/PurchaseSku.cs
  39. 78
      BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs
  40. 60
      BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs
  41. 39
      BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs
  42. 43
      BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs
  43. 4
      BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs
  44. 2
      BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs
  45. 2
      BBWY.Client/ViewModels/BaseVM.cs
  46. 1
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  47. 19
      BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs
  48. 32
      BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
  49. 17
      BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs
  50. 652
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  51. 462
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  52. 2
      BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs
  53. 6
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  54. 304
      BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs
  55. 26
      BBWY.Client/ViewModels/ViewModelLocator.cs
  56. 13
      BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs
  57. 250
      BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml
  58. 26
      BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml.cs
  59. 238
      BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml
  60. 26
      BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml.cs
  61. 105
      BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml
  62. 72
      BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs
  63. 113
      BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml
  64. 75
      BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs
  65. 307
      BBWY.Client/Views/FallWare/WaitFallWareControl.xaml
  66. 26
      BBWY.Client/Views/FallWare/WaitFallWareControl.xaml.cs
  67. 86
      BBWY.Client/Views/FallWare/WareFallWareListControl.xaml
  68. 26
      BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs
  69. 2
      BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs
  70. 2
      BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs
  71. 95
      BBWY.Client/Views/PackTask/PersonList.xaml
  72. 135
      BBWY.Client/Views/PackTask/PersonList.xaml.cs
  73. 12
      BBWY.Client/Views/PackTask/PublishTaskWindow.xaml.cs
  74. 35
      BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
  75. 1
      BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
  76. 283
      BBWY.Client/Views/PackTask/TaskList.xaml
  77. 252
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  78. 2
      BBWY.Client/Views/PackTask/TipsWindow.xaml
  79. 28
      BBWY.Client/Views/PackTask/TipsWindow.xaml.cs
  80. 33
      BBWY.Client/Views/PackTask/WareHouseList.xaml
  81. 2
      BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
  82. 9
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  83. 11
      BBWY.Client/Views/QualityTask/QualityWindow.xaml
  84. 12
      BBWY.Client/Views/QualityTask/QualityWindow.xaml.cs
  85. 202
      BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml
  86. 44
      BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs
  87. 240
      BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml
  88. 26
      BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml.cs
  89. 234
      BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml
  90. 26
      BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml.cs
  91. 54
      BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml
  92. 188
      BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs
  93. 104
      BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml
  94. 26
      BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml.cs
  95. 104
      BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml
  96. 26
      BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml.cs
  97. 98
      BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml
  98. 0
      BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml.cs
  99. 23
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  100. 21
      BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs

27
BBWY.Client/APIServices/DictionaryService.cs

@ -0,0 +1,27 @@
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.APIServices
{
public class DictionaryService : BaseApiService, IDenpendency
{
public DictionaryService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<GetDictionaryByKeyResponse> GetDictionaryByKey(string key)
{
return SendRequest<GetDictionaryByKeyResponse>(globalContext.QKApiHost, $"api/Dictionary/GetDictionaryByKey?key={key}",
null
, null, HttpMethod.Get);
}
}
}

4
BBWY.Client/APIServices/LogisticsService.cs

@ -21,6 +21,10 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
/// <summary>
/// 获取仓库列表
/// </summary>
/// <returns></returns>
public ApiResponse<IList<StoreResponse>> GetStoreList()
{
return SendRequest<IList<StoreResponse>>(globalContext.BBYWApiHost, "api/vender/GetStoreHouseList", new

64
BBWY.Client/APIServices/PackTaskService.cs

@ -26,37 +26,33 @@ namespace BBWY.Client.APIServices
public ApiResponse<PackTaskResultResponse> GetOrderList(string skuId = null, string taskId = null,
public ApiResponse<SearchTaskListResponse> GetTaskList(string skuId = null, string taskId = null,
DateTime? startTime = null,
DateTime? endTime = null,
TaskState? availability = null,
int? taskStatus = null,
TaskState? TaskState = null,
int pageIndex = 1,
int pageSize = 10
)
{
if (taskId!=null&&!string.IsNullOrEmpty(taskId.Trim()))
if (taskId != null && !string.IsNullOrEmpty(taskId.Trim()))
{
return SendRequest<PackTaskResultResponse>(globalContext.QKApiHost, "api/PackTask/SearchNewPackTaskList", new
return SendRequest<SearchTaskListResponse>(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new
{
TaskId = taskId,
ShopId = globalContext.User.Shop.ShopId.ToString()
}, null, HttpMethod.Post);
}
return SendRequest<PackTaskResultResponse>(globalContext.QKApiHost, "api/PackTask/SearchNewPackTaskList", new
return SendRequest<SearchTaskListResponse>(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new
{
SkuId = skuId,
TaskId = taskId,
StartTime = startTime,
EndTime = endTime,
Availability = availability,
TaskStatus = taskStatus,
TaskState = TaskState,
PageIndex = pageIndex,
PageSize = pageSize,
ShopId = globalContext.User.Shop.ShopId.ToString()
@ -65,7 +61,7 @@ namespace BBWY.Client.APIServices
public ApiResponse<SearchTaskListResponse> GetWareHouseList(string WayBillNo=null,string SourceExpressName=null, int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null,
DateTime? startTime = null,
DateTime? endTime = null,
PackTaskState? TaskState = null,
TaskState? TaskState = null,
string ShopName = null,
int pageIndex = 1,
int pageSize = 10
@ -98,16 +94,9 @@ namespace BBWY.Client.APIServices
public ApiResponse<ProductSkuCountsResponse> GetAllCount()
public ApiResponse<ProductSkuCountsResponse> GetTaskAllCount(string shopId=null)
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={globalContext.User.Shop.ShopId.ToString()}",
null
, null, HttpMethod.Get);
}
public ApiResponse<ProductSkuCountsResponse> GetWareAllCount()
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount",
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={shopId}",
null
, null, HttpMethod.Get);
}
@ -178,12 +167,12 @@ namespace BBWY.Client.APIServices
/// <param name="taskId"></param>
/// <param name="packTaskState"></param>
/// <returns></returns>
public ApiResponse<object> SetPackTaskState(long taskId, PackTaskState packTaskState)
public ApiResponse<object> SetPackTaskState(long taskId, TaskState taskState)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/SetPackTaskState", new
{
taskId = taskId,
TaskState= packTaskState
TaskState= taskState
}
, null, HttpMethod.Post);
}
@ -329,16 +318,32 @@ namespace BBWY.Client.APIServices
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<bool> CompeteSealBox( List<CompeteSealBox> CompeteSealBoxs)
public ApiResponse<bool> CompeteSealBox( CompeteSealBox CompeteSealBoxs)
{
return SendRequest<bool>(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", new
return SendRequest<bool>(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", CompeteSealBoxs, null, HttpMethod.Post);
}
/// <summary>
/// 获取待落仓列表
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<SearchWaitFallWareResponse> SearchWaitFallWareList(string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchWaitFallWareResponse>(globalContext.QKApiHost, "api/PackTask/SearchWaitFallWareList", new
{
CompeteSealBoxs
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize
}, null, HttpMethod.Post);
}
}
public class CompeteSealBox
@ -346,11 +351,14 @@ namespace BBWY.Client.APIServices
/// <summary>
/// 任务Id
/// </summary>
public long TaskId { get; set; }
public long[] TaskId { get; set; }
/// <summary>
/// 仓库Id
/// </summary>
public string WareId { get; set; }
public int BoxCount { get; set; }
}

201
BBWY.Client/APIServices/SealBoxService.cs

@ -0,0 +1,201 @@
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.APIServices
{
public class SealBoxService : BaseApiService, IDenpendency
{
public SealBoxService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<SealBoxWaitConfigureResponse> GetSealBoxWaitConfigureList(string SkuId, string TaskId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null)
{
return SendRequest<SealBoxWaitConfigureResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxWaitConfigureList",
new
{
ShopId = globalContext.User.Shop.ShopId.ToString(),
TaskId = TaskId,
SkuId = SkuId,
SpuId,
PageSize,
PageIndex,
}
, null, HttpMethod.Post);
}
public ApiResponse<SealBoxPackStateCountResponse> GetSealBoxPackStateCount()
{
return SendRequest<SealBoxPackStateCountResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxPackStateCount",
new
{
ShopId = globalContext.User.Shop.ShopId.ToString(),
}
, null, HttpMethod.Post);
}
public ApiResponse<bool> SetSealBoxConfigured(SetSealBoxConfiguredRequest setSealBoxConfiguredRequest)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/SetSealBoxConfigured",
setSealBoxConfiguredRequest
, null, HttpMethod.Post);
}
public ApiResponse<SealBoxConfiguredResponse> GetSealBoxConfiguredList(PositionState PositionState, string SkuId, string TaskId, string shopId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null)
{
return SendRequest<SealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxConfiguredList",
new
{
PositionState,
ShopId = shopId,
TaskId = TaskId,
SkuId = SkuId,
SpuId,
PageSize,
PageIndex,
}
, null, HttpMethod.Post);
}
public ApiResponse<UpdateSealBoxConfiguredResponse> GetUpdateSealBoxConfigured(long SealBoxId, long[] TaskIds)
{
return SendRequest<UpdateSealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfigured",
new
{
SealBoxId,
TaskIds
}
, null, HttpMethod.Post);
}
public ApiResponse<bool> BatchUpdateSealBoxConfigured(BatchUpdateSealBoxConfiguredRequest batchUpdateSealBoxConfiguredRequest)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/BatchUpdateSealBoxConfigured",
batchUpdateSealBoxConfiguredRequest
, null, HttpMethod.Post);
}
public ApiResponse<GetWareSealBoxResponse> GetWareSealBoxList(string ShopName, long? TaskId, string SkuId, int? PageIndex, int? PageSize)
{
return SendRequest<GetWareSealBoxResponse>(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxList",
new
{
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize
}
, null, HttpMethod.Post);
}
public ApiResponse<bool> WareCompeteSealBox(long SealBoxId, int? BoxCount)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/WareCompeteSealBox",
new
{
SealBoxId,
BoxCount
}
, null, HttpMethod.Post);
}
/// <summary>
/// 仓库端获取待落仓列表
/// </summary>
/// <param name="ShopName"></param>
/// <param name="TaskId"></param>
/// <param name="SkuId"></param>
/// <param name="PageIndex"></param>
/// <param name="PageSize"></param>
/// <returns></returns>
public ApiResponse<SearchWaitFallWareResponse> SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchWaitFallWareResponse>(globalContext.QKApiHost, $"api/SealBox/SearchWareFallWareConfigureList",
new
{
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize,
positionState
}
, null, HttpMethod.Post);
}
/// <summary>
/// 商家端 获取待落仓列表
/// </summary>
/// <param name="ShopName"></param>
/// <param name="TaskId"></param>
/// <param name="SkuId"></param>
/// <param name="PageIndex"></param>
/// <param name="PageSize"></param>
/// <returns></returns>
public ApiResponse<SearchFallWareConfiguredResponse> SearchFallWareConfiguredList(PositionState positionState, long? TaskId = null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchFallWareConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/SearchFallWareConfiguredList",
new
{
shopId = globalContext.User.Shop.ShopId.ToString(),
positionState,
TaskId,
SkuId,
PageIndex,
PageSize
}
, null, HttpMethod.Post);
}
public ApiResponse<bool> SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure",
new
{
SealBoxId,
ProductTitle,
PurchaseOrder,
PrewOrder,
WaybillNo
}
, null, HttpMethod.Post);
}
public ApiResponse<FallWareConfigureCountResponse> GetFallWareConfigureCounts(string shopId)
{
return SendRequest<FallWareConfigureCountResponse>(globalContext.QKApiHost, $"api/SealBox/GetFallWareConfigureCounts?shopId={shopId}",
null
, null, HttpMethod.Post);
}
public ApiResponse<bool> WareCompeteFallWare(long SealBoxId)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/WareCompeteFallWare?SealBoxId={SealBoxId}",
null
, null, HttpMethod.Post);
}
}
}

7
BBWY.Client/App.xaml.cs

@ -1,6 +1,7 @@
using BBWY.Client.Models;
using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Client.ViewModels.SealBox;
using BBWY.Common.Extensions;
using BBWY.Common.Http;
using BBWY.Common.Models;
@ -122,8 +123,10 @@ namespace BBWY.Client
serviceCollection.AddTransient<BatchPurchaseCreateNewOrderViewModel>();
serviceCollection.AddTransient<BatchPurchaseAddProductSkuViewModel>();
serviceCollection.AddTransient<PackSkuSplitConfigViewModel>();
//serviceCollection.AddScoped<PackServiceViewModel>();
serviceCollection.AddTransient<SealBoxConfigureViewModel>();
serviceCollection.AddTransient<PublishTaskViewModel>();
serviceCollection.AddTransient<QualityViewModel>();
serviceCollection.AddScoped<PackServiceViewModel>();
#region 注册拳探SDK相关类
serviceCollection.AddSingleton<QuanTanProductClient>();

1
BBWY.Client/BBWY.Client.csproj

@ -35,6 +35,7 @@
<ItemGroup>
<PackageReference Include="BarcodeLib" Version="2.4.0" />
<PackageReference Include="FreeSpire.XLS" Version="12.7.0" />
<PackageReference Include="HandyControl" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.28" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />

2
BBWY.Client/BBWYAppSettings.json

@ -5,5 +5,5 @@
"JOSApiHost": "",
"1688ApiHost": "",
"QKApiHost": "http://localhost:8080"
// "QKApiHost": "http://qiku.qiyue666.com"
//"QKApiHost": "http://qiku.qiyue666.com"
}

306
BBWY.Client/Helpers/MyPrintHelper.cs

@ -1,6 +1,10 @@
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;
using System;
using System.Collections.Generic;
using System.Drawing;
@ -195,100 +199,100 @@ namespace BBWY.Client.Helpers
private static void SetCerStander(ref PrintPageEventArgs args, CertificateModel certificate, Font font)
{
//#if DEBUG
// Bitmap bitmap = new Bitmap(236, 157);
// // Bitmap bitmap = new Bitmap(500, 500);
// Graphics graphics = Graphics.FromImage(bitmap);
// var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域
// graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置
// graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域
// int bigJiange = 20;//合格证与品牌的高度差
// var heightSpace = 4;//所有行间隔高度
// if (!string.IsNullOrEmpty(certificate.ProduceDate))
// {
// bigJiange = 10; heightSpace = 3;
// }
// int standerSpace = 1;//执行标准之间的
// if (certificate.IsLogo == 1)//含图标
// {
// string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
// string path = appPath + $"/Resources/Images/3c.png";
// Image image = Image.FromFile(path);
// graphics.DrawImage(image, 190, 7, 28, 21);
// graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28);
// }
// var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular);
// string cerName = "合格证";
// SizeF bigSize = graphics.MeasureString(cerName, fontBig);
// float verHeight = bigJiange + bigSize.Height;
// graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10));
// graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// if (!string.IsNullOrEmpty(certificate.ProductNo))
// graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
// var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度
// verHeight += (smallSize.Height + heightSpace);
// graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
// StringBuilder sb = new StringBuilder();
// var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries);
// int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数
// for (int i = 0; i < excutes.Count(); i++)
// {
// if (i % 2 == 0 && i > 0)//间隔两个换行
// {
// sb.Append("\n");
// }
// sb.Append(excutes[i]).Append(" ");
// }
// sb.Remove(sb.Length - 3, 3);
// var rows = sb.ToString().Split('\n');
// string excuteStander = "执行标准: ";
// smallSize = graphics.MeasureString(excuteStander, font);
// verHeight += (smallSize.Height + heightSpace);
// graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// for (int i = 1; i < rows.Count(); i++)
// {
// verHeight += (smallSize.Height + standerSpace);
// graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight));
// }
// if (!string.IsNullOrEmpty(certificate.ProduceDate))
// {
// verHeight += (smallSize.Height + heightSpace) - 3;
// graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// }
// verHeight += (smallSize.Height + heightSpace);
// RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace);
// var productStr = $"生产商: {certificate.ProductShop}";
// if (graphics.MeasureString(productStr, font).Width <= 220)
// {
// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight);
// verHeight += smallSize.Height + heightSpace;
// }
// else
// {
// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect);
// verHeight += 2 * smallSize.Height + heightSpace;
// }
// var productShop = graphics.MeasureString("生产商", font);
// var adress = graphics.MeasureString("地 址", font);
// var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace);
// graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1);
// var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
// bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png);
//#if DEBUG
// Bitmap bitmap = new Bitmap(236, 157);
// // Bitmap bitmap = new Bitmap(500, 500);
// Graphics graphics = Graphics.FromImage(bitmap);
// var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域
// graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置
// graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域
// int bigJiange = 20;//合格证与品牌的高度差
// var heightSpace = 4;//所有行间隔高度
// if (!string.IsNullOrEmpty(certificate.ProduceDate))
// {
// bigJiange = 10; heightSpace = 3;
// }
// int standerSpace = 1;//执行标准之间的
// if (certificate.IsLogo == 1)//含图标
// {
// string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
// string path = appPath + $"/Resources/Images/3c.png";
// Image image = Image.FromFile(path);
// graphics.DrawImage(image, 190, 7, 28, 21);
// graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28);
// }
// var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular);
// string cerName = "合格证";
// SizeF bigSize = graphics.MeasureString(cerName, fontBig);
// float verHeight = bigJiange + bigSize.Height;
// graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10));
// graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// if (!string.IsNullOrEmpty(certificate.ProductNo))
// graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
// var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度
// verHeight += (smallSize.Height + heightSpace);
// graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
// StringBuilder sb = new StringBuilder();
// var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries);
// int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数
// for (int i = 0; i < excutes.Count(); i++)
// {
// if (i % 2 == 0 && i > 0)//间隔两个换行
// {
// sb.Append("\n");
// }
// sb.Append(excutes[i]).Append(" ");
// }
// sb.Remove(sb.Length - 3, 3);
// var rows = sb.ToString().Split('\n');
// string excuteStander = "执行标准: ";
// smallSize = graphics.MeasureString(excuteStander, font);
// verHeight += (smallSize.Height + heightSpace);
// graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// for (int i = 1; i < rows.Count(); i++)
// {
// verHeight += (smallSize.Height + standerSpace);
// graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight));
// }
// if (!string.IsNullOrEmpty(certificate.ProduceDate))
// {
// verHeight += (smallSize.Height + heightSpace) - 3;
// graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
// }
// verHeight += (smallSize.Height + heightSpace);
// RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace);
// var productStr = $"生产商: {certificate.ProductShop}";
// if (graphics.MeasureString(productStr, font).Width <= 220)
// {
// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight);
// verHeight += smallSize.Height + heightSpace;
// }
// else
// {
// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect);
// verHeight += 2 * smallSize.Height + heightSpace;
// }
// var productShop = graphics.MeasureString("生产商", font);
// var adress = graphics.MeasureString("地 址", font);
// var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace);
// graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1);
// var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
// bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png);
int bigJiange = 20;//合格证与品牌的高度差
@ -319,8 +323,8 @@ namespace BBWY.Client.Helpers
args.Graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10));
args.Graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
if(!string.IsNullOrEmpty(certificate.ProductNo))
args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
if (!string.IsNullOrEmpty(certificate.ProductNo))
args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight));
var smallSize = args.Graphics.MeasureString(certificate.Brand, font);//小字体高度
verHeight += (smallSize.Height + heightSpace);
@ -375,7 +379,7 @@ namespace BBWY.Client.Helpers
var productShop = args.Graphics.MeasureString("生产商", font);
var adress = args.Graphics.MeasureString("地 址", font);
var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight- 2, 220, smallSize.Height * 3 + heightSpace);
var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace);
args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1);
@ -489,7 +493,7 @@ namespace BBWY.Client.Helpers
int bigJiange = 20;//合格证与品牌的高度差
var heightSpace = 4;//所有行间隔高度
int standerSpace = 1;//执行标准之间的
if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10;
if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10;
var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular);
string cerName = "合格证";
SizeF bigSize = args.Graphics.MeasureString(cerName, fontBig);
@ -548,7 +552,7 @@ namespace BBWY.Client.Helpers
}
if (!string.IsNullOrEmpty(certificate.ProduceDate))
{
verHeight += (smallSize.Height + heightSpace)-3;
verHeight += (smallSize.Height + heightSpace) - 3;
args.Graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight));
}
verHeight += (smallSize.Height + heightSpace);
@ -568,7 +572,7 @@ namespace BBWY.Client.Helpers
var productShop = args.Graphics.MeasureString("生产商", font);
var adress = args.Graphics.MeasureString("地 址", font);
var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight-2, 220, smallSize.Height * 3 + heightSpace);
var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace);
args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1);
@ -593,7 +597,7 @@ namespace BBWY.Client.Helpers
public static BitmapImage GetBarcodeImage(string printStr,int width,int height)
public static BitmapImage GetBarcodeImage(string printStr, int width, int height)
{
Bitmap image = new Bitmap(width, height);
Graphics graphics2 = Graphics.FromImage(image);
@ -603,7 +607,7 @@ namespace BBWY.Client.Helpers
return bitmapToBitmapImage(image);
}
static BitmapImage bitmapToBitmapImage(Bitmap bitmap)
static BitmapImage bitmapToBitmapImage(Bitmap bitmap)
{
using (var stream = new MemoryStream())
{
@ -620,6 +624,104 @@ 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
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))
{
File.Delete(printNamePath);
}
File.WriteAllText(printNamePath, printName);
var excel = $"{applicationPath}/Resources/ExccelModel/sealbox.xlsx";
var newExccel = $"{applicationPath}/Resources/ExccelModel/newsealbox.xlsx";
if (File.Exists(newExccel))
{
File.Delete(newExccel);
}
FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read);
XSSFWorkbook wb = new XSSFWorkbook(fs);
var sheet = wb.GetSheetAt(0); // 得到第一个sheet
var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行
var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行
XSSFWorkbook wb2 = new XSSFWorkbook();
sheet.CopyTo(wb2, "Sheet1", true, false);
var sheet2 = wb2.GetSheet("Sheet1");
var nameCell2 = sheet2.GetRow(0).GetCell(1);
nameCell2.SetCellValue(sealBoxModel.ShopName);
sheet2.GetRow(3).GetCell(1).SetCellValue(sealBoxModel.WareName);
StringBuilder sb = new StringBuilder();
int totalCount = 0;
for (int i = 0; i < sealBoxModel.SealBoxSkus.Count; i++)
{
var title = sealBoxModel.SealBoxSkus[i].SkuTitle;
//if (title.Length>5)
//{
// title = title.Substring(0,5);
//}
totalCount += sealBoxModel.SealBoxSkus[i].WareHourseSkuCount;
sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}");
sheet2.GetRow(i + 6).GetCell(2).SetCellValue($"SKU:{sealBoxModel.SealBoxSkus[i].SkuId}");
sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].WareHourseSkuCount}");
}
sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount);
sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount);
FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite);
wb2.Write(fs1);
fs1.Close();
fs1.Dispose();
Workbook workbook = new Workbook();
workbook.LoadFromFile(newExccel);
Worksheet wsheet = workbook.Worksheets[0];
wsheet.PageSetup.PaperSize = PaperSizeType.PaperA4;
wsheet.PageSetup.Orientation = PageOrientationType.Portrait;
wsheet.PageSetup.PrintArea = "A1:D31";
var print = workbook.PrintDocument;
print.PrinterSettings.PrinterName = printName;
print.PrinterSettings.Copies = (short)printCount;//打印份数
print.Print();
}
/// <summary>
/// 打印京东箱唛
/// </summary>
public static void PrintJDBoxWareData(JDWareBoxModel jDWareBoxModel,string printName)
{
}
public static void SetDefaultPrint(string printName)
{
SetDefaultPrinter(printName);

101
BBWY.Client/Helpers/UnitConverHelper.cs

@ -0,0 +1,101 @@
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
namespace BBWY.Client.Helpers
{
public class UnitConverHelper
{
int dpiX = 0;
int dpiY = 0;
public UnitConverHelper()
{
GetDpi();
}
private void GetDpi()
{
var hDc = GetDC(IntPtr.Zero);
dpiX = GetDeviceCaps(hDc, LOGPIXELSX);
dpiY = GetDeviceCaps(hDc, LOGPIXELSY);
ReleaseDC(IntPtr.Zero, hDc);
}
/// <summary>
/// 毫米转像素(获取打印的宽和高)
/// </summary>
/// <param name="mm"></param>
/// <returns></returns>
public PrintPx MmToPx(double mWidth, double mHeight)
{
if(dpiX<=0||dpiY<=0) GetDpi();
return new PrintPx
{
Width = mWidth * dpiX / 25.4,
Height = mHeight * dpiY / 25.4,
};
}
/// <summary>
/// 像素转毫米
/// </summary>
/// <param name="pxWidth"></param>
/// <param name="pxHeight"></param>
/// <returns></returns>
public PrintPx PxToMm(double pxWidth, double pxHeight)
{
if (dpiX <= 0 || dpiY <= 0) GetDpi();
return new PrintPx
{
Width = pxWidth * 25.4 / dpiX,
Height = pxHeight * 25.4 / dpiY,
};
}
private const int LOGPIXELSX = 88;
private const int LOGPIXELSY = 90;
[DllImport("gdi32.dll")]
private static extern int GetDeviceCaps(IntPtr hdc, int index);
[DllImport("user32.dll")]
private static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDc);
}
public class PrintPx
{
public double Width { get; set; }
public double Height { get; set; }
}
}

39
BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class BatchUpdateSealBoxConfiguredRequest
{
/// <summary>
/// 判断当前的封箱任务是否 是带封箱状态
/// </summary>
public long SealBoxId { get; set; }
public string ShopId { get; set; }
public IList<UpdateSealBoxConfiguredDataRequest> UpdateSealBoxConfiguredDatas { get; set; }
}
public class UpdateSealBoxConfiguredDataRequest
{
public long TaskId { get; set; }
/// <summary>
/// sku总量任务量
/// </summary>
public int SkuCount { get; set; }
public IList<SealBoxConfiguredWareHourseRequest> SealBoxConfiguredWareHourseRequests { get; set; }
}
public class SealBoxConfiguredWareHourseRequest : WareHourseData
{
/// <summary>
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
/// </summary>
public PositionState? WareState { get; set; }
}
}

5
BBWY.Client/Models/APIModel/Request/CerRequest.cs

@ -68,8 +68,11 @@ namespace BBWY.Client.Models.APIModel.Request
/// </summary>
public string ApplyAge { get; set; }
public long GoodsNumber { get; set; }
public long? GoodsNumber { get; set; }
/// <summary>
///
/// </summary>
public string ProduceDate { get; set; }

13
BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs

@ -62,10 +62,7 @@ namespace BBWY.Client.Models.APIModel.Request
/// 增量耗材
/// </summary>
public string Increment1 { get; set; }
/// <summary>
/// 增量耗材
/// </summary>
public int Increment2 { get; set; }
//条形码 合格证数据
@ -92,11 +89,6 @@ namespace BBWY.Client.Models.APIModel.Request
/// </summary>
public long? BarCodeId { get; set; }
/// <summary>
/// 合格证Id
/// </summary>
public long? CertificateId { get; set; }
/// <summary>
/// 合格证Id
/// </summary>
@ -106,8 +98,9 @@ namespace BBWY.Client.Models.APIModel.Request
/// </summary>
public int? CertificatePosition { get; set; }
public Worry IsWorry { get; set; }
//public Worry IsWorry { get; set; }
public string OrderId { get; set; }
public Platform Platform { get; set; }
public bool NeedBar { get;set; }

61
BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SetSealBoxConfiguredRequest
{
/// <summary>
/// 店铺id
/// </summary>
public string ShopId { get; set; }
public IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas { get; set; }
}
public class SetSealBoxConfiguredData
{
/// <summary>
/// 任务Id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// sku
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// sku总量任务量(校对)
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 仓库去向
/// </summary>
public IList<WareHourseData> WareHourseDatas { get; set; }
}
public class WareHourseData
{
/// <summary>
/// 仓库id
/// </summary>
public string WareId { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Count { get; set; }
/// <summary>
/// 入仓类型 (京仓=0 云仓=1,商家仓=2,聚水潭=3)
/// </summary>
public WareType WareType { get; set; }
}
}

34
BBWY.Client/Models/APIModel/Response/Dictionary/GetDictionaryByKeyResponse.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class GetDictionaryByKeyResponse
{
/// <summary>
/// 字典类型
/// </summary>
public string Key { get; set; }
/// <summary>
/// 字典类型名称
/// </summary>
public string KeyName { get; set; }
/// <summary>
/// 字典值列表
/// </summary>
public IList<DicValue> DicValueList { get; set; }
}
public class DicValue
{
/// <summary>
/// 字典值
/// </summary>
public string Value { get; set; }
/// <summary>
/// 字典值标签
/// </summary>
public string ValueName { get; set; }
}
}

13
BBWY.Client/Models/APIModel/Response/FallWare/FallWareConfigureCountResponse.cs

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class FallWareConfigureCountResponse
{
public int FallWareWaitConfigureCount { get; set; }
public int FallWareConfiguredCount { get; set; }
}
}

13
BBWY.Client/Models/APIModel/Response/FallWare/SearchFallWareConfiguredResponse.cs

@ -0,0 +1,13 @@
using BBWY.Client.Models.FallWare;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SearchFallWareConfiguredResponse
{
public IList<FallWareConfiguredModel> FallWareConfiguredModels { get; set; }
public int TotalCount { get; set; }
}
}

10
BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs

@ -36,5 +36,15 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// 待出库数
/// </summary>
public int? WaitOutbound { get; set; }
/// <summary>
/// 待落仓
/// </summary>
public int? WaitFallWareCount { get; set; }
/// <summary>
/// 待完结
/// </summary>
public string WaitCompleted { get; set; }
}
}

15
BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs

@ -92,16 +92,6 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// </summary>
public string Increment1 { get; set; }
/// <summary>
/// 条形码id
/// </summary>
public long? BarcodeId { get; set; }
/// <summary>
/// 合格证
/// </summary>
public string CertificateId { get; set; }
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
@ -122,10 +112,7 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// 注意事项(对接备注)
/// </summary>
public string MarkMessage { get; set; }
/// <summary>
/// 到货情况(待收货=2,部分收货=1,已到货=0)
/// </summary>
public int Availability { get; set; }
public bool NeedBar { get; set; }

2
BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs

@ -40,7 +40,7 @@ namespace BBWY.Client.Models.APIModel
/// <summary>
/// 任务状态
/// </summary>
public PackTaskState TaskState { get; set; }
public TaskState TaskState { get; set; }
/// <summary>
/// 需求方团队

156
BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs

@ -0,0 +1,156 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SearchWaitFallWareResponse
{
/// <summary>
/// 数量
/// </summary>
public int TotalCount { get; set; }
public IList<WaitFallWareModelResponse> WaitFallWareList { get; set; }
}
public class WaitFallWareModelResponse
{ /// <summary>
/// 仓库类型
/// </summary>
public WareType WareType { get; set; }
/// <summary>
/// 店铺Id
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 仓库Id(同一个店铺 唯一)
/// </summary>
public string WareId { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 仓库名
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 团队名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 对接人(同团队下)
/// </summary>
public List<string> AcceptUserNames { get; set; }
/// <summary>
/// 封箱sku列表
/// </summary>
public List<SealBoxSku> SealBoxSkus { get; set; }
/// <summary>
/// 封箱的箱子数量
/// </summary>
public int SealBoxCount { get; set; }
/// <summary>
/// 封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 落仓材料
/// </summary>
public BoxConfigureData BoxConfigureData { get; set; }
/// <summary>
/// 商品数量(封箱sku任务数总和)
/// </summary>
public int ProductCount { get; set; }
}
public class WaitFallWareModel
{
/// <summary>
/// 仓库类型
/// </summary>
public WareType WareType { get; set; }
/// <summary>
/// 店铺Id
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 仓库Id(同一个店铺 唯一)
/// </summary>
public string WareId { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 仓库名
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 团队名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 对接人(同团队下)
/// </summary>
public string AcceptUserNames { get; set; }
/// <summary>
/// 封箱sku列表
/// </summary>
public List<SealBoxSku> SealBoxSkus { get; set; }
/// <summary>
/// 封箱的箱子数量
/// </summary>
public int SealBoxCount { get; set; }
/// <summary>
/// 封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 落仓材料
/// </summary>
public BoxConfigureData BoxConfigureData { get; set; }
/// <summary>
/// 商品数量(封箱sku任务数总和)
/// </summary>
public int ProductCount { get; set; }
}
public class BoxConfigureData
{
/// <summary>
/// 采购单号
/// </summary>
public string PurchaseOrder { get; set; }
/// <summary>
/// 预约单号
/// </summary>
public string PrewOrder { get; set; }
/// <summary>
/// 运单号
/// </summary>
public string WaybillNo { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string ProductTitle { get; set; }
}
}

1
BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs

@ -96,5 +96,6 @@ namespace BBWY.Client.Models.APIModel
/// 打包sku产品数量
/// </summary>
public int SkuCount { get; set; }
}
}

90
BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class GetWareSealBoxResponse
{
/// <summary>
/// 数量
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 分箱列表
/// </summary>
public List<WareSealBoxData> WaitSealBoxModels { get; set; }
}
public class WareSealBoxData
{
public long SealBoxId { get; set; }
/// <summary>
/// 店铺Id
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 仓库Id(同一个店铺 唯一)
/// </summary>
public string WareId { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 仓库名
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 团队名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 对接人(同团队下)
/// </summary>
public List<string> AcceptUserNames { get; set; }
/// <summary>
/// 封箱sku列表
/// </summary>
public List<WareSealBoxSku> SealBoxSkus { get; set; }
}
public class WareSealBoxSku
{
public TaskState TaskState { get; set; }
/// <summary>
/// 任务Id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 图片链接
/// </summary>
public string Logo { get; set; }
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// sku标题
/// </summary>
public string SkuTitle { get; set; }
/// <summary>
/// 品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// 货号
/// </summary>
public string ProductNo { get; set; }
/// <summary>
/// (分箱的仓库的sku产品数量)
/// </summary>
public int WareHourseSkuCount { get; set; }
}
}

17
BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs

@ -0,0 +1,17 @@
using BBWY.Client.Models.SealBox;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SealBoxConfiguredResponse
{
public int TotalCount { get; set; }
public IList<SealBoxConfiguredModel> SealBoxConfiguredModels { get; set; }
}
}

18
BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SealBoxPackStateCountResponse
{
/// <summary>
/// 封箱 待配置数
/// </summary>
public int SealBoxWaitConfigureCount { get; set; }
/// <summary>
///封箱 已配置数
/// </summary>
public int SealBoxConfiguredCount { get; set; }
}
}

16
BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SealBoxWaitConfigureResponse
{
public int TotalCount { get; set; }
public IList<SealBoxWaitConfigureModel> SealBoxWaitConfigureModels { get; set; }
}
}

12
BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs

@ -0,0 +1,12 @@
using BBWY.Client.Models.SealBox;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class UpdateSealBoxConfiguredResponse
{
public IList<SealBoxConfigureModel> UpdateSealBoxConfiguredTaskDatas { get; set; }
}
}

6
BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs

@ -120,11 +120,11 @@ namespace BBWY.Client.Models
/// </summary>
public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } }
private TaskState availability;
private Availability availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
public Availability Availability { get => availability; set { Set(ref availability, value); } }
private PackType packType;
/// <summary>
@ -470,7 +470,7 @@ namespace BBWY.Client.Models
GoodsNumber = config.GoodsNumber;
PackType = (PackType)config.PackType;
BasicPack = (BasicPack)config.BasicPack;
Availability = (TaskState)config.Availability;
// Availability = (Availability)config.Availability;
MarkMessage = config.MarkMessage;
CertificatePosition = config.CertificatePosition == null ? CertificatePosition. : (CertificatePosition)config.CertificatePosition.Value;
// Increment1 = config.Increment1;

56
BBWY.Client/Models/Enums.cs

@ -209,22 +209,29 @@
}
///// <summary>
///// 快递到货情况
///// </summary>
public enum TaskState
{
= 0,
= 1,
= 2,
= 3,
= 4,
= 5
}
public enum Availability
{
= 0,
= 1,
= 2,
}
/////// <summary>
/////// 快递到货情况
/////// </summary>
//public enum TaskState
//{
// 已到货 = 0,
// 部分到货 = 1,
// 未到货 = 2,
// 已完成 = 3,
// 全部 = 4,
// 加急 = 5
//}
/// <summary>
/// 仓库打包任务状态
/// </summary>
public enum PackTaskState
public enum TaskState
{
= 0,
= 1,
@ -233,7 +240,9 @@
= 4,
= 5,
= 6,
= 7
= 7,
= 8,
= 9
}
@ -483,7 +492,7 @@
}
/// <summary>
/// 打包配置存放区分
/// 存放区分(任务区分)
/// </summary>
public enum SaveType
{
@ -496,4 +505,21 @@
/// </summary>
B端 = 1
}
/// <summary>
/// 落仓状态
/// </summary>
public enum PositionState
{
=0, =1,=2, =3
}
/// <summary>
/// 封箱配置状态
/// </summary>
public enum SealBoxConfigureType
{
=0,
=1
}
}

44
BBWY.Client/Models/FallWare/CloudWareBoxModel.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.FallWare
{
public class CloudWareBoxModel
{
/// <summary>
/// 箱子id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// CLPS采购单号
/// </summary>
public string CLPSPurchaseOrder { get; set; }
/// <summary>
/// 预约单号
/// </summary>
public string PrewOrder { get; set; }
/// <summary>
/// 目的城市-仓库
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 箱子数
/// </summary>
public int BoxCount { get; set; }
/// <summary>
/// 商品数量
/// </summary>
public int ProductCount { get; set; }
}
}

60
BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs

@ -0,0 +1,60 @@
using BBWY.Client.Models.SealBox;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.FallWare
{
public class FallWareConfiguredModel
{ /// <summary>
/// 商品名称
/// </summary>
public string ProductTitle { get; set; }
/// <summary>
/// 采购单号
/// </summary>
public string PurchaseOrder { get; set; }
/// <summary>
/// 预约单号
/// </summary>
public string PrewOrder { get; set; }
/// <summary>
/// 运单号
/// </summary>
public string WaybillNo { get; set; }
/// <summary>
/// 仓库类型
/// </summary>
public WareType? WareType { get; set; }
/// <summary>
/// 封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 箱子数
/// </summary>
public int? BoxCount { get; set; }
/// <summary>
/// 箱子总数量
/// </summary>
public int SealBoxTotalCount { get; set; }
/// <summary>
/// 仓库任务列表
/// </summary>
public IList<FallWareConfigureTask> SealBoxConfigureTasks { get; set; }
}
public class FallWareConfigureTask : SealBoxConfigureTask
{
}
}

36
BBWY.Client/Models/FallWare/FallWareWaitConfigureModel.cs

@ -0,0 +1,36 @@
using BBWY.Client.Models.SealBox;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace BBWY.Client.Models.FallWare
{
public class FallWareWaitConfigureModel
{
/// <summary>
/// 封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 箱子总数量
/// </summary>
public int SealBoxTotalCount { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 仓库类型
/// </summary>
public WareType? WareType { get; set; }
/// <summary>
/// 仓库任务列表
/// </summary>
public ObservableCollection<SealBoxConfigureTask> SealBoxConfigureTasks { get; set; }
}
}

53
BBWY.Client/Models/FallWare/JDWareBoxModel.cs

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.FallWare
{
public class JDWareBoxModel
{
/// <summary>
/// 箱子id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 采购单号
/// </summary>
public string PurchaseOrder { get; set; }
/// <summary>
/// 预约单号
/// </summary>
public string PrewOrder { get; set; }
/// <summary>
/// 运单号
/// </summary>
public string WaybillNo { get; set; }
/// <summary>
/// 目的城市-仓库
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string ProductTitle { get; set; }
/// <summary>
/// 箱子数
/// </summary>
public int BoxCount { get; set; }
/// <summary>
/// 商品数量
/// </summary>
public int ProductCount { get; set; }
}
}

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
{

5
BBWY.Client/Models/PackTask/CertificateModel.cs

@ -82,11 +82,6 @@ namespace BBWY.Client.Models
/// </summary>
public string ProductNo { get => productNo; set { Set(ref productNo, value); } }
///// <summary>
///// 生产日期
///// </summary>
//public DateTime ProductDate { get; set; }
/// <summary>
/// 经销商
/// </summary>

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

@ -14,6 +14,7 @@ using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using WebSocketSharp;
namespace BBWY.Client.Models
{
@ -29,8 +30,8 @@ namespace BBWY.Client.Models
private long id;
public long Id { get => id; set { Set(ref id, value); } }
public ICommand PrintBarcodeCommand { get; set; }
public ICommand PrintCerCommand { get; set; }
@ -48,19 +49,20 @@ namespace BBWY.Client.Models
public Action ReflashTask { get; set; }
private void UpdateTask()
{
ViewModelLocator viewModel = new ViewModelLocator();
var publicTaskViewModel = viewModel.PublishTask;
if (publicTaskViewModel.ReflashWindow == null)
publicTaskViewModel.ReflashWindow = ReflashTask;
if (!this.OrderId.IsNullOrEmpty())
{
System.Windows.MessageBox.Show("暂不支持修改采购组的任务");
return;
}
publicTaskViewModel.InitData(this);
PublishTaskWindow publish = new PublishTaskWindow();
PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this);
publish.Show();
//CreatePackTask create = new CreatePackTask();
@ -87,66 +89,21 @@ namespace BBWY.Client.Models
LookCerCommand = new RelayCommand(LookCer);
SetServiceCommand = new RelayCommand(SetService);
UpdateTaskCommand = new RelayCommand(UpdateTask);
QualityTaskCommand=new RelayCommand(QualityTask);
QualityTaskCommand = new RelayCommand(QualityTask);
}
private void QualityTask()
{
QualityWindow service = new QualityWindow();
//加载数据
ViewModelLocator viewModelLocator = new ViewModelLocator();
var qualityViewModel = viewModelLocator.QualityTask;
if (qualityViewModel.ReflashWindow == null)
qualityViewModel.ReflashWindow = ReflashTask;
//qualityViewModel.TaskCount = SkuCount;
// qualityViewModel.TaskId = TaskId;
qualityViewModel.OrderId = OrderId;
qualityViewModel.SkuId = SkuId;
try
{
qualityViewModel.SearchSku(this);
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message);
}
//qualityViewModel.LoadPackDatas();
//qualityViewModel.SetAllFees = new Action<FeesItemResponse, List<string>>((feesItem, packUsers) =>
//{
// FeesItemResponse = feesItem;
// PackUser = string.Join("\r\n", packUsers);
// FeesItemResponse.DiscountAllFees = feesItem.disCount * feesItem.AllFees;
// IsShowFees = feesItem.AllFees > 0 ? true : false;
//});
QualityWindow service = new QualityWindow(this, ReflashTask);
service.Show();
}
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();
}
@ -197,7 +154,7 @@ namespace BBWY.Client.Models
return;
}
PrintWindow printWindow = new PrintWindow();
printWindow.CertificateModel = certificateModel;
printWindow.LoadData();
//printWindow.Datas = LoadCerLabelModels();
@ -215,7 +172,7 @@ namespace BBWY.Client.Models
return;
}
PrintWindow printWindow = new PrintWindow();
PrintWindow printWindow = new PrintWindow();
printWindow.BarCodeModel = new BarCodeModel
{
Brand = BarCodeModel.Brand,
@ -229,72 +186,8 @@ namespace BBWY.Client.Models
//printWindow.Datas = LoadBarLabelModels();
printWindow.Show();
}
/*
public Dictionary<string, string> LoadBarLabelModels()
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("pinming", $"品名: {BarCodeModel.BrandName}");
data.Add("guige", $"规格: {BarCodeModel.SkuName}");
data.Add("pop", $"POP{BarCodeModel.SkuId}");
switch (BarCodeModel.LabelModel)
{
case BarcodeLabelModel.barstander:
data.Add("pinpai", $"品牌: {BarCodeModel.Brand}");
data.Add("xinghao", $"型号: {BarCodeModel.ProductNo}");
return data;
case BarcodeLabelModel.barsimplify:
return data;
default:
break;
}
return data;
}
public Dictionary<string, string> LoadCerLabelModels()
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("pinming", $"品名: {CertificateModel.BrandName}");
data.Add("pinpai", $"品牌: {CertificateModel.Brand}");
data.Add("xinghao", $"型号: {CertificateModel.ProductNo}");
data.Add("dizhi", $"地址: {CertificateModel.ProductAdress}");
data.Add("caizhi", $"材质: {CertificateModel.Shader}");
data.Add("changshang", $"生产商: {CertificateModel.ProductShop}");
switch (CertificateModel.IsLogo)
{
case 0://无图
data.Add("gongchangid", $"无");
break;
case 1://有图
data.Add("gongchangid", $"{CertificateModel.FactoryNumber}");
break;
default:
break;
}
string[] excutes = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries);
StringBuilder sb = new StringBuilder();
sb.Append("执行标准: ");
for (int i = 0; i < excutes.Count(); i++)
{
if (i % 2 == 0 && i > 0)//间隔两个换行
{
sb.Append("\r\n").Append(" ");
}
sb.Append(excutes[i]).Append(" ");
}
sb.Remove(sb.Length - 3, 3);
data.Add("biaozhun", sb.ToString());
return data;
}
*/
private DateTime endTime;
/// <summary>
@ -331,11 +224,11 @@ namespace BBWY.Client.Models
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } }
private TaskState availability;
private Availability availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
public Availability Availability { get => availability; set { Set(ref availability, value); } }
private Worry isWorry;
@ -352,11 +245,11 @@ namespace BBWY.Client.Models
public TaskStateType TaskStatus { get => taskStatus; set { Set(ref taskStatus, value); } }
private PackTaskState taskState;
private TaskState taskState;
/// <summary>
/// 打包仓库任务状态
/// </summary>
public PackTaskState TaskState { get => taskState; set { Set(ref taskState, value); } }
public TaskState TaskState { get => taskState; set { Set(ref taskState, value); } }
private PackType packType;
@ -394,14 +287,6 @@ namespace BBWY.Client.Models
/// </summary>
public string Increment1 { get => increment1; set { Set(ref increment1, value); } }
private Increment increment2;
/// <summary>
/// 增量2()
/// </summary>
public Increment Increment2 { get => increment2; set { Set(ref increment2, value); } }
private string positionType;
/// <summary>
/// 落仓(本地仓=0,云仓=1,京仓=2)
@ -455,11 +340,11 @@ namespace BBWY.Client.Models
public string SkuId { get => skuId; set { Set(ref skuId, value); } }
private string modelNo;
/// <summary>
/// 型号
/// </summary>
public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } }
//private string modelNo;
///// <summary>
///// 型号
///// </summary>
//public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } }
#endregion
@ -577,6 +462,6 @@ namespace BBWY.Client.Models
/// </summary>
public string GoodsNo { get => goodsNo; set { Set(ref goodsNo, value); } }
}
}

13
BBWY.Client/Models/PackTask/SealBoxModel.cs

@ -7,7 +7,10 @@ namespace BBWY.Client.Models.PackTask
{
public class SealBoxModel
{
/// <summary>
/// /封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 店铺Id
/// </summary>
@ -38,6 +41,12 @@ namespace BBWY.Client.Models.PackTask
/// <summary>
/// 封箱sku列表
/// </summary>
public List<SealBoxSku> SealBoxSkus { get; set; }
public List<WareSealBoxSku> SealBoxSkus { get; set; }
/// <summary>
/// 封箱数
/// </summary>
public int? SealBoxCount{ get; set; }
}
}

2
BBWY.Client/Models/QualityTask/PurchaseSku.cs

@ -69,5 +69,7 @@ namespace BBWY.Client.Models.QualityTask
}
}
}
}

78
BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs

@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace BBWY.Client.Models.SealBox
{
public class SealBoxConfigureModel : NotifyObject
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// sku任务数
/// </summary>
public int SkuCount { get; set; }
/// <summary>
/// sku图片
/// </summary>
public string Logo { get; set; }
private int splitCount;
/// <summary>
/// 份数
/// </summary>
public int SplitCount { get=>splitCount; set {Set(ref splitCount,value); } }
private ObservableCollection<SealBoxConfigureWareHourseModel> wareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel>();
/// <summary>
/// 装箱配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } }
}
/// <summary>
/// 封箱配置 装箱配置
/// </summary>
public class SealBoxConfigureWareHourseModel : NotifyObject
{
private int index;
public int Index { get => index; set { Set(ref index, value); } }
private int count;
public int Count { get=>count; set {Set(ref count,value); } }
private string wareId;
public string WareId { get => wareId; set { Set(ref wareId, value); } }
private string wareName;
public string WareName { get => wareName; set { Set(ref wareName, value); } }
private WareType? wareType;
public WareType? WareType { get => wareType; set { Set(ref wareType, value); } }
/// <summary>
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
/// </summary>
public PositionState? WareState { get; set; }
}
}

60
BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs

@ -0,0 +1,60 @@
using BBWY.Client.Models.APIModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace BBWY.Client.Models.SealBox
{
public class SealBoxConfiguredModel:NotifyObject
{
/// <summary>
/// 封箱id
/// </summary>
public long SealBoxId { get; set; }
/// <summary>
/// 箱子总数量
/// </summary>
public int SealBoxTotalCount { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string WareName { get; set; }
/// <summary>
/// 仓库类型
/// </summary>
public WareType? WareType { get; set; }
/// <summary>
/// 仓库任务列表
/// </summary>
public ObservableCollection<SealBoxConfigureTask> SealBoxConfigureTasks { get; set; }
}
public class SealBoxConfigureTask:NotifyObject
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 仓库sku任务数
/// </summary>
public int WareHourseCount { get; set; }
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get; set; }
/// <summary>
/// sku图片
/// </summary>
public string Logo { get; set; }
}
}

39
BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models
{
public class SealBoxWaitConfigureModel : NotifyObject
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// sku任务数
/// </summary>
public int SkuCount { get; set; }
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get; set; }
/// <summary>
/// sku图片
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 预计完成时间
/// </summary>
public DateTime? PreCompletedTime { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public TaskState? TaskState { get; set; }
}
}

43
BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs

@ -0,0 +1,43 @@
using BBWY.Client.Models.APIModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace BBWY.Client.Models.SealBox
{
public class UpdateSealBoxConfiguredTaskModel:NotifyObject
{
public string Logo { get; set; }
public string SkuId { get; set; }
public long TaskId { get; set; }
/// <summary>
/// 采购数量
/// </summary>
public int SkuCount { get; set; }
public string SkuName { get; set; }
private int taskWareCount;
/// <summary>
/// 份数
/// </summary>
public int TaskWareCount { get => taskWareCount; set { Set(ref taskWareCount, value); } }
private ObservableCollection<UpdateSealBoxWareHourseModel> wareHourseDatas;
public ObservableCollection<UpdateSealBoxWareHourseModel> WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } }
}
public class UpdateSealBoxWareHourseModel:WareHourseData
{
/// <summary>
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
/// </summary>
public PositionState? WareState { get; set; }
}
}

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
{

2
BBWY.Client/ViewModels/BaseVM.cs

@ -26,7 +26,7 @@ namespace BBWY.Client.ViewModels
{
try
{
Clipboard.SetText(s.ToString());
Clipboard.SetText(s?.ToString());
}
catch (Exception ex)
{

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;

19
BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs

@ -192,11 +192,11 @@ namespace BBWY.Client.ViewModels.PackTask
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } }
private TaskState availability;
private Availability availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
public Availability Availability { get => availability; set { Set(ref availability, value); } }
private PackType packType;
@ -220,18 +220,7 @@ namespace BBWY.Client.ViewModels.PackTask
private Increment increment1;
/// <summary>
/// 增量1()
/// </summary>
public Increment Increment1 { get => increment1; set { Set(ref increment1, value); } }
private Increment increment2;
/// <summary>
/// 增量2()
/// </summary>
public Increment Increment2 { get => increment2; set { Set(ref increment2, value); } }
private PositionType positionType;
@ -883,7 +872,6 @@ namespace BBWY.Client.ViewModels.PackTask
SkuId = SkuId,
CreateTime = DateTime.Now,
Increment1 = increateStr,
Increment2 = (int)Increment2,
CertificatePosition = (int)CertificatePosition,
PackType = (int)PackType,
MarkMessage = MarkMessage,
@ -987,10 +975,9 @@ namespace BBWY.Client.ViewModels.PackTask
GoodsNumber = config.GoodsNumber;
PackType = (PackType)config.PackType;
BasicPack = (BasicPack)config.BasicPack;
Availability = (TaskState)config.Availability;
//Availability = (Availability)config.Availability;
MarkMessage = config.MarkMessage;
CertificatePosition = config.CertificatePosition == null ? CertificatePosition. : (CertificatePosition)config.CertificatePosition.Value;
// Increment1 = config.Increment1;
string[] increateDatas = config.Increment1.Split(',');
bool isSelected = false;

32
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);
@ -616,7 +616,7 @@ namespace BBWY.Client.ViewModels.PackTask
var res = packDetailService.SetPackTaskDetail(packTaskDetail);
if (res==null)
if (res == null)
{
System.Windows.MessageBox.Show("网络异常!");
return;
@ -627,18 +627,18 @@ namespace BBWY.Client.ViewModels.PackTask
return;
}
// new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
if (SetAllFees != null)
SetAllFees();
win.Close();
// new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
if (ReflashWindow != null)
ReflashWindow();
win.Close();
}
/// <summary>
/// 更新 打包员 和费用数据
/// 刷新界面
/// </summary>
public Action SetAllFees { get; set; }
public Action ReflashWindow { get; set; }
private void AddPackService()
{

17
BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs

@ -19,7 +19,7 @@ using System.Windows.Input;
namespace BBWY.Client.ViewModels.PackTask
{
public class PublishTaskViewModel : BaseVM, IDenpendency
public class PublishTaskViewModel : BaseVM
{
#region 属性
@ -124,11 +124,11 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } }
private TaskState availability;
private Availability availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
public Availability Availability { get => availability; set { Set(ref availability, value); } }
private PackType packType;
/// <summary>
@ -322,7 +322,6 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand OpenSkuDetailCommand { get; set; }
public ICommand CreateTaskCommand { get; set; }
public ICommand SearchSkuCommand { get; set; }
private void SetBarCode()
@ -744,16 +743,6 @@ namespace BBWY.Client.ViewModels.PackTask
new TipsWindow("请设置合格证模板").Show();
return;
}
try
{
createTaskModel.CertificateId = CertificateModel.Where(c => c.Id > 0).FirstOrDefault()?.Id;
}
catch
{
}
createTaskModel.CerId = string.Join(",", CertificateModel.Where(c => c.Id > 0).Select(c => c.Id));//
}
ApiResponse<object> res = null;

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

@ -22,6 +22,13 @@ using HandyControl.Tools.Extension;
using Newtonsoft.Json;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask;
using WebSocketSharp;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Views.SealBox;
using BBWY.Client.Models.SealBox;
using BBWY.Client.ViewModels.SealBox;
using BBWY.Client.Views.FallWare;
using BBWY.Client.Models.FallWare;
namespace BBWY.Client.ViewModels.PackTask
{
@ -31,7 +38,64 @@ namespace BBWY.Client.ViewModels.PackTask
public partial class TaskListViewModel : BaseVM, IDenpendency//注入服务
{
#region 属性绑定
private string sealBoxWaitConfigureCount;
/// <summary>
/// 封箱 待配置数
/// </summary>
public string SealBoxWaitConfigureCount { get => sealBoxWaitConfigureCount; set { Set(ref sealBoxWaitConfigureCount, value); } }
private string sealBoxConfiguredCount;
/// <summary>
///封箱 已配置数
/// </summary>
public string SealBoxConfiguredCount { get => sealBoxConfiguredCount; set { Set(ref sealBoxConfiguredCount, value); } }
private SealBoxConfigureType sealBoxConfigureType;
/// <summary>
/// 封箱配置状态
/// </summary>
public SealBoxConfigureType SealBoxConfigureType { get => sealBoxConfigureType; set { Set(ref sealBoxConfigureType, value); } }
//private SealBoxConfigureType fallWareConfigureType;
///// <summary>
///// 落仓配置状态
///// </summary>
//public SealBoxConfigureType FallWareConfigureType { get => fallWareConfigureType; set { Set(ref fallWareConfigureType, value); } }
private ObservableCollection<SealBoxWaitConfigureModel> sealBoxWaitConfigureList;
/// <summary>
/// 封箱待配置列表
/// </summary>
public ObservableCollection<SealBoxWaitConfigureModel> SealBoxWaitConfigureList { get => sealBoxWaitConfigureList; set { Set(ref sealBoxWaitConfigureList, value); } }
private ObservableCollection<SealBoxConfiguredModel> sealBoxConfiguredList;
/// <summary>
/// 封箱已配置列表
/// </summary>
public ObservableCollection<SealBoxConfiguredModel> SealBoxConfiguredList { get => sealBoxConfiguredList; set { Set(ref sealBoxConfiguredList, value); } }
private ObservableCollection<FallWareConfiguredModel> fallWareWaitConfigureList;
/// <summary>
/// 落仓待配置列表
/// </summary>
public ObservableCollection<FallWareConfiguredModel> FallWareWaitConfigureList { get => fallWareWaitConfigureList; set { Set(ref fallWareWaitConfigureList, value); } }
private ObservableCollection<FallWareConfiguredModel> fallWareConfiguredList;
/// <summary>
/// 落仓已配置列表
/// </summary>
public ObservableCollection<FallWareConfiguredModel> FallWareConfiguredList { get => fallWareConfiguredList; set { Set(ref fallWareConfiguredList, value); } }
/// <summary>
/// 查询时间段
/// </summary>
@ -84,33 +148,59 @@ namespace BBWY.Client.ViewModels.PackTask
/// <summary>
/// 未到货数量
/// </summary>
public int NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } }
private int noArrivedCount;
private int someArrivedCount;
public string NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } }
private string noArrivedCount;
private string someArrivedCount;
/// <summary>
/// 部分到货数量
/// </summary>
public int SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } }
public string SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } }
private int arrivedCount;
private string arrivedCount;
/// <summary>
/// 已到货数量
/// </summary>
public int ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } }
//private int totalCount;
///// <summary>
///// 全部数量
///// </summary>
//public int TotalCount { get => totalCount; set { Set(ref totalCount, value); } }
public string ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } }
private bool isLoading;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
private string waitPackCount;
/// <summary>
/// 待打包任务数
/// </summary>
public string WaitPackCount { get => waitPackCount; set { Set(ref waitPackCount, value); } }
private string waitSealBoxCount;
/// <summary>
/// 带封箱任务数
/// </summary>
public string WaitSealBoxCount { get => waitSealBoxCount; set { Set(ref waitSealBoxCount, value); } }
private string waitFallWareCount;
/// <summary>
/// 待落仓任务数
/// </summary>
public string WaitFallWareCount { get => waitFallWareCount; set { Set(ref waitFallWareCount, value); } }
private string waitOutbound;
/// <summary>
/// 待出库任务数
/// </summary>
public string WaitOutbound { get => waitOutbound; set { Set(ref waitOutbound, value); } }
private string waitCompleted;
/// <summary>
/// 待完成任务数
/// </summary>
public string WaitCompleted { get => waitCompleted; set { Set(ref waitCompleted, value); } }
private bool isLoading;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
private readonly SealBoxService sealBoxService;
private readonly PackTaskService packTaskService;
WorkProcessService workProcessService;
public int? taskStatus { get; set; }
@ -125,7 +215,7 @@ namespace BBWY.Client.ViewModels.PackTask
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService)
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService, SealBoxService sealBoxService)
{
this.globalContext = globalContext;
this.productService = productService;
@ -133,10 +223,17 @@ namespace BBWY.Client.ViewModels.PackTask
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
this.packTaskService = packTaskService;
//TaskState = BBWY.Client.Models. TaskState.全部;
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState);
SetSealBoxConfigureTypeCommand = new RelayCommand<SealBoxConfigureType>(s =>
{
PageIndex = 1;
SealBoxConfigureType = s;
Task.Factory.StartNew(() => SearchTaskList());
});
CreateTaskCommand = new RelayCommand(CreateTask);
SearchTaskCommand = new RelayCommand(() =>
{
@ -151,44 +248,146 @@ namespace BBWY.Client.ViewModels.PackTask
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
DeletedTaskCommand = new RelayCommand<object>(DeletedTask);
ConfiguredSealBoxCommand = new RelayCommand(ConfiguredSealBox);
UpdateSealBoxConfiguredCommand = new RelayCommand<SealBoxConfiguredModel>(UpdateSealBoxConfigured);
StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date;
IsLoading = false;
//加载数据
SetTaskState(Models.TaskState.);
SetTaskState(null);
this.sealBoxService = sealBoxService;
SealBoxConfigureType = SealBoxConfigureType.;
SetFallWareConfiguredCommand = new RelayCommand<object>(SetFallWareConfigured);
}
private void SetFallWareConfigured(object obj)
{
var fallware = obj as FallWareConfiguredModel;
JDWareBoxModel model = new JDWareBoxModel
{
ShopName = globalContext.User.Shop.ShopName,
WareName = fallware.WareName,
SealBoxId = fallware.SealBoxId,
ProductCount = fallware.SealBoxTotalCount,
BoxCount = fallware.BoxCount.Value,
PrewOrder = fallware.PrewOrder,
ProductTitle = fallware.ProductTitle,
PurchaseOrder = fallware.PurchaseOrder,
WaybillNo = fallware.WaybillNo
};
if (fallware.WareType== WareType.)
{
SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask);
window.Show();
}
if (fallware.WareType == WareType.)
{
SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType.Value, ReflashTask);
window.Show();
}
}
private void UpdateSealBoxConfigured(SealBoxConfiguredModel model)
{
var sealBoxId = model.SealBoxId;
var taskIds = model.SealBoxConfigureTasks.Select(s => s.TaskId).ToArray();
private void DeletedTask(object obj)
var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(sealBoxId, taskIds);
if (updateSealBoxConfig == null)
{
MessageBox.Show("网络异常,获取不到带封箱数据");
return;
}
if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null)
{
MessageBox.Show(updateSealBoxConfig.Msg);
return;
}
SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId);
sealBoxConfigureWindow.Show();
}
private void ConfiguredSealBox()
{
var waitSealBoxRes = sealBoxService.GetSealBoxWaitConfigureList(null, null, null, null, null);//获取所有待封装列表
if (waitSealBoxRes == null)
{
MessageBox.Show("网络异常,获取不到带封箱数据");
return;
}
if (!waitSealBoxRes.Success || waitSealBoxRes.Data == null)
{
MessageBox.Show(waitSealBoxRes.Msg);
return;
}
if (waitSealBoxRes.Data.TotalCount <= 0)
{
MessageBox.Show("已全部封箱!");
return;
}
var taskIds = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(w => w.TaskId).ToArray();
var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(0, taskIds);
if (updateSealBoxConfig == null)
{
MessageBox.Show("网络异常,获取不到带封箱数据");
return;
}
if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null)
{
MessageBox.Show(updateSealBoxConfig.Msg);
return;
}
SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, 0);
sealBoxConfigureWindow.Show();
}
private void DeletedTask(object obj)
{
var packTaskmodel = (PackTaskModel)obj;
if (!packTaskmodel.OrderId.IsNullOrEmpty())
{
System.Windows.MessageBox.Show($"暂不支持删除采购组的任务,如要删除,请到采购列表取消订单:{packTaskmodel.OrderId}");
return;
}
MessageBoxResult result = MessageBox.Show("确定取消任务?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
long taskId = (long)obj;
if (result != MessageBoxResult.Yes) return;
packTaskService.DeletedTask(taskId);
packTaskService.DeletedTask(packTaskmodel.TaskId);
Task.Factory.StartNew(() => SearchTaskList());
}
private void IsLoadCount()
{
var packTaskResult = packTaskService.GetAllCount();
if (packTaskResult != null && packTaskResult.Success)
var packTaskResult = packTaskService.GetTaskAllCount(globalContext.User.Shop.ShopId.ToString());
if (packTaskResult != null && packTaskResult.Success && packTaskResult.Data != null)
{
App.Current.Dispatcher.Invoke(() =>
App.Current.Dispatcher.Invoke(new Action(() =>
{
ArrivedCount = packTaskResult.Data.ArrivedCount;
NoArrivedCount = packTaskResult.Data.NoArrivedCount;
SomeArrivedCount = packTaskResult.Data.SomeArrivedCount;
});
ArrivedCount = packTaskResult.Data.ArrivedCount.ToString();
NoArrivedCount = packTaskResult.Data.NoArrivedCount.ToString();
SomeArrivedCount = packTaskResult.Data.SomeArrivedCount.ToString();
//WorryCount = packTaskResult.Data.WorryCount.ToString();
WaitOutbound = packTaskResult.Data.WaitOutbound?.ToString();
WaitPackCount = packTaskResult.Data.WaitPackCount?.ToString();
WaitSealBoxCount = packTaskResult.Data.WaitSealBox?.ToString();
WaitFallWareCount = packTaskResult.Data.WaitFallWareCount?.ToString();
WaitCompleted = packTaskResult.Data.WaitCompleted?.ToString();
}));
}
}
private void LoadIndex(int pageIndex)
@ -201,6 +400,23 @@ namespace BBWY.Client.ViewModels.PackTask
#region 事件绑定
/// <summary>
/// 设置落仓配置信息(上传材料)
/// </summary>
public ICommand SetFallWareConfiguredCommand { get; set; }
/// <summary>
/// 修改封箱数据
/// </summary>
public ICommand UpdateSealBoxConfiguredCommand { get; set; }
/// <summary>
/// 配置封箱策略
/// </summary>
public ICommand ConfiguredSealBoxCommand { get; set; }
/// <summary>
/// 待配置 /已配置
/// </summary>
public ICommand SetSealBoxConfigureTypeCommand { get; set; }
/// <summary>
/// 筛选数据
/// </summary>
@ -233,33 +449,12 @@ namespace BBWY.Client.ViewModels.PackTask
public void SetTaskState(TaskState? taskState)
{
PageIndex = 1;
TaskState = taskState;
switch (taskState)
{
case null:
break;
case Models.TaskState.:
case Models.TaskState.: //未完成的数据
case Models.TaskState.:
taskStatus = null;
TaskState = taskState;
taskStatus = 0;
break;
case Models.TaskState.: //所有数据
TaskState = null;
taskStatus = null;
break;
case Models.TaskState.:
TaskState = null;
taskStatus = 1;
break;
default:
break;
}
SearchTaskList();
}
private ConsumableService consumableService;
private IncreateServiceService increateServiceService;
@ -269,16 +464,19 @@ namespace BBWY.Client.ViewModels.PackTask
SearchTaskList();
}
private List<TaskState> waitSealBoxTaskStates = new List<TaskState> {
Models.TaskState., Models.TaskState.
};//配置封箱的任务状态范围
/// <summary>
/// 搜索任务列表
/// </summary>
public void SearchTaskList()
{
long? taskId = null;
try
{
if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim()))
Convert.ToInt64(SearchTaskId);
taskId= Convert.ToInt64(SearchTaskId);
}
catch
{
@ -288,107 +486,256 @@ namespace BBWY.Client.ViewModels.PackTask
}
IsLoading = true;
Task.Factory.StartNew(() =>
{
try
if (TaskState == null || !waitSealBoxTaskStates.Contains(TaskState.Value))
Task.Factory.StartNew(() =>
{
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.GetOrderList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), taskStatus,
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
try
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.GetTaskList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState),
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var data = new PackTaskModel()
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
{
Brand = item.Brand,
SkuId = item.SkuId,
AcceptName = item.UserName,
Availability = (TaskState)item.Availability,
BasicPack = (BasicPack)item.BasicPack,
DepartmentName = item.DepartmentName,
CertificatePosition = (CertificatePosition)item.CertificatePosition,
GoodsNumber = item.GoodsNumber,
Increment1 = item.Increment1,
Increment2 = (Increment)item.Increment2,
ItemList = new List<SkuMessage>() { new SkuMessage
var data = new PackTaskModel()
{
Brand = item.Brand,
SkuId = item.SkuId,
AcceptName = item.UserName,
Availability = (Availability)item.Availability,
BasicPack = (BasicPack)item.BasicPack,
DepartmentName = item.DepartmentName,
CertificatePosition = (CertificatePosition)item.CertificatePosition,
GoodsNumber = item.GoodsNumber,
Increment1 = item.Increment1,
ItemList = new List<SkuMessage>() { new SkuMessage
{ BrandName = item.BrandName,
GoodsNo = item.ProductItemNum, Logo= item.Logo,
ShopName = item.ShopName, SkuName = item.SkuName,
Id = item.SkuId
} },
MarkMessage = item.MarkMessage,
PackType = (PackType)item.PackType,
PositionType = ((PositionType)item.PositionType).ToString(),
SkuCount = item.SkuCount,
SkuTitle = item.SkuGoodsTitle,
TaskId = item.TaskId,
TaskStatus = (TaskStateType)item.TaskStatus,
EndTime = item.CreateTime,
IsWorry = (Worry)item.IsWorry,
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{
data.BarCodeModel = item.BarCodeDTO;
}
if (item.cers != null)
{
data.CertificateModel = item.cers;
}
if (item.FeesItemResponse != null)
{
data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees;
data.IsShowFees = data.FeesMoney > 0 ? true : false;
data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount;
data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * item.FeesItemResponse.disCount;
MarkMessage = item.MarkMessage,
PackType = (PackType)item.PackType,
PositionType = item.PositionType,
SkuCount = item.SkuCount,
SkuTitle = item.SkuGoodsTitle,
TaskId = item.TaskId,
EndTime = item.CreateTime,
BrandName = item.BrandName,
OrderId = item.OrderId,
TaskState = item.TaskState,
// IsWorry = (Worry)item.IsWorry,
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{
data.BarCodeModel = item.BarCodeDTO;
}
if (item.Cers != null)
{
data.CertificateModel = item.Cers;
}
if (item.FeesItemResponse != null)
{
data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees;
data.IsShowFees = data.FeesMoney > 0 ? true : false;
data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount;
data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * item.FeesItemResponse.disCount;
}
else
{
data.IsShowFees = false;
}
if (item.PackUserName != null && item.PackUserName.Count() > 0)
{
data.PackUser = string.Join("\r\n", item.PackUserName);
}
data.ReflashTask = ReflashTask;
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PackTaskList.Add(data);
}));
}
else
{
data.IsShowFees = false;
}
if (item.PackUserName != null && item.PackUserName.Count() > 0)
{
data.PackUser = string.Join("\r\n", item.PackUserName);
}
data.ReflashTask = ReflashTask;
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PackTaskList.Add(data);
}));
}
else
{
MessageBox.Show("查不到数据");
}
IsLoadCount();
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message);
}
else
IsLoading = false;
});
if (TaskState != null && waitSealBoxTaskStates.Contains(TaskState.Value))//封箱操作
{
if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
MessageBox.Show("查不到数据");
try
{
if (SealBoxConfigureType == SealBoxConfigureType.)
{
SealBoxWaitConfigureList = new ObservableCollection<SealBoxWaitConfigureModel>();
ApiResponse<SealBoxWaitConfigureResponse> sealBoxWaitRes = sealBoxService.GetSealBoxWaitConfigureList(SearchSkuId, SearchTaskId, PageSize, PageIndex);
if (sealBoxWaitRes == null)
{
System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return;
}
if (!sealBoxWaitRes.Success || sealBoxWaitRes.Data == null)
{
System.Windows.MessageBox.Show(sealBoxWaitRes.Msg); IsLoading = false; return;
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
OrderCount = sealBoxWaitRes.Data.TotalCount;
}));
foreach (var item in sealBoxWaitRes.Data.SealBoxWaitConfigureModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
SealBoxWaitConfigureList.Add(item);
}));
}
}
}
IsLoadCount();
if (SealBoxConfigureType == SealBoxConfigureType.)
{
SealBoxConfiguredList = new ObservableCollection<SealBoxConfiguredModel>();
var sealBoxRes = sealBoxService.GetSealBoxConfiguredList(PositionState., SearchSkuId, SearchTaskId, globalContext.User.Shop.ShopId.ToString(), PageSize, PageIndex);
if (sealBoxRes == null)
{
System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return;
}
if (!sealBoxRes.Success || sealBoxRes.Data == null)
{
System.Windows.MessageBox.Show(sealBoxRes.Msg); IsLoading = false; return;
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
OrderCount = sealBoxRes.Data.TotalCount;
}));
foreach (var item in sealBoxRes.Data.SealBoxConfiguredModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
SealBoxConfiguredList.Add(item);
}));
}
}
IsLoadSealBoxCount();
IsLoadCount();
}
catch (Exception ex)
{
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message);
}
IsLoading = false;
});
if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
}
try
{
if (SealBoxConfigureType == SealBoxConfigureType.)
{
FallWareWaitConfigureList = new ObservableCollection<FallWareConfiguredModel>();
var fallWareRes = sealBoxService.SearchFallWareConfiguredList(PositionState., taskId, SearchSkuId, PageIndex, PageSize);
if (fallWareRes == null)
{
System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return;
}
if (!fallWareRes.Success || fallWareRes.Data == null)
{
System.Windows.MessageBox.Show(fallWareRes.Msg); IsLoading = false; return;
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
OrderCount = fallWareRes.Data.TotalCount;
}));
foreach (var item in fallWareRes.Data.FallWareConfiguredModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
FallWareWaitConfigureList.Add(item);
}));
}
}
if (SealBoxConfigureType == SealBoxConfigureType.)
{
FallWareConfiguredList = new ObservableCollection<FallWareConfiguredModel>();
var fallWareRes = sealBoxService.SearchFallWareConfiguredList(PositionState., taskId, SearchSkuId, PageIndex, PageSize);
if (fallWareRes == null)
{
System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return;
}
if (!fallWareRes.Success || fallWareRes.Data == null)
{
System.Windows.MessageBox.Show(fallWareRes.Msg); IsLoading = false; return;
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
OrderCount = fallWareRes.Data.TotalCount;
}));
foreach (var item in fallWareRes.Data.FallWareConfiguredModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
FallWareConfiguredList.Add(item);
}));
}
}
IsLoading = false;
});
IsLoadFallWareCount();
IsLoadCount();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
IsLoading = false;
});
}
@ -396,42 +743,37 @@ namespace BBWY.Client.ViewModels.PackTask
GlobalContext globalContext;
ProductService productService;
private void IsLoadFallWareCount()
{
var res = sealBoxService.GetFallWareConfigureCounts(globalContext.User.Shop.ShopId.ToString());
if (res != null && res.Success && res.Data != null)
{
SealBoxWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString();
SealBoxConfiguredCount = res.Data.FallWareConfiguredCount.ToString();
}
}
private void IsLoadSealBoxCount()
{
var res = sealBoxService.GetSealBoxPackStateCount();
if (res != null && res.Success && res.Data != null)
{
SealBoxWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString();
SealBoxConfiguredCount = res.Data.SealBoxConfiguredCount.ToString();
}
}
/// <summary>
/// 展示发布任务页面
/// </summary>
public void CreateTask()
{
ViewModelLocator viewModel = new ViewModelLocator();
var publicTaskViewModel = viewModel.PublishTask;
if (publicTaskViewModel.ReflashWindow == null)
publicTaskViewModel.ReflashWindow = ReflashTask;
publicTaskViewModel.InitData();
PublishTaskWindow publish = new PublishTaskWindow();
PublishTaskWindow publish = new PublishTaskWindow(ReflashTask);
publish.Show();
//ViewModelLocator viewModel = new ViewModelLocator();
//var createViewModel = viewModel.CreateTaskView;
//if (createViewModel.ReflashWindow == null)
//{
// createViewModel.ReflashWindow = ReflashTask;
//}
//CreatePackTask create = new CreatePackTask();
//create.SendData();
//create.Show();
}
@ -463,7 +805,9 @@ namespace BBWY.Client.ViewModels.PackTask
{
var paramList = (object[])param;
// var orderId = paramList[0].ToString();
var skuId = paramList[1].ToString();
var skuId = paramList.Last().ToString();
var url = $"https://item.jd.com/{skuId}.html";

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

@ -21,6 +21,9 @@ using NPOI.SS.Formula.Functions;
using GalaSoft.MvvmLight.Messaging;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.SealBox;
using BBWY.Client.Views.FallWare;
using BBWY.Client.Models.FallWare;
namespace BBWY.Client.ViewModels.PackTask
{
@ -47,6 +50,22 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
public string fallWareWaitConfigureCount;
public string FallWareWaitConfigureCount { get => fallWareWaitConfigureCount; set { Set(ref fallWareWaitConfigureCount, value); } }
public string fallWareConfiguredCount;
public string FallWareConfiguredCount { get => fallWareConfiguredCount; set { Set(ref fallWareConfiguredCount, value); } }
private ObservableCollection<WaitFallWareModel> waitFallWareList;
/// <summary>
/// 待落仓列表
/// </summary>
public ObservableCollection<WaitFallWareModel> WaitFallWareList { get => waitFallWareList; set { Set(ref waitFallWareList, value); } }
private ObservableCollection<SealBoxModel> waitSealBoxModels;
/// <summary>
@ -54,7 +73,11 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ObservableCollection<SealBoxModel> WaitSealBoxModels { get => waitSealBoxModels; set { Set(ref waitSealBoxModels, value); } }
private ObservableCollection<PackTaskModel> packTaskList;
/// <summary>
/// 打包任务列表
/// </summary>
public ObservableCollection<PackTaskModel> PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } }
/// <summary>
/// 查询时间段
@ -92,11 +115,11 @@ namespace BBWY.Client.ViewModels.PackTask
private string searchSkuId;
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } }
public PackTaskState? taskState;
public TaskState? taskState;
/// <summary>
/// 任务状态
/// </summary>
public PackTaskState? TaskState
public TaskState? TaskState
{
get => taskState; private set
{
@ -142,26 +165,36 @@ namespace BBWY.Client.ViewModels.PackTask
private string waitPackCount;
/// <summary>
/// 待打包数
/// 待打包任务
/// </summary>
public string WaitPackCount { get => waitPackCount; set { Set(ref waitPackCount, value); } }
private string waitSealBox;
private string waitSealBoxCount;
/// <summary>
/// 带封箱任务数
/// </summary>
public string WaitSealBoxCount { get => waitSealBoxCount; set { Set(ref waitSealBoxCount, value); } }
private string waitFallWareCount;
/// <summary>
/// 带封箱数
/// 待落仓任务
/// </summary>
public string WaitSealBox { get => waitSealBox; set { Set(ref waitSealBox, value); } }
public string WaitFallWareCount { get => waitFallWareCount; set { Set(ref waitFallWareCount, value); } }
private string waitOutbound;
/// <summary>
/// 待出库数
/// 待出库任务
/// </summary>
public string WaitOutbound { get => waitOutbound; set { Set(ref waitOutbound, value); } }
//private int totalCount;
///// <summary>
///// 全部数量
///// </summary>
//public int TotalCount { get => totalCount; set { Set(ref totalCount, value); } }
private string waitCompleted;
/// <summary>
/// 待完成任务数
/// </summary>
public string WaitCompleted { get => waitCompleted; set { Set(ref waitCompleted, value); } }
public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } }
@ -176,17 +209,6 @@ namespace BBWY.Client.ViewModels.PackTask
private int? IsWorry { get; set; }
public int? taskStatus { get; set; }
private ObservableCollection<PackTaskModel> packTaskList;
/// <summary>
/// 动态数据表
/// </summary>
public ObservableCollection<PackTaskModel> PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } }
//private ObservableCollection<FeesItemTypeDTO> feesItems;
///// <summary>
///// 动态数据表
///// </summary>
//public ObservableCollection<FeesItemTypeDTO> FeesItems { get => feesItems; set { Set(ref feesItems, value); } }
public string searchDepartment;
@ -198,27 +220,28 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
private SealBoxConfigureType sealBoxConfigureType;
/// <summary>
/// 封箱配置状态
/// </summary>
public SealBoxConfigureType SealBoxConfigureType { get => sealBoxConfigureType; set { Set(ref sealBoxConfigureType, value); } }
#endregion
private readonly ProductService productService;
private readonly ConsumableService consumableService;
private readonly WorkProcessService workProcessService;
private readonly PackTaskService packTaskService;
private readonly IncreateServiceService increateServiceService;
private readonly SealBoxService sealBoxService;
public GlobalContext globalContext;
public WareHouseListViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService, ProductService productService, BatchPurchaseService batchPurchaseService, GlobalContext globalContext)
public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService)
{
this.globalContext = globalContext;
this.sealBoxService = sealBoxService;
this.packTaskService = packTaskService;
this.consumableService = consumableService;
//Messenger.Default.Send(globalContext, "AcceptGlobalContext");
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
SetTaskStateCommand = new RelayCommand<PackTaskState?>(SetTaskState);
SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState);
SearchTaskCommand = new RelayCommand(() =>
{
@ -231,21 +254,7 @@ namespace BBWY.Client.ViewModels.PackTask
});
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
CopyTextCommand = new RelayCommand<object>(s =>
{
try
{
if (s != null)
Clipboard.SetText(s.ToString());
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(ex);
Console.ResetColor();
}
});
StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date;
IsLoading = false;
@ -253,19 +262,144 @@ namespace BBWY.Client.ViewModels.PackTask
//加载数据
SetTaskState(null);
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
this.productService = productService;
this.batchPurchaseService = batchPurchaseService;
UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState);
CompeteSealBoxCommand = new RelayCommand<object>(CompeteSealBox);
SetSealBoxCommand = new RelayCommand<object>(SetSealBox);
CompeteFallWareCommand = new RelayCommand<object>(CompeteFallWare);
SealBoxConfigureType = SealBoxConfigureType.;
PositionState = PositionState.;
SetSealBoxConfigureTypeCommand = new RelayCommand<SealBoxConfigureType>(s =>
{
PageIndex = 1;
SealBoxConfigureType = s;
PositionState = s == SealBoxConfigureType. ? PositionState. : PositionState.;
Task.Factory.StartNew(() => SearchTaskList());
});
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)
{
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.)
{
SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask,false);
window.Show();
}
if (fallware.WareType == WareType.)
{
SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false);
window.Show();
}
}
public PositionState PositionState { get; set; }
/// <summary>
/// 完成落仓(todo:)
/// </summary>
/// <param name="obj"></param>
private void CompeteFallWare(object obj)
{
if (System.Windows.MessageBox.Show("是否完成落仓?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
var model = obj as WaitFallWareModel;
var res = sealBoxService.WareCompeteFallWare(model.SealBoxId);
if (res != null&&res.Success)
{
ReflashTask();return;
}
if (res==null)
{
System.Windows.MessageBox.Show("网络异常");
return;
}
System.Windows.MessageBox.Show(res.Msg);
}
private void SetSealBox(object obj)
{
var model = (SealBoxModel)obj;
if (model.SealBoxSkus.Any(s => s.TaskState == Models.TaskState. || s.TaskState == Models.TaskState.))
{
System.Windows.MessageBox.Show("无法封箱,存在未封箱的任务");
return;
}
SetSealBoxWindow setSealBoxWindow = new SetSealBoxWindow(model);
setSealBoxWindow.SendBoxCount = boxCount =>
{
model.SealBoxCount = boxCount;
};
setSealBoxWindow.ShowDialog();
}
#region 事件绑定
public ICommand LookBoxConfigureCommand { get; set; }
/// <summary>
/// 待配置 /已配置
/// </summary>
public ICommand SetSealBoxConfigureTypeCommand { get; set; }
public ICommand CompeteFallWareCommand { get; set; }
public ICommand CompeteSealBoxCommand { get; set; }
public ICommand SetTaskStatusCommand { get; set; }
@ -274,10 +408,7 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ICommand OpenSkuDetailCommand { get; set; }
/// <summary>
/// 复制
/// </summary>
public ICommand CopyTextCommand { get; set; }
/// <summary>
/// 筛选数据
/// </summary>
@ -302,57 +433,74 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ICommand TaskPageIndexChangedCommand { get; set; }
/// <summary>
/// 设置分箱数量
/// </summary>
public ICommand SetSealBoxCommand { get; set; }
BatchPurchaseService batchPurchaseService;
/// <summary>
/// 打印封箱数据
/// </summary>
public ICommand PrintBoxConfigureCommand { get; set; }
private void CompeteSealBox(object obj)
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="obj"></param>
private void CompeteSealBox(object obj)
{
var objList = obj as SealBoxModel;
var model = (SealBoxModel)obj;
List<CompeteSealBox> CompeteSealBoxs = new List<CompeteSealBox>();
string wareId = objList.WareId;
foreach (var item in objList.SealBoxSkus)
if (model.SealBoxCount == null || model.SealBoxCount.Value <= 0)
{
System.Windows.MessageBox.Show("请先设置封箱数量");
return;
}
var res = sealBoxService.WareCompeteSealBox(model.SealBoxId, model.SealBoxCount);
if (res == null)
{
System.Windows.MessageBox.Show("网络异常", "");
return;
}
CompeteSealBoxs.Add(new APIServices.CompeteSealBox
{
WareId = wareId,
TaskId = item.TaskId,
});
}
var res = packTaskService.CompeteSealBox(CompeteSealBoxs);
if (res != null && res.Success)
if (!res.Success || !res.Data)
{
SearchTaskList();
System.Windows.MessageBox.Show(res.Msg);
return;
}
SearchTaskList();
}
private void UpdateTaskState(object obj)
{
var objList = (object[])obj;
long taskId = (long)objList[0];
var packTaskState = (PackTaskState)objList[1];
var model = (PackTaskModel)obj;
long taskId = model.TaskId;
var packTaskState = model.TaskState;
ApiResponse<object> res = null;
switch (packTaskState)
{
case PackTaskState.:
case PackTaskState.:
case Models.TaskState.:
case Models.TaskState.:
if (System.Windows.MessageBox.Show("是否确认收货?","提示",
if (System.Windows.MessageBox.Show("是否确认收货?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
res = packTaskService.SetPackTaskState(taskId, PackTaskState.);
res = packTaskService.SetPackTaskState(taskId, Models.TaskState.);
break;
case PackTaskState.:
case Models.TaskState.:
break;
case PackTaskState.:
case Models.TaskState.:
var packModel = PackTaskList.SingleOrDefault(p => p.TaskId == taskId);
if (packModel == null || packModel.FeesItemResponse == null || packModel.FeesItemResponse.DiscountAllFees == 0)
@ -364,15 +512,17 @@ namespace BBWY.Client.ViewModels.PackTask
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
res = packTaskService.SetPackTaskState(taskId, PackTaskState.);
res = packTaskService.SetPackTaskState(taskId, Models.TaskState.);
break;
case PackTaskState.:
case Models.TaskState.:
break;
case PackTaskState.:
case Models.TaskState.:
break;
case PackTaskState.:
case Models.TaskState.:
break;
case PackTaskState.:
case Models.TaskState.:
break;
default:
break;
@ -397,44 +547,14 @@ namespace BBWY.Client.ViewModels.PackTask
SearchTaskList();
}
public void SetTaskState(PackTaskState? taskState)
public void SetTaskState(TaskState? taskState)
{
PageIndex = 1;
TaskState = taskState;
SearchTaskList();
}
//public void SetTaskState(TaskState? taskState)
//{
// IsWorry = null;
// TaskState = null;
// taskStatus = null;
// switch (taskState)
// {
// case null:
// break;
// case Models.TaskState.已到货:
// case Models.TaskState.部分到货: //未完成的数据
// case Models.TaskState.未到货:
// TaskState = taskState;
// taskStatus = 0;
// break;
// case Models.TaskState.全部: //所有数据
// break;
// case Models.TaskState.已完成:
// taskStatus = 1;
// break;
// case Models.TaskState.加急:
// taskStatus = 0;
// IsWorry = 1;
// break;
// default:
// break;
// }
// SearchTaskList();
//}
/// <summary>
@ -453,38 +573,87 @@ namespace BBWY.Client.ViewModels.PackTask
taskId = null;
}
IsLoading = true;
if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
WaitFallWareList = new ObservableCollection<WaitFallWareModel>();
var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.WaitFallWareList)
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
WaitFallWareList.Add(new WaitFallWareModel
{
AcceptUserNames = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus,
ShopId = item.ShopId,
ShopName = item.ShopName,
WareId = item.WareId,
WareName = item.WareName,
SealBoxCount = item.SealBoxCount,
SealBoxId = item.SealBoxId,
BoxConfigureData = item.BoxConfigureData,
ProductCount = item.ProductCount,
WareType = item.WareType,
});
}));
}
}
else
{
//App.Current.Dispatcher.BeginInvoke(new Action(() =>
//{
// new TipsWindow("查不到数据").Show();
//}));
}
IsLoadCount();
IsLoadFallWareCount();
IsLoading = false;
IsLoading = true;
if (TaskState == PackTaskState.)
});
else if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
var randNum = new Random().Next(81, 90);
WaitSealBoxModels = new ObservableCollection<SealBoxModel>();
var datas = packTaskService.SearchWaitSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.WaitSealBoxModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
WaitSealBoxModels.Add(new SealBoxModel
{
AcceptUserName = string.Join("|", item.AcceptUserNames.Select(a => a.UserName)),
AcceptUserName = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus,
SealBoxSkus = item.SealBoxSkus.Select(s =>
{
s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}");
return s;
}).ToList(),
ShopId = item.ShopId,
ShopName = item.ShopName,
WareId = item.WareId,
WareName = item.WareName,
SealBoxId = item.SealBoxId,
});
}));
@ -517,7 +686,7 @@ namespace BBWY.Client.ViewModels.PackTask
var data = new PackTaskModel()
{
AcceptName = item.UserName,
Availability = (TaskState)item.Availability,
Availability = (Availability)item.Availability,
BasicPack = (BasicPack)item.BasicPack,
DepartmentName = item.DepartmentName,
CertificatePosition = (CertificatePosition)item.CertificatePosition,
@ -542,8 +711,8 @@ namespace BBWY.Client.ViewModels.PackTask
OrderId = item.OrderId,
SkuId = item.SkuId,
SkuName = item.SkuName,
FloorDragNumber=item.FloorDragNumber,
FloorDragNumber = item.FloorDragNumber,
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
@ -589,27 +758,26 @@ namespace BBWY.Client.ViewModels.PackTask
}
else
{
//App.Current.Dispatcher.BeginInvoke(new Action(() =>
//{
// new TipsWindow("查不到数据").Show();
//}));
}
IsLoadCount();
IsLoading = false;
});
}
private void IsLoadFallWareCount()
{
var res = sealBoxService.GetFallWareConfigureCounts(null);
if (res != null && res.Success && res.Data != null)
{
FallWareWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString();
FallWareConfiguredCount = res.Data.FallWareConfiguredCount.ToString();
}
}
private void IsLoadCount()
{
var packTaskResult = packTaskService.GetWareAllCount();
if (packTaskResult != null && packTaskResult.Success)
var packTaskResult = packTaskService.GetTaskAllCount();
if (packTaskResult != null && packTaskResult.Success && packTaskResult.Data != null)
{
App.Current.Dispatcher.Invoke(() =>
App.Current.Dispatcher.Invoke(new Action(() =>
{
ArrivedCount = packTaskResult.Data.ArrivedCount.ToString();
NoArrivedCount = packTaskResult.Data.NoArrivedCount.ToString();
@ -617,8 +785,10 @@ namespace BBWY.Client.ViewModels.PackTask
WorryCount = packTaskResult.Data.WorryCount.ToString();
WaitOutbound = packTaskResult.Data.WaitOutbound?.ToString();
WaitPackCount = packTaskResult.Data.WaitPackCount?.ToString();
WaitSealBox = packTaskResult.Data.WaitSealBox?.ToString();
});
WaitSealBoxCount = packTaskResult.Data.WaitSealBox?.ToString();
WaitFallWareCount = packTaskResult.Data.WaitFallWareCount?.ToString();
WaitCompleted = packTaskResult.Data.WaitCompleted?.ToString();
}));
}
}
private void LoadIndex(int pageIndex)
@ -635,7 +805,7 @@ namespace BBWY.Client.ViewModels.PackTask
private void OpenSkuDetail(object param)
{
var paramList = (object[])param;
var skuId = paramList[1].ToString();
var skuId = paramList.Last().ToString();
var url = $"https://item.jd.com/{skuId}.html";
try
{

2
BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs

@ -74,7 +74,7 @@ namespace BBWY.Client.ViewModels
MessageBox.Show(response.Msg, "获取仓库");
return;
}
storeList = response.Data;
storeList = response.Data.Where(s=>s.Status== StockStatus.使).ToArray();
}
var w = new PackSkuSplitCountAndStoreWindow(packSkuSplitConfig.PackCount, packSkuSplitConfig.Store, storeList, packSkuSplitConfig.IsJST);
if (w.ShowDialog() == true)

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

@ -24,7 +24,7 @@ using WebSocketSharp;
namespace BBWY.Client.ViewModels
{
public class QualityViewModel : BaseVM, IDenpendency
public class QualityViewModel : BaseVM
{
#region 属性
@ -197,11 +197,11 @@ namespace BBWY.Client.ViewModels
/// </summary>
public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } }
private TaskState availability;
private Availability availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
public Availability Availability { get => availability; set { Set(ref availability, value); } }
private PackType packType;
/// <summary>

304
BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs

@ -0,0 +1,304 @@
using AutoMapper.Internal;
using BBWY.Client.APIServices;
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.QiKu;
using BBWY.Client.Models.SealBox;
using BBWY.Client.Views.BatchPurchase;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
namespace BBWY.Client.ViewModels.SealBox
{
public class SealBoxConfigureViewModel : BaseVM
{
private IList<StoreResponse> storeList;//仓库列表
private LogisticsService logisticsService;
private SealBoxService sealBoxService;
private GlobalContext globalContext;
private ObservableCollection<SealBoxConfigureModel> sealBoxConfigureModelList;
/// <summary>
/// 分箱配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } }
public SealBoxConfigureViewModel(LogisticsService logisticsService, SealBoxService sealBoxService, GlobalContext globalContext)
{
this.logisticsService = logisticsService;
this.sealBoxService = sealBoxService;
SetSplitCountCommand = new RelayCommand<SealBoxConfigureModel>(SetSplitCount);
SetPackCountAndStoreCommand = new RelayCommand<object>(SetPackCountAndStore);
SaveCommand = new RelayCommand<object>(Save);
SealBoxConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
this.globalContext = globalContext;
}
private long sealBoxId;
public long SealBoxId { get => sealBoxId; set { Set(ref sealBoxId, value); } }
public ICommand SetSplitCountCommand { get; set; }
public ICommand SetPackCountAndStoreCommand { get; set; }
public ICommand SaveCommand { get; set; }
private void SetSplitCount(SealBoxConfigureModel sealBoxConfigureModel)
{
sealBoxConfigureModel.WareHourseDatas.Where(w => w.WareState == null || w.WareState == PositionState.).ToList().ForEach(
s => sealBoxConfigureModel.WareHourseDatas.Remove(s)
);
var otherCount = sealBoxConfigureModel.WareHourseDatas.Count();
if (sealBoxConfigureModel.SplitCount <= 0 || sealBoxConfigureModel.SplitCount < otherCount)
{
MessageBox.Show("份数不正确");
return;
}
int resetIndex = 1;
foreach (var item in sealBoxConfigureModel.WareHourseDatas)
{
item.Index = resetIndex;
resetIndex++;
}
for (var i = 1 + otherCount; i <= sealBoxConfigureModel.SplitCount; i++)
{
sealBoxConfigureModel.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel()
{
Index = i,
Count = 0
});
}
}
private StoreResponse store;
private void SetPackCountAndStore(object obj)
{
var sealBoxConfigureWareHourseModel = obj as SealBoxConfigureWareHourseModel;
if (storeList == null)
{
var response = logisticsService.GetStoreList();
if (!response.Success)
{
MessageBox.Show(response.Msg, "获取仓库");
return;
}
storeList = response.Data.Where(s => s.Status == StockStatus.使).ToArray();
}
if (store == null)
{
if (sealBoxConfigureWareHourseModel != null)
store = new StoreResponse
{
Id = sealBoxConfigureWareHourseModel.WareId,
Name = sealBoxConfigureWareHourseModel.WareName,
Type = ToStockType(sealBoxConfigureWareHourseModel.WareType),
Status = StockStatus.使
};
}
var w = new PackSkuSplitCountAndStoreWindow(sealBoxConfigureWareHourseModel.Count, store, storeList, sealBoxConfigureWareHourseModel.WareType == WareType.);
if (w.ShowDialog() == true)
{
store = w.Store;
sealBoxConfigureWareHourseModel.Count = w.Quantity;
IsJST = w.IsJST;
sealBoxConfigureWareHourseModel.WareType = w.IsJST ? WareType. : ToWareType(w.Store.Type);
sealBoxConfigureWareHourseModel.WareId = w.IsJST ? "qiyuejushuitan" : w.Store.Id;
sealBoxConfigureWareHourseModel.WareName = w.IsJST ? "齐越聚水潭" : w.Store.Name;
}
}
/// <summary>
/// 是否聚水潭
/// </summary>
public bool IsJST { get; set; }
private WareType ToWareType(StockType stockType)
{
switch (stockType)
{
case StockType.:
return WareType.;
break;
case StockType.:
return WareType.;
break;
case StockType.:
return WareType.;
break;
default:
break;
}
return WareType.;
}
private StockType ToStockType(WareType? wareType)
{
switch (wareType)
{
case WareType.:
return StockType.;
break;
case WareType.:
return StockType.;
break;
case WareType.:
return StockType.;
break;
case WareType.:
break;
default:
break;
}
return StockType.;
}
private void Save(object obj)
{
if (SealBoxId <= 0)//设置分箱
{
SetSealBoxConfiguredRequest setSealBoxConfiguredRequest = new SetSealBoxConfiguredRequest();
setSealBoxConfiguredRequest.ShopId = globalContext.User.Shop.ShopId.ToString();
IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas = new List<SetSealBoxConfiguredData>();
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList)
{
////todo: 到分箱界面判断
//if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count())
//{
// MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!");
// return;
//}
//判断任务数量与分箱数量总和是否相等
if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum())
{
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
return;
}
SetSealBoxConfiguredDatas.Add(new SetSealBoxConfiguredData
{
SkuId = sealBoxConfigureModel.SkuId,
TaskId = sealBoxConfigureModel.TaskId,
TotalCount = sealBoxConfigureModel.SkuCount,
WareHourseDatas = sealBoxConfigureModel.WareHourseDatas.Select(x => new WareHourseData
{
Count = x.Count,
WareId = x.WareId,
WareName = x.WareName,
WareType = x.WareType.Value,
}).ToList(),
});
}
setSealBoxConfiguredRequest.SetSealBoxConfiguredDatas = SetSealBoxConfiguredDatas;
var setSealBoxRes = sealBoxService.SetSealBoxConfigured(setSealBoxConfiguredRequest);
if (setSealBoxRes == null)
{
MessageBox.Show("网络异常");
return;
}
if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data)
{
MessageBox.Show(setSealBoxRes.Msg);
return;
}
if (ReflashWindow != null) ReflashWindow();
var window = obj as BWindow;
window.Close();
}
if (SealBoxId > 0)//修改分箱
{
BatchUpdateSealBoxConfiguredRequest res = new BatchUpdateSealBoxConfiguredRequest()
{
SealBoxId = SealBoxId,
ShopId = globalContext.User.Shop.ShopId.ToString()
};
IList<UpdateSealBoxConfiguredDataRequest> UpdateSealBoxConfiguredDatas = new List<UpdateSealBoxConfiguredDataRequest>();
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList)
{
////todo: 到分箱界面判断
//if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count())
//{
// MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!");
// return;
//}
//判断任务数量与分箱数量总和是否相等
if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum())
{
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} 中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
return;
}
UpdateSealBoxConfiguredDatas.Add(new UpdateSealBoxConfiguredDataRequest
{
TaskId = sealBoxConfigureModel.TaskId,
SkuCount = sealBoxConfigureModel.SkuCount,
SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Select(x => new SealBoxConfiguredWareHourseRequest
{
Count = x.Count,
WareId = x.WareId,
WareName = x.WareName,
WareType = x.WareType.Value,
WareState = x.WareState,
}).ToList(),
});
}
res.UpdateSealBoxConfiguredDatas = UpdateSealBoxConfiguredDatas;
var setSealBoxRes = sealBoxService.BatchUpdateSealBoxConfigured(res);
if (setSealBoxRes == null)
{
MessageBox.Show("网络异常");
return;
}
if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data)
{
MessageBox.Show(setSealBoxRes.Msg);
return;
}
if (ReflashWindow != null) ReflashWindow();
var window = obj as BWindow;
window.Close();
}
}
public Action ReflashWindow { get; set; }
}
}

26
BBWY.Client/ViewModels/ViewModelLocator.cs

@ -1,4 +1,6 @@
using BBWY.Client.ViewModels.PackTask;
using BBWY.Client.Models;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Client.ViewModels.SealBox;
using BBWY.Client.ViewModels.TotalPackTask;
using GalaSoft.MvvmLight.Ioc;
using Microsoft.Extensions.DependencyInjection;
@ -326,10 +328,26 @@ namespace BBWY.Client.ViewModels
}
void test()
public SealBoxConfigureViewModel SealBoxConfigureVModel
{
var packuser = (App.Current as App).ServiceProvider.GetRequiredService<PackUserSalaryViewModel>();
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<SealBoxConfigureViewModel>();
}
}
//public ShopSealBoxListViewModel ShopSealBoxListVM
//{
// get
// {
// using (var s = sp.CreateScope())
// {
// return s.ServiceProvider.GetRequiredService<ShopSealBoxListViewModel>();
// }
// }
//}
}
}

13
BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs

@ -95,7 +95,18 @@ namespace BBWY.Client.Views.BatchPurchase
{
this.txtQuantity.Text = Quantity.ToString();
this.cbx_stroeList.SelectedItem = this.Store;
if (isJST)
{
//this.cbx_stroeList.Text = Store.Name;
}
else
{
this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id);
}
//this.cbx_stroeList.ItemsSource = storeList;
//if (Store != null)
// this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id);

250
BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml

@ -0,0 +1,250 @@
<UserControl x:Class="BBWY.Client.Views.FallWare.FallWareConfiguredControl"
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.FallWare"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="任务信息" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>-->
<TextBlock Text="数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="采购单号" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="预约单号" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="5" Style="{StaticResource middleTextBlock}"/>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
<!--<Border Height="1" VerticalAlignment="Top" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>-->
</Grid>
</Border>
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding FallWareConfiguredList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="68">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition MinHeight="68"/>
</Grid.RowDefinitions>
<Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" >
<TextBlock VerticalAlignment="Center" Text="仓库:" Margin="16,0,0,0" />
<c:BButton Content="{Binding WareName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding WareName}"
Margin=" 5,0,7,0"/>
</StackPanel>
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding SealBoxTotalCount}"/>
</Grid>
<!--<Grid Grid.Column="2">
<c:BButton Style="{StaticResource LinkButton}" Content="修改"/>
</Grid>-->
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<ListBox Name="listbox_orerSku"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="62"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="48" DecodePixelWidth="48"
VerticalAlignment="Top" Margin="14,10,0,10"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="8,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuName,Mode=TwoWay}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="任务ID:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<ListBox Grid.Column="1" Name="listbox_skuCount"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Grid.Column="1" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WareHourseCount}"/>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="2">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding PurchaseOrder}"/>
</Grid>
<Grid Grid.Column="3">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding PrewOrder}"/>
</Grid>
<Grid Grid.Column="4">
<c:BButton Style="{StaticResource LinkButton}" Content="修改" Command="{Binding DataContext.SetFallWareConfiguredCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"/>
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<Grid Grid.Column="5" >
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" Margin="0 0 2 0"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4" Margin="0 0 1 0"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="13"/>-->
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

26
BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// FallWareConfiguredControl.xaml 的交互逻辑
/// </summary>
public partial class FallWareConfiguredControl : UserControl
{
public FallWareConfiguredControl()
{
InitializeComponent();
}
}
}

238
BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml

@ -0,0 +1,238 @@
<UserControl x:Class="BBWY.Client.Views.FallWare.FallWareWaitConfigureControl"
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.FallWare"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="任务信息" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>-->
<TextBlock Text="数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
<!--<Border Height="1" VerticalAlignment="Top" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>-->
</Grid>
</Border>
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding FallWareWaitConfigureList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="68">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition MinHeight="68"/>
</Grid.RowDefinitions>
<Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" >
<TextBlock VerticalAlignment="Center" Text="仓库:" Margin="16,0,0,0" />
<c:BButton Content="{Binding WareName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding WareName}"
Margin=" 5,0,7,0"/>
</StackPanel>
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding SealBoxTotalCount}"/>
</Grid>
<!--<Grid Grid.Column="2">
<c:BButton Style="{StaticResource LinkButton}" Content="修改"/>
</Grid>-->
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<ListBox Name="listbox_orerSku"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="62"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="48" DecodePixelWidth="48"
VerticalAlignment="Top" Margin="14,10,0,10"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="8,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuName,Mode=TwoWay}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="任务ID:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<ListBox Grid.Column="1" Name="listbox_skuCount"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Grid.Column="1" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WareHourseCount}"/>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="2">
<c:BButton Style="{StaticResource LinkButton}" Content="设置" Command="{Binding DataContext.SetFallWareConfiguredCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"/>
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<Grid Grid.Column="3" >
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" Margin="0 0 2 0"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4" Margin="0 0 1 0"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="13"/>-->
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

26
BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// FallWareWaitConfigureControl.xaml 的交互逻辑
/// </summary>
public partial class FallWareWaitConfigureControl : UserControl
{
public FallWareWaitConfigureControl()
{
InitializeComponent();
}
}
}

105
BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml

@ -0,0 +1,105 @@
<c:BWindow x:Class="BBWY.Client.Views.FallWare.SetCloudWareBoxWindow"
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.FallWare"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="450" Height="330"
RightButtonGroupMargin="0,5,5,0">
<!--CloseButtonColor="{StaticResource WindowButtonColor}" -->
<c:BWindow.Resources>
<ResourceDictionary>
<Style x:Key="middleTextBox" TargetType="TextBox">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Margin" Value="1"/>
</Style>
</ResourceDictionary>
</c:BWindow.Resources>
<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="云仓箱唛" FontSize="16" HorizontalAlignment="Left" Margin="10 0 0 0" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" Margin="1 0 1 1" Name="jd_box">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" VerticalAlignment="Top" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="1" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="2" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="3" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="4" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="5" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="6" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="0" HorizontalAlignment="Left" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="0" HorizontalAlignment="Right" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="3" HorizontalAlignment="Right" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Right" Grid.RowSpan="1"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="2" Grid.Row="6" HorizontalAlignment="Right" Grid.RowSpan="1"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="供应商名称"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ShopName}" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="CLPS采购单号" Grid.Row="1"/>
<TextBox Style="{StaticResource middleTextBox}" Text="{Binding PurchaseOrder ,Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="目的城市-仓库" Grid.Row="2"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WareName}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="箱数" Grid.Row="3"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1" >
<TextBlock Style="{StaticResource middleTextBlock}" Text="1/"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding BoxCount,Mode=TwoWay}" />
</StackPanel>
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品数量" Grid.Row="3" Grid.Column="2"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ProductCount}" Grid.Row="3" Grid.Column="3" />
</Grid>
<c:BButton Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
Name="btn_save" />
</Grid>
</c:BWindow>

72
BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs

@ -0,0 +1,72 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.FallWare;
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
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;
using WebSocketSharp;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// SetCloudWareBoxWindow.xaml 的交互逻辑
/// </summary>
public partial class SetCloudWareBoxWindow : BWindow
{
public SetCloudWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true)
{
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;
}
}
public JDWareBoxModel JDWareBoxModel { get; set; }
private SealBoxService SealBoxService { get; set; }
private Action ReflashWindow { get; set; }
private WareType WareType { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
{
MessageBox.Show("采购单号不能为空");
return;
}
if (JDWareBoxModel.PrewOrder.IsNullOrEmpty() && WareType == WareType.)
{
MessageBox.Show("预约单号不能为空");
return;
}
var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo);
if (res != null && res.Success)
{
if (ReflashWindow != null) ReflashWindow();
this.Close();
return;
}
if (res != null) MessageBox.Show(res.Msg);
}
}
}

113
BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml

@ -0,0 +1,113 @@
<c:BWindow x:Class="BBWY.Client.Views.FallWare.SetJDWareBoxWindow"
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.FallWare"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="450" Height="500"
RightButtonGroupMargin="0,5,5,0">
<!--CloseButtonColor="{StaticResource WindowButtonColor}" -->
<c:BWindow.Resources>
<ResourceDictionary>
<Style x:Key="middleTextBox" TargetType="TextBox">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Margin" Value="1"/>
</Style>
</ResourceDictionary>
</c:BWindow.Resources>
<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="京仓箱唛" FontSize="16" HorizontalAlignment="Left" Margin="10 0 0 0" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" Margin="1 0 1 1" Name="jd_box">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" VerticalAlignment="Top" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="1" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="2" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="3" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="4" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="5" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="6" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="0" HorizontalAlignment="Left" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="0" HorizontalAlignment="Right" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="3" HorizontalAlignment="Right" Grid.RowSpan="7"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Right" Grid.RowSpan="1"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="2" Grid.Row="6" HorizontalAlignment="Right" Grid.RowSpan="1"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="供应商名称"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ShopName}" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="采购单号" Grid.Row="1"/>
<TextBox Style="{StaticResource middleTextBox}" Text="{Binding PurchaseOrder ,Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="预约单号" Grid.Row="2"/>
<TextBox Style="{StaticResource middleTextBox}" Text="{Binding PrewOrder,Mode=TwoWay}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="运单号" Grid.Row="3"/>
<TextBox Style="{StaticResource middleTextBox}" Text="{Binding WaybillNo,Mode=TwoWay}" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="目的城市-仓库" Grid.Row="4"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WareName}" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品名称" Grid.Row="5"/>
<TextBox Style="{StaticResource middleTextBox}" Text="{Binding ProductTitle,Mode=TwoWay}" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="箱数" Grid.Row="6"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="6" Grid.Column="1" >
<TextBlock Style="{StaticResource middleTextBlock}" Text="1/"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding BoxCount,Mode=TwoWay}" />
</StackPanel>
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品数量" Grid.Row="6" Grid.Column="2"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ProductCount}" Grid.Row="6" Grid.Column="3" />
</Grid>
<c:BButton Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
Name="btn_save" />
</Grid>
</c:BWindow>

75
BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs

@ -0,0 +1,75 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models;
using BBWY.Client.Models.FallWare;
using BBWY.Controls;
using System;
using System.Collections.Generic;
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;
using WebSocketSharp;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// SetJDWareBoxWindow.xaml 的交互逻辑
/// </summary>
public partial class SetJDWareBoxWindow : BWindow
{
public SetJDWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService,WareType wareType, Action reflashWindow,bool isEnabled = true)
{
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;
}
}
public JDWareBoxModel JDWareBoxModel { get; set; }
private SealBoxService SealBoxService { get; set; }
private Action ReflashWindow { get; set; }
private WareType WareType { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
{
MessageBox.Show("采购单号不能为空");
return;
}
if (JDWareBoxModel.PrewOrder.IsNullOrEmpty()&& WareType== WareType.)
{
MessageBox.Show("预约单号不能为空");
return;
}
var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle,JDWareBoxModel.PurchaseOrder,JDWareBoxModel.PrewOrder,JDWareBoxModel.WaybillNo);
if (res!=null&&res.Success)
{
if (ReflashWindow != null) ReflashWindow();
this.Close();
return;
}
if (res != null) MessageBox.Show(res.Msg);
}
}
}

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

@ -0,0 +1,307 @@
<UserControl x:Class="BBWY.Client.Views.PackTask.WaitFallWareControl"
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"
mc:Ignorable="d" Background="white"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding WareHouseList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="落仓材料" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
</Grid>
</Border>
<!--ItemsSource="{Binding OrderList}"-->
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding WaitFallWareList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="100">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition MinHeight="90"/>
</Grid.RowDefinitions>
<Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.ColumnSpan="11">
<TextBlock Text="店铺:" Style="{StaticResource middleTextBlock}" Margin="10 0 0 0"/>
<c:BButton Content="{Binding ShopName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ShopName}"
Margin=" 5,0,7,0"/>
<TextBlock VerticalAlignment="Center" Text="仓库:" Margin="16,0,0,0" />
<c:BButton Content="{Binding WareName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding WareName}"
Margin=" 5,0,7,0"/>
<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskState}" Foreground="White" Background="{Binding TaskState,Converter={StaticResource objConverter} , ConverterParameter=已完成:#02a7f0:#facd91 }" Margin="5,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="部门:" Margin="14,0,0,0" />
<c:BButton Content="{Binding DepartmentName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding DepartmentName}"
Margin=" 5,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptUserNames}" Margin="5,0,0,0" />
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<ListBox x:Name="listbox_orerSku" ItemsSource="{Binding SealBoxSkus}"
Style="{StaticResource NoScrollViewListBoxStyle}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--{Binding Logo}-->
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="80" DecodePixelWidth="80"
VerticalAlignment="Top" Margin="11,10,0,10"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/>
<Binding Path="Id"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="8,15,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuTitle,Mode=TwoWay}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuTitle}"/>
</TextBlock>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,13,0 0">
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,15,0,10">
<StackPanel Orientation="Horizontal" >
<TextBlock Foreground="{StaticResource Text.Gray}">
<Run Text="货号:" />
</TextBlock>
<c:BButton Content="{Binding ProductNo}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Top"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ProductNo}"
Margin=" 5,0,0,0"/>
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0,13,0,5">
<TextBlock Foreground="{StaticResource Text.Gray}">
<Run Text="任务ID:" />
</TextBlock>
<c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Top"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<ListBox x:Name="listbox_skuCount" ItemsSource="{Binding SealBoxSkus}"
Style="{StaticResource NoScrollViewListBoxStyle}" Grid.Column="1"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid>
<TextBlock x:Name="txt_storeName"
Text="{Binding SkuCount}"
TextWrapping="Wrap"
HorizontalAlignment="Center" VerticalAlignment="Center"
/>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="2" >
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"
>
<TextBlock Style="{StaticResource middleTextBlock}" Text="箱唛:" />
<StackPanel Orientation="Horizontal"
Visibility="{Binding BoxConfigureData,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="查看"
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="未配置"
Visibility="{Binding BoxConfigureData,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
</StackPanel>
</Grid>
<Grid Grid.Column="3" >
</Grid>
<Grid Grid.Column="4" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
Command="{Binding DataContext.CompeteFallWareCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
CommandParameter="{Binding}"
>
</c:BButton>
</StackPanel>
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="13"/>-->
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

26
BBWY.Client/Views/FallWare/WaitFallWareControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// WaitFallWareControl.xaml 的交互逻辑
/// </summary>
public partial class WaitFallWareControl : UserControl
{
public WaitFallWareControl()
{
InitializeComponent();
}
}
}

86
BBWY.Client/Views/FallWare/WareFallWareListControl.xaml

@ -0,0 +1,86 @@
<UserControl x:Class="BBWY.Client.Views.FallWare.WareFallWareListControl"
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.FallWare"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:packtask ="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:fallware="clr-namespace:BBWY.Client.Views.FallWare"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding WareHouseList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" />
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" />
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<RadioButton Content="已配置" Height="35" Width="130" Tag="{Binding FallWareConfiguredCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:True:False}"
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.已配置}"
/>
<RadioButton Content="待配置" Height="35" Width="130" Tag="{Binding FallWareWaitConfigureCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:True:False}"
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.待配置}"
/>
</StackPanel>
<Grid Grid.Row="1"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待落仓:Visible:Collapsed}"
>
<packtask:WaitFallWareControl/>
</Grid>
</Grid>
</UserControl>

26
BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// WareFallWareListControl.xaml 的交互逻辑
/// </summary>
public partial class WareFallWareListControl : UserControl
{
public WareFallWareListControl()
{
InitializeComponent();
}
}
}

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)
{
}
}
}
}

12
BBWY.Client/Views/PackTask/PublishTaskWindow.xaml.cs

@ -1,4 +1,6 @@
using BBWY.Controls;
using BBWY.Client.Models;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Text;
@ -18,9 +20,15 @@ namespace BBWY.Client.Views.PackTask
/// </summary>
public partial class PublishTaskWindow : BWindow
{
public PublishTaskWindow()
public PublishTaskWindow(Action ReflashTask, PackTaskModel model = null)
{
InitializeComponent();
var publicTaskViewModel = (PublishTaskViewModel)this.DataContext;
if (publicTaskViewModel.ReflashWindow == null)
publicTaskViewModel.ReflashWindow = ReflashTask;
publicTaskViewModel.InitData(model);
}
}
}

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

@ -1,17 +1,22 @@
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;
using HandyControl.Controls;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.IO;
using System.Printing;
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;
@ -28,36 +33,46 @@ 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)
{
var localPrintServer = new LocalPrintServer();
string printName = cbPrintName.Text.Trim();
if (string.IsNullOrEmpty(printName))
{
MessageBox.Show("选择打印机");
System.Windows.MessageBox.Show("选择打印机");
return;
}
var printQueue = localPrintServer.GetPrintQueue(printName);
if (printQueue.IsInError)
{
MessageBox.Show("打印机处于错误状态");
System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
this.printArea.Arrange(new Rect(new Point(0, 0), new Size(printArea.ActualWidth, printArea.ActualHeight)));
PrintDialog printDialog = new PrintDialog();
System.Windows.Controls.PrintDialog printDialog = new PrintDialog();
//设置纸张大小
var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
@ -76,7 +91,7 @@ namespace BBWY.Client.Views.PackTask
}
}

1
BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs

@ -94,6 +94,7 @@ namespace BBWY.Client.Views.PackTask
ApplyAge = item.CertificateModel.ApplyAge,
GoodsNumber = item.CertificateModel.GoodsNumber,
ProduceDate = item.CertificateModel.ProduceDate,
SaveType = SaveType.C端,
});
if (resData == null)

283
BBWY.Client/Views/PackTask/TaskList.xaml

@ -7,6 +7,7 @@
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sealbox="clr-namespace:BBWY.Client.Views.SealBox"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
@ -21,7 +22,46 @@
<sys:Int32 x:Key="d7">6</sys:Int32>
<sys:Int32 x:Key="d15">14</sys:Int32>
<sys:Int32 x:Key="d30">29</sys:Int32>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" />
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" />
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
@ -33,12 +73,12 @@
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" Width="1000">
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30">
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30" >
<StackPanel.Resources>
<Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/>
@ -55,213 +95,62 @@
</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}"
<Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="30,0,0,0"
Command="{Binding SearchTaskCommand}" Grid.Column="1"
Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
</Grid>
<StackPanel Grid.Row="1" Grid.RowSpan="1" HorizontalAlignment="Left" Orientation="Horizontal">
<RadioButton Height="35" Width="126" VerticalAlignment="Center" x:Name="qb" IsChecked="True" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.全部}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="全部"/>
</TextBlock>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" x:Name="qb" IsChecked="True" Content="全部" Command="{Binding SetTaskStateCommand}" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.未到货}" Content="未到货" Tag="{Binding NoArrivedCount,Mode=TwoWay}" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.部分到货}" Content="部分到货" Tag="{Binding SomeArrivedCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待质检}" Tag="{Binding ArrivedCount,Mode=TwoWay}" Content="待质检" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待打包}" Content="待打包" Tag="{Binding WaitPackCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待封箱}" Content="待封箱" Tag="{Binding WaitSealBoxCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待落仓}" Content="待落仓" Tag="{Binding WaitFallWareCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待出库}" Content="待完结" Tag="{Binding WaitOutbound,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" Content="已完成" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已取消}" Content="已取消" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已到货}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="已到货"/>
<Run Text="{Binding ArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}" />
</TextBlock>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.部分到货}" >>
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="部分到货"/>
<Run Text="{Binding SomeArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}" />
</TextBlock>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.未到货}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="未到货"/>
<Run Text="{Binding NoArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}" />
</TextBlock>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock Text="已完成" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<Button Content="发布任务" Height="35" Width="120" Margin="30 0 0 0"
Command="{Binding CreateTaskCommand}" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"
/>
<Button Content="发布任务" Width="118" Height="35" VerticalAlignment="Stretch" Margin="50,0,0,0" Command="{Binding CreateTaskCommand}"
Grid.Row="2" HorizontalAlignment="Left" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"
/>
<Border Grid.Row="3" Margin="0,0,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"
/>
<local:TaskListControl x:Name="listbox_task" Grid.Row="2" Margin="0,5,0,0"/>
<c:PageControl PageIndex="{Binding PageIndex}"
<local:TaskListControl x:Name="listbox_task" Grid.Row="2" Margin="0,5,0,0"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱|待落仓:Collapsed:Visible}"
/>
<sealbox:ShopSealBoxListControl Grid.Row="2" Margin="0,5,0,0"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱|待落仓:Visible:Collapsed}"
/>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
Grid.Row="3"

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

@ -8,6 +8,7 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
@ -111,19 +112,21 @@
CommandParameter="{Binding TaskId}"
Margin=" 5,0,7,0"/>
<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskStatus}" Foreground="White" Background="{Binding TaskStatus,Converter={StaticResource objConverter} , ConverterParameter=未完成:#facd91:#02a7f0 }" Margin="5,0,0,0"/>
<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskState}" Foreground="White" Background="{Binding TaskStatus,Converter={StaticResource objConverter} , ConverterParameter=未完成:#facd91:#02a7f0 }" Margin="5,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="部门:" Margin="14,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding DepartmentName}" Margin="5,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" />
</StackPanel>
<StackPanel Grid.Column="11" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<c:BButton Command="{Binding UpdateTaskCommand}"
Style="{StaticResource LinkButton}" Content="修改" />
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding TaskId}"
Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="取消" />
<StackPanel Grid.Column="11" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
>
<!-- Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货:Visible:Collapsed}"-->
<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">
<Grid.ColumnDefinitions>
@ -220,7 +223,7 @@
/>
</StackPanel>
</Grid>
<Grid Grid.Column="2" Background="{Binding Availability,Converter={StaticResource enumToColorConverter} , ConverterParameter={x:Type cmodel:TaskState} }">
<Grid Grid.Column="2" Background="{Binding Availability,Converter={StaticResource enumToColorConverter} , ConverterParameter={x:Type cmodel:Availability} }">
<TextBlock Text="{Binding Availability}"
VerticalAlignment="Center"
TextWrapping="Wrap"
@ -268,7 +271,7 @@
<Run Text="{Binding Increment1}"/>
</TextBlock>
</Grid>
</StackPanel>
</Grid>
@ -291,19 +294,19 @@
<TextBlock Text="条形码:"/>
<c:BButton x:Name="btn_lookBarCode" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding LookBarCommand}" />
<!--<c:BButton x:Name="btn_daCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding PrintBarcodeCommand}"/>-->
</StackPanel>
<StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="合格证:"/>
<c:BButton x:Name="btn_lookCer" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding LookCerCommand}"/>
<!--<c:BButton x:Name="btn_dayinCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding PrintCerCommand}"/>-->
Command="{Binding PrintCerCommand}"/>-->
</StackPanel>
</StackPanel>
@ -353,232 +356,13 @@
ToolTipService.ShowDuration="20000">
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<local:FeesExcelControl IsWareHouse="False" FeesItem="{Binding FeesItemResponse,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
<local:FeesExcelControl FeesItem="{Binding FeesItemResponse,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
/>
<!--<Grid Height="100">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Border Background="#F2F2F2" Grid.RowSpan="2" Grid.ColumnSpan="17"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="13" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="16" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Right" BorderBrush="#D7D7D7" Grid.Column="16" Grid.Row="0" Grid.RowSpan="3" BorderThickness="0,0,1,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="4" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="17" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="15" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="17" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="17" BorderThickness="0,1,0,0"/>
<TextBlock Width="84" TextAlignment="Center" Text="任务ID" Grid.Column="0" Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="增值服务" Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="打包服务" Grid.Column="4" Grid.ColumnSpan="9" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="打包耗材" Grid.Column="13" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Width="101" TextAlignment="Center" Text="总计" Grid.Column="16" Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid Grid.Column="1" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsAcceptGoods,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="收货、卸货" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.AcceptGoods,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="2" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsSendGoods ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="装箱、送货" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.SendGoods,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="3" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsRuturnGoods ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="退货质检" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.RuturnGoods,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="4" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsBasicPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="基础包装费" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1" Text="{Binding FeesItemTypeDTO.BasicPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="5" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsBoxPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="箱子包装" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.BoxPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="6" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsExpressPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="快递袋包装" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.ExpressPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="7" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsExpressCloseSideFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="快递袋封边" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.ExpressCloseSideFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="8" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsAirPaperPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="气泡纸包装" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.AirPaperPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="9" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsAirBagPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="气泡袋包装" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.AirBagPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="10" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsPOPBagPackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="POP袋" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.POPBagPackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="11" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsTapePackFees ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="胶带工序" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.TapePackFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="12" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsIncreateGoods ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="增量配件" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.IncreateGoods,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="13" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsPaperBox ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="{Binding FeesItemTypeDTO.BoxNumber ,Converter={StaticResource intToStringConverter},ConverterParameter=号纸箱}"/>
</TextBlock>
<TextBlock Text="{Binding FeesItemTypeDTO.PaperBox,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="14" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsAirPaper ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="气泡纸" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.AirPaper,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="15" Width="84" Grid.Row="1" Grid.RowSpan="2" Visibility="{Binding FeesItemTypeDTO.IsTape ,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="胶带" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.Tape,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<TextBlock Text="{Binding TaskId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding FeesItemTypeDTO.TotalFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>-->
</ToolTip>
</Path.ToolTip>
</Path>
</StackPanel>
<!--<Grid Grid.Row="1" >
<Border Grid.Row="0" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/>
<c:BButton HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Background="White" Foreground="Black" Grid.Row="1" Content="设置"
Command="{Binding SetServiceCommand}"
Visibility="Visible" />
</Grid>-->
</Grid>
</Grid>
<Grid Grid.Column="11" >

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

@ -30,7 +30,7 @@
<TextBlock Text="提示" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBox Name="tbContent" IsReadOnly="True" AcceptsReturn="True" TextWrapping="Wrap" Grid.Row="1" Margin="10"
Text="请设置合格证内容 请设置合格证内容" BorderBrush="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
Text="请设置合格证内容" BorderBrush="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<!--<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click" />-->

28
BBWY.Client/Views/PackTask/TipsWindow.xaml.cs

@ -20,7 +20,7 @@ namespace BBWY.Client.Views.PackTask
public partial class TipsWindow : BWindow
{
private DispatcherTimer timer;
public TipsWindow(string Content,int waitTime=2)
public TipsWindow(string Content, int waitTime =3)
{
InitializeComponent();
tbContent.Text = Content;
@ -31,16 +31,38 @@ namespace BBWY.Client.Views.PackTask
timer.Tick += OnTimerTick;
timer.Start();
this.Closed += TipsWindow_Closed;
}
private void TipsWindow_Closed(object sender, EventArgs e)
{
IsClosed = true;
}
private bool IsClosed;
private void OnTimerTick(object sender, EventArgs e)
{
timer.Stop();
Close();
CloseWindow();
}
object closeWindow = new object();
private void CloseWindow()
{
if (IsClosed)
return;
lock (closeWindow)
{
if (!IsClosed)
Close();
}
}
private void BButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
CloseWindow();
}
}
}

33
BBWY.Client/Views/PackTask/WareHouseList.xaml

@ -4,6 +4,7 @@
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:fallware="clr-namespace:BBWY.Client.Views.FallWare"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
@ -142,24 +143,26 @@
<RadioButton Height="35" Width="126" VerticalAlignment="Center" x:Name="qb" IsChecked="True" Content="全部" Command="{Binding SetTaskStateCommand}" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.未到货}" Content="未到货" Tag="{Binding NoArrivedCount,Mode=TwoWay}" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.未到货}" Content="未到货" Tag="{Binding NoArrivedCount,Mode=TwoWay}" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.部分到货}" Content="部分到货" Tag="{Binding SomeArrivedCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.部分到货}" Content="部分到货" Tag="{Binding SomeArrivedCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.待质检}" Tag="{Binding ArrivedCount,Mode=TwoWay}" Content="待质检" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待质检}" Tag="{Binding ArrivedCount,Mode=TwoWay}" Content="待质检" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.待打包}" Content="待打包" Tag="{Binding WaitPackCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待打包}" Content="待打包" Tag="{Binding WaitPackCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.待封箱}" Content="待封箱" Tag="{Binding WaitSealBox,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待封箱}" Content="待封箱" Tag="{Binding WaitSealBoxCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.待出库}" Content="待出库" Tag="{Binding WaitOutbound,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待落仓}" Content="待落仓" Tag="{Binding WaitFallWareCount,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.已完成}" Content="已完成" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待出库}" Content="待出库" Tag="{Binding WaitOutbound,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:PackTaskState.已取消}" Content="已取消" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" Content="已完成" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已取消}" Content="已取消" />
@ -167,16 +170,20 @@
</StackPanel>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/>
<Border Grid.Row="3" Margin="0,0,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"
/>
<Grid Grid.Row="2" Margin="0,5,0,0">
<local:WareHouseListControl Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱:Collapsed:Visible}" x:Name="listbox_task" />
<fallware:WareFallWareListControl Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待落仓:Visible:Collapsed}" />
<local:WareHouseListControl Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱|待落仓:Collapsed:Visible}" />
<local:WaitSealBoxControl Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱:Visible:Collapsed}" />
</Grid>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
<c:PageControl PageIndex="{Binding PageIndex,Mode=TwoWay}"
PageSize="{Binding PageSize,Mode=TwoWay}"
RecordCount="{Binding OrderCount,Mode=TwoWay}"
Grid.Row="3"
HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers>

2
BBWY.Client/Views/PackTask/WareHouseList.xaml.cs

@ -236,7 +236,7 @@ namespace BBWY.Client.Views.PackTask
}
}
if (tipBoxShop!=null)
tipBoxShop.Visibility = Visibility.Visible;
}
catch (Exception)

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

@ -230,7 +230,7 @@
/>
</StackPanel>
</Grid>
<Grid Grid.Column="2" Background="{Binding Availability,Converter={StaticResource enumToColorConverter} , ConverterParameter={x:Type cmodel:TaskState} }">
<Grid Grid.Column="2" Background="{Binding Availability,Converter={StaticResource enumToColorConverter} , ConverterParameter={x:Type cmodel:Availability} }">
<TextBlock Text="{Binding Availability}"
VerticalAlignment="Center"
TextWrapping="Wrap"
@ -423,10 +423,11 @@
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
CommandParameter="{Binding}"
Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}"
>
<b:Interaction.Triggers>
<!--<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
@ -437,7 +438,7 @@
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</b:Interaction.Triggers>-->
</c:BButton>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"

11
BBWY.Client/Views/QualityTask/QualityWindow.xaml

@ -228,17 +228,6 @@
Height="150" Width="150" Stretch="Fill"
VerticalAlignment="Top" Margin="20 0 0 0"
Cursor="Hand">
<!--<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>-->
</c:BAsyncImage>
<DockPanel VerticalAlignment="Top" Width="190" Height="150">

12
BBWY.Client/Views/QualityTask/QualityWindow.xaml.cs

@ -1,5 +1,7 @@
using BBWY.Controls;
using BBWY.Client.Models;
using BBWY.Client.ViewModels;
using BBWY.Controls;
using System;
namespace BBWY.Client.Views.QualityTask
{
@ -8,9 +10,13 @@ namespace BBWY.Client.Views.QualityTask
/// </summary>
public partial class QualityWindow : BWindow
{
public QualityWindow()
public QualityWindow(PackTaskModel model,Action ReflashTask)
{
InitializeComponent();
var qualityViewModel =(QualityViewModel)this.DataContext;
if (qualityViewModel.ReflashWindow == null)
qualityViewModel.ReflashWindow = ReflashTask;
qualityViewModel.SearchSku(model);
}
}
}

202
BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml

@ -0,0 +1,202 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.SealBoxConfigureWindow"
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.SealBox"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
Title="PackSkuConfigWindow" Height="500" Width="1024"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Style="{StaticResource bwstyle}"
DataContext="{Binding SealBoxConfigureVModel,Source={StaticResource Locator}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="封箱配置" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ListBox x:Name="listbox"
ItemsSource="{Binding SealBoxConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,0,0,0"
Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox,Converter={StaticResource widthConverter},ConverterParameter=3}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="170"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--{Binding Logo}-->
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="150" DecodePixelWidth="150"
VerticalAlignment="Top" Margin="10 10 10 10"
Cursor="Hand"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0">
<Run Text="SKU:"/>
<Run Text="{Binding SkuId}"/>
</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0">
<Run Text="任务ID:"/>
<Run Text="{Binding TaskId}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock VerticalAlignment="Center" Grid.Column="1" Margin="30,10,0,0">
<Run Text="采购数量:"/>
<Run Text="{Binding SkuCount}"/>
</TextBlock>
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="30,5,0,0">
<TextBlock Text="份数:" VerticalAlignment="Center"/>
<c:BTextBox Text="{Binding SplitCount}" Width="40" Margin="5,0" Height="25"/>
<c:BButton Command="{Binding DataContext.SetSplitCountCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding }"
Content="设置"
Style="{StaticResource LinkButton}"/>
</StackPanel>
</StackPanel>
</StackPanel>
<Grid Grid.Row="2" Grid.ColumnSpan="2"
Visibility="{Binding WareHourseDatas.Count,ConverterParameter=0:Collapsed:Visible,Converter={StaticResource objConverter}}"
>
<!--<ListBox Grid.Row="2" Grid.ColumnSpan="2" Name="listbox_ware"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderThickness="1,1,0,1"
BorderBrush="{StaticResource Border.Brush}"
ItemsSource="{Binding WareHourseDatas}"
Width="Auto"
Margin="10,0,0,10"
HorizontalAlignment="Left" Height="92"
Visibility="{Binding DataContext.SealBoxId,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type c:BWindow}},ConverterParameter=0:Visible:Collapsed,Converter={StaticResource objConverter}}"
>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="auto" Height="90" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Index,StringFormat=第\{0\}份}" Style="{StaticResource middleTextBlock}"/>
<c:BButton MinWidth="100" Content="设置" Style="{StaticResource LinkButton}" Grid.Row="1"
Command="{Binding DataContext.SetPackCountAndStoreCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"
CommandParameter="{Binding}"/>
<TextBlock Grid.Row="2" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 ">
<Run Text="{Binding WareName}"/>
<Run Text="{Binding Count,StringFormat= \{0\}件}"/>
</TextBlock>
<Border Width="1" Grid.RowSpan="3" HorizontalAlignment="Right"
Background="{StaticResource Border.Brush}"/>
<Border Height="1" Background="{StaticResource Border.Brush}"
VerticalAlignment="Bottom"/>
<Border Height="1" Background="{StaticResource Border.Brush}"
VerticalAlignment="Bottom" Grid.Row="1"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>-->
<ListBox Grid.Row="2" Grid.ColumnSpan="2"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderThickness="1,1,0,1"
BorderBrush="{StaticResource Border.Brush}"
ItemsSource="{Binding WareHourseDatas}"
Width="Auto"
Margin="10,0,0,10"
HorizontalAlignment="Left" Height="122" >
<!--Visibility="{Binding DataContext.SealBoxId,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type c:BWindow}},Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"-->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="auto" Height="120" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Index,StringFormat=第\{0\}份}" Style="{StaticResource middleTextBlock}"/>
<TextBlock Grid.Row="1" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 ">
<Run Text="{Binding Count,StringFormat=\{0\}件}"/>
</TextBlock>
<TextBlock Grid.Row="2" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 ">
<Run Text="{Binding WareName}"/>
</TextBlock>
<c:BButton MinWidth="100" Content="{Binding Count,Converter={StaticResource objConverter},ConverterParameter=0:设置:修改}" Style="{StaticResource LinkButton}" Grid.Row="3"
Command="{Binding DataContext.SetPackCountAndStoreCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"
CommandParameter="{Binding}"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=#null|待封箱:True:False}"
/>
<Border Width="1" Grid.RowSpan="4" HorizontalAlignment="Right"
Background="{StaticResource Border.Brush}"/>
<Border Height="1" Background="{StaticResource Border.Brush}"
VerticalAlignment="Bottom"/>
<Border Height="1" Background="{StaticResource Border.Brush}"
VerticalAlignment="Bottom" Grid.Row="1"/>
<Border Height="1" Background="{StaticResource Border.Brush}"
VerticalAlignment="Bottom" Grid.Row="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
<Border Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
<c:BButton Content="{Binding SealBoxId,Converter={StaticResource objConverter},ConverterParameter=0:提交任务:保存}" Width="80" HorizontalAlignment="Right" Grid.Row="2"
Command="{Binding SaveCommand}" Margin="0,0,5,0"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}"
/>
</Grid>
</c:BWindow>

44
BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs

@ -0,0 +1,44 @@
using BBWY.Client.Models;
using BBWY.Client.Models.SealBox;
using BBWY.Client.ViewModels.SealBox;
using BBWY.Controls;
using System;
using System.Collections.Generic;
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.SealBox
{
/// <summary>
/// SealBoxConfigureWindow.xaml 的交互逻辑
/// </summary>
public partial class SealBoxConfigureWindow : BWindow
{
public SealBoxConfigureWindow(IList<SealBoxConfigureModel> sealBoxWaitConfigureModels, Action ReflashWindow, long sealboxId=0)
{
InitializeComponent();
var sealBoxConfigureViewModel = (SealBoxConfigureViewModel)this.DataContext;
sealBoxConfigureViewModel.SealBoxId = sealboxId;
sealBoxConfigureViewModel.SealBoxConfigureModelList = new System.Collections.ObjectModel.ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureViewModel.ReflashWindow = ReflashWindow;
foreach (var sealBoxWaitConfigureModel in sealBoxWaitConfigureModels)
{
sealBoxWaitConfigureModel.Logo= sealBoxWaitConfigureModel.Logo.Replace("80x80", "150x150");
App.Current.Dispatcher.Invoke(new Action(() =>
{
sealBoxConfigureViewModel.SealBoxConfigureModelList.Add(sealBoxWaitConfigureModel);
}));
}
}
}
}

240
BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml

@ -0,0 +1,240 @@
<UserControl x:Class="BBWY.Client.Views.SealBox.SealBoxConfiguredControl"
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.SealBox"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="任务信息" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>-->
<TextBlock Text="封箱数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
<!--<Border Height="1" VerticalAlignment="Top" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>-->
</Grid>
</Border>
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding SealBoxConfiguredList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="68">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition MinHeight="68"/>
</Grid.RowDefinitions>
<Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" >
<TextBlock VerticalAlignment="Center" Text="仓库:" Margin="16,0,0,0" />
<c:BButton Content="{Binding WareName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding WareName}"
Margin=" 5,0,7,0"/>
</StackPanel>
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding SealBoxTotalCount}"/>
</Grid>
<!--<Grid Grid.Column="2">
<c:BButton Style="{StaticResource LinkButton}" Content="修改"/>
</Grid>-->
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<ListBox Name="listbox_orerSku"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="62"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="48" DecodePixelWidth="48"
VerticalAlignment="Top" Margin="14,10,0,10"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="8,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuName,Mode=TwoWay}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="任务ID:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<ListBox Grid.Column="1" Name="listbox_skuCount"
ItemsSource="{Binding SealBoxConfigureTasks}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,0,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid MinHeight="68" Grid.Column="1" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid Grid.Column="1">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WareHourseCount}"/>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="2">
<c:BButton Style="{StaticResource LinkButton}" Content="修改" Command="{Binding DataContext.UpdateSealBoxConfiguredCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"/>
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<Grid Grid.Column="3" >
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" Margin="0 0 2 0"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4" Margin="0 0 1 0"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="13"/>-->
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

26
BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.SealBox
{
/// <summary>
/// SealBoxConfiguredControl.xaml 的交互逻辑
/// </summary>
public partial class SealBoxConfiguredControl : UserControl
{
public SealBoxConfiguredControl()
{
InitializeComponent();
}
}
}

234
BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml

@ -0,0 +1,234 @@
<UserControl x:Class="BBWY.Client.Views.SealBox.SealBoxWaitConfigureControl"
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.SealBox"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="300"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="任务信息" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="封箱数量" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>-->
<TextBlock Text=" " Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="操作" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>-->
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
<!--<Border Height="1" VerticalAlignment="Top" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>-->
</Grid>
</Border>
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding SealBoxWaitConfigureList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="68">
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="300"/>
<ColumnDefinition MinWidth="80"/>
</Grid.ColumnDefinitions>
<Grid MinHeight="68" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="62"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="48" DecodePixelWidth="48"
VerticalAlignment="Top" Margin="14,10,0,10"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="8,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuName,Mode=TwoWay}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,10,0,10">
<StackPanel Orientation="Horizontal" >
<TextBlock Foreground="{StaticResource Text.Gray}">
<Run Text="数量:" />
<Run Text="{Binding SkuCount}"/>
</TextBlock>
<!--<c:BButton Content="{Binding ProductNo}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Top"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ProductNo}"
Margin=" 5,0,0,0"/>-->
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<Grid MinHeight="68" Grid.Column="1" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="10 10 0 13">
<TextBlock Text="任务ID:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="40 0 0 0">
<Run Text="状态:"/>
<Run Text="{Binding TaskState}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10 0 0 13">
<TextBlock Style="{StaticResource middleTextBlock}">
<Run Text="预计完成时间:"/>
<Run Text="{Binding PreCompletedTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
</TextBlock>
</StackPanel>
</StackPanel>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
<!--<Grid Grid.Column="2" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="设置"
Command="{Binding DataContext.SetSealBoxCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
CommandParameter="{Binding}"
>
</c:BButton>
</StackPanel>
</Grid>-->
<Grid Grid.Column="2" >
</Grid>
<!--<Grid Grid.Column="3" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
Command="{Binding DataContext.CompeteSealBoxCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
CommandParameter="{Binding}"
>
</c:BButton>
-->
<!-- Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}" -->
<!--
</StackPanel>
</Grid>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" Margin="0 0 2 0"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4" Margin="0 0 1 0"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="13"/>-->
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

26
BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.SealBox
{
/// <summary>
/// SealBoxNoConfigureControl.xaml 的交互逻辑
/// </summary>
public partial class SealBoxWaitConfigureControl : UserControl
{
public SealBoxWaitConfigureControl()
{
InitializeComponent();
}
}
}

54
BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml

@ -0,0 +1,54 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.SetSealBoxWindow"
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.SealBox"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="378" Height="219"
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">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" Margin="0 41 0 0">
<TextBlock Text="封箱数:" Style="{StaticResource middleTextBlock}"/>
<TextBox x:Name="tbSealBoxCount" Width="200" VerticalContentAlignment="Center"
Height="25"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0" Visibility="Collapsed">
<TextBlock Style="{StaticResource middleTextBlock}" Text="打印机:" />
<ComboBox x:Name="cbPrint" Width="200" Height="25" VerticalContentAlignment="Center"/>
</StackPanel >
</StackPanel>
</Grid>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

188
BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs

@ -0,0 +1,188 @@
using BBWY.Client.Extensions;
using BBWY.Client.Helpers;
using BBWY.Client.Models.PackTask;
using BBWY.Controls;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Spire.Xls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing.Printing;
using System.IO;
using System.Printing;
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;
namespace BBWY.Client.Views.SealBox
{
/// <summary>
/// SetSealBoxWindow.xaml 的交互逻辑
/// </summary>
public partial class SetSealBoxWindow : BWindow
{
public SetSealBoxWindow(SealBoxModel sealBoxModel)
{
SealBoxModel = sealBoxModel;
InitializeComponent();
LoadPrints();
}
SealBoxModel SealBoxModel { get; set; }
/// <summary>
/// 获取打印机名称
/// </summary>
private void LoadPrints()
{
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;
//}
cbPrint.Items.Add(name);
}
//if (cbPrint.Items.Count > selectIndex)
//{
// cbPrint.SelectedIndex = selectIndex;
//}
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNamePath = $"{applicationPath}/printSealName.init";
if (File.Exists(printNamePath))
{
cbPrint.Text = File.ReadAllText(printNamePath);
}
}
public Action<int> SendBoxCount { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
int boxCount = 0;
try
{
boxCount = Convert.ToInt32(tbSealBoxCount.Text);
}
catch (Exception)
{
MessageBox.Show("请输入数字!");
return;
}
//string printName = cbPrint.Text;
//var localPrintServer = new LocalPrintServer();
//var printQueue = localPrintServer.GetPrintQueue(printName);
//if (printQueue.IsInError)
//{
// MessageBox.Show("打印机处于错误状态");
// return;
//}
////PrintSealboxModel(printName, boxCount);
//MyPrintHelper.PrintSealBoxData(SealBoxModel, printName, boxCount, 1);
////todo: 打印单子
if (SendBoxCount != null) SendBoxCount(boxCount);
this.Close();
}
private void PrintSealboxModel(string printName, int boxCount, int printCount = 1)
{
//
}
private void PrintSealboxModel1(string printName, int boxCount)
{
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNamePath = $"{applicationPath}/printSealName.init";
if (File.Exists(printNamePath))
{
File.Delete(printNamePath);
}
File.WriteAllText(printNamePath, printName);
var excel = $"{applicationPath}/Resources/ExccelModel/sealbox.xlsx";
var newExccel = $"{applicationPath}/Resources/ExccelModel/newsealbox.xlsx";
if (File.Exists(newExccel))
{
File.Delete(newExccel);
}
FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read);
XSSFWorkbook wb = new XSSFWorkbook(fs);
var sheet = wb.GetSheetAt(0); // 得到第一个sheet
var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行
var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行
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);
sheet2.GetRow(3).GetCell(1).SetCellValue(SealBoxModel.WareName);
StringBuilder sb = new StringBuilder();
int totalCount = 0;
for (int i = 0; i < SealBoxModel.SealBoxSkus.Count; i++)
{
var title = SealBoxModel.SealBoxSkus[i].SkuTitle;
//if (title.Length>5)
//{
// title = title.Substring(0,5);
//}
totalCount += SealBoxModel.SealBoxSkus[i].WareHourseSkuCount;
sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}");
sheet2.GetRow(i + 6).GetCell(2).SetCellValue($"SKU:{SealBoxModel.SealBoxSkus[i].SkuId}");
sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{SealBoxModel.SealBoxSkus[i].WareHourseSkuCount}");
}
sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount);
sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount);
FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite);
wb2.Write(fs1);
fs1.Close();
fs1.Dispose();
//Workbook workbook = new Workbook();
//workbook.loa
//workbook.LoadFromFile(newExccel);
//var print = workbook.PrintDocument;
//print.PrinterSettings.PrinterName = printName;
//print.Print();
//
}
void SpirePrint()
{
}
}
}

104
BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml

@ -0,0 +1,104 @@
<UserControl x:Class="BBWY.Client.Views.SealBox.ShopSealBoxListControl"
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:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox"
xmlns:fallware="clr-namespace:BBWY.Client.Views.FallWare"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1500">
<UserControl.Resources>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" />
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" />
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<RadioButton Content="已配置" Height="35" Width="130" Tag="{Binding SealBoxConfiguredCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:True:False}"
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.已配置}"
/>
<RadioButton Content="待配置" Height="35" Width="130" Tag="{Binding SealBoxWaitConfigureCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:True:False}"
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.待配置}"
/>
<c:BButton Content="配置封箱策略" Width="130" Height="35" Margin="40 0 0 0" Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱:Visible:Collapsed}"
Command="{Binding ConfiguredSealBoxCommand}"
/>
</StackPanel>
<Grid Grid.Row="1"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待封箱:Visible:Collapsed}"
>
<local:SealBoxConfiguredControl
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:Visible:Collapsed}"
/>
<local:SealBoxWaitConfigureControl
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:Visible:Collapsed}"
/>
</Grid>
<Grid Grid.Row="1"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待落仓:Visible:Collapsed}"
>
<fallware:FallWareConfiguredControl
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:Visible:Collapsed}"
/>
<fallware:FallWareWaitConfigureControl
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:Visible:Collapsed}"
/>
</Grid>
</Grid>
</UserControl>

26
BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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;
namespace BBWY.Client.Views.SealBox
{
/// <summary>
/// ShopSealBoxListControl.xaml 的交互逻辑
/// </summary>
public partial class ShopSealBoxListControl : UserControl
{
public ShopSealBoxListControl()
{
InitializeComponent();
}
}
}

104
BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml

@ -0,0 +1,104 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.UpdateSealBoxConfiguredWindow"
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.SealBox"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
Title="修改分箱配置表" Height="500" Width="1024"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Style="{StaticResource bwstyle}"
DataContext="{Binding SealBoxConfigureVModel,Source={StaticResource Locator}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="封箱配置修改" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ListBox x:Name="listbox"
ItemsSource="{Binding SealBoxConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,0,0,0"
Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox,Converter={StaticResource widthConverter},ConverterParameter=3}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="170"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--{Binding Logo}-->
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="150" DecodePixelWidth="150"
VerticalAlignment="Top" Margin="10 10 10 10"
Cursor="Hand"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0">
<Run Text="SKU:"/>
<Run Text="{Binding SkuId}"/>
</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0">
<Run Text="任务ID:"/>
<Run Text="{Binding TaskId}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock VerticalAlignment="Center" Grid.Column="1" Margin="30,10,0,0">
<Run Text="采购数量:"/>
<Run Text="{Binding SkuCount}"/>
</TextBlock>
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="30,5,0,0">
<TextBlock Text="份数:" VerticalAlignment="Center"/>
<c:BTextBox Text="{Binding SplitCount}" Width="40" Margin="5,0" Height="25"/>
<c:BButton Command="{Binding DataContext.SetSplitCountCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding }"
Content="设置"
Style="{StaticResource LinkButton}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<Border Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
<c:BButton Content="保存" Width="80" HorizontalAlignment="Right" Grid.Row="2"
Command="{Binding SaveUpdateCommand}" Margin="0,0,5,0"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}"
/>
</Grid>
</c:BWindow>

26
BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml.cs

@ -0,0 +1,26 @@
using BBWY.Controls;
using System;
using System.Collections.Generic;
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.SealBox
{
/// <summary>
/// UpdateSealBoxConfiguredWindow.xaml 的交互逻辑
/// </summary>
public partial class UpdateSealBoxConfiguredWindow : BWindow
{
public UpdateSealBoxConfiguredWindow()
{
InitializeComponent();
}
}
}

98
BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml → BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml

@ -4,7 +4,7 @@
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"
mc:Ignorable="d"
mc:Ignorable="d" Background="white"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
@ -29,33 +29,42 @@
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0"
Background="#F2F2F2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="封箱数量" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text=" " Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>-->
</Grid>
<!--ItemsSource="{Binding OrderList}"-->
<!--<Border Height="1" VerticalAlignment="Top" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>-->
</Grid>
</Border>
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding WaitSealBoxModels}"
@ -75,6 +84,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
@ -93,7 +103,7 @@
CommandParameter="{Binding WareName}"
Margin=" 5,0,7,0"/>
<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskState}" Foreground="White" Background="{Binding TaskState,Converter={StaticResource objConverter} , ConverterParameter=已完成:#02a7f0:#facd91 }" Margin="5,0,0,0"/>
<!--<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskState}" Foreground="White" Background="{Binding TaskState,Converter={StaticResource objConverter} , ConverterParameter=已完成:#02a7f0:#facd91 }" Margin="5,0,0,0"/>-->
<TextBlock VerticalAlignment="Center" Text="部门:" Margin="14,0,0,0" />
<c:BButton Content="{Binding DepartmentName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
@ -110,6 +120,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
@ -137,8 +148,7 @@
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/>
<Binding Path="Id"/>
<Binding Path="SkuId"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
@ -191,6 +201,10 @@
CommandParameter="{Binding TaskId}"
Margin=" 5,0,0,0"/>
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,10,0 0">
<Run Text="任务状态:"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待质检|待打包:Red:black}" Text="{Binding TaskState}"/>
</TextBlock>
</StackPanel>
@ -211,7 +225,7 @@
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid>
<TextBlock x:Name="txt_storeName"
Text="{Binding SkuCount}"
Text="{Binding WareHourseSkuCount}"
TextWrapping="Wrap"
HorizontalAlignment="Center" VerticalAlignment="Center"
/>
@ -223,24 +237,41 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="2" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="设置"
Command="{Binding DataContext.SetSealBoxCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
CommandParameter="{Binding}"
>
</c:BButton>
</StackPanel>
</Grid>
<Grid Grid.Column="3" >
</Grid>
<Grid Grid.Column="3" >
<Grid Grid.Column="4" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
Command="{Binding DataContext.CompeteSealBoxCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
CommandParameter="{Binding}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}"
>
</c:BButton>
<!-- Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}" -->
</StackPanel>
@ -248,8 +279,9 @@
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" Margin="0 0 2 0"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4" Margin="0 0 1 0"/>
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>-->
<!--<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>

0
BBWY.Client/Views/PackTask/WaitSealBoxControl.xaml.cs → BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml.cs

23
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -3,6 +3,7 @@ using BBWY.Common.Models;
using BBWY.Server.Model;
using BBWY.Server.Model.Dto;
using Jd.ACES;
using Jd.ACES.Common;
using Jd.Api;
using Jd.Api.Request;
using Jd.Api.Response;
@ -1419,5 +1420,27 @@ namespace BBWY.Server.Business
return res.Json["jingdong_asc_freight_view_responce"]["result"]["data"];
}
public override JToken GetJDInStorePurchaseOrderDetail(GetJDInStorePurchaseOrderDetailRequest request)
{
var jdClient = GetJdClient(request.AppKey, request.AppSecret);
var req = new EclpPoQueryPoOrderRequest();
req.poOrderNo = request.PoOrderNo;
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
if (res.Json == null)
res.Json = JObject.Parse(res.Body);
return res.Json;
}
public override JToken GetJDSupplierDetail(GetJDSupplierDetailRequest request)
{
var jdClient = GetJdClient(request.AppKey, request.AppSecret);
var req = new EclpMasterQuerySupplierRequest();
req.deptNo = request.DeptNo;
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
if (res.Json == null)
res.Json = JObject.Parse(res.Body);
return res.Json;
}
}
}

21
BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs

@ -213,6 +213,25 @@ namespace BBWY.Server.Business
throw new NotImplementedException();
}
/// <summary>
/// 获取京东入库采购单详情
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public virtual JToken GetJDInStorePurchaseOrderDetail(GetJDInStorePurchaseOrderDetailRequest request)
{
throw new NotImplementedException();
}
/// <summary>
/// 获取京东供应商信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public virtual JToken GetJDSupplierDetail(GetJDSupplierDetailRequest request)
{
throw new NotImplementedException();
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save