change -成品下线查询

dev
liuwf 1 year ago
parent dfbda6226f
commit b0deb4402f

@ -10,7 +10,10 @@ namespace Admin.Core.IService
/// </summary>
public interface IBaseMaterialInfoServices : IBaseServices<BaseMaterialInfo>
{
public Task<List<BaseMaterialInfo>> query();
/// <summary>
/// 查出BASE_MATERIALINFO中存在的成品类型
/// </summary>
public Task<List<BaseMaterialInfo>> queryAsync(string search);
}
}

@ -29,9 +29,19 @@ namespace Admin.Core.Service
/// <summary>
/// 1.查出BASE_MATERIALINFO中存在的成品类型
/// </summary>
public async Task<List<BaseMaterialInfo>> query()
public async Task<List<BaseMaterialInfo>> queryAsync(string search)
{
List<BaseMaterialInfo> list = await _baseMaterialInfoRepository.QueryAsync(x => x.MaterialType == "FERT");
List<BaseMaterialInfo> list;
if (!string.IsNullOrEmpty(search))
{
list = await _baseMaterialInfoRepository.QueryAsync(x => x.MaterialType == "FERT" && (x.MaterialCode.Contains(search) || x.MaterialName.Contains(search)));
}
else
{
list = await _baseMaterialInfoRepository.QueryAsync(x => x.MaterialType == "FERT");
}
return list;
}

@ -43,8 +43,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
{
MaterialDataGrid.Clear();
// 处理查询按钮点击事件
// 1.先查出BASE_MATERIALINFO中存在但BASE_SPACEINFO不存在的成品类型(说明该类型未分配货道)
List<BaseMaterialInfo> materialInfoList = await _baseMaterialInfoServices.query();
List<BaseMaterialInfo> materialInfoList = await _baseMaterialInfoServices.queryAsync(Search);
int count = 0;
Application.Current.Dispatcher.Invoke(() =>
{
@ -85,8 +84,17 @@ namespace Aucma.Core.ProductOffLine.ViewModels
MessageBox.Show("保存失败");
}
}
#region 参数定义
private string _search = string.Empty;
public string Search
{
get { return _search; }
set {
_search = value;
OnPropertyChanged(nameof(Search));
}
}
#region 初始化datagrid
private ObservableCollection<DirectionEditModel> materialDataGrid = new ObservableCollection<DirectionEditModel>();
public ObservableCollection<DirectionEditModel> MaterialDataGrid
@ -100,6 +108,6 @@ namespace Aucma.Core.ProductOffLine.ViewModels
}
#endregion
#endregion
}
}

@ -22,7 +22,8 @@
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Grid.Column="2">
<Button Content="刷 新" Command="{Binding QueryCommand}" Background="#007DFA" BorderBrush="#007DFA" VerticalAlignment="Center" Foreground="White" Height="30" Width="100" />
<TextBox Width="200" Height="25" Margin="10 0 0 0" Text="{Binding Search}" Foreground="#FFFFFF" VerticalAlignment="Center" FontSize="15"/>
<Button Content="查 询" Command="{Binding QueryCommand}" Background="#007DFA" BorderBrush="#007DFA" VerticalAlignment="Center" Foreground="White" Height="30" Width="100" />
<Button Content="保 存" Command="{Binding SaveCommand}" Background="#007DFA" BorderBrush="#007DFA" VerticalAlignment="Center" Foreground="White" Height="30" Width="100" Margin="50 0 0 0"/>
</StackPanel>
<!--计划列表-->

Loading…
Cancel
Save