From 12746711f3f83519be4de2c7db06d960684e5257 Mon Sep 17 00:00:00 2001
From: ZhaoGang <15196688790@163.com>
Date: Wed, 7 Jun 2023 15:09:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=85=8D=E6=96=B9=E5=88=86?=
=?UTF-8?q?=E7=B1=BB=E5=8F=8A=E9=85=8D=E6=96=B9=E6=93=8D=E4=BD=9C=E4=BA=8C?=
=?UTF-8?q?=E6=AC=A1=E7=A1=AE=E8=AE=A4=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BPASmartClient.JXJFoodBigStation/App.xaml | 27 ++
.../Model/RawMaterial/RecipeData.cs | 8 +
.../View/RecipeInfosView.xaml | 330 ++++++++++++++----
.../ViewModel/ManualFlowViewModel.cs | 18 +-
.../ViewModel/RecipeInfosViewModel.cs | 34 +-
.../ViewModel/RecipeReceiveViewModel.cs | 14 +
.../ViewModel/RecipeSendDownViewModel.cs | 8 +
7 files changed, 358 insertions(+), 81 deletions(-)
diff --git a/BPASmartClient.JXJFoodBigStation/App.xaml b/BPASmartClient.JXJFoodBigStation/App.xaml
index 5d64b9c2..368efbca 100644
--- a/BPASmartClient.JXJFoodBigStation/App.xaml
+++ b/BPASmartClient.JXJFoodBigStation/App.xaml
@@ -32,6 +32,33 @@
+
+
diff --git a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
index 9d1a21c9..01adfb87 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
@@ -16,6 +16,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;
+
+ ///
+ /// 配方类别
+ ///
+ public string RecipeCategory { get { return _RecipeCategory; } set { _RecipeCategory = value; OnPropertyChanged(); } }
+ private string _RecipeCategory;
+
+
///
/// 配方ID
///
diff --git a/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml b/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
index 4d21eab2..6692a88d 100644
--- a/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
+++ b/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
@@ -255,76 +255,212 @@
-->
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -334,19 +470,19 @@
-
-
-
-
-
-
+
+
+
+
+
+
@@ -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}"/>
-
-
+ Text="{Binding RawMaterialLocation}" />
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+ BorderBrush="#e69519"
+ FontSize="14"
+ Foreground="LightGray"
+ Text="{Binding RawMaterialWeight}" />
+
+
+
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs
index 4b9201b8..951df57b 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs
@@ -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.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.Data.Recipes != null)
{
int index = Array.FindIndex(Json.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}】。");
}
}
});
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
index 7fdefbbd..67d5b677 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
@@ -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.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode);
if (bom == null)//新配方
{
@@ -70,16 +75,17 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
if (IsWashingBarrel)
{
- Json.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType="洗桶" });
+ Json.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.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料" });
+ Json.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料", RecipeCategory = RecipeCategory });
}
Json.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.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.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 _Categorys=new();
+
+ public ObservableCollection Categorys
+ {
+ get { return _Categorys; }
+ set { _Categorys = value; OnPropertyChanged(); }
+ }
public RelayCommand ReturnPage { get; set; }
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
index f4e90230..3a0eae43 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
@@ -107,17 +107,31 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
//});
ClearAllRecipe = new RelayCommand(() =>
{
+ if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有本地配方?",DialogType.Warning))
+ {
+ return;
+ }
+
Json.Data.Recipes.Clear();
Json.Save();
+
+ NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"本地配方已全部删除!");
+ MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。");
});
RemoveCommand = new RelayCommand((recipeCode) =>
{
+ if (!MessageNotify.GetInstance.ShowDialog($"请确认,是否删除配方【{recipeCode}】?",DialogType.Warning))
+ {
+ return;
+ }
var res = Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode);
if (res != null)
{
Recipes.Remove(res);
Json.Save();
+ NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方删除完成");
+ MessageNotify.GetInstance.ShowUserLog($"手动删除【{res.RecipeName}】配方:【{recipeCode}】,");
}
});
}
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs
index 0a6fc51b..b022f68a 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs
@@ -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