Browse Source

添加商家封箱

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
0ac78b4cf2
  1. 4
      BBWY.Client/APIServices/LogisticsService.cs
  2. 141
      BBWY.Client/APIServices/SealBoxService.cs
  3. 4
      BBWY.Client/App.xaml.cs
  4. 4
      BBWY.Client/Helpers/MyPrintHelper.cs
  5. 39
      BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs
  6. 61
      BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs
  7. 88
      BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs
  8. 17
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs
  9. 18
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs
  10. 16
      BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs
  11. 12
      BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs
  12. 9
      BBWY.Client/Models/Enums.cs
  13. 11
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  14. 7
      BBWY.Client/Models/PackTask/SealBoxModel.cs
  15. 78
      BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs
  16. 62
      BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs
  17. 39
      BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs
  18. 43
      BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs
  19. 2
      BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs
  20. 404
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  21. 61
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  22. 2
      BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs
  23. 304
      BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs
  24. 26
      BBWY.Client/ViewModels/ViewModelLocator.cs
  25. 13
      BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs
  26. 12
      BBWY.Client/Views/PackTask/PublishTaskWindow.xaml.cs
  27. 41
      BBWY.Client/Views/PackTask/TaskList.xaml
  28. 27
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  29. 6
      BBWY.Client/Views/PackTask/WareHouseList.xaml
  30. 202
      BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml
  31. 44
      BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs
  32. 232
      BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml
  33. 233
      BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml
  34. 6
      BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml
  35. 4
      BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs
  36. 89
      BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml
  37. 26
      BBWY.Client/Views/SealBox/ShopSealBoxListControl.xaml.cs
  38. 105
      BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml
  39. 26
      BBWY.Client/Views/SealBox/UpdateSealBoxConfiguredWindow.xaml.cs
  40. 2
      BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml

4
BBWY.Client/APIServices/LogisticsService.cs

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

141
BBWY.Client/APIServices/SealBoxService.cs

@ -0,0 +1,141 @@
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(string SkuId, string TaskId, string shopId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null)
{
return SendRequest<SealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxConfiguredList",
new
{
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> SearchWaitFallWareList(string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchWaitFallWareResponse>(globalContext.QKApiHost, $"api/SealBox/SearchWaitFallWareList",
new
{
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize
}
, null, HttpMethod.Post);
}
}
}

4
BBWY.Client/App.xaml.cs

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

4
BBWY.Client/Helpers/MyPrintHelper.cs

@ -696,10 +696,10 @@ namespace BBWY.Client.Helpers
//{ //{
// title = title.Substring(0,5); // title = title.Substring(0,5);
//} //}
totalCount += sealBoxModel.SealBoxSkus[i].SkuCount; totalCount += sealBoxModel.SealBoxSkus[i].WareHourseSkuCount;
sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}"); 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(2).SetCellValue($"SKU:{sealBoxModel.SealBoxSkus[i].SkuId}");
sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].SkuCount}"); sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].WareHourseSkuCount}");
} }
sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount); sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount);

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

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

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

@ -0,0 +1,88 @@
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
{
/// <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; }
}
}

9
BBWY.Client/Models/Enums.cs

@ -484,4 +484,13 @@
{ {
, , , ,
} }
/// <summary>
/// 封箱配置状态
/// </summary>
public enum SealBoxConfigureType
{
=0,
=1
}
} }

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

@ -54,20 +54,15 @@ namespace BBWY.Client.Models
private void UpdateTask() private void UpdateTask()
{ {
ViewModelLocator viewModel = new ViewModelLocator();
var publicTaskViewModel = viewModel.PublishTask;
if (publicTaskViewModel.ReflashWindow == null)
publicTaskViewModel.ReflashWindow = ReflashTask;
if (!this.OrderId.IsNullOrEmpty()) if (!this.OrderId.IsNullOrEmpty())
{ {
System.Windows.MessageBox.Show("暂不支持修改采购组的任务"); System.Windows.MessageBox.Show("暂不支持修改采购组的任务");
return; return;
} }
publicTaskViewModel.InitData(this);
PublishTaskWindow publish = new PublishTaskWindow(); PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this);
publish.Show(); publish.Show();
//CreatePackTask create = new CreatePackTask(); //CreatePackTask create = new CreatePackTask();

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

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

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

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

@ -0,0 +1,62 @@
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 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; }
///// <summary>
///// 预计完成时间
///// </summary>
//public DateTime? PreCompletedTime { get; set; }
///// <summary>
///// 任务状态
///// </summary>
//public TaskState? TaskState { 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; }
}
}

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

@ -19,7 +19,7 @@ using System.Windows.Input;
namespace BBWY.Client.ViewModels.PackTask namespace BBWY.Client.ViewModels.PackTask
{ {
public class PublishTaskViewModel : BaseVM, IDenpendency public class PublishTaskViewModel : BaseVM
{ {
#region 属性 #region 属性

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

@ -23,6 +23,10 @@ using Newtonsoft.Json;
using BBWY.Client.Models.APIModel.Response.PackTask; using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask; using BBWY.Client.Models.PackTask;
using WebSocketSharp; using WebSocketSharp;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Views.SealBox;
using BBWY.Client.Models.SealBox;
using BBWY.Client.ViewModels.SealBox;
namespace BBWY.Client.ViewModels.PackTask namespace BBWY.Client.ViewModels.PackTask
{ {
@ -36,25 +40,36 @@ namespace BBWY.Client.ViewModels.PackTask
#region 属性绑定 #region 属性绑定
private string sealBoxWaitConfigureCount;
/// <summary>
/// 封箱 待配置数
/// </summary>
public string SealBoxWaitConfigureCount { get => sealBoxWaitConfigureCount; set { Set(ref sealBoxWaitConfigureCount, value); } }
//private SealBoxConfigureType sealBoxConfigureType; private string sealBoxConfiguredCount;
///// <summary> /// <summary>
///// 封箱配置状态 ///封箱 已配置数
///// </summary> /// </summary>
//public SealBoxConfigureType SealBoxConfigureType { get; set; } 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 ObservableCollection<SealBoxWaitConfigureModel> sealBoxWaitConfigureList; private ObservableCollection<SealBoxWaitConfigureModel> sealBoxWaitConfigureList;
///// <summary> /// <summary>
///// 封箱待配置列表 /// 封箱待配置列表
///// </summary> /// </summary>
//public ObservableCollection<SealBoxWaitConfigureModel> SealBoxWaitConfigureList { get => sealBoxWaitConfigureList; set { Set(ref sealBoxWaitConfigureList, value); } } public ObservableCollection<SealBoxWaitConfigureModel> SealBoxWaitConfigureList { get => sealBoxWaitConfigureList; set { Set(ref sealBoxWaitConfigureList, value); } }
//private ObservableCollection<SealBoxConfiguredModel> sealBoxConfiguredList; private ObservableCollection<SealBoxConfiguredModel> sealBoxConfiguredList;
///// <summary> /// <summary>
///// 封箱已配置列表 /// 封箱已配置列表
///// </summary> /// </summary>
//public ObservableCollection<SealBoxConfiguredModel> SealBoxConfiguredList { get => sealBoxConfiguredList; set { Set(ref sealBoxConfiguredList, value); } } public ObservableCollection<SealBoxConfiguredModel> SealBoxConfiguredList { get => sealBoxConfiguredList; set { Set(ref sealBoxConfiguredList, value); } }
/// <summary> /// <summary>
/// 查询时间段 /// 查询时间段
@ -160,7 +175,7 @@ namespace BBWY.Client.ViewModels.PackTask
private readonly SealBoxService sealBoxService;
private readonly PackTaskService packTaskService; private readonly PackTaskService packTaskService;
WorkProcessService workProcessService; WorkProcessService workProcessService;
public int? taskStatus { get; set; } public int? taskStatus { get; set; }
@ -175,7 +190,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.globalContext = globalContext;
this.productService = productService; this.productService = productService;
@ -186,6 +201,14 @@ namespace BBWY.Client.ViewModels.PackTask
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据 PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState); SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState);
SetSealBoxConfigureTypeCommand = new RelayCommand<SealBoxConfigureType>(s =>
{
PageIndex = 1;
SealBoxConfigureType = s;
Task.Factory.StartNew(() => SearchTaskList());
});
CreateTaskCommand = new RelayCommand(CreateTask); CreateTaskCommand = new RelayCommand(CreateTask);
SearchTaskCommand = new RelayCommand(() => SearchTaskCommand = new RelayCommand(() =>
{ {
@ -200,35 +223,91 @@ namespace BBWY.Client.ViewModels.PackTask
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
DeletedTaskCommand = new RelayCommand<object>(DeletedTask); DeletedTaskCommand = new RelayCommand<object>(DeletedTask);
ConfiguredSealBoxCommand = new RelayCommand(ConfiguredSealBox);
UpdateSealBoxConfiguredCommand = new RelayCommand<SealBoxConfiguredModel>(UpdateSealBoxConfigured);
StartTime = DateTime.Now.Date; StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date; EndTime = DateTime.Now.Date;
IsLoading = false; IsLoading = false;
//加载数据 //加载数据
SetTaskState(null); SetTaskState(null);
this.sealBoxService = sealBoxService;
SealBoxConfigureType = SealBoxConfigureType.;
} }
private void UpdateSealBoxConfigured(SealBoxConfiguredModel model)
private void DeletedTask(object obj)
{ {
var packTaskmodel = (PackTaskModel)obj; var sealBoxId = model.SealBoxId;
if (!packTaskmodel.OrderId.IsNullOrEmpty()) var taskIds = model.SealBoxConfigureTasks.Select(s => s.TaskId).ToArray();
var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(sealBoxId, taskIds);
if (updateSealBoxConfig == null)
{ {
System.Windows.MessageBox.Show("暂不支持删除采购组的任务"); MessageBox.Show("网络异常,获取不到带封箱数据");
return;
}
if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null)
{
MessageBox.Show(updateSealBoxConfig.Msg);
return; return;
} }
MessageBoxResult result = MessageBox.Show("确定取消任务?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
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);
if (result != MessageBoxResult.Yes) return; if (result != MessageBoxResult.Yes) return;
packTaskService.DeletedTask(packTaskmodel.TaskId); packTaskService.DeletedTask(packTaskmodel.TaskId);
Task.Factory.StartNew(() => SearchTaskList()); Task.Factory.StartNew(() => SearchTaskList());
@ -265,6 +344,20 @@ namespace BBWY.Client.ViewModels.PackTask
#region 事件绑定 #region 事件绑定
/// <summary>
/// 修改封箱数据
/// </summary>
public ICommand UpdateSealBoxConfiguredCommand { get; set; }
/// <summary>
/// 配置封箱策略
/// </summary>
public ICommand ConfiguredSealBoxCommand { get; set; }
/// <summary>
/// 待配置 /已配置
/// </summary>
public ICommand SetSealBoxConfigureTypeCommand { get; set; }
/// <summary> /// <summary>
/// 筛选数据 /// 筛选数据
/// </summary> /// </summary>
@ -312,7 +405,9 @@ namespace BBWY.Client.ViewModels.PackTask
SearchTaskList(); SearchTaskList();
} }
private List<TaskState> waitSealBoxTaskStates = new List<TaskState> {
Models.TaskState., Models.TaskState.
};//配置封箱的任务状态范围
/// <summary> /// <summary>
/// 搜索任务列表 /// 搜索任务列表
/// </summary> /// </summary>
@ -331,108 +426,187 @@ namespace BBWY.Client.ViewModels.PackTask
} }
IsLoading = true; IsLoading = true;
Task.Factory.StartNew(() =>
{
try if (TaskState == null || !waitSealBoxTaskStates.Contains(TaskState.Value))
Task.Factory.StartNew(() =>
{ {
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.GetTaskList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), try
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{ {
var dataModel = datas.Data; PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
OrderCount = dataModel.TotalCount; var datas = packTaskService.GetTaskList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState),
foreach (var item in dataModel.Items) PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{ {
var dataModel = datas.Data;
var data = new PackTaskModel() OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
{ {
Brand = item.Brand,
SkuId = item.SkuId, var data = new PackTaskModel()
AcceptName = item.UserName, {
Availability = (Availability)item.Availability, Brand = item.Brand,
BasicPack = (BasicPack)item.BasicPack, SkuId = item.SkuId,
DepartmentName = item.DepartmentName, AcceptName = item.UserName,
CertificatePosition = (CertificatePosition)item.CertificatePosition, Availability = (Availability)item.Availability,
GoodsNumber = item.GoodsNumber, BasicPack = (BasicPack)item.BasicPack,
Increment1 = item.Increment1, DepartmentName = item.DepartmentName,
ItemList = new List<SkuMessage>() { new SkuMessage CertificatePosition = (CertificatePosition)item.CertificatePosition,
GoodsNumber = item.GoodsNumber,
Increment1 = item.Increment1,
ItemList = new List<SkuMessage>() { new SkuMessage
{ BrandName = item.BrandName, { BrandName = item.BrandName,
GoodsNo = item.ProductItemNum, Logo= item.Logo, GoodsNo = item.ProductItemNum, Logo= item.Logo,
ShopName = item.ShopName, SkuName = item.SkuName, ShopName = item.ShopName, SkuName = item.SkuName,
Id = item.SkuId Id = item.SkuId
} }, } },
MarkMessage = item.MarkMessage, MarkMessage = item.MarkMessage,
PackType = (PackType)item.PackType, PackType = (PackType)item.PackType,
PositionType = item.PositionType, PositionType = item.PositionType,
SkuCount = item.SkuCount, SkuCount = item.SkuCount,
SkuTitle = item.SkuGoodsTitle, SkuTitle = item.SkuGoodsTitle,
TaskId = item.TaskId, TaskId = item.TaskId,
EndTime = item.CreateTime, EndTime = item.CreateTime,
BrandName = item.BrandName, BrandName = item.BrandName,
OrderId = item.OrderId, OrderId = item.OrderId,
TaskState = item.TaskState, TaskState = item.TaskState,
// IsWorry = (Worry)item.IsWorry, // IsWorry = (Worry)item.IsWorry,
}; };
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{ {
data.BarCodeModel = item.BarCodeDTO; data.BarCodeModel = item.BarCodeDTO;
} }
if (item.Cers != null) if (item.Cers != null)
{ {
data.CertificateModel = item.Cers; data.CertificateModel = item.Cers;
} }
if (item.FeesItemResponse != null) if (item.FeesItemResponse != null)
{ {
data.FeesItemResponse = item.FeesItemResponse; data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees; data.FeesMoney = item.FeesItemResponse.SingleFees;
data.IsShowFees = data.FeesMoney > 0 ? true : false; data.IsShowFees = data.FeesMoney > 0 ? true : false;
data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount; data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount;
data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * 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();
} }
else catch (Exception ex)
{ {
MessageBox.Show("查不到数据"); System.Windows.MessageBox.Show(ex.Message);
} }
IsLoadCount(); IsLoading = false;
});
} if (TaskState != null && waitSealBoxTaskStates.Contains(TaskState.Value))//封箱操作
catch (Exception ex) {
{ if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
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);
}));
}
}
} if (SealBoxConfigureType == SealBoxConfigureType.)
IsLoading = false; {
}); SealBoxConfiguredList = new ObservableCollection<SealBoxConfiguredModel>();
var sealBoxRes = sealBoxService.GetSealBoxConfiguredList(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();
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message);
}
IsLoading = false;
});
if (TaskState == Models.TaskState.)
IsLoading = false;
}
@ -442,22 +616,26 @@ namespace BBWY.Client.ViewModels.PackTask
ProductService productService; ProductService productService;
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>
/// 展示发布任务页面 /// 展示发布任务页面
/// </summary> /// </summary>
public void CreateTask() public void CreateTask()
{ {
ViewModelLocator viewModel = new ViewModelLocator();
var publicTaskViewModel = viewModel.PublishTask;
if (publicTaskViewModel.ReflashWindow == null)
publicTaskViewModel.ReflashWindow = ReflashTask;
publicTaskViewModel.InitData(); PublishTaskWindow publish = new PublishTaskWindow(ReflashTask);
PublishTaskWindow publish = new PublishTaskWindow();
publish.Show(); publish.Show();
} }
@ -490,7 +668,9 @@ namespace BBWY.Client.ViewModels.PackTask
{ {
var paramList = (object[])param; var paramList = (object[])param;
// var orderId = paramList[0].ToString(); // var orderId = paramList[0].ToString();
var skuId = paramList[1].ToString();
var skuId = paramList.Last().ToString();
var url = $"https://item.jd.com/{skuId}.html"; var url = $"https://item.jd.com/{skuId}.html";

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

@ -217,19 +217,16 @@ namespace BBWY.Client.ViewModels.PackTask
#endregion #endregion
private readonly ProductService productService;
private readonly ConsumableService consumableService;
private readonly WorkProcessService workProcessService;
private readonly PackTaskService packTaskService; private readonly PackTaskService packTaskService;
private readonly IncreateServiceService increateServiceService; private readonly SealBoxService sealBoxService;
public GlobalContext globalContext; 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.globalContext = globalContext;
this.sealBoxService = sealBoxService;
this.packTaskService = packTaskService; this.packTaskService = packTaskService;
this.consumableService = consumableService;
//Messenger.Default.Send(globalContext, "AcceptGlobalContext"); //Messenger.Default.Send(globalContext, "AcceptGlobalContext");
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据 PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
@ -247,7 +244,7 @@ namespace BBWY.Client.ViewModels.PackTask
}); });
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
StartTime = DateTime.Now.Date; StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date; EndTime = DateTime.Now.Date;
IsLoading = false; IsLoading = false;
@ -255,10 +252,9 @@ namespace BBWY.Client.ViewModels.PackTask
//加载数据 //加载数据
SetTaskState(null); SetTaskState(null);
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
this.productService = productService;
this.batchPurchaseService = batchPurchaseService;
UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState); UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState);
@ -266,6 +262,7 @@ namespace BBWY.Client.ViewModels.PackTask
SetSealBoxCommand = new RelayCommand<object>(SetSealBox); SetSealBoxCommand = new RelayCommand<object>(SetSealBox);
CompeteFallWareCommand = new RelayCommand<object>(CompeteFallWare); CompeteFallWareCommand = new RelayCommand<object>(CompeteFallWare);
} }
/// <summary> /// <summary>
@ -333,10 +330,13 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand SetSealBoxCommand { get; set; } public ICommand SetSealBoxCommand { get; set; }
BatchPurchaseService batchPurchaseService;
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="obj"></param>
private void CompeteSealBox(object obj) private void CompeteSealBox(object obj)
{ {
var model = (SealBoxModel)obj; var model = (SealBoxModel)obj;
@ -346,19 +346,21 @@ namespace BBWY.Client.ViewModels.PackTask
System.Windows.MessageBox.Show("请先设置封箱数量"); System.Windows.MessageBox.Show("请先设置封箱数量");
return; return;
} }
var res = sealBoxService.WareCompeteSealBox(model.SealBoxId,model.SealBoxCount);
if(res==null)
{
System.Windows. MessageBox.Show("网络异常","");
return;
}
var objList = obj as SealBoxModel;
CompeteSealBox competeSealBox = new CompeteSealBox();
competeSealBox.WareId = objList.WareId; if (!res.Success||!res.Data)
competeSealBox.BoxCount = model.SealBoxCount.Value;
competeSealBox.TaskId = objList.SealBoxSkus.Select(s => s.TaskId).ToArray();
var res = packTaskService.CompeteSealBox(competeSealBox);
if (res != null && res.Success)
{ {
SearchTaskList(); System.Windows.MessageBox.Show(res.Msg);
return;
} }
SearchTaskList();
} }
@ -427,6 +429,7 @@ namespace BBWY.Client.ViewModels.PackTask
} }
public void SetTaskState(TaskState? taskState) public void SetTaskState(TaskState? taskState)
{ {
PageIndex = 1;
TaskState = taskState; TaskState = taskState;
SearchTaskList(); SearchTaskList();
@ -457,7 +460,7 @@ namespace BBWY.Client.ViewModels.PackTask
WaitFallWareList = new ObservableCollection<WaitFallWareModel>(); WaitFallWareList = new ObservableCollection<WaitFallWareModel>();
var datas = packTaskService.SearchWaitFallWareList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); var datas = sealBoxService.SearchWaitFallWareList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success) if (datas != null && datas.Data != null && datas.Success)
{ {
var dataModel = datas.Data; var dataModel = datas.Data;
@ -497,10 +500,12 @@ namespace BBWY.Client.ViewModels.PackTask
else if (TaskState == Models.TaskState.) else if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
WaitSealBoxModels = new ObservableCollection<SealBoxModel>(); 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) if (datas != null && datas.Data != null && datas.Success)
{ {
var dataModel = datas.Data; var dataModel = datas.Data;
@ -511,14 +516,14 @@ namespace BBWY.Client.ViewModels.PackTask
{ {
WaitSealBoxModels.Add(new SealBoxModel WaitSealBoxModels.Add(new SealBoxModel
{ {
AcceptUserName = string.Join("|", item.AcceptUserNames.Select(a => a.UserName)), AcceptUserName = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName, DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus, SealBoxSkus = item.SealBoxSkus,
ShopId = item.ShopId, ShopId = item.ShopId,
ShopName = item.ShopName, ShopName = item.ShopName,
WareId = item.WareId, WareId = item.WareId,
WareName = item.WareName, WareName = item.WareName,
SealBoxId = item.SealBoxId,
}); });
})); }));

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

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

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 BBWY.Client.ViewModels.TotalPackTask;
using GalaSoft.MvvmLight.Ioc; using GalaSoft.MvvmLight.Ioc;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -326,10 +328,26 @@ namespace BBWY.Client.ViewModels
} }
void test() public SealBoxConfigureViewModel SealBoxConfigureVModel
{ {
get
var packuser = (App.Current as App).ServiceProvider.GetRequiredService<PackUserSalaryViewModel>(); {
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.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; //this.cbx_stroeList.ItemsSource = storeList;
//if (Store != null) //if (Store != null)
// this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id); // this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id);

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

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

@ -7,6 +7,7 @@
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models" xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sealbox="clr-namespace:BBWY.Client.Views.SealBox"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding TaskList,Source={StaticResource Locator}}" DataContext="{Binding TaskList,Source={StaticResource Locator}}"
@ -72,12 +73,12 @@
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
<!----> <!---->
</Grid.RowDefinitions> </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> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30"> <StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30" >
<StackPanel.Resources> <StackPanel.Resources>
<Style TargetType="DatePickerTextBox"> <Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/> <Setter Property="IsReadOnly" Value="True"/>
@ -94,12 +95,8 @@
</StackPanel> </StackPanel>
<Grid Grid.Column="1" > <Grid Grid.Column="1" >
<Grid.ColumnDefinitions> <Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="30,0,0,0"
<ColumnDefinition/> Command="{Binding SearchTaskCommand}" Grid.Column="1"
<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.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid> </Grid>
@ -124,7 +121,7 @@
<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 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="待完结" 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="已完成" />
@ -132,14 +129,28 @@
<Button Content="发布任务" Height="35" Width="120" Margin="30 0 0 0"
Command="{Binding CreateTaskCommand}" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"
/>
</StackPanel> </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"
<local:TaskListControl x:Name="listbox_task" Grid.Row="2" Margin="0,5,0,0"/> />
<Border Grid.Row="3" Margin="0,0,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,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}" PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}" RecordCount="{Binding OrderCount}"
Grid.Row="3" Grid.Row="3"

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

@ -8,6 +8,7 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models" xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
DataContext="{Binding TaskList,Source={StaticResource Locator}}" DataContext="{Binding TaskList,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d" mc:Ignorable="d"
@ -118,17 +119,13 @@
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" />
</StackPanel> </StackPanel>
<StackPanel Grid.Column="11" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" <StackPanel Grid.Column="11" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货:Visible:Collapsed}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待质检:Visible:Collapsed}" ><!---->
> <c:BButton Command="{Binding UpdateTaskCommand}" Style="{StaticResource LinkButton}" Content="修改" />
<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}" <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="取消" Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="取消"/>
/>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -273,7 +270,7 @@
<Run Text="{Binding Increment1}"/> <Run Text="{Binding Increment1}"/>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>
@ -296,19 +293,19 @@
<TextBlock Text="条形码:"/> <TextBlock Text="条形码:"/>
<c:BButton x:Name="btn_lookBarCode" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <c:BButton x:Name="btn_lookBarCode" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding LookBarCommand}" /> Command="{Binding LookBarCommand}" />
<!--<c:BButton x:Name="btn_daCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <!--<c:BButton x:Name="btn_daCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding PrintBarcodeCommand}"/>--> Command="{Binding PrintBarcodeCommand}"/>-->
</StackPanel> </StackPanel>
<StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" > <StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="合格证:"/> <TextBlock Text="合格证:"/>
<c:BButton x:Name="btn_lookCer" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <c:BButton x:Name="btn_lookCer" Content="查看" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding LookCerCommand}"/> Command="{Binding LookCerCommand}"/>
<!--<c:BButton x:Name="btn_dayinCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <!--<c:BButton x:Name="btn_dayinCer" Content="打印" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding PrintCerCommand}"/>--> Command="{Binding PrintCerCommand}"/>-->
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>

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

@ -178,9 +178,9 @@
</Grid> </Grid>
<c:PageControl PageIndex="{Binding PageIndex}" <c:PageControl PageIndex="{Binding PageIndex,Mode=TwoWay}"
PageSize="{Binding PageSize}" PageSize="{Binding PageSize,Mode=TwoWay}"
RecordCount="{Binding OrderCount}" RecordCount="{Binding OrderCount,Mode=TwoWay}"
Grid.Row="3" Grid.Row="3"
HorizontalAlignment="Left" Width="450"> HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers> <b:Interaction.Triggers>

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

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

@ -5,8 +5,236 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox" xmlns:local="clr-namespace:BBWY.Client.Views.SealBox"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> 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>
<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> </Grid>
</UserControl> </UserControl>

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

@ -36,15 +36,14 @@
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="300"/>
<ColumnDefinition MinWidth="80"/> <ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/> <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="2" 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}"/> <!--<TextBlock Text="操作" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>-->
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>--> <!--<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}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/> <Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
@ -66,7 +65,7 @@
</Border> </Border>
<ListBox x:Name="listbox_order" <ListBox x:Name="listbox_order"
Grid.Row="7" Grid.Row="7"
ItemsSource="{Binding WaitSealBoxModels}" ItemsSource="{Binding SealBoxWaitConfigureList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}" BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0" BorderThickness="1,1,1,0"
@ -74,165 +73,99 @@
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}" <Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="100"> MinHeight="68">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition MinHeight="90"/>
</Grid.RowDefinitions>
<Grid Background="#F2F2F2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/>
<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"/>
<StackPanel Orientation="Horizontal"
Visibility="Collapsed" >
<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>
<!--<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 AcceptUserName}" Margin="5,0,0,0" />
</StackPanel>
</Grid>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="300"/>
<ColumnDefinition MinWidth="80"/> <ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ListBox x:Name="listbox_orerSku" ItemsSource="{Binding SealBoxSkus}" <Grid MinHeight="68" Width="{Binding ActualWidth,ElementName=listbox_orerSku}">
Style="{StaticResource NoScrollViewListBoxStyle}" <Grid>
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" > <Grid.ColumnDefinitions>
<ListBox.ItemTemplate> <ColumnDefinition Width="62"/>
<DataTemplate> <ColumnDefinition/>
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_orerSku}"> <ColumnDefinition/>
<Grid> </Grid.ColumnDefinitions>
<Grid.ColumnDefinitions> <c:BAsyncImage UrlSource="{Binding Logo}"
<ColumnDefinition Width="90"/> Width="48" DecodePixelWidth="48"
<ColumnDefinition/> VerticalAlignment="Top" Margin="14,10,0,10"
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--{Binding Logo}-->
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="80" DecodePixelWidth="80"
VerticalAlignment="Top" Margin="11,10,0,10"
Cursor="Hand"> Cursor="Hand">
<b:Interaction.Triggers> <b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown"> <b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"> <b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter> <b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}"> <MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="SkuId"/> <Binding Path="SkuId"/>
</MultiBinding> </MultiBinding>
</b:InvokeCommandAction.CommandParameter> </b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction> </b:InvokeCommandAction>
</b:EventTrigger> </b:EventTrigger>
</b:Interaction.Triggers> </b:Interaction.Triggers>
</c:BAsyncImage> </c:BAsyncImage>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="8,15,0,10"> <StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="8,10,0,10">
<StackPanel Orientation="Horizontal" Margin="0 0 0 13"> <StackPanel Orientation="Horizontal" Margin="0 0 0 13">
<TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" /> <TextBlock Text="SKU:" Style="{StaticResource middleTextBlock}" />
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" <c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding SkuId}" CommandParameter="{Binding SkuId}"
Margin=" 5,0,0,0"/> Margin=" 5,0,0,0"/>
</StackPanel> </StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis"> <TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip> <TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> <ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding SkuTitle,Mode=TwoWay}"/> <TextBlock Text="{Binding SkuName,Mode=TwoWay}"/>
</ToolTip> </ToolTip>
</TextBlock.ToolTip> </TextBlock.ToolTip>
<Run Text="SKU名称:"/> <Run Text="SKU名称:"/>
<Run Text="{Binding SkuTitle}"/> <Run Text="{Binding SkuName}"/>
</TextBlock>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,13,0 0">
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock> </TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,10,0,10">
<StackPanel Orientation="Horizontal" >
<TextBlock Foreground="{StaticResource Text.Gray}">
</StackPanel> <Run Text="数量:" />
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="20,15,0,10"> <Run Text="{Binding SkuCount}"/>
<StackPanel Orientation="Horizontal" > </TextBlock>
<TextBlock Foreground="{StaticResource Text.Gray}"> <!--<c:BButton Content="{Binding ProductNo}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Top"
<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}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ProductNo}" CommandParameter="{Binding ProductNo}"
Margin=" 5,0,0,0"/> Margin=" 5,0,0,0"/>-->
</StackPanel> </StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0,13,0,5"> </StackPanel>
<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>
</Grid> <Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</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"/> <Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="0"/>
<ListBox x:Name="listbox_skuCount" ItemsSource="{Binding SealBoxSkus}" <Grid MinHeight="68" Grid.Column="1" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
Style="{StaticResource NoScrollViewListBoxStyle}" Grid.Column="1" <StackPanel Orientation="Vertical">
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" > <StackPanel Orientation="Horizontal" Margin="10 10 0 13">
<ListBox.ItemTemplate> <TextBlock Text="任务ID:" Style="{StaticResource middleTextBlock}" />
<DataTemplate> <c:BButton Content="{Binding TaskId}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left"
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_skuCount}"> Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
<Grid> CommandParameter="{Binding TaskId}"
<TextBlock x:Name="txt_storeName" Margin=" 5,0,0,0"/>
Text="{Binding SkuCount}" <TextBlock Style="{StaticResource middleTextBlock}" Margin="40 0 0 0">
TextWrapping="Wrap" <Run Text="状态:"/>
HorizontalAlignment="Center" VerticalAlignment="Center" <Run Text="{Binding TaskState}"/>
/> </TextBlock>
</Grid>
</StackPanel>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> <StackPanel Orientation="Horizontal" Margin="10 0 0 13">
</Grid> <TextBlock Style="{StaticResource middleTextBlock}">
<Run Text="预计完成时间:"/>
</DataTemplate> <Run Text="{Binding PreCompletedTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
</ListBox.ItemTemplate> </TextBlock>
</ListBox>
</StackPanel>
</StackPanel>
<Border Grid.Row="0" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
@ -256,7 +189,7 @@
</Grid> </Grid>
<Grid Grid.Column="3" > <!--<Grid Grid.Column="3" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
@ -267,11 +200,13 @@
> >
</c:BButton> </c:BButton>
<!-- Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}" --> -->
<!-- Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}" -->
<!--
</StackPanel> </StackPanel>
</Grid> </Grid>-->
<Border Width="1" HorizontalAlignment="Right" 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="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/> <Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>

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

@ -34,12 +34,12 @@
<StackPanel Orientation="Vertical" HorizontalAlignment="Center"> <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" Margin="0 41 0 0"> <StackPanel Orientation="Horizontal" Margin="0 41 0 0">
<TextBlock Text="封箱数:" Style="{StaticResource middleTextBlock}"/> <TextBlock Text="封箱数:" Style="{StaticResource middleTextBlock}"/>
<TextBox x:Name="tbSealBoxCount" Width="200" <TextBox x:Name="tbSealBoxCount" Width="200" VerticalContentAlignment="Center"
Height="25"/> Height="25"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0"> <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
<TextBlock Style="{StaticResource middleTextBlock}" Text="打印机:" /> <TextBlock Style="{StaticResource middleTextBlock}" Text="打印机:" />
<ComboBox x:Name="cbPrint" Width="200" Height="25"/> <ComboBox x:Name="cbPrint" Width="200" Height="25" VerticalContentAlignment="Center"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
@ -47,7 +47,7 @@
</Grid> </Grid>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click" <c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
/> />
</Grid> </Grid>

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

@ -160,10 +160,10 @@ namespace BBWY.Client.Views.SealBox
//{ //{
// title = title.Substring(0,5); // title = title.Substring(0,5);
//} //}
totalCount += SealBoxModel.SealBoxSkus[i].SkuCount; totalCount += SealBoxModel.SealBoxSkus[i].WareHourseSkuCount;
sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}"); 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(2).SetCellValue($"SKU:{SealBoxModel.SealBoxSkus[i].SkuId}");
sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{SealBoxModel.SealBoxSkus[i].SkuCount}"); sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{SealBoxModel.SealBoxSkus[i].WareHourseSkuCount}");
} }
sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount); sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount);

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

@ -0,0 +1,89 @@
<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: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"
Command="{Binding ConfiguredSealBoxCommand}"
/>
</StackPanel>
<Grid Grid.Row="1">
<local:SealBoxConfiguredControl
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:Visible:Collapsed}"
/>
<local:SealBoxWaitConfigureControl
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();
}
}
}

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

@ -0,0 +1,105 @@
<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();
}
}
}

2
BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml

@ -221,7 +221,7 @@
<Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_skuCount}"> <Grid MinHeight="100" Width="{Binding ActualWidth,ElementName=listbox_skuCount}">
<Grid> <Grid>
<TextBlock x:Name="txt_storeName" <TextBlock x:Name="txt_storeName"
Text="{Binding SkuCount}" Text="{Binding WareHourseSkuCount}"
TextWrapping="Wrap" TextWrapping="Wrap"
HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"
/> />

Loading…
Cancel
Save