change -完成工单执行的报工和工单结束,继续完善交接班

main
frankiecao 1 year ago
commit 533b3d30f0

@ -68,7 +68,7 @@ namespace SlnMesnac.Model.domain
/// 实际开始时间 /// 实际开始时间
/// </summary> /// </summary>
[SugarColumn(ColumnName = "begin_time")] [SugarColumn(ColumnName = "begin_time")]
public string BeginTIme { get; set; } public string BeginTime { get; set; }
/// <summary> /// <summary>
/// 实际完成时间 /// 实际完成时间
@ -111,5 +111,11 @@ namespace SlnMesnac.Model.domain
/// </summary> /// </summary>
[SugarColumn(ColumnName = "device_code")] [SugarColumn(ColumnName = "device_code")]
public string DeviceCode { get; set; } public string DeviceCode { get; set; }
/// <summary>
/// 工单状态
/// </summary>
[SugarColumn(ColumnName = "plan_status")]
public string PlanStatus { get; set; }
} }
} }

@ -0,0 +1,97 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
namespace SlnMesnac.Model.domain
{
[SugarTable("prod_plan_detail"), TenantAttribute("mes")]
[DataContract(Name = "ProdPLanDetail 员工信息")]
public class ProdPlanDetail
{
/// <summary>
///
/// </summary>
[SugarColumn(ColumnName = "obj_id", IsPrimaryKey = true, IsIdentity = true)]
public int ObjId { get; set; }
/// <summary>
/// 工单编号
/// </summary>
[SugarColumn(ColumnName = "plan_code")]
public string PlanCode { get; set; }
/// <summary>
/// 物料编号
/// </summary>
[SugarColumn(ColumnName = "material_code")]
public string MaterialCode { get; set; }
/// <summary>
/// 计划完成数
/// </summary>
[SugarColumn(ColumnName = "plan_amount")]
public string PlanAmount { get; set; }
/// <summary>
/// 实际完成数
/// </summary>
[SugarColumn(ColumnName = "complete_amount")]
public string CompleteAmount { get; set; }
/// <summary>
/// 开始时间
/// </summary>
[SugarColumn(ColumnName = "begin_time")]
public string BeginTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[SugarColumn(ColumnName = "end_time")]
public string EndTime { get; set; }
/// <summary>
/// 当前班组长
/// </summary>
[SugarColumn(ColumnName = "current_staff_id")]
public string CurrentStaffId { get; set; }
/// <summary>
/// 下一班组长
/// </summary>
[SugarColumn(ColumnName = "next_staff_id")]
public string NextStaffId { get; set; }
/// <summary>
/// 结束标志
/// </summary>
[SugarColumn(ColumnName = "end_flag")]
public string EndFlag { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnName = "created_by")]
public string CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "created_time")]
public string CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
[SugarColumn(ColumnName = "updated_by")]
public string UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnName = "updated_time")]
public string UpdatedTime { get; set; }
}
}

@ -20,5 +20,17 @@ namespace SlnMesnac.Repository.service
/// <param name="recordStaffAttendances"></param> /// <param name="recordStaffAttendances"></param>
/// <returns></returns> /// <returns></returns>
bool InsertRecordStaffAttendance(List<RecordStaffAttendance> recordStaffAttendances); bool InsertRecordStaffAttendance(List<RecordStaffAttendance> recordStaffAttendances);
/// <summary>
/// 获取最后的上班记录
/// </summary>
/// <returns></returns>
RecordStaffAttendance GetLastestOnRecord();
/// <summary>
/// 获取最后的下班记录
/// </summary>
/// <returns></returns>
RecordStaffAttendance GetLastestOffRecord();
} }
} }

@ -0,0 +1,56 @@
using Microsoft.Extensions.Logging;
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Repository.service.Impl
{
public class ProdPlanDetailServiceImpl : BaseServiceImpl<ProdPlanDetail>, ProdPlanDetailService
{
private ILogger<ProdPlanDetailServiceImpl> _logger;
public ProdPlanDetailServiceImpl(Repository<ProdPlanDetail> repository, ILogger<ProdPlanDetailServiceImpl> logger) : base(repository)
{
_logger = logger;
}
public List<ProdPlanDetail> GetPlanDetails()
{
List<ProdPlanDetail> pLanDetails = null;
try
{
pLanDetails = base._rep.GetList();
pLanDetails.Reverse();
}
catch (Exception ex)
{
_logger.LogError($"获取员工打卡信息异常{ex.Message}");
}
return pLanDetails;
}
public bool InsertPlanDetails(List<ProdPlanDetail> planDetails)
{
bool result = false;
try
{
base._rep.AsTenant().BeginTran();
result = base._rep.InsertRange(planDetails);
base._rep.AsTenant().CommitTran();
}
catch (Exception ex)
{
base._rep.AsTenant().RollbackTran();
_logger.LogError($"员工打卡信息添加异常:{ex.Message}");
}
return result;
}
public ProdPlanDetail GetPlanDetailsByPlanCode(string planCode)
{
ProdPlanDetail prodPlanDetail = _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(planCode),x=>x.PlanCode == planCode).First();
return prodPlanDetail;
}
}
}

@ -26,13 +26,14 @@ namespace SlnMesnac.Repository.service.Impl
/// <param name="planCode"></param> /// <param name="planCode"></param>
/// <param name="materialCode"></param> /// <param name="materialCode"></param>
/// <returns></returns> /// <returns></returns>
public List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string? orderCode, string? planCode, string? materialCode, string? stationCode) public List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string? orderCode, string? planCode, string? materialCode, string? stationCode,string? planStatus)
{ {
List<ProdPLanInfo> recordStaffAttendances = new List<ProdPLanInfo>(); List<ProdPLanInfo> recordStaffAttendances = new List<ProdPLanInfo>();
List<ProdPLanInfo> planInfoList = _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(orderCode), x => x.OrderCode == orderCode) List<ProdPLanInfo> planInfoList = _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(orderCode), x => x.OrderCode == orderCode)
.WhereIF(!string.IsNullOrEmpty(planCode), x => x.PlanCode == planCode) .WhereIF(!string.IsNullOrEmpty(planCode), x => x.PlanCode == planCode)
.WhereIF(!string.IsNullOrEmpty(materialCode), x => x.MaterialCode == materialCode) .WhereIF(!string.IsNullOrEmpty(materialCode), x => x.MaterialCode == materialCode)
.WhereIF(!string.IsNullOrEmpty(stationCode), x => x.StationCode == stationCode) .WhereIF(!string.IsNullOrEmpty(stationCode), x => x.StationCode == stationCode)
.WhereIF(!string.IsNullOrEmpty(planStatus),x => x.PlanStatus == planStatus)
.ToList(); .ToList();
return planInfoList; return planInfoList;
} }

@ -48,5 +48,17 @@ namespace SlnMesnac.Repository.service.Impl
} }
return result; return result;
} }
public RecordStaffAttendance GetLastestOnRecord()
{
RecordStaffAttendance recordStaffAttendances = _rep.AsQueryable().Where(x => x.AttendanceType == "0").OrderByDescending(x => x.CreateTime).First();
return recordStaffAttendances;
}
public RecordStaffAttendance GetLastestOffRecord()
{
RecordStaffAttendance recordStaffAttendances = _rep.AsQueryable().Where(x => x.AttendanceType == "1").OrderByDescending(x => x.CreateTime).First();
return recordStaffAttendances;
}
} }
} }

@ -0,0 +1,32 @@
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Repository.service
{
public interface ProdPlanDetailService : IBaseService<ProdPlanDetail>
{
/// <summary>
/// 获取所有工单信息
/// </summary>
/// <returns></returns>
List<ProdPlanDetail> GetPlanDetails();
/// <summary>
/// 验证添加员工打卡记录
/// </summary>
/// <param name="planDetails"></param>
/// <returns></returns>
bool InsertPlanDetails(List<ProdPlanDetail> planDetails);
/// <summary>
/// 根据工单号查询此工单所有明细
/// </summary>
/// <param name="orderCode"></param>
/// <param name="planCode"></param>
/// <returns></returns>
ProdPlanDetail GetPlanDetailsByPlanCode(string planCode);
}
}

@ -18,6 +18,6 @@ namespace SlnMesnac.Repository.service
/// 根据订单编号、工单编号、物料名称获取工单信息 /// 根据订单编号、工单编号、物料名称获取工单信息
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string orderCode,string planCode,string materialCode, string stationCode); List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string orderCode,string planCode,string materialCode, string stationCode, string planStatus);
} }
} }

@ -120,7 +120,7 @@
<TextBlock Text="工位:" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="工位:" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="1"> <Border Grid.Row="1" Grid.Column="1">
<TextBlock Text="{Binding ProductLineNameTextBlock}" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left"/> <TextBlock Text="{Binding StationTextBox}" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="5"> <Border Grid.Row="1" Grid.Column="5">
<Button Content="检索" x:Name="Select" Command="{Binding SearchCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="15,5,15,5"/> <Button Content="检索" x:Name="Select" Command="{Binding SearchCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="15,5,15,5"/>
@ -131,12 +131,12 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<DataGrid Name="dataGridPlanInfo" ItemsSource="{Binding ProdPLanInfoDataGrid}" Background="Transparent" <DataGrid x:Name="DataGridPlanInfo" ItemsSource="{Binding ProdPLanInfoDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="40" LoadingRow="dgvMH_LoadingRow" FontSize="15" ColumnHeaderHeight="40" LoadingRow="dgvMH_LoadingRow"
RowHeight="40" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="40" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}"> Foreground="#FFFFFF" SelectedItem="{Binding SelectedRow}">
<!--resourceStyle 399行修改选中字体颜色--> <!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTemplateColumn Width="55" Header="序号" > <DataGridTemplateColumn Width="55" Header="序号" >
@ -158,9 +158,8 @@
<DataTemplate> <DataTemplate>
<WrapPanel> <WrapPanel>
<!--<Button Content="查看" FontSize="18" CommandParameter="{Binding ID}" Margin="0 0 0 0" Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />--> <!--<Button Content="查看" FontSize="18" CommandParameter="{Binding ID}" Margin="0 0 0 0" Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />-->
<Button Content="执行" FontSize="15" Width="80" Height="34" CommandParameter="{Binding ID}" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" /> <Button Content="执行" FontSize="15" Width="80" Height="34" Command="{Binding DataContext.ExecuteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/>
<!--<Button Content="取消" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Background="#df4642" BorderBrush="#df4642" Command="{Binding DataContext.DeletePlanCommand, 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 }}" />-->
</WrapPanel> </WrapPanel>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
@ -201,6 +200,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding OrderCodeText}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="2"> <Border Grid.Row="0" Grid.Column="2">
<TextBlock Text="工单编号" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="工单编号" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -209,6 +209,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding PlanCodeText}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="0"> <Border Grid.Row="1" Grid.Column="0">
<TextBlock Text="物料编号" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="物料编号" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -217,6 +218,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding MaterialCodeText}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="2"> <Border Grid.Row="1" Grid.Column="2">
<TextBlock Text="计划工位" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="计划工位" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -225,6 +227,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding StationCodeText}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>
@ -232,18 +235,25 @@
<TextBlock Text="工单明细" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="工单明细" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Row="3"> <Border Grid.Row="3">
<DataGrid Name="dataGridPlanDetail" ItemsSource="{Binding RfidInfoDataGrid}" Background="Transparent" <DataGrid Name="dataGridPlanDetail" ItemsSource="{Binding ProdPLanDetailDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="30" FontSize="15" ColumnHeaderHeight="30" LoadingRow="dgvMH_LoadingRow"
RowHeight="30" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="30" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}"> Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}">
<!--resourceStyle 399行修改选中字体颜色--> <!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding baggageTagCode}" Header="序号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTemplateColumn Width="55" Header="序号" >
<DataGridTextColumn Binding="{Binding baggageTagCode}" Header="计划数量" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTemplateColumn.CellTemplate>
<DataGridTextColumn Binding="{Binding baggageTagCode}" Header="完成数量" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataTemplate>
<DataGridTextColumn Binding="{Binding date,StringFormat=\{0:yyyy-MM-dd\}}" Header="实际开始时间" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Binding="{Binding baggageTagCode}" Header="序号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime, StringFormat=\{0:yyy-MM-dd HH:mm:ss\}}" Header="实际开始时间" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</Border> </Border>
@ -254,10 +264,10 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Column="0"> <Border Grid.Column="0">
<Button Content="生产报工" x:Name="ProductionReport" Command="{Binding ControlOnClickCommand}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,14,40,14"/> <Button Content="生产报工" x:Name="ProductionReport" Command="{Binding ProductionReportCommand}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,14,40,14"/>
</Border> </Border>
<Border Grid.Column="1"> <Border Grid.Column="1">
<Button Content="换班交接" x:Name="Handover" Command="{Binding HandoverCommand}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,14,40,14" Click="ChangeShifts_Click"/> <Button Content="换班交接" x:Name="Handover" Command="{Binding HandoverCommand}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,14,40,14" Click="ChangeShifts_Click"/>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>

@ -2,6 +2,7 @@
using SlnMesnac.WPF.Views; using SlnMesnac.WPF.Views;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -50,5 +51,30 @@ namespace SlnMesnac.WPF.Page
{ {
e.Row.Header = (e.Row.GetIndex() + 1).ToString(); e.Row.Header = (e.Row.GetIndex() + 1).ToString();
} }
public string GetSelectedRowValue()
{
if (DataGridPlanInfo.SelectedItem != null)
{
DataRowView row = (DataRowView)DataGridPlanInfo.SelectedItems[0];
// 获取选中行中指定列的值
string value = row["PlanCode"].ToString();
//// 或者直接遍历选中行中的所有列
//foreach (DataColumn col in row.Row.Table.Columns)
//{
// string colName = col.ColumnName;
// string colValue = row[colName].ToString();
//}
return value;
}
else
{
return string.Empty;
}
}
} }
} }

@ -5,10 +5,13 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Protocols; using Microsoft.IdentityModel.Protocols;
using SlnMesnac.Business.business; using SlnMesnac.Business.business;
using SlnMesnac.Model.domain; using SlnMesnac.Model.domain;
using SlnMesnac.Model.dto;
using SlnMesnac.Repository.service; using SlnMesnac.Repository.service;
using SlnMesnac.WPF.Page;
using SlnMesnac.WPF.Views; using SlnMesnac.WPF.Views;
using SqlSugar; using SqlSugar;
using System; using System;
using System.CodeDom.Compiler;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
@ -30,22 +33,40 @@ namespace SlnMesnac.WPF.ViewModel
public ObservableCollection<string> MaterialNameComboBoxItems { get; set; } public ObservableCollection<string> MaterialNameComboBoxItems { get; set; }
private ProdPlanInfoService _prodPlanInfoService; private ProdPlanInfoService _prodPlanInfoService;
private List<ProdPLanInfo> prodPlanInfos; private List<ProdPLanInfo> prodPlanInfos;
private ProdPlanDetailService _prodPlanDetailService;
private IRecordStaffAttendanceService _recordStaffAttendanceService;
private string StationCode; private string StationCode;
private bool isComplete = true;
/// <summary> /// <summary>
/// 按钮文字转换事件 /// 按钮文字转换事件
/// </summary> /// </summary>
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// 检索命令
/// </summary>
public ICommand SearchCommand { get; private set; }
/// <summary> /// <summary>
/// 换班命令 /// 换班命令
/// </summary> /// </summary>
public ICommand HandoverCommand { get; private set; } public ICommand HandoverCommand { get; private set; }
/// <summary>
/// 报工命令
/// </summary>
public ICommand ProductionReportCommand { get; private set; }
/// <summary>
/// 执行命令
/// </summary>
public ICommand ExecuteCommand { get; private set; }
public ExecuteViewModel() public ExecuteViewModel()
{ {
_prodPlanInfoService = App.ServiceProvider.GetService<ProdPlanInfoService>(); _prodPlanInfoService = App.ServiceProvider.GetService<ProdPlanInfoService>();
// 读取appsettings.json配置文件 _prodPlanDetailService = App.ServiceProvider.GetService<ProdPlanDetailService>();
_recordStaffAttendanceService = App.ServiceProvider.GetService<IRecordStaffAttendanceService>();
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder() IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
.SetBasePath(System.AppContext.BaseDirectory) .SetBasePath(System.AppContext.BaseDirectory)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
@ -54,7 +75,9 @@ namespace SlnMesnac.WPF.ViewModel
stationTextBlock = configuration.GetSection("AppConfig")["ProductLineName"]; stationTextBlock = configuration.GetSection("AppConfig")["ProductLineName"];
StationCode = configuration.GetSection("AppConfig")["ProductLineCode"]; StationCode = configuration.GetSection("AppConfig")["ProductLineCode"];
HandoverCommand = new RelayCommand(Handover); HandoverCommand = new RelayCommand(Handover);
ProductionReportCommand = new RelayCommand(ProductionReport);
SearchCommand = new RelayCommand(Search); SearchCommand = new RelayCommand(Search);
ExecuteCommand = new RelayCommand(Execute);
} }
/// <summary> /// <summary>
@ -64,15 +87,18 @@ namespace SlnMesnac.WPF.ViewModel
{ {
var handOverWin = new HandOverWin(); var handOverWin = new HandOverWin();
handOverWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央 handOverWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
handOverWin.ShowDialog();//窗体出现后禁止后面的用户控件 handOverWin.ShowDialog();//窗体出现后禁止后面的用户控件
//其他操作
} }
/// <summary> /// <summary>
/// 检索命令 /// 换班弹窗
/// </summary> /// </summary>
public ICommand SearchCommand { get; private set; } private void ProductionReport()
{
var reportWin = new ProductionReportWin();
reportWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
reportWin.ShowDialog();//窗体出现后禁止后面的用户控件
}
/// <summary> /// <summary>
/// 检索事件 /// 检索事件
@ -80,9 +106,9 @@ namespace SlnMesnac.WPF.ViewModel
private void Search() private void Search()
{ {
// 在这里执行其他操作可以通过InputText获取用户输入的信息 // 在这里执行其他操作可以通过InputText获取用户输入的信息
Console.WriteLine("用户输入的信息:" + OrderCodeTextBox + PlanCodeTextBox + MaterialCodeTextBox); //Console.WriteLine("用户输入的信息:" + OrderCodeTextBox + PlanCodeTextBox + MaterialCodeTextBox);
//ProductLineNameTextBlock = ConfigurationManager.AppSettings["ProductLineNameTextBlock"]; //ProductLineNameTextBlock = ConfigurationManager.AppSettings["ProductLineNameTextBlock"];
List<ProdPLanInfo> list = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(OrderCodeTextBox, PlanCodeTextBox, MaterialCodeTextBox, StationCode); List<ProdPLanInfo> list = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(OrderCodeTextBox, PlanCodeTextBox, MaterialCodeTextBox, StationCode,"0");
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () => System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{ {
ProdPLanInfoDataGrid.Clear(); ProdPLanInfoDataGrid.Clear();
@ -91,7 +117,50 @@ namespace SlnMesnac.WPF.ViewModel
ProdPLanInfoDataGrid.Add(item); ProdPLanInfoDataGrid.Add(item);
}); });
})); }));
// }
// 新增的执行事件
private void Execute()
{
if (isComplete)
{
// 将当前记录存为实体可以通过parameter获取当前记录的信息
string orderCode = _selectedRow.OrderCode.ToString();
string planCode = _selectedRow.PlanCode.ToString();
ProdPLanInfo pLanInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(orderCode, planCode, "", "", "0").First();
RecordStaffAttendance currentRecord = _recordStaffAttendanceService.GetLastestOnRecord();
RecordStaffAttendance nextRecord = _recordStaffAttendanceService.GetLastestOffRecord();
// 向detail表里插入一条数据
ProdPlanDetail prodPlanDetail = new ProdPlanDetail
{
PlanCode = pLanInfo.PlanCode,
MaterialCode = pLanInfo.MaterialCode,
PlanAmount = pLanInfo.PlanAmount,
CompleteAmount = pLanInfo.CompleteAmount,
BeginTime = DateTime.Now.ToString(),
CurrentStaffId = currentRecord.StaffId,
//NextStaffId = nextRecord.StaffId,
};
_prodPlanDetailService.Insert(prodPlanDetail);
//按钮文字变成执行中并锁定,其他的订单执行按钮也禁用
pLanInfo.BeginTime = DateTime.Now.ToString();
pLanInfo.PlanStatus = "1";
_prodPlanInfoService.Update(pLanInfo);
Search();
//查明细表显示出来
ProdPlanDetail planDetail = _prodPlanDetailService.GetPlanDetailsByPlanCode(pLanInfo.PlanCode);
PlanCodeText = planDetail.PlanCode;
OrderCodeText = pLanInfo.OrderCode;
MaterialCodeText = planDetail.MaterialCode;
StationCodeText = pLanInfo.StationCode;
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
ProdPLanDetailDataGrid.Clear();
ProdPLanDetailDataGrid.Add(planDetail);
}));
isComplete = false;
}
} }
#region #region
@ -136,7 +205,7 @@ namespace SlnMesnac.WPF.ViewModel
} }
/// <summary> /// <summary>
/// DataGrid /// PlanDataGrid
/// </summary> /// </summary>
private ObservableCollection<ProdPLanInfo> prodPLanInfoDataGrid = new ObservableCollection<ProdPLanInfo>(); private ObservableCollection<ProdPLanInfo> prodPLanInfoDataGrid = new ObservableCollection<ProdPLanInfo>();
public ObservableCollection<ProdPLanInfo> ProdPLanInfoDataGrid public ObservableCollection<ProdPLanInfo> ProdPLanInfoDataGrid
@ -144,6 +213,69 @@ namespace SlnMesnac.WPF.ViewModel
get { return prodPLanInfoDataGrid; } get { return prodPLanInfoDataGrid; }
set { prodPLanInfoDataGrid = value; OnPropertyChanged("ProdPLanInfoDataGrid"); } set { prodPLanInfoDataGrid = value; OnPropertyChanged("ProdPLanInfoDataGrid"); }
} }
/// <summary>
/// DetailDataGrid
/// </summary>
private ObservableCollection<ProdPlanDetail> prodPLanDetailDataGrid = new ObservableCollection<ProdPlanDetail>();
public ObservableCollection<ProdPlanDetail> ProdPLanDetailDataGrid
{
get { return prodPLanDetailDataGrid; }
set { ProdPLanDetailDataGrid = value; OnPropertyChanged("ProdPLanDetailDataGrid"); }
}
/// <summary>
/// 选中行
/// </summary>
public ProdPLanInfo _selectedRow;
public ProdPLanInfo SelectedRow
{
get { return _selectedRow; }
set
{
_selectedRow = value; OnPropertyChanged(nameof(SelectedRow));
}
}
/// <summary>
/// 订单Text
/// </summary>
private string orderCodeText;
public string OrderCodeText
{
get { return orderCodeText; }
set { orderCodeText = value; OnPropertyChanged("OrderCodeText"); }
}
/// <summary>
/// 工单Text
/// </summary>
private string planCodeText;
public string PlanCodeText
{
get { return planCodeText; }
set { planCodeText = value; OnPropertyChanged("PlanCodeText"); }
}
/// <summary>
/// 原料Text
/// </summary>
private string materialCodeText;
public string MaterialCodeText
{
get { return materialCodeText; }
set { materialCodeText = value; OnPropertyChanged("MaterialCodeText"); }
}
/// <summary>
/// 订单
/// </summary>
private string stationCodeText;
public string StationCodeText
{
get { return stationCodeText; }
set { stationCodeText = value; OnPropertyChanged("StationCodeText"); }
}
#endregion #endregion
public void OnPropertyChanged([CallerMemberName] string propertyName = "") public void OnPropertyChanged([CallerMemberName] string propertyName = "")

@ -1,4 +1,5 @@
using ConsoleApp; using ConsoleApp;
using GalaSoft.MvvmLight.Command;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SlnMesnac.Model.domain; using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service; using SlnMesnac.Repository.service;
@ -9,29 +10,100 @@ using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input;
namespace SlnMesnac.WPF.ViewModel namespace SlnMesnac.WPF.ViewModel
{ {
public class HandOverViewModel : INotifyPropertyChanged public class HandOverViewModel : INotifyPropertyChanged
{ {
//private HidUtils hidUtils = new HidUtils();
private IBaseStaffService _baseStaffService; private IBaseStaffService _baseStaffService;
private ProdPlanInfoService _prodPlanInfoService;
private ProdPlanDetailService _prodPlanDetailService;
private ProdPLanInfo planInfo;
private ProdPlanDetail planDetail;
private int times; private int times;
/// <summary> /// <summary>
/// 按钮文字转换事件 /// 按钮文字转换事件
/// </summary> /// </summary>
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged = delegate { };
public HandOverViewModel() public HandOverViewModel()
{ {
_prodPlanDetailService = App.ServiceProvider.GetService<ProdPlanDetailService>();
_prodPlanInfoService = App.ServiceProvider.GetService<ProdPlanInfoService>();
planInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions("", "", "", "", "1").FirstOrDefault();
HandoverCommand = new RelayCommand(Handover);
Init(); Init();
_baseStaffService = App.ServiceProvider.GetService<IBaseStaffService>(); _baseStaffService = App.ServiceProvider.GetService<IBaseStaffService>();
} }
/// <summary>
/// 初始化
/// </summary>
private void Init()
{
planDetail = _prodPlanDetailService.GetPlanDetailsByPlanCode(planInfo.PlanCode);
PlanAmountText = planDetail.PlanAmount.ToString();
CompleteAmountText = planDetail.CompleteAmount.ToString();
var hidUtils = EmployeeLoginViewModel.hidUtils;
// hidUtils.Initial();
hidUtils.StartScan();
hidUtils.pushReceiveDataEvent += (bytes, str) =>
{
if (times < 2)//打卡超过2次无效
{
str = str.ToString().Replace(" ", "");
BaseStaffInfo user = _baseStaffService.GetStaffInfoByCardId(str);
if (user != null)
{
string staffType = user.StaffType;
if (staffType == "1")//判断是否为班长
{
//显示记录
StaffIdText = user.StaffId;
StaffNameText = user.StaffName;
StaffTypeText = user.StaffType;
TeamCodeText = user.TeamCode;
//数量+1
times++;
}
else
{
HintText = "打卡人员非班长,打卡无效!";
}
}
else
{
HintText = "没有匹配的员工,打卡失败!";
}
}
};
}
#region #region
/// <summary>
/// 计划数量Text
/// </summary>
private string planAmountText;
public string PlanAmountText
{
get { return planAmountText; }
set { planAmountText = value; OnPropertyChanged("PlanAmountText"); }
}
/// <summary>
/// 完成数量Text
/// </summary>
private string completeAmountText;
public string CompleteAmountText
{
get { return completeAmountText; }
set { completeAmountText = value; OnPropertyChanged("CompleteAmountText"); }
}
/// <summary> /// <summary>
/// 员工id /// 员工id
/// </summary> /// </summary>
@ -94,43 +166,20 @@ namespace SlnMesnac.WPF.ViewModel
#endregion #endregion
/// <summary> /// <summary>
/// 初始化 /// 确认交班
/// </summary> /// </summary>
private void Init() public ICommand HandoverCommand { get; private set; }
private void Handover()
{ {
var hidUtils = EmployeeLoginViewModel.hidUtils; //判断两个班长是否都已打卡
// hidUtils.Initial(); if(times == 2)
hidUtils.StartScan();
hidUtils.pushReceiveDataEvent += (bytes, str) =>
{ {
if (times < 2) //在工单明细插入一条,记录两个班长
{ }
str = str.ToString().Replace(" ", ""); else
BaseStaffInfo user = _baseStaffService.GetStaffInfoByCardId(str); {
if (user != null) HintText = "有人未打卡,请检查!";
{ }
string staffType = user.StaffType;
if (staffType == "1")
{
//显示记录
StaffIdText = user.StaffId;
StaffNameText = user.StaffName;
StaffTypeText = user.StaffType;
TeamCodeText = user.TeamCode;
//数量+1
times++;
}
else
{
HintText = "打卡人员非班长,打卡无效!";
}
}
else
{
HintText = "没有匹配的员工,打卡失败!";
}
}
};
} }
public void OnPropertyChanged([CallerMemberName] string propertyName = "") public void OnPropertyChanged([CallerMemberName] string propertyName = "")

@ -0,0 +1,179 @@
using GalaSoft.MvvmLight.Command;
using Microsoft.Extensions.DependencyInjection;
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service;
using SlnMesnac.WPF.Views;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace SlnMesnac.WPF.ViewModel
{
public class ProductionReportViewModel : INotifyPropertyChanged
{
private ProdPlanInfoService _prodPlanInfoService;
private ProdPlanDetailService _prodPlanDetailService;
private ProdPLanInfo planInfo;
private ProdPlanDetail planDetail;
/// <summary>
/// 按钮文字转换事件
/// </summary>
public event PropertyChangedEventHandler PropertyChanged = delegate { };
public ProductionReportViewModel()
{
_prodPlanDetailService = App.ServiceProvider.GetService<ProdPlanDetailService>();
_prodPlanInfoService = App.ServiceProvider.GetService<ProdPlanInfoService>();
ConfirmCommand = new RelayCommand(Confirm);
EndPlanCommand = new RelayCommand(EndPlan);
Init();
}
private void Init()
{
planInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions("", "", "", "","1").FirstOrDefault();
Refresh();
}
private void Refresh()
{
if (planInfo != null)
{
planDetail = _prodPlanDetailService.GetPlanDetailsByPlanCode(planInfo.PlanCode);
PlanAmountText = planDetail.PlanAmount.ToString();
CompleteAmountText = planDetail.CompleteAmount.ToString();
}
else
{
HintText = "没有正在执行的工单,请执行工单!";
}
}
#region
/// <summary>
/// 计划数量Text
/// </summary>
private string planAmountText;
public string PlanAmountText
{
get { return planAmountText; }
set { planAmountText = value; OnPropertyChanged("PlanAmountText"); }
}
/// <summary>
/// 完成数量Text
/// </summary>
private string completeAmountText;
public string CompleteAmountText
{
get { return completeAmountText; }
set { completeAmountText = value; OnPropertyChanged("CompleteAmountText"); }
}
/// <summary>
/// 新增数量Text
/// </summary>
private string newAmountText;
public string NewAmountText
{
get { return newAmountText; }
set { newAmountText = value; OnPropertyChanged("NewAmountText"); }
}
/// <summary>
/// 提示框
/// </summary>
private string hintText;
public string HintText
{
get { return hintText; }
set { hintText = value; OnPropertyChanged("HintText"); }
}
#endregion
/// <summary>
/// 确认命令
/// </summary>
public ICommand ConfirmCommand { get; private set; }
/// <summary>
/// 确认事件
/// </summary>
private void Confirm()
{
string newAmount = NewAmountText;
if (newAmount != null)
{
bool isNum = true;
foreach (char x in newAmount)
{
if (!char.IsNumber(x) && x != '.')
{
isNum = false;
}
}
if (isNum)
{
//将新增产量加到实际产量中
double currentAmountDouble = Convert.ToDouble(planDetail.CompleteAmount);
double newAmountDouble = Convert.ToDouble(newAmount);
double result = currentAmountDouble + newAmountDouble;
planDetail.CompleteAmount = result.ToString();
_prodPlanDetailService.Update(planDetail);
Refresh();
NewAmountText = null;
HintText = "已提交!";
}
else
{
//提示框提示错误信息
HintText = "输入有误,请输入阿拉伯数字!";
}
}
else
{
HintText = "不能为空!";
}
}
/// <summary>
/// 确认命令
/// </summary>
public ICommand EndPlanCommand { get; private set; }
private void EndPlan()
{
planDetail.EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
_prodPlanDetailService.Update(planDetail);
planInfo.PlanStatus = "2";
planInfo.EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
double planAmountDouble = Convert.ToDouble(planDetail.PlanAmount);
double completeAmountDouble = Convert.ToDouble(planDetail.CompleteAmount);
if(planAmountDouble == completeAmountDouble)
{
planInfo.CompFlag = "0";//正常完成
}
else if(planAmountDouble > completeAmountDouble)
{
planInfo.CompFlag = "1";//不足目标产量降级处理
}
else
{
planInfo.CompFlag = "2";//超额完成
}
_prodPlanInfoService.Update(planInfo);
//关闭窗口
Application.Current.Windows.OfType<ProductionReportWin>().First().Close();
}
public void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}

@ -94,7 +94,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding PlannedQuantity}" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="{Binding PlanAmountText}" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Column="2"> <Border Grid.Column="2">
<TextBlock Text="完成数量" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="完成数量" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -103,7 +103,7 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/> <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding CompletedQuantity}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="{Binding CompleteAmountText}" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>
@ -172,13 +172,9 @@
</Border.Effect> </Border.Effect>
<TextBlock Text="{Binding HintText}" FontSize="20" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="{Binding HintText}" FontSize="20" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Column="1"> <Border Grid.Column="1"/>
<Grid>
<TextBlock Text="请先进行生产报工" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</Grid>
</Border>
<Border Grid.Column="2"> <Border Grid.Column="2">
<Button Content="确认交班" x:Name="ProductionReport" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="20" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,14,40,14"/> <Button Content="确认交班" x:Name="ProductionReport" Command="{Binding HandoverCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="20" FontWeight="Bold" Background="#FFDC870B" BorderBrush="#FFDC870B" Margin="40,14,40,14" Click="ProductionReport_Click"/>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>

@ -25,5 +25,10 @@ namespace SlnMesnac.WPF.Views
InitializeComponent(); InitializeComponent();
this.DataContext = new HandOverViewModel(); this.DataContext = new HandOverViewModel();
} }
private void ProductionReport_Click(object sender, RoutedEventArgs e)
{
}
} }
} }

@ -0,0 +1,161 @@
<Window x:Class="SlnMesnac.WPF.Views.ProductionReportWin"
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:SlnMesnac.WPF.Views"
WindowStartupLocation="CenterOwner" Background="Transparent" ResizeMode="NoResize" FontWeight="ExtraLight"
mc:Ignorable="d"
Title="ProductionReportWin" Height="450" Width="800">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1"/>
</WindowChrome.WindowChrome>
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</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="#4285DE" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<!--<Setter Property="Foreground" Value="#dddddd"/>-->
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="6*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0">
<TextBlock Text="计划数量" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Height="50" Width="150" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" HorizontalAlignment="Left">
<Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<TextBlock Text="{Binding PlanAmountText}" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2">
<TextBlock Text="完成数量" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" Height="50" Width="150" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" HorizontalAlignment="Left">
<Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<TextBlock Text="{Binding CompleteAmountText}" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2">
<Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0">
<TextBlock Text="新增产量:" FontSize="20" FontWeight="Bold" Foreground="#1254AB" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="15"/>
</Border>
<Border Grid.Column="1">
<TextBox TextWrapping="Wrap" Text="{Binding NewAmountText}" FontSize="20" FontWeight="Bold" Height="50" Margin="10" Foreground="#1254AB"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="1">
<Button Content="提交" Command="{Binding ConfirmCommand}" FontSize="20" Foreground="White" Height="50" Width="120" Style="{StaticResource BUTTON_AGREE}" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,20,0"></Button>
</Border>
</Grid>
</Border>
<Border Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Height="50" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Margin="20,0,20,0">
<Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<TextBlock Text="{Binding HintText}" FontSize="20" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1">
<Grid/>
</Border>
<Border Grid.Column="2">
<Button Content="结束工单" x:Name="Handover" Command="{Binding EndPlanCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="20" FontWeight="Bold" Background="#FFDC870B" BorderBrush="#FFDC870B" Margin="40,14,40,14"/>
</Border>
</Grid>
</Border>
</Grid>
</Window>

@ -0,0 +1,29 @@
using SlnMesnac.WPF.ViewModel;
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 SlnMesnac.WPF.Views
{
/// <summary>
/// ProductionReportWin.xaml 的交互逻辑
/// </summary>
public partial class ProductionReportWin : Window
{
public ProductionReportWin()
{
InitializeComponent();
this.DataContext = new ProductionReportViewModel();
}
}
}

@ -57,7 +57,7 @@
} }
], ],
"redisConfig": "175.27.215.92:6379,password=redis@2023", "redisConfig": "175.27.215.92:6379,password=redis@2023",
"ProductLineCode": "1001", "StationCode": "1010",
"ProductLineName": "一产线" "ProductLineName": "压延一工位"
} }
} }

Loading…
Cancel
Save