|
|
@ -36,6 +36,15 @@ namespace BBWY.Client.ViewModels |
|
|
|
public string Town { get => town; set { Set(ref town, value); } } |
|
|
|
public string PrucahseRemark { get => prucahseRemark; set { Set(ref prucahseRemark, value); } } |
|
|
|
|
|
|
|
public PurchaseOrderMode PurchaseOrderMode |
|
|
|
{ |
|
|
|
get => purchaseOrderMode; set |
|
|
|
{ |
|
|
|
if (Set(ref purchaseOrderMode, value)) |
|
|
|
OnDelayTriggerExecute(Guid.NewGuid().ToString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private OrderListViewModel orderListViewModel; |
|
|
|
private GlobalContext globalContext; |
|
|
|
private string orderId; |
|
|
@ -56,7 +65,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
private string county; |
|
|
|
private string town; |
|
|
|
private string prucahseRemark; |
|
|
|
|
|
|
|
private PurchaseOrderMode purchaseOrderMode = PurchaseOrderMode.代发; |
|
|
|
private string tradeMode; |
|
|
|
|
|
|
|
public _1688PreviewPurchaseViewModel(OneBoundAPIService oneBoundAPIService, PurchaseOrderService purchaseOrderService, GlobalContext globalContext, OrderListViewModel orderListViewModel) |
|
|
@ -69,6 +78,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
FastCreateOrderCommand = new RelayCommand(FastCreateOrder); |
|
|
|
this.globalContext = globalContext; |
|
|
|
this.orderListViewModel = orderListViewModel; |
|
|
|
//PurchaseOrderMode = PurchaseOrderMode.代发;
|
|
|
|
} |
|
|
|
|
|
|
|
public void SetData(string orderId, int skuItemCount, PurchaseScheme purchaseScheme, PurchaseAccount purchaseAccount, Consignee consignee) |
|
|
@ -102,7 +112,13 @@ namespace BBWY.Client.ViewModels |
|
|
|
{ |
|
|
|
WaitHandle.WaitAll(waitList.ToArray()); |
|
|
|
//IsLoading = false;
|
|
|
|
OnDelayTriggerExecute(string.Empty); |
|
|
|
if (PurchaseSchemeProductSkuList.Count() > 0) |
|
|
|
OnDelayTriggerExecute(Guid.NewGuid().ToString()); |
|
|
|
else |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show("采购方案商品加载失败,请重新打开预览窗口", "提示")); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -150,6 +166,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
//记录日志
|
|
|
|
|
|
|
|
errorMsg = response.Msg; |
|
|
|
Console.WriteLine(errorMsg); |
|
|
|
return null; |
|
|
|
} |
|
|
|
var jobject = response.Data; |
|
|
@ -205,6 +222,8 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
private void OnDelayTriggerExecute(string key) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(key)) |
|
|
|
return; |
|
|
|
IsLoading = true; |
|
|
|
Task.Factory.StartNew(() => purchaseOrderService.PreviewPurchaseOrder(new Consignee() |
|
|
|
{ |
|
|
@ -216,7 +235,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
Province = Province, |
|
|
|
TelePhone = Mobile, |
|
|
|
Town = Town |
|
|
|
}, PurchaseSchemeProductSkuList, Platform.阿里巴巴, PurchaseAccount)) |
|
|
|
}, PurchaseSchemeProductSkuList, Platform.阿里巴巴, PurchaseAccount, PurchaseOrderMode)) |
|
|
|
.ContinueWith(t => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
@ -242,9 +261,19 @@ namespace BBWY.Client.ViewModels |
|
|
|
MessageBox.Show("总金额为0不能提交订单", "提示"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (string.IsNullOrEmpty(Mobile) || |
|
|
|
string.IsNullOrEmpty(Address) || |
|
|
|
string.IsNullOrEmpty(City) || |
|
|
|
string.IsNullOrEmpty(Province) || |
|
|
|
string.IsNullOrEmpty(County) || |
|
|
|
string.IsNullOrEmpty(Town) || |
|
|
|
string.IsNullOrEmpty(ContactName)) |
|
|
|
{ |
|
|
|
MessageBox.Show("收货人信息不全", "下单"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
IsLoading = true; |
|
|
|
|
|
|
|
Task.Factory.StartNew(() => purchaseOrderService.FastCreateOrder(new Consignee() |
|
|
|
{ |
|
|
|
Address = Address, |
|
|
@ -258,6 +287,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
}, PurchaseSchemeProductSkuList, |
|
|
|
Platform.阿里巴巴, |
|
|
|
PurchaseAccount, |
|
|
|
PurchaseOrderMode, |
|
|
|
tradeMode, |
|
|
|
PrucahseRemark, |
|
|
|
orderId, |
|
|
|