diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index f04be251..a0e24d4a 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -29,6 +29,7 @@ + @@ -321,6 +322,7 @@ + diff --git a/BPASmartClient.CustomResource/Fonts/pic/iconfont.ttf b/BPASmartClient.CustomResource/Fonts/pic/iconfont.ttf new file mode 100644 index 00000000..40dd2311 Binary files /dev/null and b/BPASmartClient.CustomResource/Fonts/pic/iconfont.ttf differ diff --git a/BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml b/BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml index 79bec1d3..f59ffcb9 100644 --- a/BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml +++ b/BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml @@ -34,12 +34,12 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient.MorkS/View/GoodsMakeView.xaml.cs b/BPASmartClient.MorkS/View/GoodsMakeView.xaml.cs new file mode 100644 index 00000000..646805ef --- /dev/null +++ b/BPASmartClient.MorkS/View/GoodsMakeView.xaml.cs @@ -0,0 +1,52 @@ +//using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.MorkS.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +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 BPASmartClient.MorkS.View +{ + /// + /// GoodsMakeView.xaml 的交互逻辑 + /// + public partial class GoodsMakeView : UserControl + { + public GoodsMakeView() + { + InitializeComponent(); + } + + private void togFire_Click(object sender, RoutedEventArgs e) + { + if (sender is ToggleButton btn) + { + if (btn.IsChecked!=null) + { + btn.Content=(bool)btn.IsChecked ? "本地" : "小程序"; + if ((bool)btn.IsChecked) + { + btn.HorizontalContentAlignment = HorizontalAlignment.Left; + } + else + { + btn.HorizontalContentAlignment = HorizontalAlignment.Right; + } + Global.LocalOrderModel =(bool)btn.IsChecked; + } + + } + } + } +} diff --git a/BPASmartClient.MorkS/ViewModel/GoodsEditViewModel.cs b/BPASmartClient.MorkS/ViewModel/GoodsEditViewModel.cs new file mode 100644 index 00000000..4f8cac60 --- /dev/null +++ b/BPASmartClient.MorkS/ViewModel/GoodsEditViewModel.cs @@ -0,0 +1,49 @@ +using BPA.Helper; +using BPASmartClient.MorkS.Model; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace BPASmartClient.MorkS.ViewModel +{ + internal class GoodsEditViewModel:NotifyBase + { + private string _orderNum { get; set; } + public string OrderNum { get { return _orderNum; } set { _orderNum = value; OnPropertyChanged(); } } + + private string _goodsName="板面"; + public string GoodsName { get { return _goodsName; } set { _goodsName = value; OnPropertyChanged(); } } + public ObservableCollection bowlLocs { get; set; } = new ObservableCollection() { false, false }; + public ObservableCollection noodlesLocs { get; set; } = new ObservableCollection() { false, false, false, false, false }; + public BPARelayCommand ConfirmCommand { get; set; } + + public GoodsEditViewModel() + { + + ConfirmCommand = new BPARelayCommand(() => { + + GoodsModel goods = new GoodsModel(); + goods.OrderNum = Guid.NewGuid().ToString("D"); + goods.GoodsName = GoodsName; + var bLoc = bowlLocs.ToList().FindIndex(p => p == true); + var noLoc = noodlesLocs.ToList().FindIndex(p => p == true); + if (bLoc != -1&& noLoc!=-1) + { + goods.BowlLoc = bLoc + 10; + goods.NoodlesLoc = noLoc + 1; + } + else + { + MessageBox.Show("请选择面位置或碗类型", "提示", MessageBoxButton.OK, MessageBoxImage.Information); + return; + } + ActionManage.GetInstance.Send("orderEdit", goods); + ActionManage.GetInstance.Send ("CloseEditWindow"); + }); + } + } +} diff --git a/BPASmartClient.MorkS/ViewModel/GoodsMakeViewModel.cs b/BPASmartClient.MorkS/ViewModel/GoodsMakeViewModel.cs new file mode 100644 index 00000000..abd41cca --- /dev/null +++ b/BPASmartClient.MorkS/ViewModel/GoodsMakeViewModel.cs @@ -0,0 +1,79 @@ +using BPA.Helper; +using BPASmartClient.Model; +using BPASmartClient.MorkS.Model; +using BPASmartClient.MorkS.View; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace BPASmartClient.MorkS.ViewModel +{ + internal class GoodsMakeViewModel : NotifyBase + { + public ObservableCollection GoodsModels { get; set; } = new ObservableCollection(); + public BPARelayCommand SendOrderCommand { get; set; } + + public BPARelayCommand DeleteOrderCommand { get; set; } + public BPARelayCommand EditCommand { get; set; } + + public GoodsMakeViewModel() + { + Json.Read(); + GoodsModels = Json.Data.GoodsModels; + ActionManage.GetInstance.Register(new Action((res) => + { + if (res != null && res is GoodsModel goods) + { + var result = GoodsModels.FirstOrDefault(p => p.OrderNum == goods.OrderNum); + if (result == null) + { + GoodsModels.Add(goods); + Json.Save(); + } + else + { + MessageBox.Show("新增订单失败!","提示", MessageBoxButton.OK, MessageBoxImage.Warning); + } + } + }), "orderEdit"); + SendOrderCommand = new BPARelayCommand((s) => + { + var res = GoodsModels.FirstOrDefault(p => p.OrderNum.Equals(s)); + if (res != null) + { + new MorksSimorderModel() { Bowloc = res.BowlLoc, NoodleLoc = res.NoodlesLoc }.Publish(); + } + + + }); + EditCommand = new BPARelayCommand(() => + { + + GoodsEditView goodsEditView = new GoodsEditView(); + goodsEditView.ShowDialog(); + }); + + DeleteOrderCommand = new BPARelayCommand((res) => + { + if (!string.IsNullOrEmpty(res)) + { + var re = GoodsModels.FirstOrDefault(p=>p.OrderNum.Equals(res)); + if (re != null) + { + GoodsModels.Remove(re); + Json.Save(); + } + else + { + MessageBox.Show("未查找到当前订单,删除失败!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); + } + } + + }); + } + } +}