1 year ago
commit 87669eacc8

@ -1581,8 +1581,8 @@
<Border Background="#213269" BorderBrush="Silver" BorderThickness="2" CornerRadius="10" Margin="0,5,0,0"> <Border Background="#213269" BorderBrush="Silver" BorderThickness="2" CornerRadius="10" Margin="0,5,0,0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="物料名称:" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/> <TextBlock Text="物料名称:" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="MaterialName" Width="200" Height="40" Margin="5,0,0,0" VerticalAlignment="Center"/> <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"/> <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="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"/> <Button Content="出选择料箱" HorizontalAlignment="Right" Background="#346DFF" Foreground="White" FontSize="25" Height="50" Width="200" Margin="20,0,0,0" Click="CallTrayBtn_Click"/>
</StackPanel> </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="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="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="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="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"/> <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" /> <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;
using System.Windows.Controls; using System.Windows.Controls;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using static HandyControl.Tools.Interop.InteropValues;
namespace Khd.Core.Wpf.Form namespace Khd.Core.Wpf.Form
{ {
@ -1269,7 +1270,7 @@ namespace Khd.Core.Wpf.Form
wcsTask.taskStatus = 0; wcsTask.taskStatus = 0;
wcsTask.createTime = DateTime.Now; wcsTask.createTime = DateTime.Now;
wcsTask.useFlag = 1; wcsTask.useFlag = 1;
wcsTask.objid=Global.SnowId.NextId(); wcsTask.objid = Global.SnowId.NextId();
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask); WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
dbContext.Add(wcsTaskLog); dbContext.Add(wcsTaskLog);
dbContext.Update(wcsTask); dbContext.Update(wcsTask);
@ -1633,6 +1634,11 @@ namespace Khd.Core.Wpf.Form
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void InRawBaseLocaltion_Click(object sender, RoutedEventArgs e) private void InRawBaseLocaltion_Click(object sender, RoutedEventArgs e)
{
ScanInBox();
}
private void ScanInBox()
{ {
try try
{ {
@ -1818,7 +1824,7 @@ namespace Khd.Core.Wpf.Form
createDate = System.DateTime.Now, createDate = System.DateTime.Now,
safeFlag = material.safeFlag safeFlag = material.safeFlag
}; };
dbContext.WmsRawStock.Add(newRawStock); dbContext.WmsRawStock.Add(newRawStock);
dbContext.SaveChanges(); dbContext.SaveChanges();
HandyControl.Controls.MessageBox.Success("入库成功!"); HandyControl.Controls.MessageBox.Success("入库成功!");
@ -1882,7 +1888,8 @@ namespace Khd.Core.Wpf.Form
{ {
try try
{ {
materialName.Text = string.Empty;
materialSpec.Text = string.Empty;
string barCode = txtInBarCode.Text; string barCode = txtInBarCode.Text;
if (barCode.Length < 19) return; if (barCode.Length < 19) return;
@ -1892,6 +1899,8 @@ namespace Khd.Core.Wpf.Form
if (!string.IsNullOrEmpty(barCode)) if (!string.IsNullOrEmpty(barCode))
{ {
var material = dbContext.MesBaseBarcodeInfo.FirstOrDefault(t => t.barcodeInfo == barCode); var material = dbContext.MesBaseBarcodeInfo.FirstOrDefault(t => t.barcodeInfo == barCode);
if (material == null) if (material == null)
{ {
@ -1914,8 +1923,8 @@ namespace Khd.Core.Wpf.Form
{ {
txtInScan.Text = (material.batchFlag == "1") ? "" : "1.00"; txtInScan.Text = (material.batchFlag == "1") ? "" : "1.00";
materialName.Text = mesBaseMaterialInfo.MaterialName;
materialSpec.Text = mesBaseMaterialInfo.MaterialSpec;
if (mesBaseMaterialInfo.BatchFlag == "0") if (mesBaseMaterialInfo.BatchFlag == "0")
{ {
txtInScan.IsReadOnly = true; txtInScan.IsReadOnly = true;
@ -1924,6 +1933,7 @@ namespace Khd.Core.Wpf.Form
{ {
txtInScan.IsReadOnly = false; txtInScan.IsReadOnly = false;
} }
txtInScan.Focus();
} }
} }
} }
@ -2270,7 +2280,7 @@ namespace Khd.Core.Wpf.Form
List<MesBaseMaterialInfo> materialInfos = new List<MesBaseMaterialInfo>(); List<MesBaseMaterialInfo> materialInfos = new List<MesBaseMaterialInfo>();
if (!string.IsNullOrEmpty(MaterialName.Text)) 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(); materialIds = materialInfos.Select(t => t.MaterialId).ToList();
} }
@ -2313,6 +2323,7 @@ namespace Khd.Core.Wpf.Form
//wmsRawStocksId = b.rawStockId, //wmsRawStocksId = b.rawStockId,
locationCode = a.locationCode, locationCode = a.locationCode,
materialId = b.materialId, materialId = b.materialId,
materialCode = c.MaterialCode,
materialName = c.MaterialName, materialName = c.MaterialName,
materialSpec = c.MaterialSpec, materialSpec = c.MaterialSpec,
palletInfoCode = b.palletInfoCode, palletInfoCode = b.palletInfoCode,
@ -2331,6 +2342,7 @@ namespace Khd.Core.Wpf.Form
totalAmount = string.Join("\n", t.Select(x => x.totalAmount)), totalAmount = string.Join("\n", t.Select(x => x.totalAmount)),
frozenAmount = string.Join("\n", t.Select(x => x.frozenAmount)), frozenAmount = string.Join("\n", t.Select(x => x.frozenAmount)),
materialId = string.Join("\n", t.Select(x => x.materialId)), 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)])), 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)), 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)])), materialSpec = string.Join("\n", t.Select(x => x.materialSpec[..(x.materialSpec.Length > 20 ? 20 : x.materialSpec.Length)])),
@ -3570,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