master
1 year ago
parent 7f51c1b6a8
commit 325255d5c9

@ -133,8 +133,8 @@ namespace Khd.Core.Domain.Models
/// </summary>
[Column("remark")]
public string remark { get; set; }
[Column("is_out")]
public int? IsOut { get; set; }
//[Column("is_out")]
//public int? IsOut { get; set; }
}
}

@ -1821,7 +1821,8 @@ namespace Khd.Core.Wcs.Wcs
if (endEquip.equipType == 10)//CTU出库到装配区
{
BaseEquip endStationCodeEquip = dbContext.BaseEquip.First(t => t.objid == 10);
if (!string.IsNullOrEmpty(endStationCodeEquip.endStationCode) && endStationCodeEquip.IsOut == 1)
if (!string.IsNullOrEmpty(endStationCodeEquip.endStationCode) )
//if (!string.IsNullOrEmpty(endStationCodeEquip.endStationCode) && endStationCodeEquip.IsOut == 1)
{
if (item.endStationCode != endStationCodeEquip.endStationCode)
{
@ -1981,7 +1982,7 @@ namespace Khd.Core.Wcs.Wcs
}
if (CreateSuccess)
{
endStationCodeEquip.IsOut = 0;
//endStationCodeEquip.IsOut = 0;
foreach (var orderItem in orderList)
{
if (orderItem.beginTime == null)

@ -1976,7 +1976,7 @@
</StackPanel>
</TabItem>
<TabItem Visibility="Collapsed" x:Name="ScanReturnManager" Header="扫描退库" Style="{StaticResource DefaultItem}" FontSize="25" HorizontalContentAlignment="Center" Background="#213269" VerticalContentAlignment="Center" Foreground="White" Width="160" Height="100" Margin="5">
<TabItem x:Name="ScanReturnManager" Header="扫描退库" Style="{StaticResource DefaultItem}" FontSize="25" HorizontalContentAlignment="Center" Background="#213269" VerticalContentAlignment="Center" Foreground="White" Width="160" Height="100" Margin="5">
<StackPanel Height="1060" Width="1703" Background="#213269" Canvas.Left="175" Canvas.Top="110" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Width="1750">
<StackPanel Orientation="Vertical" Margin="20,5,0,0">
@ -1990,35 +1990,147 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="152*"/>
<RowDefinition Height="152*"/>
<RowDefinition Height="152*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="152*"/>
<RowDefinition Height="152*"/>
<RowDefinition Height="75*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="扫描退库" Foreground="White" FontSize="50" Grid.ColumnSpan="6" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="扫描料箱号:" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<TextBlock Text="扫描条码号:" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<TextBlock Text="退库数量:" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<hc:TextBox x:Name="txtReturnBox" hc:InfoElement.ShowClearButton="True" FontSize="50" LostFocus="txtInBox_TextChanged" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="1" Grid.Column="3" Grid.ColumnSpan="3"/>
<Button Click="barClear_Click" HorizontalAlignment="Right" Height="100" Panel.ZIndex="1" Width="100" Margin="0,0,130,0" Grid.Column="5" Grid.Row="2">
<Image Source="..\Resources\cancel.png"/>
</Button>
<Button Click="boxClear_Click" HorizontalAlignment="Right" Height="100" Panel.ZIndex="1" Width="100" Margin="0,0,130,0" Grid.Column="5" Grid.Row="1">
<Image Source="..\Resources\cancel.png"/>
</Button>
<hc:TextBox x:Name="txtReturnBarCode" hc:InfoElement.ShowClearButton="True" FontSize="50" LostFocus="txtInBarCode_TextChanged" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="3"/>
<hc:TextBox x:Name="txtReturnScan" FontSize="50" IsReadOnly="True" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="3" />
<Button Content="确认退库" Grid.Row="4" Grid.ColumnSpan="6" Width="500" Height="100" FontSize="50" Background="#346DFF" Foreground="White" Click="ReturnRawBaseLocaltion_Click"/>
<Button Content="一键收料" Grid.Row="5" Grid.ColumnSpan="6" Width="500" Height="100" FontSize="50" Background="#346DFF" Foreground="White" Click="callPlc_Click"/>
<Button Content="执行CTU入库任务" Visibility="Hidden" Click="btnCtuInConfirmBox_Click" Grid.Row="5" Grid.ColumnSpan="6" Width="500" Height="100" FontSize="50" Background="#346DFF" Foreground="White"/>
<Border BorderBrush="White" BorderThickness="2" Grid.ColumnSpan="2" Grid.Column="4" Grid.RowSpan="2" Margin="20">
<StackPanel Orientation="Vertical" >
<TextBlock x:Name="ReturnOrder" Background="Transparent" Grid.ColumnSpan="2" Grid.RowSpan="2" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<TextBlock x:Name="thisReturnEndStation" Background="Transparent" Grid.ColumnSpan="2" Grid.RowSpan="2" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,20,0,0"/>
</StackPanel>
</Border>
<Border BorderBrush="White" BorderThickness="2" Grid.Column="0" Grid.ColumnSpan="6" Grid.Row="5" Grid.RowSpan="2" Margin="20">
<DataGrid Background="Transparent"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
x:Name="ReturnTaskNumber" >
<DataGrid.Columns>
<DataGridTextColumn
Header="物料名称"
Binding="{Binding materiaName}"
ElementStyle="{StaticResource dgCell}"
Width="3*"
/>
<DataGridTextColumn
Header="物料描述"
Binding="{Binding materialSpec}"
ElementStyle="{StaticResource dgCell}"
Width="5*"
/>
<DataGridTextColumn
Header="销售订单"
Binding="{Binding saleOrderId}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="箱体携带数量"
Binding="{Binding thisOutAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="申请数量"
Binding="{Binding outstockAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="已出数量"
Binding="{Binding realOutstockAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="是否出完"
Binding="{Binding isSendOver}"
Width="2*"
ElementStyle="{StaticResource dgCell}"
/>
</DataGrid.Columns>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</DataGrid.CellStyle>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
</Style>
</DataGrid.RowStyle>
<DataGrid.RowHeaderStyle>
<Style TargetType="{x:Type DataGridRowHeader}">
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</DataGrid.RowHeaderStyle>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="BorderThickness" Value="5" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="FontSize" Value="30" />
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
</Border>
<TextBlock Text="扫描出库" Grid.RowSpan="2" Foreground="White" FontSize="50" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="6"/>
<TextBlock Text="待执行CTU任务数:" Visibility="Hidden" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="50"/>
<TextBlock x:Name="ReturnTaskCount" Visibility="Hidden" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<Button Content="执行CTU出库任务" Visibility="Hidden" Grid.Row="1" Grid.Column="3" Grid.ColumnSpan="2" Width="500" Height="100" FontSize="50" Background="#346DFF" Foreground="White" Click="ExecuteCtuTask_Click"/>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="6">
<TextBlock Text="扫描料箱号:" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<Grid>
<hc:TextBox hc:InfoElement.ShowClearButton="True" x:Name="txtReturnBox" FontSize="50" LostFocus="txtReturnBox_TextChanged" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="3"/>
<Button Click="boxReturnClear_Click" HorizontalAlignment="Right" Height="100" Panel.ZIndex="1" Width="100" Margin="0,0,0,0" Grid.Column="5" Grid.Row="2">
<Image Source="..\Resources\cancel.png"/>
</Button>
</Grid>
<!--<Button Content="选择退库" Background="#346DFF" Grid.ColumnSpan="6" Grid.Row="1" Foreground="White" FontSize="50" Margin="20,0,0,0" Height="100" Width="250" Click="SelectOutBtn_Click"/>-->
<Button Content="继续退库" Visibility="Collapsed" Background="#346DFF" Grid.ColumnSpan="6" Grid.Row="1" Foreground="White" FontSize="50" Margin="20,0,0,0" Height="100" Width="250" Click="ContineOutBtn_Click"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="6">
<TextBlock Text="扫描条码号:" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<Grid>
<hc:TextBox hc:InfoElement.ShowClearButton="True" x:Name="txtReturnBarCode" FontSize="50" LostFocus="txtReturnBarCode_TextChanged" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="3"/>
<Button Click="barReturnClear_Click" HorizontalAlignment="Right" Height="100" Panel.ZIndex="1" Width="100" Margin="0,0,0,0" Grid.Column="5" Grid.Row="3">
<Image Source="..\Resources\cancel.png"/>
</Button>
</Grid>
<Button Content="确认退库" Grid.Column="4" Grid.Row="5" Grid.ColumnSpan="2" Width="400" Height="100" Margin="100,0,0,0" FontSize="35" Background="#346DFF" Foreground="White" Click="ReturnRawBaseLocaltion_Click"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="4" Grid.ColumnSpan="6">
<TextBlock Text="出库数量:" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>
<Grid>
<hc:TextBox x:Name="txtReturnScan" Margin="80,0,0,0" IsReadOnly="True" FontSize="50" Width="700" HorizontalAlignment="Left" VerticalAlignment="Center" Height="130" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="3" />
</Grid>
<Button Content="背负式小车捡料完成" Grid.Column="4" Grid.Row="6" Grid.ColumnSpan="2" Width="400" Height="100" Margin="100,0,0,0" FontSize="35" Background="#346DFF" Foreground="White" Click="btnBearConfirmBox_Click"/>
</StackPanel>
</Grid>
</StackPanel>
</StackPanel>
</StackPanel>
</TabItem>
<TabItem x:Name="ScanOutManager" Header="扫描出库" Style="{StaticResource DefaultItem}" FontSize="25" HorizontalContentAlignment="Center" Background="#213269" VerticalContentAlignment="Center" Foreground="White" Width="160" Height="100" Margin="5">
<StackPanel Height="1060" Width="1703" Background="#213269" Canvas.Left="175" Canvas.Top="110" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Width="1750">
@ -2149,7 +2261,7 @@
</Button>
</Grid>
<Button Content="选择出库" Background="#346DFF" Grid.ColumnSpan="6" Grid.Row="1" Foreground="White" FontSize="50" Margin="20,0,0,0" Height="100" Width="250" Click="SelectOutBtn_Click"/>
<Button Content="继续出库" Background="#346DFF" Grid.ColumnSpan="6" Grid.Row="1" Foreground="White" FontSize="50" Margin="20,0,0,0" Height="100" Width="250" Click="ContineOutBtn_Click"/>
<Button Content="继续出库" Visibility="Collapsed" Background="#346DFF" Grid.ColumnSpan="6" Grid.Row="1" Foreground="White" FontSize="50" Margin="20,0,0,0" Height="100" Width="250" Click="ContineOutBtn_Click"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="6">
<TextBlock Text="扫描条码号:" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="75"/>

@ -30,6 +30,7 @@ using System.Windows.Threading;
using System.Windows.Input;
using System.Windows;
using System.Windows.Controls;
using System.Collections.ObjectModel;
namespace Khd.Core.Wpf.Form
{
@ -60,6 +61,16 @@ namespace Khd.Core.Wpf.Form
private int pageCount = 15;
private object updateLock = new object();
private ObservableCollection<SelectItemModel> itemsControlItems;
//人工叫料选中类
public class SelectItemModel
{
//料箱位置id
public long baseLocationId { get; set; }
//托盘号
public string palletInfoCode { get; set; }
}
private void ScanMessage()
{
while (true)
@ -128,7 +139,6 @@ namespace Khd.Core.Wpf.Form
};
});
GetMenu();
DispatcherTimer dispatcherTimer = new DispatcherTimer();
@ -1335,7 +1345,25 @@ namespace Khd.Core.Wpf.Form
}
}
/// <summary>
/// 删除选中的值
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DeleteButton_Click(object sender, RoutedEventArgs e)
{
// 获取点击按钮的实例
Button button = sender as Button;
// 从按钮的 Tag 属性中获取当前数据项
SelectItemModel itemToRemove = button.Tag as SelectItemModel;
if (itemToRemove != null)
{
// 从集合中移除数据项
itemsControlItems.Remove(itemToRemove);
}
}
/// <summary>
/// 刷新
/// </summary>
@ -1731,8 +1759,6 @@ namespace Khd.Core.Wpf.Form
if (!string.IsNullOrEmpty(barCode))
{
var material = dbContext.MesBaseBarcodeInfo.FirstOrDefault(t => t.barcodeInfo == barCode);
if (material == null)
{
@ -1774,6 +1800,95 @@ namespace Khd.Core.Wpf.Form
}
}
/// <summary>
/// 出库容器改变
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtReturnBox_TextChanged(object sender, RoutedEventArgs e)
{
try
{
string containerCode = txtReturnBox.Text;
if (!string.IsNullOrEmpty(containerCode))
{
using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
var container = dbContext.WmsBaseLocation.FirstOrDefault(t => t.containerCode == containerCode && t.warehouseId == 512);
if (container == null)
{
MsgText.Text = $"未查询到该容器{txtReturnBox.Text}!";
txtReturnBox.Text = string.Empty;
txtReturnBox.Focus();
}
else
{
txtReturnBarCode.Focus();
}
}
}
catch
{
}
}
/// <summary>
/// 出库条码改变
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtReturnBarCode_TextChanged(object sender, RoutedEventArgs e)
{
try
{
string barCode = txtReturnBarCode.Text;
if (barCode.Length < 19) return;
using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
if (!string.IsNullOrEmpty(barCode))
{
var material = dbContext.MesBaseBarcodeInfo.FirstOrDefault(t => t.barcodeInfo == barCode);
if (material == null)
{
txtReturnBarCode.Text = string.Empty;
txtReturnScan.Text = string.Empty;
txtReturnBarCode.Focus();
}
else
{
var mesBaseMaterialInfo = dbContext.MesBaseMaterialInfo.FirstOrDefault(t => t.MaterialId == material.materialId);
if (mesBaseMaterialInfo == null)
{
txtReturnBarCode.Text = string.Empty;
txtReturnScan.Text = string.Empty;
txtReturnBarCode.Focus();
}
else
{
txtReturnScan.Text = (material.batchFlag == "1") ? "" : "1.00";
if (mesBaseMaterialInfo.BatchFlag == "0")
{
txtReturnScan.IsReadOnly = true;
}
else
{
txtReturnScan.IsReadOnly = false;
}
}
}
}
}
catch
{
}
}
/// <summary>
/// 出库容器改变
/// </summary>
@ -2530,6 +2645,17 @@ namespace Khd.Core.Wpf.Form
{
txtOutBarCode.Text = string.Empty;
}
private void boxReturnClear_Click(object sender, RoutedEventArgs e)
{
txtReturnBox.Text = string.Empty;
}
private void barReturnClear_Click(object sender, RoutedEventArgs e)
{
txtReturnBarCode.Text = string.Empty;
}
#endregion
#region 托盘库进出
@ -3185,13 +3311,13 @@ namespace Khd.Core.Wpf.Form
{
try
{
using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
BaseEquip baseEquip = dbContext.BaseEquip.Where(t => t.objid == 10).First();
baseEquip.IsOut = 1;
dbContext.Update(baseEquip);
dbContext.SaveChanges();
HandyControl.Controls.MessageBox.Show("继续出库成功!");
//using var scope = _host.Services.CreateScope();
//using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
//BaseEquip baseEquip = dbContext.BaseEquip.Where(t => t.objid == 10).First();
//baseEquip.IsOut = 1;
//dbContext.Update(baseEquip);
//dbContext.SaveChanges();
//HandyControl.Controls.MessageBox.Show("继续出库成功!");
}
catch
{

Loading…
Cancel
Save