change - 老线发泡通过货道监控页面设置货道类型、物料型号、生产计划

dev
wenjy 1 year ago
parent 2f5245140b
commit e6bc3444c9

@ -174,7 +174,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
public void AddPlan(string objId)
{
int shiftType = 1;//当班是1
SplitPlanView plan = new SplitPlanView(objId, shiftType);
SplitPlanView plan = new SplitPlanView(objId, shiftType,"");
plan.Show();
}

@ -27,6 +27,7 @@ using log4net;
using System.Windows.Forms;
using Aucma.Core.HwPLc;
using Aucma.Core.PLc;
using System.Windows.Input;
namespace Aucma.Core.OldBoxFoam.ViewModels
{
@ -454,7 +455,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
/// 设置夹具箱型
/// </summary>
/// <param name="obj"></param>
public void MouseClick(object obj)
public void BoxTypeClick(object obj)
{
var info = SelectedDataItem as OldBoxFoamTypeModel;
if (info != null)
@ -529,5 +530,20 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
return address;
}
/// <summary>
/// 设置夹具箱型
/// </summary>
/// <param name="obj"></param>
public void MaterialCodeClick(object obj)
{
var info = SelectedDataItem as OldBoxFoamTypeModel;
if (info != null)
{
SelectType selectType = new SelectType(info.ObjId.ToString(),info.Boxtype);
selectType.ShowDialog();
}
}
}
}

@ -44,7 +44,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
private void SubmitCommandExecute(string spaceCode)
{
SelectType type = new SelectType(spaceCode);
SelectType type = new SelectType(spaceCode,"");
type.ShowDialog();
}

@ -4,6 +4,7 @@ using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Service;
using Aucma.Core.OldBoxFoam;
using Aucma.Core.OldBoxFoam.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using log4net;
@ -41,6 +42,9 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
public RelayCommand QueryCommand { get; set; }
public RelayCommand deleteCommand { get; set; }
public RelayCommand SaveCommand { get; set; }
public RelayCommand SetPlanInfoCommand { get; set; }
private string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(BaseSpaceInfoServices));
@ -59,7 +63,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
{
}
public SelectTypeViewModel(string spaceCode)
public SelectTypeViewModel(string spaceCode,string boxType)
{
//_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
_oldBoxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
@ -67,16 +71,22 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
QueryCommand = new RelayCommand(searchData);
SaveCommand = new RelayCommand(updateDirection);
deleteCommand = new RelayCommand(deleteModel);
SetPlanInfoCommand = new RelayCommand(SetPlanInfo);
spaceCodes = spaceCode;
this.SearchText = boxType;
MouseClickCommand = new RelayCommand<object>(MouseClick);
materialDataGrid = new ObservableCollection<BaseMaterialInfo>();
Console.WriteLine(spaceCode);
Load();
Load(boxType);
}
public async void Load()
public async void Load(string boxType)
{
var infos = await _baseMaterialInfoServices.QueryAsync(x => x.MaterialSubclass == "200");
if (!string.IsNullOrEmpty(boxType))
{
infos = infos.Where(x=>x.MaterialName.Contains(boxType)).ToList();
}
MaterialDataGrid.Clear();
Application.Current.Dispatcher.Invoke(() =>
{
@ -262,8 +272,29 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
}
else
{
Load();
Load("");
}
}
/// <summary>
/// 维护计划
/// </summary>
private async void SetPlanInfo()
{
if (string.IsNullOrEmpty(spaceCodes))
{
MessageBox.Show("请至少选择一个型号!");
return;
}
if (string.IsNullOrEmpty(PlanInfo.MaterialCode))
{
MessageBox.Show("请至少选择一个型号!");
return;
}
SplitPlanView splitPlanView = new SplitPlanView("1", 1,PlanInfo.MaterialCode);
splitPlanView.ShowDialog();
}
}
}

@ -28,8 +28,11 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
private AppConfigHelper appConfig = new AppConfigHelper();
public SplitPlanViewModel(string objId, int shiftType)
private string materialCodeSearchText = string.Empty;
public SplitPlanViewModel(string objId, int shiftType, string materialCode)
{
this.materialCodeSearchText = materialCode;
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
Task.WaitAll(LoadData());
@ -47,6 +50,12 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
int i = 1;
string station = Appsettings.app("StationInfo", "StationCode"); ;
var planlist = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station));
if (!string.IsNullOrEmpty(materialCodeSearchText))
{
planlist = planlist.Where(x=>x.MaterialCode == materialCodeSearchText).ToList();
}
var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station));
foreach (var item in planlist)
{

@ -29,7 +29,7 @@ namespace Aucma.Core.OldBoxFoam.Views
private void Button_Click(object sender, RoutedEventArgs e)
{
SplitPlanView type = new SplitPlanView("1",1);
SplitPlanView type = new SplitPlanView("1",1,"");
type.ShowDialog();
}
}

@ -226,11 +226,12 @@
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" SelectedItem="{Binding SelectedDataItem}" MouseLeftButtonDown="dgvMH_MouseLeftButtonDown_1">
Foreground="White" SelectedItem="{Binding SelectedDataItem}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ObjId}" Header="序号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding Local}" Header="位置" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SpaceName}" Header="货道号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTemplateColumn Width="*" Header="状态">
<DataGridTemplateColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
@ -245,11 +246,25 @@
</Style>
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding Boxtype}" Header="货道型号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding Boxtype}" Header="货道型号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTemplateColumn Header="货道型号" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="{Binding Boxtype}" Click="Button_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding Storeamount}" Header="库存数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding Status}" Header="库存状态" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<!--<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />-->
<DataGridTemplateColumn Header="物料编号" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="{Binding MaterialCode}" Click="Button_Click_1" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding QualityResult}" Header="模具数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>

@ -32,7 +32,17 @@ namespace Aucma.Core.OldBoxFoam.Views
private void dgvMH_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
{
realRoadPageView.MouseClick(sender);
realRoadPageView.BoxTypeClick(sender);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
realRoadPageView.BoxTypeClick(sender);
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
realRoadPageView.MaterialCodeClick(sender);
}
}
}

@ -183,7 +183,8 @@
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="保 存" FontSize="20" Command="{Binding SaveCommand}" Background="#FF36B5C1" BorderBrush="#FF36B5C1" Foreground="white" Margin="0,0,10,0" Height="50" Width="100" />
<Button Content="保 存" FontSize="20" Command="{Binding SaveCommand}" Background="#FF36B5C1" BorderBrush="#FF36B5C1" Foreground="white" Margin="0,0,10,0" Height="50" Width="120" />
<Button Content="维护计划" FontSize="20" Command="{Binding SetPlanInfoCommand}" Background="#FF36B5C1" BorderBrush="#FF36B5C1" Foreground="white" Margin="20,0,10,0" Height="50" Width="120"/>
</StackPanel>
</Grid>

@ -22,10 +22,10 @@ namespace Aucma.Core.OldBoxFoam.Views
public partial class SelectType : Window
{
private SelectTypeViewModel viewModel = null;
public SelectType(string spaceCode)
public SelectType(string spaceCode,string boxType)
{
InitializeComponent();
viewModel = new SelectTypeViewModel(spaceCode);
viewModel = new SelectTypeViewModel(spaceCode, boxType);
this.DataContext = viewModel;
viewModel.closeEvent += closeWindow;
}

@ -13,10 +13,10 @@ namespace Aucma.Core.OldBoxFoam.Views
{
private SplitPlanViewModel planInfoEditViewModel = null;
public SplitPlanView(string objId,int shiftType)
public SplitPlanView(string objId,int shiftType,string materialCode)
{
InitializeComponent();
planInfoEditViewModel = new SplitPlanViewModel(objId, shiftType);
planInfoEditViewModel = new SplitPlanViewModel(objId, shiftType, materialCode);
this.DataContext = planInfoEditViewModel;
WeakReferenceMessenger.Default.Register<object>(this,Recive);
}

Loading…
Cancel
Save