Browse Source

Merge branch 'master' of http://code.qiyue666.com/pengcong001/bbwy

AddValidOverTime
shanji 2 years ago
parent
commit
57d4eb5b0f
  1. 7
      BBWY.Client/APIServices/QiKu/PackTaskService.cs
  2. 8
      BBWY.Client/APIServices/QiKu/SealBoxService.cs
  3. 2
      BBWY.Client/BBWYAppSettings.json
  4. 2
      BBWY.Client/GlobalContext.cs
  5. 2
      BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
  6. 4
      BBWY.Client/Models/Enums.cs
  7. 90
      BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs
  8. 6
      BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs
  9. 2
      BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs
  10. 4
      BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs
  11. 53
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  12. 74
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  13. 36
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  14. 686
      BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs
  15. 2
      BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs
  16. 4
      BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml
  17. 6
      BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs
  18. 34
      BBWY.Client/Views/PackTask/CerControl.xaml
  19. 2
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml
  20. 4
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs
  21. 19
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  22. 18
      BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml
  23. 19
      BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
  24. 49
      BBWY.Client/Views/SealBox/AddWareListWindow.xaml
  25. 163
      BBWY.Client/Views/SealBox/AddWareListWindow.xaml.cs
  26. 2
      BBWY.Client/Views/SealBox/SealBoxConfigureWindow.xaml.cs
  27. 2
      BBWY.Client/Views/SealBox/SealBoxConfiguredControl.xaml
  28. 2
      BBWY.Client/Views/SealBox/SealBoxWaitConfigureControl.xaml
  29. 12
      BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml
  30. 26
      BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml.cs
  31. 777
      BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml
  32. 196
      BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml.cs
  33. 71
      BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml
  34. 64
      BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml.cs
  35. 2
      BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml
  36. 2
      BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs
  37. 4
      BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml

7
BBWY.Client/APIServices/QiKu/PackTaskService.cs

@ -39,6 +39,7 @@ namespace BBWY.Client.APIServices
return SendRequest<SearchTaskListResponse>(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new
{
orderSn,
spuId,
skuId,
@ -55,12 +56,16 @@ namespace BBWY.Client.APIServices
TaskState? TaskState = null,
string ShopName = null,
int pageIndex = 1,
int pageSize = 10
int pageSize = 10,
string SkuTitle = null,
string SpuTitle = null
)
{
return SendRequest<SearchTaskListResponse>(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new
{
SkuTitle,
SpuTitle,
DepartmentName = departmentName,
SkuId = skuId,
TaskId = taskId,

8
BBWY.Client/APIServices/QiKu/SealBoxService.cs

@ -28,8 +28,8 @@ namespace BBWY.Client.APIServices
{
ShopId = globalContext.User.Shop.ShopId.ToString(),
TaskId = TaskId,
SkuId = SkuId,
TaskId,
SkuId,
SpuId,
PageSize,
PageIndex,
@ -72,9 +72,9 @@ namespace BBWY.Client.APIServices
}
public ApiResponse<UpdateSealBoxConfiguredResponse> GetUpdateSealBoxConfigured(long SealBoxId, long[] TaskIds)
public ApiResponse<UpdateSealBoxConfiguredResponse> GetUpdateSealBoxConfiguredV2(long SealBoxId, long[] TaskIds)
{
return SendRequest<UpdateSealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfigured",
return SendRequest<UpdateSealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfiguredV2",
new
{
SealBoxId,

2
BBWY.Client/BBWYAppSettings.json

@ -4,6 +4,6 @@
"MDSApiHost": "http://mdsapi.qiyue666.com",
"JOSApiHost": "",
"1688ApiHost": "",
//"QKApiHost": "http://localhost:8080"
// "QKApiHost": "http://localhost:8080"
"QKApiHost": "http://qiku.qiyue666.com"
}

2
BBWY.Client/GlobalContext.cs

@ -13,7 +13,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10159";
ClientVersion = "10160";
}
private User user;

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

@ -33,7 +33,7 @@ namespace BBWY.Client.Models
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } }
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> {
"商家仓","云仓", "京仓","聚水潭齐越仓"};
"商家仓","云仓", "京仓","聚水潭"};
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<string> packTypeList = new ObservableCollection<string> {

4
BBWY.Client/Models/Enums.cs

@ -266,7 +266,7 @@
= 0,
= 1,
= 2,
= 3
= 3
}
/// <summary>
/// 合格证包装位置
@ -463,7 +463,7 @@
}
public enum WareType
{
= 0, = 1, = 2, = 3
= 0, = 1, = 2, = 3
}
public enum FeesMode
{

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

@ -2,36 +2,65 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Windows;
namespace BBWY.Client.Models.SealBox
{
/// <summary>
/// 待配置
/// </summary>
public class SealBoxConfigureModel : NotifyObject
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// sku标题
/// </summary>
public string SkuName { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 任务状态
/// </summary>
private TaskState? taskState;
/// <summary>
/// 任务状态
/// </summary>
public TaskState? TaskState { get => taskState; set { Set(ref taskState, value); } }
private int skuCount;
/// <summary>
/// sku任务数
/// </summary>
public int SkuCount { get; set; }
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } }
private int waitConfigureCount;
/// <summary>
/// sku图片
/// 待分配数量
/// </summary>
public string Logo { get; set; }
public int WaitConfigureCount
{
get
{
return waitConfigureCount;
}
set { Set(ref waitConfigureCount, value); }
}
private int splitCount;
/// <summary>
/// 份数
/// sku图片
/// </summary>
public int SplitCount { get=>splitCount; set {Set(ref splitCount,value); } }
public string Logo { get; set; }
private ObservableCollection<SealBoxConfigureWareHourseModel> wareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel>();
/// <summary>
@ -39,19 +68,48 @@ namespace BBWY.Client.Models.SealBox
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } }
private WareType? wareType;
public WareType? WareType { get => wareType; set { Set(ref wareType, value); } }
}
/// <summary>
/// 封箱配置 装箱配置
/// </summary>
public class SealBoxConfigureWareHourseModel : NotifyObject
{
private int index;
public long TaskId { get; set; }
public int Index { get => index; set { Set(ref index, value); } }
public Action<int, long> TotalWareCount { get; set; }
private int count;
public int Count { get=>count; set {Set(ref count,value); } }
public int Count
{
get => count; set
{
Set(ref count, value);
OnCountChanged();
}
}
private void OnCountChanged()
{
if (Count<0)
{
MessageBox.Show("数量不能为负数");
return;
}
if (TotalWareCount != null) TotalWareCount(Count, TaskId);
}
private string wareId;
@ -63,21 +121,21 @@ namespace BBWY.Client.Models.SealBox
public string WareName { get => wareName; set { Set(ref wareName, value); } }
private WareType? wareType;
public WareType? WareType { get => wareType; set { Set(ref wareType, value); } }
private PositionState? wareState;
/// <summary>
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
///待封箱 = 0, 待落仓 = 1, 待落仓已配置 = 2,待完结=3
/// </summary>
public PositionState? WareState { get; set; }
public PositionState? WareState { get => wareState; set { Set(ref wareState, value); } }
/// <summary>
///封箱id
/// </summary>
public long? SealBoxId { get; set; }
//private WareType? wareType;
//public WareType? WareType { get => wareType; set { Set(ref wareType, value); } }
}
}

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

@ -27,15 +27,13 @@ namespace BBWY.Client.Models
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 预计完成时间
/// </summary>
public DateTime? PreCompletedTime { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public TaskState? TaskState { get; set; }
public string BrandName { get; set; }
public WareType? WareType { get; set; }
}
}

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

@ -35,7 +35,7 @@ namespace BBWY.Client.ViewModels.PackTask
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } }
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> {
"商家仓","云仓", "京仓","聚水潭齐越仓"};
"商家仓","云仓", "京仓","聚水潭"};
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<string> packTypeList = new ObservableCollection<string> {

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

@ -42,7 +42,7 @@ namespace BBWY.Client.ViewModels.PackTask
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } }
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> {
"商家仓","云仓", "京仓","聚水潭齐越仓"};
"商家仓","云仓", "京仓","聚水潭"};
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<string> packTypeList = new ObservableCollection<string> {
@ -145,7 +145,7 @@ namespace BBWY.Client.ViewModels.PackTask
private PositionType positionType;
/// <summary>
/// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭齐越仓=3)
/// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3)
/// </summary>
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } }

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

@ -309,20 +309,9 @@ namespace BBWY.Client.ViewModels.PackTask
WaybillNo = fallware.WaybillNo
};
//if (fallware.WareType== WareType.京仓)
//{
//SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask);
//window.Show();
var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask, fallware.TransportOverTime);
w.ShowDialog();
//}
//if (fallware.WareType == WareType.云仓)
//{
// SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType.Value, ReflashTask);
// window.Show();
//}
}
private void UpdateSealBoxConfigured(SealBoxConfiguredModel model)
@ -330,7 +319,7 @@ namespace BBWY.Client.ViewModels.PackTask
var sealBoxId = model.SealBoxId;
var taskIds = model.SealBoxConfigureTasks.Select(s => s.TaskId).ToArray();
var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(sealBoxId, taskIds);
var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfiguredV2(sealBoxId, taskIds);
if (updateSealBoxConfig == null)
{
MessageBox.Show("网络异常,获取不到带封箱数据");
@ -342,10 +331,10 @@ namespace BBWY.Client.ViewModels.PackTask
return;
}
SetSealBoxPolicyWindow setSealBoxPolicyWindow = new SetSealBoxPolicyWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId);
setSealBoxPolicyWindow.ShowDialog();
SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId);
sealBoxConfigureWindow.ShowDialog();
}
private void ConfiguredSealBox()
@ -366,24 +355,32 @@ namespace BBWY.Client.ViewModels.PackTask
MessageBox.Show("已全部封箱!");
return;
}
var taskIds = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(w => w.TaskId).ToArray();
//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.ShowDialog();
//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.ShowDialog();
var data = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(x => new SealBoxConfigureModel {
Logo = x.Logo,
WareType = x.WareType, SkuCount = x.SkuCount , SkuId = x.SkuId, SkuName = x.SkuName, TaskId = x.TaskId, TaskState =x.TaskState,
WaitConfigureCount= x.SkuCount,
} ).ToList();
SetSealBoxPolicyWindow setSealBoxPolicyWindow = new SetSealBoxPolicyWindow(data, ReflashTask, 0);
setSealBoxPolicyWindow.ShowDialog();
}
private void DeletedTask(object obj)

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

@ -38,6 +38,13 @@ namespace BBWY.Client.ViewModels.PackTask
//public RelayCommand<string> SelectCmd => new RelayCommand<string>(str => Growl.Info(str));
#region 属性绑定
private ObservableCollection<string> selectTitleList = new ObservableCollection<string> {
"SKU名称","标题"
};
public ObservableCollection<string> SelectTitleList { get => selectTitleList; set { Set(ref selectTitleList, value); } }
private ObservableCollection<string> selectExpressList = new ObservableCollection<string> {
"物流单号","物流公司名称"
@ -62,8 +69,39 @@ namespace BBWY.Client.ViewModels.PackTask
};
public ObservableCollection<string> SelectShopList { get => selectShopList; set { Set(ref selectShopList, value); } }
/// <summary>
/// 查询物流
/// 查询名称
/// </summary>
private string selectTitle = "SKU名称";
public string SelectTitle
{
get => selectTitle;
set
{
Set(ref selectTitle, value);
OnSelectTitleChanged(SelectTitle);
}
}
private void OnSelectTitleChanged(string SelectTitle)
{
if (SelectTitle == "SKU名称")
{
SearchSpuTitle = null;
}
if (SelectTitle == "标题")
{
SearchSkuTitle = null;
}
}
/// <summary>
/// 查询店铺
/// </summary>
private string selectShop = "店铺";
public string SelectShop
@ -477,6 +515,28 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
public string searchSpuTitle;
public string SearchSpuTitle
{
get => searchSpuTitle; set
{
Set(ref searchSpuTitle, value);
}
}
public string searchSkuTitle;
public string SearchSkuTitle
{
get => searchSkuTitle; set
{
Set(ref searchSkuTitle, value);
}
}
private SealBoxConfigureType sealBoxConfigureType;
/// <summary>
/// 封箱配置状态
@ -882,7 +942,7 @@ namespace BBWY.Client.ViewModels.PackTask
//var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType, ReflashTask, false);
//w.ShowDialog();
}
if (fallware.WareType == WareType. || fallware.WareType == WareType.)
if (fallware.WareType == WareType. || fallware.WareType == WareType.)
{
SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, fallware.WareType);
window.ShowDialog();
@ -1151,6 +1211,14 @@ namespace BBWY.Client.ViewModels.PackTask
public void SetTaskState(TaskState? taskState)
{
if (!(TaskState== Models.TaskState.&&TaskState== Models.TaskState.))
{
SearchSkuTitle = "";
SearchSpuTitle = "";
}
TaskState = taskState;
if (PageIndex == 1)
@ -1486,7 +1554,7 @@ namespace BBWY.Client.ViewModels.PackTask
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState, SearchShopName,
PageIndex, PageSize);
PageIndex, PageSize,SearchSkuTitle,SearchSpuTitle);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;

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

@ -31,18 +31,18 @@ namespace BBWY.Client.ViewModels
#region 属性
public int goodProductQuantity;
public int arrivalQuantity;
public int? goodProductQuantity;
public int? arrivalQuantity;
/// <summary>
/// 到货数量
/// </summary>
public int ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } }
public int? ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } }
/// <summary>
/// 良品数量
/// </summary>
public int GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } }
public int? GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } }
///// <summary>
///// 预计完成时间
@ -65,7 +65,7 @@ namespace BBWY.Client.ViewModels
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } }
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> {
"商家仓","云仓", "京仓","聚水潭齐越仓"};
"商家仓","云仓", "京仓","聚水潭"};
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<string> packTypeList = new ObservableCollection<string> {
@ -194,7 +194,7 @@ namespace BBWY.Client.ViewModels
private PositionType positionType;
/// <summary>
/// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭齐越仓=3)
/// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3)
/// </summary>
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } }
@ -395,6 +395,16 @@ namespace BBWY.Client.ViewModels
#region 方法
private void CompeteQualityTask(object obj)
{
if (ArrivalQuantity==null)
{
MessageBox.Show($"请输入到货数量");
return;
}
if (GoodProductQuantity == null)
{
MessageBox.Show($"请输入良品数量");
return;
}
if (FloorDragNumber <= 0)
{
@ -414,11 +424,15 @@ namespace BBWY.Client.ViewModels
return;
}
var request = new Models.APIModel.Request.QualityTaskRequest
{
BasicPack = BasicPack,
ArrivalQuantity = ArrivalQuantity,
GoodProductQuantity = GoodProductQuantity,
ArrivalQuantity = ArrivalQuantity.Value,
GoodProductQuantity = GoodProductQuantity.Value,
Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)),
BrandName = BrandName,
CertificatePosition = CertificatePosition,
@ -488,7 +502,7 @@ namespace BBWY.Client.ViewModels
//{
// BarCodeModel.ShopName = OriginShopName;
//}
batchPrint.SetData(GoodProductQuantity,
batchPrint.SetData(GoodProductQuantity.Value,
PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
, BarCodeModel);
batchPrint.ShowDialog();
@ -653,8 +667,8 @@ namespace BBWY.Client.ViewModels
SkuTitle = model.SkuTitle;
BasicPack = model.BasicPack;
CertificatePosition = model.CertificatePosition;
ArrivalQuantity = 0;
GoodProductQuantity = 0;
//ArrivalQuantity = 0;
//GoodProductQuantity = 0;
IncreateList = new ObservableCollection<IncreateModel>();
string[] increateDatas = model.Increment1?.Split(',');

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

@ -5,89 +5,546 @@ using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.QiKu;
using BBWY.Client.Models.SealBox;
using BBWY.Client.Views.BatchPurchase;
using BBWY.Client.Views.SealBox;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using NPOI.SS.Formula.Functions;
using NPOI.Util;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using WebSocketSharp;
namespace BBWY.Client.ViewModels.SealBox
{
public class SealBoxConfigureViewModel : BaseVM
{
private IList<StoreResponse> storeList;//仓库列表
private LogisticsService logisticsService;
public LogisticsService logisticsService;
private SealBoxService sealBoxService;
private GlobalContext globalContext;
private ObservableCollection<SealBoxConfigureModel> sealBoxConfigureModelList;
private WareType selectWareType = WareType.;
public WareType SelectWareType { get => selectWareType; set { Set(ref selectWareType, value); } }
private string searchSkuId;
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } }
private List<SealBoxConfigureModel> sealBoxConfigureModelList;
/// <summary>
/// 分箱配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } }
public List<SealBoxConfigureModel> SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } }
private ObservableCollection<SealBoxConfigureModel> jdConfigureModelList;
/// <summary>
/// 京仓配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> JdConfigureModelList { get => jdConfigureModelList; set { Set(ref jdConfigureModelList, value); } }
private ObservableCollection<SealBoxConfigureModel> cloudConfigureModelList;
/// <summary>
/// 云仓配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> CloudConfigureModelList { get => cloudConfigureModelList; set { Set(ref cloudConfigureModelList, value); } }
private ObservableCollection<SealBoxConfigureModel> jstConfigureModelList;
/// <summary>
/// 聚水潭配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> JstConfigureModelList { get => jstConfigureModelList; set { Set(ref jstConfigureModelList, value); } }
private ObservableCollection<SealBoxConfigureModel> storeConfigureModelList;
/// <summary>
/// 商家仓配置列表
/// </summary>
public ObservableCollection<SealBoxConfigureModel> StoreConfigureModelList { get => storeConfigureModelList; set { Set(ref storeConfigureModelList, value); } }
private ObservableCollection<SealBoxConfigureWareHourseModel> jdWareHourseHeaderList;
/// <summary>
/// 京仓仓库配置头列表
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> JdWareHourseHeaderList { get => jdWareHourseHeaderList; set { Set(ref jdWareHourseHeaderList, value); } }
private ObservableCollection<SealBoxConfigureWareHourseModel> cloudWareHourseHeaderList;
/// <summary>
/// 云仓仓库配置头列表
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> CloudWareHourseHeaderList { get => cloudWareHourseHeaderList; set { Set(ref cloudWareHourseHeaderList, value); } }
private ObservableCollection<SealBoxConfigureWareHourseModel> jstWareHourseHeaderList;
/// <summary>
/// 聚水潭仓库配置头列表
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> JstWareHourseHeaderList { get => jstWareHourseHeaderList; set { Set(ref jstWareHourseHeaderList, value); } }
private ObservableCollection<SealBoxConfigureWareHourseModel> storeWareHourseHeaderList;
/// <summary>
/// 商家仓仓库配置头列表
/// </summary>
public ObservableCollection<SealBoxConfigureWareHourseModel> StoreWareHourseHeaderList { get => storeWareHourseHeaderList; set { Set(ref storeWareHourseHeaderList, 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>();
//SealBoxConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
this.globalContext = globalContext;
SelectWareTypeCommand = new RelayCommand(SearchSku);
SearchSkuCommand = new RelayCommand(SearchSku);
AddWareCommand = new RelayCommand(AddWare);
SpliteOtherWareCommand = new RelayCommand<SealBoxConfigureModel>(SpliteOtherWare);
BatchSetWareMaxCountCommand = new RelayCommand<string>(BatchSetWareMaxCount);
SetWareMaxCountCommand = new RelayCommand<SealBoxConfigureWareHourseModel>(SetWareMaxCount);
}
private void SetWareMaxCount(SealBoxConfigureWareHourseModel model)
{
SealBoxConfigureModelList.Where(s => s.WareType == SelectWareType && s.TaskId == model.TaskId)
.ForAll(s =>
{
s.WareHourseDatas?.ForAll(d =>
{
if (d.WareId == model.WareId)
{
d.Count += s.WaitConfigureCount;
s.WaitConfigureCount = 0;
}
});
});
}
private void BatchSetWareMaxCount(string wareId)
{
SealBoxConfigureModelList.Where(s => s.WareType == SelectWareType)
.ForAll(s =>
{
s.WareHourseDatas?.ForAll(d =>
{
if (d.WareId == wareId)
{
d.Count += s.WaitConfigureCount;
}
});
});
}
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)
public ICommand SearchSkuCommand { get; set; }
public ICommand AddWareCommand { get; set; }
public ICommand SpliteOtherWareCommand { get; set; }
);
var otherCount = sealBoxConfigureModel.WareHourseDatas.Count();
if (sealBoxConfigureModel.SplitCount <= 0 || sealBoxConfigureModel.SplitCount < otherCount)
public ICommand SelectWareTypeCommand { get; set; }
public ICommand BatchSetWareMaxCountCommand { get; set; }
public ICommand SetWareMaxCountCommand { get; set; }
private void SearchSku()
{
if (SearchSkuId.IsNullOrEmpty())
{
MessageBox.Show("份数不正确");
return;
switch (SelectWareType)
{
case WareType.:
JdConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
JdConfigureModelList.Add(s);
}));
});
break;
case WareType.:
CloudConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
CloudConfigureModelList.Add(s);
}));
});
break;
case WareType.:
StoreConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
StoreConfigureModelList.Add(s);
}));
});
break;
case WareType.:
JstConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
JstConfigureModelList.Add(s);
}));
});
break;
default:
break;
}
}
else
{
switch (SelectWareType)
{
case WareType.:
JdConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
JdConfigureModelList.Add(s);
}));
});
break;
case WareType.:
CloudConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
CloudConfigureModelList.Add(s);
}));
});
break;
case WareType.:
StoreConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
StoreConfigureModelList.Add(s);
}));
});
break;
case WareType.:
JstConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
SealBoxConfigureModelList.Where(s => s.SkuId == SearchSkuId && s.WareType == WareType. && s.SkuCount > 0).ForAll(s =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
JstConfigureModelList.Add(s);
}));
});
break;
default:
break;
}
int resetIndex = 1;
foreach (var item in sealBoxConfigureModel.WareHourseDatas)
}
switch (SelectWareType)//加载动态仓库头
{
item.Index = resetIndex;
resetIndex++;
case WareType.:
if (JdConfigureModelList.Count > 0 && JdConfigureModelList[0].WareHourseDatas?.Count > 0)
{
JdWareHourseHeaderList = JdConfigureModelList[0].WareHourseDatas;
}
else
{
JdWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel>();
}
break;
case WareType.:
if (CloudConfigureModelList.Count > 0 && CloudConfigureModelList[0].WareHourseDatas?.Count > 0)
{
CloudWareHourseHeaderList = CloudConfigureModelList[0].WareHourseDatas;
}
else
{
CloudWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel>();
}
break;
case WareType.:
if (StoreConfigureModelList.Count > 0 && StoreConfigureModelList[0].WareHourseDatas?.Count > 0)
{
StoreWareHourseHeaderList = StoreConfigureModelList[0].WareHourseDatas;
}
else
{
StoreWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel>();
}
break;
case WareType.:
if (JstConfigureModelList.Count > 0 && JstConfigureModelList[0].WareHourseDatas?.Count > 0)
{
JstWareHourseHeaderList = JstConfigureModelList[0].WareHourseDatas;
}
else
{
JstWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel>();
}
break;
default:
break;
}
for (var i = 1 + otherCount; i <= sealBoxConfigureModel.SplitCount; i++)
}
private void AddWare()
{
AddWareListWindow addWareListWindow = new AddWareListWindow(SelectWareType, logisticsService, SealBoxConfigureModelList);
addWareListWindow.AddWareList = AddWareList;
addWareListWindow.ShowDialog();
}
void AddWareList(WareType wareType, List<StoreWare> storeWares)
{
var oldList = sealBoxConfigureModelList.Where(s => s.WareType == wareType).SelectMany(s => s.WareHourseDatas).Select(w => w.WareId).Distinct().ToList();//原ids
var newList = storeWares.Select(s => s.WareId).Distinct().ToList();
var addList = newList.Except(oldList).ToList();
var deletedList = oldList.Except(newList).ToList();
sealBoxConfigureModelList.Where(s => s.WareType == wareType).ForAll(s =>
{
sealBoxConfigureModel.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel()
if (s.WareHourseDatas == null)
s.WareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel> { };
foreach (var item in addList)
{
Index = i,
Count = 0
s.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel
{
Count = 0,
SealBoxId = null,
WareId = item,
WareName = storeWares.FirstOrDefault(f => f.WareId == item)?.WareName,
TotalWareCount = TotalCount,
TaskId = s.TaskId
});
}
foreach (var item in deletedList)
{
var deletedCount = s.WareHourseDatas.Where(w => w.WareId == item).Select(w => w.Count).Sum();
s.WaitConfigureCount += deletedCount;
ObservableCollection<SealBoxConfigureWareHourseModel> d = new ObservableCollection<SealBoxConfigureWareHourseModel>();
foreach (var WareHourseData in s.WareHourseDatas)
{
if (item == WareHourseData.WareId)
continue;
d.Add(WareHourseData);
}
s.WareHourseDatas = d;
}
});
SearchSku();
}
/// <summary>
///
/// </summary>
/// <param name="count"></param>
/// <param name="skuid"></param>
public void TotalCount(int count, long taskId)
{
var totalSkuItemCount = sealBoxConfigureModelList.Where(s => s.TaskId == taskId && s.WareType == SelectWareType).SelectMany(s => s.WareHourseDatas).Sum(s => s.Count);
sealBoxConfigureModelList.Where(s => s.TaskId == taskId && s.WareType == SelectWareType).ForAll(
s =>
{
if (totalSkuItemCount > s.SkuCount)
{
MessageBox.Show($"总量超过可分配量,请重新分配,任务id:{s.TaskId}");
}
s.WaitConfigureCount = s.SkuCount - totalSkuItemCount;
});
}
private void SpliteOtherWare(SealBoxConfigureModel model)//
{
if (model.WaitConfigureCount <= 0)
{
MessageBox.Show($"可分配量不足!当前可分配量:{model.WaitConfigureCount}", "提示");
return;
}
SplitOtherWareWindow splitOtherWareWindow = new SplitOtherWareWindow(model.WaitConfigureCount, SelectWareType, (count, waretype) =>
{
model.WaitConfigureCount -= count;
model.SkuCount -= count;
var type = SealBoxConfigureModelList.SingleOrDefault(s => s.TaskId == model.TaskId && s.WareType == waretype);
if (type != null)
{
type.SkuCount += count;
type.WaitConfigureCount += count;
}
else
{
}
var data = new SealBoxConfigureModel
{
Logo = model.Logo,
WareType = waretype,
SkuCount = count,
SkuId = model.SkuId,
SkuName = model.SkuName,
TaskId = model.TaskId,
TaskState = model.TaskState,
WaitConfigureCount = count,
};
data.WareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel>();
switch (waretype)
{
case WareType.:
if (JdWareHourseHeaderList != null)
foreach (var item in JdWareHourseHeaderList)
{
data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel
{
TaskId = model.TaskId,
SealBoxId = item.SealBoxId,
TotalWareCount = TotalCount,
WareId = item.WareId,
WareName = item.WareName,
//WareType = s.WareType,
WareState = item.WareState
});
}
break;
case WareType.:
if (CloudWareHourseHeaderList != null)
foreach (var item in CloudWareHourseHeaderList)
{
data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel
{
TaskId = model.TaskId,
SealBoxId = item.SealBoxId,
TotalWareCount = TotalCount,
WareId = item.WareId,
WareName = item.WareName,
//WareType = s.WareType,
WareState = item.WareState
});
}
break;
case WareType.:
if (StoreWareHourseHeaderList != null)
foreach (var item in StoreWareHourseHeaderList)
{
data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel
{
TaskId = model.TaskId,
SealBoxId = item.SealBoxId,
TotalWareCount = TotalCount,
WareId = item.WareId,
WareName = item.WareName,
//WareType = s.WareType,
WareState = item.WareState
});
}
break;
case WareType.:
if (JstWareHourseHeaderList != null)
foreach (var item in JstWareHourseHeaderList)
{
data.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel
{
TaskId = model.TaskId,
SealBoxId = item.SealBoxId,
TotalWareCount = TotalCount,
WareId = item.WareId,
WareName = item.WareName,
//WareType = s.WareType,
WareState = item.WareState
});
}
break;
default:
break;
}
SealBoxConfigureModelList.Add(data);
}
SearchSku();
});
splitOtherWareWindow.ShowDialog();
}
private StoreResponse store;
private void SetPackCountAndStore(object obj)
{
@ -110,27 +567,27 @@ namespace BBWY.Client.ViewModels.SealBox
{
Id = sealBoxConfigureWareHourseModel.WareId,
Name = sealBoxConfigureWareHourseModel.WareName,
Type = ToStockType(sealBoxConfigureWareHourseModel.WareType),
//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;
//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>
@ -138,46 +595,68 @@ namespace BBWY.Client.ViewModels.SealBox
/// </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 PositionType ToPositionType(WareType wareType)
//{
// switch (wareType)
// {
// case WareType.京仓:
// return PositionType.京仓;
// break;
// case WareType.云仓:
// return PositionType.云仓;
// break;
// case WareType.商家仓:
// return PositionType.商家仓;
// break;
// case WareType.聚水潭:
// return PositionType.聚水潭;
// break;
// default:
// break;
// }
// return PositionType.聚水潭;
//}
//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)
{
@ -187,36 +666,24 @@ namespace BBWY.Client.ViewModels.SealBox
SetSealBoxConfiguredRequest setSealBoxConfiguredRequest = new SetSealBoxConfiguredRequest();
setSealBoxConfiguredRequest.ShopId = globalContext.User.Shop.ShopId.ToString();
IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas = new List<SetSealBoxConfiguredData>();
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList)
{
if (sealBoxConfigureModel.WareHourseDatas==null|| !sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count>0))
if (sealBoxConfigureModel.WareHourseDatas == null || !sealBoxConfigureModel.WareHourseDatas.Any(w => w.Count > 0))//未配置
{
continue;
}
//判断存在0的报错
if (sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count==0))
if (sealBoxConfigureModel.WaitConfigureCount != 0)
{
System.Windows.MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在未配置的数据");
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
return;
}
////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())
if (SealBoxConfigureModelList.Where(s => s.TaskId == sealBoxConfigureModel.TaskId).Any(s => s.WaitConfigureCount != 0))
{
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在部分落仓 未设置数据");
return;
}
SetSealBoxConfiguredDatas.Add(new SetSealBoxConfiguredData
@ -229,7 +696,7 @@ namespace BBWY.Client.ViewModels.SealBox
Count = x.Count,
WareId = x.WareId,
WareName = x.WareName,
WareType = x.WareType.Value,
WareType = sealBoxConfigureModel.WareType.Value,
}).ToList(),
});
}
@ -264,32 +731,30 @@ namespace BBWY.Client.ViewModels.SealBox
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())
if (sealBoxConfigureModel.WaitConfigureCount != 0)
{
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} 中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}");
return;
}
if (SealBoxConfigureModelList.Where(s => s.TaskId == sealBoxConfigureModel.TaskId).Any(s => s.WaitConfigureCount != 0))
{
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在部分落仓 未设置数据");
return;
}
UpdateSealBoxConfiguredDatas.Add(new UpdateSealBoxConfiguredDataRequest
{
TaskId = sealBoxConfigureModel.TaskId,
SkuCount = sealBoxConfigureModel.SkuCount,
SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Select(x => new SealBoxConfiguredWareHourseRequest
SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Where(w => w.Count > 0).Select(x => new SealBoxConfiguredWareHourseRequest
{
Count = x.Count,
WareId = x.WareId,
WareName = x.WareName,
WareType = x.WareType.Value,
WareType = sealBoxConfigureModel.WareType.Value,
WareState = x.WareState,
SealBoxId=x.SealBoxId
SealBoxId = x.SealBoxId
}).ToList(),
});
@ -303,7 +768,7 @@ namespace BBWY.Client.ViewModels.SealBox
MessageBox.Show("网络异常");
return;
}
if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data)
if (!setSealBoxRes.Success || !setSealBoxRes.Data)
{
MessageBox.Show(setSealBoxRes.Msg);
return;
@ -316,8 +781,7 @@ namespace BBWY.Client.ViewModels.SealBox
}
public Action ReflashWindow { get; set; }
public Action ReflashWindow { get; set; }
}
}

2
BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs

@ -150,7 +150,7 @@ namespace BBWY.Client.Views.FallWare
}
if (WareType == WareType. || WareType == WareType.)
if (WareType == WareType. || WareType == WareType.)
{
App.Current.Dispatcher.Invoke(new Action(() =>
{

4
BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml

@ -71,8 +71,8 @@
<RadioButton Height="35" Width="80" VerticalAlignment="Center" Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.云仓}" Content="云仓"
Name="btn_yuncang" IsChecked="{Binding wareType,Converter={StaticResource objConverter},ConverterParameter=云仓:True:False}"
/>
<RadioButton Height="35" Width="80" VerticalAlignment="Center" Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.聚水潭齐越仓}" Content="聚水潭"
Name="btn_jushuitang" IsChecked="{Binding wareType,Converter={StaticResource objConverter},ConverterParameter=聚水潭齐越仓:True:False}"
<RadioButton Height="35" Width="80" VerticalAlignment="Center" Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.聚水潭}" Content="聚水潭"
Name="btn_jushuitang" IsChecked="{Binding wareType,Converter={StaticResource objConverter},ConverterParameter=聚水潭:True:False}"
/>
</StackPanel>

6
BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs

@ -76,7 +76,7 @@ namespace BBWY.Client.Views.FallWare
break;
case WareType.:
break;
case WareType.:
case WareType.:
btn_yuncang.IsEnabled = false;
btn_jingcang.IsEnabled = false;
panel_jingcang.Visibility = Visibility.Collapsed;
@ -154,7 +154,7 @@ namespace BBWY.Client.Views.FallWare
});
return;
}
if (wareType == WareType.|| wareType == WareType.)
if (wareType == WareType.|| wareType == WareType.)
{
if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
@ -163,7 +163,7 @@ namespace BBWY.Client.Views.FallWare
return;
}
if (wareType == WareType.)
if (wareType == WareType.)
{
if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
{

34
BBWY.Client/Views/PackTask/CerControl.xaml

@ -24,9 +24,9 @@
<TextBlock Text="材质:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/>
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Height="50" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<StackPanel Orientation="Horizontal" Margin="0">
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Visibility="{Binding model.ProduceDate,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}" Orientation="Horizontal" Margin="0 10 0 10">
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" />
@ -37,8 +37,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
@ -62,8 +62,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.ApplyAge}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Height="50" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Visibility="{Binding model.ProduceDate,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}" Orientation="Horizontal" Margin="0 10 0 10">
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" />
@ -74,8 +74,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
@ -96,8 +96,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Height="50" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Visibility="{Binding model.ProduceDate,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}" Orientation="Horizontal" Margin="0 10 0 10">
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" />
@ -108,8 +108,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
</Border>
@ -137,8 +137,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Height="50" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" WaterRemark="如多个标准请使用逗号分隔" Text="{Binding model.ExcuteStanderFormat,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Visibility="{Binding model.ProduceDate,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}" Orientation="Horizontal" Margin="0 5 0 0">
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" />
@ -149,8 +149,8 @@
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 5 0 0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 0 0 0" />
<c:BTextBox IsReadOnly="True" VerticalContentAlignment="Top" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Height="48" Text="{Binding model.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>

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

@ -466,7 +466,7 @@
<c:BButton Foreground="Blue" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding DeleteServiceCommand}"
Visibility="{Binding DataContext.IsConsumableTypeListEnable,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}},Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}" Content="删除" Grid.Column="4"/>
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBox}}, Path=ItemsSource}" Content="删除" Grid.Column="4"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="1" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="2" Width="1" Background="{StaticResource Border.Brush}"/>

4
BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs

@ -40,14 +40,14 @@ namespace BBWY.Client.Views.PackTask
var serviceViewModel = this.DataContext as PackDetailViewModel;
if (model.Brand.IsNullOrEmpty())
{
if (!model.BarCodeModel.Brand.IsNullOrEmpty())
if (model.BarCodeModel!=null&&!model.BarCodeModel.Brand.IsNullOrEmpty())
model.Brand = model.BarCodeModel.Brand;
else if (model.CertificateModel != null && model.CertificateModel.Any(c => c.Brand != null))
model.Brand = model.CertificateModel.FirstOrDefault(c => c.Brand != null)?.Brand;
}
if (model.BrandName.IsNullOrEmpty())
{
if (!model.BarCodeModel.BrandName.IsNullOrEmpty())
if (model.BarCodeModel != null && !model.BarCodeModel.BrandName.IsNullOrEmpty())
model.BrandName = model.BarCodeModel.BrandName;
else if (model.CertificateModel != null && model.CertificateModel.Any(c => c.BrandName != null))
model.BrandName = model.CertificateModel.FirstOrDefault(c => c.BrandName != null)?.BrandName;

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

@ -146,6 +146,24 @@
</StackPanel>
</Border>
<Grid Grid.Column="1" Grid.Row="1" Margin="20,0,0,0"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货:Visible:Collapsed}"
>
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<StackPanel Orientation="Horizontal" Margin="1">
<ComboBox Width="125" BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ItemsSource="{Binding SelectTitleList}" Text="{Binding SelectTitle }"/>
<UniformGrid Width="150" Margin="0,0,0,0" Rows="1" Columns="1">
<c:BTextBox Width="150" Text="{Binding SearchSkuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="模糊搜索"
BorderThickness="1 0 0 0" Visibility="{Binding SelectTitle,Converter={StaticResource objConverter},ConverterParameter=SKU名称:Visible:Collapsed}"
/>
<c:BTextBox Width="150" Text="{Binding SearchSpuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="模糊搜索"
BorderThickness="1 0 0 0" Visibility="{Binding SelectTitle,Converter={StaticResource objConverter},ConverterParameter=标题:Visible:Collapsed}"
/>
</UniformGrid>
</StackPanel>
</Grid>
<c:BButton Content="搜索" Width="94" Height="30" VerticalAlignment="Stretch" Margin="10,0,0,0"
Command="{Binding SearchTaskCommand}"
@ -591,7 +609,6 @@
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

18
BBWY.Client/Views/QualityTask/ShopWaitQualityControl.xaml

@ -111,37 +111,19 @@
Margin=" 5,0,7,0"/>
<!--<Label Width="70" Height="25" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="{Binding TaskState}" Foreground="White" Background="{Binding TaskState,Converter={StaticResource objConverter} , ConverterParameter=已完成:#02a7f0:#facd91 }" Margin="5,0,0,0"/>-->
<TextBlock VerticalAlignment="Center" Text="部门:" Margin="14,0,0,0" />
<c:BButton Content="{Binding DepartmentName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding DepartmentName}"
Margin=" 5,0,0,0"/>
<!--<TextBlock VerticalAlignment="Center" Text="店铺:" Margin="14,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,0,0"/>-->
<StackPanel Orientation="Horizontal" Visibility="{Binding OrderId, Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}">
<TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" />
</StackPanel>
<!--<StackPanel Orientation="Horizontal" Visibility="{Binding QualityRemainTime, Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<TextBlock Foreground="Red" VerticalAlignment="Center" Text="{Binding QualityRemainTime}" Margin="20,0,0,0" />
</StackPanel>-->
</StackPanel>
<!--<StackPanel Grid.Column="12" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"
Style="{StaticResource LinkButton}" Content="取消任务" Margin="0 5 0 5 "
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待验收:Visible:Collapsed}"
/>
</StackPanel>-->

19
BBWY.Client/Views/QualityTask/WaitQualityControl.xaml

@ -3,8 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
mc:Ignorable="d" Background="White"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
@ -143,6 +142,22 @@
</StackPanel>
</Border>
<Grid Grid.Column="1" Grid.Row="1" Margin="20,0,0,0">
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<StackPanel Orientation="Horizontal" Margin="1">
<ComboBox Width="125" BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ItemsSource="{Binding SelectTitleList}" Text="{Binding SelectTitle }"/>
<UniformGrid Width="150" Margin="0,0,0,0" Rows="1" Columns="1">
<c:BTextBox Width="150" Text="{Binding SearchSkuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="模糊搜索"
BorderThickness="1 0 0 0" Visibility="{Binding SelectTitle,Converter={StaticResource objConverter},ConverterParameter=SKU名称:Visible:Collapsed}"
/>
<c:BTextBox Width="150" Text="{Binding SearchSpuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="模糊搜索"
BorderThickness="1 0 0 0" Visibility="{Binding SelectTitle,Converter={StaticResource objConverter},ConverterParameter=标题:Visible:Collapsed}"
/>
</UniformGrid>
</StackPanel>
</Grid>
<c:BButton Content="搜索" Width="94" Height="30" VerticalAlignment="Stretch" Margin="10,0,0,0"
Command="{Binding SearchTaskCommand}"

49
BBWY.Client/Views/SealBox/AddWareListWindow.xaml

@ -0,0 +1,49 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.AddWareListWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="384" Height="510"
RightButtonGroupMargin="0,5,5,0">
<!--CloseButtonColor="{StaticResource WindowButtonColor}" -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="39"/>
<RowDefinition/>
<RowDefinition Height="36"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="添加仓库" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<ListBox Name="list_ware" Margin="50 20"
ItemsSource="{Binding WareList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,1"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=list_ware,Converter={StaticResource widthConverter},ConverterParameter=-0}" Height="35">
<CheckBox Content="{Binding WareName}" IsEnabled="{Binding IsEdit}" IsChecked="{Binding IsSelect}" FontSize="14" Margin="5 0 0 0"/>
<Border Height="1" Background="{StaticResource Border.Brush}" VerticalAlignment="Bottom"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="2" VerticalAlignment="Top"/>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

163
BBWY.Client/Views/SealBox/AddWareListWindow.xaml.cs

@ -0,0 +1,163 @@
using AutoMapper.Internal;
using BBWY.Client.APIServices;
using BBWY.Client.Models;
using BBWY.Client.Models.SealBox;
using BBWY.Controls;
using Org.BouncyCastle.Utilities.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
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>
/// AddWareListWindow.xaml 的交互逻辑
/// </summary>
public partial class AddWareListWindow : BWindow
{
public AddWareListWindow(WareType WareType, LogisticsService logisticsService, List<SealBoxConfigureModel> SealBoxConfigureModelList)
{
this.WareType = WareType;
InitializeComponent();
LoadWare(logisticsService, SealBoxConfigureModelList);
this.DataContext = this;
}
private WareType wareType;
public WareType WareType { get => wareType; set { Set(ref wareType, value); } }
public void LoadWare(LogisticsService logisticsService, List<SealBoxConfigureModel> SealBoxConfigureModelList)
{
if (WareType != WareType.)
{
var response = logisticsService.GetStoreList();//京仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3
if (response == null || !response.Success)
{
MessageBox.Show($"加载仓库列表失败,{response?.Msg}");
return;
}
var data = response.Data.Where(w => w.Status == StockStatus.使);
var stockType = StockType.;
switch (WareType)
{
case WareType.:
stockType = StockType.;
break;
case WareType.:
stockType = StockType.;
break;
case WareType.:
stockType = StockType.;
break;
//case WareType.聚水潭:
// WareList = new List<StoreWare> { new StoreWare { WareId = "qiyuejushuitan", WareName = "齐越聚水潭", IsSelect = false } };
// break;
//default:
// break;
}
WareList = new List<StoreWare>();
data.Where(d => d.Type == stockType).ForAll(d =>
{
if (SealBoxConfigureModelList.Where(s => s.WareType == WareType &&s.WareHourseDatas!=null).SelectMany(s => s.WareHourseDatas).Any(w => w.WareId == d.Id))//存在
{
bool isedit = true;
if (SealBoxConfigureModelList.Where(s => s.WareType == WareType && s.WareHourseDatas != null).SelectMany(s => s.WareHourseDatas).Any(s=>s.WareState>0&& s.WareId == d.Id))
isedit =false;
WareList.Add(new StoreWare
{
IsSelect = true,
WareId = d.Id,
WareName = d.Name,
IsEdit= isedit
});
}
else
{
WareList.Add(new StoreWare
{
IsSelect = false,
WareId = d.Id,
WareName = d.Name,
IsEdit = true
});
}
});
}
else
{
bool isJST = false;
if (SealBoxConfigureModelList.Where(s => s.WareType == WareType).SelectMany(s => s.WareHourseDatas).Any(w => w.WareId == "qiyuejushuitan"))//存在
isJST = true;
WareList = new List<StoreWare> { new StoreWare { WareId = "qiyuejushuitan", WareName = "齐越聚水潭", IsSelect = isJST } };
}
}
private List<StoreWare> wareList;
public List<StoreWare> WareList { get => wareList; set { Set(ref wareList, value); } }
public Action<WareType, List<StoreWare>> AddWareList { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
var selectWare = WareList.Where(w => w.IsSelect).ToList();
if (AddWareList != null) AddWareList(WareType, selectWare);
this.Close();
}
private PositionType ToPositionType(WareType wareType)
{
switch (wareType)
{
case WareType.:
return PositionType.;
break;
case WareType.:
return PositionType.;
break;
case WareType.:
return PositionType.;
break;
case WareType.:
return PositionType.;
break;
default:
break;
}
return PositionType.;
}
}
public class StoreWare : NotifyObject
{
private bool isSelect;
public bool IsSelect { get => isSelect; set { Set(ref isSelect, value); } }
private string wareName;
public string WareName { get => wareName; set { Set(ref wareName, value); } }
private string wareId;
public string WareId { get => wareId; set { Set(ref wareId, value); } }
private bool isEdit=true;
public bool IsEdit { get => isEdit; set { Set(ref isEdit, value); } }
}
}

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

@ -27,7 +27,7 @@ namespace BBWY.Client.Views.SealBox
var sealBoxConfigureViewModel = (SealBoxConfigureViewModel)this.DataContext;
sealBoxConfigureViewModel.SealBoxId = sealboxId;
sealBoxConfigureViewModel.SealBoxConfigureModelList = new System.Collections.ObjectModel.ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureViewModel.SealBoxConfigureModelList = new List<SealBoxConfigureModel>();
sealBoxConfigureViewModel.ReflashWindow = ReflashWindow;

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

@ -180,7 +180,7 @@
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,0,0 0">
<Run Text="任务状态:"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待打包:Red:black}" Text="{Binding TaskState}"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待打包:Red:black}" Text="{Binding TaskState}"/>
</TextBlock>
</StackPanel>

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

@ -152,7 +152,7 @@
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,10,0 0">
<Run Text="任务状态:"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待打包:Red:black}" Text="{Binding TaskState}"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待打包:Red:black}" Text="{Binding TaskState}"/>
</TextBlock>
</StackPanel>

12
BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.xaml

@ -0,0 +1,12 @@
<UserControl x:Class="BBWY.Client.Views.SealBox.SetSealBoxPolicyWareListControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

26
BBWY.Client/Views/SealBox/SetSealBoxPolicyWareListControl.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>
/// SetSealBoxPolicyWareListControl.xaml 的交互逻辑
/// </summary>
public partial class SetSealBoxPolicyWareListControl : UserControl
{
public SetSealBoxPolicyWareListControl()
{
InitializeComponent();
}
}
}

777
BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml

@ -0,0 +1,777 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.SetSealBoxPolicyWindow"
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:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
DataContext="{Binding SealBoxConfigureVModel,Source={StaticResource Locator}}"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
Height="800" Width="1000"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Style="{StaticResource bwstyle}"
>
<c:BWindow.Resources>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="White" HorizontalAlignment="Center" Height="35" Stroke="{StaticResource Border.Brush}" 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>
</c:BWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="60"/>
<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>
<StackPanel Orientation="Horizontal" Height="35" Grid.Row="1" >
<RadioButton Content="京仓" Width="116" Margin="20 0 0 0" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=京仓:True:false}" Command="{Binding SelectWareTypeCommand}"/>
<RadioButton Content="云仓" Width="116" Margin="-1 0 0 0" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=云仓:True:false}" Command="{Binding SelectWareTypeCommand}"/>
<RadioButton Content="聚水潭" Width="116" Margin="-1 0 0 0" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=聚水潭:True:false}" Command="{Binding SelectWareTypeCommand}"/>
<RadioButton Content="商家仓" Width="116" Margin="-1 0 0 0" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=商家仓:True:false}" Command="{Binding SelectWareTypeCommand}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Height="30">
<TextBlock Style="{StaticResource middleTextBlock}" Text="SKU:" Margin="20 00 0 0"/>
<c:BTextBox Width="170" Margin="5 0 5 0" Text="{Binding SearchSkuId}"/>
<c:BButton Width="66" Content="搜索" Command="{Binding SearchSkuCommand}"
/>
</StackPanel>
<Grid Grid.Row="3" Margin="20 10 20 0" >
<ListBox Name="jd_list" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<Grid Visibility="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=京仓:Visible:Collapsed}"
Width="{Binding Width,ElementName=jd_list,Converter={StaticResource widthConverter},ConverterParameter=-0}"
>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="3" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品信息"/>
<TextBlock Grid.Column="1" Style="{StaticResource middleTextBlock}" Text="待分配量"/>
<Grid Grid.Column="2">
</Grid>
<ListBox Grid.Column="2" ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemsSource="{Binding JdWareHourseHeaderList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Visible"
Visibility="{Binding JdWareHourseHeaderList.Count,Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="180" Height="32">
<TextBlock Text="{Binding WareName,Mode=TwoWay}" Style="{StaticResource middleTextBlock}"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Column="3" Style="{StaticResource middleTextBlock}" Text="操作"/>
</Grid>
</Border>
<ListBox Grid.Column="2" Grid.Row="1" Name="list_sealbox_jddata"
ItemsSource="{Binding JdConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}" ScrollViewer.VerticalScrollBarVisibility="Hidden"
>
<ListBox.ItemTemplate>
<DataTemplate >
<Grid Width="{Binding Width,ElementName=list_sealbox_jddata,Converter={StaticResource widthConverter},ConverterParameter=-0}">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Background="{StaticResource Border.Background}">
<TextBlock Text="任务ID:" Margin="10 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskId}" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="任务状态:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskState}" Style="{StaticResource middleTextBlock}"
Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待包装:Red:Black}"
/>
<TextBlock Text="包装数量:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding SkuCount}" Style="{StaticResource middleTextBlock}"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Grid MinHeight="68">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage DecodePixelWidth="48" Margin="10 0 0 0"
Cursor="Hand" UrlSource="{Binding Logo}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="SKU:"/>
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
CommandParameter="{Binding SkuId}"
/>
</StackPanel>
<TextBlock HorizontalAlignment="Left" Margin="0 10 0 0">
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
</Grid>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitConfigureCount}" Grid.Column="1"/>
<ListBox Grid.Column="2" Name="list_ware_data" VerticalAlignment="Center"
ItemsSource="{Binding WareHourseDatas}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="180" Height="68">
<TextBox Text="{Binding Count,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="0" Width="180" Height="68"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center">
</TextBox>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Column="3" Orientation="Vertical" VerticalAlignment="Center">
<c:BButton Style="{StaticResource LinkButton}" Content="添加仓库" Command="{Binding DataContext.AddWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="分配至其他仓" Margin="0 5 0 0" CommandParameter="{Binding}" Command="{Binding DataContext.SpliteOtherWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
</StackPanel>
<Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="5" 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"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</ListBox>
<Grid
Visibility="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=云仓:Visible:Collapsed}"
>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="3" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品信息"/>
<TextBlock Grid.Column="1" Style="{StaticResource middleTextBlock}" Text="待分配量"/>
<ListBox Grid.Column="2" ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemsSource="{Binding CloudWareHourseHeaderList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding CloudWareHourseHeaderList.Count,Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="200" Height="32">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding WareName}" Style="{StaticResource middleTextBlock}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="批量MAX"
CommandParameter="{Binding WareId}" Command="{Binding DataContext.BatchSetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Left"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Column="3" Style="{StaticResource middleTextBlock}" Text="操作"/>
</Grid>
</Border>
<ListBox Grid.Column="2" Grid.Row="1" Name="list_sealbox_data_cloud"
ItemsSource="{Binding CloudConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=list_sealbox_data_cloud,Converter={StaticResource widthConverter},ConverterParameter=-0}">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Background="{StaticResource Border.Background}">
<TextBlock Text="任务ID:" Margin="10 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskId}" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="任务状态:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskState}" Style="{StaticResource middleTextBlock}"
Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待包装:Red:Black}"
/>
<TextBlock Text="包装数量:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding SkuCount}" Style="{StaticResource middleTextBlock}"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Grid MinHeight="68">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage DecodePixelWidth="48" Margin="10 0 0 0"
Cursor="Hand" UrlSource="{Binding Logo}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="SKU:"/>
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
CommandParameter="{Binding SkuId}"
/>
</StackPanel>
<TextBlock HorizontalAlignment="Left" Margin="0 10 0 0">
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
</Grid>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitConfigureCount}" Grid.Column="1"/>
<ListBox Grid.Column="2" Name="list_ware_data" VerticalAlignment="Center"
ItemsSource="{Binding WareHourseDatas}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="200" Height="68">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Count,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="0" Width="155" Height="68"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Grid.Column="1"/>
<c:BButton Style="{StaticResource LinkButton}" Content="MAX" FontSize="14" Foreground="Gray"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
CommandParameter="{Binding}" Command="{Binding DataContext.SetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Column="3" Orientation="Vertical" VerticalAlignment="Center">
<c:BButton Style="{StaticResource LinkButton}" Content="添加仓库" Command="{Binding DataContext.AddWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="分配至其他仓" Margin="0 5 0 0" CommandParameter="{Binding}" Command="{Binding DataContext.SpliteOtherWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
</StackPanel>
<Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="5" 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"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid
Visibility="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=聚水潭:Visible:Collapsed}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="3" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品信息"/>
<TextBlock Grid.Column="1" Style="{StaticResource middleTextBlock}" Text="待分配量"/>
<ListBox Grid.Column="2" ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemsSource="{Binding JstWareHourseHeaderList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding JstWareHourseHeaderList.Count,Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="155" Height="32">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding WareName}" Style="{StaticResource middleTextBlock}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="批量MAX"
CommandParameter="{Binding WareId}" Command="{Binding DataContext.BatchSetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Left"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Column="3" Style="{StaticResource middleTextBlock}" Text="操作"/>
</Grid>
</Border>
<ListBox Grid.Column="2" Grid.Row="1" Name="list_sealbox_data_jst"
ItemsSource="{Binding JstConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate >
<DataTemplate >
<Grid Width="{Binding ActualWidth,ElementName=list_sealbox_data_jst,Converter={StaticResource widthConverter},ConverterParameter=-0}">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Background="{StaticResource Border.Background}">
<TextBlock Text="任务ID:" Margin="10 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskId}" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="任务状态:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskState}" Style="{StaticResource middleTextBlock}"
Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待包装:Red:Black}"
/>
<TextBlock Text="包装数量:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding SkuCount}" Style="{StaticResource middleTextBlock}"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Grid MinHeight="68">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage DecodePixelWidth="48" Margin="10 0 0 0"
Cursor="Hand" UrlSource="{Binding Logo}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="SKU:"/>
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
CommandParameter="{Binding SkuId}"
/>
</StackPanel>
<TextBlock HorizontalAlignment="Left" Margin="0 10 0 0">
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
</Grid>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitConfigureCount}" Grid.Column="1"/>
<ListBox Grid.Column="2" VerticalAlignment="Center"
ItemsSource="{Binding WareHourseDatas}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="155" Height="68">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Count,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="0" Width="155" Height="68"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Grid.Column="1"/>
<c:BButton Style="{StaticResource LinkButton}" Content="MAX" FontSize="14" Foreground="Gray"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
CommandParameter="{Binding}" Command="{Binding DataContext.SetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Column="3" Orientation="Vertical" VerticalAlignment="Center">
<c:BButton Style="{StaticResource LinkButton}" Content="添加仓库" Command="{Binding DataContext.AddWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="分配至其他仓" Margin="0 5 0 0" CommandParameter="{Binding}" Command="{Binding DataContext.SpliteOtherWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
</StackPanel>
<Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="5" 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"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid
Visibility="{Binding SelectWareType,Converter={StaticResource objConverter}, ConverterParameter=商家仓:Visible:Collapsed}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<Border Width="1" Grid.Column="3" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="商品信息"/>
<TextBlock Grid.Column="1" Style="{StaticResource middleTextBlock}" Text="待分配量"/>
<ListBox Grid.Column="2" ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemsSource="{Binding StoreWareHourseHeaderList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding StoreWareHourseHeaderList.Count,Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="155" Height="32">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding WareName}" Style="{StaticResource middleTextBlock}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="批量MAX"
CommandParameter="{Binding WareId}" Command="{Binding DataContext.BatchSetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Left"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Column="3" Style="{StaticResource middleTextBlock}" Text="操作"/>
</Grid>
</Border>
<ListBox Name="list_sealbox_data_store"
Grid.Row="1"
ItemsSource="{Binding StoreConfigureModelList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=list_sealbox_data_store,Converter={StaticResource widthConverter},ConverterParameter=-0}">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Background="{StaticResource Border.Background}">
<TextBlock Text="任务ID:" Margin="10 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskId}" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="任务状态:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding TaskState}" Style="{StaticResource middleTextBlock}"
Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待包装:Red:Black}"
/>
<TextBlock Text="包装数量:" Margin="20 0 0 0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="{Binding SkuCount}" Style="{StaticResource middleTextBlock}"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="224"/>
<ColumnDefinition Width="97"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="157"/>
</Grid.ColumnDefinitions>
<Grid MinHeight="68">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage DecodePixelWidth="48" Margin="10 0 0 0"
Cursor="Hand" UrlSource="{Binding Logo}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="SKU:"/>
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
CommandParameter="{Binding SkuId}"
/>
</StackPanel>
<TextBlock HorizontalAlignment="Left" Margin="0 10 0 0">
<Run Text="SKU名称:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
</StackPanel>
</Grid>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitConfigureCount}" Grid.Column="1"/>
<ListBox Grid.Column="2" VerticalAlignment="Center"
ItemsSource="{Binding WareHourseDatas}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="155" Height="68">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Count,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="0" Width="155" Height="68"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Grid.Column="1"/>
<c:BButton Style="{StaticResource LinkButton}" Content="MAX" FontSize="14" Foreground="Gray"
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=待封箱|#null:true:false}"
CommandParameter="{Binding}" Command="{Binding DataContext.SetWareMaxCountCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"
Grid.Column="1" HorizontalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" Grid.ColumnSpan="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Column="3" Orientation="Vertical" VerticalAlignment="Center">
<c:BButton Style="{StaticResource LinkButton}" Content="添加仓库" Command="{Binding DataContext.AddWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
<c:BButton Style="{StaticResource LinkButton}" Content="分配至其他仓" Margin="0 5 0 0" CommandParameter="{Binding}" Command="{Binding DataContext.SpliteOtherWareCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}}}"/>
</StackPanel>
<Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="5" 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"
Visibility="{Binding WareHourseDatas.Count,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
<Border Grid.Row="3" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
<c:BButton Content="{Binding SealBoxId,Converter={StaticResource objConverter},ConverterParameter=0:提交任务:保存}" Width="80" HorizontalAlignment="Right" Grid.Row="4"
Command="{Binding SaveCommand}" Margin="0,0,5,0"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}"
/>
</Grid>
</c:BWindow>

196
BBWY.Client/Views/SealBox/SetSealBoxPolicyWindow.xaml.cs

@ -0,0 +1,196 @@
using BBWY.Client.Models.SealBox;
using BBWY.Client.ViewModels.SealBox;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using AutoMapper.Internal;
using BBWY.Client.APIServices;
namespace BBWY.Client.Views.SealBox
{
/// <summary>
/// SetSealBoxPolicyWindow.xaml 的交互逻辑
/// </summary>
public partial class SetSealBoxPolicyWindow : BWindow
{
public SetSealBoxPolicyWindow(IList<SealBoxConfigureModel> sealBoxWaitConfigureModels, Action ReflashWindow, long sealboxId = 0)
{
InitializeComponent();
var sealBoxConfigureVM = this.DataContext as SealBoxConfigureViewModel;
sealBoxConfigureVM.SealBoxConfigureModelList = sealBoxWaitConfigureModels.ToList();
sealBoxConfigureVM.JdConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureVM.CloudConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureVM.JstConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureVM.StoreConfigureModelList = new ObservableCollection<SealBoxConfigureModel>();
sealBoxConfigureVM.SealBoxId = sealboxId;
sealBoxConfigureVM.ReflashWindow = ReflashWindow;
LoadData(sealBoxWaitConfigureModels, sealboxId, sealBoxConfigureVM);
}
/// <summary>
/// 加载数据
/// </summary>
/// <param name="sealBoxWaitConfigureModels"></param>
/// <param name="sealboxId"></param>
/// <param name="sealBoxConfigureVM"></param>
private void LoadData(IList<SealBoxConfigureModel> sealBoxWaitConfigureModels, long sealboxId, SealBoxConfigureViewModel sealBoxConfigureVM)
{
if (sealboxId == 0)//设置
{
sealBoxConfigureVM.JstWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = "齐越聚水潭",WareId="qiyuejushuitan"
}
};
var storeListRes = sealBoxConfigureVM.logisticsService.GetStoreList();
if (storeListRes.Success)
{
//加载商家仓 全国仓
var storeList = storeListRes.Data.Where(s=>s.Status== Models.StockStatus.使);
var store = storeList.FirstOrDefault(s => s.Id == "0");//商家全国仓
if (store != null)
{
sealBoxConfigureVM.StoreWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = store.Name,WareId=store.Id
}
};
}
//加载 泉州齐越云仓3号库
var cloud = storeList.FirstOrDefault(s => s.Id == "800009450");//商家全国仓
if (cloud != null)
{
sealBoxConfigureVM.CloudWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = cloud.Name,WareId=cloud.Id
}
};
}
}
//sealBoxConfigureVM.CloudWareHourseHeaderList = new ObservableCollection<SealBoxConfigureWareHourseModel> {
// new SealBoxConfigureWareHourseModel{
// WareName = "泉州齐越云仓3号库",WareId="800009450"
// }
//};
}
foreach (var sealBoxWaitConfigureModel in sealBoxWaitConfigureModels)
{
if (sealBoxWaitConfigureModel.WareHourseDatas != null && sealBoxWaitConfigureModel.WareHourseDatas.Count > 0)//修改数据
{
sealBoxWaitConfigureModel.WaitConfigureCount = 0;
sealBoxWaitConfigureModel.WareHourseDatas.ForAll(w => { w.TotalWareCount = sealBoxConfigureVM.TotalCount; w.TaskId = sealBoxWaitConfigureModel.TaskId; });
}
else
{
sealBoxWaitConfigureModel.WaitConfigureCount = sealBoxWaitConfigureModel.SkuCount;
}
switch (sealBoxWaitConfigureModel.WareType.Value)
{
case Models.WareType.:
if (sealboxId == 0)
{
if (sealBoxConfigureVM.StoreWareHourseHeaderList != null && sealBoxConfigureVM.StoreWareHourseHeaderList.Count > 0)
{
sealBoxConfigureVM.StoreWareHourseHeaderList.ForAll(s =>
{
sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = s.WareName,
WareId=s.WareId,
TaskId=sealBoxWaitConfigureModel.TaskId,
TotalWareCount=sealBoxConfigureVM.TotalCount,
}
};
});
}
}
sealBoxConfigureVM.StoreConfigureModelList.Add(sealBoxWaitConfigureModel);
sealBoxConfigureVM.StoreWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas;
break;
case Models.WareType.:
if (sealboxId == 0)
{
if (sealBoxConfigureVM.CloudWareHourseHeaderList != null && sealBoxConfigureVM.CloudWareHourseHeaderList.Count > 0)
{
sealBoxConfigureVM.CloudWareHourseHeaderList.ForAll(s =>
{
sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = s.WareName,
WareId=s.WareId,
TaskId=sealBoxWaitConfigureModel.TaskId,
TotalWareCount=sealBoxConfigureVM.TotalCount,
}
};
});
}
}
sealBoxConfigureVM.CloudConfigureModelList.Add(sealBoxWaitConfigureModel);
sealBoxConfigureVM.CloudWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas;
break;
case Models.WareType.:
sealBoxConfigureVM.JdConfigureModelList.Add(sealBoxWaitConfigureModel);
sealBoxConfigureVM.JdWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas;
break;
case Models.WareType.:
sealBoxConfigureVM.JstConfigureModelList.Add(sealBoxWaitConfigureModel);
if (sealboxId == 0)
{
sealBoxWaitConfigureModel.WareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel> {
new SealBoxConfigureWareHourseModel{
WareName = "齐越聚水潭",WareId="qiyuejushuitan", TaskId=sealBoxWaitConfigureModel.TaskId, TotalWareCount=sealBoxConfigureVM.TotalCount,
}
};
}
sealBoxConfigureVM.JstWareHourseHeaderList = sealBoxWaitConfigureModel.WareHourseDatas;
break;
default:
break;
}
}
}
}
}

71
BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml

@ -0,0 +1,71 @@
<c:BWindow x:Class="BBWY.Client.Views.SealBox.SplitOtherWareWindow"
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:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
WindowStartupLocation="CenterScreen"
CloseButtonVisibility="Visible"
xmlns:hc="https://handyorg.github.io/handycontrol"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
Width="384" Height="254" ResizeMode="NoResize"
RightButtonGroupMargin="0,5,5,0">
<!--CloseButtonColor="{StaticResource WindowButtonColor}" -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="39"/>
<RowDefinition/>
<RowDefinition Height="36"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="添加落仓" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" Margin="100 20 100 20">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Text="待分配量:"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding WaitCount}"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Text="仓库:"/>
<Grid Margin="5" Height="30" Width="150" Grid.Column="1" Grid.ColumnSpan="3">
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<ComboBox Height="30" Width="150" SelectedItem="{Binding SelectWareType}" ItemsSource="{Binding WareTypeList}" BorderThickness="0" Margin="1" BorderBrush="Black">
<ComboBox.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries >
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ComboBox.Resources>
</ComboBox>
</Grid>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Text="数量:"/>
<Border BorderBrush="{StaticResource Border.Brush}" Margin="5 0 0 0" Height="30" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<c:BTextBox Height="30" Width="100" Text="{Binding Count}" BorderThickness="0 0 1 0"/>
<c:BButton Style="{StaticResource LinkButton}" Content="MAX" BorderThickness="0" Height="30" Width="50" Foreground="{StaticResource Border.Brush}" Click="BButton_Click_1"/>
</StackPanel>
</Border>
</StackPanel>
</Grid>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="2" VerticalAlignment="Top"/>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="105" VerticalAlignment="Center" Height="40" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

64
BBWY.Client/Views/SealBox/SplitOtherWareWindow.xaml.cs

@ -0,0 +1,64 @@
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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>
/// SplitOtherWareWindow.xaml 的交互逻辑
/// </summary>
public partial class SplitOtherWareWindow : BWindow
{
public SplitOtherWareWindow(int waitCount, WareType wareType, Action<int, WareType> SplitWare)
{
this. SplitWare = SplitWare;
WaitCount = waitCount;
WareTypeList.Remove(wareType);//移除当前落仓
InitializeComponent();
this.DataContext = this;
}
private Action<int, WareType> SplitWare { get;set;}
private int waitCount;
public int WaitCount { get => waitCount; set { Set(ref waitCount, value); } }
private int count;
public int Count { get => count; set { Set(ref count, value); } }
private WareType selectWareType;
public WareType SelectWareType { get => selectWareType; set { Set(ref selectWareType, value); } }
private ObservableCollection<WareType> wareTypeList=new ObservableCollection<WareType> {
WareType., WareType., WareType., WareType.
};
public ObservableCollection<WareType> WareTypeList { get => wareTypeList; set { Set(ref wareTypeList, value); } }
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (WaitCount< Count)
{
MessageBox.Show("可分配量不足!");
return;
}
if (SplitWare != null) SplitWare(Count, SelectWareType);
this.Close();
}
private void BButton_Click_1(object sender, RoutedEventArgs e)
{
Count = WaitCount;
}
}
}

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

@ -210,7 +210,7 @@
</StackPanel>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,10,0 0">
<Run Text="任务状态:"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待打包:Red:black}" Text="{Binding TaskState}"/>
<Run Foreground="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收|待排单|待打包:Red:black}" Text="{Binding TaskState}"/>
</TextBlock>
</StackPanel>

2
BBWY.Client/Views/TotalPackTask/PackUserSalaryControl.xaml.cs

@ -72,7 +72,7 @@ namespace BBWY.Client.Views.TotalPackTask
<ColumnDefinition MinWidth=""60""/>
[:Column:]
</Grid.ColumnDefinitions>
<CheckBox HorizontalAlignment=""Center"" Grid.Column=""0"" HorizontalContentAlignment=""Center"" />
<CheckBox HorizontalAlignment=""Center"" Grid.Column=""0"" HorizontalContentAlignment=""Center"" />
<TextBlock Text="""" Grid.Column=""1"" Style=""{StaticResource middleTextBlock}""/>
<TextBlock Text="""" Grid.Column=""2"" Style=""{StaticResource middleTextBlock}""/>
<TextBlock Text="""" Grid.Column=""3"" Style=""{StaticResource middleTextBlock}""/>

4
BBWY.Client/Views/WaitTransport/WareWaitTransportListControl.xaml

@ -74,8 +74,8 @@
<RadioButton Content="云仓" Height="35" Width="130" Tag="{Binding WaitTransportCloudWareCount,Mode=TwoWay}" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter},ConverterParameter=云仓:True:False}"
Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.云仓}"
/>
<RadioButton Content="聚水潭" Height="35" Width="130" Tag="{Binding WaitTransportJuShuiTanCount,Mode=TwoWay}" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter},ConverterParameter=聚水潭齐越仓:True:False}"
Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.聚水潭齐越仓}"
<RadioButton Content="聚水潭" Height="35" Width="130" Tag="{Binding WaitTransportJuShuiTanCount,Mode=TwoWay}" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter},ConverterParameter=聚水潭:True:False}"
Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.聚水潭}"
/>
<RadioButton Content="商家仓" Height="35" Width="130" Tag="{Binding WaitTransportStoreWareCount,Mode=TwoWay}" IsChecked="{Binding SelectWareType,Converter={StaticResource objConverter},ConverterParameter=商家仓:True:False}"
Command="{Binding SetWareTypeCommand}" CommandParameter="{x:Static cmodel:WareType.商家仓}"

Loading…
Cancel
Save