1.移植盟讯的盘点下架功能
This commit is contained in:
@ -231,6 +231,7 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
var body = new GetOutOrderListByStatusRequest()
|
||||
{
|
||||
IsMXPD = false,
|
||||
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 }
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||
|
429
货架标准上位机/ViewModels/MXViewModel/MXPDViewModel.cs
Normal file
429
货架标准上位机/ViewModels/MXViewModel/MXPDViewModel.cs
Normal file
@ -0,0 +1,429 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using MiniExcelLibs;
|
||||
using Newtonsoft.Json;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using 货架标准上位机.Api;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class MXPDViewModel : BindableBase
|
||||
{
|
||||
public MXPDViewModel()
|
||||
{
|
||||
RefreshOutOrderList();
|
||||
}
|
||||
|
||||
#region Property
|
||||
private OutOrderModel selectedOutOrder;
|
||||
public OutOrderModel SelectedOutOrder
|
||||
{
|
||||
get { return selectedOutOrder; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrder, value);
|
||||
if (selectedOutOrder != null)
|
||||
{
|
||||
SelectedOutOrderNumber = selectedOutOrder.OrderNumber;
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedOutOrderNumber;
|
||||
public string SelectedOutOrderNumber
|
||||
{
|
||||
get => selectedOutOrderNumber;
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrderNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ObservableCollection<OutOrderModel> outOrderList;
|
||||
public ObservableCollection<OutOrderModel> OutOrderList
|
||||
{
|
||||
get => outOrderList;
|
||||
set
|
||||
{
|
||||
SetProperty(ref outOrderList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<OutOrderMatDetailModel> dataGridItemSource;
|
||||
public ObservableCollection<OutOrderMatDetailModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
RefreshCount();
|
||||
}
|
||||
}
|
||||
|
||||
//单据总盘数
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get => totalPan; set
|
||||
{
|
||||
SetProperty(ref totalPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
{
|
||||
get => sendedPan; set
|
||||
{
|
||||
SetProperty(ref sendedPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get => totalCount;
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
|
||||
private string orderStatus;
|
||||
public string OrderStatus
|
||||
{
|
||||
get { return orderStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshCount()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
SendedPan = dataGridItemSource.Where(t => t.IsSended).Count();
|
||||
TotalPan = dataGridItemSource.Count();
|
||||
TotalCount = dataGridItemSource.Sum(t => t.MatQty);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get => matCode;
|
||||
set { SetProperty(ref matCode, value); }
|
||||
}
|
||||
|
||||
private string wareHouseCode;
|
||||
public string WareHouseCode
|
||||
{
|
||||
get => wareHouseCode;
|
||||
set { SetProperty(ref wareHouseCode, value); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnOutOrderCommand { get => new DelegateCommand(BtnOutOrder); }
|
||||
public void BtnOutOrder()
|
||||
{
|
||||
var window = new MXOutOrderView();
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口开始出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功开始出库!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口结束出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功结束盘点!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnQueryCommand { get => new DelegateCommand(BtnQuery); }
|
||||
public void BtnQuery()
|
||||
{
|
||||
try
|
||||
{
|
||||
//请求WMS获取物料明细
|
||||
var request = new ElectronicSiloPushRequest()
|
||||
{
|
||||
materialCode = MatCode,
|
||||
warehouseCode = WareHouseCode
|
||||
};
|
||||
var requeststr = JsonConvert.SerializeObject(request);
|
||||
var result = ApiHelp.MXGetDataFromHttp<List<ElectronicSiloPushDto>>(requeststr, "http://192.168.2.23:9213/integrate/inOut/electronicSiloPush", "POST", true);
|
||||
if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
||||
{
|
||||
//通过返回的物料明细查询当前库存中有的数据
|
||||
var matSns = result.data.Select(t => t.materialBar).ToList();
|
||||
//调用 比对库存数据 获取库存中有的数据
|
||||
#region 调用接口 比对库存数据 获取库存中有的数据
|
||||
try
|
||||
{
|
||||
var body = new CompareMatInventoryDetailRequest()
|
||||
{
|
||||
MatSns = matSns,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/compareMatInventoryDetail", body, "POST", true);
|
||||
|
||||
//查询到物料信息
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null && Result.Data.Lists.Count != 0)
|
||||
{
|
||||
var count = Result.Data.Lists.Count;
|
||||
//是否生成盘点单 实际上是出库单
|
||||
var dialogResult = HandyControl.Controls.MessageBox.Show($"共查询到有{count}盘物料,是否生成盘点单?", "提示", MessageBoxButton.YesNo);
|
||||
if (dialogResult == MessageBoxResult.Yes)
|
||||
{
|
||||
#region 调用接口保存出库单据
|
||||
var body1 = new SysOutOrderByMatSnRequest()
|
||||
{
|
||||
IsMXPD = true,
|
||||
OrderType = "出库",
|
||||
OrderSource = "WCS前端",
|
||||
SnList = Result.Data.Lists.Select(t => t.MatSN).ToList(),
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
|
||||
if (Result1 != null && Result1.Code == 200)
|
||||
{
|
||||
//出库单据保存成功 刷新左侧出库单列表
|
||||
MXPDView.viewModel.RefreshOutOrderList(Result1.Message.ToString());
|
||||
Growl.Success("盘点单据保存成功,请点击【开始盘点】进行盘点下架!");
|
||||
}
|
||||
else if (Result1 != null)
|
||||
{
|
||||
Growl.Warning(Result1.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else if (Result != null && Result.Code == 200 && (Result.Data == null || Result.Data.Lists == null || Result.Data.Lists.Count == 0))
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!所推荐物料在此货架上不存在,请确认是否在其他货架上!\r\n{string.Join(",\r\n", matSns)}");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("获取WMS系统库存数据失败!" + result?.message);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
//dia.Close();
|
||||
//dia.Collapse();
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshOutOrderList(string OrderNumber = "")
|
||||
{
|
||||
#region 调用接口获取发料单
|
||||
try
|
||||
{
|
||||
var body = new GetOutOrderListByStatusRequest()
|
||||
{
|
||||
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 },
|
||||
IsMXPD = true,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
OutOrderList = new ObservableCollection<OutOrderModel>(Result.Data.Lists);
|
||||
if (!string.IsNullOrEmpty(OrderNumber))
|
||||
{
|
||||
SelectedOutOrder = OutOrderList.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning(ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public void RefreshDataGridItemSource()
|
||||
{
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
//选择的单据为空无法进行查询
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取出库单物料明细
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
|
||||
OrderStatus = Result.Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
Growl.Warning("该单据未查询到发料明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -127,7 +127,7 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">盘点单据</TextBlock>
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">PDA盘点单</TextBlock>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
@ -139,7 +139,7 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">物料盘点</TextBlock>
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">PDA盘点</TextBlock>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
@ -147,6 +147,18 @@
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">物料盘点</TextBlock>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:MXPDView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
@ -133,7 +133,7 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Ellipse Width="20" Height="20" Fill="LightGreen" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||
<Ellipse Width="20" Height="20" Fill="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
235
货架标准上位机/Views/MXWindows/MXPDView.xaml
Normal file
235
货架标准上位机/Views/MXWindows/MXPDView.xaml
Normal file
@ -0,0 +1,235 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.MXPDView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:converter="clr-namespace:货架标准上位机"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192">
|
||||
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="料 号 :" FontSize="20" ></TextBlock>
|
||||
<TextBox Grid.Column="1" Text="{Binding MatCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="20" MinWidth="160" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="仓库代码:" FontSize="20" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding WareHouseCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="20" MinWidth="160" ></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="2" MinHeight="45" FontSize="28" Content="获取明细" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnQueryCommand}">
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="4" MinHeight="45" FontSize="28" Content="开始盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnStartCommand}"
|
||||
>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="5" MinHeight="45" FontSize="28" Content="结束盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnPauseCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="0" Background="LightGray" Padding="0">
|
||||
<Border Margin="1" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock FontSize="26" Text="当前盘点单:">
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedPickBillNumber}">
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--</TabItem>-->
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="6*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="盘点单列表" MouseDown="TextBlock_MouseDown" FontWeight="DemiBold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"></TextBlock>
|
||||
<Border CornerRadius="3" Margin="1" Grid.Row="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||
<ListView.View>
|
||||
|
||||
<GridView AllowsColumnReorder="False">
|
||||
<GridView.ColumnHeaderContainerStyle>
|
||||
<Style TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</GridView.ColumnHeaderContainerStyle>
|
||||
<GridViewColumn DisplayMemberBinding="{Binding OrderNumber}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Border CornerRadius="3" Margin="1" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
||||
<TextBlock Text="当前盘点单:" FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding SelectedPickBillNumber}" FontSize="24">
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="2"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="40"
|
||||
AutoGenerateColumns="False" FontSize="15">
|
||||
<DataGrid.Resources>
|
||||
<converter:WorkItemBackgroundConverter x:Key="converter"/>
|
||||
</DataGrid.Resources>
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="{Binding Path=IsSend, Converter={StaticResource converter}}"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="" CanUserResize="False" Width="50">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Ellipse Width="20" Height="20" Fill="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsSended,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding OriginalQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" MaxWidth="300" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="False" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="5 0 1 0" VerticalAlignment="Top" Width="Auto" Height="40">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="8.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="4*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0">
|
||||
<TextBlock Text=" 当前状态:" FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding OrderStatus,FallbackValue=未知}" Foreground="red" FontSize="24">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||
<TextBlock Text="物料总数量:" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalCount,FallbackValue=0}" FontSize="20">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Text=" 取料进度:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding SendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="/" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<!--<TextBlock Text=" 未出盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding UnSendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>-->
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
59
货架标准上位机/Views/MXWindows/MXPDView.xaml.cs
Normal file
59
货架标准上位机/Views/MXWindows/MXPDView.xaml.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using Ping9719.WpfEx;
|
||||
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.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Text.RegularExpressions;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class MXPDView : UserControlBase
|
||||
{
|
||||
public static MXPDViewModel viewModel { get; set; } = new MXPDViewModel();
|
||||
public MXPDView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
viewModel.RefreshOutOrderList(viewModel.SelectedOutOrderNumber);
|
||||
}
|
||||
private void ListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (!e.Handled)
|
||||
{
|
||||
e.Handled = true;
|
||||
// 激发一个鼠标滚轮事件,冒泡给外层ListView接收到
|
||||
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||
eventArg.Source = sender;
|
||||
var parent = ((Control)sender).Parent as UIElement;
|
||||
parent.RaiseEvent(eventArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -108,6 +108,10 @@ namespace 货架标准上位机
|
||||
StockTakingView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.通知刷新盟讯盘点:
|
||||
MXPDView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.恢复正常:
|
||||
var SolvedGuids = warning.SolvedGuids;
|
||||
SolvedGuids.ForEach(guid =>
|
||||
|
Reference in New Issue
Block a user