|
@ -472,17 +472,101 @@ namespace BBWYB.Client.ViewModels |
|
|
Brand = productApiResponse.Data.Items[0].BrandName; |
|
|
Brand = productApiResponse.Data.Items[0].BrandName; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IsNeedBarCode = Need.需要; |
|
|
|
|
|
IsSetBarCode = true; |
|
|
|
|
|
IsSetCertificate = true; |
|
|
var productSku = packPurchaseTaskService.GetConfigPack(SkuId, "", OrderId); |
|
|
var productSku = packPurchaseTaskService.GetConfigPack(SkuId, "", OrderId); |
|
|
|
|
|
|
|
|
if (productSku == null || !productSku.Success || productSku.Data == null) |
|
|
if (productSku == null) |
|
|
{ |
|
|
{ |
|
|
MessageBox.Show(productSku.Msg); |
|
|
MessageBox.Show("网络异常!"); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
PurchaseSkuList = new ObservableCollection<Models.PackPurchaseTask.PurchaseSku>(); |
|
|
|
|
|
SkuPurchaseSchemeId = null; |
|
|
|
|
|
if (productSku.Success && productSku.Data != null && !string.IsNullOrEmpty(productSku.Data.SkuPurchaseSchemeId)) |
|
|
|
|
|
{ |
|
|
|
|
|
SkuPurchaseSchemeId = productSku.Data.SkuPurchaseSchemeId; |
|
|
|
|
|
BarCodeModel = productSku.Data.BarCode; |
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in productSku.Data.PurchaseSkus) |
|
|
|
|
|
{ |
|
|
|
|
|
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); |
|
|
|
|
|
if (list == null || !list.Success || list.Data == null) continue; |
|
|
|
|
|
var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|
|
|
|
|
if (skuItem == null) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show($"{item.PurchaseProductId}采购商品列表不存在skuid:{item.PurchaseSkuId},sku商品可能被下架了."); |
|
|
|
|
|
//return false;
|
|
|
|
|
|
} |
|
|
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
|
|
{ |
|
|
|
|
|
PurchaseSkuList.Add(new Models.PackPurchaseTask.PurchaseSku |
|
|
|
|
|
{ |
|
|
|
|
|
Logo = skuItem?.Logo, |
|
|
|
|
|
Title = skuItem?.Title, |
|
|
|
|
|
IsNeedCer = item.IsNeedCer, |
|
|
|
|
|
PurchaseSkuId = item.PurchaseSkuId, |
|
|
|
|
|
CerDTO = item.CerDTO, |
|
|
|
|
|
IsSetCertificate = item.CerDTO == null ? true : false, |
|
|
|
|
|
}); |
|
|
|
|
|
})); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (productSku.Data.PackConfig != null) |
|
|
|
|
|
{ |
|
|
|
|
|
var config = productSku.Data.PackConfig; |
|
|
|
|
|
SkuTitle = config.SkuGoodsTitle; |
|
|
|
|
|
BrandName = config.BrandName; |
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
IsNeedBarCode = config.NeedBar ? Need.需要 : Need.不需要; |
|
|
|
|
|
IsNeedCertificateModel = config.NeedCer ? Need.需要 : Need.不需要; |
|
|
|
|
|
|
|
|
|
|
|
IsSetBarCode = !config.NeedBar; |
|
|
|
|
|
IsSetCertificate = !config.NeedCer; |
|
|
|
|
|
|
|
|
|
|
|
string[] increateDatas = config.Increment1?.Split(','); |
|
|
|
|
|
bool isSelected = false; |
|
|
|
|
|
|
|
|
|
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
|
|
|
foreach (var item in increates) |
|
|
|
|
|
{ |
|
|
|
|
|
isSelected = false; |
|
|
|
|
|
if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) |
|
|
|
|
|
{ |
|
|
|
|
|
isSelected = true; |
|
|
|
|
|
} |
|
|
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
|
|
{ |
|
|
|
|
|
IncreateList.Add(new IncreateModel |
|
|
|
|
|
{ |
|
|
|
|
|
IncreateName = item, |
|
|
|
|
|
IsSelected = isSelected |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
PurchaseSkuList.Add(new Models.PackPurchaseTask.PurchaseSku |
|
|
|
|
|
{ |
|
|
|
|
|
CerDTO = new CertificateModel { } |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SkuPurchaseSchemeId = productSku.Data.SkuPurchaseSchemeId; |
|
|
|
|
|
BarCodeModel = productSku.Data.BarCode; |
|
|
|
|
|
if (BarCodeModel == null) |
|
|
if (BarCodeModel == null) |
|
|
{ |
|
|
{ |
|
|
BarCodeModel = new BarCodeModel(); |
|
|
BarCodeModel = new BarCodeModel(); |
|
@ -495,75 +579,7 @@ namespace BBWYB.Client.ViewModels |
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
BarCodeModel.SkuId = SkuId; |
|
|
BarCodeModel.SkuId = SkuId; |
|
|
BarCodeModel.SkuName = SkuName; |
|
|
BarCodeModel.SkuName = SkuName; |
|
|
PurchaseSkuList = new ObservableCollection<Models.PackPurchaseTask.PurchaseSku>(); |
|
|
|
|
|
foreach (var item in productSku.Data.PurchaseSkus) |
|
|
|
|
|
{ |
|
|
|
|
|
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); |
|
|
|
|
|
if (list == null) continue; |
|
|
|
|
|
var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|
|
|
|
|
if (skuItem == null) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show($"{item.PurchaseProductId}采购商品列表不存在skuid:{item.PurchaseSkuId},sku商品可能被下架了."); |
|
|
|
|
|
//return false;
|
|
|
|
|
|
} |
|
|
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
|
|
{ |
|
|
|
|
|
PurchaseSkuList.Add(new Models.PackPurchaseTask.PurchaseSku |
|
|
|
|
|
{ |
|
|
|
|
|
Logo = skuItem?.Logo, |
|
|
|
|
|
Title = skuItem?.Title, |
|
|
|
|
|
IsNeedCer = item.IsNeedCer, |
|
|
|
|
|
PurchaseSkuId = item.PurchaseSkuId, |
|
|
|
|
|
CerDTO = item.CerDTO, |
|
|
|
|
|
IsSetCertificate = item.CerDTO == null ? true : false, |
|
|
|
|
|
}); |
|
|
|
|
|
})); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IsNeedBarCode = Need.需要; |
|
|
|
|
|
IsSetBarCode = true; |
|
|
|
|
|
IsSetCertificate = true; |
|
|
|
|
|
if (productSku.Data.PackConfig != null) |
|
|
|
|
|
{ |
|
|
|
|
|
var config = productSku.Data.PackConfig; |
|
|
|
|
|
SkuTitle = config.SkuGoodsTitle; |
|
|
|
|
|
BrandName = config.BrandName; |
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
IsNeedBarCode = config.NeedBar ? Need.需要 : Need.不需要; |
|
|
|
|
|
IsNeedCertificateModel = config.NeedCer ? Need.需要 : Need.不需要; |
|
|
|
|
|
|
|
|
|
|
|
IsSetBarCode = !config.NeedBar; |
|
|
|
|
|
IsSetCertificate = !config.NeedCer; |
|
|
|
|
|
|
|
|
|
|
|
string[] increateDatas = config.Increment1?.Split(','); |
|
|
|
|
|
bool isSelected = false; |
|
|
|
|
|
|
|
|
|
|
|
IncreateList = new ObservableCollection<IncreateModel>(); |
|
|
|
|
|
foreach (var item in increates) |
|
|
|
|
|
{ |
|
|
|
|
|
isSelected = false; |
|
|
|
|
|
if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) |
|
|
|
|
|
{ |
|
|
|
|
|
isSelected = true; |
|
|
|
|
|
} |
|
|
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
|
|
{ |
|
|
|
|
|
IncreateList.Add(new IncreateModel |
|
|
|
|
|
{ |
|
|
|
|
|
IncreateName = item, |
|
|
|
|
|
IsSelected = isSelected |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|