74 changed files with 4876 additions and 1228 deletions
@ -1,9 +1,9 @@ |
|||
{ |
|||
//"BBWYApiHost": "http://localhost:5000", |
|||
"BBWYApiHost": "http://bbwytest.qiyue666.com", |
|||
"BBWYApiHost": "http://localhost:5000", |
|||
//"BBWYApiHost": "http://bbwytest.qiyue666.com", |
|||
"MDSApiHost": "http://mdsapi.qiyue666.com", |
|||
"JOSApiHost": "", |
|||
"1688ApiHost": "", |
|||
//"QKApiHost": "http://localhost:8080" |
|||
"QKApiHost": "http://qiku.qiyue666.com" |
|||
"QKApiHost": "http://localhost:8080" |
|||
//"QKApiHost": "http://qiku.qiyue666.com" |
|||
} |
@ -0,0 +1,573 @@ |
|||
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 bool isSelected; |
|||
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } |
|||
|
|||
private ObservableCollection<string> worryList = new ObservableCollection<string> { |
|||
"否","是" |
|||
}; |
|||
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } } |
|||
|
|||
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> { |
|||
"商家仓","齐越仓", "京东仓","聚水潭仓"}; |
|||
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> packTypeList = new ObservableCollection<string> { |
|||
"单件","多件" |
|||
}; |
|||
public ObservableCollection<string> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> basicPackList = new ObservableCollection<string> { |
|||
"快递袋","纸箱","麻袋" |
|||
}; |
|||
public ObservableCollection<string> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } |
|||
|
|||
private ObservableCollection<string> isNeedBarCodeList = new ObservableCollection<string> { |
|||
"需要", "不需要" }; |
|||
public ObservableCollection<string> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } |
|||
|
|||
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> { |
|||
"无","外部包装","产品包装" |
|||
}; |
|||
public ObservableCollection<string> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } |
|||
|
|||
private ObservableCollection<string> availabilityList = new ObservableCollection<string> { |
|||
"已到货","部分到货","未到货" |
|||
}; |
|||
public ObservableCollection<string> 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[] { |
|||
new CertificateModel{ |
|||
ProductNo = ProductNo, |
|||
Brand = Brand, |
|||
SkuId = SkuId |
|||
} |
|||
}; |
|||
|
|||
|
|||
} |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
foreach (var item in CertificateModel) item.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.Cers; |
|||
IsSetCertificate = false; |
|||
if (CertificateModel == null) |
|||
{ |
|||
CertificateModel = new CertificateModel[] { |
|||
new CertificateModel{ } |
|||
}; |
|||
IsSetCertificate = true; |
|||
|
|||
} |
|||
foreach (var item in CertificateModel) |
|||
{ |
|||
item.Brand = Brand; |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
item.BrandName = BrandName; |
|||
item.ProductNo = ProductNo; |
|||
item.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,175 @@ |
|||
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 |
|||
{ |
|||
|
|||
|
|||
|
|||
private ObservableCollection<BatchPublishTask> batchPublishTasks; |
|||
public ObservableCollection<BatchPublishTask> BatchPublishTasks { get => batchPublishTasks; set { Set(ref batchPublishTasks, value); } } |
|||
// public ObservableCollection<BatchPublishTask> BatchPublishTasks;
|
|||
|
|||
PackTaskService packTaskService; |
|||
ProductService productService; |
|||
GlobalContext globalContext; |
|||
private bool isLoading = false; |
|||
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|||
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; |
|||
|
|||
this.globalContext = globalContext; |
|||
CreateTaskCommand = new RelayCommand<object>(CreateTask); |
|||
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
|||
|
|||
|
|||
|
|||
} |
|||
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调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示"); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
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.Count() <= 0) |
|||
{ |
|||
new TipsWindow("请设置合格证模板").Show(); |
|||
return; |
|||
} |
|||
createTaskModel.CerId =string.Join(",", task.CertificateModel.Where(c=>c.Id>0).Select(c=>c.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,759 @@ |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Models.PackTask; |
|||
using BBWY.Client.Views.PackTask; |
|||
using BBWY.Common.Models; |
|||
using GalaSoft.MvvmLight.Command; |
|||
using GalaSoft.MvvmLight.Messaging; |
|||
using Org.BouncyCastle.Ocsp; |
|||
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.ViewModels.PackTask |
|||
{ |
|||
public class PublishTaskViewModel : BaseVM, IDenpendency |
|||
{ |
|||
|
|||
#region 属性
|
|||
|
|||
private string searchSkuId; |
|||
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } |
|||
|
|||
public long TaskId { get; set; } |
|||
private bool isSelected; |
|||
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } |
|||
|
|||
private ObservableCollection<string> worryList = new ObservableCollection<string> { |
|||
"否","是" |
|||
}; |
|||
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } } |
|||
|
|||
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> { |
|||
"商家仓","齐越仓", "京东仓","聚水潭仓"}; |
|||
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> packTypeList = new ObservableCollection<string> { |
|||
"单件","多件" |
|||
}; |
|||
public ObservableCollection<string> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> basicPackList = new ObservableCollection<string> { |
|||
"快递袋","纸箱","麻袋" |
|||
}; |
|||
public ObservableCollection<string> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } |
|||
|
|||
private ObservableCollection<string> isNeedBarCodeList = new ObservableCollection<string> { |
|||
"需要", "不需要" }; |
|||
public ObservableCollection<string> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } |
|||
|
|||
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> { |
|||
"无","外部包装","产品包装" |
|||
}; |
|||
public ObservableCollection<string> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } |
|||
|
|||
private ObservableCollection<string> availabilityList = new ObservableCollection<string> { |
|||
"已到货","部分到货","未到货" |
|||
}; |
|||
public ObservableCollection<string> 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,聚水潭仓=3)
|
|||
/// </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); } } |
|||
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
|||
|
|||
PackTaskService packTaskService; |
|||
ProductService productService; |
|||
GlobalContext globalContext; |
|||
private bool isLoading = false; |
|||
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|||
#endregion
|
|||
|
|||
public PublishTaskViewModel(PackTaskService packTaskService, ProductService productService, GlobalContext globalContext) |
|||
{ |
|||
this.packTaskService = packTaskService; |
|||
this.productService = productService; |
|||
this.globalContext = globalContext; |
|||
CreateTaskCommand = new RelayCommand<object>(CreateTask); |
|||
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
|||
SetBarCodeCommand = new RelayCommand(SetBarCode); |
|||
SetCertificateCommand = new RelayCommand(SetCertificate); |
|||
LookBarCommand = new RelayCommand(LookBar); |
|||
LookCerCommand = new RelayCommand(LookCer); |
|||
SearchSkuCommand = new RelayCommand<object>(SearchSku); |
|||
IncreateList = new ObservableCollection<IncreateModel>(); |
|||
foreach (var item in increates) |
|||
{ |
|||
IncreateList.Add(new IncreateModel |
|||
{ |
|||
IncreateName = item, |
|||
IsSelected = false |
|||
}); |
|||
} |
|||
Messenger.Default.Register<PackTaskModel>(this, "InitData", message => |
|||
{ |
|||
|
|||
InitData(message); |
|||
}); |
|||
|
|||
} |
|||
|
|||
|
|||
#region 方法
|
|||
public ICommand SetBarCodeCommand { get; set; } |
|||
public ICommand SetCertificateCommand { get; set; } |
|||
public ICommand LookBarCommand { get; set; } |
|||
public ICommand LookCerCommand { get; set; } |
|||
|
|||
public ICommand OpenSkuDetailCommand { get; set; } |
|||
public ICommand CreateTaskCommand { get; set; } |
|||
|
|||
public ICommand SearchSkuCommand { 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[] { |
|||
new CertificateModel{ |
|||
ProductNo = ProductNo, |
|||
Brand = Brand, |
|||
SkuId = SkuId, |
|||
|
|||
} |
|||
}; |
|||
|
|||
|
|||
} |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
foreach (var item in CertificateModel) item.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(object obj) |
|||
{ |
|||
string skuid = (string)obj; |
|||
if (string.IsNullOrEmpty(skuid)) |
|||
return; |
|||
|
|||
SkuId = skuid; |
|||
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.Cers; |
|||
IsSetCertificate = false; |
|||
if (CertificateModel == null) |
|||
{ |
|||
CertificateModel = new CertificateModel[] { |
|||
new CertificateModel{ } |
|||
}; |
|||
IsSetCertificate = true; |
|||
|
|||
} |
|||
foreach (var item in CertificateModel) |
|||
{ |
|||
item.Brand = Brand; |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
item.BrandName = BrandName; |
|||
item.ProductNo = ProductNo; |
|||
item.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 Action ReflashWindow { get; set; } |
|||
public void InitData(PackTaskModel model = null) |
|||
{ |
|||
|
|||
IncreateList = new ObservableCollection<IncreateModel>(); |
|||
SpuId = string.Empty; |
|||
if (model == null) |
|||
{ |
|||
SaveTask = "发布"; |
|||
TaskId = 0; |
|||
Logo = string.Empty; |
|||
SearchSkuId = ""; |
|||
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 |
|||
}); |
|||
} |
|||
IsNeedBarCode = Need.需要; |
|||
return; |
|||
} |
|||
SaveTask = "保存"; |
|||
Logo = model.ItemList[0].Logo; |
|||
SearchSkuId = model.SkuId; |
|||
SkuId = model.SkuId; |
|||
SkuCount = model.SkuCount; |
|||
SkuName = model.ItemList[0].SkuName; |
|||
ProductNo = model.ItemList[0].GoodsNo; |
|||
Brand = model.Brand; |
|||
BrandName = model.ItemList[0].BrandName; |
|||
this.MarkMessage = model.MarkMessage; |
|||
IsSetBarCode = model.BarCodeModel != null ? false : true; |
|||
IsSetCertificate = model.CertificateModel != null ? false : true; |
|||
BarCodeModel = model.BarCodeModel; |
|||
CertificateModel = model.CertificateModel; |
|||
SkuTitle = model.SkuTitle; |
|||
GoodsNumber = model.GoodsNumber; |
|||
Availability = model.Availability; |
|||
IsWorry = model.IsWorry; |
|||
PositionType = model.PositionType; |
|||
PackType = model.PackType; |
|||
BasicPack = model.BasicPack; |
|||
IsNeedBarCode = model.BarCodeModel == null ? Need.不需要 : Need.需要; |
|||
IsNeedCertificateModel = model.CertificateModel == null ? Need.不需要 : Need.需要; |
|||
CertificatePosition = model.CertificatePosition; |
|||
TaskId = model.TaskId; |
|||
string[] increateDatas = model.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 |
|||
}); |
|||
}); |
|||
} |
|||
SearchSku(SkuId); |
|||
|
|||
} |
|||
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调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示"); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
private void CreateTask(object obj) |
|||
{ |
|||
if (string.IsNullOrEmpty(SkuId)) |
|||
{ |
|||
new TipsWindow("请先搜索SkuId!").Show(); |
|||
return; |
|||
} |
|||
if (SkuCount <= 0) |
|||
{ |
|||
new TipsWindow("请设置SKU任务数!").Show(); |
|||
return; |
|||
} |
|||
string increateStr = ""; |
|||
var increates = 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 = ProductNo, |
|||
Logo = Logo, |
|||
SkuName = SkuName, |
|||
TaskId = TaskId, |
|||
BrandName = BrandName, |
|||
Availability = (int)Availability, |
|||
BasicPack = (int)BasicPack, |
|||
SkuId = SkuId, |
|||
CreateTime = DateTime.Now, |
|||
Increment1 = increateStr, |
|||
//Increment2 = (int)Increment2,
|
|||
CertificatePosition = (int)CertificatePosition, |
|||
PackType = (int)PackType, |
|||
MarkMessage = MarkMessage, |
|||
PositionType = (int)PositionType, |
|||
GoodsNumber = GoodsNumber, |
|||
SkuGoodsTitle = SkuTitle, |
|||
SkuCount = SkuCount, |
|||
UserId = globalContext.User.Id.ToString(), |
|||
ShopId = globalContext.User.Shop.ShopId.ToString(), |
|||
|
|||
//IsWorry = IsWorry
|
|||
}; |
|||
if (IsNeedBarCode == Need.需要) |
|||
{ |
|||
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|||
{ |
|||
new TipsWindow("请设置条形码模板").Show(); |
|||
return; |
|||
} |
|||
createTaskModel.BarCodeId = BarCodeModel.Id; |
|||
} |
|||
if (IsNeedCertificateModel == Need.需要) |
|||
{ |
|||
if (CertificateModel == null || CertificateModel.Count() <= 0) |
|||
{ |
|||
new TipsWindow("请设置合格证模板").Show(); |
|||
return; |
|||
} |
|||
try |
|||
{ |
|||
createTaskModel.CertificateId = CertificateModel.Where(c => c.Id > 0).FirstOrDefault()?.Id; |
|||
} |
|||
catch |
|||
{ |
|||
|
|||
|
|||
} |
|||
|
|||
createTaskModel.CerId = string.Join(",", CertificateModel.Where(c => c.Id > 0).Select(c => c.Id));//
|
|||
} |
|||
ApiResponse<object> res = null; |
|||
if (TaskId > 0)//修改界面
|
|||
{ |
|||
res = packTaskService.UpdateTask(createTaskModel); |
|||
} |
|||
else |
|||
{ |
|||
res = packTaskService.CreateTask(createTaskModel); |
|||
} |
|||
if (res.Success) |
|||
{ |
|||
if (ReflashWindow != null) ReflashWindow();//刷新主界面
|
|||
|
|||
var win = obj as System.Windows.Window; |
|||
win.Close(); |
|||
} |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,277 @@ |
|||
<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.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> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<Grid > |
|||
<TextBlock Text="任务信息" FontWeight="Bold" Margin="19 23" HorizontalAlignment="Left" VerticalAlignment="Top"/> |
|||
<StackPanel Height="30" 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"/> |
|||
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"> |
|||
<ComboBox BorderThickness="0" VerticalContentAlignment="Center" ItemsSource="{Binding AvailabilityList}" Text="{Binding Availability}" > |
|||
|
|||
</ComboBox> |
|||
</Border> |
|||
|
|||
<!--<TextBlock Margin="30 0 0 0" Text="加急:" VerticalAlignment="Center"/> |
|||
<ComboBox VerticalContentAlignment="Center" ItemsSource="{Binding WorryList}" Text="{Binding IsWorry}" > |
|||
|
|||
</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="30" |
|||
Margin="19 118 0 0"> |
|||
<TextBlock Text="落仓去向:" VerticalAlignment="Center"/> |
|||
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"> |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding PositionTypeList}" Text="{Binding PositionType}" > |
|||
|
|||
</ComboBox> |
|||
</Border> |
|||
|
|||
</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="88"/> |
|||
<ColumnDefinition Width="140"/> |
|||
<ColumnDefinition Width="88"/> |
|||
<ColumnDefinition Width="88"/> |
|||
<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="1" BorderThickness="0" 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 VerticalContentAlignment="Center" Margin="1" BorderThickness="0" ItemsSource="{Binding BasicPackList}" Text="{Binding BasicPack}" > |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
|
|||
|
|||
<Grid Grid.Row="1" Grid.Column="4"> |
|||
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding IncreateList}" |
|||
ShowClearButton="True" |
|||
MinWidth="90" |
|||
Height="25" BorderThickness="0" Margin="1" |
|||
> |
|||
<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="1" BorderThickness="0" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedBarCode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="6" > |
|||
<ComboBox VerticalContentAlignment="Center" Margin="1" BorderThickness="0" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="7" > |
|||
<ComboBox VerticalContentAlignment="Center" Margin="1" BorderThickness="0" 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,272 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.PackTask.PublishTaskWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
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 PublishTask,Source={StaticResource Locator}}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
RightButtonGroupMargin="0,5,5,0" |
|||
Height="545" Width="1300"> |
|||
<Window.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
<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 Height="60"/> |
|||
<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> |
|||
<Grid Grid.Row="1" Visibility="{Binding TaskId,Converter={StaticResource objConverter},ConverterParameter=0:Visible:Collapsed}"> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<c:BTextBox Text="{Binding SearchSkuId}" Height="35" Width="217" Margin="25 0 0 0" WaterRemark="请输入SKU"/> |
|||
<c:BButton Content="查询" Width="120" Height="35" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,2,5,2" |
|||
Command="{Binding SearchSkuCommand}" |
|||
CommandParameter="{Binding SearchSkuId}" |
|||
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid Grid.Row="2"> |
|||
<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" TextTrimming="CharacterEllipsis"> |
|||
<TextBlock.ToolTip> |
|||
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> |
|||
<TextBlock Text="{Binding SkuName}"/> |
|||
</ToolTip> |
|||
</TextBlock.ToolTip> |
|||
<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 Height="3*"/> |
|||
<RowDefinition Height="2*"/> |
|||
</Grid.RowDefinitions> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock Text="任务信息" FontWeight="Bold" Margin="19 23 0 0" HorizontalAlignment="Left" VerticalAlignment="Top"/> |
|||
<StackPanel Height="30" VerticalAlignment="Top" Margin="19 23 0 0" 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"/> |
|||
<Border CornerRadius="0" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}"> |
|||
<ComboBox BorderThickness="0" VerticalContentAlignment="Center" ItemsSource="{Binding AvailabilityList}" Text="{Binding Availability}" > |
|||
|
|||
</ComboBox> |
|||
</Border> |
|||
<TextBlock Text="落仓去向:" VerticalAlignment="Center" Margin="30 0 0 0" /> |
|||
<Border CornerRadius="0" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}"> |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding PositionTypeList}" Text="{Binding PositionType}" > |
|||
|
|||
</ComboBox> |
|||
</Border> |
|||
|
|||
<!--<TextBlock Margin="30 0 0 0" Text="加急:" VerticalAlignment="Center"/> |
|||
<ComboBox VerticalContentAlignment="Center" ItemsSource="{Binding WorryList}" Text="{Binding IsWorry}" > |
|||
|
|||
</ComboBox>--> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" |
|||
Margin="19 23 0 0"> |
|||
|
|||
<c:BTextBox Text="{Binding MarkMessage}" VerticalAlignment="Top" Width="467" Height="85" |
|||
WaterRemark="打包备注" AcceptsReturn="True" TextWrapping="Wrap" > |
|||
|
|||
</c:BTextBox> |
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
<Grid Grid.Row="1"> |
|||
<TextBlock Text="打包配置" FontWeight="Bold" Margin="19 23 0 0" /> |
|||
<Grid Height="70" Margin="20 54 20 0"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="77"/> |
|||
<ColumnDefinition Width="77"/> |
|||
<ColumnDefinition MinWidth="77"/> |
|||
<ColumnDefinition Width="90"/> |
|||
<ColumnDefinition Width="140"/> |
|||
<ColumnDefinition Width="86"/> |
|||
<ColumnDefinition Width="86"/> |
|||
<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" BorderThickness="0" Margin="1" 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 VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding BasicPackList}" Text="{Binding BasicPack}" > |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
|
|||
|
|||
<Grid Grid.Row="1" Grid.Column="4"> |
|||
<Grid.Resources> |
|||
|
|||
</Grid.Resources> |
|||
<hc:CheckComboBox BorderThickness="0" 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" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedBarCode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="6" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="7" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding CertificatePositionList}" Text="{Binding CertificatePosition}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
</Grid> |
|||
<Border Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
|
|||
|
|||
</Grid> |
|||
<Grid Grid.Row="3"> |
|||
|
|||
<c:BButton Content="{Binding SaveTask,Mode=TwoWay}" 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,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.PackTask |
|||
{ |
|||
/// <summary>
|
|||
/// PublishTaskWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class PublishTaskWindow : BWindow |
|||
{ |
|||
public PublishTaskWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,85 @@ |
|||
using System; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Security.Cryptography; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Common.Extensions |
|||
{ |
|||
public static class EncryptionExtension |
|||
{ |
|||
|
|||
public static string Md5Encrypt(this string originStr) |
|||
{ |
|||
using (var md5 = MD5.Create()) |
|||
{ |
|||
return string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(originStr)).Select(x => x.ToString("x2"))); |
|||
} |
|||
} |
|||
|
|||
//AES加密 传入,要加密的串和, 解密key
|
|||
public static string AESEncrypt(this string input) |
|||
{ |
|||
var key = "dataplatform2019"; |
|||
var ivStr = "1012132405963708"; |
|||
|
|||
var encryptKey = Encoding.UTF8.GetBytes(key); |
|||
var iv = Encoding.UTF8.GetBytes(ivStr); //偏移量,最小为16
|
|||
using (var aesAlg = Aes.Create()) |
|||
{ |
|||
using (var encryptor = aesAlg.CreateEncryptor(encryptKey, iv)) |
|||
{ |
|||
using (var msEncrypt = new MemoryStream()) |
|||
{ |
|||
using (var csEncrypt = new CryptoStream(msEncrypt, encryptor, |
|||
CryptoStreamMode.Write)) |
|||
|
|||
using (var swEncrypt = new StreamWriter(csEncrypt)) |
|||
{ |
|||
swEncrypt.Write(input); |
|||
} |
|||
var decryptedContent = msEncrypt.ToArray(); |
|||
|
|||
return Convert.ToBase64String(decryptedContent); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
public static string AESDecrypt(this string cipherText) |
|||
{ |
|||
var fullCipher = Convert.FromBase64String(cipherText); |
|||
|
|||
var ivStr = "1012132405963708"; |
|||
var key = "dataplatform2019"; |
|||
|
|||
var iv = Encoding.UTF8.GetBytes(ivStr); |
|||
var decryptKey = Encoding.UTF8.GetBytes(key); |
|||
|
|||
using (var aesAlg = Aes.Create()) |
|||
{ |
|||
using (var decryptor = aesAlg.CreateDecryptor(decryptKey, iv)) |
|||
{ |
|||
string result; |
|||
using (var msDecrypt = new MemoryStream(fullCipher)) |
|||
{ |
|||
using (var csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) |
|||
{ |
|||
using (var srDecrypt = new StreamReader(csDecrypt)) |
|||
{ |
|||
result = srDecrypt.ReadToEnd(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public static string Base64Encrypt(this string originStr) |
|||
{ |
|||
return Convert.ToBase64String(Encoding.UTF8.GetBytes(originStr)); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
using BBWY.Server.Business; |
|||
using Microsoft.AspNetCore.Authentication.JwtBearer; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Data; |
|||
|
|||
namespace BBWY.Server.API.Controllers |
|||
{ |
|||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|||
public class SqlController : BaseApiController |
|||
{ |
|||
private SqlBusiness sqlBusiness; |
|||
|
|||
public SqlController(IHttpContextAccessor httpContextAccessor, SqlBusiness sqlBusiness) : base(httpContextAccessor) |
|||
{ |
|||
this.sqlBusiness = sqlBusiness; |
|||
} |
|||
|
|||
[HttpPost] |
|||
public int ExecuteNonQuery([FromBody]BaseSqlData baseSqlData) |
|||
{ |
|||
return sqlBusiness.ExecuteNonQuery(baseSqlData); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public DataTable ExecuteDataTable([FromBody] BaseSqlData baseSqlData) |
|||
{ |
|||
return sqlBusiness.ExecuteDataTable(baseSqlData); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
using BBWY.Common.Extensions; |
|||
using BBWY.Common.Models; |
|||
using System.Data; |
|||
using Yitter.IdGenerator; |
|||
|
|||
namespace BBWY.Server.Business |
|||
{ |
|||
/// <summary>
|
|||
/// SQL业务类,仅适用内部系统之间调用
|
|||
/// </summary>
|
|||
public class SqlBusiness : BaseBusiness, IDenpendency |
|||
{ |
|||
public SqlBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator) : base(fsql, nLogManager, idGenerator) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public int ExecuteNonQuery(BaseSqlData baseSqlData) |
|||
{ |
|||
return fsql.Ado.ExecuteNonQuery(baseSqlData.Sql.AESDecrypt()); |
|||
} |
|||
|
|||
public DataTable ExecuteDataTable(BaseSqlData baseSqlData) |
|||
{ |
|||
return fsql.Ado.ExecuteDataTable(baseSqlData.Sql.AESDecrypt()); |
|||
} |
|||
} |
|||
|
|||
public class BaseSqlData |
|||
{ |
|||
public string Sql { get; set; } |
|||
} |
|||
} |
@ -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; } |
|||
|
|||
} |
|||
} |
@ -1,22 +1,8 @@ |
|||
using BBWY.Server.Model.Db; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Server.Model.Dto |
|||
namespace BBWY.Server.Model.Dto |
|||
{ |
|||
public class CancelPurchaseOrderRequest: PlatformRequest |
|||
{ |
|||
public string OrderId { get; set; } |
|||
|
|||
|
|||
public string Remark { get; set; } |
|||
|
|||
public PurchaseAccount PurchaseAccount { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购平台
|
|||
/// </summary>
|
|||
public Enums.Platform PurchasePlatform { 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 |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
namespace QuanTan.SDK.Model |
|||
{ |
|||
public class QuanTanEditPriceNotifyRequest |
|||
{ |
|||
public string OrderId { get; set; } |
|||
} |
|||
} |
Loading…
Reference in new issue