扫码枪

dev
liulb@mesnac.com 1 year ago
parent ddff67c3ea
commit 95efc382f5

@ -7,6 +7,7 @@ using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.ScannerGun;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -61,8 +62,8 @@ namespace Admin.Core.RealTimeService
AddServices(services);
//任务调度
services.AddJobSetup();
//services.AddJobSetup();
services.AddScannerGunSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -83,15 +84,15 @@ namespace Admin.Core.RealTimeService
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter)
public void Configure(IApplicationBuilder app, IScannerGunService scannerGunService)
{
// 使用静态文件
app.UseStaticFiles();
// 然后是授权中间件
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
// app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
app.UseScannerGunMildd(scannerGunService);
}
#region 注册服务

@ -163,7 +163,9 @@
"Middleware": {
"QuartzNetJob": {
"Enabled": true
},
"ScannerGun": {
"Enabled": true
}
},
"IpRateLimiting": {

@ -24,6 +24,11 @@
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="White" />
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="White" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="White" />
<!--字体大小设置-->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -54,13 +54,13 @@ namespace Aucma.Core.BoxFoam.ViewModels
{
PlanInfoDataGrid.Clear();
int i = 1;
var list = await _recordInstoreServices.SaveRecordToDb(storeCode, startTime, endTime);
foreach (var item in list.OrderByDescending(d=>d.No))
{
PlanInfoDataGrid.Add(new EnterLibView()
{
No=item.No,
No=i,
PlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
@ -69,6 +69,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
ExecDateTime = item.ExecDateTime,
Status = item.Status
});
i++;
};
//Datalist.Insert(0, Datalist[Datalist.Count - 1]);
//Datalist.RemoveAt(Datalist.Count - 1);

@ -6,7 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:cvt="clr-namespace:Aucma.Core.BoxFoam.ConvertTo"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<cvt:MultiBindingConverter x:Key="QueryConvert"></cvt:MultiBindingConverter>

@ -2,15 +2,17 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views"
mc:Ignorable="d"
d:DesignHeight="800"
d:DesignWidth="1000" >
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="1080" FontFamily="Microsoft YaHei"
d:DesignWidth="1920" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="18" />
</Style>
<Style TargetType="DataGrid">
@ -32,15 +34,10 @@
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
@ -51,7 +48,7 @@
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
@ -69,81 +66,6 @@
</Style.Triggers>
</Style>
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式换行换色-->
<!--<Style TargetType="DataGridRow">
<Setter Property="Height" Value="30"/>
<Style.Triggers>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#e7e7e7"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#f2f2f2" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#f1ef9f" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
</Style.Triggers>
</Style>-->
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Margin="1 5 1 0">
@ -164,7 +86,7 @@
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,3,5" >
<TextBlock Text="扫描信息" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource MaterialDesignHeadline6TextBlock}" FontWeight="Bold"/>
<TextBlock Text="扫描信息" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold"/>
</Border>
<!--扫描信息-->
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,3,5">
@ -190,25 +112,25 @@
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料条码" FontSize="15" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 30 0"/>
<TextBox FontSize="15" Text="{Binding MaterialBarCode,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="200" IsReadOnly="True" Margin="0 0 10 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<TextBox FontSize="15" Text="{Binding BeginTime,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="200" IsReadOnly="True" Margin="10 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox FontSize="18" Text="{Binding MaterialBarCode,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="200" IsReadOnly="True" Margin="0 0 10 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<TextBox FontSize="18" Text="{Binding BeginTime,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="200" IsReadOnly="True" Margin="10 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料编码" FontSize="15" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 30 0"/>
<TextBox FontSize="15" Text="{Binding MaterialCode,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="0 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<TextBlock Text="物料编码" FontSize="18" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 30 0"/>
<TextBox FontSize="18" Text="{Binding MaterialCode,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="0 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料名称" FontSize="15" Foreground="White" HorizontalAlignment="Left"/>
<TextBox FontSize="15" Text="{Binding MaterialName,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBlock Text="物料名称" FontSize="18" Foreground="White" HorizontalAlignment="Left"/>
<TextBox FontSize="18" Text="{Binding MaterialName,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="目的信息" FontSize="15" Foreground="White"/>
<TextBox FontSize="15" Text="{Binding Destination,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBlock Text="目的信息" FontSize="18" Foreground="White"/>
<TextBox FontSize="18" Text="{Binding Destination,Mode=TwoWay}" BorderBrush="White" Foreground="White" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.RowSpan="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="提示信息" FontSize="15" Foreground="White"/>
<TextBlock Text="提示信息" FontSize="18" Foreground="White"/>
<TextBox FontSize="15" BorderBrush="White"
MinHeight="70" MaxHeight="100" MinWidth="420" IsReadOnly="True" Foreground="White"
VerticalAlignment="Top" Margin="30 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
@ -233,13 +155,13 @@
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,1,5" >
<TextBlock Text="日志信息" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource MaterialDesignHeadline6TextBlock}" />
<TextBlock Text="设备监控" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<!--日志信息-->
<!--设备监控-->
<Border x:Name="HeightHelperPanel" Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="25,1,5,5">
<ListBox MinHeight="60"
Height="{Binding Path=ActualHeight, ElementName=HeightHelperPanel}" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" Foreground="White" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
Height="{Binding Path=ActualHeight, ElementName=HeightHelperPanel}" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" Foreground="White" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
</Border>
</Grid>
</Border>
@ -252,7 +174,7 @@
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="扫描记录" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource MaterialDesignHeadline6TextBlock}" />
<TextBlock Text="扫描记录" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<!--计划列表-->
@ -265,13 +187,13 @@
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35" Height="{Binding Path=ActualHeight, ElementName=ScanPanel}"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" FontSize="18"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<!--修改选中字体颜色-->
<DataGrid.Columns>
<!--<DataGridTextColumn Binding="{Binding No}" Header="编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Binding="{Binding No}" Header="编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="物料条码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />

@ -7,8 +7,8 @@
mc:Ignorable="d"
Title="澳柯玛箱体发泡控制系统"
d:DesignHeight="800"
d:DesignWidth="1000"
MinHeight="1080" MinWidth="1920" WindowState="Maximized"
d:DesignWidth="1000" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1920" WindowState="Normal"
WindowStartupLocation="CenterScreen"
>
<Window.Background>
@ -64,39 +64,37 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="实时监控" x:Name="FirstPage" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" Margin="5 0" />
<Button Content="实时监控" x:Name="FirstPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" />
<Button Content="实时库存" x:Name="RealTimeInventoryPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RealTimeInventoryPage}" />
<Button Content="任务监控" x:Name="MonitorPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=MonitorPage}" />
<Button Content="入库统计" x:Name="StatisticsPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=StatisticsPage}" />
<Button Content="键盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Background="#FF0033" BorderBrush="#FF0033"/>
</StackPanel>
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock x:Name="PLCState" Text="PLC" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="PLCState" Text="PLC连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="DB" Text="数据库" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatusImage" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="DB" Text="数据库连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="BarCodeStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
</StackPanel>
</Grid>
</Border>
</DockPanel>
</Grid>
</Border>
</Window>

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">

@ -6,7 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views"
x:Class="Aucma.Core.BoxFoam.Views.RealTimeInventoryPageView"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800">
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5,5">

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views.UserPage"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800">
<Grid >

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800">
<Grid >

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views.UserPage"
mc:Ignorable="d"
Background="#4285DE"
Background="#1152AC"
Title="货道明细" Height="450" Width="800">
<Window.Resources>

@ -27,6 +27,12 @@
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="White" />
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="White" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="White" />
<!--字体大小设置-->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -6,9 +6,12 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="澳柯玛门体发泡系统"
d:DesignHeight="800"
d:DesignWidth="1000"
MinHeight="1080" MinWidth="1920" WindowState="Maximized" WindowStyle="None"
d:DesignHeight="1080"
d:DesignWidth="1920"
MinHeight="1080"
MinWidth="1920"
WindowState="Maximized"
WindowStyle="None"
WindowStartupLocation="CenterScreen" >
<Window.Background>
@ -66,30 +69,30 @@
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="实时监控" x:Name="FirstPage" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" Margin="5 0" />
<Button Content="发泡记录" x:Name="RecordPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RecordPage}" />
<Button Content="键盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Background="#FF0033" BorderBrush="#FF0033" />
</StackPanel>
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 5 0">
<TextBlock x:Name="PLCState" Text="PLC" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="PLCState" Text="PLC连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="DB" Text="数据库" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatusImage" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="DB" Text="数据库连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="BarCodeStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>

@ -24,6 +24,15 @@
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#DDFFFFFF" />
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#0288d1" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#0288d1" />
<!--字体大小设置-->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<Style TargetType="TextBox">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -6,7 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="800"
d:DesignWidth="1000"
d:DesignWidth="1000" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1920" WindowState="Maximized"
WindowStartupLocation="CenterScreen" WindowStyle="None"
>
@ -65,29 +65,31 @@
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="实时监控" x:Name="FirstPage" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" Margin="5 0" />
<Button Content="扫描记录" x:Name="RecordPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RecordPage}" />
<Button Content="键盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 5 0">
<TextBlock x:Name="PLCState" Text="PLC" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="PLCState" Text="PLC连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="DB" Text="数据库" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatusImage" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="DB" Text="数据库连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="BarCodeStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
</StackPanel>
</Grid>
</Border>

@ -26,7 +26,7 @@
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#DDFFFFFF" />
<!--字体大小设置-->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>

@ -1,7 +1,5 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.IService;
using Admin.Core.Model.ViewModels;
using Aucma.Core.PrintTo.Common;
using Aucma.Core.PrintTo.Models;
using Aucma.Core.PrintTo.Views;
using CommunityToolkit.Mvvm.ComponentModel;
@ -9,7 +7,6 @@ using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using NetTaste;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -31,9 +28,14 @@ namespace Aucma.Core.PrintTo.ViewModels
public IndexPageViewModel()
{
_baseOrderInfoServices = App.ServiceProvider.GetService<IBaseOrderInfoServices>();
_=LoadData();
PrintIsEnabled = "True";
WeakReferenceMessenger.Default.Register<string>(this, Recive);
Task.Run(async ()=>
{
await LoadData();
});
}
#region 加载DataGrid数据
@ -41,7 +43,6 @@ namespace Aucma.Core.PrintTo.ViewModels
{
Datalist.Clear();
var list = await _baseOrderInfoServices.QueryPrintInfo();
foreach (var item in list)
{
OrderInfo info = new OrderInfo();
@ -60,7 +61,6 @@ namespace Aucma.Core.PrintTo.ViewModels
Datalist.Add(info);
}
}
#endregion
#region 查询按钮

@ -41,8 +41,8 @@
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="Height" Value="50"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
@ -153,7 +153,7 @@
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Margin="10" >
<UniformGrid Grid.Column="0" Margin="5" >
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent">
<Grid Margin="3">
<Grid.RowDefinitions>
@ -162,8 +162,8 @@
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5 5 0 0">
<Label Content="查询条件" VerticalAlignment="Center" Foreground="White" />
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" PreviewMouseDown="queryParam_PreviewMouseDown" Width="200" HorizontalAlignment="Left" VerticalContentAlignment="Center"/>
<Button Content="查询" Background="#4285DE" Width="100" Command="{Binding QueryStringCommand}" CommandParameter="{Binding Text, ElementName=queryParam}"/>
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" PreviewMouseDoubleClick="queryParam_PreviewMouseDown" Width="200" HorizontalAlignment="Left" VerticalContentAlignment="Center"/>
<Button Content="查询" Background="#4285DE" Width="100" Margin="5 0" Command="{Binding QueryStringCommand}" CommandParameter="{Binding Text, ElementName=queryParam}"/>
</WrapPanel>
<UniformGrid Grid.Row="1" Margin="0 5 0 0" x:Name="HeightPanel">
<!--
@ -171,19 +171,19 @@
AutoGenerateColumns="False" 表示不让DataGrid自动生成列。如果设置成true则效果 多出了不需要的列;
HorizontalAlignment="Left" 不显示多余的空白列;
-->
<DataGrid x:Name="dgvMH" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
<DataGrid x:Name="dgvMH" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ItemsSource="{Binding Datalist}" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn MinWidth="160" Binding="{Binding CreatedTime, StringFormat=\{0:yyy-MM-dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding OrderCode}" Header="订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="300" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding CompleteAmount}" Header="内胆码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding CompleteAmount}" Header="箱体码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn MinWidth="50" Binding="{Binding CompleteAmount}" Header="完成量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Width="*" Binding="{Binding CreatedTime, StringFormat=\{0:yyy-MM-dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding OrderCode}" Header="订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="内胆码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="箱体码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTexStColumn MinWidth="50" Binding="{Binding CompleteAmount}" Header="完成量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn MinWidth="50" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding LinerCodeNum}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding BoxCodeNum}" Header="U壳码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
@ -196,8 +196,8 @@
</Grid>
</Border>
</UniformGrid>
<UniformGrid Grid.Column="1" Margin="0 10 3 5">
<Border BorderBrush="#0288d1" BorderThickness="1" Margin="0 0 0 5" CornerRadius="5">
<UniformGrid Grid.Column="1" Margin="5">
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5">
<Grid Margin="0 30">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
@ -209,32 +209,32 @@
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="产品编码" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBlock Text="产品编码" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductNo" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.ProductCode, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="400"
materialDesign:HintAssist.Hint="产品编码" />
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="产品名称" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBlock Text="产品名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductName" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.ProductName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="产品名称" />
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="物料名称" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBlock Text="物料名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="MaterialName" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.MaterialName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="物料名称" />
</WrapPanel>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="打印数量" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Slider x:Name="PlanAmount" Minimum="0" Maximum="500" BorderBrush="White" Value="{Binding SelectedItem.StandardAmount, ElementName=dgvMH}" Foreground="white" Height="30" VerticalContentAlignment="Center"
HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" FontSize="18" Width="340"/>
<TextBlock Text="1~500" Width="50" Margin="10 0 0 0" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
<TextBlock Text="打印数量" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Slider x:Name="PlanAmount" FontSize="18" Minimum="0" Maximum="500" BorderBrush="White" Value="{Binding SelectedItem.StandardAmount, ElementName=dgvMH}" Foreground="White" Height="30" VerticalContentAlignment="Center"
HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" Width="340"/>
<TextBlock Text="1~500" Width="60" Margin="10 0 0 0" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</WrapPanel>
<Border Grid.Row="4" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="100 5" >
<StackPanel >
<WrapPanel Height="300">
<RadioButton Content="内胆码-L" Foreground="white" FontSize="18" x:Name="内胆" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=内胆}"/>
<RadioButton Content="箱体码-B" Foreground="white" FontSize="18" x:Name="箱体" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=箱体}"/>
<RadioButton Content="内胆码-L" Foreground="White" FontSize="18" BorderBrush="White" x:Name="内胆" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=内胆}"/>
<RadioButton Content="箱体码-B" Foreground="White" FontSize="18" BorderBrush="White" x:Name="箱体" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=箱体}"/>
</WrapPanel>
<!--<Button Content="添加" Foreground="White" BorderBrush="#0288d1" Background="#4285DE" HorizontalAlignment="Right" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />-->
</StackPanel>
@ -255,11 +255,6 @@
Background="#4285DE"
Content="特殊" Margin="10 10 0 0" Width="100" Command="{Binding SpecialPrintCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" />
<!--<Button
Background="#4285DE"
Content="设备" Margin="10 10 0 0" Width="100" Command="{Binding SupplementPrintCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"/>-->
</WrapPanel>
</Grid>
</Border>

@ -8,12 +8,9 @@
Title="澳柯玛条码打印系统"
MinHeight="800" MinWidth="1100"
d:DesignHeight="800" d:DesignWidth="1100"
Background="#1152AC" FontFamily="Microsoft YaHei"
Background="#1152AC" FontFamily="Microsoft YaHei"
WindowStartupLocation="CenterScreen" WindowState="Maximized" WindowStyle="None"
>
<!--<Window.Background>
<ImageBrush ImageSource="/Assets/Images/bg.jpg"/>
</Window.Background>-->
<Border CornerRadius="5">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
@ -48,17 +45,17 @@
<!--</ScrollViewer>-->
</DockPanel>
<DockPanel Grid.Row="2" Background="#08408B">
<Border Margin="3" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<DockPanel Grid.Row="2">
<Border Margin="3 0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="首 页" Background="#4285DE" Margin="5 0" />
<Button Content="键 盘" Background="#4285DE" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="首 页" Margin="5 0" />
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Background="#FF0033" BorderBrush="#FF0033" />
</StackPanel>
</Grid>
</Border>

@ -49,18 +49,18 @@
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印进度" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ProgressBar Style="{x:Null}" Height="15" Minimum="1" Maximum="{Binding MaxProgress}" Value="{Binding Progress}" Width="300" Margin="5"/>
<TextBlock Text="打印进度" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ProgressBar Style="{x:Null}" Height="20" Minimum="1" Maximum="{Binding MaxProgress}" Value="{Binding Progress}" Width="300" Margin="6"/>
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印信息" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintProgress}" FontSize="15" Width="300" Foreground="White" BorderBrush="White" Margin="10 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
<TextBlock Text="打印信息" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintProgress}" FontSize="18" Width="300" Foreground="White" BorderBrush="White" Margin="10 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印状态" FontSize="15" Foreground="White" Margin="5"/>
<TextBlock FontSize="15" Margin="10 0" Background="{Binding State}" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="异常条码数量:" Margin="5" FontSize="15" Foreground="White"/>
<TextBlock Text="{Binding ErrorNum}" FontSize="15" Margin="10 0" Width="150" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="打印状态" FontSize="18" Foreground="White" Margin="5"/>
<TextBlock FontSize="18" Margin="10 0" Background="{Binding State}" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="异常条码数量:" Margin="5" FontSize="18" Foreground="White"/>
<TextBlock Text="{Binding ErrorNum}" FontSize="18" Margin="10 0" Width="130" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</WrapPanel>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="打印" x:Name="Start" Margin="20 0" Command="{Binding OperateCommand}" IsEnabled="{Binding OperateEnabled}" />

@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Background="#0C4CA3" x:Name="window"
Title="Window1" Height="450" Width="800">
Title="特殊条码打印" Height="450" Width="800" WindowState="Normal" WindowStyle="ToolWindow">
<Window.Resources>
<Style TargetType="{x:Type Slider}">
@ -83,8 +83,8 @@
<UniformGrid Grid.Row="0">
<GroupBox Margin="16 0" Header="条码类型" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Left" Margin="50 5" >
<RadioButton Content="放行码" Foreground="white" FontSize="15" Margin="10 5" />
<TextBox Text="{Binding BarCode,Mode=TwoWay}" PreviewMouseDown="TextBox_PreviewMouseDown" FontSize="18" Width="300" BorderBrush="White" Foreground="White" Margin="10 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" />
<RadioButton Content="放行码" Foreground="White" FontSize="15" IsChecked="True" Margin="10 5" />
<TextBox Text="{Binding BarCode,Mode=TwoWay}" PreviewMouseDoubleClick="TextBox_PreviewMouseDown" FontSize="18" Width="300" BorderBrush="White" Foreground="White" Margin="10 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" />
</WrapPanel>
</GroupBox>
</UniformGrid>
@ -92,9 +92,11 @@
<Border Margin="16 5" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="打印数量" Foreground="white" Margin="10 5" />
<Slider x:Name="PrintAmount" Minimum="0" Value="{Binding PrintNum,Mode=TwoWay}" Maximum="500" BorderBrush="White" Foreground="White" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" FontSize="15" Width="240"/>
<Slider x:Name="PrintAmount" Minimum="0" Value="{Binding PrintNum,Mode=TwoWay}" Maximum="500" BorderBrush="White" Foreground="White" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" FontSize="15" Width="240"/>
<Button Background="#4285DE" Margin="30 0 0 0"
Content="打印" Width="100" Command="{Binding PrintCommand}" />
<!--<Button Background="#4285DE" Margin="30 0 0 0"
Content="暂停" Width="100" Command="{Binding PrintCommand}" />-->
<Button Background="#4285DE" Margin="20 0"
Content="关闭" Width="100" Command="{Binding CloseCommand}" CommandParameter="{Binding ElementName=window}"/>
</WrapPanel>

@ -17,7 +17,7 @@ namespace Aucma.Core.ScannerGun
/// </summary>
public static void InitScanCode()
{
string COM1 = "COM3";
string COM1 = "com3";
InstanceSerialPort3(COM1);
}
@ -71,10 +71,10 @@ namespace Aucma.Core.ScannerGun
SerialPort serialPort = (SerialPort)serialPortobj;
string code = serialPort.ReadExisting();
if (string.IsNullOrEmpty(code))
if (!string.IsNullOrEmpty(code))
{
//MessageBox.Show("未扫描到条码!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
//传递给前端提醒
Console.WriteLine(code.Trim());
return;
}
//业务处理

@ -1,7 +1,12 @@
using Admin.Core.Model;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Service;
using Aucma.Core.SheetMetal.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@ -13,10 +18,20 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class QuantityIssuedViewModel : ObservableObject
{
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo) {
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(QuantityIssuedViewModel));
private IBaseBomInfoServices _bomInfoServices;
private IBaseSpaceDetailServices _spaceDetailServices;
#region 构造函数
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo)
{
_bomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_spaceDetailServices = App.ServiceProvider.GetService<IBaseSpaceDetailServices>();
PlanInfo = productPlanInfo;
}
}
#endregion
#region 属性
private ProductPlanInfoModel _PlanInfo = new ProductPlanInfoModel();
public ProductPlanInfoModel PlanInfo
{
@ -29,60 +44,42 @@ namespace Aucma.Core.SheetMetal.ViewModels
get => _TransmitAmount;
set => SetProperty(ref _TransmitAmount, value);
}
#endregion
#region 下传计划
/// <summary>
/// 下传计划
/// </summary>
[RelayCommand]
private void PlanInfoTransmit()
{
var productPlanInfo = _PlanInfo;
//if (productPlanInfo != null)
//{
// var materialType = productPlanInfo.MaterialCode;
if (productPlanInfo != null)
{
//下传到PLC
// bool shellResult = assemblyPlanBusiness.JudgmentStock(productPlanInfo, Convert.ToInt32(_TransmitAmount), appConfig.shellMaterialType, appConfig.shellStoreCode);
// if (!shellResult)
// {
// MessageBox.Show("计划下达失败,箱壳物料库存不足", "提示", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
// return;
// }
// bool linerResult = assemblyPlanBusiness.JudgmentStock(productPlanInfo, Convert.ToInt32(_TransmitAmount), appConfig.linerMaterialType, appConfig.linerStoreCode);
// if (!linerResult)
// {
// MessageBox.Show("计划下达失败,内胆物料库存不足", "提示", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
// return;
// }
//拆分计划到任务表中
//if (!shellResult && !linerResult)
//{
// MessageBox.Show("计划下达失败,箱壳、内胆物料库存不足");
// return;
//}else if(!shellResult || !linerResult)
//bool result = PlanTransmitByProductPlan(_PlanInfo.PlanCode, Convert.ToInt32(_TransmitAmount));
//if (result)
//{
// if (!shellResult)
// {
// MessageBox.Show("计划下达失败,箱壳物料库存不足");
// return;
// }
// else if (!linerResult)
// {
// MessageBox.Show("计划下达失败,内胆物料库存不足");
// return;
// }
// MessageBox.Show("执行计划维护成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
//}
//}
//else
//{
// MessageBox.Show("生产计划获取失败,加载为空", "提示", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
// return;
//}
//bool result = assemblyPlanBusiness.PlanTransmitByProductPlan(_PlanInfo.planCode, Convert.ToInt32(_TransmitAmount));
//if (result)
//{
// MessageBox.Show("执行计划维护成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
//}
}
else
{
MessageBox.Show("生产计划获取失败,加载为空", "提示", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
return;
}
}
#endregion
#region 清除
/// <summary>
/// 清除
/// </summary>
[RelayCommand]
private void ClearTransmitAmount()
{
@ -92,7 +89,9 @@ namespace Aucma.Core.SheetMetal.ViewModels
TransmitAmount = amount.Substring(0, amount.Length - 1);
}
}
#endregion
#region KeypadButton
[RelayCommand]
private void KeypadButton(object obj)
{
@ -100,7 +99,13 @@ namespace Aucma.Core.SheetMetal.ViewModels
TransmitAmount += info;
}
#endregion
#region 关闭
/// <summary>
/// 关闭
/// </summary>
/// <param name="parameter"></param>
[RelayCommand]
private void CloseWindow(object parameter)
{
@ -109,7 +114,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
window.Close();
}
}
}
#endregion
}
}

@ -6,8 +6,8 @@
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d" Background="#1152AC" FontFamily="Microsoft YaHei"
d:DesignHeight="800"
d:DesignWidth="1500" >
d:DesignHeight="1080"
d:DesignWidth="1920" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
@ -318,6 +318,7 @@
<Button Content="上移" FontSize="12" CommandParameter="{Binding ID}" Margin="0 2 0 2" Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下移" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="取消" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Background="#FF0033" BorderBrush="#FF0033" Command="{Binding DataContext.DeletePlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下传" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Background="Yellow" BorderBrush="Yellow" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="450" d:DesignWidth="800"
>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5 15 5 5">

@ -6,8 +6,8 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="澳柯玛生产控制系统" Icon="/Assets/images/Icon.png"
d:DesignHeight="800"
d:DesignWidth="1500" FontFamily="Microsoft YaHei"
d:DesignHeight="1080"
d:DesignWidth="1920" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1800" WindowState="Normal"
WindowStartupLocation="CenterScreen" >
<Window.Background>

@ -93,8 +93,8 @@
</Border>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="计划下达" Command="{Binding PlanInfoTransmitCommand}" Height="50" Width="150" />
<Button Content="取 消" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF9900" Margin="10,0,0,0" Height="50" BorderBrush="#FF9900" Width="150" />
<Button Content="计划下达" Command="{Binding PlanInfoTransmitCommand}" Height="50" Width="140" />
<Button Content="取 消" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF9900" Margin="25,0,0,0" Height="50" BorderBrush="#FF9900" Width="140" />
</StackPanel>
</Grid>
</Border>

@ -116,94 +116,12 @@
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
},
{
"ID": 2,
"Name": "TestTask",
"JobGroup": "DEFAULT",
"Cron": "*/1 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_BoxFoamInStoreTask_Quartz",
"Remark": "执行箱体入库任务调度系统,",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2224-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
},
{
"ID": 3,
"Name": "PQInStoreTask",
"JobGroup": "DEFAULT",
"Cron": "*/15 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_BoxFoamOutStore_Quartz",
"Remark": "泡前库入库调度任务",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2224-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
}
],
"StoreInfo": {
"BeforeStoreCode": "PBSCK-001",
"AfterStoreCode": "FPJCK-001"
},
"Startup": {
"Cors": {
"PolicyName": "CorsIpAccess", //
"EnableAllIPs": true, //trueIP访
// /localhost:8000/
// http://127.0.0.1:1818 http://localhost:1818
"IPs": "http://localhost:81,http://127.0.0.1:81"
},
"AppConfigAlert": {
"Enabled": true
},
"ApiName": "Admin.Core",
"IdentityServer4": {
"Enabled": false, // false使jwttrue使Ids4
"AuthorizationUrl": "http://localhost:5004", //
"ApiName": "admin.core.api" //
},
"RedisMq": {
"Enabled": false //redis
},
"MiniProfiler": {
"Enabled": false //
},
"Nacos": {
"Enabled": false //Nacos
}
},
"Redis": {
//"ConnectionString": "127.0.0.1:6379"
"ConnectionString": "127.0.0.1:6379"
},
"RabbitMQ": {
"Enabled": true,
"Connection": "http://localhost:15672/",
"UserName": "robin",
"Password": "123456",
"RetryCount": 3
},
"EventBus": {
"Enabled": true,
"SubscriptionClientName": "Admin.Core"

Loading…
Cancel
Save