105 lines
2.9 KiB
C#
105 lines
2.9 KiB
C#
using HandyControl.Controls;
|
|
using Ping9719.WpfEx.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
using WCS.BLL.DbModels;
|
|
using WCS.Model;
|
|
using WCS.Model.ApiModel.MatBaseInfo;
|
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
|
using 货架标准上位机.Api;
|
|
|
|
namespace 货架标准上位机.ViewModels
|
|
{
|
|
public class OutInventoryAddMatViewModel : BindableBase
|
|
{
|
|
#region Property
|
|
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
|
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
|
{
|
|
get { return dataGridItemSource; }
|
|
set
|
|
{
|
|
SetProperty(ref dataGridItemSource, value);
|
|
}
|
|
}
|
|
|
|
private MatInventorySummaryModel selectedataGridItem;
|
|
public MatInventorySummaryModel SelectedataGridItem
|
|
{
|
|
get { return selectedataGridItem; }
|
|
set
|
|
{
|
|
SetProperty(ref selectedataGridItem, value);
|
|
}
|
|
}
|
|
|
|
|
|
private string matCode;
|
|
public string MatCode
|
|
{
|
|
get { return matCode; }
|
|
set
|
|
{
|
|
SetProperty(ref matCode, value);
|
|
}
|
|
}
|
|
|
|
private string matName;
|
|
public string MatName
|
|
{
|
|
get { return matName; }
|
|
set
|
|
{
|
|
SetProperty(ref matName, value);
|
|
}
|
|
}
|
|
|
|
private int shelfTypeId;
|
|
public int ShelfTypeId
|
|
{
|
|
get => shelfTypeId;
|
|
set { SetProperty(ref shelfTypeId, value); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Command
|
|
/// <summary>
|
|
/// 搜索
|
|
/// </summary>
|
|
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearch); }
|
|
public void BtnSearch()
|
|
{
|
|
#region 调用接口获取数据
|
|
try
|
|
{
|
|
var body = new GetMatInventorySummaryRequest()
|
|
{
|
|
MatName = MatName,
|
|
MatCode = MatCode,
|
|
ShelfTypeId = ShelfTypeId,
|
|
};
|
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInventorySummaryModel>>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventorySummary", body, "POST");
|
|
if (Result != null && Result.Data != null)
|
|
{
|
|
DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>(Result.Data);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Growl.Error("加载数据失败:" + ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
#endregion
|
|
}
|
|
#endregion
|
|
}
|
|
}
|