liulb@mesnac.com 1 year ago
parent 806c0c01c2
commit a8c45c773b

@ -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>

@ -7,9 +7,21 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="Views\InventoryStatisticsPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\LogPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\MaterialStatisticsView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\QuantityIssuedView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\SearchCriteriaView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\SplitPlanView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@ -24,12 +36,24 @@
<Page Update="Views\IndexPage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\InventoryStatisticsPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\LogPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\MainWindow.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\MaterialStatisticsView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\QuantityIssuedView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\SearchCriteriaView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\SplitPlanView.xaml">
<SubType>Designer</SubType>
</Page>

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Common
{
public class AppConfigHelper
{
private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/App.InI");
//private static readonly AppConfigHelper lazy = new AppConfigHelper();
//public static AppConfigHelper Instance
//{
// get
// {
// return lazy;
// }
//}
public AppConfigHelper()
{
}
public string searchItems
{
get { return iniHelper.IniReadValue("system", "searchItems"); }
set { iniHelper.IniWriteValue("system", "searchItems", value); }
}
}
}

@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Common
{
public class IniHelper
{
public string path;
public IniHelper(string INIPath)
{
path = INIPath;
}
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string defVal, Byte[] retVal, int size, string filePath);
[DllImport("kernel32", EntryPoint = "GetPrivateProfileString")]
private static extern uint GetPrivateProfileStringA(string section, string key, string def, Byte[] retVal, int size, string filePath);
/// <summary>
/// 写INI文件
/// </summary>
/// <param name="Section"></param>
/// <param name="Key"></param>
/// <param name="Value"></param>
public void IniWriteValue(string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, this.path);
}
/// <summary>
/// 读取INI文件
/// </summary>
/// <param name="Section"></param>
/// <param name="Key"></param>
/// <returns></returns>
public string IniReadValue(string Section, string Key)
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, "", temp, 255, this.path);
//return temp.ToString();
string str = temp.ToString();
return str;
}
public byte[] IniReadValues(string section, string key)
{
byte[] temp = new byte[255];
int i = GetPrivateProfileString(section, key, "", temp, 255, this.path);
return temp;
}
/// <summary>
/// 删除ini文件下所有段落
/// </summary>
public void ClearAllSection()
{
IniWriteValue(null, null, null);
}
/// <summary>
/// 删除ini文件下personal段落下的所有键
/// </summary>
/// <param name="Section"></param>
public void ClearSection(string Section)
{
IniWriteValue(Section, null, null);
}
public List<string> ReadKeys(String SectionName)
{
return ReadKeys(SectionName, this.path);
}
public List<string> ReadKeys(string SectionName, string iniFilename)
{
List<string> result = new List<string>();
Byte[] buf = new Byte[65536];
uint len = GetPrivateProfileStringA(SectionName, null, null, buf, buf.Length, iniFilename);
int j = 0;
for (int i = 0; i < len; i++)
if (buf[i] == 0)
{
result.Add(Encoding.Default.GetString(buf, j, i - j));
j = i + 1;
}
return result;
}
}
}

@ -1,57 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Common
{
/// <summary>
/// 窗口管理器
/// </summary>
public class WindowManager
{
static Dictionary<string, WindowStruct> _regWindowContainer = new Dictionary<string, WindowStruct>();
/// <summary>
/// 注册类型
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name"></param>
/// <param name="owner"></param>
public static void Register<T>(string name, System.Windows.Window owner = null)
{
if (!_regWindowContainer.ContainsKey(name))
{
_regWindowContainer.Add(name, new WindowStruct { WindowType = typeof(T), Owner = owner });
}
}
/// <summary>
/// 获取对象
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name"></param>
/// <param name="dataContext"></param>
/// <returns></returns>
public static bool ShowDialog<T>(string name, T dataContext)
{
if (_regWindowContainer.ContainsKey(name))
{
Type type = _regWindowContainer[name].WindowType;
//反射创建窗体对象
var window = (System.Windows.Window)Activator.CreateInstance(type);
window.Owner = _regWindowContainer[name].Owner;
window.DataContext = dataContext;
return window.ShowDialog() == true;
}
return false;
}
}
public class WindowStruct
{
public Type WindowType { get; set; }
public System.Windows.Window Owner { get; set; }
}
}

@ -9,7 +9,7 @@ namespace Aucma.Core.SheetMetal.Models
/// <summary>
/// 计划维护表
/// </summary>
public class PlanMaintenanceModel
public class ProductPlanInfoModel
{
/// <summary>
/// 序号

@ -6,8 +6,12 @@ using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Models
{
public class TaskExecModel
public class TaskExecModel
{
/// <summary>
/// 主键
/// </summary>
public int No { get; set; }
/// <summary>
/// 主键
/// </summary>

@ -20,6 +20,7 @@ using Admin.Core.Model;
using System.Windows.Media;
using log4net;
using Admin.Core.Common;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
/*
*
*
@ -126,9 +127,11 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
var list= await _taskExecutionServices.QueryAsync(d=>d.ProductLineCode.Contains("1001"));
var execList= list.OrderBy(d=>d.ExecuteOrder);
int i = 1;
foreach (var item in execList)
{
TaskExecModel task=new TaskExecModel();
task.No = i;
task.ID = item.ObjId.ToString();
task.OrderCode = item.OrderCode;
task.MaterialCode = item.MaterialCode;
@ -138,6 +141,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
task.BeginTime = item.BeginTime;
task.IsExec = item.ExecuteStatus;
PlanInfoDataGrid.Add(task);
i++;
}
}
@ -259,6 +263,18 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
#region 物料库存
/// <summary>
/// 物料库存
/// </summary>
[RelayCommand]
private void InventoryStatistics()
{
MaterialStatisticsView model = new MaterialStatisticsView();
model.ShowDialog();
}
#endregion
#endregion
#region 执行计划
@ -282,15 +298,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 计划编号
private string _planCode;
public string PlanCode
private string _mesMOrderCode;
public string MesMOrderCode
{
get => _planCode;
set => SetProperty(ref _planCode, value);
get => _mesMOrderCode;
set => SetProperty(ref _mesMOrderCode, value);
}
#endregion
#region 品型号
#region 品型号
private string _productModel;
public string ProductModel
{
@ -439,7 +455,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
PlanMaxNum = info.PlanAmount;
OrderCode = info.OrderCode;
PlanCode = info.ProductPlanCode;
MesMOrderCode = info.ProductPlanCode;
ProductModel = info.MaterialName;
BeginTime = info.BeginTime.ToString();

@ -0,0 +1,14 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.ViewModels
{
public class InventoryStatisticsPageViewModel : ObservableObject
{
}
}

@ -0,0 +1,135 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Service;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class MaterialStatisticsViewModel : ObservableObject
{
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
public MaterialStatisticsViewModel()
{
_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
Refresh();
}
#region 刷新
[RelayCommand]
private async void Refresh()
{
string shellStoreCode = Appsettings.app("StoreInfo", "shellStoreCode");
string linerStoreCode = Appsettings.app("StoreInfo", "linerStoreCode");
string foamBeforeStoreCode = Appsettings.app("StoreInfo", "foamBeforeStoreCode");
//箱壳物料库存
ShellMaterialStockDataGrid = new ObservableCollection<BaseSpaceInfo>();
List<BaseSpaceInfo> shellList =await _baseSpaceInfoServices.GetSpaceInfosByStoreCode(shellStoreCode);
shellList.OrderBy(x => x.ObjId);
var shellResult = from m in shellList
group m by m.MaterialType into g
select new BaseSpaceInfo()
{
MaterialType = g.Key,
SpaceStock = g.Sum(m => m.SpaceStock)
};
foreach (var item in shellResult)
{
if (string.IsNullOrEmpty(item.MaterialType)) continue;
ShellMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = item.MaterialType, SpaceStock = item.SpaceStock });
}
//内胆物料库存
LinerMaterialStockDataGrid = new ObservableCollection<BaseSpaceInfo>();
List<BaseSpaceInfo> linerList =await _baseSpaceInfoServices.GetSpaceInfosByStoreCode(linerStoreCode);
var linerResult = from m in linerList
group m by m.MaterialType into g
select new BaseSpaceInfo()
{
MaterialType = g.Key,
SpaceStock = g.Sum(m => m.SpaceStock)
};
foreach (var item in linerResult)
{
if (string.IsNullOrEmpty(item.MaterialType)) continue;
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = item.MaterialType, SpaceStock = item.SpaceStock });
}
//泡前库物料库存
FoamBeforeMaterialStockDataGrid = new ObservableCollection<BaseSpaceInfo>();
List<BaseSpaceInfo> foamBeforeList =await _baseSpaceInfoServices.GetSpaceInfosByStoreCode(foamBeforeStoreCode);
var foamBeforeResult = from m in foamBeforeList
group m by m.MaterialType into g
select new BaseSpaceInfo()
{
MaterialType = g.Key,
SpaceStock = g.Sum(m => m.SpaceStock)
};
foreach (var item in foamBeforeResult)
{
if (string.IsNullOrEmpty(item.MaterialType)) continue;
FoamBeforeMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = item.MaterialType, SpaceStock = item.SpaceStock });
}
}
#endregion
#region 关闭窗口
[RelayCommand]
private void CloseWindow(object parameter)
{
var window = parameter as Window;
if (window != null)
{
window.Close();
}
}
#endregion
#region 参数定义
/// <summary>
/// 箱壳物料库存DataGrid
/// </summary>
private ObservableCollection<BaseSpaceInfo> shellMaterialStockDataGrid;
public ObservableCollection<BaseSpaceInfo> ShellMaterialStockDataGrid
{
get => shellMaterialStockDataGrid;
set => SetProperty(ref shellMaterialStockDataGrid, value);
}
/// <summary>
/// 内胆物料库存DataGrid
/// </summary>
private ObservableCollection<BaseSpaceInfo> linerMaterialStockDataGrid;
public ObservableCollection<BaseSpaceInfo> LinerMaterialStockDataGrid
{
get => linerMaterialStockDataGrid;
set => SetProperty(ref linerMaterialStockDataGrid, value);
}
/// <summary>
/// 泡前库物料库存DataGrid
/// </summary>
private ObservableCollection<BaseSpaceInfo> foamBeforeMaterialStockDataGrid;
public ObservableCollection<BaseSpaceInfo> FoamBeforeMaterialStockDataGrid
{
get => foamBeforeMaterialStockDataGrid;
set => SetProperty(ref foamBeforeMaterialStockDataGrid, value);
}
#endregion
}
}

@ -0,0 +1,115 @@
using Admin.Core.Model;
using Aucma.Core.SheetMetal.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class QuantityIssuedViewModel : ObservableObject
{
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo) {
PlanInfo = productPlanInfo;
}
private ProductPlanInfoModel _PlanInfo = new ProductPlanInfoModel();
public ProductPlanInfoModel PlanInfo
{
get => _PlanInfo;
set => SetProperty(ref _PlanInfo, value);
}
private string _TransmitAmount = string.Empty;
public string TransmitAmount
{
get => _TransmitAmount;
set => SetProperty(ref _TransmitAmount, value);
}
[RelayCommand]
private void PlanInfoTransmit()
{
var productPlanInfo = _PlanInfo;
//if (productPlanInfo != null)
//{
// var materialType = productPlanInfo.MaterialCode;
// 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)
//{
// if (!shellResult)
// {
// MessageBox.Show("计划下达失败,箱壳物料库存不足");
// return;
// }
// else if (!linerResult)
// {
// MessageBox.Show("计划下达失败,内胆物料库存不足");
// return;
// }
//}
//}
//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);
//}
}
[RelayCommand]
private void ClearTransmitAmount()
{
string amount = _TransmitAmount.ToString();
if (amount.Length > 0)
{
TransmitAmount = amount.Substring(0, amount.Length - 1);
}
}
[RelayCommand]
private void KeypadButton(object obj)
{
var info = obj as string;
TransmitAmount += info;
}
[RelayCommand]
private void CloseWindow(object parameter)
{
var window = parameter as Window;
if (window != null)
{
window.Close();
}
}
}
}

@ -0,0 +1,77 @@
using Aucma.Core.SheetMetal.Common;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class SearchCriteriaViewModel : ObservableObject
{
private AppConfigHelper appConfig =new AppConfigHelper();
public SearchCriteriaViewModel()
{
}
#region 关闭当前页
[RelayCommand]
private void CloseWindow(object parameter)
{
var window = parameter as Window;
if (window != null)
{
window.Close();
}
}
#endregion
#region 保存数据
[RelayCommand]
private void SaveSearchCriteria()
{
var info = _configurations.ToList();
string items = string.Empty;
foreach (var configuration in info)
{
items += configuration.ToString() + "%";
}
appConfig.searchItems = string.Empty;
appConfig.searchItems = items;
Init();
}
#endregion
#region MyRegion
private ObservableCollection<string> _configurations = new ObservableCollection<string>();
public ObservableCollection<string> Configurations
{
get => _configurations;
set => SetProperty(ref _configurations, value);
}
#endregion
#region 初始化
private void Init()
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
var split = searchItems.Split('%');
foreach (var item in split)
{
Configurations.Add(item);
}
}
#endregion
}
}

@ -18,6 +18,9 @@ using Admin.Core.Model.Model_New;
using Admin.Core.Common;
using CommunityToolkit.Mvvm.Messaging;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using MaterialDesignColors;
using Aucma.Core.SheetMetal.Views;
using Aucma.Core.SheetMetal.Common;
namespace Aucma.Core.SheetMetal.ViewModels
{
@ -27,6 +30,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
protected readonly IProductPlanInfoServices? _productPlanInfoServices;
//protected readonly ISmTaskExecutionServices? _smTaskExecutionServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
private AppConfigHelper appConfig = new AppConfigHelper();
public SplitPlanViewModel()
{
@ -48,7 +52,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
int residue = 0;
if (execList == null) residue = 0;
else residue = (execList.Where(d => d.MaterialCode.Equals(item.MaterialCode))).Sum(d => d.PlanAmount);
MaterialDataGrid.Add(new PlanMaintenanceModel()
MaterialDataGrid.Add(new ProductPlanInfoModel()
{
No = i,
PlanCode= item.PlanCode,
@ -75,7 +79,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
int residue = 0;
if (execList == null) residue = 0;
else residue = (execList.Where(d => d.MaterialCode.Equals(item.MaterialCode))).Sum(d => d.PlanAmount);
MaterialDataGrid.Add(new PlanMaintenanceModel()
MaterialDataGrid.Add(new ProductPlanInfoModel()
{
No = i,
PlanCode = item.PlanCode,
@ -93,15 +97,11 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 初始化datagrid
private ObservableCollection<PlanMaintenanceModel> materialDataGrid = new ObservableCollection<PlanMaintenanceModel>();
public ObservableCollection<PlanMaintenanceModel> MaterialDataGrid
private ObservableCollection<ProductPlanInfoModel> materialDataGrid = new ObservableCollection<ProductPlanInfoModel>();
public ObservableCollection<ProductPlanInfoModel> MaterialDataGrid
{
get { return materialDataGrid; }
set
{
materialDataGrid = value;
OnPropertyChanged();//属性通知
}
get => materialDataGrid;
set => SetProperty(ref materialDataGrid, value);
}
#endregion
@ -177,8 +177,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 获取当前行数据 赋值到textbox
private PlanMaintenanceModel selectedCells;
public PlanMaintenanceModel SelectedCells
private ProductPlanInfoModel selectedCells;
public ProductPlanInfoModel SelectedCells
{
get { return selectedCells; }
set
@ -196,7 +196,111 @@ namespace Aucma.Core.SheetMetal.ViewModels
public void CloseWindow()
{
WeakReferenceMessenger.Default.Send<object>("close");
}
}
#endregion
#region 参数定义
private string _search = string.Empty;
public string Search
{
get => _search;
set => SetProperty(ref _search, value);
}
/// <summary>
/// 下拉框
/// </summary>
public string _materialTypeCombox;
public string MaterialTypeCombox
{
get => _materialTypeCombox;
set => SetProperty(ref _materialTypeCombox, value);
}
private ObservableCollection<string> _configurations = new ObservableCollection<string>();
public ObservableCollection<string> Configurations
{
get => _configurations;
set => SetProperty(ref _configurations, value);
}
private ProductPlanInfoModel selectedDataItem;
public ProductPlanInfoModel SelectedDataItem
{
get => selectedDataItem;
set => SetProperty(ref selectedDataItem, value);
}
#endregion
#region 重置
/// <summary>
/// 重置
/// </summary>
[RelayCommand]
public void Reset()
{
LoadData();
Search = string.Empty;
MaterialTypeCombox = string.Empty;
this.LoadData();
}
#endregion
#region 搜索条件设置
/// <summary>
/// 搜索条件设置
/// </summary>
[RelayCommand]
public void SearchCriteriaSet()
{
SearchCriteriaView searchCriteriaWindow = new SearchCriteriaView();
bool? dialogResult = searchCriteriaWindow.ShowDialog();
if (dialogResult == false) // 用户点击了“取消”按钮或关闭窗口
{
LoadData();
}
}
#endregion
private void SaveSearchCriteria()
{
var info = _configurations.ToList();
string items = string.Empty;
foreach (var configuration in info)
{
items += configuration.ToString() + "%";
}
appConfig.searchItems = string.Empty;
appConfig.searchItems = items;
Init();
}
private void Init()
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
var split = searchItems.Split('%');
foreach (var item in split)
{
Configurations.Add(item);
}
}
public void MouseClick(object obj)
{
var info = SelectedDataItem as ProductPlanInfoModel;
if (info != null)
{
QuantityIssuedView quantityIssuedWindow = new QuantityIssuedView(info);
quantityIssuedWindow.ShowDialog();
}
}
}
}

@ -29,17 +29,20 @@ namespace Aucma.Core.SheetMetal.ViewModels
private async void LoadData()
{
var list = (await _productPlanInfoServices.QueryAsync(d=>d.ProductLineCode=="1001")).Take(1000);
int i = 1;
foreach (var item in list)
{
MaterialDataGrid.Add(new MaterialComplateInfo() {
ProductPlanCode = item.PlanCode,
MaterialDataGrid.Add(new MaterialComplateInfo() {
No = i,
ProductPlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
PlanAmount = item.PlanAmount,
PlanAmount = item.PlanAmount,
CompleteAmount = item.CompleteAmount,
BeginTime = item.BeginTime.ToString(),
EndTime = item.EndTime.ToString(),
});
});
i++;
}
}

@ -5,12 +5,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d"
mc:Ignorable="d" Background="#1152AC" FontFamily="Microsoft YaHei"
d:DesignHeight="800"
d:DesignWidth="1000" >
d:DesignWidth="1500" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="DataGrid">
@ -38,9 +39,9 @@
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="BorderBrush" Value="#4285DE" />
<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>
@ -49,9 +50,9 @@
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="BorderBrush" Value="#4285DE" />
<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}">
@ -64,86 +65,11 @@
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="#dddddd"/>
<!--<Setter Property="Foreground" Value="#dddddd"/>-->
</Trigger>
</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="0,15 0 0">
@ -196,29 +122,29 @@
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="工位名称" FontSize="15" Foreground="White" />
<TextBox FontSize="15" Text="{Binding StationName}" Foreground="White" BorderBrush="White" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
<TextBlock Text="工位名称" FontSize="18" Foreground="White" />
<TextBox FontSize="18" Text="{Binding StationName}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,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"/>
<TextBox FontSize="15" Text="{Binding OrderCode}" Foreground="White" BorderBrush="White" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
<TextBlock Text="订单编号" FontSize="18" Foreground="White"/>
<TextBox FontSize="18" Text="{Binding OrderCode}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,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"/>
<TextBox FontSize="15" Text="{Binding PlanCode}" Foreground="White" BorderBrush="White" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
<TextBlock Text="MES工单编号" FontSize="18" Foreground="White"/>
<TextBox FontSize="18" Text="{Binding MesMOrderCode}" Foreground="White" BorderBrush="White" Width="300" 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 ProductModel}" Foreground="White" BorderBrush="White" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
<TextBlock Text="成品型号" FontSize="18" Foreground="White"/>
<TextBox FontSize="18" Text="{Binding ProductModel}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="开始时间" FontSize="15" Foreground="White"/>
<TextBox FontSize="15" Text="{Binding BeginTime}" Foreground="White" BorderBrush="White" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
<TextBlock Text="开始时间" FontSize="18" Foreground="White"/>
<TextBox FontSize="18" Text="{Binding BeginTime}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
</Grid>
</Border>
@ -241,7 +167,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="计划数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="订单数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}"
@ -258,7 +184,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="实际数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="生产数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge GaugeBackground="Green" Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}"
@ -292,7 +218,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="完成率" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="订单完成率" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge GaugeBackground="Orange" Margin="5" Uses360Mode="True" From="0" To="100"
@ -349,7 +275,7 @@
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="3,3,3,3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
@ -372,29 +298,27 @@
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
SelectionMode="Single" IsReadOnly="True"
SelectionMode="Single" IsReadOnly="True"
Foreground="White">
<DataGrid.Columns >
<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 PlanCode}" Header="计划编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<!--<DataGridTextColumn Binding="{Binding IsExec}" x:Name="ExecControl" Header="执行" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />-->
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="3.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="3.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划类型" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.7*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTemplateColumn Header="操作" Width="5*" >
<DataGridTemplateColumn Header="操作" Width="3*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<WrapPanel>
<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" Command="{Binding DataContext.NextPassCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下后板" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.NextPassCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下箱壳" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.NextPassCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
<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 }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@ -404,12 +328,13 @@
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0">
<TextBlock Text="执行方式" VerticalAlignment="Center" Foreground="White" FontSize="15" Margin="20,0,0,0"/>
<ComboBox Text="{Binding MaterialTypeCombox}" Width="200" Height="25" Margin="10 0 0 0" VerticalAlignment="Center" FontSize="15">
<TextBlock Text="执行方式" VerticalAlignment="Center" Foreground="White" FontSize="18" Margin="20,0,0,0"/>
<ComboBox Text="{Binding MaterialTypeCombox}" Width="200" Height="30" Margin="10 0 0 0" Style="{x:Null}" Background="#1152AC" VerticalAlignment="Center" FontSize="15" BorderBrush="#1152AC">
<ComboBoxItem Content="手动" IsSelected="True"/>
<ComboBoxItem Content="自动" />
</ComboBox>
<Button Content="计划维护" Command="{Binding SplitPlanCommand}" Margin="20,0,0,0" BorderBrush="DeepSkyBlue" BorderThickness="1" />
<Button Content="计划维护" Command="{Binding SplitPlanCommand}" Margin="20,0,0,0" BorderThickness="1" />
<Button Content="物料库存" Command="{Binding InventoryStatisticsCommand}" Margin="20,0,0,0" BorderThickness="1" />
</StackPanel>
</Border>
</Grid>

@ -0,0 +1,12 @@
<UserControl x:Class="Aucma.Core.SheetMetal.Views.InventoryStatisticsPageView"
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:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.SheetMetal.ViewModels;
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.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.SheetMetal.Views
{
/// <summary>
/// InventoryStatisticsPageView.xaml 的交互逻辑
/// </summary>
public partial class InventoryStatisticsPageView : UserControl
{
public InventoryStatisticsPageView()
{
InitializeComponent();
this.DataContext = new InventoryStatisticsPageViewModel();
}
}
}

@ -14,7 +14,7 @@
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,5,5" >
<TextBlock Text="系统日志" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="设备监控" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,10">

@ -7,8 +7,8 @@
mc:Ignorable="d"
Title="澳柯玛生产控制系统" Icon="/Assets/images/Icon.png"
d:DesignHeight="800"
d:DesignWidth="1000"
MinHeight="1080" MinWidth="1800" WindowState="Maximized" WindowStyle="None"
d:DesignWidth="1500" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1800" WindowState="Normal"
WindowStartupLocation="CenterScreen" >
<Window.Background>
<ImageBrush ImageSource="/Assets/images/background.jpg" />
@ -32,7 +32,7 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="澳柯玛钣金控制系统" FontSize="45" Foreground="White" FontWeight="Bold"/>
<TextBlock Text="箱壳前后板生产控制系统" FontSize="45" Foreground="White" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
@ -55,44 +55,43 @@
<ContentControl Content="{Binding UserContent}"/>
</Border>
<DockPanel Grid.Row="2" Margin="5 0 5 3">
<DockPanel Grid.Row="2" Margin="5 0 0 3">
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="2*" />
</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="LogPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=LogPage}" />
<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"/>
<StackPanel Grid.Row="1" Height="60" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="计划下发" x:Name="FirstPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" />
<Button Content="设备监控" x:Name="LogPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=LogPage}" />
<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" 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">
<StackPanel Grid.Row="2" Height="50" Margin="5 0" Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock x:Name="BeforPLcState" 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"/>
<ImageBrush x:Name="BeforPLcStateColor" 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="AfterPlcState" Text="后板PLC" 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"/>
<ImageBrush x:Name="AfterPlcStateColor" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="DB" Text="数据库连接成功" VerticalAlignment="Center" Foreground="white" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<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="BarCodeStatus" ImageSource="/Assets/Images/Green.png"/>
<ImageBrush x:Name="PlcStatusImage" 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>

@ -0,0 +1,199 @@
<Window x:Class="Aucma.Core.SheetMetal.Views.MaterialStatisticsView"
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.SheetMetal.Views"
mc:Ignorable="d" Background="#1152AC"
Title="物料库存统计" Height="650" Width="1000" Name="window" WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" Topmost="True">
<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="18"/>
<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>
<Border Margin="5" CornerRadius="10" BorderBrush="#0288d1" >
<Border.Effect>
<DropShadowEffect ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition Height="12*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="箱 壳 库 库 存" Foreground="#FFFFFF" FontSize="18"/>
</StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding ShellMaterialStockDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding materialType}" Header="物料型号" Width="1*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding spaceStock}" Header="在库数量" Width="1*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
<Border Grid.Row="0" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="内 胆 库 库 存" Foreground="#FFFFFF" FontSize="18"/>
</StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding LinerMaterialStockDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding materialType}" Header="物料型号" Width="1*" IsReadOnly="True"/>
<!--<DataGridTextColumn Binding="{Binding executePlanCode}" Header="物料编码" Width="1*" IsReadOnly="True"/>-->
<DataGridTextColumn Binding="{Binding spaceStock}" Header="在库数量" Width="1*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="泡 前 库 库 存" Foreground="#FFFFFF" FontSize="18"/>
</StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding FoamBeforeMaterialStockDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding materialType}" Header="物料型号" Width="1*" IsReadOnly="True"/>
<!--<DataGridTextColumn Binding="{Binding executePlanCode}" Header="物料编码" Width="1*" IsReadOnly="True"/>-->
<DataGridTextColumn Binding="{Binding spaceStock}" Header="在库数量" Width="1*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="发 泡 夹 具 状 态" Foreground="#FFFFFF" FontSize="18"/>
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="2" Grid.Column="1" BorderBrush="#1254AB" BorderThickness="2">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0">
<Button Content="刷 新" Command="{Binding RefreshCommand}" Background="#007DFA" BorderBrush="#007DFA" Width="100" Height="30" Margin="20,0,0,0"/>
<Button Content="取 消" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF9900" Foreground="white" Margin="20,0,50,0" Height="30" BorderBrush="#FF9900" Width="100" />
</StackPanel>
</Border>
</Grid>
</Border>
</Window>

@ -0,0 +1,29 @@
using Aucma.Core.SheetMetal.ViewModels;
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.SheetMetal.Views
{
/// <summary>
/// MaterialStatisticsView.xaml 的交互逻辑
/// </summary>
public partial class MaterialStatisticsView : Window
{
public MaterialStatisticsView()
{
InitializeComponent();
this.DataContext = new MaterialStatisticsViewModel();
}
}
}

@ -0,0 +1,104 @@
<Window x:Class="Aucma.Core.SheetMetal.Views.QuantityIssuedView"
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.SheetMetal.Views"
mc:Ignorable="d" Background="#1152AC"
Title="下达数量" Height="500" Width="700" Name="window"
ResizeMode="NoResize" Topmost="True">
<Border Margin="5" BorderBrush="#0288d1" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="#0288d1" BorderThickness="3" CornerRadius="5" Background="Transparent" Margin="5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="计划编号" FontSize="18" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="planCode" FontSize="18" Text="{Binding PlanInfo.PlanCode}" Foreground="#FFFFFF" BorderBrush="White" Width="150" IsReadOnly="True" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="工单编号" FontSize="18" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="orderCode" FontSize="18" Text="{Binding PlanInfo.OrderCode}" Foreground="#FFFFFF" BorderBrush="White" Width="150" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="产品型号" FontSize="18" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="materialCode" FontSize="18" Text="{Binding PlanInfo.MaterialName}" Foreground="#FFFFFF" BorderBrush="White" Width="150" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="计划数量" FontSize="18" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox FontSize="18" Text="{Binding PlanInfo.PlanAmount}" Foreground="#FFFFFF" BorderBrush="White" Width="150" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="完成数量" FontSize="18" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox FontSize="18" Text="{Binding PlanInfo.CompleteAmount}" Foreground="#FFFFFF" BorderBrush="White" Width="150" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
</Grid>
</Border>
<Border Grid.Column="1" BorderBrush="#0288d1" BorderThickness="3" CornerRadius="5" Background="Transparent" Margin="5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="9*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="下达数量" FontSize="18" Foreground="#FFFFFF" Margin="10,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="TransmitAmount" FontSize="18" Text="{Binding TransmitAmount}" Foreground="#FFFFFF" BorderBrush="White" Width="150" Height="40" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<Border Grid.Row="1" BorderBrush="Black" BorderThickness="0" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Content="1" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100"/>
<Button Grid.Row="0" Grid.Column="1" Content="2" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="0" Grid.Column="2" Content="3" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="1" Grid.Column="0" Content="4" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="1" Grid.Column="1" Content="5" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="1" Grid.Column="2" Content="6" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="2" Grid.Column="0" Content="7" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="2" Grid.Column="1" Content="8" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="2" Grid.Column="2" Content="9" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="3" Grid.Column="0" Content="0" FontSize="18" Margin="2,2" Command="{Binding KeypadButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Height="70" Width="100" />
<Button Grid.Row="3" Grid.Column="2" Content="清除" FontSize="15" Margin="2,2" Background="#FF9900" Foreground="white" BorderBrush="#FF9900" Command="{Binding ClearTransmitAmountCommand}" Height="70" Width="100" />
</Grid>
</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" />
</StackPanel>
</Grid>
</Border>
</Grid>
</Border>
</Window>

@ -0,0 +1,38 @@
using Admin.Core.Model;
using Aucma.Core.SheetMetal.Models;
using Aucma.Core.SheetMetal.ViewModels;
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.SheetMetal.Views
{
/// <summary>
/// QuantityIssuedView.xaml 的交互逻辑
/// </summary>
public partial class QuantityIssuedView : Window
{
private QuantityIssuedViewModel viewModel = null;
public QuantityIssuedView()
{
InitializeComponent();
}
public QuantityIssuedView(ProductPlanInfoModel productPlanInfo)
{
InitializeComponent();
this.DataContext = new QuantityIssuedViewModel(productPlanInfo);
}
}
}

@ -0,0 +1,107 @@
<Window x:Class="Aucma.Core.SheetMetal.Views.SearchCriteriaView"
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.SheetMetal.Views"
mc:Ignorable="d"
Title="搜索条件配置" Name="window"
Background="#1152AC" Height="350" Width="600" WindowStartupLocation="CenterScreen"
d:DesignHeight="350"
d:DesignWidth="600"
ResizeMode="NoResize" Topmost="True">
<Window.Resources>
<Style x:Key="CustomTextBoxStyle" TargetType="TextBox">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#CCCCCC" />
<Setter Property="Background" Value="#F2F2F2" />
<Setter Property="Padding" Value="5" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="#333333" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="5" />
<Setter Property="MinWidth" Value="120" />
<Setter Property="MinHeight" Value="30" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border Margin="5" Background="#1254AB" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<!--<ItemsControl x:Name="YourItemsControl" ItemsSource="{Binding Configurations}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox x:Name="YourTextBoxName" Style="{StaticResource CustomTextBoxStyle}" Text="{Binding Path=. , Mode=TwoWay ,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
<TextBox Text="{Binding Configurations[0], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[1], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[2], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[3], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[4], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
<TextBox Text="{Binding Configurations[5], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[6], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[7], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[8], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
<TextBox Text="{Binding Configurations[9], Mode=TwoWay}" FontSize="18" BorderBrush="#FFFFFF" Foreground="#FFFFFF" Height="30px" Width="100px" Margin="10,0,0,0"/>
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2" Margin="5">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10 0">
<Button Content="保 存" Command="{Binding SaveSearchCriteriaCommand}" CommandParameter="{Binding ElementName=window}" Margin="5 0" />
<Button Content="取 消" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF9900" BorderBrush="#FF9900" Margin="5 0" />
</StackPanel>
</Border>
</Grid>
</Border>
</Window>

@ -0,0 +1,29 @@
using Aucma.Core.SheetMetal.ViewModels;
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.SheetMetal.Views
{
/// <summary>
/// SearchCriteriaView.xaml 的交互逻辑
/// </summary>
public partial class SearchCriteriaView : Window
{
public SearchCriteriaView()
{
InitializeComponent();
this.DataContext = new SearchCriteriaViewModel();
}
}
}

@ -1,18 +1,19 @@
<Window
<Window x:Class="Aucma.Core.SheetMetal.Views.SplitPlanView"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
x:Class="Aucma.Core.SheetMetal.Views.SplitPlanView"
mc:Ignorable="d"
Background="#1152AC"
Title="计划维护" MinHeight="600" MinWidth="1000">
Title="计划维护" FontFamily="Microsoft YaHei" Height="700" Width="900"
d:DesignHeight="800" WindowStartupLocation="CenterScreen"
d:DesignWidth="1500" ResizeMode="NoResize" Topmost="True" >
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="18"/>
</Style>
<Style TargetType="DataGrid">
@ -42,7 +43,7 @@
<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>
@ -148,7 +149,6 @@
</Style>
</Window.Resources>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
<Grid>
<Grid.RowDefinitions>
@ -158,89 +158,81 @@
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Margin="1,1,5,5" >
<TextBlock Text="计划维护" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="1,1,5,5">
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="1,0,5,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Margin="5" >
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5" VerticalAlignment="Center">
<Label Content="工单编号" VerticalAlignment="Center" Foreground="White" FontSize="18" />
<TextBox x:Name="queryParam" Text="{Binding Search,Mode=TwoWay}" Style="{x:Null}" Width="300" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="10 0 5 0"/>
<Button Content="查 询" Command="{Binding QueryPlanCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" Margin="5 0" />
<Button Content="重 置" Command="{Binding ResetCommand}" Margin="5 0" />
<Button Content="配 置" Command="{Binding SearchCriteriaSetCommand}" Margin="5 0" />
</WrapPanel>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition />
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5">
<Label Content="查询条件" Width="60" VerticalAlignment="Center" Foreground="White" />
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" Width="200" HorizontalAlignment="Left" VerticalContentAlignment="Center" />
<Button Content="查询" Margin="9,0,4,0" Width="100" Command="{Binding QueryPlanCommand}" CommandParameter="{Binding Text, ElementName=queryParam}"/>
</WrapPanel>
<UniformGrid Grid.Row="1">
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Background="#00000000"
ColumnHeaderHeight="35" x:Name="dgvMH"
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0 0 0 1">
<WrapPanel VerticalAlignment="Center" Margin="10 0">
<TextBlock Text="产品型号" VerticalAlignment="Center" Foreground="#FFFFFF" FontSize="18"/>
<ItemsControl ItemsSource="{Binding Configurations}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton
Content="{Binding}"
Command="{Binding DataContext.RadioButtonCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
GroupName="MaterialTypeRadioButton"
Margin="20,10" FontSize="15" Foreground="#FFFFFF"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</WrapPanel>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0">
<WrapPanel Grid.Row="1" VerticalAlignment="Center" Margin="10 0">
<TextBlock Text="执行类型" VerticalAlignment="Center" Foreground="#FFFFFF" FontSize="18"/>
<RadioButton Content="前后板联动" Height="60" VerticalAlignment="Center" IsChecked="True" BorderBrush="White" Foreground="White" Margin="20 0" FontSize="18"/>
<RadioButton Content="前板计划" Height="60" VerticalAlignment="Center" BorderBrush="White" Foreground="White" Margin="20 0" FontSize="18"/>
<RadioButton Content="后板计划" Height="60" VerticalAlignment="Center" BorderBrush="White" Foreground="White" Margin="20 0" FontSize="18"/>
</WrapPanel>
</Border>
</Grid>
</Border>
<UniformGrid Grid.Row="2" Margin="5" >
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" x:Name="dgvMH" FontSize="18"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" VerticalAlignment="Stretch"
ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
Foreground="White" SelectedItem="{Binding SelectedDataItem}" MouseLeftButtonDown="dgvMH_MouseLeftButtonDown">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding PlanCode}" Header="计划号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding MaterialCode}" Header="物料编号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding MaterialName}" Header="物料名称" Width="4*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding OrderCode}" Header="订单编码" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding PlanAmount}" Header="计划" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding ResidueAmount}" Header="剩余" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="160" Binding="{Binding SpliteResidueAmount}" Header="计划可拆分数量" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding OrderCode}" Header="工单编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="开始时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
<Border Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
<Grid Margin="5 30">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="计划编码" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="PlanCode" Foreground="White" Text="{Binding SelectedItem.PlanCode, ElementName=dgvMH}" IsReadOnly="True" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Margin="15 0 0 0" MinWidth="200"
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" />
<TextBox x:Name="OrderCode" Foreground="White" Text="{Binding SelectedItem.OrderCode, ElementName=dgvMH}" IsReadOnly="True" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Margin="15 0 0 0" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
materialDesign:HintAssist.Hint="订单编码" />
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 5">
<TextBlock Text="物料编码" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="OrderNo" Foreground="White" Text="{Binding SelectedItem.MaterialCode, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
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" />
<TextBox x:Name="MaterialName" Foreground="White" Text="{Binding SelectedItem.MaterialName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
materialDesign:HintAssist.Hint="物料名称" />
</WrapPanel>
<WrapPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="可拆分数" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<!--<TextBox x:Name="SpliteResidueAmount" Text="{Binding SelectedItem.SpliteResidueAmount, ElementName=dgvMH}" Margin="15 0 0 0" materialDesign:HintAssist.Hint="可拆分数量" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"/>-->
<Slider x:Name="SpliteResidueAmount" Minimum="0" Maximum="100" Value="{Binding SelectedItem.SpliteResidueAmount, ElementName=dgvMH}" Foreground="white" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" FontSize="15" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"/>
</WrapPanel>
<WrapPanel Grid.Row="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<Button Content="手动创建" Margin="5" Command="{Binding CreateTaskCommand}" CommandParameter="{Binding Text, ElementName=OrderCode}"/>
</WrapPanel>
</Grid>
</Border>
</Grid>
</Border>
</Grid>

@ -1,19 +1,7 @@
using Aucma.Core.SheetMetal.ViewModels;
using CommunityToolkit.Mvvm.Messaging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
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.SheetMetal.Views
{
@ -22,10 +10,12 @@ namespace Aucma.Core.SheetMetal.Views
/// </summary>
public partial class SplitPlanView : Window
{
private SplitPlanViewModel planInfoEditViewModel = new SplitPlanViewModel();
public SplitPlanView()
{
InitializeComponent();
this.DataContext = new SplitPlanViewModel();
this.DataContext = planInfoEditViewModel;
WeakReferenceMessenger.Default.Register<object>(this,Recive);
}
@ -33,5 +23,10 @@ namespace Aucma.Core.SheetMetal.Views
{
this.Close();
}
private void dgvMH_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
planInfoEditViewModel.MouseClick(sender);
}
}
}

@ -6,14 +6,16 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
xmlns:cvt="clr-namespace:Aucma.Core.SheetMetal.ConvertTo"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="800"
d:DesignWidth="1500">
<UserControl.Resources>
<cvt:MultiBindingConverter x:Key="QueryConvert"></cvt:MultiBindingConverter>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="18"/>
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
@ -42,7 +44,7 @@
<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>
@ -71,81 +73,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>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5 15 5 5">
@ -155,7 +82,7 @@
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,5,5" >
<TextBlock Text="数据统计" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="生产统计" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,5">
@ -164,10 +91,10 @@
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="15" VerticalAlignment="Center"/>
<TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<DatePicker
x:Name="BeginTime"
Width="200" Margin="10 0" Text="2023-10-09"
Width="200" Margin="10 0" BorderBrush="White"
materialDesign:CalendarAssist.IsHeaderVisible="False">
<DatePicker.SelectedDate>
<Binding
@ -179,10 +106,10 @@
</DatePicker.SelectedDate>
</DatePicker>
<TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="15" VerticalAlignment="Center"/>
<TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<DatePicker
x:Name="EndTime" Margin="10 0" Text="2023-10-09"
Width="200"
x:Name="EndTime" Margin="10 0"
Width="200" BorderBrush="White"
materialDesign:CalendarAssist.IsHeaderVisible="False">
<DatePicker.SelectedDate>
<Binding
@ -194,10 +121,8 @@
</DatePicker.SelectedDate>
</DatePicker>
<Button Margin="10 0"
Content="查询" Command="{Binding ExecQueryCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
Style="{StaticResource MaterialDesignRaisedSecondaryDarkButton}"
ToolTip="Resource name: MaterialDesignRaisedSecondaryDarkButton">
Content="查询" Command="{Binding ExecQueryCommand}" FontSize="50"
Style="{StaticResource MaterialDesignRaisedSecondaryDarkButton}">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource QueryConvert}">
<Binding ElementName="BeginTime" Path="Text"/>
@ -214,14 +139,15 @@
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<DataGrid.Columns>
<!--<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="成品名称" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding BeginTime}" Header="开始时间" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding EndTime}" Header="结束时间" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="前板数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="后板数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
</DataGrid.Columns>
</DataGrid>

@ -116,7 +116,9 @@
}
},
"StoreInfo": {
"StationCode": "1001"
"shellStoreCode": "1001",
"linerStoreCode": "1001",
"foamBeforeStoreCode": "1001"
},
"PLCServer": [
{

Loading…
Cancel
Save