liulb@mesnac.com 1 year ago
parent 110e510b3e
commit 67ba1307b9

@ -95,6 +95,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
Scanner1State(flag1); Scanner1State(flag1);
} }
#endregion #endregion
#region 更换界面 #region 更换界面
public System.Windows.Controls.UserControl _content; public System.Windows.Controls.UserControl _content;
@ -186,11 +187,12 @@ namespace Aucma.Core.DoorFoam.ViewModels
{ {
switch (page) switch (page)
{ {
case "FirstPage": case "FoamLinePage":
UserContent = firstPage; UserContent = firstPage;
break; break;
case "RecordPage": case "RealTimePage":
UserContent = recordPage; RealTimePageView realTimePageView = new RealTimePageView();
UserContent = realTimePageView;
break; break;
default: default:
break; break;

@ -22,47 +22,28 @@ namespace Aucma.Core.DoorFoam.ViewModels
/// <returns></returns> /// <returns></returns>
private void InitEveryDayMethodAsync() private void InitEveryDayMethodAsync()
{ {
DateTime startTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
DateTime endTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
//var list = await _doorFoamRecordServices.QueryAsync(d => d.BeginTime >= startTime && d.EndTime <= endTime);
ChartValues<double> achievement = new ChartValues<double>(); ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random(); Random random = new Random();
for (int i = 0; i < 5; i++) for (int i = 0; i < 2; i++)
{ {
achievement.Add(random.Next(60, 100)); achievement.Add(random.Next(0, 50));
} }
var column = new ColumnSeries(); ModelStatistics.Add(new ColumnSeries()
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Add(column);
ProductionHourList = new List<string>()
{ {
"12", DataLabels = true,
"13", Title = "型号",
"14", Values = achievement,
"15", Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226)),
"16", Foreground = Brushes.White,
}; FontSize = 18
});
ChartValues<double> achievement2 = new ChartValues<double>(); MaterialNameList = new List<string>()
Random random2 = new Random();
for (int i = 0; i < 5; i++)
{ {
achievement2.Add(random2.Next(60, 100)); "BCD-287CHN",
} "BCD-287CHN"
var column2 = new ColumnSeries(); };
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
Achievement.Add(column2);
} }
#region 扫描信息 #region 扫描信息

@ -1,4 +1,5 @@
using System; using Aucma.Core.DoorFoam.ViewModels;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -23,7 +24,7 @@ namespace Aucma.Core.DoorFoam.Views
public RealTimePageView() public RealTimePageView()
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = new RealTimePageView(); this.DataContext = new RealTimePageViewModel();
} }
} }
} }

@ -314,7 +314,7 @@ namespace Aucma.Core.PrintTo.ViewModels
#endregion #endregion
printBarCode.ProductCode = ProductCode; printBarCode.OrderCode = ProductCode;
printBarCode.MaterialCode = item.MaterialCode; printBarCode.MaterialCode = item.MaterialCode;
printBarCode.MaterialName = item.MaterialName; printBarCode.MaterialName = item.MaterialName;
printBarCode.PrintTime = DateTime.Now; printBarCode.PrintTime = DateTime.Now;

@ -100,7 +100,7 @@ namespace Aucma.Core.PrintTo.ViewModels
if (!string.IsNullOrEmpty(queryStr)) if (!string.IsNullOrEmpty(queryStr))
{ {
Datalist.Clear(); Datalist.Clear();
var list = await _barCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) ||d.MaterialBarcode.Equals(ProductNo) || d.ProductCode.Equals(ProductNo)); var list = await _barCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) ||d.MaterialBarcode.Equals(ProductNo) || d.OrderCode.Equals(ProductNo));
foreach (var item in list) foreach (var item in list)
{ {
@ -126,7 +126,7 @@ namespace Aucma.Core.PrintTo.ViewModels
#region 加载DataGrid数据 #region 加载DataGrid数据
private async Task LoadData(string productCode,string material_code) private async Task LoadData(string productCode,string material_code)
{ {
var list = await _barCodeServices.QueryAsync(d => d.ProductCode.Contains(productCode)&& d.MaterialCode.Contains(material_code)); var list = await _barCodeServices.QueryAsync(d => d.OrderCode.Contains(productCode)&& d.MaterialCode.Contains(material_code));
foreach (var item in list) foreach (var item in list)
{ {

@ -13,7 +13,7 @@
<UserControl.Resources> <UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}"> <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/> <Setter Property="FontSize" Value="15"/>
</Style> </Style>
<Style TargetType="DataGrid"> <Style TargetType="DataGrid">
@ -302,7 +302,7 @@
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0" HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True"
CanUserAddRows="False" SelectionMode="Single" Foreground="White" CanUserAddRows="False" SelectionMode="Single" Foreground="White"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="18"> SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="15">
<DataGrid.Columns > <DataGrid.Columns >
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" /> <DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
@ -315,7 +315,7 @@
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecuteStatus}" Header="执行状态" Visibility="Collapsed"/> <DataGridTextColumn Binding="{Binding ExecuteStatus}" Header="执行状态" Visibility="Collapsed"/>
<DataGridTemplateColumn Header="操作" Width="3.5*" > <DataGridTemplateColumn Header="操作" Width="2.5*" >
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>

Loading…
Cancel
Save