|
|
@ -53,6 +53,11 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
"需要", "不需要" }; |
|
|
|
public ObservableCollection<string> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } |
|
|
|
|
|
|
|
private ObservableCollection<string> isNeedCerList = new ObservableCollection<string> { |
|
|
|
"需要", "不需要" }; |
|
|
|
public ObservableCollection<string> IsNeedCerList { get => isNeedCerList; set { Set(ref isNeedCerList, value); } } |
|
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> { |
|
|
|
"无","外部包装","产品包装" |
|
|
|
}; |
|
|
@ -180,7 +185,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
|
|
|
|
Set(ref isSetBarCode, value); |
|
|
|
IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要; |
|
|
|
// IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -194,7 +199,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
|
|
|
|
Set(ref isSetCertificate, value); |
|
|
|
IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要; |
|
|
|
//IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要;
|
|
|
|
} |
|
|
|
} |
|
|
|
private string setSpuCerStatus; |
|
|
@ -325,6 +330,11 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
if (TaskId>0&&string.IsNullOrEmpty(SpuId))//修改界面刷新配置数据
|
|
|
|
{ |
|
|
|
SearchSku(SkuId); |
|
|
|
} |
|
|
|
|
|
|
|
if (BarCodeModel == null) |
|
|
|
{ |
|
|
|
BarCodeModel = new BarCodeModel(); |
|
|
@ -425,7 +435,6 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
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); |
|
|
@ -443,12 +452,42 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
|
|
|
|
} |
|
|
|
var productSku = packTaskService.GetProductSku(skuid); |
|
|
|
if (productSku == null || !productSku.Success) |
|
|
|
if (productSku == null || !productSku.Success||productSku.Data==null) |
|
|
|
return; |
|
|
|
BrandName = productSku.Data.BrandName; |
|
|
|
CertificateModel = productSku.Data.Cers; |
|
|
|
if (CertificateModel == null) |
|
|
|
{ |
|
|
|
CertificateModel = new CertificateModel[] { |
|
|
|
new CertificateModel{ } |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
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; |
|
|
|
if (BarCodeModel == null) |
|
|
|
{ |
|
|
|
BarCodeModel = new BarCodeModel(); |
|
|
|
} |
|
|
|
BarCodeModel.Brand = Brand; |
|
|
|
if (!string.IsNullOrEmpty(BrandName)) |
|
|
|
BarCodeModel.BrandName = BrandName; |
|
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
|
BarCodeModel.SkuId = skuid; |
|
|
|
BarCodeModel.SkuName = SkuName; |
|
|
|
|
|
|
|
|
|
|
|
IsNeedBarCode = Need.需要; |
|
|
|
IsSetBarCode = true; |
|
|
|
IsSetCertificate = true; |
|
|
|
if (productSku.Data.PackConfig != null) |
|
|
|
{ |
|
|
|
var config = productSku.Data.PackConfig; |
|
|
@ -461,6 +500,11 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; |
|
|
|
// Increment1 = config.Increment1;
|
|
|
|
string[] increateDatas = config.Increment1.Split(','); |
|
|
|
IsNeedBarCode = config.NeedBar ? Need.需要 : Need.不需要; |
|
|
|
IsNeedCertificateModel = config.NeedCer ? Need.需要 : Need.不需要; |
|
|
|
|
|
|
|
IsSetBarCode = !config.NeedBar; |
|
|
|
IsSetCertificate =!config.NeedCer; |
|
|
|
|
|
|
|
bool isSelected = false; |
|
|
|
foreach (var item in increates) |
|
|
@ -481,42 +525,6 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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 |
|
|
|
{ |
|
|
@ -525,6 +533,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//加载配置文件
|
|
|
|
} |
|
|
|
|
|
|
|
public void SearSpuCer() |
|
|
@ -641,7 +650,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
SearchSku(SkuId); |
|
|
|
// SearchSku(SkuId);
|
|
|
|
|
|
|
|
} |
|
|
|
private void OpenSkuDetail(object param) |
|
|
@ -663,9 +672,6 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void CreateTask(object obj) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(SkuId)) |
|
|
@ -706,12 +712,14 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
SkuCount = SkuCount, |
|
|
|
UserId = globalContext.User.Id.ToString(), |
|
|
|
ShopId = globalContext.User.Shop.ShopId.ToString(), |
|
|
|
NeedBar =IsNeedBarCode==Need.需要, |
|
|
|
NeedCer =IsNeedCertificateModel==Need.需要 |
|
|
|
|
|
|
|
//IsWorry = IsWorry
|
|
|
|
}; |
|
|
|
if (IsNeedBarCode == Need.需要) |
|
|
|
{ |
|
|
|
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|
|
|
if (BarCodeModel == null ||IsSetBarCode|| BarCodeModel.Id <= 0) |
|
|
|
{ |
|
|
|
new TipsWindow("请设置条形码模板").Show(); |
|
|
|
return; |
|
|
@ -720,7 +728,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
} |
|
|
|
if (IsNeedCertificateModel == Need.需要) |
|
|
|
{ |
|
|
|
if (CertificateModel == null || CertificateModel.Count() <= 0) |
|
|
|
if (CertificateModel == null || IsSetCertificate || CertificateModel.Count() <= 0) |
|
|
|
{ |
|
|
|
new TipsWindow("请设置合格证模板").Show(); |
|
|
|
return; |
|
|
|