Browse Source

菜单

master
NXX 1 year ago
parent
commit
372d258876
6 changed files with 96 additions and 16 deletions
  1. +8
    -8
      BPASmartClient.MorkBF/Control_MorkBF.cs
  2. +8
    -7
      BPASmartClient.MorkF/Control_MorkF.cs
  3. +1
    -1
      BPASmartClient.MorkF/Model/MaterialSurplus.cs
  4. +45
    -0
      BPASmartClient/Control/FoodMenu.xaml
  5. +26
    -0
      BPASmartClient/Control/FoodMenu.xaml.cs
  6. +8
    -0
      BPASmartClient/MainWindow.xaml

+ 8
- 8
BPASmartClient.MorkBF/Control_MorkBF.cs View File

@@ -37,14 +37,14 @@ namespace BPASmartClient.MorkBF
MonitorViewModel.DeviceId = DeviceId; MonitorViewModel.DeviceId = DeviceId;
ActionManage.GetInstance.Register(new Action(() => ActionManage.GetInstance.Register(new Action(() =>
{ {
GlobalFoodMenu.LocalFoodMenus.Clear();
if (BPASmartClient.Helper.Json<LocalFryPotMessage>.Data.FryPotMessage.Count > 0)
{
foreach (var item in BPASmartClient.Helper.Json<LocalFryPotMessage>.Data.FryPotMessage)
{
GlobalFoodMenu.LocalFoodMenus.Add(new FoodMenuModel { GoodKey = item.GoodKey, GoodName = item.GoodName });
}
}
//GlobalFoodMenu.LocalFoodMenus.Clear();
//if (BPASmartClient.Helper.Json<LocalFryPotMessage>.Data.FryPotMessage.Count > 0)
//{
// foreach (var item in BPASmartClient.Helper.Json<LocalFryPotMessage>.Data.FryPotMessage)
// {
// GlobalFoodMenu.LocalFoodMenus.Add(new FoodMenuModel { GoodKey = item.GoodKey, GoodName = item.GoodName });
// }
//}
}), "更新菜单"); }), "更新菜单");
CommandRegist();//调试 CommandRegist();//调试
ServerInit(); ServerInit();


+ 8
- 7
BPASmartClient.MorkF/Control_MorkF.cs View File

@@ -1,4 +1,5 @@
using BPA.Message; using BPA.Message;
using System;
using BPA.Message.Enum; using BPA.Message.Enum;
using BPASmartClient.Device; using BPASmartClient.Device;
using BPASmartClient.EventBus; using BPASmartClient.EventBus;
@@ -755,10 +756,10 @@ namespace BPASmartClient.MorkF
private void StartOrderMain(object o) private void StartOrderMain(object o)
{ {
if (o == null) return; if (o == null) return;
if (o is FoodMenuModel good)
{
NewStartLocalOrder(good.GoodName);
}
//if (o is FoodMenuModel good)
//{
// NewStartLocalOrder(good.GoodName);
//}


//if (o == null) return; //if (o == null) return;
@@ -2477,7 +2478,7 @@ namespace BPASmartClient.MorkF
if (materialInfo != null) if (materialInfo != null)
{ {
//if //if
if(Convert.ToInt32(materialInfo.Qty) - goodBatching.BatchingCount < 0)
if(System.Convert.ToInt32(materialInfo.Qty) - goodBatching.BatchingCount < 0)
{ {
MessageLog.GetInstance.ShowEx($"{materialInfo.Name}不够,请更新菜品库,并点击检测"); MessageLog.GetInstance.ShowEx($"{materialInfo.Name}不够,请更新菜品库,并点击检测");
return; return;
@@ -2887,12 +2888,12 @@ namespace BPASmartClient.MorkF
if (batchingInfo == null) if (batchingInfo == null)
{ {
//为空就新增 //为空就新增
BatchingInfos.Add(new BatchingInfo() { BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount, BatchingLoc = surplus.Loc, BatchingId = surplus.Key });
BatchingInfos.Add(new BatchingInfo() { BatchingCount = System.Convert.ToInt32(surplus.Qty) - stagingCount, BatchingLoc = surplus.Loc, BatchingId = surplus.Key });
} }
else else
{ {
batchingInfo.BatchingLoc = surplus.Loc; batchingInfo.BatchingLoc = surplus.Loc;
batchingInfo.BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount;
batchingInfo.BatchingCount = System.Convert.ToInt32(surplus.Qty) - stagingCount;
} }
} }
Thread.Sleep(1000); Thread.Sleep(1000);


+ 1
- 1
BPASmartClient.MorkF/Model/MaterialSurplus.cs View File

@@ -87,7 +87,7 @@ namespace BPASmartClient.MorkF
foreach(MaterialInfo material in materials) foreach(MaterialInfo material in materials)
{ {
//surplus += int.Parse(material.Qty.ToString()); //surplus += int.Parse(material.Qty.ToString());
surplus += Convert.ToInt32(material.Qty);
surplus += System.Convert.ToInt32(material.Qty);
} }
return true; return true;
} }


+ 45
- 0
BPASmartClient/Control/FoodMenu.xaml View File

@@ -0,0 +1,45 @@
<UserControl x:Class="Control.FoodMenu"
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:Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Name="FoodMenu">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="2"/>
<Setter Property="FontSize" Value="22"/>
<Setter Property="FontWeight" Value="Black"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontFamily" Value="楷体"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border BorderBrush="Black" BorderThickness="0" Background="Transparent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<ListBox>
</ListBox>
</Grid>
</UserControl>

+ 26
- 0
BPASmartClient/Control/FoodMenu.xaml.cs View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
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 Control
{
/// <summary>
/// FoodMenu.xaml 的交互逻辑
/// </summary>
public partial class FoodMenu : UserControl
{
public FoodMenu()
{
InitializeComponent();
}
}
}

+ 8
- 0
BPASmartClient/MainWindow.xaml View File

@@ -80,6 +80,14 @@
Content="订单监视" Content="订单监视"
Cursor="Hand" Cursor="Hand"
Tag="OrderStatusView" /> Tag="OrderStatusView" />
<Button
Width="120"
Height="40"
Margin="20,0"
Click="MenuItem_Click"
Content="本地菜单"
Cursor="Hand"
Tag="OrderStatusView" />
</StackPanel> </StackPanel>
<!--#endregion--> <!--#endregion-->
<Menu x:Name="myMenu" Visibility="Visible"> <Menu x:Name="myMenu" Visibility="Visible">


Loading…
Cancel
Save