From df579dee7952e057d741efe5d0df2491939d6510 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Fri, 24 Feb 2023 08:36:45 +0800 Subject: [PATCH] 1 --- BBWY.Client/APIServices/PurchaseService.cs | 4 ++-- BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/BBWY.Client/APIServices/PurchaseService.cs b/BBWY.Client/APIServices/PurchaseService.cs index df4a63fa..8a5c92ca 100644 --- a/BBWY.Client/APIServices/PurchaseService.cs +++ b/BBWY.Client/APIServices/PurchaseService.cs @@ -23,7 +23,7 @@ namespace BBWY.Client.APIServices string purchaserId = "", long? shopId = null, long? schemeId = null, - Platform? platform = null) + Platform? purchasePlatform = null) { return SendRequest>(globalContext.BBYWApiHost, "api/PurchaseScheme/GetPurchaseSchemeList", @@ -33,7 +33,7 @@ namespace BBWY.Client.APIServices purchaserId, shopId, schemeId, - platform + purchasePlatform }, null, HttpMethod.Post); diff --git a/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs b/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs index 4cd53221..b9995e9f 100644 --- a/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs +++ b/BBWY.Client/ViewModels/Ware/WareManagerViewModel.cs @@ -197,9 +197,9 @@ namespace BBWY.Client.ViewModels /// 加载采购方案 /// /// - private void LoadPurchaseScheme(IList skuList, Platform? platform = Platform.阿里巴巴) + private void LoadPurchaseScheme(IList skuList, Platform? purchasePlatform = Platform.阿里巴巴) { - var response = purchaseService.GetPurchaseSchemeList(skuList.Select(s => s.Id).ToList(), string.Empty, globalContext.User.Shop.ShopId, platform: platform); + var response = purchaseService.GetPurchaseSchemeList(skuList.Select(s => s.Id).ToList(), string.Empty, globalContext.User.Shop.ShopId, purchasePlatform: purchasePlatform); if (!response.Success) { App.Current.Dispatcher.BeginInvoke((Action)delegate { MessageBox.Show(response.Msg, "获取采购方案"); }); @@ -331,7 +331,14 @@ namespace BBWY.Client.ViewModels var productId = paramList[0].ToString(); var platform = (Platform)paramList[1]; - + var product = ProductList.FirstOrDefault(p => p.Id == productId); + IsLoading = true; + Task.Factory.StartNew(() => LoadPurchaseScheme(product.SkuList, platform)) + .ContinueWith(t => + { + App.Current.Dispatcher.Invoke(() => ExtractPurchaser(productId)); + IsLoading = false; + }); } #endregion