|
|
@ -23,20 +23,22 @@ namespace BBWY.Client.Views.SealBox |
|
|
|
/// </summary>
|
|
|
|
public partial class AddProductWindow : BWindow |
|
|
|
{ |
|
|
|
public AddProductWindow(PackTaskService packTaskService, ProductService productService) |
|
|
|
public AddProductWindow(PackTaskService packTaskService, ProductService productService, Action ReflashTask) |
|
|
|
{ |
|
|
|
this. packTaskService = packTaskService; |
|
|
|
this. productService = productService; |
|
|
|
this.packTaskService = packTaskService; |
|
|
|
this.productService = productService; |
|
|
|
this.ReflashTask = ReflashTask; |
|
|
|
InitializeComponent(); |
|
|
|
this.DataContext = this; |
|
|
|
} |
|
|
|
ProductService productService; |
|
|
|
PackTaskService packTaskService; |
|
|
|
ProductService productService; |
|
|
|
PackTaskService packTaskService; |
|
|
|
Action ReflashTask; |
|
|
|
private int count; |
|
|
|
public int Count { get => count; set { Set(ref count, value); } } |
|
|
|
|
|
|
|
private string skuId; |
|
|
|
public string SkuId { get=>skuId; set { Set(ref skuId, value); } } |
|
|
|
public string SkuId { get => skuId; set { Set(ref skuId, value); } } |
|
|
|
|
|
|
|
private string logo; |
|
|
|
public string Logo { get => logo; set { Set(ref logo, value); } } |
|
|
@ -45,7 +47,7 @@ namespace BBWY.Client.Views.SealBox |
|
|
|
public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } } |
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<PositionType> PositionTypes { get; set; }=new ObservableCollection<PositionType>() { |
|
|
|
public ObservableCollection<PositionType> PositionTypes { get; set; } = new ObservableCollection<PositionType>() { |
|
|
|
PositionType.商家仓, PositionType.云仓, PositionType.京仓, PositionType.聚水潭 |
|
|
|
}; |
|
|
|
|
|
|
@ -54,11 +56,11 @@ namespace BBWY.Client.Views.SealBox |
|
|
|
|
|
|
|
private void BButton_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
if (Count<=0) |
|
|
|
if (Count <= 0) |
|
|
|
{ |
|
|
|
MessageBox.Show("请输入任务数"); return; |
|
|
|
} |
|
|
|
var res = packTaskService.AddSealBoxProduct(SkuId, PositionType, Count); |
|
|
|
var res = packTaskService.AddSealBoxProduct(SkuId, PositionType, Count); |
|
|
|
|
|
|
|
if (res == null || !res.Success) |
|
|
|
{ |
|
|
@ -66,6 +68,8 @@ namespace BBWY.Client.Views.SealBox |
|
|
|
} |
|
|
|
|
|
|
|
this.Close(); |
|
|
|
if (ReflashTask != null) |
|
|
|
ReflashTask(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BButton_Click_1(object sender, RoutedEventArgs e) |
|
|
@ -76,18 +80,18 @@ namespace BBWY.Client.Views.SealBox |
|
|
|
} |
|
|
|
SkuId = SkuId.Trim(); |
|
|
|
var res = productService.GetProductSkuList(null, SkuId); |
|
|
|
if (res==null||!res.Success) |
|
|
|
if (res == null || !res.Success) |
|
|
|
{ |
|
|
|
MessageBox.Show(res?.Msg);return; |
|
|
|
MessageBox.Show(res?.Msg); return; |
|
|
|
} |
|
|
|
var productSku = res.Data.SingleOrDefault(d => d.Id == SkuId); |
|
|
|
|
|
|
|
if (productSku==null) |
|
|
|
if (productSku == null) |
|
|
|
{ |
|
|
|
MessageBox.Show("不存在对应的sku商品数据."); return; |
|
|
|
} |
|
|
|
SkuTitle = productSku.Title; |
|
|
|
Logo= productSku.Logo.Replace("80x80","150x150"); |
|
|
|
SkuTitle = productSku.Title; |
|
|
|
Logo = productSku.Logo.Replace("80x80", "150x150"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|