39 changed files with 2039 additions and 225 deletions
@ -0,0 +1,554 @@ |
|||||
|
using BBWY.Client.APIServices; |
||||
|
using BBWY.Client.Models.PackTask; |
||||
|
using BBWY.Client.ViewModels; |
||||
|
using BBWY.Client.Views.PackTask; |
||||
|
using BBWY.Common.Models; |
||||
|
using GalaSoft.MvvmLight.Command; |
||||
|
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.Controls; |
||||
|
using System.Windows.Input; |
||||
|
|
||||
|
namespace BBWY.Client.Models |
||||
|
{ |
||||
|
//public class ComboxItem
|
||||
|
//{
|
||||
|
// public int { get; set; }
|
||||
|
//}
|
||||
|
public class BatchPublishTask : NotifyObject |
||||
|
{ |
||||
|
|
||||
|
#region 属性
|
||||
|
|
||||
|
private ObservableCollection<ComboBoxItem> positionTypeList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{IsSelected = false,Content = "本地仓"}, new ComboBoxItem{IsSelected = false,Content = "齐越仓"}, new ComboBoxItem{IsSelected = false,Content = "京东仓"} |
||||
|
|
||||
|
}; |
||||
|
public ObservableCollection<ComboBoxItem> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } |
||||
|
private ObservableCollection<ComboBoxItem> packTypeList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{ Content="单件",IsSelected=false }, new ComboBoxItem{ Content="多件",IsSelected=false } |
||||
|
}; |
||||
|
public ObservableCollection<ComboBoxItem> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } |
||||
|
|
||||
|
private ObservableCollection<ComboBoxItem> basicPackList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{ Content="快递袋",IsSelected=false }, new ComboBoxItem{ Content="纸箱",IsSelected=false }, new ComboBoxItem{ Content="麻袋",IsSelected=false } |
||||
|
}; |
||||
|
public ObservableCollection<ComboBoxItem> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } |
||||
|
private ObservableCollection<ComboBoxItem> isNeedBarCodeList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{IsSelected = false,Content = "需要"}, new ComboBoxItem{IsSelected = false,Content = "不需要"}}; |
||||
|
public ObservableCollection<ComboBoxItem> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } |
||||
|
|
||||
|
private ObservableCollection<ComboBoxItem> certificatePositionList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{ Content="无",IsSelected=false }, new ComboBoxItem{ Content="外部包装",IsSelected=false }, new ComboBoxItem{ Content="产品包装",IsSelected=false } |
||||
|
}; |
||||
|
public ObservableCollection<ComboBoxItem> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } |
||||
|
private ObservableCollection<ComboBoxItem> availabilityList = new ObservableCollection<ComboBoxItem> { |
||||
|
new ComboBoxItem{ Content="已到货",IsSelected=false }, new ComboBoxItem{ Content="部分到货",IsSelected=false }, new ComboBoxItem{ Content="未到货",IsSelected=false } |
||||
|
}; |
||||
|
public ObservableCollection<ComboBoxItem> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } } |
||||
|
|
||||
|
private int skuCount; |
||||
|
/// <summary>
|
||||
|
/// Sku任务数
|
||||
|
/// </summary>
|
||||
|
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } |
||||
|
|
||||
|
private string skuId; |
||||
|
/// <summary>
|
||||
|
/// Sku
|
||||
|
/// </summary>
|
||||
|
public string SkuId { get => skuId; set { Set(ref skuId, value); } } |
||||
|
|
||||
|
private string logo; |
||||
|
/// <summary>
|
||||
|
/// 店铺Sku图链接
|
||||
|
/// </summary>
|
||||
|
public string Logo { get => logo; set { Set(ref logo, value); } } |
||||
|
|
||||
|
private string skuName; |
||||
|
/// <summary>
|
||||
|
/// 采购Sku名称
|
||||
|
/// </summary>
|
||||
|
public string SkuName { get => skuName; set { Set(ref skuName, value); } } |
||||
|
|
||||
|
private string brand; |
||||
|
/// <summary>
|
||||
|
/// 品牌
|
||||
|
/// </summary>
|
||||
|
public string Brand { get => brand; set { Set(ref brand, value); } } |
||||
|
|
||||
|
|
||||
|
private string productNo; |
||||
|
/// <summary>
|
||||
|
/// 货号
|
||||
|
/// </summary>
|
||||
|
public string ProductNo { get => productNo; set { Set(ref productNo, value); } } |
||||
|
|
||||
|
private string brandName; |
||||
|
/// <summary>
|
||||
|
/// 品名(手写上传)
|
||||
|
/// </summary>
|
||||
|
public string BrandName { get => brandName; set { Set(ref brandName, value); } } |
||||
|
|
||||
|
|
||||
|
private int goodsNumber; |
||||
|
/// <summary>
|
||||
|
/// 配件数
|
||||
|
/// </summary>
|
||||
|
public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } |
||||
|
private Worry isWorry; |
||||
|
/// <summary>
|
||||
|
/// 是否加急
|
||||
|
/// </summary>
|
||||
|
public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } |
||||
|
|
||||
|
private TaskState availability; |
||||
|
/// <summary>
|
||||
|
/// 到货情况(待收货=0,部分收货=1,已到货=2)
|
||||
|
/// </summary>
|
||||
|
public TaskState Availability { get => availability; set { Set(ref availability, value); } } |
||||
|
|
||||
|
private PackType packType; |
||||
|
/// <summary>
|
||||
|
/// 打包类型(单件=0,多件=1)
|
||||
|
/// </summary>
|
||||
|
public PackType PackType { get => packType; set { Set(ref packType, value); } } |
||||
|
|
||||
|
private BasicPack basicPack; |
||||
|
/// <summary>
|
||||
|
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
||||
|
/// </summary>
|
||||
|
public BasicPack BasicPack { get => basicPack; set { Set(ref basicPack, value); } } |
||||
|
|
||||
|
private PositionType positionType; |
||||
|
/// <summary>
|
||||
|
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
|
||||
|
/// </summary>
|
||||
|
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } |
||||
|
|
||||
|
private string skuTitle; |
||||
|
/// <summary>
|
||||
|
/// sku配件商品名称
|
||||
|
/// </summary>
|
||||
|
public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } } |
||||
|
|
||||
|
private Need isNeedBarCode; |
||||
|
/// <summary>
|
||||
|
/// 是否需要合格证
|
||||
|
/// </summary>
|
||||
|
public Need IsNeedBarCode { get => isNeedBarCode; set { Set(ref isNeedBarCode, value); } } |
||||
|
|
||||
|
|
||||
|
private Need isNeedCertificateModel; |
||||
|
/// <summary>
|
||||
|
/// 是否需要条形码
|
||||
|
/// </summary>
|
||||
|
public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } |
||||
|
|
||||
|
|
||||
|
private BarCodeModel barCodeModel; |
||||
|
/// <summary>
|
||||
|
/// 条形码
|
||||
|
/// </summary>
|
||||
|
public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } } |
||||
|
|
||||
|
|
||||
|
private bool isSetBarCode; |
||||
|
/// <summary>
|
||||
|
/// 设置显示(条形码)
|
||||
|
/// </summary>
|
||||
|
public bool IsSetBarCode |
||||
|
{ |
||||
|
get => isSetBarCode; |
||||
|
set |
||||
|
{ |
||||
|
|
||||
|
Set(ref isSetBarCode, value); |
||||
|
IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private bool isSetCertificate; |
||||
|
/// <summary>
|
||||
|
/// 设置显示(合格证)
|
||||
|
/// </summary>
|
||||
|
public bool IsSetCertificate |
||||
|
{ |
||||
|
get => isSetCertificate; set |
||||
|
{ |
||||
|
|
||||
|
Set(ref isSetCertificate, value); |
||||
|
IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要; |
||||
|
} |
||||
|
} |
||||
|
private string setSpuCerStatus; |
||||
|
|
||||
|
public string SetSpuCerStatus { get => setSpuCerStatus; set { Set(ref setSpuCerStatus, value); } } |
||||
|
private bool isSetSpuCertificate = true; |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设置spu显示(合格证)
|
||||
|
/// </summary>
|
||||
|
public bool IsSetSpuCertificate |
||||
|
{ |
||||
|
get => isSetSpuCertificate; set |
||||
|
{ |
||||
|
|
||||
|
Set(ref isSetSpuCertificate, value); |
||||
|
SetSpuCerStatus = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
private string saveTask; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设置显示(合格证)
|
||||
|
/// </summary>
|
||||
|
public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } |
||||
|
|
||||
|
|
||||
|
private string spuId; |
||||
|
/// <summary>
|
||||
|
/// 合格证
|
||||
|
/// </summary>
|
||||
|
public string SpuId { get => spuId; set { Set(ref spuId, value); } } |
||||
|
|
||||
|
private CertificateModel spuCertificateModel; |
||||
|
/// <summary>
|
||||
|
/// spu合格证
|
||||
|
/// </summary>
|
||||
|
public CertificateModel SpuCertificateModel { get => spuCertificateModel; set { Set(ref spuCertificateModel, value); } } |
||||
|
|
||||
|
|
||||
|
|
||||
|
private CertificateModel certificateModel; |
||||
|
/// <summary>
|
||||
|
/// 合格证
|
||||
|
/// </summary>
|
||||
|
public CertificateModel CertificateModel { get => certificateModel; set { Set(ref certificateModel, value); } } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合格证位置(外部包装=0,产品包装=1)
|
||||
|
/// </summary>
|
||||
|
private CertificatePosition certificatePosition; |
||||
|
/// <summary>
|
||||
|
/// 合格证位置(外部包装=0,产品包装=1)
|
||||
|
/// </summary>
|
||||
|
public CertificatePosition CertificatePosition { get => certificatePosition; set { Set(ref certificatePosition, value); } } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注意事项(对接备注)
|
||||
|
/// </summary>
|
||||
|
private string markMessage; |
||||
|
/// <summary>
|
||||
|
/// 注意事项(对接备注)
|
||||
|
/// </summary>
|
||||
|
public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } } |
||||
|
|
||||
|
|
||||
|
private ObservableCollection<IncreateModel> increateList; |
||||
|
/// <summary>
|
||||
|
/// 增量耗材查询关键字
|
||||
|
/// </summary>
|
||||
|
public ObservableCollection<IncreateModel> IncreateList { get => increateList; set { Set(ref increateList, value); } } |
||||
|
#endregion
|
||||
|
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
||||
|
public PackTaskService packTaskService; |
||||
|
public ProductService productService; |
||||
|
public BatchPublishTask() |
||||
|
{ |
||||
|
IncreateList = new ObservableCollection<IncreateModel>(); |
||||
|
foreach (var item in increates) |
||||
|
{ |
||||
|
IncreateList.Add(new IncreateModel |
||||
|
{ |
||||
|
IncreateName = item, |
||||
|
IsSelected = false |
||||
|
}); |
||||
|
} |
||||
|
SetBarCodeCommand = new RelayCommand(SetBarCode); |
||||
|
SetCertificateCommand = new RelayCommand(SetCertificate); |
||||
|
LookBarCommand = new RelayCommand(LookBar); |
||||
|
LookCerCommand = new RelayCommand(LookCer); |
||||
|
|
||||
|
} |
||||
|
#region 方法
|
||||
|
public ICommand SetBarCodeCommand { get; set; } |
||||
|
public ICommand SetCertificateCommand { get; set; } |
||||
|
public ICommand LookBarCommand { get; set; } |
||||
|
public ICommand LookCerCommand { get; set; } |
||||
|
|
||||
|
|
||||
|
private void SetBarCode() |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(SkuId)) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
if (BarCodeModel == null) |
||||
|
{ |
||||
|
BarCodeModel = new BarCodeModel(); |
||||
|
BarCodeModel.ProductNo = ProductNo; |
||||
|
BarCodeModel.Brand = Brand; |
||||
|
BarCodeModel.SkuId = SkuId; |
||||
|
BarCodeModel.SkuName = SkuName; |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(BrandName)) |
||||
|
BarCodeModel.BrandName = BrandName; |
||||
|
|
||||
|
|
||||
|
SetBarCodeWindow setBarCodeWindow = new SetBarCodeWindow(); |
||||
|
setBarCodeWindow.LoadData(BarCodeModel, packTaskService); |
||||
|
setBarCodeWindow.SaveResult = b => |
||||
|
{ |
||||
|
BarCodeModel = b; |
||||
|
IsSetBarCode = false; |
||||
|
IsNeedBarCode = Need.需要; |
||||
|
}; |
||||
|
setBarCodeWindow.Show(); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设置合格证
|
||||
|
/// </summary>
|
||||
|
private void SetCertificate() |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(SkuId)) |
||||
|
return; |
||||
|
|
||||
|
SearSpuCer(); |
||||
|
|
||||
|
if (CertificateModel == null) |
||||
|
{ |
||||
|
CertificateModel = new CertificateModel(); |
||||
|
CertificateModel.ProductNo = ProductNo; |
||||
|
CertificateModel.Brand = Brand; |
||||
|
CertificateModel.SkuId = SkuId; |
||||
|
|
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(BrandName)) |
||||
|
CertificateModel.BrandName = BrandName; |
||||
|
SetCerWindow setCerWindow = new SetCerWindow(); |
||||
|
setCerWindow.LoadData(certificateModel, packTaskService, spuCertificateModel, IsSetSpuCertificate); |
||||
|
setCerWindow.SaveResult = s => |
||||
|
{ |
||||
|
CertificateModel = s; |
||||
|
IsSetCertificate = false; |
||||
|
IsNeedCertificateModel = Need.需要; |
||||
|
}; |
||||
|
setCerWindow.Show(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 查看合格证
|
||||
|
/// </summary>
|
||||
|
private void LookCer() |
||||
|
{ |
||||
|
LookCerWindow lookCerWindow = new LookCerWindow(CertificateModel); |
||||
|
lookCerWindow.Show(); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 查看条形码
|
||||
|
/// </summary>
|
||||
|
private void LookBar() |
||||
|
{ |
||||
|
LookBarCodeWindow look = new LookBarCodeWindow(); |
||||
|
look.SetData(BarCodeModel); |
||||
|
look.Show(); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 搜索 skuId
|
||||
|
/// </summary>
|
||||
|
public void SearchSku(string skuid) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(skuid)) |
||||
|
return; |
||||
|
|
||||
|
ApiResponse<ProductListResponse> productApiResponse = null; |
||||
|
var skuResponse = productService.GetProductSkuList(string.Empty, skuid); |
||||
|
if (skuResponse.Success) |
||||
|
{ |
||||
|
if (skuResponse.Data.Count == 0) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
Logo = skuResponse.Data[0].Logo.Replace("80x80", "200x200"); |
||||
|
SkuName = skuResponse.Data[0].Title; |
||||
|
|
||||
|
|
||||
|
SpuId = skuResponse.Data[0].ProductId; |
||||
|
|
||||
|
productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1); |
||||
|
|
||||
|
if (productApiResponse.Success) |
||||
|
{ |
||||
|
if (productApiResponse.Data.Count == 0) |
||||
|
{ |
||||
|
|
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
ProductNo = productApiResponse.Data.Items[0].ProductItemNum; |
||||
|
Brand = productApiResponse.Data.Items[0].BrandName; |
||||
|
|
||||
|
} |
||||
|
var productSku = packTaskService.GetProductSku(skuid); |
||||
|
if (productSku == null || !productSku.Success) |
||||
|
{ |
||||
|
|
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (productSku.Data.PackConfig != null) |
||||
|
{ |
||||
|
var config = productSku.Data.PackConfig; |
||||
|
SkuTitle = config.SkuGoodsTitle; |
||||
|
GoodsNumber = config.GoodsNumber; |
||||
|
PackType = (PackType)config.PackType; |
||||
|
BasicPack = (BasicPack)config.BasicPack; |
||||
|
Availability = (TaskState)config.Availability; |
||||
|
MarkMessage = config.MarkMessage; |
||||
|
CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; |
||||
|
// Increment1 = config.Increment1;
|
||||
|
string[] increateDatas = config.Increment1.Split(','); |
||||
|
|
||||
|
bool isSelected = false; |
||||
|
foreach (var item in increates) |
||||
|
{ |
||||
|
isSelected = false; |
||||
|
if (increateDatas.Contains(item)) |
||||
|
{ |
||||
|
isSelected = true; |
||||
|
} |
||||
|
App.Current.Dispatcher.Invoke(() => |
||||
|
{ |
||||
|
IncreateList.Add(new IncreateModel |
||||
|
{ |
||||
|
IncreateName = item, |
||||
|
IsSelected = isSelected |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
BrandName = productSku.Data.BrandName; |
||||
|
|
||||
|
|
||||
|
CertificateModel = productSku.Data.Certificate; |
||||
|
IsSetCertificate = false; |
||||
|
if (CertificateModel == null) |
||||
|
{ |
||||
|
CertificateModel = new CertificateModel(); |
||||
|
IsSetCertificate = true; |
||||
|
|
||||
|
} |
||||
|
CertificateModel.Brand = Brand; |
||||
|
if (!string.IsNullOrEmpty(BrandName)) |
||||
|
CertificateModel.BrandName = BrandName; |
||||
|
CertificateModel.ProductNo = ProductNo; |
||||
|
CertificateModel.SkuId = skuid; |
||||
|
BarCodeModel = productSku.Data.BarCodeModel; |
||||
|
IsSetBarCode = false; |
||||
|
if (BarCodeModel == null) |
||||
|
{ |
||||
|
BarCodeModel = new BarCodeModel(); |
||||
|
IsSetBarCode = true; |
||||
|
} |
||||
|
BarCodeModel.Brand = Brand; |
||||
|
if (!string.IsNullOrEmpty(BrandName)) |
||||
|
BarCodeModel.BrandName = BrandName; |
||||
|
BarCodeModel.ProductNo = ProductNo; |
||||
|
BarCodeModel.SkuId = skuid; |
||||
|
BarCodeModel.SkuName = SkuName; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
|
||||
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku")); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void SearSpuCer() |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(SpuId)) |
||||
|
{ |
||||
|
SearchSku(SkuId); |
||||
|
return; |
||||
|
} |
||||
|
SpuId = SpuId.Trim();//去掉空格 避免数据异常
|
||||
|
|
||||
|
|
||||
|
var productSku = packTaskService.GetSpuCer(SpuId); |
||||
|
if (productSku == null || !productSku.Success) |
||||
|
{ |
||||
|
IsSetSpuCertificate = true; |
||||
|
|
||||
|
return; |
||||
|
} |
||||
|
SpuCertificateModel = productSku.Data; |
||||
|
IsSetSpuCertificate = false; |
||||
|
if (SpuCertificateModel == null) |
||||
|
{ |
||||
|
SpuCertificateModel = new CertificateModel(); |
||||
|
IsSetSpuCertificate = true; |
||||
|
SpuCertificateModel.Brand = Brand; |
||||
|
SpuCertificateModel.BrandName = BrandName; |
||||
|
SpuCertificateModel.ProductNo = ProductNo; |
||||
|
SpuCertificateModel.SpuId = SpuId; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void InitData() |
||||
|
{ |
||||
|
|
||||
|
IncreateList = new ObservableCollection<IncreateModel>(); |
||||
|
SpuId = string.Empty; |
||||
|
SaveTask = "发布"; |
||||
|
|
||||
|
Logo = string.Empty; |
||||
|
|
||||
|
SkuId = ""; |
||||
|
SkuCount = 0; |
||||
|
SkuName = string.Empty; |
||||
|
ProductNo = string.Empty; |
||||
|
Brand = string.Empty; |
||||
|
BrandName = string.Empty; |
||||
|
this.MarkMessage = ""; |
||||
|
IsSetBarCode = true; |
||||
|
IsSetCertificate = true; |
||||
|
BarCodeModel = null; |
||||
|
CertificateModel = null; |
||||
|
SkuTitle = string.Empty; |
||||
|
GoodsNumber = 0; |
||||
|
foreach (var item in increates) |
||||
|
{ |
||||
|
IncreateList.Add(new IncreateModel |
||||
|
{ |
||||
|
IncreateName = item, |
||||
|
IsSelected = false |
||||
|
}); |
||||
|
} |
||||
|
//SearchSku(SkuId);
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,172 @@ |
|||||
|
using BBWY.Client.APIServices; |
||||
|
using BBWY.Client.Models; |
||||
|
using BBWY.Client.Views.PackTask; |
||||
|
using BBWY.Common.Models; |
||||
|
using GalaSoft.MvvmLight.Command; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Collections.ObjectModel; |
||||
|
using System.Net.Mail; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using System.Windows.Input; |
||||
|
using System.Linq; |
||||
|
using System.Windows; |
||||
|
using GalaSoft.MvvmLight.Messaging; |
||||
|
|
||||
|
namespace BBWY.Client.ViewModels |
||||
|
{ |
||||
|
public class BatchPublishTaskViewModel : BaseVM, IDenpendency |
||||
|
{ |
||||
|
|
||||
|
PackTaskService packTaskService; |
||||
|
ProductService productService; |
||||
|
private bool isLoading = false; |
||||
|
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
||||
|
|
||||
|
private ObservableCollection<BatchPublishTask> batchPublishTasks; |
||||
|
public ObservableCollection<BatchPublishTask> BatchPublishTasks { get => batchPublishTasks; set { Set(ref batchPublishTasks, value); } } |
||||
|
// public ObservableCollection<BatchPublishTask> BatchPublishTasks;
|
||||
|
public ICommand OpenSkuDetailCommand { get; set; } |
||||
|
public ICommand CreateTaskCommand { get; set; } |
||||
|
public BatchPublishTaskViewModel(PackTaskService packTaskService, ProductService productService, GlobalContext globalContext) |
||||
|
{ |
||||
|
BatchPublishTasks = new ObservableCollection<BatchPublishTask>(); |
||||
|
this.packTaskService = packTaskService; |
||||
|
this.productService = productService; |
||||
|
CreateTaskCommand = new RelayCommand<object>(CreateTask); |
||||
|
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
||||
|
this.globalContext = globalContext; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
private void OpenSkuDetail(object param) |
||||
|
{ |
||||
|
var paramList = (object[])param; |
||||
|
// var orderId = paramList[0].ToString();
|
||||
|
var skuId = paramList[0].ToString(); |
||||
|
|
||||
|
|
||||
|
var url = $"https://item.jd.com/{skuId}.html"; |
||||
|
try |
||||
|
{ |
||||
|
System.Diagnostics.Process.Start("explorer.exe", url); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
Clipboard.SetText(url); |
||||
|
MessageBox.Show($"{ex.Message}\r\n调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
GlobalContext globalContext; |
||||
|
private void CreateTask(object obj) |
||||
|
{ |
||||
|
foreach (var task in BatchPublishTasks) |
||||
|
{ |
||||
|
string increateStr = ""; |
||||
|
var increates = task.IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName); |
||||
|
if (increates != null && increates.Count() > 0) |
||||
|
{ |
||||
|
increateStr = string.Join(",", increates); |
||||
|
} |
||||
|
var createTaskModel = new Models.APIModel.Request.CreateTaskRequest |
||||
|
{ |
||||
|
ProductNo = task.ProductNo, |
||||
|
Logo = task.Logo, |
||||
|
SkuName = task.SkuName, |
||||
|
BrandName = task.BrandName, |
||||
|
Availability = (int)task.Availability, |
||||
|
BasicPack = (int)task.BasicPack, |
||||
|
SkuId = task.SkuId, |
||||
|
CreateTime = DateTime.Now, |
||||
|
Increment1 = increateStr, |
||||
|
CertificatePosition = (int)task.CertificatePosition, |
||||
|
PackType = (int)task.PackType, |
||||
|
MarkMessage = task.MarkMessage, |
||||
|
PositionType = (int)task.PositionType, |
||||
|
GoodsNumber = task.GoodsNumber, |
||||
|
SkuGoodsTitle = task.SkuTitle, |
||||
|
SkuCount = task.SkuCount, |
||||
|
UserId = globalContext.User.Id.ToString(), |
||||
|
ShopId = PurchaserId, |
||||
|
IsWorry = task.IsWorry, |
||||
|
OrderId = orderId, |
||||
|
Platform =platform |
||||
|
}; |
||||
|
if (task.IsNeedBarCode == Need.需要) |
||||
|
{ |
||||
|
if (task.BarCodeModel == null || task.BarCodeModel.Id <= 0) |
||||
|
{ |
||||
|
new TipsWindow("请设置条形码模板").Show(); |
||||
|
return; |
||||
|
} |
||||
|
createTaskModel.BarCodeId = task.BarCodeModel.Id; |
||||
|
} |
||||
|
if (task.IsNeedCertificateModel == Need.需要) |
||||
|
{ |
||||
|
if (task.CertificateModel == null || task.CertificateModel.Id <= 0) |
||||
|
{ |
||||
|
new TipsWindow("请设置合格证模板").Show(); |
||||
|
return; |
||||
|
} |
||||
|
createTaskModel.CertificateId = task.CertificateModel.Id;//
|
||||
|
} |
||||
|
ApiResponse<object> res = null; |
||||
|
res = packTaskService.CreateTask(createTaskModel); |
||||
|
|
||||
|
if (!res.Success) |
||||
|
{ |
||||
|
new TipsWindow(res.Msg); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
//var win = obj as System.Windows.Window;
|
||||
|
|
||||
|
Messenger.Default.Send(true, "CloseBatchPublishTaskWindow"); |
||||
|
//win.Close();
|
||||
|
if (PublishTask != null) PublishTask(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public Action PublishTask { get; set; } |
||||
|
|
||||
|
|
||||
|
Platform platform; string orderId; string PurchaserId; |
||||
|
public void AddSkus(Platform platform, string orderId, string PurchaserId, List<PurchaseOrderSku> purchaseOrderSkus) |
||||
|
{ |
||||
|
BatchPublishTasks = new ObservableCollection<BatchPublishTask>(); |
||||
|
this.platform = platform; this.orderId = orderId; |
||||
|
this.PurchaserId = PurchaserId; |
||||
|
BatchPublishTask model = null; |
||||
|
IsLoading = true; |
||||
|
foreach (var item in purchaseOrderSkus) |
||||
|
{ |
||||
|
model = new BatchPublishTask(); |
||||
|
model.productService = productService; |
||||
|
model.packTaskService = packTaskService; |
||||
|
model.SkuId = item.SkuId; |
||||
|
model.SkuCount = item.Quantity.Value; |
||||
|
model.Logo = item.Logo.Replace("80x80", "200x200"); |
||||
|
model.SpuId = item.ProductId; |
||||
|
model.SkuName = item.SkuTitle; |
||||
|
model.SearchSku(item.SkuId); |
||||
|
App.Current.Dispatcher.Invoke(() => |
||||
|
{ |
||||
|
BatchPublishTasks.Add(model); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
IsLoading = false; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,270 @@ |
|||||
|
<c:BWindow x:Class="BBWY.Client.Views.BatchPurchase.BatchPublishTaskWindow" |
||||
|
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.BatchPurchase" |
||||
|
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
||||
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
||||
|
xmlns:ctr="clr-namespace:BBWY.Client.Converters" |
||||
|
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
||||
|
xmlns:hc="https://handyorg.github.io/handycontrol" |
||||
|
mc:Ignorable="d" |
||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
||||
|
CloseButtonVisibility="Visible" |
||||
|
CloseButtonColor="{StaticResource WindowButtonColor}" |
||||
|
DataContext="{Binding BatchPublishTask,Source={StaticResource Locator}}" |
||||
|
MinButtonVisibility="Collapsed" |
||||
|
MaxButtonVisibility="Collapsed" |
||||
|
RightButtonGroupMargin="0,5,5,0" |
||||
|
Title="发布任务" Height="800" Width="1300"> |
||||
|
<!-- DataContext="{Binding CreateTaskView,Source={StaticResource Locator}}" --> |
||||
|
<Window.Resources> |
||||
|
<ResourceDictionary> |
||||
|
|
||||
|
<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"/> |
||||
|
</ResourceDictionary> |
||||
|
|
||||
|
</Window.Resources> |
||||
|
|
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="40"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="40"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> |
||||
|
<Grid Background="{StaticResource Border.Background}"> |
||||
|
<TextBlock Text="发布任务" VerticalAlignment="Center" HorizontalAlignment="Center" /> |
||||
|
</Grid> |
||||
|
<ListBox x:Name="listbox_order" |
||||
|
Grid.Row="1" |
||||
|
ItemsSource="{Binding BatchPublishTasks,Mode=TwoWay}" |
||||
|
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
||||
|
BorderBrush="{StaticResource Border.Brush}" |
||||
|
BorderThickness="1,1,1,1" |
||||
|
Foreground="{StaticResource Text.Color}"> |
||||
|
<ListBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}" |
||||
|
MinHeight="100"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="200"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Grid.Column="1"/> |
||||
|
<StackPanel Orientation="Vertical" Grid.Column="0"> |
||||
|
<c:BAsyncImage UrlSource="{Binding Logo}" |
||||
|
Width="150" DecodePixelWidth="150" |
||||
|
VerticalAlignment="Top" Margin="25 13 25 13" |
||||
|
Cursor="Hand"> |
||||
|
<b:Interaction.Triggers> |
||||
|
<b:EventTrigger EventName="PreviewMouseLeftButtonDown"> |
||||
|
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"> |
||||
|
<b:InvokeCommandAction.CommandParameter> |
||||
|
<MultiBinding Converter="{StaticResource mptConverter}"> |
||||
|
<Binding Path="SkuId"/> |
||||
|
</MultiBinding> |
||||
|
</b:InvokeCommandAction.CommandParameter> |
||||
|
</b:InvokeCommandAction> |
||||
|
</b:EventTrigger> |
||||
|
</b:Interaction.Triggers> |
||||
|
</c:BAsyncImage> |
||||
|
<TextBlock Margin="25 0 0 10"> |
||||
|
<Run Text="SKU名称:"/> |
||||
|
<Run Text="{Binding SkuName}"/> |
||||
|
</TextBlock > |
||||
|
<TextBlock Margin="25 0 0 10"> |
||||
|
<Run Text="货号:"/> |
||||
|
<Run Text="{Binding ProductNo}"/> |
||||
|
</TextBlock> |
||||
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="25 0 0 10" Height="30"> |
||||
|
<TextBlock Text="品名:" VerticalAlignment="Center"/> |
||||
|
<c:BTextBox Text="{Binding BrandName}" Height="30" Width="120" WaterRemark="请输入品名"/> |
||||
|
|
||||
|
</StackPanel> |
||||
|
<StackPanel Margin="25 0 0 10" Orientation="Horizontal"> |
||||
|
<TextBlock Text="条形码:"/> |
||||
|
<c:BButton Content="设置" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetBarCodeCommand}" |
||||
|
Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }" |
||||
|
/> |
||||
|
<StackPanel Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }" Orientation="Horizontal" HorizontalAlignment="Center" > |
||||
|
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding LookBarCommand}"/> |
||||
|
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetBarCodeCommand}"/> |
||||
|
</StackPanel > |
||||
|
</StackPanel> |
||||
|
<StackPanel Margin="25 0 0 5" Orientation="Horizontal"> |
||||
|
<TextBlock Text="合格证:"/> |
||||
|
<c:BButton Content="设置" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetCertificateCommand}" |
||||
|
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"/> |
||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" |
||||
|
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"> |
||||
|
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding LookCerCommand}"/> |
||||
|
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetCertificateCommand}"/> |
||||
|
</StackPanel > |
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
|
<Grid Grid.Column="1"> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Grid > |
||||
|
<TextBlock Text="任务信息" FontWeight="Bold" Margin="19 23" HorizontalAlignment="Left" VerticalAlignment="Top"/> |
||||
|
<StackPanel Height="25" VerticalAlignment="Center" Margin="19 64" Orientation="Horizontal" HorizontalAlignment="Left" > |
||||
|
<TextBlock Text="数量:" VerticalAlignment="Center"/> |
||||
|
<c:BTextBox WaterRemark="打包数量" Height="25" Width="90" Text="{Binding SkuCount}" /> |
||||
|
<TextBlock Margin="30 0 0 0" Text="到货情况:" VerticalAlignment="Center"/> |
||||
|
<ComboBox VerticalContentAlignment="Center" ItemsSource="{Binding AvailabilityList}" Text="{Binding Availability}" > |
||||
|
|
||||
|
</ComboBox> |
||||
|
<TextBlock Margin="30 0 0 0" Text="加急:" VerticalAlignment="Center"/> |
||||
|
<ComboBox VerticalContentAlignment="Center" Text="{Binding IsWorry}" > |
||||
|
<ComboBoxItem Content="否" IsSelected="True" /> |
||||
|
<ComboBoxItem Content="是"/> |
||||
|
</ComboBox> |
||||
|
</StackPanel> |
||||
|
|
||||
|
<c:BTextBox HorizontalAlignment="Left" Text="{Binding MarkMessage}" VerticalAlignment="Top" Height="100" Width="350" |
||||
|
WaterRemark="备注信息" Margin="400 64 0 0 " AcceptsReturn="True" TextWrapping="Wrap"> |
||||
|
|
||||
|
</c:BTextBox> |
||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Height="25" |
||||
|
Margin="19 118 0 0"> |
||||
|
<TextBlock Text="落仓去向:" VerticalAlignment="Center"/> |
||||
|
<ComboBox VerticalContentAlignment="Center" ItemsSource="{Binding PositionTypeList}" Text="{Binding PositionType}" > |
||||
|
|
||||
|
</ComboBox> |
||||
|
</StackPanel> |
||||
|
|
||||
|
</Grid> |
||||
|
<Grid Grid.Row="1"> |
||||
|
<TextBlock Text="打包配置" FontWeight="Bold" Margin="19 23" /> |
||||
|
<Grid Height="70" Margin="19 64"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="77"/> |
||||
|
<ColumnDefinition Width="77"/> |
||||
|
<ColumnDefinition MinWidth="77"/> |
||||
|
<ColumnDefinition Width="77"/> |
||||
|
<ColumnDefinition Width="140"/> |
||||
|
<ColumnDefinition Width="77"/> |
||||
|
<ColumnDefinition Width="77"/> |
||||
|
<ColumnDefinition Width="100"/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="35"/> |
||||
|
<RowDefinition/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Border Grid.Row="0" Grid.ColumnSpan="8" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.Row="0" Grid.ColumnSpan="8" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.Row="1" Grid.ColumnSpan="8" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
||||
|
|
||||
|
<Border Grid.RowSpan="2" Grid.Column="0" HorizontalAlignment="Left" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="0" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="1" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="3" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="4" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="5" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="6" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
<Border Grid.RowSpan="2" Grid.Column="7" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
||||
|
|
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="0" Text="组合类型"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="1" Text="配件数量"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="2" Text="SKU配件商品"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="3" Text="基础包装"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="4" Text="增量耗材"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="5" Text="条码标签"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="6" Text="合格证"/> |
||||
|
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="7" Text="合格证位置"/> |
||||
|
|
||||
|
|
||||
|
<Grid Grid.Row="1" Grid.Column="0" > |
||||
|
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding PackTypeList}" Text="{Binding PackType}" > |
||||
|
|
||||
|
</ComboBox> |
||||
|
</Grid> |
||||
|
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="1" Height="30" Margin="5" Text="{Binding GoodsNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
||||
|
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="2" Height="30" Margin="5" Text="{Binding SkuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
||||
|
<Grid Grid.Row="1" Grid.Column="3" > |
||||
|
<ComboBox BorderBrush="Transparent" VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding BasicPackList}" Text="{Binding BasicPack}" > |
||||
|
|
||||
|
</ComboBox> |
||||
|
</Grid> |
||||
|
|
||||
|
|
||||
|
<Grid Grid.Row="1" Grid.Column="4"> |
||||
|
<Grid.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> |
||||
|
</Grid.Resources> |
||||
|
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding IncreateList}" |
||||
|
ShowClearButton="True" |
||||
|
MinWidth="90" |
||||
|
Height="25" |
||||
|
Margin="5,0,5,0"> |
||||
|
<hc:CheckComboBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<StackPanel Orientation="Horizontal" Margin="5,2.5"> |
||||
|
<CheckBox Content="{Binding IncreateName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
||||
|
</StackPanel> |
||||
|
</DataTemplate> |
||||
|
</hc:CheckComboBox.ItemTemplate> |
||||
|
<hc:CheckComboBox.ItemContainerStyle> |
||||
|
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}"> |
||||
|
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
||||
|
</Style> |
||||
|
</hc:CheckComboBox.ItemContainerStyle> |
||||
|
</hc:CheckComboBox> |
||||
|
</Grid> |
||||
|
|
||||
|
<Grid Grid.Row="1" Grid.Column="5" > |
||||
|
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedBarCode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> |
||||
|
|
||||
|
</ComboBox> |
||||
|
</Grid> |
||||
|
<Grid Grid.Row="1" Grid.Column="6" > |
||||
|
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}"> |
||||
|
|
||||
|
</ComboBox> |
||||
|
</Grid> |
||||
|
<Grid Grid.Row="1" Grid.Column="7" > |
||||
|
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding CertificatePositionList}" Text="{Binding CertificatePosition}"> |
||||
|
|
||||
|
</ComboBox> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
|
||||
|
</Grid> |
||||
|
|
||||
|
<Border Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
||||
|
</Grid> |
||||
|
|
||||
|
</DataTemplate> |
||||
|
</ListBox.ItemTemplate> |
||||
|
</ListBox> |
||||
|
<Grid Grid.Row="2"> |
||||
|
|
||||
|
<Button Content="发布" Width="100" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,2,5,2" |
||||
|
Command="{Binding CreateTaskCommand}" |
||||
|
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}" |
||||
|
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/> |
||||
|
</Grid> |
||||
|
|
||||
|
</Grid> |
||||
|
</c:BWindow> |
||||
|
|
@ -0,0 +1,41 @@ |
|||||
|
using BBWY.Client.Models; |
||||
|
using BBWY.Controls; |
||||
|
using GalaSoft.MvvmLight.Messaging; |
||||
|
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.BatchPurchase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// BatchPublishTaskWindow.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class BatchPublishTaskWindow : BWindow |
||||
|
{ |
||||
|
public BatchPublishTaskWindow() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
|
||||
|
Messenger.Default.Register<bool>(this, "CloseBatchPublishTaskWindow", CloseWindow); |
||||
|
} |
||||
|
|
||||
|
private void CloseWindow(bool obj) |
||||
|
{ |
||||
|
Messenger.Default.Unregister(this); |
||||
|
if (obj) |
||||
|
{ |
||||
|
|
||||
|
this.Close(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,79 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Server.Model.Db.QK |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 收费明细表
|
||||
|
/// </summary>
|
||||
|
[Table(Name = "feesdetail", DisableSyncStructure = true)] |
||||
|
public class FeesDetail |
||||
|
{ |
||||
|
[Column(IsPrimary =true)] |
||||
|
public long Id { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 任务id
|
||||
|
/// </summary>
|
||||
|
public long TaskId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 耗材ids
|
||||
|
/// </summary>
|
||||
|
public string ConsumableIds { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 耗材数量
|
||||
|
/// </summary>
|
||||
|
public string ConsumableNos { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 工序ids
|
||||
|
/// </summary>
|
||||
|
public string WorkProcessIds { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 工序数量
|
||||
|
/// </summary>
|
||||
|
public string WorkProcessNos { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 增值服务ids
|
||||
|
/// </summary>
|
||||
|
public string IncreateServiceIds { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 增值服务数量
|
||||
|
/// </summary>
|
||||
|
public string IncreateServiceNos { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 任务单件费用
|
||||
|
/// </summary>
|
||||
|
public decimal SingleFees { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 任务总费用
|
||||
|
/// </summary>
|
||||
|
public decimal AllFees { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务打折
|
||||
|
/// </summary>
|
||||
|
public decimal? Discount { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 创建时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? CreateTime { get; set; } = DateTime.Now; |
||||
|
/// <summary>
|
||||
|
/// 打包服务项目
|
||||
|
/// </summary>
|
||||
|
public string PackServiceIds { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 服务数量
|
||||
|
/// </summary>
|
||||
|
public string PackServiceNos { get; set; } |
||||
|
|
||||
|
public decimal? IncreaseFees { get; set; } |
||||
|
|
||||
|
public decimal? PackFees { get; set; } |
||||
|
|
||||
|
public decimal? ConsumableFees { get; set; } |
||||
|
|
||||
|
public decimal? DiscountPrice { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,192 @@ |
|||||
|
using FreeSql; |
||||
|
using FreeSql.DataAnnotations; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Xml.Linq; |
||||
|
using BBWY.Server.Model; |
||||
|
|
||||
|
namespace BBWY.Server.Model.Db.QK |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 打包任务
|
||||
|
/// </summary>
|
||||
|
[Table(Name = "packtask", DisableSyncStructure = true)] |
||||
|
public class PackTask |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[Column(IsPrimary = true, IsNullable = false)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求方创建日期
|
||||
|
/// </summary>
|
||||
|
public DateTime CreateTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务状态(未完成=0,已完成=1,)
|
||||
|
/// </summary>
|
||||
|
public int TaskStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 项目完成时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? EndTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求方团队id
|
||||
|
/// </summary>
|
||||
|
public string DepartmentId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求方店铺id
|
||||
|
/// </summary>
|
||||
|
public string ShopId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 货号品名(手写上传)
|
||||
|
/// </summary>
|
||||
|
public string BrandName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 对接人
|
||||
|
/// </summary>
|
||||
|
public string UserId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// skuid
|
||||
|
/// </summary>
|
||||
|
public string SkuId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// sku数量
|
||||
|
/// </summary>
|
||||
|
public int SkuCount { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打包类型(单件=0,多件=1)
|
||||
|
/// </summary>
|
||||
|
public int PackType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
|
||||
|
/// </summary>
|
||||
|
public int PositionType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
||||
|
/// </summary>
|
||||
|
public int BasicPack { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 增量1()
|
||||
|
/// </summary>
|
||||
|
public string Increment1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 增量2()
|
||||
|
/// </summary>
|
||||
|
public int? Increment2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 工序道数
|
||||
|
/// </summary>
|
||||
|
public int? ProcessCount { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 条形码id
|
||||
|
/// </summary>
|
||||
|
public long? BarcodeId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合格证
|
||||
|
/// </summary>
|
||||
|
public long? CertificateId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合格证位置(外部包装=0,产品包装=1)
|
||||
|
/// </summary>
|
||||
|
public int? CertificatePosition { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 箱子耗材(自带=0,4-13号纸箱=1-10,)
|
||||
|
/// </summary>
|
||||
|
public int? BoxConsumables { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// sku配件名称
|
||||
|
/// </summary>
|
||||
|
public string SkuGoodsTitle { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 配件数
|
||||
|
/// </summary>
|
||||
|
public int GoodsNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 气泡纸耗材(长=0,宽=1)
|
||||
|
/// </summary>
|
||||
|
public int? AirConsumables { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注意事项(对接备注)
|
||||
|
/// </summary>
|
||||
|
public string MarkMessage { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 到货情况(待收货=2,部分收货=1,已到货=0)
|
||||
|
/// </summary>
|
||||
|
public int Availability { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否加急
|
||||
|
/// </summary>
|
||||
|
public int IsWorry { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否删除
|
||||
|
/// </summary>
|
||||
|
public Enums.IsDeleted IsDeleted { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否结清
|
||||
|
/// </summary>
|
||||
|
public Enums.Settle IsSettle { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 拳探订单id
|
||||
|
/// </summary>
|
||||
|
public string OrderId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 店铺归属
|
||||
|
/// </summary>
|
||||
|
public string OriginShopId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 账单归属(0=店铺,1=拳探)
|
||||
|
/// </summary>
|
||||
|
public Enums.BillOrigin BillOrigin { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public class OrderTaskFees |
||||
|
{ |
||||
|
public string OrderId { get; set; } |
||||
|
|
||||
|
public string SkuId { get; set; } |
||||
|
|
||||
|
public Decimal? DiscountPrice { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using BBWY.Server.Model; |
||||
|
|
||||
|
namespace BBWY.Server.Model.Dto |
||||
|
{ |
||||
|
public class UpdatePackStateRequest |
||||
|
{ |
||||
|
public string OrderId { get; set; } |
||||
|
public Enums.PackState PackState { get ;set ;} |
||||
|
} |
||||
|
|
||||
|
public class UpdatePurchaseOrderStateRequest |
||||
|
{ |
||||
|
public string OrderId { get; set; } |
||||
|
public Enums.PurchaseOrderState PurchaseOrderState { get; set; } |
||||
|
} |
||||
|
|
||||
|
public class UpdatePackMoneyRequest |
||||
|
{ |
||||
|
public string SkuId { get; set; } |
||||
|
public string OrderId { get; set; } |
||||
|
//设置sku 耗材费
|
||||
|
public decimal PackMoney { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Server.Model.Dto |
||||
|
{ |
||||
|
public class UpdatePackStateResponse |
||||
|
{ |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue