|
@ -29,7 +29,7 @@ using System.Windows.Navigation; |
|
|
|
|
|
|
|
|
namespace BBWY.Client.ViewModels.PackTask |
|
|
namespace BBWY.Client.ViewModels.PackTask |
|
|
{ |
|
|
{ |
|
|
public class CreatePackTaskViewModel : BaseVM,IDenpendency |
|
|
public class CreatePackTaskViewModel : BaseVM, IDenpendency |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -257,13 +257,48 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 设置显示(条形码)
|
|
|
/// 设置显示(条形码)
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public bool IsSetBarCode { get => isSetBarCode; set { Set(ref isSetBarCode, value); } } |
|
|
public bool IsSetBarCode |
|
|
|
|
|
{ |
|
|
|
|
|
get => isSetBarCode; set |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
Set(ref isSetBarCode, value); |
|
|
|
|
|
IsNeedBarCode = IsSetBarCode ? "不需要" : "需要"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private bool isSetCertificate; |
|
|
private bool isSetCertificate; |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 设置显示(合格证)
|
|
|
/// 设置显示(合格证)
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public bool IsSetCertificate { get => isSetCertificate; set { Set(ref isSetCertificate, value); } } |
|
|
public bool IsSetCertificate |
|
|
|
|
|
{ |
|
|
|
|
|
get => isSetCertificate; set |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
Set(ref isSetCertificate, value); |
|
|
|
|
|
IsNeedCertificateModel = IsSetCertificate ? "不需要" : "需要"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
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; |
|
|
private string saveTask; |
|
|
|
|
|
|
|
@ -273,6 +308,18 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } |
|
|
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; |
|
|
private CertificateModel certificateModel; |
|
@ -351,17 +398,21 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
|
|
|
|
|
public ICommand BarLabelCheckCommand { get; set; } |
|
|
public ICommand BarLabelCheckCommand { get; set; } |
|
|
public ICommand CerLabelCheckCommand { get; set; } |
|
|
public ICommand CerLabelCheckCommand { get; set; } |
|
|
|
|
|
public ICommand SpuCerLabelCheckCommand { get; set; } |
|
|
|
|
|
|
|
|
public ICommand LookBarCommand { get; set; } |
|
|
public ICommand LookBarCommand { get; set; } |
|
|
public ICommand LookCerCommand { get; set; } |
|
|
public ICommand LookCerCommand { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ICommand SetSpuCerCommand { get; set; } |
|
|
|
|
|
public ICommand SaveSpuCerCommand { get; set; } |
|
|
|
|
|
public ICommand InseartCerCommand { get; set; } |
|
|
|
|
|
|
|
|
public void InitData(PackTaskModel model = null) |
|
|
public void InitData(PackTaskModel model = null) |
|
|
{ |
|
|
{ |
|
|
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
|
|
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
|
|
|
SpuId = string.Empty; |
|
|
if (model == null) |
|
|
if (model == null) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@ -397,7 +448,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
SaveTask = "保存"; |
|
|
SaveTask = "保存"; |
|
|
|
|
|
|
|
|
Logo = model.ItemList[0].Logo; |
|
|
Logo = model.ItemList[0].Logo; |
|
|
SearchSkuId =model.SkuId ; |
|
|
SearchSkuId = model.SkuId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SkuId = model.SkuId; |
|
|
SkuId = model.SkuId; |
|
@ -407,8 +458,8 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
Brand = model.Brand; |
|
|
Brand = model.Brand; |
|
|
BrandName = model.ItemList[0].BrandName; |
|
|
BrandName = model.ItemList[0].BrandName; |
|
|
this.MarkMessage = model.MarkMessage; |
|
|
this.MarkMessage = model.MarkMessage; |
|
|
IsSetBarCode = model.BarCodeModel!=null ? false:true; |
|
|
IsSetBarCode = model.BarCodeModel != null ? false : true; |
|
|
IsSetCertificate = model.CertificateModel!=null ? false : true; |
|
|
IsSetCertificate = model.CertificateModel != null ? false : true; |
|
|
BarCodeModel = model.BarCodeModel; |
|
|
BarCodeModel = model.BarCodeModel; |
|
|
CertificateModel = model.CertificateModel; |
|
|
CertificateModel = model.CertificateModel; |
|
|
SkuTitle = model.SkuTitle; |
|
|
SkuTitle = model.SkuTitle; |
|
@ -416,13 +467,13 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
Availability = model.Availability; |
|
|
Availability = model.Availability; |
|
|
IsWorry = model.IsWorry; |
|
|
IsWorry = model.IsWorry; |
|
|
PositionType = model.PositionType; |
|
|
PositionType = model.PositionType; |
|
|
PackType =model.PackType; |
|
|
PackType = model.PackType; |
|
|
BasicPack = model.BasicPack; |
|
|
BasicPack = model.BasicPack; |
|
|
IsNeedBarCode = model.BarCodeModel != null ? "需要" : "不需要"; |
|
|
IsNeedBarCode = model.BarCodeModel != null ? "需要" : "不需要"; |
|
|
IsNeedCertificateModel = model.CertificateModel != null ? "需要" : "不需要"; |
|
|
IsNeedCertificateModel = model.CertificateModel != null ? "需要" : "不需要"; |
|
|
CertificatePosition = model.CertificatePosition; |
|
|
CertificatePosition = model.CertificatePosition; |
|
|
TaskId = model.TaskId; |
|
|
TaskId = model.TaskId; |
|
|
string[] increateDatas =model.Increment1.Split(','); |
|
|
string[] increateDatas = model.Increment1.Split(','); |
|
|
|
|
|
|
|
|
bool isSelected = false; |
|
|
bool isSelected = false; |
|
|
foreach (var item in increates) |
|
|
foreach (var item in increates) |
|
@ -438,7 +489,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
IsSelected = isSelected |
|
|
IsSelected = isSelected |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
//SearchSku();
|
|
|
SearchSku(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -469,10 +520,6 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
IsSelected = false |
|
|
IsSelected = false |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询sku
|
|
|
//查询sku
|
|
|
SearchSkuCommand = new RelayCommand(() => |
|
|
SearchSkuCommand = new RelayCommand(() => |
|
|
{ |
|
|
{ |
|
@ -485,9 +532,15 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
SetCertificateCommand = new RelayCommand(SetCertificate); |
|
|
SetCertificateCommand = new RelayCommand(SetCertificate); |
|
|
SaveBarCodeCommand = new RelayCommand(SaveBarCode); |
|
|
SaveBarCodeCommand = new RelayCommand(SaveBarCode); |
|
|
|
|
|
|
|
|
|
|
|
SetSpuCerCommand = new RelayCommand(SetSpuCer); |
|
|
|
|
|
SaveSpuCerCommand = new RelayCommand(SaveSpuCer); |
|
|
|
|
|
InseartCerCommand = new RelayCommand(InseartCer); |
|
|
|
|
|
|
|
|
SaveCerCommand = new RelayCommand(SaveCer); |
|
|
SaveCerCommand = new RelayCommand(SaveCer); |
|
|
BarLabelCheckCommand = new RelayCommand<BarcodeLabelModel>(BarLabelCheck); |
|
|
BarLabelCheckCommand = new RelayCommand<BarcodeLabelModel>(BarLabelCheck); |
|
|
CerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(CerLabelCheck); |
|
|
CerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(CerLabelCheck); |
|
|
|
|
|
SpuCerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(SpuCerLabelCheck); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LookBarCommand = new RelayCommand(LookBar); |
|
|
LookBarCommand = new RelayCommand(LookBar); |
|
|
LookCerCommand = new RelayCommand(LookCer); |
|
|
LookCerCommand = new RelayCommand(LookCer); |
|
@ -497,7 +550,76 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
BarLabelCheck(BarcodeLabelModel.精简模板);//默认精简模式
|
|
|
BarLabelCheck(BarcodeLabelModel.精简模板);//默认精简模式
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void InseartCer() |
|
|
|
|
|
{ |
|
|
|
|
|
CertificateModel = new CertificateModel() |
|
|
|
|
|
{ |
|
|
|
|
|
//SpuId = SpuCertificateModel.SpuId,
|
|
|
|
|
|
SkuId = SkuId, |
|
|
|
|
|
Brand = SpuCertificateModel.Brand, |
|
|
|
|
|
BrandName = SpuCertificateModel.BrandName, |
|
|
|
|
|
ExcuteStander = SpuCertificateModel.ExcuteStander, |
|
|
|
|
|
FactoryNumber = SpuCertificateModel.FactoryNumber, |
|
|
|
|
|
IsLogo = SpuCertificateModel.IsLogo, |
|
|
|
|
|
LabelModel = SpuCertificateModel.LabelModel, |
|
|
|
|
|
ProductAdress = SpuCertificateModel.ProductAdress, |
|
|
|
|
|
ProductNo = SpuCertificateModel.ProductNo, |
|
|
|
|
|
Shader = SpuCertificateModel.Shader, |
|
|
|
|
|
ProductShop = SpuCertificateModel.ProductShop, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void SetSpuCer() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
if (SpuCertificateModel == null) |
|
|
|
|
|
{ |
|
|
|
|
|
SpuCertificateModel = new CertificateModel(); |
|
|
|
|
|
SpuCertificateModel.ProductNo = ProductNo; |
|
|
|
|
|
SpuCertificateModel.Brand = Brand; |
|
|
|
|
|
SpuCertificateModel.SkuId = SkuId; |
|
|
|
|
|
} |
|
|
|
|
|
SpuCertificateModel.BrandName = BrandName; |
|
|
|
|
|
setSpuCerWindow = new SetSpuCerWindow(); |
|
|
|
|
|
setSpuCerWindow.Show(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void SaveSpuCer() |
|
|
|
|
|
{ |
|
|
|
|
|
if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander) |
|
|
|
|
|
|| string.IsNullOrEmpty(SpuCertificateModel.Shader) || string.IsNullOrEmpty(SpuCertificateModel.BrandName) |
|
|
|
|
|
|| string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop) |
|
|
|
|
|
|| string.IsNullOrEmpty(SpuCertificateModel.ProductAdress)) |
|
|
|
|
|
{ |
|
|
|
|
|
new TipsWindow("参数出错!请重新填写!").Show(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
var resData = packTaskService.SaveSpuCer(new CerRequest |
|
|
|
|
|
{ |
|
|
|
|
|
Brand = SpuCertificateModel.Brand, |
|
|
|
|
|
BrandName = SpuCertificateModel.BrandName, |
|
|
|
|
|
ProductNo = SpuCertificateModel.ProductNo, |
|
|
|
|
|
SpuId = SpuCertificateModel.SpuId, |
|
|
|
|
|
ExcuteStander = SpuCertificateModel.ExcuteStander, |
|
|
|
|
|
LabelModel = (int)SpuCertificateModel.LabelModel, |
|
|
|
|
|
FactoryNumber = SpuCertificateModel.FactoryNumber, |
|
|
|
|
|
IsLogo = SpuCertificateModel.IsLogo, |
|
|
|
|
|
ProductAdress = SpuCertificateModel.ProductAdress, |
|
|
|
|
|
ProductShop = SpuCertificateModel.ProductShop, |
|
|
|
|
|
Shader = SpuCertificateModel.Shader |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
if (resData == null || !resData.Success) |
|
|
|
|
|
{ |
|
|
|
|
|
IsSetSpuCertificate = false; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
IsNeedCertificateModel = "需要"; |
|
|
|
|
|
CertificateModel.Id = resData.Data; |
|
|
|
|
|
IsSetSpuCertificate = false; |
|
|
|
|
|
setSpuCerWindow.Close(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void OnSearchIncreateKeyWordChanged(string key) |
|
|
private void OnSearchIncreateKeyWordChanged(string key) |
|
|
{ |
|
|
{ |
|
@ -558,11 +680,15 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
}); |
|
|
}); |
|
|
look.Show(); |
|
|
look.Show(); |
|
|
} |
|
|
} |
|
|
|
|
|
private void SpuCerLabelCheck(CertificateLabelModel cer) |
|
|
|
|
|
{ |
|
|
|
|
|
SpuCertificateModel.LabelModel = cer; |
|
|
|
|
|
SpuCertificateModel.IsLogo = cer == CertificateLabelModel.标准有3c ? 1 : 0; |
|
|
|
|
|
} |
|
|
private void CerLabelCheck(CertificateLabelModel cer) |
|
|
private void CerLabelCheck(CertificateLabelModel cer) |
|
|
{ |
|
|
{ |
|
|
CertificateModel.LabelModel = cer; |
|
|
CertificateModel.LabelModel = cer; |
|
|
CertificateModel.IsLogo = cer== CertificateLabelModel.标准有3c?1:0; |
|
|
CertificateModel.IsLogo = cer == CertificateLabelModel.标准有3c ? 1 : 0; |
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
///
|
|
|
///
|
|
@ -595,7 +721,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
SearSpuCer(); |
|
|
|
|
|
|
|
|
if (CertificateModel == null) |
|
|
if (CertificateModel == null) |
|
|
{ |
|
|
{ |
|
@ -607,7 +733,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
} |
|
|
} |
|
|
CertificateModel.BrandName = BrandName; |
|
|
CertificateModel.BrandName = BrandName; |
|
|
setCerWindow = new SetCerWindow(); |
|
|
setCerWindow = new SetCerWindow(); |
|
|
setCerWindow.ShowDialog(); |
|
|
setCerWindow.Show(); |
|
|
//throw new NotImplementedException();
|
|
|
//throw new NotImplementedException();
|
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
@ -620,7 +746,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|| string.IsNullOrEmpty(CertificateModel.Brand) || string.IsNullOrEmpty(CertificateModel.ProductShop) |
|
|
|| string.IsNullOrEmpty(CertificateModel.Brand) || string.IsNullOrEmpty(CertificateModel.ProductShop) |
|
|
|| string.IsNullOrEmpty(CertificateModel.ProductAdress)) |
|
|
|| string.IsNullOrEmpty(CertificateModel.ProductAdress)) |
|
|
{ |
|
|
{ |
|
|
new TipsWindow("参数出错!请重新填写!").ShowDialog(); |
|
|
new TipsWindow("参数出错!请重新填写!").Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
var standers = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries); |
|
|
var standers = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries); |
|
@ -652,10 +778,10 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
setCerWindow.Close(); |
|
|
setCerWindow.Close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SetBarCodeWindow setBarCodeWindow = null; SetCerWindow setCerWindow = null; |
|
|
SetBarCodeWindow setBarCodeWindow = null; SetCerWindow setCerWindow = null; SetSpuCerWindow setSpuCerWindow = null; |
|
|
private void SetBarCode() |
|
|
private void SetBarCode() |
|
|
{ |
|
|
{ |
|
|
if (string.IsNullOrEmpty( SearchSkuId)) |
|
|
if (string.IsNullOrEmpty(SearchSkuId)) |
|
|
{ |
|
|
{ |
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
new TipsWindow("请先查询skuId").Show(); |
|
|
return; |
|
|
return; |
|
@ -672,7 +798,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
BarCodeModel.BrandName = BrandName; |
|
|
BarCodeModel.BrandName = BrandName; |
|
|
setBarCodeWindow = new SetBarCodeWindow(); |
|
|
setBarCodeWindow = new SetBarCodeWindow(); |
|
|
|
|
|
|
|
|
setBarCodeWindow.ShowDialog(); |
|
|
setBarCodeWindow.Show(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public BarcodeLabelModel LabelModel = BarcodeLabelModel.精简模板; |
|
|
public BarcodeLabelModel LabelModel = BarcodeLabelModel.精简模板; |
|
@ -685,7 +811,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
if (string.IsNullOrEmpty(ProductNo) || ProductNo == "待填写") |
|
|
if (string.IsNullOrEmpty(ProductNo) || ProductNo == "待填写") |
|
|
{ |
|
|
{ |
|
|
TipsWindow tips = new TipsWindow("该SKU无货号信息,将影响条形码打印\r\n请先设置好货号信息或调整打印模板类型"); |
|
|
TipsWindow tips = new TipsWindow("该SKU无货号信息,将影响条形码打印\r\n请先设置好货号信息或调整打印模板类型"); |
|
|
tips.ShowDialog(); |
|
|
tips.Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -728,7 +854,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
new TipsWindow("请先搜索SkuId!").Show(); |
|
|
new TipsWindow("请先搜索SkuId!").Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (SkuCount<=0) |
|
|
if (SkuCount <= 0) |
|
|
{ |
|
|
{ |
|
|
new TipsWindow("请设置SKU任务数!").Show(); |
|
|
new TipsWindow("请设置SKU任务数!").Show(); |
|
|
return; |
|
|
return; |
|
@ -741,7 +867,10 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
} |
|
|
} |
|
|
var createTaskModel = new Models.APIModel.Request.CreateTaskRequest |
|
|
var createTaskModel = new Models.APIModel.Request.CreateTaskRequest |
|
|
{ |
|
|
{ |
|
|
TaskId=TaskId, |
|
|
ProductNo = ProductNo, |
|
|
|
|
|
Logo = Logo, |
|
|
|
|
|
SkuName = SkuName, |
|
|
|
|
|
TaskId = TaskId, |
|
|
BrandName = BrandName, |
|
|
BrandName = BrandName, |
|
|
Availability = (int)Availability, |
|
|
Availability = (int)Availability, |
|
|
BasicPack = (int)BasicPack, |
|
|
BasicPack = (int)BasicPack, |
|
@ -764,7 +893,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
{ |
|
|
{ |
|
|
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|
|
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|
|
{ |
|
|
{ |
|
|
new TipsWindow("请设置条形码模板").ShowDialog(); |
|
|
new TipsWindow("请设置条形码模板").Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
createTaskModel.BarCodeId = BarCodeModel.Id; |
|
|
createTaskModel.BarCodeId = BarCodeModel.Id; |
|
@ -773,13 +902,13 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
{ |
|
|
{ |
|
|
if (CertificateModel == null || CertificateModel.Id <= 0) |
|
|
if (CertificateModel == null || CertificateModel.Id <= 0) |
|
|
{ |
|
|
{ |
|
|
new TipsWindow("请设置合格证模板").ShowDialog(); |
|
|
new TipsWindow("请设置合格证模板").Show(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
createTaskModel.CertificateId = CertificateModel.Id;//
|
|
|
createTaskModel.CertificateId = CertificateModel.Id;//
|
|
|
} |
|
|
} |
|
|
ApiResponse<object> res = null; |
|
|
ApiResponse<object> res = null; |
|
|
if (TaskId>0)//修改界面
|
|
|
if (TaskId > 0)//修改界面
|
|
|
{ |
|
|
{ |
|
|
res = packTaskService.UpdateTask(createTaskModel); |
|
|
res = packTaskService.UpdateTask(createTaskModel); |
|
|
} |
|
|
} |
|
@ -822,7 +951,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
SkuName = skuResponse.Data[0].Title; |
|
|
SkuName = skuResponse.Data[0].Title; |
|
|
// ProductNo = skuResponse.Data[0].ProductItemNum;
|
|
|
// ProductNo = skuResponse.Data[0].ProductItemNum;
|
|
|
|
|
|
|
|
|
|
|
|
SpuId = skuResponse.Data[0].ProductId; |
|
|
|
|
|
|
|
|
productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1); |
|
|
productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1); |
|
|
|
|
|
|
|
@ -846,11 +975,13 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
} |
|
|
} |
|
|
BrandName = productSku.Data.BrandName; |
|
|
BrandName = productSku.Data.BrandName; |
|
|
|
|
|
|
|
|
IsSetCertificate = true; |
|
|
|
|
|
CertificateModel = productSku.Data.Certificate; |
|
|
CertificateModel = productSku.Data.Certificate; |
|
|
|
|
|
IsSetCertificate = false; |
|
|
if (CertificateModel == null) |
|
|
if (CertificateModel == null) |
|
|
{ |
|
|
{ |
|
|
CertificateModel = new CertificateModel(); |
|
|
CertificateModel = new CertificateModel(); |
|
|
|
|
|
IsSetCertificate = true; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
CertificateModel.Brand = Brand; |
|
|
CertificateModel.Brand = Brand; |
|
@ -858,16 +989,17 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
CertificateModel.ProductNo = ProductNo; |
|
|
CertificateModel.ProductNo = ProductNo; |
|
|
CertificateModel.SkuId = SkuId; |
|
|
CertificateModel.SkuId = SkuId; |
|
|
BarCodeModel = productSku.Data.BarCodeModel; |
|
|
BarCodeModel = productSku.Data.BarCodeModel; |
|
|
|
|
|
IsSetBarCode = false; |
|
|
if (BarCodeModel == null) |
|
|
if (BarCodeModel == null) |
|
|
{ |
|
|
{ |
|
|
BarCodeModel = new BarCodeModel(); |
|
|
BarCodeModel = new BarCodeModel(); |
|
|
|
|
|
IsSetBarCode = true; |
|
|
} |
|
|
} |
|
|
BarCodeModel.Brand = Brand; |
|
|
BarCodeModel.Brand = Brand; |
|
|
BarCodeModel.BrandName = BrandName; |
|
|
BarCodeModel.BrandName = BrandName; |
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
BarCodeModel.SkuId = SkuId; |
|
|
BarCodeModel.SkuId = SkuId; |
|
|
BarCodeModel.SkuName = SkuName; |
|
|
BarCodeModel.SkuName = SkuName; |
|
|
IsSetBarCode = true; |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -880,5 +1012,38 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
//查看有木有存在
|
|
|
//查看有木有存在
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void SearSpuCer() |
|
|
|
|
|
{ |
|
|
|
|
|
if (string.IsNullOrEmpty(SpuId)) |
|
|
|
|
|
{ |
|
|
|
|
|
SearchSku(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
SpuId = SpuId.Trim();//去掉空格 避免数据异常
|
|
|
|
|
|
IsLoading = true; |
|
|
|
|
|
|
|
|
|
|
|
var productSku = packTaskService.GetSpuCer(SpuId); |
|
|
|
|
|
if (productSku == null || !productSku.Success) |
|
|
|
|
|
{ |
|
|
|
|
|
IsSetSpuCertificate = true; |
|
|
|
|
|
IsLoading = false; |
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
IsLoading = false; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|