|
|
@ -222,18 +222,18 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
/// </summary>
|
|
|
|
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } |
|
|
|
|
|
|
|
private string isNeedBarCode; |
|
|
|
private Need isNeedBarCode; |
|
|
|
/// <summary>
|
|
|
|
/// 是否需要合格证
|
|
|
|
/// </summary>
|
|
|
|
public string IsNeedBarCode { get => isNeedBarCode; set { Set(ref isNeedBarCode, value); } } |
|
|
|
public Need IsNeedBarCode { get => isNeedBarCode; set { Set(ref isNeedBarCode, value); } } |
|
|
|
|
|
|
|
|
|
|
|
private string isNeedCertificateModel; |
|
|
|
private Need isNeedCertificateModel; |
|
|
|
/// <summary>
|
|
|
|
/// 是否需要条形码
|
|
|
|
/// </summary>
|
|
|
|
public string IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } |
|
|
|
public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +255,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
|
|
|
|
Set(ref isSetBarCode, value); |
|
|
|
IsNeedBarCode = IsSetBarCode ? "不需要" : "需要"; |
|
|
|
IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -269,7 +269,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
|
|
|
|
Set(ref isSetCertificate, value); |
|
|
|
IsNeedCertificateModel = IsSetCertificate ? "不需要" : "需要"; |
|
|
|
IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要; |
|
|
|
} |
|
|
|
} |
|
|
|
private string setSpuCerStatus; |
|
|
@ -371,13 +371,13 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
|
|
|
public void InitData(PackTaskModel model = null) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
|
SpuId = string.Empty; |
|
|
|
if (model == null) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SaveTask = "发布"; |
|
|
|
TaskId = 0; |
|
|
|
Logo = string.Empty; |
|
|
@ -427,8 +427,8 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
PositionType = model.PositionType; |
|
|
|
PackType = model.PackType; |
|
|
|
BasicPack = model.BasicPack; |
|
|
|
IsNeedBarCode = model.BarCodeModel != null ? "需要" : "不需要"; |
|
|
|
IsNeedCertificateModel = model.CertificateModel != null ? "需要" : "不需要"; |
|
|
|
IsNeedBarCode = model.BarCodeModel == null ? Need.不需要 : Need.需要; |
|
|
|
IsNeedCertificateModel = model.CertificateModel == null ? Need.不需要 : Need.需要; |
|
|
|
CertificatePosition = model.CertificatePosition; |
|
|
|
TaskId = model.TaskId; |
|
|
|
string[] increateDatas = model.Increment1.Split(','); |
|
|
@ -441,7 +441,8 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
isSelected = true; |
|
|
|
} |
|
|
|
App.Current.Dispatcher.Invoke(() => { |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
IncreateList.Add(new IncreateModel |
|
|
|
{ |
|
|
|
IncreateName = item, |
|
|
@ -470,7 +471,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
IsSetCertificate = true; |
|
|
|
//数据库获取增量耗材数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
|
foreach (var item in increates) |
|
|
|
{ |
|
|
@ -504,7 +505,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
|
|
|
|
LookBarCommand = new RelayCommand(LookBar); |
|
|
|
LookCerCommand = new RelayCommand(LookCer); |
|
|
|
|
|
|
|
|
|
|
|
delayTrigger = new DelayTrigger(500); |
|
|
|
delayTrigger.OnExecute = OnSearchIncreateKeyWordChanged; |
|
|
|
BarLabelCheck(BarcodeLabelModel.精简模板);//默认精简模式
|
|
|
@ -531,7 +532,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
ProductNo = SpuCertificateModel.ProductNo, |
|
|
|
Shader = SpuCertificateModel.Shader, |
|
|
|
ProductShop = SpuCertificateModel.ProductShop, |
|
|
|
ApplyAge = SpuCertificateModel.ApplyAge, |
|
|
|
ApplyAge = SpuCertificateModel.ApplyAge, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
@ -545,7 +546,8 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
SpuCertificateModel.Brand = Brand; |
|
|
|
SpuCertificateModel.SkuId = SkuId; |
|
|
|
} |
|
|
|
SpuCertificateModel.BrandName = BrandName; |
|
|
|
if (!string.IsNullOrEmpty(BrandName)) |
|
|
|
SpuCertificateModel.BrandName = BrandName; |
|
|
|
setSpuCerWindow = new SetSpuCerWindow(); |
|
|
|
setSpuCerWindow.Show(); |
|
|
|
} |
|
|
@ -575,7 +577,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
Shader = SpuCertificateModel.Shader, |
|
|
|
SkuId = SpuCertificateModel.SkuId, |
|
|
|
ApplyAge = SpuCertificateModel.ApplyAge, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
@ -678,31 +680,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
//throw new NotImplementedException();
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 设置合格证
|
|
|
|
/// </summary>
|
|
|
|
private void SetCertificate() |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(SearchSkuId)) |
|
|
|
{ |
|
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
|
return; |
|
|
|
} |
|
|
|
SearSpuCer(); |
|
|
|
|
|
|
|
if (CertificateModel == null) |
|
|
|
{ |
|
|
|
CertificateModel = new CertificateModel(); |
|
|
|
CertificateModel.ProductNo = ProductNo; |
|
|
|
CertificateModel.Brand = Brand; |
|
|
|
CertificateModel.SkuId = SkuId; |
|
|
|
|
|
|
|
} |
|
|
|
CertificateModel.BrandName = BrandName; |
|
|
|
setCerWindow = new SetCerWindow(); |
|
|
|
setCerWindow.Show(); |
|
|
|
//throw new NotImplementedException();
|
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 保存合格证
|
|
|
|
/// </summary>
|
|
|
@ -738,18 +716,20 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
IsSetCertificate = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
IsNeedCertificateModel = "需要"; |
|
|
|
IsNeedCertificateModel = Need.需要; |
|
|
|
CertificateModel.Id = resData.Data; |
|
|
|
IsSetCertificate = false; |
|
|
|
setCerWindow.Close(); |
|
|
|
} |
|
|
|
|
|
|
|
SetBarCodeWindow setBarCodeWindow = null; SetCerWindow setCerWindow = null; SetSpuCerWindow setSpuCerWindow = null; |
|
|
|
|
|
|
|
public BarcodeLabelModel LabelModel = BarcodeLabelModel.精简模板; |
|
|
|
|
|
|
|
private void SetBarCode() |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(SearchSkuId)) |
|
|
|
if (string.IsNullOrEmpty(SkuId)) |
|
|
|
{ |
|
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (BarCodeModel == null) |
|
|
@ -759,15 +739,54 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
BarCodeModel.Brand = Brand; |
|
|
|
BarCodeModel.SkuId = SkuId; |
|
|
|
BarCodeModel.SkuName = SkuName; |
|
|
|
|
|
|
|
} |
|
|
|
BarCodeModel.BrandName = BrandName; |
|
|
|
setBarCodeWindow = new SetBarCodeWindow(); |
|
|
|
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(); |
|
|
|
} |
|
|
|
|
|
|
|
public BarcodeLabelModel LabelModel = BarcodeLabelModel.精简模板; |
|
|
|
/// <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(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveBarCode() |
|
|
|
{ |
|
|
@ -785,12 +804,12 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
//保存到服务器中 返回id
|
|
|
|
var resData = packTaskService.SaveBarCode(new BarCodeRequest |
|
|
|
{ |
|
|
|
Brand = Brand, |
|
|
|
BrandName = BrandName, |
|
|
|
ProductNo = ProductNo, |
|
|
|
SkuId = SkuId, |
|
|
|
SkuName = SkuName, |
|
|
|
LabelModel = LabelModel |
|
|
|
Brand = BarCodeModel. Brand, |
|
|
|
BrandName = BarCodeModel.BrandName, |
|
|
|
ProductNo = BarCodeModel.ProductNo, |
|
|
|
SkuId = BarCodeModel.SkuId, |
|
|
|
SkuName = BarCodeModel.SkuName, |
|
|
|
LabelModel = BarCodeModel.LabelModel |
|
|
|
|
|
|
|
}); |
|
|
|
if (resData == null || !resData.Success) |
|
|
@ -800,7 +819,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
} |
|
|
|
|
|
|
|
BarCodeModel.Id = resData.Data; |
|
|
|
IsNeedBarCode = "需要"; |
|
|
|
IsNeedBarCode = Need.需要; |
|
|
|
IsSetBarCode = false; |
|
|
|
setBarCodeWindow.Close(); |
|
|
|
} |
|
|
@ -846,7 +865,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
Increment2 = (int)Increment2, |
|
|
|
CertificatePosition = (int)CertificatePosition, |
|
|
|
PackType = (int)PackType, |
|
|
|
MarkMessage = markMessage, |
|
|
|
MarkMessage = MarkMessage, |
|
|
|
PositionType = (int)PositionType, |
|
|
|
GoodsNumber = GoodsNumber, |
|
|
|
SkuGoodsTitle = SkuTitle, |
|
|
@ -855,7 +874,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
ShopId = globalContext.User.Shop.ShopId.ToString(), |
|
|
|
IsWorry = IsWorry |
|
|
|
}; |
|
|
|
if (IsNeedBarCode == "需要") |
|
|
|
if (IsNeedBarCode == Need.需要) |
|
|
|
{ |
|
|
|
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|
|
|
{ |
|
|
@ -864,7 +883,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
} |
|
|
|
createTaskModel.BarCodeId = BarCodeModel.Id; |
|
|
|
} |
|
|
|
if (IsNeedCertificateModel == "需要") |
|
|
|
if (IsNeedCertificateModel == Need.需要) |
|
|
|
{ |
|
|
|
if (CertificateModel == null || CertificateModel.Id <= 0) |
|
|
|
{ |
|
|
@ -940,16 +959,16 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (productSku.Data.PackConfig!=null) |
|
|
|
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; |
|
|
|
BasicPack = (BasicPack)config.BasicPack; |
|
|
|
Availability = (TaskState)config.Availability; |
|
|
|
MarkMessage = config.MarkMessage; |
|
|
|
CertificatePosition = config.CertificatePosition==null? CertificatePosition .无: (CertificatePosition)config.CertificatePosition.Value; |
|
|
|
CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; |
|
|
|
// Increment1 = config.Increment1;
|
|
|
|
string[] increateDatas = config.Increment1.Split(','); |
|
|
|
|
|
|
@ -961,12 +980,13 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
isSelected = true; |
|
|
|
} |
|
|
|
App.Current.Dispatcher.Invoke(() => { |
|
|
|
IncreateList.Add(new IncreateModel |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
IncreateName = item, |
|
|
|
IsSelected = isSelected |
|
|
|
}); |
|
|
|
IncreateList.Add(new IncreateModel |
|
|
|
{ |
|
|
|
IncreateName = item, |
|
|
|
IsSelected = isSelected |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -984,7 +1004,9 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
|
|
|
|
} |
|
|
|
CertificateModel.Brand = Brand; |
|
|
|
CertificateModel.BrandName = BrandName; |
|
|
|
if (!string.IsNullOrEmpty(BrandName)) |
|
|
|
|
|
|
|
CertificateModel.BrandName = BrandName; |
|
|
|
CertificateModel.ProductNo = ProductNo; |
|
|
|
CertificateModel.SkuId = SkuId; |
|
|
|
BarCodeModel = productSku.Data.BarCodeModel; |
|
|
@ -995,8 +1017,10 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
IsSetBarCode = true; |
|
|
|
} |
|
|
|
BarCodeModel.Brand = Brand; |
|
|
|
BarCodeModel.BrandName = BrandName; |
|
|
|
if (!string.IsNullOrEmpty(BrandName)) |
|
|
|
BarCodeModel.BrandName = BrandName; |
|
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
|
|
|
|
|
BarCodeModel.SkuId = SkuId; |
|
|
|
BarCodeModel.SkuName = SkuName; |
|
|
|
} |
|
|
@ -1035,7 +1059,8 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
SpuCertificateModel = new CertificateModel(); |
|
|
|
IsSetSpuCertificate = true; |
|
|
|
SpuCertificateModel.Brand = Brand; |
|
|
|
SpuCertificateModel.BrandName = BrandName; |
|
|
|
if (!string.IsNullOrEmpty(BrandName)) |
|
|
|
SpuCertificateModel.BrandName = BrandName; |
|
|
|
SpuCertificateModel.ProductNo = ProductNo; |
|
|
|
SpuCertificateModel.SpuId = SpuId; |
|
|
|
|
|
|
|