1.增加盟讯公司业务逻辑相关适配 前后端增加配置参数“ISMX”进行控制
2.前端websocket取消心跳机制(原有心跳和断线重连当服务端网线断开后需要等tcp保活期到期后才能发现重连),自己实现心跳和重连 3.前端关闭后任占用后台线程问题修复
This commit is contained in:
156
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml.cs
Normal file
156
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml.cs
Normal file
@ -0,0 +1,156 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class MXOutOrderView : HandyControl.Controls.Window
|
||||
{
|
||||
public MXOutOrderViewModel viewModel = new MXOutOrderViewModel();
|
||||
public MXOutOrderView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
System.Windows.Controls.DataGrid datagrid = sender as System.Windows.Controls.DataGrid;
|
||||
index = datagrid.SelectedIndex;
|
||||
if (index >= 0)
|
||||
{
|
||||
if (viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > index)
|
||||
{
|
||||
var data = viewModel.DataGridItemSource.ElementAt(index);
|
||||
try
|
||||
{
|
||||
var current = viewModel.DataGridItemSource.Where(t => t.IsSelected).First();
|
||||
current.IsSelected = false;
|
||||
}
|
||||
catch { }
|
||||
|
||||
data.IsSelected = true;
|
||||
viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||
}
|
||||
}
|
||||
//datagrid.UnselectAllCells();
|
||||
}
|
||||
|
||||
private void txtMatQty1_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
if (!Regex.IsMatch(e.Text, "^[0-9]"))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public PickOrder SelectedOrder { get; set; }
|
||||
|
||||
public List<MatInventoryDetailModel> inventoryDetails { get; set; }
|
||||
|
||||
|
||||
|
||||
private void comfirmClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var isFirstSend = 0;
|
||||
try
|
||||
{
|
||||
var button = sender as System.Windows.Controls.Button;
|
||||
if (button != null)
|
||||
{
|
||||
if (button.Content.Equals("首盘发料"))
|
||||
isFirstSend = 1;
|
||||
else if (button.Content.Equals("全部发料"))
|
||||
isFirstSend = 0;
|
||||
else
|
||||
isFirstSend = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logs.Write("button获取失败了!!!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (viewModel.DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("请搜索并选择领料单后进行确认!");
|
||||
return;
|
||||
}
|
||||
|
||||
SelectedOrder = viewModel.DataGridItemSource.Where(t => t.IsSelected).FirstOrDefault();
|
||||
if (SelectedOrder == null)
|
||||
{
|
||||
Growl.Warning("请选择领料单后进行确认!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SelectedOrder.pickBillNumber.Contains("SCLL"))
|
||||
{
|
||||
if (string.IsNullOrEmpty(viewModel.WarehouseCode))
|
||||
{
|
||||
Growl.Warning("请输入仓库代码!");
|
||||
txtWarehouseCode.Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(viewModel.WarehouseCode))
|
||||
{
|
||||
|
||||
Growl.Warning("非生产领料无需输入仓库代码!");
|
||||
txtWarehouseCode.Focus();
|
||||
return;
|
||||
}
|
||||
viewModel.WarehouseCode = string.Empty;
|
||||
}
|
||||
|
||||
this.Hide();
|
||||
var detailWindow = new MXOutOrderDetailView(SelectedOrder.pickBillNumber, viewModel.WarehouseCode
|
||||
, SelectedOrder.orderProdNumbers, SelectedOrder.orderWorkNumbers, isFirstSend, reportSideCbx.Text
|
||||
);
|
||||
System.Windows.Interop.WindowInteropHelper mainUI = new System.Windows.Interop.WindowInteropHelper(detailWindow);
|
||||
mainUI.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
|
||||
|
||||
detailWindow.ShowDialog();
|
||||
if (detailWindow.DialogResult == true && detailWindow.DataGridItemSource != null && detailWindow.DataGridItemSource.Count > 0)
|
||||
{
|
||||
inventoryDetails = detailWindow.DataGridItemSource;
|
||||
//LocalStatic.CurrentPickBillNumber = SelectedOrder.pickBillNumber;
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
this.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user