liuwf 1 year ago
parent cffa06e652
commit 5c1e5f769e

@ -1581,8 +1581,8 @@
<Border Background="#213269" BorderBrush="Silver" BorderThickness="2" CornerRadius="10" Margin="0,5,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="物料名称:" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="MaterialName" Width="200" Height="40" Margin="5,0,0,0" VerticalAlignment="Center"/>
<Button Content="搜索" Background="#346DFF" Foreground="White" FontSize="25" Height="50" Width="100" Margin="20,0,0,0" Click="SelectButton_Click"/>
<TextBox x:Name="MaterialName" Width="200" Height="40" Margin="5,0,0,0" VerticalAlignment="Center" KeyDown="Form1_KeyDown"/>
<Button Content="搜索" Background="#346DFF" Foreground="White" FontSize="25" Height="50" Width="100" Margin="20,0,0,0" Click="SelectButton_Click" KeyDown="Form1_KeyDown"/>
<Button Content="出空箱" HorizontalAlignment="Right" Background="#346DFF" Foreground="White" FontSize="25" Height="50" Width="100" Margin="20,0,0,0" Click="CallEmptyBtn_Click"/>
<Button Content="出选择料箱" HorizontalAlignment="Right" Background="#346DFF" Foreground="White" FontSize="25" Height="50" Width="200" Margin="20,0,0,0" Click="CallTrayBtn_Click"/>
</StackPanel>
@ -1964,7 +1964,7 @@
<hc:TextBox x:Name="txtInBarCode" hc:InfoElement.ShowClearButton="True" FontSize="50" LostFocus="txtInBarCode_TextChanged" TextChanged="txtInBarCode_TextChanged" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="100" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="3"/>
<hc:TextBox x:Name="materialName" IsReadOnly="True" hc:InfoElement.ShowClearButton="True" FontSize="50" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="100" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="3"/>
<hc:TextBox x:Name="materialSpec" IsReadOnly="True" hc:InfoElement.ShowClearButton="True" FontSize="50" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="100" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="3"/>
<hc:TextBox x:Name="txtInScan" FontSize="50" IsReadOnly="True" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="100" Grid.Row="5" Grid.Column="3" Grid.ColumnSpan="3" />
<hc:TextBox x:Name="txtInScan" FontSize="50" IsReadOnly="True" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="100" Grid.Row="5" Grid.Column="3" Grid.ColumnSpan="3" KeyDown="ScanInKeyDown" />
<Button Content="确认入库" Grid.Row="6" Grid.ColumnSpan="6" Width="300" Height="100" FontSize="50" Background="#346DFF" Foreground="White" Click="InRawBaseLocaltion_Click"/>
<Button Content="一键收料" Grid.Row="7" Grid.ColumnSpan="6" Width="300" Height="100" FontSize="50" Background="#346DFF" Foreground="White" Click="callPlc_Click" HorizontalAlignment="Right"/>
<TextBlock Grid.Row="7" Text="提示信息:" HorizontalAlignment="Center" Grid.Column="1" Grid.ColumnSpan="1" Width="250" Height="100" FontSize="50" Foreground="White" />

@ -31,6 +31,7 @@ using System.Windows.Input;
using System.Windows;
using System.Windows.Controls;
using System.Collections.ObjectModel;
using static HandyControl.Tools.Interop.InteropValues;
namespace Khd.Core.Wpf.Form
{
@ -1269,7 +1270,7 @@ namespace Khd.Core.Wpf.Form
wcsTask.taskStatus = 0;
wcsTask.createTime = DateTime.Now;
wcsTask.useFlag = 1;
wcsTask.objid=Global.SnowId.NextId();
wcsTask.objid = Global.SnowId.NextId();
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
dbContext.Add(wcsTaskLog);
dbContext.Update(wcsTask);
@ -1633,6 +1634,11 @@ namespace Khd.Core.Wpf.Form
/// <param name="sender"></param>
/// <param name="e"></param>
private void InRawBaseLocaltion_Click(object sender, RoutedEventArgs e)
{
ScanInBox();
}
private void ScanInBox()
{
try
{
@ -1818,7 +1824,7 @@ namespace Khd.Core.Wpf.Form
createDate = System.DateTime.Now,
safeFlag = material.safeFlag
};
dbContext.WmsRawStock.Add(newRawStock);
dbContext.SaveChanges();
HandyControl.Controls.MessageBox.Success("入库成功!");
@ -2274,7 +2280,7 @@ namespace Khd.Core.Wpf.Form
List<MesBaseMaterialInfo> materialInfos = new List<MesBaseMaterialInfo>();
if (!string.IsNullOrEmpty(MaterialName.Text))
{
materialInfos = dbContext.MesBaseMaterialInfo.Where(t => t.MaterialName.Contains(MaterialName.Text)).ToList();
materialInfos = dbContext.MesBaseMaterialInfo.Where(t => t.MaterialName.Contains(MaterialName.Text) || t.MaterialCode.Contains(MaterialName.Text) || t.MaterialSpec.Contains(MaterialName.Text)).ToList();
materialIds = materialInfos.Select(t => t.MaterialId).ToList();
}
@ -2317,6 +2323,7 @@ namespace Khd.Core.Wpf.Form
//wmsRawStocksId = b.rawStockId,
locationCode = a.locationCode,
materialId = b.materialId,
materialCode = c.MaterialCode,
materialName = c.MaterialName,
materialSpec = c.MaterialSpec,
palletInfoCode = b.palletInfoCode,
@ -2335,6 +2342,7 @@ namespace Khd.Core.Wpf.Form
totalAmount = string.Join("\n", t.Select(x => x.totalAmount)),
frozenAmount = string.Join("\n", t.Select(x => x.frozenAmount)),
materialId = string.Join("\n", t.Select(x => x.materialId)),
materialCode = string.Join("\n", t.Select(x => x.materialCode)),
materialName = string.Join("\n", t.Select(x => x.materialName[..(x.materialName.Length > 20 ? 20 : x.materialName.Length)])),
materialNameSrc = string.Join("\n", t.Select(x => x.materialName)),
materialSpec = string.Join("\n", t.Select(x => x.materialSpec[..(x.materialSpec.Length > 20 ? 20 : x.materialSpec.Length)])),
@ -3574,5 +3582,30 @@ namespace Khd.Core.Wpf.Form
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
// 触发按钮的点击事件
CallSelectedItem.Clear();
GetPersonCallMaterialData();
}
}
/// <summary>
/// 扫描入库enter
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ScanInKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
// 触发按钮的点击事件
ScanInBox();
}
}
}
}

Loading…
Cancel
Save