提交代码
This commit is contained in:
@ -27,6 +27,8 @@ using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using HandyControl.Tools.Extension;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
using System.Collections.ObjectModel;
|
||||
using static 货架标准上位机.ViewModel.InOutRecordViewModel;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
@ -162,6 +164,44 @@ namespace 货架标准上位机.ViewModel
|
||||
SetProperty(ref matSN, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DirectionEnum? selectedDirection;
|
||||
public DirectionEnum? SelectedDirection
|
||||
{
|
||||
get { return selectedDirection; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedDirection, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<DirectionItem> Directions => GetEnumValues();
|
||||
private ObservableCollection<DirectionItem> GetEnumValues()
|
||||
{
|
||||
// 初始化ObservableCollection
|
||||
var directions = new ObservableCollection<DirectionItem>();
|
||||
// 添加“全部”选项
|
||||
directions.Add(new DirectionItem { Text = "全部", Value = null }); // Value设置为null或某个表示“全部”的值
|
||||
|
||||
// 遍历DirectionEnum枚举并添加项
|
||||
foreach (DirectionEnum direction in Enum.GetValues(typeof(DirectionEnum)))
|
||||
{
|
||||
directions.Add(new DirectionItem { Text = direction.ToString(), Value = direction });
|
||||
}
|
||||
return directions;
|
||||
}
|
||||
|
||||
public class DirectionItem
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
@ -192,11 +232,13 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
var body = new GetInOutRecordRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
|
||||
MatSN = MatSN,
|
||||
MatName = MatName,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
Direction = SelectedDirection,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
Reference in New Issue
Block a user