40 changed files with 2168 additions and 352 deletions
@ -0,0 +1,141 @@ |
|||
using BBWY.Client.Models.APIModel; |
|||
using BBWY.Client.Models.APIModel.Response.PackTask; |
|||
using BBWY.Client.Views.PackTask; |
|||
using BBWY.Common.Http; |
|||
using BBWY.Common.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Net.Http; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.APIServices |
|||
{ |
|||
public class SealBoxService : BaseApiService, IDenpendency |
|||
{ |
|||
public SealBoxService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) |
|||
{ |
|||
} |
|||
|
|||
|
|||
public ApiResponse<SealBoxWaitConfigureResponse> GetSealBoxWaitConfigureList(string SkuId, string TaskId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null) |
|||
{ |
|||
return SendRequest<SealBoxWaitConfigureResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxWaitConfigureList", |
|||
new |
|||
{ |
|||
ShopId = globalContext.User.Shop.ShopId.ToString(), |
|||
TaskId = TaskId, |
|||
SkuId = SkuId, |
|||
SpuId, |
|||
PageSize, |
|||
PageIndex, |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
public ApiResponse<SealBoxPackStateCountResponse> GetSealBoxPackStateCount() |
|||
{ |
|||
return SendRequest<SealBoxPackStateCountResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxPackStateCount", |
|||
new |
|||
{ |
|||
ShopId = globalContext.User.Shop.ShopId.ToString(), |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<bool> SetSealBoxConfigured(SetSealBoxConfiguredRequest setSealBoxConfiguredRequest) |
|||
{ |
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/SetSealBoxConfigured", |
|||
setSealBoxConfiguredRequest |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<SealBoxConfiguredResponse> GetSealBoxConfiguredList(string SkuId, string TaskId, string shopId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null) |
|||
{ |
|||
return SendRequest<SealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetSealBoxConfiguredList", |
|||
new |
|||
{ |
|||
ShopId = shopId, |
|||
TaskId = TaskId, |
|||
SkuId = SkuId, |
|||
SpuId, |
|||
PageSize, |
|||
PageIndex, |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
public ApiResponse<UpdateSealBoxConfiguredResponse> GetUpdateSealBoxConfigured(long SealBoxId, long[] TaskIds) |
|||
{ |
|||
return SendRequest<UpdateSealBoxConfiguredResponse>(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfigured", |
|||
new |
|||
{ |
|||
SealBoxId, |
|||
TaskIds |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
public ApiResponse<bool> BatchUpdateSealBoxConfigured(BatchUpdateSealBoxConfiguredRequest batchUpdateSealBoxConfiguredRequest) |
|||
{ |
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/BatchUpdateSealBoxConfigured", |
|||
batchUpdateSealBoxConfiguredRequest |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<GetWareSealBoxResponse> GetWareSealBoxList(string ShopName, long? TaskId, string SkuId, int? PageIndex, int? PageSize) |
|||
{ |
|||
return SendRequest<GetWareSealBoxResponse>(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxList", |
|||
new |
|||
{ |
|||
ShopName, |
|||
TaskId, |
|||
SkuId, |
|||
PageIndex, |
|||
PageSize |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
|
|||
public ApiResponse<bool> WareCompeteSealBox(long SealBoxId, int? BoxCount) |
|||
{ |
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/SealBox/WareCompeteSealBox", |
|||
new |
|||
{ |
|||
SealBoxId, |
|||
BoxCount |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
/// <summary>
|
|||
/// 获取待落仓列表
|
|||
/// </summary>
|
|||
/// <param name="ShopName"></param>
|
|||
/// <param name="TaskId"></param>
|
|||
/// <param name="SkuId"></param>
|
|||
/// <param name="PageIndex"></param>
|
|||
/// <param name="PageSize"></param>
|
|||
/// <returns></returns>
|
|||
public ApiResponse<SearchWaitFallWareResponse> SearchWaitFallWareList(string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1 |
|||
, int PageSize = 10) |
|||
{ |
|||
return SendRequest<SearchWaitFallWareResponse>(globalContext.QKApiHost, $"api/SealBox/SearchWaitFallWareList", |
|||
new |
|||
{ |
|||
ShopName, |
|||
TaskId, |
|||
SkuId, |
|||
PageIndex, |
|||
PageSize |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class BatchUpdateSealBoxConfiguredRequest |
|||
{ |
|||
/// <summary>
|
|||
/// 判断当前的封箱任务是否 是带封箱状态
|
|||
/// </summary>
|
|||
public long SealBoxId { get; set; } |
|||
|
|||
public string ShopId { get; set; } |
|||
|
|||
public IList<UpdateSealBoxConfiguredDataRequest> UpdateSealBoxConfiguredDatas { get; set; } |
|||
|
|||
} |
|||
public class UpdateSealBoxConfiguredDataRequest |
|||
{ |
|||
public long TaskId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// sku总量任务量
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
|
|||
public IList<SealBoxConfiguredWareHourseRequest> SealBoxConfiguredWareHourseRequests { get; set; } |
|||
} |
|||
|
|||
public class SealBoxConfiguredWareHourseRequest : WareHourseData |
|||
{ |
|||
/// <summary>
|
|||
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
|
|||
/// </summary>
|
|||
public PositionState? WareState { get; set; } |
|||
} |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class SetSealBoxConfiguredRequest |
|||
{ |
|||
/// <summary>
|
|||
/// 店铺id
|
|||
/// </summary>
|
|||
public string ShopId { get; set; } |
|||
|
|||
public IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas { get; set; } |
|||
|
|||
} |
|||
|
|||
|
|||
public class SetSealBoxConfiguredData |
|||
{ |
|||
/// <summary>
|
|||
/// 任务Id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// sku
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// sku总量任务量(校对)
|
|||
/// </summary>
|
|||
public int TotalCount { get; set; } |
|||
/// <summary>
|
|||
/// 仓库去向
|
|||
/// </summary>
|
|||
public IList<WareHourseData> WareHourseDatas { get; set; } |
|||
|
|||
} |
|||
public class WareHourseData |
|||
{ |
|||
/// <summary>
|
|||
/// 仓库id
|
|||
/// </summary>
|
|||
public string WareId { get; set; } |
|||
/// <summary>
|
|||
/// 仓库名称
|
|||
/// </summary>
|
|||
public string WareName { get; set; } |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public int Count { get; set; } |
|||
/// <summary>
|
|||
/// 入仓类型 (京仓=0 云仓=1,商家仓=2,聚水潭=3)
|
|||
/// </summary>
|
|||
public WareType WareType { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,88 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class GetWareSealBoxResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public int TotalCount { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 分箱列表
|
|||
/// </summary>
|
|||
public List<WareSealBoxData> WaitSealBoxModels { get; set; } |
|||
} |
|||
|
|||
public class WareSealBoxData |
|||
{ |
|||
public long SealBoxId { get; set; } |
|||
/// <summary>
|
|||
/// 店铺Id
|
|||
/// </summary>
|
|||
public string ShopId { get; set; } |
|||
/// <summary>
|
|||
/// 仓库Id(同一个店铺 唯一)
|
|||
/// </summary>
|
|||
public string WareId { get; set; } |
|||
/// <summary>
|
|||
/// 店铺名称
|
|||
/// </summary>
|
|||
public string ShopName { get; set; } |
|||
/// <summary>
|
|||
/// 仓库名
|
|||
/// </summary>
|
|||
public string WareName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 团队名称
|
|||
/// </summary>
|
|||
public string DepartmentName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对接人(同团队下)
|
|||
/// </summary>
|
|||
public List<string> AcceptUserNames { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 封箱sku列表
|
|||
/// </summary>
|
|||
public List<WareSealBoxSku> SealBoxSkus { get; set; } |
|||
|
|||
} |
|||
|
|||
public class WareSealBoxSku |
|||
{ |
|||
/// <summary>
|
|||
/// 任务Id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// 图片链接
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// sku标题
|
|||
/// </summary>
|
|||
public string SkuTitle { get; set; } |
|||
/// <summary>
|
|||
/// 品名
|
|||
/// </summary>
|
|||
public string BrandName { get; set; } |
|||
/// <summary>
|
|||
/// 货号
|
|||
/// </summary>
|
|||
public string ProductNo { get; set; } |
|||
/// <summary>
|
|||
/// (分箱的仓库的sku产品数量)
|
|||
/// </summary>
|
|||
public int WareHourseSkuCount { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
using BBWY.Client.Models.SealBox; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class SealBoxConfiguredResponse |
|||
{ |
|||
public int TotalCount { get; set; } |
|||
|
|||
public IList<SealBoxConfiguredModel> SealBoxConfiguredModels { get; set; } |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class SealBoxPackStateCountResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 封箱 待配置数
|
|||
/// </summary>
|
|||
public int SealBoxWaitConfigureCount { get; set; } |
|||
/// <summary>
|
|||
///封箱 已配置数
|
|||
/// </summary>
|
|||
public int SealBoxConfiguredCount { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class SealBoxWaitConfigureResponse |
|||
{ |
|||
public int TotalCount { get; set; } |
|||
|
|||
public IList<SealBoxWaitConfigureModel> SealBoxWaitConfigureModels { get; set; } |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
using BBWY.Client.Models.SealBox; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class UpdateSealBoxConfiguredResponse |
|||
{ |
|||
public IList<SealBoxConfigureModel> UpdateSealBoxConfiguredTaskDatas { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,78 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.SealBox |
|||
{ |
|||
public class SealBoxConfigureModel : NotifyObject |
|||
{ |
|||
|
|||
|
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// sku任务数
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// sku图片
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
|
|||
private int splitCount; |
|||
/// <summary>
|
|||
/// 份数
|
|||
/// </summary>
|
|||
public int SplitCount { get=>splitCount; set {Set(ref splitCount,value); } } |
|||
|
|||
private ObservableCollection<SealBoxConfigureWareHourseModel> wareHourseDatas = new ObservableCollection<SealBoxConfigureWareHourseModel>(); |
|||
/// <summary>
|
|||
/// 装箱配置列表
|
|||
/// </summary>
|
|||
public ObservableCollection<SealBoxConfigureWareHourseModel> WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } } |
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 封箱配置 装箱配置
|
|||
/// </summary>
|
|||
public class SealBoxConfigureWareHourseModel : NotifyObject |
|||
{ |
|||
private int index; |
|||
|
|||
public int Index { get => index; set { Set(ref index, value); } } |
|||
|
|||
private int count; |
|||
|
|||
public int Count { get=>count; set {Set(ref count,value); } } |
|||
|
|||
private string wareId; |
|||
|
|||
public string WareId { get => wareId; set { Set(ref wareId, value); } } |
|||
|
|||
|
|||
private string wareName; |
|||
|
|||
public string WareName { get => wareName; set { Set(ref wareName, value); } } |
|||
|
|||
|
|||
private WareType? wareType; |
|||
|
|||
public WareType? WareType { get => wareType; set { Set(ref wareType, value); } } |
|||
|
|||
/// <summary>
|
|||
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
|
|||
/// </summary>
|
|||
public PositionState? WareState { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
using BBWY.Client.Models.APIModel; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.SealBox |
|||
{ |
|||
public class SealBoxConfiguredModel:NotifyObject |
|||
{ |
|||
/// <summary>
|
|||
/// 封箱id
|
|||
/// </summary>
|
|||
public long SealBoxId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 箱子总数量
|
|||
/// </summary>
|
|||
public int SealBoxTotalCount { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 仓库名称
|
|||
/// </summary>
|
|||
public string WareName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 仓库任务列表
|
|||
/// </summary>
|
|||
public ObservableCollection<SealBoxConfigureTask> SealBoxConfigureTasks { get; set; } |
|||
} |
|||
public class SealBoxConfigureTask:NotifyObject |
|||
{ |
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// 仓库sku任务数
|
|||
/// </summary>
|
|||
public int WareHourseCount { get; set; } |
|||
/// <summary>
|
|||
/// sku名称
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
/// <summary>
|
|||
/// sku图片
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
///// <summary>
|
|||
///// 预计完成时间
|
|||
///// </summary>
|
|||
//public DateTime? PreCompletedTime { get; set; }
|
|||
///// <summary>
|
|||
///// 任务状态
|
|||
///// </summary>
|
|||
//public TaskState? TaskState { get; set; }
|
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models |
|||
{ |
|||
public class SealBoxWaitConfigureModel : NotifyObject |
|||
{ |
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// sku任务数
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
/// <summary>
|
|||
/// sku名称
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
/// <summary>
|
|||
/// sku图片
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
/// <summary>
|
|||
/// 预计完成时间
|
|||
/// </summary>
|
|||
public DateTime? PreCompletedTime { get; set; } |
|||
/// <summary>
|
|||
/// 任务状态
|
|||
/// </summary>
|
|||
public TaskState? TaskState { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
using BBWY.Client.Models.APIModel; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.SealBox |
|||
{ |
|||
public class UpdateSealBoxConfiguredTaskModel:NotifyObject |
|||
{ |
|||
public string Logo { get; set; } |
|||
|
|||
public string SkuId { get; set; } |
|||
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// 采购数量
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
public string SkuName { get; set; } |
|||
|
|||
private int taskWareCount; |
|||
/// <summary>
|
|||
/// 份数
|
|||
/// </summary>
|
|||
public int TaskWareCount { get => taskWareCount; set { Set(ref taskWareCount, value); } } |
|||
|
|||
|
|||
|
|||
private ObservableCollection<UpdateSealBoxWareHourseModel> wareHourseDatas; |
|||
|
|||
public ObservableCollection<UpdateSealBoxWareHourseModel> WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } } |
|||
} |
|||
public class UpdateSealBoxWareHourseModel:WareHourseData |
|||
{ |
|||
|
|||
|
|||
/// <summary>
|
|||
///待封箱 = 0, 待落仓 = 1, 待完结 = 2
|
|||
/// </summary>
|
|||
public PositionState? WareState { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,304 @@ |
|||
using AutoMapper.Internal; |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Models.APIModel; |
|||
using BBWY.Client.Models.QiKu; |
|||
using BBWY.Client.Models.SealBox; |
|||
using BBWY.Client.Views.BatchPurchase; |
|||
using BBWY.Controls; |
|||
using GalaSoft.MvvmLight.Command; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Input; |
|||
|
|||
namespace BBWY.Client.ViewModels.SealBox |
|||
{ |
|||
public class SealBoxConfigureViewModel : BaseVM |
|||
{ |
|||
private IList<StoreResponse> storeList;//仓库列表
|
|||
private LogisticsService logisticsService; |
|||
private SealBoxService sealBoxService; |
|||
private GlobalContext globalContext; |
|||
private ObservableCollection<SealBoxConfigureModel> sealBoxConfigureModelList; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 分箱配置列表
|
|||
/// </summary>
|
|||
public ObservableCollection<SealBoxConfigureModel> SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } } |
|||
public SealBoxConfigureViewModel(LogisticsService logisticsService, SealBoxService sealBoxService, GlobalContext globalContext) |
|||
{ |
|||
this.logisticsService = logisticsService; |
|||
this.sealBoxService = sealBoxService; |
|||
SetSplitCountCommand = new RelayCommand<SealBoxConfigureModel>(SetSplitCount); |
|||
SetPackCountAndStoreCommand = new RelayCommand<object>(SetPackCountAndStore); |
|||
SaveCommand = new RelayCommand<object>(Save); |
|||
SealBoxConfigureModelList = new ObservableCollection<SealBoxConfigureModel>(); |
|||
this.globalContext = globalContext; |
|||
} |
|||
|
|||
private long sealBoxId; |
|||
public long SealBoxId { get => sealBoxId; set { Set(ref sealBoxId, value); } } |
|||
|
|||
public ICommand SetSplitCountCommand { get; set; } |
|||
|
|||
public ICommand SetPackCountAndStoreCommand { get; set; } |
|||
|
|||
public ICommand SaveCommand { get; set; } |
|||
|
|||
private void SetSplitCount(SealBoxConfigureModel sealBoxConfigureModel) |
|||
{ |
|||
sealBoxConfigureModel.WareHourseDatas.Where(w => w.WareState == null || w.WareState == PositionState.待封箱).ToList().ForEach( |
|||
s => sealBoxConfigureModel.WareHourseDatas.Remove(s) |
|||
|
|||
); |
|||
var otherCount = sealBoxConfigureModel.WareHourseDatas.Count(); |
|||
if (sealBoxConfigureModel.SplitCount <= 0 || sealBoxConfigureModel.SplitCount < otherCount) |
|||
{ |
|||
MessageBox.Show("份数不正确"); |
|||
return; |
|||
} |
|||
|
|||
int resetIndex = 1; |
|||
foreach (var item in sealBoxConfigureModel.WareHourseDatas) |
|||
{ |
|||
item.Index = resetIndex; |
|||
resetIndex++; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
for (var i = 1 + otherCount; i <= sealBoxConfigureModel.SplitCount; i++) |
|||
{ |
|||
sealBoxConfigureModel.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel() |
|||
{ |
|||
Index = i, |
|||
Count = 0 |
|||
}); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
private StoreResponse store; |
|||
private void SetPackCountAndStore(object obj) |
|||
{ |
|||
|
|||
var sealBoxConfigureWareHourseModel = obj as SealBoxConfigureWareHourseModel; |
|||
if (storeList == null) |
|||
{ |
|||
var response = logisticsService.GetStoreList(); |
|||
if (!response.Success) |
|||
{ |
|||
MessageBox.Show(response.Msg, "获取仓库"); |
|||
return; |
|||
} |
|||
storeList = response.Data.Where(s => s.Status == StockStatus.使用).ToArray(); |
|||
} |
|||
if (store == null) |
|||
{ |
|||
if (sealBoxConfigureWareHourseModel != null) |
|||
store = new StoreResponse |
|||
{ |
|||
Id = sealBoxConfigureWareHourseModel.WareId, |
|||
Name = sealBoxConfigureWareHourseModel.WareName, |
|||
Type = ToStockType(sealBoxConfigureWareHourseModel.WareType), |
|||
Status = StockStatus.使用 |
|||
}; |
|||
} |
|||
|
|||
|
|||
|
|||
var w = new PackSkuSplitCountAndStoreWindow(sealBoxConfigureWareHourseModel.Count, store, storeList, sealBoxConfigureWareHourseModel.WareType == WareType.聚水潭齐越仓); |
|||
if (w.ShowDialog() == true) |
|||
{ |
|||
store = w.Store; |
|||
sealBoxConfigureWareHourseModel.Count = w.Quantity; |
|||
IsJST = w.IsJST; |
|||
sealBoxConfigureWareHourseModel.WareType = w.IsJST ? WareType.聚水潭齐越仓 : ToWareType(w.Store.Type); |
|||
sealBoxConfigureWareHourseModel.WareId = w.IsJST ? "qiyuejushuitan" : w.Store.Id; |
|||
sealBoxConfigureWareHourseModel.WareName = w.IsJST ? "齐越聚水潭" : w.Store.Name; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 是否聚水潭
|
|||
/// </summary>
|
|||
public bool IsJST { get; set; } |
|||
|
|||
private WareType ToWareType(StockType stockType) |
|||
{ |
|||
switch (stockType) |
|||
{ |
|||
case StockType.商家仓: |
|||
return WareType.商家仓; |
|||
break; |
|||
case StockType.京仓: |
|||
return WareType.京仓; |
|||
break; |
|||
case StockType.云仓: |
|||
return WareType.云仓; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
return WareType.聚水潭齐越仓; |
|||
} |
|||
|
|||
private StockType ToStockType(WareType? wareType) |
|||
{ |
|||
switch (wareType) |
|||
{ |
|||
case WareType.京仓: |
|||
return StockType.京仓; |
|||
break; |
|||
case WareType.云仓: |
|||
return StockType.云仓; |
|||
break; |
|||
case WareType.商家仓: |
|||
return StockType.商家仓; |
|||
break; |
|||
case WareType.聚水潭齐越仓: |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
|
|||
return StockType.京仓; |
|||
} |
|||
|
|||
private void Save(object obj) |
|||
{ |
|||
|
|||
if (SealBoxId <= 0)//设置分箱
|
|||
{ |
|||
SetSealBoxConfiguredRequest setSealBoxConfiguredRequest = new SetSealBoxConfiguredRequest(); |
|||
setSealBoxConfiguredRequest.ShopId = globalContext.User.Shop.ShopId.ToString(); |
|||
IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas = new List<SetSealBoxConfiguredData>(); |
|||
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) |
|||
{ |
|||
////todo: 到分箱界面判断
|
|||
//if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count())
|
|||
//{
|
|||
// MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!");
|
|||
// return;
|
|||
//}
|
|||
//判断任务数量与分箱数量总和是否相等
|
|||
if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) |
|||
{ |
|||
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); |
|||
return; |
|||
} |
|||
SetSealBoxConfiguredDatas.Add(new SetSealBoxConfiguredData |
|||
{ |
|||
SkuId = sealBoxConfigureModel.SkuId, |
|||
TaskId = sealBoxConfigureModel.TaskId, |
|||
TotalCount = sealBoxConfigureModel.SkuCount, |
|||
WareHourseDatas = sealBoxConfigureModel.WareHourseDatas.Select(x => new WareHourseData |
|||
{ |
|||
Count = x.Count, |
|||
WareId = x.WareId, |
|||
WareName = x.WareName, |
|||
WareType = x.WareType.Value, |
|||
}).ToList(), |
|||
}); |
|||
} |
|||
setSealBoxConfiguredRequest.SetSealBoxConfiguredDatas = SetSealBoxConfiguredDatas; |
|||
var setSealBoxRes = sealBoxService.SetSealBoxConfigured(setSealBoxConfiguredRequest); |
|||
if (setSealBoxRes == null) |
|||
{ |
|||
MessageBox.Show("网络异常"); |
|||
return; |
|||
} |
|||
if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data) |
|||
{ |
|||
MessageBox.Show(setSealBoxRes.Msg); |
|||
return; |
|||
} |
|||
if (ReflashWindow != null) ReflashWindow(); |
|||
|
|||
var window = obj as BWindow; |
|||
window.Close(); |
|||
} |
|||
|
|||
|
|||
if (SealBoxId > 0)//修改分箱
|
|||
{ |
|||
BatchUpdateSealBoxConfiguredRequest res = new BatchUpdateSealBoxConfiguredRequest() |
|||
{ |
|||
|
|||
SealBoxId = SealBoxId, |
|||
ShopId = globalContext.User.Shop.ShopId.ToString() |
|||
}; |
|||
|
|||
IList<UpdateSealBoxConfiguredDataRequest> UpdateSealBoxConfiguredDatas = new List<UpdateSealBoxConfiguredDataRequest>(); |
|||
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) |
|||
{ |
|||
|
|||
////todo: 到分箱界面判断
|
|||
//if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count())
|
|||
//{
|
|||
// MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!");
|
|||
// return;
|
|||
//}
|
|||
//判断任务数量与分箱数量总和是否相等
|
|||
if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) |
|||
{ |
|||
MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} 中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); |
|||
return; |
|||
} |
|||
UpdateSealBoxConfiguredDatas.Add(new UpdateSealBoxConfiguredDataRequest |
|||
{ |
|||
|
|||
TaskId = sealBoxConfigureModel.TaskId, |
|||
SkuCount = sealBoxConfigureModel.SkuCount, |
|||
SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Select(x => new SealBoxConfiguredWareHourseRequest |
|||
{ |
|||
Count = x.Count, |
|||
WareId = x.WareId, |
|||
WareName = x.WareName, |
|||
WareType = x.WareType.Value, |
|||
WareState = x.WareState, |
|||
|
|||
}).ToList(), |
|||
}); |
|||
} |
|||
res.UpdateSealBoxConfiguredDatas = UpdateSealBoxConfiguredDatas; |
|||
|
|||
|
|||
var setSealBoxRes = sealBoxService.BatchUpdateSealBoxConfigured(res); |
|||
if (setSealBoxRes == null) |
|||
{ |
|||
MessageBox.Show("网络异常"); |
|||
return; |
|||
} |
|||
if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data) |
|||
{ |
|||
MessageBox.Show(setSealBoxRes.Msg); |
|||
return; |
|||
} |
|||
if (ReflashWindow != null) ReflashWindow(); |
|||
var window = obj as BWindow; |
|||
window.Close(); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
public Action ReflashWindow { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,202 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.SealBox.SealBoxConfigureWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
mc:Ignorable="d" |
|||
Title="PackSkuConfigWindow" Height="500" Width="1024" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
Style="{StaticResource bwstyle}" |
|||
DataContext="{Binding SealBoxConfigureVModel,Source={StaticResource Locator}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="封箱配置" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Border> |
|||
|
|||
<ListBox x:Name="listbox" |
|||
ItemsSource="{Binding SealBoxConfigureModelList}" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
BorderThickness="1,0,0,0" |
|||
Grid.Row="1"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Width="{Binding ActualWidth,ElementName=listbox,Converter={StaticResource widthConverter},ConverterParameter=3}"> |
|||
|
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="170"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<!--{Binding Logo}--> |
|||
<c:BAsyncImage UrlSource="{Binding Logo}" |
|||
Width="150" DecodePixelWidth="150" |
|||
VerticalAlignment="Top" Margin="10 10 10 10" |
|||
Cursor="Hand"/> |
|||
|
|||
<Grid Grid.Column="1"> |
|||
<Grid.RowDefinitions> |
|||
|
|||
<RowDefinition Height="60"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<StackPanel Orientation="Horizontal"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0"> |
|||
<Run Text="SKU:"/> |
|||
<Run Text="{Binding SkuId}"/> |
|||
</TextBlock> |
|||
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0"> |
|||
<Run Text="任务ID:"/> |
|||
<Run Text="{Binding TaskId}"/> |
|||
</TextBlock> |
|||
|
|||
</StackPanel> |
|||
|
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Center" Grid.Column="1" Margin="30,10,0,0"> |
|||
<Run Text="采购数量:"/> |
|||
<Run Text="{Binding SkuCount}"/> |
|||
</TextBlock> |
|||
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="30,5,0,0"> |
|||
<TextBlock Text="份数:" VerticalAlignment="Center"/> |
|||
<c:BTextBox Text="{Binding SplitCount}" Width="40" Margin="5,0" Height="25"/> |
|||
<c:BButton Command="{Binding DataContext.SetSplitCountCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" |
|||
CommandParameter="{Binding }" |
|||
Content="设置" |
|||
Style="{StaticResource LinkButton}"/> |
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<Grid Grid.Row="2" Grid.ColumnSpan="2" |
|||
Visibility="{Binding WareHourseDatas.Count,ConverterParameter=0:Collapsed:Visible,Converter={StaticResource objConverter}}" |
|||
> |
|||
<!--<ListBox Grid.Row="2" Grid.ColumnSpan="2" Name="listbox_ware" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
BorderThickness="1,1,0,1" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
ItemsSource="{Binding WareHourseDatas}" |
|||
Width="Auto" |
|||
Margin="10,0,0,10" |
|||
HorizontalAlignment="Left" Height="92" |
|||
Visibility="{Binding DataContext.SealBoxId,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type c:BWindow}},ConverterParameter=0:Visible:Collapsed,Converter={StaticResource objConverter}}" |
|||
> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal"/> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Width="auto" Height="90" > |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition /> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="{Binding Index,StringFormat=第\{0\}份}" Style="{StaticResource middleTextBlock}"/> |
|||
<c:BButton MinWidth="100" Content="设置" Style="{StaticResource LinkButton}" Grid.Row="1" |
|||
Command="{Binding DataContext.SetPackCountAndStoreCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}" |
|||
CommandParameter="{Binding}"/> |
|||
<TextBlock Grid.Row="2" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 "> |
|||
<Run Text="{Binding WareName}"/> |
|||
<Run Text="{Binding Count,StringFormat= \{0\}件}"/> |
|||
|
|||
</TextBlock> |
|||
<Border Width="1" Grid.RowSpan="3" HorizontalAlignment="Right" |
|||
Background="{StaticResource Border.Brush}"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom" Grid.Row="1"/> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
|
|||
</ListBox>--> |
|||
<ListBox Grid.Row="2" Grid.ColumnSpan="2" |
|||
|
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
BorderThickness="1,1,0,1" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
ItemsSource="{Binding WareHourseDatas}" |
|||
Width="Auto" |
|||
Margin="10,0,0,10" |
|||
HorizontalAlignment="Left" Height="122" > |
|||
<!--Visibility="{Binding DataContext.SealBoxId,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type c:BWindow}},Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"--> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal"/> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Width="auto" Height="120" > |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition /> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="{Binding Index,StringFormat=第\{0\}份}" Style="{StaticResource middleTextBlock}"/> |
|||
<TextBlock Grid.Row="1" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 "> |
|||
<Run Text="{Binding Count,StringFormat=\{0\}件}"/> |
|||
</TextBlock> |
|||
<TextBlock Grid.Row="2" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 "> |
|||
<Run Text="{Binding WareName}"/> |
|||
</TextBlock> |
|||
<c:BButton MinWidth="100" Content="{Binding Count,Converter={StaticResource objConverter},ConverterParameter=0:设置:修改}" Style="{StaticResource LinkButton}" Grid.Row="3" |
|||
Command="{Binding DataContext.SetPackCountAndStoreCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}" |
|||
CommandParameter="{Binding}" |
|||
IsEnabled="{Binding WareState,Converter={StaticResource objConverter},ConverterParameter=#null|待封箱:True:False}" |
|||
/> |
|||
<Border Width="1" Grid.RowSpan="4" HorizontalAlignment="Right" |
|||
Background="{StaticResource Border.Brush}"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom" Grid.Row="1"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom" Grid.Row="2"/> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
|
|||
</ListBox> |
|||
</Grid> |
|||
|
|||
</Grid> |
|||
|
|||
<Border Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
|
|||
<Border HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
<Border Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
<c:BButton Content="{Binding SealBoxId,Converter={StaticResource objConverter},ConverterParameter=0:提交任务:保存}" Width="80" HorizontalAlignment="Right" Grid.Row="2" |
|||
Command="{Binding SaveCommand}" Margin="0,0,5,0" |
|||
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}" |
|||
/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,44 @@ |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Models.SealBox; |
|||
using BBWY.Client.ViewModels.SealBox; |
|||
using BBWY.Controls; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.SealBox |
|||
{ |
|||
/// <summary>
|
|||
/// SealBoxConfigureWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class SealBoxConfigureWindow : BWindow |
|||
{ |
|||
public SealBoxConfigureWindow(IList<SealBoxConfigureModel> sealBoxWaitConfigureModels, Action ReflashWindow, long sealboxId=0) |
|||
{ |
|||
InitializeComponent(); |
|||
var sealBoxConfigureViewModel = (SealBoxConfigureViewModel)this.DataContext; |
|||
|
|||
sealBoxConfigureViewModel.SealBoxId = sealboxId; |
|||
sealBoxConfigureViewModel.SealBoxConfigureModelList = new System.Collections.ObjectModel.ObservableCollection<SealBoxConfigureModel>(); |
|||
|
|||
sealBoxConfigureViewModel.ReflashWindow = ReflashWindow; |
|||
|
|||
foreach (var sealBoxWaitConfigureModel in sealBoxWaitConfigureModels) |
|||
{ |
|||
sealBoxWaitConfigureModel.Logo= sealBoxWaitConfigureModel.Logo.Replace("80x80", "150x150"); |
|||
App.Current.Dispatcher.Invoke(new Action(() => |
|||
{ |
|||
sealBoxConfigureViewModel.SealBoxConfigureModelList.Add(sealBoxWaitConfigureModel); |
|||
})); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,89 @@ |
|||
<UserControl x:Class="BBWY.Client.Views.SealBox.ShopSealBoxListControl" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox" |
|||
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
|||
DataContext="{Binding TaskList,Source={StaticResource Locator}}" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
mc:Ignorable="d" |
|||
d:DesignHeight="450" d:DesignWidth="1500"> |
|||
<UserControl.Resources> |
|||
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> |
|||
<ObjectDataProvider.MethodParameters> |
|||
<x:Type TypeName="cmodel:StorageType"/> |
|||
</ObjectDataProvider.MethodParameters> |
|||
</ObjectDataProvider> |
|||
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/> |
|||
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/> |
|||
<ctr:WaybillNoConverter x:Key="waybillConverter"/> |
|||
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/> |
|||
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/> |
|||
<Style TargetType="RadioButton"> |
|||
|
|||
<Setter Property="IsChecked" Value="False" /> |
|||
<Setter Property="Background" Value="#8080FF" /> |
|||
<Setter Property="Foreground" Value="Black" /> |
|||
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>--> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="RadioButton"> |
|||
<Grid Background="#F2F2F2" > |
|||
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5"> |
|||
<Rectangle.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform ScaleY="-1"/> |
|||
<SkewTransform/> |
|||
<RotateTransform/> |
|||
<TranslateTransform/> |
|||
</TransformGroup> |
|||
</Rectangle.RenderTransform> |
|||
</Rectangle> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35"> |
|||
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" /> |
|||
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsChecked" Value="true"> |
|||
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" /> |
|||
<Setter Property="Foreground" Value="white"/> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
</UserControl.Resources> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition /> |
|||
</Grid.RowDefinitions> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<RadioButton Content="已配置" Height="35" Width="130" Tag="{Binding SealBoxConfiguredCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:True:False}" |
|||
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.已配置}" |
|||
/> |
|||
<RadioButton Content="待配置" Height="35" Width="130" Tag="{Binding SealBoxWaitConfigureCount,Mode=TwoWay}" IsChecked="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:True:False}" |
|||
Command="{Binding SetSealBoxConfigureTypeCommand}" CommandParameter="{x:Static cmodel:SealBoxConfigureType.待配置}" |
|||
/> |
|||
<c:BButton Content="配置封箱策略" Width="130" Height="35" Margin="40 0 0 0" |
|||
Command="{Binding ConfiguredSealBoxCommand}" |
|||
/> |
|||
</StackPanel> |
|||
<Grid Grid.Row="1"> |
|||
|
|||
<local:SealBoxConfiguredControl |
|||
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=已配置:Visible:Collapsed}" |
|||
/> |
|||
<local:SealBoxWaitConfigureControl |
|||
Visibility="{Binding SealBoxConfigureType,Converter={StaticResource objConverter},ConverterParameter=待配置:Visible:Collapsed}" |
|||
/> |
|||
|
|||
</Grid> |
|||
</Grid> |
|||
</UserControl> |
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Navigation; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.SealBox |
|||
{ |
|||
/// <summary>
|
|||
/// ShopSealBoxListControl.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class ShopSealBoxListControl : UserControl |
|||
{ |
|||
public ShopSealBoxListControl() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.SealBox.UpdateSealBoxConfiguredWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.SealBox" |
|||
mc:Ignorable="d" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
|
|||
Title="修改分箱配置表" Height="500" Width="1024" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
Style="{StaticResource bwstyle}" |
|||
DataContext="{Binding SealBoxConfigureVModel,Source={StaticResource Locator}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="30"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="封箱配置修改" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Border> |
|||
|
|||
<ListBox x:Name="listbox" |
|||
ItemsSource="{Binding SealBoxConfigureModelList}" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
BorderThickness="1,0,0,0" |
|||
Grid.Row="1"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Width="{Binding ActualWidth,ElementName=listbox,Converter={StaticResource widthConverter},ConverterParameter=3}"> |
|||
|
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="170"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<!--{Binding Logo}--> |
|||
<c:BAsyncImage UrlSource="{Binding Logo}" |
|||
Width="150" DecodePixelWidth="150" |
|||
VerticalAlignment="Top" Margin="10 10 10 10" |
|||
Cursor="Hand"/> |
|||
|
|||
<Grid Grid.Column="1"> |
|||
<Grid.RowDefinitions> |
|||
|
|||
<RowDefinition Height="60"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<StackPanel Orientation="Horizontal"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0"> |
|||
<Run Text="SKU:"/> |
|||
<Run Text="{Binding SkuId}"/> |
|||
</TextBlock> |
|||
<TextBlock VerticalAlignment="Center" Margin="10,10,0,0"> |
|||
<Run Text="任务ID:"/> |
|||
<Run Text="{Binding TaskId}"/> |
|||
</TextBlock> |
|||
|
|||
</StackPanel> |
|||
|
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Center" Grid.Column="1" Margin="30,10,0,0"> |
|||
<Run Text="采购数量:"/> |
|||
<Run Text="{Binding SkuCount}"/> |
|||
</TextBlock> |
|||
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="30,5,0,0"> |
|||
<TextBlock Text="份数:" VerticalAlignment="Center"/> |
|||
<c:BTextBox Text="{Binding SplitCount}" Width="40" Margin="5,0" Height="25"/> |
|||
<c:BButton Command="{Binding DataContext.SetSplitCountCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" |
|||
CommandParameter="{Binding }" |
|||
Content="设置" |
|||
Style="{StaticResource LinkButton}"/> |
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
|
|||
</Grid> |
|||
|
|||
<Border Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
|
|||
<Border HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
<Border Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
<c:BButton Content="保存" Width="80" HorizontalAlignment="Right" Grid.Row="2" |
|||
Command="{Binding SaveUpdateCommand}" Margin="0,0,5,0" |
|||
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}" |
|||
/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,26 @@ |
|||
using BBWY.Controls; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.SealBox |
|||
{ |
|||
/// <summary>
|
|||
/// UpdateSealBoxConfiguredWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class UpdateSealBoxConfiguredWindow : BWindow |
|||
{ |
|||
public UpdateSealBoxConfiguredWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue