|
|
@ -49,6 +49,8 @@ namespace BBWY.Client.ViewModels |
|
|
|
public ICommand DeletePurchaserCommand { get; set; } |
|
|
|
public ICommand SearchCommand { get; set; } |
|
|
|
public ICommand ProductPageIndexChangedCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand SwitchPurchasePlatformCommand { get; set; } |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Methods
|
|
|
@ -57,6 +59,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
AddPurchaserCommand = new RelayCommand<Product>(AddPurchaser); |
|
|
|
EditPurchaserCommand = new RelayCommand<Purchaser>(EditPurchaser); |
|
|
|
DeletePurchaserCommand = new RelayCommand<Purchaser>(DeletePurchaser); |
|
|
|
SwitchPurchasePlatformCommand = new RelayCommand<object>(SwitchPurchasePlatform); |
|
|
|
SearchCommand = new RelayCommand(() => |
|
|
|
{ |
|
|
|
PageIndex = 1; |
|
|
@ -194,9 +197,9 @@ namespace BBWY.Client.ViewModels |
|
|
|
/// 加载采购方案
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="productList"></param>
|
|
|
|
private void LoadPurchaseScheme(IList<ProductSku> skuList) |
|
|
|
private void LoadPurchaseScheme(IList<ProductSku> skuList, Platform? platform = Platform.阿里巴巴) |
|
|
|
{ |
|
|
|
var response = purchaseService.GetPurchaseSchemeList(skuList.Select(s => s.Id).ToList(), string.Empty, globalContext.User.Shop.ShopId); |
|
|
|
var response = purchaseService.GetPurchaseSchemeList(skuList.Select(s => s.Id).ToList(), string.Empty, globalContext.User.Shop.ShopId, platform: platform); |
|
|
|
if (!response.Success) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)delegate { MessageBox.Show(response.Msg, "获取采购方案"); }); |
|
|
@ -312,7 +315,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
Task.Factory.StartNew(() => |
|
|
|
{ |
|
|
|
IsLoading = true; |
|
|
|
LoadPurchaseScheme(skuList); |
|
|
|
LoadPurchaseScheme(skuList, product.SelectedPurchasePlatformModel); |
|
|
|
IsLoading = false; |
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)delegate |
|
|
|
{ |
|
|
@ -321,6 +324,15 @@ namespace BBWY.Client.ViewModels |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void SwitchPurchasePlatform(object param) |
|
|
|
{ |
|
|
|
var paramList = (object[])param; |
|
|
|
var productId = paramList[0].ToString(); |
|
|
|
var platform = (Platform)paramList[1]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|