|
|
@ -29,9 +29,11 @@ namespace BBWY.Client.ViewModels |
|
|
|
private bool isLoading; |
|
|
|
private KVModel selectedLocalFilterOperation; |
|
|
|
private bool isEnableCanCorrectionOrder; |
|
|
|
private StorageType? selectedStorageType; |
|
|
|
private KVModel selectedStorageType; |
|
|
|
private string searchLocalOrderId; |
|
|
|
private Shop selectedLocalShop; |
|
|
|
private Shop allShop; |
|
|
|
private KVModel allStorageType; |
|
|
|
|
|
|
|
private GlobalContext globalContext; |
|
|
|
|
|
|
@ -107,16 +109,19 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
public IList<KVModel> LocalFilterOperationList { get; set; } |
|
|
|
|
|
|
|
public IList<KVModel> LocalStorageTypeList { get; set; } |
|
|
|
|
|
|
|
public KVModel SelectedLocalFilterOperation { get => selectedLocalFilterOperation; set { Set(ref selectedLocalFilterOperation, value); } } |
|
|
|
|
|
|
|
public bool IsEnableCanCorrectionOrder { get => isEnableCanCorrectionOrder; set { Set(ref isEnableCanCorrectionOrder, value); } } |
|
|
|
|
|
|
|
public StorageType? SelectedStorageType { get => selectedStorageType; set { Set(ref selectedStorageType, value); } } |
|
|
|
public KVModel SelectedStorageType { get => selectedStorageType; set { Set(ref selectedStorageType, value); } } |
|
|
|
|
|
|
|
public string SearchLocalOrderId { get => searchLocalOrderId; set { Set(ref searchLocalOrderId, value); } } |
|
|
|
|
|
|
|
public Shop SelectedLocalShop { get => selectedLocalShop; set { Set(ref selectedLocalShop, value); } } |
|
|
|
|
|
|
|
|
|
|
|
public BillCorrectionViewModel(GlobalContext globalContext, BillCorrectionService billCorrectionService) |
|
|
|
{ |
|
|
|
this.billCorrectionService = billCorrectionService; |
|
|
@ -137,6 +142,17 @@ namespace BBWY.Client.ViewModels |
|
|
|
new KVModel(){ Key="保留",Value="save" }, |
|
|
|
new KVModel(){ Key="过滤",Value="filter"} |
|
|
|
}; |
|
|
|
LocalStorageTypeList = new List<KVModel>(); |
|
|
|
|
|
|
|
var storageTypeArray = Enum.GetValues(typeof(StorageType)); |
|
|
|
foreach (var storageType in storageTypeArray) |
|
|
|
{ |
|
|
|
LocalStorageTypeList.Add(new KVModel() |
|
|
|
{ |
|
|
|
Key = storageType.ToString(), |
|
|
|
Value = ((int)storageType).ToString() |
|
|
|
}); |
|
|
|
} |
|
|
|
ImportSaleFreightBillCommand = new RelayCommand<string>(ImportSaleFreightBill); |
|
|
|
SearchBillCorrectionOrderCommand = new RelayCommand(SearchBillCorrectionOrder); |
|
|
|
CorrectCommand = new RelayCommand(Correct); |
|
|
@ -145,6 +161,14 @@ namespace BBWY.Client.ViewModels |
|
|
|
ClearLocalConditionCommand = new RelayCommand(ClearLocalCondition); |
|
|
|
SaveCommand = new RelayCommand(Save); |
|
|
|
SelectedLocalFilterOperation = LocalFilterOperationList[0]; |
|
|
|
allShop = new Shop() { ShopId = 0, ShopName = "全部" }; |
|
|
|
allStorageType = new KVModel() { Key = "全部", Value = string.Empty }; |
|
|
|
|
|
|
|
LocalStorageTypeList.Insert(0, allStorageType); |
|
|
|
SelectedStorageType = allStorageType; |
|
|
|
|
|
|
|
LocalShopList.Insert(0, allShop); |
|
|
|
SelectedLocalShop = allShop; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnSearchShopKeyWordChanged(string key) |
|
|
@ -357,9 +381,10 @@ namespace BBWY.Client.ViewModels |
|
|
|
return; |
|
|
|
} |
|
|
|
IsLoading = true; |
|
|
|
foreach (var shop in LocalShopList) |
|
|
|
foreach (var shop in selectShops) |
|
|
|
LocalShopList.Add(shop); |
|
|
|
SelectedLocalShop = null; |
|
|
|
LocalShopList.Insert(0, allShop); |
|
|
|
SelectedLocalShop = LocalShopList[0]; |
|
|
|
var shopIds = selectShops.Select(s => s.ShopId).ToList(); |
|
|
|
Task.Factory.StartNew(() => billCorrectionService.GetBillCorrectionOrderList(shopIds, StartDate, EndDate)) |
|
|
|
.ContinueWith(t => |
|
|
@ -402,10 +427,10 @@ namespace BBWY.Client.ViewModels |
|
|
|
{ |
|
|
|
LocalOrderList.Clear(); |
|
|
|
var where = OrderList.Where(o => true); |
|
|
|
if (SelectedLocalShop != null) |
|
|
|
if (SelectedLocalShop != null && SelectedLocalShop.ShopId != 0) |
|
|
|
where = where.Where(o => o.ShopId == SelectedLocalShop.ShopId); |
|
|
|
if (SelectedStorageType != null) |
|
|
|
where = where.Where(o => o.StorageType == SelectedStorageType); |
|
|
|
if (SelectedStorageType != null && !string.IsNullOrEmpty(SelectedStorageType.Value)) |
|
|
|
where = where.Where(o => o.StorageType == (StorageType)Convert.ToInt32(SelectedStorageType.Value)); |
|
|
|
if (!string.IsNullOrEmpty(SearchLocalOrderId)) |
|
|
|
where = where.Where(o => o.OrderId == SearchLocalOrderId); |
|
|
|
if (IsEnableCanCorrectionOrder) |
|
|
@ -465,20 +490,20 @@ namespace BBWY.Client.ViewModels |
|
|
|
SaleFreightBillList.Clear(); |
|
|
|
OrderList.Clear(); |
|
|
|
LocalOrderList.Clear(); |
|
|
|
SelectedStorageType = null; |
|
|
|
SelectedStorageType = allStorageType; |
|
|
|
IsEnableCanCorrectionOrder = false; |
|
|
|
SearchShopKeyWord = string.Empty; |
|
|
|
SearchLocalOrderId = string.Empty; |
|
|
|
SelectedLocalShop = null; |
|
|
|
SelectedLocalShop = allShop; |
|
|
|
SelectedLocalFilterOperation = LocalFilterOperationList[0]; |
|
|
|
} |
|
|
|
|
|
|
|
private void ClearLocalCondition() |
|
|
|
{ |
|
|
|
SelectedStorageType = null; |
|
|
|
SelectedStorageType = allStorageType; |
|
|
|
IsEnableCanCorrectionOrder = false; |
|
|
|
SearchLocalOrderId = string.Empty; |
|
|
|
SelectedLocalShop = null; |
|
|
|
SelectedLocalShop = allShop; |
|
|
|
SearchLocalOrderList(); |
|
|
|
} |
|
|
|
|
|
|
|