add-成品下线添加操作手册功能

dev
liuwf 11 months ago
parent 13d48106e6
commit ccd9516ae1

@ -45,6 +45,12 @@ namespace Aucma.Core.BoxFoam.Models
/// 物料型号C
/// </summary>
public string typeCodeC { get; set; }
public string typeNameA { get; set; }
public string typeNameB { get; set; }
public string typeNameC { get; set; }
/// <summary>
/// 入库状态
/// </summary>

@ -115,6 +115,9 @@ namespace Aucma.Core.BoxFoam.ViewModels
model.materialType = item.MaterialType;
model.typeCodeB = item.typeCodeB;
model.typeCodeC = item.typeCodeC;
model.typeNameA = GetSubstringBetweenCommas(item.typeNameA);
model.typeNameB = GetSubstringBetweenCommas(item.typeNameB);
model.typeNameC = GetSubstringBetweenCommas(item.typeNameC);
model.unusualFlag = item.UnusualFlag == 2 ? "Red" : "White";
// 夹具型号
model.boxType = item.BoxType;
@ -135,9 +138,40 @@ namespace Aucma.Core.BoxFoam.ViewModels
Shapes.Add(model);
}
}
}
#endregion
/// <summary>
/// 截取两个逗号之间的字符串
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
static string GetSubstringBetweenCommas(string input)
{
if (input == null) return null;
// 找到第一个逗号的位置
int firstCommaIndex = input.IndexOf(',');
if (firstCommaIndex != -1)
{
// 找到第二个逗号的位置
int secondCommaIndex = input.IndexOf(',', firstCommaIndex + 1);
if (secondCommaIndex != -1)
{
// 使用Substring截取第一个逗号和第二个逗号之间的字符
return input.Substring(firstCommaIndex + 1, secondCommaIndex - firstCommaIndex - 1);
}
else
{
return null;
}
}
else
{
return null;
}
}
#region 初始化
private ObservableCollection<SpaceInfoModel> _shapes = new ObservableCollection<SpaceInfoModel>();
public ObservableCollection<SpaceInfoModel> Shapes

@ -151,8 +151,10 @@
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号1" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -162,6 +164,14 @@
<TextBlock Text="{Binding materialType}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="2" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" Grid.Row="0" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.SubmitCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent" Height="auto">
<TextBlock Text="{Binding typeNameA}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号2" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
@ -170,6 +180,14 @@
<TextBlock Text="{Binding typeCodeB}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="2" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" Grid.Row="1" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.SubmitCommand2, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent" Height="auto">
<TextBlock Text="{Binding typeNameB}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="0" Grid.Row="2" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号3" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
@ -178,6 +196,14 @@
<TextBlock Text="{Binding typeCodeC}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="2" Grid.Row="2" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" Grid.Row="2" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.SubmitCommand3, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent" Height="auto">
<TextBlock Text="{Binding typeNameC}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
</Grid>
</Border>

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

@ -31,6 +31,9 @@
<None Remove="Assets\Images\logo.png" />
<None Remove="Assets\Images\Newlog.png" />
<None Remove="Assets\Images\Red.png" />
<None Remove="Assets\Images\word1.jpg" />
<None Remove="Assets\Images\word2.jpg" />
<None Remove="Assets\Images\word3.jpg" />
<None Remove="Log4net.config" />
</ItemGroup>
@ -61,6 +64,15 @@
<Resource Include="Assets\Images\Red.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\word1.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\word2.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\word3.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>

@ -112,7 +112,7 @@ namespace Aucma.Core.ProductOffLine.Business
GunBusiness.RefreshMaterialCodeStrEvent += MaterialBarScan;
ChooseDirectionWindow.SendPlcPassEvent += DownLoadPassFlag;
//test();
// test();
}
#region 变量定义
/// <summary>
@ -125,15 +125,18 @@ namespace Aucma.Core.ProductOffLine.Business
public void test()
{
//Task.Run(() =>
//{
Task.Run(() =>
{
// Thread.Sleep(5000);
// OffLineInfo info11 = new OffLineInfo();
// info11.ProductSNCode = "test111";
// int flag = _offLineInfoServices.AddAsync(info11).Result;
Thread.Sleep(5000);
TempOffLineInfo1.MsgInfo = "条码重复,上传间隔超过五分钟禁止放行,人工处理,上传时间:" + DateTime.Now;
TempOffLineInfo1.MsgAlarmFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo1);
//OffLineInfo info11 = new OffLineInfo();
//info11.ProductSNCode = "test111";
//int flag = _offLineInfoServices.AddAsync(info11).Result;
//});
});
// private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness));
// string result = _productOffLineServices.QueryChecked("1520870000099E2V0004");

@ -12,7 +12,7 @@
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Label Content="扫码枪扫描位置" FontSize="20" Foreground="White" HorizontalAlignment="Left" Margin="122,120,0,0" VerticalAlignment="Top" Height="50" Width="148"/>
@ -26,6 +26,7 @@
<Button Content="内侧提升机" Click="RightButton_Click" Height="50" Width="130" Margin="310,66,60,126" Background="Green" />
<Label Content="放行方向:" FontSize="20" Foreground="White" HorizontalAlignment="Left" Margin="125,66,0,0" VerticalAlignment="Top" Height="50" Width="97"/>
<Button Content="保存" FontSize="20" HorizontalAlignment="Left" Margin="554,178,0,0" VerticalAlignment="Top" Width="100" Height="45" Click="Button_Click"/>
<Button Content="操作手册" FontSize="20" HorizontalAlignment="Left" Margin="36,178,0,0" VerticalAlignment="Top" Height="45" Width="116" Background="#FF9900" BorderBrush="#FF9900" Click="Button_Click_1" />
</Grid>
<!--</StackPanel>-->
</Grid>

@ -2,6 +2,8 @@
using Aucma.Core.ProductOffLine.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -99,5 +101,11 @@ namespace Aucma.Core.ProductOffLine.Views
this.Close();
}
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
WordWindow window = new WordWindow();
window.Show();
}
}
}

@ -16,12 +16,16 @@
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="851*"/>
<ColumnDefinition Width="1059*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.7*"/>
<RowDefinition Height="6*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,2" Height="100">
<Border Grid.Row="0" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,2,2,2" Height="100" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.3*"/>
@ -57,11 +61,11 @@
</Border>
<Border Grid.Row="1" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,5,2,2">
<Border Grid.Row="1" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,5,2,2" Grid.ColumnSpan="2">
<ContentControl Content="{Binding UserContent}"/>
</Border>
<DockPanel Grid.Row="2" Margin="5 0 5 3">
<DockPanel Grid.Row="2" Margin="5 0 5 3" Grid.ColumnSpan="2">
<Border Margin="5" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid>

@ -0,0 +1,33 @@
<Window x:Class="Aucma.Core.ProductOffLine.Views.WordWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Aucma.Core.ProductOffLine.Views"
mc:Ignorable="d" FontFamily="Microsoft YaHei"
Title="操作手册" Height="800" Width="850">
<!--WindowStartupLocation="CenterScreen"-->
<Grid Background="#1152AC">
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Image Source="/Assets/images/word1.jpg" Width="800" Height="500" Margin="10"/>
<Image Source="/Assets/images/word2.jpg" Width="800" Height="300" Margin="10"/>
<Image Source="/Assets/images/word3.jpg" Width="800" Height="500" Margin="10"/>
<!-- Add more images here -->
</StackPanel>
</ScrollViewer>
</Grid>
<Grid Grid.Row="1">
<Button Content="关闭" FontSize="20" HorizontalAlignment="Left" Margin="593,44,0,0" VerticalAlignment="Top"/>
</Grid>
<!--</StackPanel>-->
</Grid>
</Window>

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Aucma.Core.ProductOffLine.Views
{
/// <summary>
/// WordWindow.xaml 的交互逻辑
/// </summary>
public partial class WordWindow : Window
{
public WordWindow()
{
InitializeComponent();
}
}
}
Loading…
Cancel
Save