终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
2.0 KiB

  1. using BPASmartClient.CustomResource.Pages.Model;
  2. using BPASmartClient.FoodStationTest.Model;
  3. using BPASmartClient.FoodStationTest.View;
  4. using BPASmartClient.Helper;
  5. using Microsoft.Toolkit.Mvvm.ComponentModel;
  6. using Microsoft.Toolkit.Mvvm.Input;
  7. using System.Collections.ObjectModel;
  8. using System.Linq;
  9. namespace BPASmartClient.FoodStationTest.ViewModel
  10. {
  11. public class SiemensRecipeReceiveViewModel : ObservableObject
  12. {
  13. //ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
  14. public SiemensRecipeReceiveViewModel()
  15. {
  16. Recipes = Json<RemoteRecipeDataColl>.Data.Recipes;
  17. DetailsCommand = new RelayCommand<object>((o) =>
  18. {
  19. if (o != null && o is string cnt)
  20. {
  21. ActionManage.GetInstance.Send("CloseRecipeInfosView");
  22. RecipeInfosView nrv = new RecipeInfosView();
  23. var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
  24. if (res != null)
  25. {
  26. ActionManage.GetInstance.Send("RecipeInfo", res);
  27. nrv.Show();
  28. MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
  29. }
  30. }
  31. });
  32. ClearAllRecipe = new RelayCommand(() =>
  33. {
  34. if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有配方订单?"))
  35. {
  36. Json<RemoteRecipeDataColl>.Data.Recipes.Clear();
  37. MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。");
  38. }
  39. });
  40. }
  41. public RelayCommand<object> DetailsCommand { get; set; }
  42. public RelayCommand ClearAllRecipe { get; set; }
  43. public ObservableCollection<RemoteRecipeData> Recipes { get; set; }
  44. }
  45. }