diff --git a/BBWY.Client/Models/Product/Product.cs b/BBWY.Client/Models/Product/Product.cs index 818e707b..86006ead 100644 --- a/BBWY.Client/Models/Product/Product.cs +++ b/BBWY.Client/Models/Product/Product.cs @@ -8,10 +8,10 @@ namespace BBWY.Client.Models public Product() { PurchaserList = new ObservableCollection(); - PurchasePlatformList = new List(); + PurchasePlatformList = new List(); } - private PurchasePlatformModel selectedPurchasePlatformModel; + private Platform selectedPurchasePlatformModel; /// /// 商品Id @@ -41,12 +41,12 @@ namespace BBWY.Client.Models /// /// 采购平台集合 /// - public IList PurchasePlatformList { get; set; } + public IList PurchasePlatformList { get; set; } /// /// 选中的采购平台 /// - public PurchasePlatformModel SelectedPurchasePlatformModel + public Platform SelectedPurchasePlatformModel { get => selectedPurchasePlatformModel; set { Set(ref selectedPurchasePlatformModel, value); } @@ -54,8 +54,8 @@ namespace BBWY.Client.Models public void CreatePlatformList() { - PurchasePlatformList.Add(new PurchasePlatformModel() { ProductId = this.Id, PurchasePlatform = Platform.阿里巴巴 }); - PurchasePlatformList.Add(new PurchasePlatformModel() { ProductId = this.Id, PurchasePlatform = Platform.拳探 }); + PurchasePlatformList.Add(Platform.阿里巴巴); + PurchasePlatformList.Add(Platform.拳探); SelectedPurchasePlatformModel = PurchasePlatformList[0]; } } diff --git a/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs b/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs index 4a16e679..4cd53221 100644 --- a/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs +++ b/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs @@ -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(AddPurchaser); EditPurchaserCommand = new RelayCommand(EditPurchaser); DeletePurchaserCommand = new RelayCommand(DeletePurchaser); + SwitchPurchasePlatformCommand = new RelayCommand(SwitchPurchasePlatform); SearchCommand = new RelayCommand(() => { PageIndex = 1; @@ -194,9 +197,9 @@ namespace BBWY.Client.ViewModels /// 加载采购方案 /// /// - private void LoadPurchaseScheme(IList skuList) + private void LoadPurchaseScheme(IList 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 diff --git a/BBWY.Client/Views/Ware/WareManager.xaml b/BBWY.Client/Views/Ware/WareManager.xaml index e42c7707..8a8f92b9 100644 --- a/BBWY.Client/Views/Ware/WareManager.xaml +++ b/BBWY.Client/Views/Ware/WareManager.xaml @@ -18,6 +18,7 @@ + @@ -242,12 +243,18 @@ - - + + + + + + + +