From fd75af861505c73d5a20b93dc421309eb228ecc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com>
Date: Tue, 30 May 2023 21:55:50 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E6=96=B9=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Model/Siemens/NewRemoteRecipeModel.cs | 121 ++++++++++--------
.../View/NewLocalRecipeView.xaml | 27 ++--
.../View/NewLocalRecipeView.xaml.cs | 6 +-
.../ViewModel/NewLocalRecipeViewModel.cs | 102 +++++++++++++--
.../ViewModel/RecipeReceiveViewModel.cs | 30 ++---
5 files changed, 187 insertions(+), 99 deletions(-)
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/NewRemoteRecipeModel.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/NewRemoteRecipeModel.cs
index 041e009a..568471d7 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/NewRemoteRecipeModel.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/NewRemoteRecipeModel.cs
@@ -1,61 +1,74 @@
-using BPA.Helper;
-using Microsoft.Toolkit.Mvvm.ComponentModel;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+//using BPA.Helper;
+//using Microsoft.Toolkit.Mvvm.ComponentModel;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.Text;
+//using System.Threading.Tasks;
-namespace BPASmartClient.JXJFoodSmallStation.Model
-{
- public class NewRemoteRecipeModel : ObservableObject
- {
- ///
- /// 原料名称
- ///
- public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } }
- private string _mRawMaterialName;
+//namespace BPASmartClient.JXJFoodSmallStation.Model
+//{
+// public class NewRemoteRecipeModel : ObservableObject
+// {
+// ///
+// /// 原料名称
+// ///
+// public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } }
+// private string _mRawMaterialName;
- ///
- /// 原料对应的桶号
- ///
- public short RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; OnPropertyChanged(); } }
- private short _mRawMaterialBarrelNum;
+// ///
+// /// 原料对应的桶号
+// ///
+// public short RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; OnPropertyChanged(); } }
+// private short _mRawMaterialBarrelNum;
- ///
- /// 原料类型
- ///
- public string RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } }
- private string _mRawMaterialType;
+// ///
+// /// 原料类型
+// ///
+// public string RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } }
+// private string _mRawMaterialType;
- ///
- /// 需要原料重量
- ///
- public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } }
- private float _mRawMaterialWeight;
+// ///
+// /// 需要原料重量
+// ///
+// public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } }
+// private float _mRawMaterialWeight;
- ///
- /// 原料对应料仓的位置
- ///
- public int RawMaterialLocation
- {
- get { return _mRawMaterialLocation; }
- set
- {
- _mRawMaterialLocation = value;
- if (RawMaterialType == "小料")
- {
- //Json.Data.BomMaterial
- }
- else if (RawMaterialType == "粉料")
- {
+// ///
+// /// 原料对应料仓的位置
+// ///
+// public int RawMaterialLocation
+// {
+// get { return _mRawMaterialLocation; }
+// set
+// {
+// _mRawMaterialLocation = value;
+// //if (RawMaterialType == "小料")
+// //{
+// // var res = Json.Data.rawMaterialStockBin.FirstOrDefault(p => p.RawMaterialLocation == value);
+// // if (res != null && !string.IsNullOrEmpty(res.RawMaterialName))
+// // {
+// // var temp = Json.Data.BomMaterial.FirstOrDefault(p => p.MaterialCode == res.RawMaterialName);
+// // if (temp != null && !string.IsNullOrEmpty(temp.MaterialName))
+// // {
+// // RawMaterialName = temp.MaterialName;
+// // }
+// // }
+// //}
+// //else if (RawMaterialType == "粉料")
+// //{
+// // var res = Json.Data.windSendRawMaterial.FirstOrDefault(p => p.Location == value);
+// // if (res != null)
+// // {
+// // RawMaterialName = res.RawMaterialName;
+// // }
+// //}
+// ActionManage.GetInstance.Send("ChangeNotify", this);
+// OnPropertyChanged();
+// }
+// }
+// private int _mRawMaterialLocation;
- }
- OnPropertyChanged();
- }
- }
- private int _mRawMaterialLocation;
-
- }
-}
+// }
+//}
diff --git a/BPASmartClient.JXJFoodSmallStation/View/NewLocalRecipeView.xaml b/BPASmartClient.JXJFoodSmallStation/View/NewLocalRecipeView.xaml
index 3bcbb335..425e7e73 100644
--- a/BPASmartClient.JXJFoodSmallStation/View/NewLocalRecipeView.xaml
+++ b/BPASmartClient.JXJFoodSmallStation/View/NewLocalRecipeView.xaml
@@ -246,12 +246,12 @@
Background="#ff0C255F">
-
-
-
-
-
-
+
+
+
+
+
+
+ Text="重量(kg)" />
-
-
-
-
-
-
+
+
+
+
+
+
-
{ this.Close(); };
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
- ActionManage.GetInstance.CancelRegister("CloseNewRemoteRecipeView");
- ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseNewRemoteRecipeView");
+ //ActionManage.GetInstance.CancelRegister("CloseNewRemoteRecipeView");
+ ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseNewRemoteRecipeView", true);
}
-
+
}
}
diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs
index e7ef7ead..6536e92c 100644
--- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs
+++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs
@@ -12,6 +12,8 @@ using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
+using Google.Protobuf.WellKnownTypes;
+using Newtonsoft.Json.Linq;
namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
@@ -20,6 +22,39 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
public NewLocalRecipeViewModel()
{
//ActionManage.GetInstance.CancelRegister("LocalRecipeEdit");
+
+ //ActionManage.GetInstance.Register(new Action