change -成品下线

dev
liuwf 1 year ago
parent 3c0c01f28e
commit b312137ce5

@ -493,7 +493,7 @@
</member>
<member name="T:Admin.Core.Model.Model_New.OffLineInfo">
<summary>
条码下线信息
条码下线信息记录
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.OffLineInfo.ObjId">

@ -8,9 +8,9 @@ using System.Threading.Tasks;
namespace Admin.Core.Model.Model_New
{
/// <summary>
/// 条码下线信息
/// 条码下线信息记录
/// </summary>
[SugarTable("OFF_LINEINFO", "AUCMA_MES")]
[SugarTable("PRODUCT_OFFLINE", "AUCMA_SCADA")]
public class OffLineInfo
{
/// <summary>
@ -18,41 +18,43 @@ namespace Admin.Core.Model.Model_New
///</summary>
[SugarColumn(ColumnName = "OBJ_ID", IsPrimaryKey = true, IsIdentity = true)]
public int ObjId { get; set; }
[SugarColumn(ColumnName = "PRODUCT_FACTORY_CODE")]
public string ProductFactoryCode { get; set; } //计划工厂
[SugarColumn(ColumnName = "PRODUCT_SNCODE")]
public string ProductSNCode { get; set; } //公司条码
[SugarColumn(ColumnName = "PRODUCT_ORDER_NO")]
public string ProductOrderNo { get; set; }//工单号
[SugarColumn(ColumnName = "PRODUCT_SALE_NO")]
public string ProductSaleNo { get; set; } //销售订单号
[SugarColumn(ColumnName = "PRODUCT_SALE_LINE_NO")]
public string ProductSaleLineNo { get; set; } //销售行号
[SugarColumn(ColumnName = "PRODUCT_CODE")]
public string ProductCode { get; set; }//物料编码
[SugarColumn(ColumnName = "PRODUCT_MODEL")]
public string ProductModel{ get; set; }//产品型号
[SugarColumn(ColumnName = "PRODUCT_NAME")]
public string ProductName { get; set; }//物料描述
[SugarColumn(ColumnName = "PRODUCT_TYPE")]
public string ProductType { get; set; }//产品类型
[SugarColumn(ColumnName = "PRODUCT_CHECK_INFO")]
public string ProductCheckInfo { get; set; }//验证组合
[SugarColumn(ColumnName = "PRODUCT_REMARK")]
public string ProductRemark { get; set; } //标签特征
[SugarColumn(ColumnName = "PRODUCT_BAR_NO")]
public string ProductBarNo { get; set; }//产品条码编码
[SugarColumn(ColumnName = "PRODUCT_MASTER_MODEL")]
public string ProductMasterModel { get; set; }//主型号
[SugarColumn(ColumnName = "PRODUCT_VERSION")]
public string ProductVersion { get; set; }//版本号
[SugarColumn(ColumnName = "PRODUCT_USERINFO")]
public string ProductUseInfo { get; set; }//用途位
[SugarColumn(ColumnName = "PRODUCT_CIRCULATE")]
public string ProductFactoryCode; //计划工厂
public string ProductSNCode; //公司条码
public string ProductOrderNo; //工单号
public string ProductSaleNo; //销售订单号
public string ProductSaleLineNo; //销售行号
public string ProductCode;//物料编码
public string ProductModel;//产品型号
public string ProductName;//物料描述
public string ProductType;//产品类型
public string ProductCheckInfo;//验证组合
public string ProductRemark; //标签特征
public string ProductBarNo; //产品条码编码
public string ProductMasterModel;//主型号
public string ProductVersion;//版本号
public string ProductUseInfo;//用途位
public string ProductCirculate;//流通特性
public string ProductCreateDate;//生成日期
public string ProductScanTime; //扫描时间
public bool ProductRefreshFlag;
public int ReadFlag;
public bool ProductDataFlag;
// 界面提示信息
public string MsgInfo;
public bool MsgAlarmFlag;
public int OrderQty;
public int ActQty;
public string oneCode;
public string serialNumber;
public string rfid;
public string sim;
public string number1;
public bool ChkOut;
public string ProductCirculate { get; set; }//流通特性
[SugarColumn(ColumnName = "PRODUCT_CREATEDATE")]
public string ProductCreateDate { get; set; }//生成日期
[SugarColumn(ColumnName = "PRODUCT_SCANTIME")]
public DateTime ProductScanTime { get; set; } //扫描时间
}
}

@ -14,6 +14,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@ -39,14 +40,13 @@ namespace Aucma.Core.ProductOffLine.Business
// public OffLineBusiness(){}
#region 变量定义
public static OffLineInfo TempOffLineInfo = new OffLineInfo();
public static OffLineInfo FDOffLineInfo = new OffLineInfo();
public static TempInfo TempOffLineInfo = new TempInfo();
public static TempInfo FDOffLineInfo = new TempInfo();
// 河南工厂编码
private static string Werks = "1301";
#endregion
#region 接口引用
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness));
@ -91,110 +91,137 @@ namespace Aucma.Core.ProductOffLine.Business
public async void test()
{
BaseOrderInfo order = await _baseOrderInfoServices.FirstAsync();
Console.WriteLine(order);
//TempInfo info = new TempInfo();
//string tt = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000000807@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01";
//string[] FArrayList = tt.Split('@');
//if (FArrayList[0].ToUpper() == "Y") //查询数据成功
//{
// #region 实体赋值
// info.ProductFactoryCode = FArrayList[1];
// info.ProductSNCode = FArrayList[2];
// info.ProductOrderNo = DBToString(FArrayList[3]);
// info.ProductSaleNo = DBToString(FArrayList[4]);
// info.ProductSaleLineNo = DBToString(FArrayList[5]);
// info.ProductCheckInfo = DBToString(FArrayList[6]); //验证组合
// info.ProductCode = DBToString(FArrayList[7]);
// info.ProductName = DBToString(FArrayList[8]); //产品描述
// info.ProductType = FArrayList[9];
// info.ProductModel = FArrayList[10]; //产品型号
// info.ProductRemark = DBToString(FArrayList[11]);
// info.ProductBarNo = FArrayList[12];
// info.ProductMasterModel = FArrayList[13]; //产品主型号
// info.ProductVersion = FArrayList[14];
// info.ProductUseInfo = FArrayList[15];//产品用途
// info.ProductCirculate = FArrayList[16];//流通特性
// info.ProductCreateDate = FArrayList[17];
// #endregion
// info.ProductScanTime = System.DateTime.Now;
// info.number1 = "111";
// OffLineInfo info11 = MapperTwo(info);
// int a = await _offLineInfoServices.AddAsync(info11);
// Console.WriteLine(a);
//}
}
/// <summary>
/// 处理条码
/// </summary>
/// <param name="code"></param>
/// <param name="direction">扫码器方向</param>
private async void MaterialBarScanEvent(string code)//接收条码数据
{
//1.扫描的SN条码去条码系统校验
bool BackResult = await HandleMaterialBarCode(code.Trim()); //处理条码信息
TempOffLineInfo.ReadFlag = 0;
if (BackResult == true)
public async void MaterialBarScanEvent(string code)//接收条码数据
{
TempOffLineInfo.ProductRefreshFlag = true;
// 更新mes数据库
int a = await _offLineInfoServices.AddAsync(TempOffLineInfo);
log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo.ProductOrderNo.Replace("0000", ""), TempOffLineInfo.OrderQty));
if (a > 0)
//1.扫描的SN条码去条码系统校验
bool BackResult = await HandleMaterialBarCode(code.Trim()); //处理条码信息
TempOffLineInfo.ReadFlag = 0;
if (BackResult == true)
{
// 先查询分垛方向A或者B eg:000000009001000718
string direction = getDirectioneEvent?.Invoke(TempOffLineInfo.ProductCode.Replace("00000000", ""));
TempOffLineInfo.ProductRefreshFlag = true;
// 更新mes数据库
OffLineInfo info11 = MapperTwo(TempOffLineInfo);
int a = await _offLineInfoServices.AddAsync(info11);
log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo.ProductOrderNo.Replace("0000", ""), TempOffLineInfo.OrderQty));
if (a > 0)
{
// 先查询分垛方向A或者B eg:000000009001000718=>9001000718
string direction = getDirectioneEvent?.Invoke(TempOffLineInfo.ProductCode.Replace("00000000", ""));
// DownLoadPassFlag(BackResult); //下发plc放行信号,分垛AB库
TempOffLineInfo.ReadFlag = 1; //放行成功
// DownLoadPassFlag(BackResult); //下发plc放行信号,分垛AB库
TempOffLineInfo.ReadFlag = 1; //放行成功
}
else
{
TempOffLineInfo.ReadFlag = 2; //保存条码失败
}
}
else
{
TempOffLineInfo.ReadFlag = 2; //保存条码失败
log.Info("条码验证失败");
TempOffLineInfo.ReadFlag = 3; // 条码验证失败
}
}
else
{
log.Info("条码验证失败");
TempOffLineInfo.ReadFlag = 3; // 条码验证失败
}
}
// // 如果校验失败,下发报警
// if ("N".Equals(result.Substring(0, 1)))
//{
// sendPlcError();
// // 刷新页面提示信息 result.Substring(2)
// return false;
//}
//3.分垛A,B库逻辑(先左边读到的条码分A库右边读到的B库==>预留分库逻辑)
////4.下发plc信号
//bool flag = SendPlcPass();
//if (!flag)
//{
// log.Error("获取plc反馈失败");
// return;
//}
//Console.WriteLine(code);
//return;
//5.调条码系统保存入库接口SaveBarcodeInfo
//string saveResult = await _productOffLineServices.SaveBarcodeInfo("333", "ILS_SORT", "11111", 1);
//if (string.IsNullOrEmpty(saveResult) || "E".Equals(saveResult.Substring(0, 1)))
//{
// log.Error("条码系统保存接口出错");
// sendPlcError();
// return;
//}
////6.更新mes数据库完成数量和时间(BASE_ORDERINFO,PRODUCT_PLANINFO) 注意:查询的字段可能需要修改,确保数据一致
////6.1截取订单号去查询更新BASE_ORDERINFO,全放到service处理
//string orderCode = "11215484";
//List<BaseOrderInfo> orders = await _baseOrderInfoServices.QueryAsync(x => x.OrderCode == orderCode);
//BaseOrderInfo order = orders.FirstOrDefault();
//if (order.CompleteAmount == 0)
//{
// order.CompleteAmount++;
// order.BeginDate = DateTime.Now;
//}
//if (order.CompleteAmount == order.OrderAmount)
//{
// order.EndDate = DateTime.Now;
//}
//order.UpdatedTime = DateTime.Now;
//_baseOrderInfoServices.UpdateAsync(order);
////6.2根据订单号去更新PRODUCT_PLANINFO
//List<ProductPlanInfo> productInfos = await _productPlanInfoServices.QueryAsync(x => x.OrderCode == orderCode);
//ProductPlanInfo productInfo = productInfos.FirstOrDefault();
//if (productInfo.CompleteAmount == 0)
//{
// productInfo.CompleteAmount++;
// productInfo.BeginTime = DateTime.Now;
//}
//if (productInfo.CompleteAmount == productInfo.PlanAmount)
//{
// productInfo.EndTime = DateTime.Now;
//}
//productInfo.UpdatedTime = DateTime.Now;
//await _productPlanInfoServices.UpdateAsync(productInfo);
// // 如果校验失败,下发报警
// if ("N".Equals(result.Substring(0, 1)))
//{
// sendPlcError();
// // 刷新页面提示信息 result.Substring(2)
// return false;
//}
//3.分垛A,B库逻辑(先左边读到的条码分A库右边读到的B库==>预留分库逻辑)
////4.下发plc信号
//bool flag = SendPlcPass();
//if (!flag)
//{
// log.Error("获取plc反馈失败");
// return;
//}
//Console.WriteLine(code);
//return;
//5.调条码系统保存入库接口SaveBarcodeInfo
//string saveResult = await _productOffLineServices.SaveBarcodeInfo("333", "ILS_SORT", "11111", 1);
//if (string.IsNullOrEmpty(saveResult) || "E".Equals(saveResult.Substring(0, 1)))
//{
// log.Error("条码系统保存接口出错");
// sendPlcError();
// return;
//}
////6.更新mes数据库完成数量和时间(BASE_ORDERINFO,PRODUCT_PLANINFO) 注意:查询的字段可能需要修改,确保数据一致
////6.1截取订单号去查询更新BASE_ORDERINFO,全放到service处理
//string orderCode = "11215484";
//List<BaseOrderInfo> orders = await _baseOrderInfoServices.QueryAsync(x => x.OrderCode == orderCode);
//BaseOrderInfo order = orders.FirstOrDefault();
//if (order.CompleteAmount == 0)
//{
// order.CompleteAmount++;
// order.BeginDate = DateTime.Now;
//}
//if (order.CompleteAmount == order.OrderAmount)
//{
// order.EndDate = DateTime.Now;
//}
//order.UpdatedTime = DateTime.Now;
//_baseOrderInfoServices.UpdateAsync(order);
////6.2根据订单号去更新PRODUCT_PLANINFO
//List<ProductPlanInfo> productInfos = await _productPlanInfoServices.QueryAsync(x => x.OrderCode == orderCode);
//ProductPlanInfo productInfo = productInfos.FirstOrDefault();
//if (productInfo.CompleteAmount == 0)
//{
// productInfo.CompleteAmount++;
// productInfo.BeginTime = DateTime.Now;
//}
//if (productInfo.CompleteAmount == productInfo.PlanAmount)
//{
// productInfo.EndTime = DateTime.Now;
//}
//productInfo.UpdatedTime = DateTime.Now;
//await _productPlanInfoServices.UpdateAsync(productInfo);
/// <summary>
/// 去条码系统查询校验并保存
@ -206,9 +233,9 @@ namespace Aucma.Core.ProductOffLine.Business
try
{
TempOffLineInfo.ProductSNCode = BarCode.Trim(); //SN码
TempOffLineInfo.ProductScanTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
TempOffLineInfo.ProductScanTime = System.DateTime.Now;
TempOffLineInfo.ProductOrderNo = "";
TempOffLineInfo.ProductOrderNo = "";
log.Info("条码验证开始:" + BarCode);
//1.查询条码系统
@ -321,7 +348,9 @@ namespace Aucma.Core.ProductOffLine.Business
else
{
log.Info(BarCode + "条码重复,本地不存在,已上传中");
await _offLineInfoServices.AddAsync(TempOffLineInfo);
OffLineInfo info11 = MapperTwo(TempOffLineInfo);
await _offLineInfoServices.AddAsync(info11);
}
}
return false;
@ -519,7 +548,7 @@ namespace Aucma.Core.ProductOffLine.Business
/// </summary>
/// <param name="TempOffLineInfo"></param>
/// <returns></returns>
public bool TestBarCode(OffLineInfo TempOffLineInfo)
public bool TestBarCode(TempInfo TempOffLineInfo)
{
if (TempOffLineInfo.ProductCode.Replace("00000000", "") == "9002005518" || TempOffLineInfo.ProductCode.Replace("00000000", "") == "9002005517")
{
@ -617,6 +646,44 @@ namespace Aucma.Core.ProductOffLine.Business
return true;
}
#endregion
}
/// <summary>
/// 传入类型B的对象b将b与a相同名称的值进行赋值给创建的a中
/// </summary>
/// <typeparam name="A">类型A</typeparam>
/// <typeparam name="B">类型B</typeparam>
/// <param name="b">类型为B的参数b</param>
/// <returns>拷贝b中相同属性的值的a</returns>
public OffLineInfo MapperTwo(TempInfo b)
{
OffLineInfo a = new OffLineInfo();
try
{
a.ProductFactoryCode = b.ProductFactoryCode;
a.ProductSNCode = b.ProductSNCode;
a.ProductOrderNo = b.ProductOrderNo;
a.ProductSaleNo = b.ProductSaleNo;
a.ProductSaleLineNo = b.ProductSaleLineNo;
a.ProductCode = b.ProductCode;
a.ProductModel = b.ProductModel;
a.ProductName = b.ProductName;
a.ProductType = b.ProductType;
a.ProductCheckInfo = b.ProductCheckInfo;
a.ProductRemark = b.ProductRemark;
a.ProductBarNo = b.ProductBarNo;
a.ProductMasterModel = b.ProductMasterModel;
a.ProductVersion = b.ProductVersion;
a.ProductUseInfo = b.ProductUseInfo;
a.ProductCirculate = b.ProductCirculate;
a.ProductCreateDate = b.ProductCreateDate;
a.ProductScanTime = b.ProductScanTime;
}
catch (Exception ex)
{
return null;
}
return a;
}
#endregion
}
}

@ -0,0 +1,70 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.ProductOffLine.Models
{
/// <summary>
/// 条码下线信息记录
/// </summary>
public class TempInfo
{
public string ProductFactoryCode { get; set; } //计划工厂
public string ProductSNCode { get; set; } //公司条码
public string ProductOrderNo { get; set; }//工单号
public string ProductSaleNo { get; set; } //销售订单号
public string ProductSaleLineNo { get; set; } //销售行号
public string ProductCode { get; set; }//物料编码
public string ProductModel { get; set; }//产品型号
public string ProductName { get; set; }//物料描述
public string ProductType { get; set; }//产品类型
public string ProductCheckInfo { get; set; }//验证组合
public string ProductRemark { get; set; } //标签特征
public string ProductBarNo { get; set; }//产品条码编码
public string ProductMasterModel { get; set; }//主型号
public string ProductVersion { get; set; }//版本号
public string ProductUseInfo { get; set; }//用途位
public string ProductCirculate { get; set; }//流通特性
public string ProductCreateDate { get; set; }//生成日期
public DateTime ProductScanTime { get; set; } //扫描时间
public bool ProductRefreshFlag { get; set; }
public int ReadFlag { get; set; }
public bool ProductDataFlag { get; set; }
// 界面提示信息
public string MsgInfo { get; set; }
public bool MsgAlarmFlag { get; set; }
public int OrderQty { get; set; }
public int ActQty { get; set; }
public string oneCode { get; set; }
public string serialNumber { get; set; }
public string rfid { get; set; }
public string sim { get; set; }
public string number1 { get; set; }
public bool ChkOut { get; set; }
}
}

@ -22,16 +22,16 @@ namespace Aucma.Core.ProductOffLine.ViewModels
#region 加载DataGrid数据
private void LoadData()
{
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 2, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 60, CompleteAmount = 40 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 3, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 4, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 40, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 5, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 30, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 6, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 20 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 7, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 10, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 8, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 9, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 80, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 10, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10});
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 2, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 60, CompleteAmount = 40 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 3, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 4, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 40, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 5, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 30, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 6, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 20 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 7, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 10, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 8, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 9, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 80, CompleteAmount = 10 });
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 10, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10});
}
#endregion

@ -33,7 +33,7 @@
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}" MouseLeftButtonDown="dataGrid_MouseLeftButtonDown">
Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}" SelectionMode="Single" MouseLeftButtonDown="dataGrid_MouseLeftButtonDown">
<!-- 表头剧中-->
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">

@ -44,7 +44,7 @@
<TextBox x:Name="MaterialName" FontSize="20" Text="{Binding PlanInfo.MaterialName}" Foreground="#FFFFFF" Width="260" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="60,0,0,0" >
<!--样式-->
<!--单选框样式-->
<StackPanel.Resources>
<Style TargetType="RadioButton">
<Setter Property="Foreground" Value="White"/>

@ -19,7 +19,35 @@
<Setter Property="Height" Value="30"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<Style TargetType="RadioButton">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Grid Width="20" Height="20">
<Ellipse x:Name="BulletRadio" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
</Grid>
</BulletDecorator.Bullet>
<ContentPresenter Margin="4,0,0,0" VerticalAlignment="Center" RecognizesAccessKey="True"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="BulletRadio" Property="Fill" Value="Green"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Border Grid.Row="0" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="5">
<Grid>
@ -31,34 +59,34 @@
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="基本配置" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="基本配置" FontSize="40" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
<Grid Grid.Row="1">
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="分垛模式选择:" Margin="10 0" Foreground="White" FontSize="15" VerticalAlignment="Center"/>
<TextBlock Text="分垛模式选择:" Margin="10 0" Foreground="White" FontSize="30" VerticalAlignment="Center"/>
<!--<ComboBox Width="100" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="15" Foreground="White">
<ComboBoxItem Content="手动模式" Foreground="Blue" />
<ComboBoxItem Content="自动模式" Foreground="Blue"/>
</ComboBox>-->
<ComboBox SelectedItem="{Binding SelectedMaterialType}" Width="100" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="15" Foreground="White">
<ComboBox SelectedItem="{Binding SelectedMaterialType}" Width="200" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="30" Foreground="White">
<ComboBoxItem Content="自动模式" Foreground="Blue"/>
<ComboBoxItem Content="手动模式" Foreground="Blue" />
</ComboBox>
<Border Margin="100 0 0 0">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="手动方向设置:" Foreground="White" FontSize="15" VerticalAlignment="Center"/>
<RadioButton Content="A" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" />
<RadioButton Content="B" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
<TextBlock Text="手动方向设置: " Foreground="White" FontSize="30" VerticalAlignment="Center"/>
<RadioButton Content="A" FontSize="30" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" />
<RadioButton Content="B" FontSize="30" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
</WrapPanel>
</Border>
<Button Content="自动方向设置" Command="{Binding AutoDirectionCommand}" Margin="100,0,0,0" Background="Blue" Foreground="White"/>
<Button Content="质检项设置" Command="{Binding SelectQualityCommand}" Margin="50,0,0,0" Background="Blue" Foreground="White" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Button Content="自动方向设置" Command="{Binding AutoDirectionCommand}" FontSize="25" Margin="100,0,0,0" Background="Blue" Foreground="White" Height="50"/>
<Button Content="质检项设置" Command="{Binding SelectQualityCommand}" FontSize="25" Margin="50,0,0,0" Background="Blue" Foreground="White" Height="50"/>
</WrapPanel>
</Grid>
<Grid Grid.Row="2">
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,1,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="质检数据" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="质检数据" FontSize="40" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
<Grid Grid.Row="3">

Loading…
Cancel
Save