|
|
@ -111,8 +111,6 @@ namespace BBWYB.Client.ViewModels |
|
|
|
public void SetData(Order order, IList<PurchaseScheme> schemeList) |
|
|
|
{ |
|
|
|
this.order = order; |
|
|
|
//this.purchaser = purchaser;
|
|
|
|
//this.purchaseAccount = purchaseAccount;
|
|
|
|
this.schemeList = schemeList; |
|
|
|
this.ContactName = order.Consignee.ContactName; |
|
|
|
this.Address = order.Consignee.Address; |
|
|
@ -229,35 +227,35 @@ namespace BBWYB.Client.ViewModels |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//IsLoading = true;
|
|
|
|
//Task.Factory.StartNew(() => purchaseOrderService.PreviewPurchaseOrder(new Consignee()
|
|
|
|
//{
|
|
|
|
// Address = Address,
|
|
|
|
// City = City,
|
|
|
|
// ContactName = ContactName,
|
|
|
|
// County = County,
|
|
|
|
// Mobile = Mobile,
|
|
|
|
// Province = Province,
|
|
|
|
// TelePhone = Mobile,
|
|
|
|
// Town = Town
|
|
|
|
//}, PurchaseSchemeProductSkuList, purchaseAccount.PurchasePlatformId, purchaseAccount, PurchaseOrderMode))
|
|
|
|
// .ContinueWith(t =>
|
|
|
|
// {
|
|
|
|
// IsLoading = false;
|
|
|
|
// var r = t.Result;
|
|
|
|
// if (!r.Success)
|
|
|
|
// {
|
|
|
|
// ProductAmount = FreightAmount = TotalAmount = 0;
|
|
|
|
// extensions = string.Empty;
|
|
|
|
// App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "预览订单报价"));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// ProductAmount = r.Data.ProductAmount;
|
|
|
|
// FreightAmount = r.Data.FreightAmount;
|
|
|
|
// TotalAmount = r.Data.TotalAmount;
|
|
|
|
// //tradeMode = r.Data.OrderTradeType?.Code;
|
|
|
|
// extensions = r.Data.Extensions;
|
|
|
|
// });
|
|
|
|
IsLoading = true; |
|
|
|
Task.Factory.StartNew(() => purchaseOrderService.PreviewPurchaseOrder(new Consignee() |
|
|
|
{ |
|
|
|
Address = Address, |
|
|
|
City = City, |
|
|
|
ContactName = ContactName, |
|
|
|
County = County, |
|
|
|
Mobile = Mobile, |
|
|
|
Province = Province, |
|
|
|
TelePhone = Mobile, |
|
|
|
Town = Town |
|
|
|
}, ProductSkuWithSchemeList, PurchaseOrderMode)) |
|
|
|
.ContinueWith(t => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
var r = t.Result; |
|
|
|
if (!r.Success) |
|
|
|
{ |
|
|
|
ProductAmount = FreightAmount = TotalAmount = 0; |
|
|
|
extensions = string.Empty; |
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "预览订单报价")); |
|
|
|
return; |
|
|
|
} |
|
|
|
ProductAmount = r.Data.ProductAmount; |
|
|
|
FreightAmount = r.Data.FreightAmount; |
|
|
|
TotalAmount = r.Data.TotalAmount; |
|
|
|
//tradeMode = r.Data.OrderTradeType?.Code;
|
|
|
|
extensions = r.Data.Extensions; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void FastCreateOrder() |
|
|
@ -286,43 +284,40 @@ namespace BBWYB.Client.ViewModels |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//IsLoading = true;
|
|
|
|
//Task.Factory.StartNew(() => purchaseOrderService.FastCreateOrder(new Consignee()
|
|
|
|
//{
|
|
|
|
// Address = Address,
|
|
|
|
// City = City,
|
|
|
|
// ContactName = ContactName,
|
|
|
|
// County = County,
|
|
|
|
// Mobile = Mobile,
|
|
|
|
// Province = Province,
|
|
|
|
// TelePhone = Mobile,
|
|
|
|
// Town = Town
|
|
|
|
//}, PurchaseSchemeProductSkuList,
|
|
|
|
// purchaseAccount.PurchasePlatformId,
|
|
|
|
// purchaseAccount,
|
|
|
|
// PurchaseOrderMode,
|
|
|
|
// PrucahseRemark,
|
|
|
|
// order.Id,
|
|
|
|
// globalContext.User.Shop.ShopId,
|
|
|
|
// purchaseSchemeList[0].PurchaserName,
|
|
|
|
// extensions)).ContinueWith(t =>
|
|
|
|
// {
|
|
|
|
// IsLoading = false;
|
|
|
|
// var r = t.Result;
|
|
|
|
// if (!r.Success)
|
|
|
|
// {
|
|
|
|
// App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "下单"));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //刷新订单列表
|
|
|
|
// //orderListViewModel.RefreshOrder(order.Id);
|
|
|
|
// orderVM.RefreshOrder(order.Id);
|
|
|
|
|
|
|
|
// //关闭当前窗口
|
|
|
|
// //GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<object>(null, "OnlinePurchase_Close");
|
|
|
|
// WeakReferenceMessenger.Default.Send(new Message_OnlinePurchase_Close(null));
|
|
|
|
// });
|
|
|
|
IsLoading = true; |
|
|
|
Task.Factory.StartNew(() => purchaseOrderService.FastCreateOrder(new Consignee() |
|
|
|
{ |
|
|
|
Address = Address, |
|
|
|
City = City, |
|
|
|
ContactName = ContactName, |
|
|
|
County = County, |
|
|
|
Mobile = Mobile, |
|
|
|
Province = Province, |
|
|
|
TelePhone = Mobile, |
|
|
|
Town = Town |
|
|
|
}, ProductSkuWithSchemeList, |
|
|
|
PurchaseOrderMode, |
|
|
|
PrucahseRemark, |
|
|
|
order.Id, |
|
|
|
globalContext.User.Shop.ShopId, |
|
|
|
extensions)).ContinueWith(t => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
var r = t.Result; |
|
|
|
if (!r.Success) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "下单")); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//刷新订单列表
|
|
|
|
//orderListViewModel.RefreshOrder(order.Id);
|
|
|
|
orderVM.RefreshOrder(order.Id); |
|
|
|
|
|
|
|
//关闭当前窗口
|
|
|
|
//GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<object>(null, "OnlinePurchase_Close");
|
|
|
|
WeakReferenceMessenger.Default.Send(new Message_OnlinePurchase_Close(null)); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void PreviewOrder() |
|
|
|