using Admin.Core.Common; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace Admin.Core.Wpf.ViewModels { public partial class PrintToDevViewModel : ObservableObject { public PrintToDevViewModel() { } public PrintToDevViewModel(string productCode, string materialCode, string materialName, int printAmount, string? barCode = null) { ProductCode = productCode; MaterialName = materialName; PrintAmount = printAmount; } #region 选中订单参数 #region 订单编码 private string _orderNo; public string OrderNo { get => _orderNo; set => SetProperty(ref _orderNo, value); } #endregion #region 产品编码 private string _productCode; public string ProductCode { get => _productCode; set => SetProperty(ref _productCode, value); } #endregion #region 物料型号 private string _materialName; public string MaterialName { get => _materialName; set => SetProperty(ref _materialName, value); } #endregion #region 打印条码 private string _barCode; public string BarCode { get => _barCode; set => SetProperty(ref _barCode, value); } #endregion #region 打印数量 private int _printAmount; public int PrintAmount { get => _printAmount; set => SetProperty(ref _printAmount, value); } #endregion #endregion #region 暂停打印、取消打印 [RelayCommand] public void Operate(string param) { if (string.IsNullOrEmpty(param)) return; switch (param) { case "Suspend": MessageBox.Show("暂停打印中....","系统信息"); break; case "Cancel": MessageBox.Show("取消打印中....","系统信息"); break; default: break; } } #endregion #region 执行打印 /// /// 执行打印 /// /// /// /// /// public void ExecPrint(string orderNo, string materialName, int planAmount) { //对接打印机 } #endregion } }