Browse Source

新增配方分类及配方操作二次确认。

master
ZhaoGang 1 year ago
parent
commit
12746711f3
7 changed files with 358 additions and 81 deletions
  1. +27
    -0
      BPASmartClient.JXJFoodBigStation/App.xaml
  2. +8
    -0
      BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
  3. +253
    -77
      BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
  4. +17
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs
  5. +31
    -3
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
  6. +14
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
  7. +8
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs

+ 27
- 0
BPASmartClient.JXJFoodBigStation/App.xaml View File

@@ -32,6 +32,33 @@
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>

<Style x:Key="ListBoxGroupStyle" TargetType="GroupItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander ExpandDirection="Down" IsExpanded="True">
<Expander.Header>
<StackPanel Orientation="Horizontal" Margin="5,10">
<TextBlock
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{Binding Path=Name}" />
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{Binding Path=ItemCount, StringFormat=数量:{0}个}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 8
- 0
BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs View File

@@ -16,6 +16,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;

/// <summary>
/// 配方类别
/// </summary>
public string RecipeCategory { get { return _RecipeCategory; } set { _RecipeCategory = value; OnPropertyChanged(); } }
private string _RecipeCategory;


/// <summary>
/// 配方ID
/// </summary>


+ 253
- 77
BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml View File

@@ -255,76 +255,212 @@
</Grid>
</Border>-->

<Border Name="br" BorderThickness="2" BorderBrush="#0CADF5">
<Border
Name="br"
BorderBrush="#0CADF5"
BorderThickness="2">
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
</Border.Background>
<Grid >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="85"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition Height="50" />
<RowDefinition Height="85" />
<RowDefinition Height="40" />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock Text="大配料站配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="0,10"></TextBlock>
<UniformGrid Grid.Row="1" Columns="2" Margin="0,0,0,5">
<StackPanel Orientation="Vertical" >
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="请输入配方名称:" Foreground="#FF2AB2E7" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
<TextBox Text="{Binding RecipeName}" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange"
VerticalContentAlignment="Center"
BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" ></TextBox>
<TextBlock
Margin="0,10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="大配料站配方信息" />
<UniformGrid
Grid.Row="1"
Margin="0,0,0,5"
Columns="3">
<StackPanel Orientation="Vertical">
<StackPanel Margin="0,8" Orientation="Horizontal">
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="18"
Foreground="#FF2AB2E7"
Text="请输入配方名称:" />
<TextBox
Width="170"
Height="30"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Background="Transparent"
BorderBrush="#FF2AB2E7"
BorderThickness="1"
FontSize="16"
Foreground="Orange"
Text="{Binding RecipeName}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="请输入托盘编号:" Foreground="#FF2AB2E7" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
<TextBox Text="{Binding TrayCode}" InputMethod.IsInputMethodEnabled="False" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange"
VerticalContentAlignment="Center"
BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" ></TextBox>
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="18"
Foreground="#FF2AB2E7"
Text="请输入托盘编号:" />
<TextBox
Width="170"
Height="30"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Background="Transparent"
BorderBrush="#FF2AB2E7"
BorderThickness="1"
FontSize="16"
Foreground="Orange"
InputMethod.IsInputMethodEnabled="False"
Text="{Binding TrayCode}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="0,8" Orientation="Horizontal">
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="18"
Foreground="#FF2AB2E7"
Text="请选择配方类别:" />
<ComboBox
Width="170"
Height="30"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Background="Transparent"
BorderBrush="#FF2AB2E7"
BorderThickness="1"
FontSize="16"
Foreground="Orange"
IsReadOnly="False"
Text="{Binding RecipeCategory}"
ItemsSource="{Binding Categorys}" />
</StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,4,0,0">
<CheckBox Content="是否洗桶" FontSize="16" Foreground="#FF2AB2E7" Height="30" Width="180" Margin="0,0,10,0" IsChecked="{Binding IsWashingBarrel}"/>
<Button Content="添加原料" Width="180" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" Command="{Binding AddRecipe}" ></Button>
<StackPanel
Margin="0,4,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<CheckBox
Width="140"
Height="30"
Margin="0,0,10,0"
Padding="10,0"
HorizontalContentAlignment="Center"
Content="是否洗桶"
FontSize="16"
Foreground="#FF2AB2E7"
IsChecked="{Binding IsWashingBarrel}" />
<Button
Width="140"
Height="30"
Margin="0,0,10,0"
Background="Transparent"
BorderBrush="#FF2AB2E7"
Command="{Binding AddRecipe}"
Content="添加原料"
Cursor="Hand"
Foreground="#FF2AB2E7" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Center">
<Button Content="确认" Margin="0,0,10,0" Height="30" Width="180" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding Comfirm}"></Button>
<Button Click="Button_Click" Content="取消" Margin="0,0,10,0" Height="30" FontSize="20" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Width="180" Cursor="Hand"></Button>
<StackPanel
Grid.Row="1"
Margin="0,4,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
Width="140"
Height="30"
Margin="0,0,10,0"
Background="Transparent"
BorderBrush="#FF2AB2E7"
Command="{Binding Comfirm}"
Content="确认"
Foreground="#FF2AB2E7" />
<Button
Width="140"
Height="30"
Margin="0,0,10,0"
Background="Transparent"
BorderBrush="#FF2AB2E7"
Click="Button_Click"
Content="取消"
Cursor="Hand"
FontSize="20"
Foreground="#FF2AB2E7" />
</StackPanel>
</Grid>

</UniformGrid>
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,10">
<Grid
Grid.Row="2"
Margin="0,0,0,10"
Background="#FF2AB2E7">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="120"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="原料位置" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter></GridSplitter>
<TextBlock Grid.Column="1" Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter Grid.Column="1"></GridSplitter>
<TextBlock Grid.Column="2" Text="原料中文名" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter Grid.Column="1"></GridSplitter>
<TextBlock Grid.Column="3" Text="托盘桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter Grid.Column="2"></GridSplitter>
<TextBlock Grid.Column="4" Text="原料重量" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"></TextBlock>
<GridSplitter Grid.Column="3"></GridSplitter>
<TextBlock Grid.Column="5" Text="操作" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="原料位置" />
<GridSplitter />
<TextBlock
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="原料名称" />
<GridSplitter Grid.Column="1" />
<TextBlock
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="原料中文名" />
<GridSplitter Grid.Column="1" />
<TextBlock
Grid.Column="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="托盘桶号" />
<GridSplitter Grid.Column="2" />
<TextBlock
Grid.Column="4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="原料重量" />
<GridSplitter Grid.Column="3" />
<TextBlock
Grid.Column="5"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="操作" />
</Grid>
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding RawMaterialsInfo}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel></StackPanel>
<StackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
@@ -334,19 +470,19 @@
<ControlTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<!--<ComboBox ItemsSource="{Binding DataContext.materialNames,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" Text="{Binding RawMaterialLocation}" Margin="10,0,0,10" Width="190" FontSize="14" KeyUp="ComboBox_KeyUp" LostFocus="ComboBox_LostFocus">
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="#e69519"/>

</Style>
</ComboBox.ItemContainerStyle>-->
@@ -361,39 +497,79 @@
Foreground="LightGray"
IsEditable="False"
ItemsSource="{Binding DataContext.RawMaterialLocation, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
SelectedValue="{Binding RawMaterialLocation}"
MouseLeave="ComboBox_MouseLeave"
SelectedValue="{Binding RawMaterialLocation}"
Style="{StaticResource ComboBoxStyle}"
Text="{Binding RawMaterialLocation}"/>
<StackPanel
VerticalAlignment="Center" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" >
<TextBlock Grid.Column="1" Text="{Binding RawMaterialName}" Background="Transparent" FontSize="14" Foreground="LightGray" ></TextBlock>
Text="{Binding RawMaterialLocation}" />
<StackPanel
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
Grid.Column="1"
Background="Transparent"
FontSize="14"
Foreground="LightGray"
Text="{Binding RawMaterialName}" />
</StackPanel>
<StackPanel
VerticalAlignment="Center" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Center" >
<TextBlock Grid.Column="1" Text="{Binding RawMaterialChineseName}" Background="Transparent" FontSize="14" Foreground="LightGray" ></TextBlock>
<StackPanel
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
Grid.Column="1"
Background="Transparent"
FontSize="14"
Foreground="LightGray"
Text="{Binding RawMaterialChineseName}" />
</StackPanel>
<!--<TextBox Text="{Binding RawMaterialName}" Background="Transparent" FontSize="14"
BorderBrush="#e69519" Foreground="LightGray" Width="190" Margin="10,0,0,10" ></TextBox>-->
<StackPanel
Margin="3" Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBox Text="{Binding RawMaterialBarrelNum}" Background="Transparent" FontSize="14"
BorderBrush="#e69519" Foreground="LightGray" Width="120" ></TextBox>
</StackPanel>
<StackPanel
Margin="3" Orientation="Horizontal" Grid.Column="4" HorizontalAlignment="Center">
<TextBox Text="{Binding RawMaterialWeight}" Background="Transparent" FontSize="14"
BorderBrush="#e69519" Foreground="LightGray" Width="120" ></TextBox>
<TextBlock FontSize="14" VerticalAlignment="Center" Margin="4,0,0,0" Text="Kg" Foreground="#e69519" ></TextBlock>
</StackPanel>
<Button Grid.Column="5"
Content="删除"
Width="94"
<StackPanel
Grid.Column="3"
Margin="3"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBox
Width="120"
Background="Transparent"
BorderBrush="#e69519"
FontSize="14"
Foreground="LightGray"
Text="{Binding RawMaterialBarrelNum}" />
</StackPanel>
<StackPanel
Grid.Column="4"
Margin="3"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBox
Width="120"
Background="Transparent"
BorderBrush="#e69519" Foreground="LightGray" HorizontalAlignment="Center"
Command="{Binding DataContext.RemoveRecipe,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
CommandParameter="{Binding RawMaterialLocation}"></Button>
BorderBrush="#e69519"
FontSize="14"
Foreground="LightGray"
Text="{Binding RawMaterialWeight}" />
<TextBlock
Margin="4,0,0,0"
VerticalAlignment="Center"
FontSize="14"
Foreground="#e69519"
Text="Kg" />
</StackPanel>
<Button
Grid.Column="5"
Width="94"
HorizontalAlignment="Center"
Background="Transparent"
BorderBrush="#e69519"
Command="{Binding DataContext.RemoveRecipe, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding RawMaterialLocation}"
Content="删除"
FontSize="14"
Foreground="LightGray" />
</Grid>
</ControlTemplate>
</RadioButton.Template>


+ 17
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs View File

@@ -1,4 +1,7 @@
using BPASmartClient.Helper;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
@@ -43,11 +46,22 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
});
ClearAllRecipe = new RelayCommand(() =>
{
if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否清除所有西门子配方?",DialogType.Warning))
{
return;
}
Json<RemoteRecipe>.Data.Recipes.Clear();
GVL_BigStation.SiemensSendRecipeStatus = 0;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"清楚所有配方完成");
MessageNotify.GetInstance.ShowUserLog($"手动清除所有西门子配方。");
});
CancelRecipeCommand = new RelayCommand(() =>
{
if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否取消订单【{CancelRecipeCode}】?", DialogType.Warning))
{
return;
}

if (Json<RemoteRecipe>.Data.Recipes != null)
{
int index = Array.FindIndex(Json<RemoteRecipe>.Data.Recipes.ToArray(), p => p.RecipeCode == CancelRecipeCode);
@@ -55,6 +69,8 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
GVL_BigStation.Order_Cancel = true;
GVL_BigStation.Order_CancelRecipeCode = CancelRecipeCode;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"订单取消完成");
MessageNotify.GetInstance.ShowUserLog($"手动取消订单【{CancelRecipeCode}】。");
}
}
});


+ 31
- 3
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs View File

@@ -32,6 +32,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
RecipeCode = rm.RecipeCode;
TrayCode = rm.TrayCode;
IsWashingBarrel = rm.IsWashingBarrel;
RecipeCategory = rm.RecipeCategory;
foreach (var item in rm.RawMaterial)
{
//item.RawMaterialCount = Array.FindIndex(ProcessControl.GetInstance.RawMaterialsInfo.ToArray(), p => p.RawMaterialName == item.RawMaterialName);
@@ -57,6 +58,10 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
});
Comfirm = new RelayCommand(() =>
{
if (!MessageNotify.GetInstance.ShowDialog($"是否保存该配方?"))
{
return;
}
var bom= Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode);
if (bom == null)//新配方
{
@@ -70,16 +75,17 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
if (IsWashingBarrel)
{
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType="洗桶" });
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType="洗桶",RecipeCategory=RecipeCategory});
if (RawMaterialsInfo.Count > 0)
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, App.MainWindow, "提示", $"订单类型为洗桶,不保存原料信息");
}
else
{
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料" });
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料", RecipeCategory = RecipeCategory });
}
Json<LocalRecipe>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方保存完成");
MessageNotify.GetInstance.ShowUserLog($"新增【{RecipeName}】配方,订单号为【{recipeCode}】。");
}
else
{
@@ -102,11 +108,14 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
bom.RecipeName = RecipeName;
bom.TrayCode = TrayCode;
bom.IsWashingBarrel = IsWashingBarrel;
bom.RecipeCategory = RecipeCategory;
if (IsWashingBarrel)
{
bom.RawMaterial.Clear();
}
Json<LocalRecipe>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方保存完成");
MessageNotify.GetInstance.ShowUserLog($"修改【{RecipeName}】配方。");
ActionManage.GetInstance.Send("CloseRecipeInfosView");
}
});
@@ -116,6 +125,15 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
if (res != null)
RawMaterialsInfo.Remove(res);
});

foreach (var item in Json<LocalRecipe>.Data.Recipes)
{
if (!Categorys.Contains(item.RecipeCategory))
{
Categorys.Add(item.RecipeCategory);
}
}

}
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;
@@ -130,7 +148,17 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
private int _mSelectIndex;
public bool IsWashingBarrel { get { return _mIsWashingBarrel; } set { _mIsWashingBarrel = value; OnPropertyChanged(); } }
private bool _mIsWashingBarrel;

public string RecipeCategory { get { return _RecipeCategory; } set { _RecipeCategory = value; OnPropertyChanged(); } }
private string _RecipeCategory;

private ObservableCollection<string> _Categorys=new();

public ObservableCollection<string> Categorys
{
get { return _Categorys; }
set { _Categorys = value; OnPropertyChanged(); }
}

public RelayCommand ReturnPage { get; set; }



+ 14
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs View File

@@ -107,17 +107,31 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
//});
ClearAllRecipe = new RelayCommand(() =>
{
if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有本地配方?",DialogType.Warning))
{
return;
}

Json<LocalRecipe>.Data.Recipes.Clear();
Json<LocalRecipe>.Save();

NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"本地配方已全部删除!");
MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。");
});

RemoveCommand = new RelayCommand<string>((recipeCode) =>
{
if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否删除配方【{recipeCode}】?",DialogType.Warning))
{
return;
}
var res = Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode);
if (res != null)
{
Recipes.Remove(res);
Json<LocalRecipe>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方删除完成");
MessageNotify.GetInstance.ShowUserLog($"手动删除【{res.RecipeName}】配方:【{recipeCode}】,");
}
});
}


+ 8
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs View File

@@ -41,6 +41,10 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
if (GVL_BigStation.IsUseLocalRecipe)
{
if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否下发配方【{recipeName}】?"))
{
return;
}
//配方下发逻辑
var res = Recipes.FirstOrDefault(p => p.RecipeName == recipeName);
if (res != null)
@@ -52,6 +56,10 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
MessageNotify.GetInstance.ShowRunLog($"手动下发配方:{recipeName}完成");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方下发完成");
}
else
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "失败", $"配方下发失败,已下发过此配方。");
}
}
}
else


Loading…
Cancel
Save