提交代码
This commit is contained in:
@ -140,6 +140,7 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
scanner.ShelfCode = string.Empty;
|
||||
scanner.ModulesStr = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -201,7 +202,7 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
scanner.MatSn = Result.Data.MatSN;
|
||||
}
|
||||
else if(Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
@ -237,6 +238,7 @@ namespace 货架标准上位机.ViewModel
|
||||
t.MatSn = string.Empty;
|
||||
|
||||
t.ScannerDisplayControl.RefreshValues(t.ShelfCode, t.MatSn);
|
||||
Growl.Success(Result.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -11,6 +11,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Markup;
|
||||
|
||||
@ -25,6 +26,18 @@ namespace 货架标准上位机.ViewModel
|
||||
/// </summary>
|
||||
public string Title { get => title; set { SetProperty(ref title, value); } }
|
||||
|
||||
|
||||
private bool goToOutVentoryView;
|
||||
public bool GoToOutVentoryView
|
||||
{
|
||||
get { return goToOutVentoryView; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref goToOutVentoryView, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 专用_MainWindow2
|
||||
//隐藏式选项卡的高度
|
||||
public double TabItemHeight { get; set; } = 0;
|
||||
@ -72,6 +85,10 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
ScannerManager.InitScanners();
|
||||
}),
|
||||
new Tuple<string, string, Action>("初始化WebSocket连接..", "初始化WebSocket连接失败,请联系管理员", () =>
|
||||
{
|
||||
WebSocket.InitWebSocket();
|
||||
}),
|
||||
};
|
||||
|
||||
MainLoadWindow.TaskSleepTime = 200;
|
||||
@ -88,7 +105,7 @@ namespace 货架标准上位机.ViewModel
|
||||
});
|
||||
|
||||
|
||||
////不登录,直接使用最高权限
|
||||
//不登录,直接使用最高权限
|
||||
//{
|
||||
// UserLoginView.NotLogin();
|
||||
// return true;
|
||||
|
@ -124,7 +124,6 @@ namespace 货架标准上位机.ViewModel
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
//var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
@ -159,8 +158,6 @@ namespace 货架标准上位机.ViewModel
|
||||
//dia.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -116,8 +116,9 @@ namespace 货架标准上位机.ViewModels
|
||||
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
|
||||
{
|
||||
MatCode = t.MatCode,
|
||||
MatName = t.MatName,
|
||||
MatBatch = t.MatBatch,
|
||||
ReqQty = t.NeedQty
|
||||
ReqQty = t.NeedQty,
|
||||
}).ToList(),
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
|
378
货架标准上位机/ViewModels/OutInventoryDocumentViewModel.cs
Normal file
378
货架标准上位机/ViewModels/OutInventoryDocumentViewModel.cs
Normal file
@ -0,0 +1,378 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
using 货架标准上位机.Api;
|
||||
|
||||
namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
public class OutInventoryDocumentViewModel : BindableBase
|
||||
{
|
||||
public OutInventoryDocumentViewModel()
|
||||
{
|
||||
BtnSearch();
|
||||
}
|
||||
|
||||
#region Properties界面绑定的实体
|
||||
private ObservableCollection<OutOrderModel> dataGridItemSource;
|
||||
public ObservableCollection<OutOrderModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
public OutOrderModel selectedataGridItem;
|
||||
public OutOrderModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderNumber;
|
||||
public string OrderNumber
|
||||
{
|
||||
get { return orderNumber; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderType;
|
||||
public string OrderType
|
||||
{
|
||||
get { return orderType; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderType, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderSource;
|
||||
public string OrderSource
|
||||
{
|
||||
get { return orderSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
try
|
||||
{
|
||||
var body = new GetOutOrderListRequest()
|
||||
{
|
||||
OrderNumber = OrderNumber,
|
||||
OrderType = OrderType,
|
||||
OrderSource = OrderSource,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outStore/GetOutOrderList", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderModel>(Result.Data.Lists);
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public void BtnDelete()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ICommand BtnOrderDetailCommand { get => new DelegateCommand(BtnOrderDetail); }
|
||||
public void BtnOrderDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
//打开窗体
|
||||
var window = new OutInventoryDocumentDetailView(Result.Data);
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("该单据没有单据明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ICommand BtnOrderMatDetailCommand { get => new DelegateCommand(BtnOrderMatDetail); }
|
||||
public void BtnOrderMatDetail()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
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)
|
||||
{
|
||||
//打开窗体
|
||||
var window = new OutInventoryDocumentMatDetailView(Result.Data);
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("该单据没有发料明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//开始入库 如果成功就直接跳转出库界面
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
//判断是否勾选数据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
//成功后直接跳转
|
||||
MainWindow1.viewModel.GoToOutVentoryView = true;
|
||||
Growl.Success("已跳转到物料出库页面!");
|
||||
}
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">报警</TextBlock>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextErrCommand}"> 清除</Button>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextErrCommand}"> 清除</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<TextBox Style="{StaticResource TextBoxExtend.Multi}" IsReadOnly="True" Margin="-1" Text="{Binding TextErr}" Foreground="Tomato" hc:InfoElement.Placeholder="没有报警信息"></TextBox>
|
||||
@ -49,10 +49,10 @@
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">日志</TextBlock>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<pi:TextBoxLog Style="{StaticResource TextBoxExtend.Multi}" Margin="-1" hc:InfoElement.Placeholder="没有日志信息" Foreground="CornflowerBlue"></pi:TextBoxLog>
|
||||
<pi:TextBoxLog Token="123" Style="{StaticResource TextBoxExtend.Multi}" Margin="-1" hc:InfoElement.Placeholder="没有日志信息" Foreground="CornflowerBlue"></pi:TextBoxLog>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
@ -13,7 +13,8 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
<RowDefinition Height="5*"></RowDefinition>
|
||||
<RowDefinition Height="5*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" CornerRadius="0" Padding="0" MouseUp="Border_MouseUp">
|
||||
@ -26,113 +27,51 @@
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<Button Style="{StaticResource ButtonDanger}" Margin="10" hc:BorderElement.CornerRadius="15"
|
||||
MinHeight="40" FontSize="20" Content="结束入库" FontFamily="{StaticResource IconFont}"
|
||||
<Button
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
Margin="10"
|
||||
PreviewKeyDown="Button_PreviewKeyDown"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
MinHeight="40"
|
||||
FontSize="20"
|
||||
Content="结束入库"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnEndCommand}">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="1" Background="AliceBlue" Padding="0">
|
||||
<WrapPanel Name="scannersWrapPanel">
|
||||
|
||||
<Border Grid.Row="1" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
||||
<WrapPanel Name="scannersWrapPanel">
|
||||
</WrapPanel>
|
||||
<!--<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="1.2*"></RowDefinition>
|
||||
<RowDefinition Height="1.2*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="最小包装条码:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
Text="{Binding MatSN}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
></TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
Text="物料编码:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1"
|
||||
Text="{Binding MatCode}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
></TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
Text="物料名称:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1"
|
||||
Text="{Binding MatName}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
></TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0"
|
||||
Text="物料规格:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
Text="{Binding MatSpec}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0"
|
||||
Text="物料批次:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right">
|
||||
</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1"
|
||||
Text="{Binding MatBatch}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="0"
|
||||
Text="物料数量:" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1"
|
||||
Text="{Binding MatQty}" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="2"
|
||||
Text="当前入库货架:" FontSize="20" FontWeight="Bold"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="3" Grid.RowSpan="2"
|
||||
Text="{Binding ShelfCode}" FontSize="5" FontWeight="Bold"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
</TextBlock>
|
||||
|
||||
|
||||
</Grid>
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39" Margin="5"
|
||||
AutoGenerateColumns="False" FontSize="18" CanUserSortColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="入库位置" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="入库人" Binding="{Binding InstoreUser}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="入库时间" Binding="{Binding InstoreTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>-->
|
||||
<Border Grid.Row="2" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<GroupBox Grid.Column="0" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}" Margin="0,5,5,5" >
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">入库报警信息</TextBlock>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<pi:TextBoxLog Token="InstoreWarning" Style="{StaticResource TextBoxExtend.Multi}" Margin="-1" hc:InfoElement.Placeholder="没有日志信息" Foreground="CornflowerBlue"></pi:TextBoxLog>
|
||||
</GroupBox>
|
||||
<GroupBox Grid.Column="1" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}" Margin="0,5,5,5" >
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">入库日志信息</TextBlock>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<pi:TextBoxLog Token="InstoreLog" Style="{StaticResource TextBoxExtend.Multi}" Margin="-1" hc:InfoElement.Placeholder="没有日志信息" Foreground="CornflowerBlue"></pi:TextBoxLog>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
@ -65,5 +65,13 @@ namespace 货架标准上位机
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Button_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Space)
|
||||
{
|
||||
e.Handled = true; // 阻止空格键触发按钮点击事件
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<!--内容-->
|
||||
<TabControl Grid.Row="1" TabStripPlacement="Left" Margin="5,0,5,2" Padding="0,0,3,0" BorderThickness="0" Style="{StaticResource TabControlRectangle}" PreviewKeyDown="tabControl_PreviewKeyDown">
|
||||
<TabControl Grid.Row="1" TabStripPlacement="Left" Margin="5,0,5,2" Padding="0,0,3,0" BorderThickness="0" Style="{StaticResource TabControlRectangle}" PreviewKeyDown="tabControl_PreviewKeyDown">
|
||||
<TabItem Padding="10,10,40,10" IsSelected="True">
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
@ -86,9 +86,6 @@
|
||||
<View:HomeView />
|
||||
</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>
|
||||
@ -103,6 +100,17 @@
|
||||
</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:OutInventoryDocumentView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
<TabItem IsSelected="{Binding GoToOutVentoryView}" 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>
|
||||
@ -113,7 +121,7 @@
|
||||
<View:OutVentoryView/>
|
||||
</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">
|
||||
@ -251,7 +259,7 @@
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</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">
|
||||
|
48
货架标准上位机/Views/OutInventoryDocumentDetailView.xaml
Normal file
48
货架标准上位机/Views/OutInventoryDocumentDetailView.xaml
Normal file
@ -0,0 +1,48 @@
|
||||
<hc:Window x:Class="货架标准上位机.OutInventoryDocumentDetailView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Height="500" Width="800" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||
<hc:Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||
<Setter Property="Padding" Value="25,0"></Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</hc:Window.Resources>
|
||||
<Border BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="24" Name="Title" Text="单 据 明 细" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||
|
||||
<Grid Margin="5,0" Grid.Row="1" >
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据编号" Binding="{Binding OrderNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="需求数量" Binding="{Binding ReqQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已出库数量" Binding="{Binding OutQty}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Margin="5" x:Name="spacingPanel" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Margin="5" Content="确认" FontSize="18" Click="closeClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</hc:Window>
|
46
货架标准上位机/Views/OutInventoryDocumentDetailView.xaml.cs
Normal file
46
货架标准上位机/Views/OutInventoryDocumentDetailView.xaml.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
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 WCS.Model.ApiModel.OutStore;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class OutInventoryDocumentDetailView : HandyControl.Controls.Window
|
||||
{
|
||||
public OutInventoryDocumentDetailView(List<OutOrderDetailModel> _matBaseInfo = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (_matBaseInfo != null)
|
||||
{
|
||||
dg1.ItemsSource = _matBaseInfo;
|
||||
}
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
}
|
||||
}
|
51
货架标准上位机/Views/OutInventoryDocumentMatDetailView.xaml
Normal file
51
货架标准上位机/Views/OutInventoryDocumentMatDetailView.xaml
Normal file
@ -0,0 +1,51 @@
|
||||
<hc:Window x:Class="货架标准上位机.OutInventoryDocumentMatDetailView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Height="500" Width="800" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||
<hc:Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||
<Setter Property="Padding" Value="25,0"></Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</hc:Window.Resources>
|
||||
<Border BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="24" Name="Title" Text="发 料 明 细" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||
|
||||
<Grid Margin="5,0" Grid.Row="1" >
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="库位" MaxWidth="120" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料编码" MaxWidth="150" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料名称" MaxWidth="150" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料规格" MaxWidth="150" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料批次" MaxWidth="150" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料SN" MaxWidth="150" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="是否已发" MaxWidth="100" Binding="{Binding IsSended}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="操作人" MaxWidth="150" Binding="{Binding OpUser}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Margin="5" x:Name="spacingPanel" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Margin="5" Content="确认" FontSize="18" Click="closeClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</hc:Window>
|
40
货架标准上位机/Views/OutInventoryDocumentMatDetailView.xaml.cs
Normal file
40
货架标准上位机/Views/OutInventoryDocumentMatDetailView.xaml.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class OutInventoryDocumentMatDetailView : HandyControl.Controls.Window
|
||||
{
|
||||
public OutInventoryDocumentMatDetailView(List<OutOrderMatDetailModel> _matBaseInfo = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (_matBaseInfo != null )
|
||||
{
|
||||
dg1.ItemsSource= _matBaseInfo;
|
||||
}
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
}
|
||||
}
|
181
货架标准上位机/Views/OutInventoryDocumentView.xaml
Normal file
181
货架标准上位机/Views/OutInventoryDocumentView.xaml
Normal file
@ -0,0 +1,181 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.OutInventoryDocumentView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192">
|
||||
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="5 5 5 0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="单据编号:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1" Text="{Binding OrderNumber}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="单据类型:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="3" Text="{Binding OrderType}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="单据来源:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding OrderSource}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
|
||||
<!--<TextBlock Grid.Row="2" Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="单据状态:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding OrderNumber}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>-->
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
Command="{Binding BtnSearchCommand}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="6" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}" Margin="0,0,0,-10" >
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}"
|
||||
Command="{Binding BtnResetCommand}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="7" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}" Margin="0,0,0,-10" >
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnOrderDetailCommand}"
|
||||
Content="单据明细" FontFamily="{StaticResource IconFont}" Background="#bccbb0" Foreground="White">
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnOrderMatDetailCommand}"
|
||||
Content="发料明细" FontFamily="{StaticResource IconFont}" Background="#bccbb0" Foreground="White">
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnStartCommand}"
|
||||
Content="开始发料" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White">
|
||||
</Button>
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnPauseCommand}"
|
||||
Content="暂停发料" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
Name="dg"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30" Height="30" IsHitTestVisible="False" IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据编号" Binding="{Binding OrderNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据来源" Binding="{Binding OrderSource}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据类型" Binding="{Binding OrderType}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据状态" Binding="{Binding OrderStatus}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据同步类型" Binding="{Binding SyncType}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="创建时间" Binding="{Binding CreateTime}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="创建人" Binding="{Binding CreateUser}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
66
货架标准上位机/Views/OutInventoryDocumentView.xaml.cs
Normal file
66
货架标准上位机/Views/OutInventoryDocumentView.xaml.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
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 货架标准上位机.ViewModels;
|
||||
using DataGrid = System.Windows.Controls.DataGrid;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
/// <summary>
|
||||
/// InInventoryView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OutInventoryDocumentView : UserControlBase
|
||||
{
|
||||
public OutInventoryDocumentViewModel viewModel = new OutInventoryDocumentViewModel();
|
||||
public OutInventoryDocumentView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
this.dg.UnselectAllCells();//取消选中 避免手动点击check选项时反选失败 和重新点击该项时反选失败
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
|
||||
{
|
||||
if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Pager)
|
||||
{
|
||||
if (e.Item.Cells[1].Text.Length > 20)
|
||||
{
|
||||
e.Item.Cells[1].Text = e.Item.Cells[1].Text.Substring(0, 20) + "...";
|
||||
}
|
||||
if (e.Item.Cells[2].Text.Length > 20)
|
||||
{
|
||||
e.Item.Cells[2].Text = e.Item.Cells[2].Text.Substring(0, 20) + "...";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -132,9 +132,9 @@ namespace 货架标准上位机
|
||||
{
|
||||
var body = new GetUsersRequest()
|
||||
{
|
||||
UserName = "未登录",
|
||||
UserName = "admin",
|
||||
DeviceType = "WCS前端",
|
||||
Info = "admin",
|
||||
Info = "123",
|
||||
};
|
||||
var Result = ApiHelp.Post<ResponseCommon<List<UserModel>>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result;
|
||||
if (Result != null && Result.Data.Any())
|
||||
@ -144,9 +144,9 @@ namespace 货架标准上位机
|
||||
|
||||
var bodyRole = new GetUsersRequest()
|
||||
{
|
||||
UserName = "未登录",
|
||||
UserName = "admin",
|
||||
DeviceType = "WCS前端",
|
||||
Info = string.Empty,
|
||||
Info = "123",
|
||||
|
||||
};
|
||||
var ResultRole = ApiHelp.Post<ResponseCommon<List<RoleModel>>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result;
|
||||
|
100
货架标准上位机/WebSocket.cs
Normal file
100
货架标准上位机/WebSocket.cs
Normal file
@ -0,0 +1,100 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TouchSocket.Core;
|
||||
using TouchSocket.Http.WebSockets;
|
||||
using TouchSocket.Sockets;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public static class WebSocket
|
||||
{
|
||||
public static void InitWebSocket()
|
||||
{
|
||||
var client = new WebSocketClient();
|
||||
client.Setup(new TouchSocketConfig()
|
||||
.SetRemoteIPHost("ws://127.0.0.1:7789/ws")
|
||||
.ConfigureContainer(a =>
|
||||
{
|
||||
a.AddConsoleLogger();
|
||||
})
|
||||
.ConfigurePlugins(a =>
|
||||
{
|
||||
a.Add<WebSocketClientPlugin>();
|
||||
//配置心跳
|
||||
a.UseWebSocketHeartbeat()//使用心跳插件
|
||||
.SetTick(TimeSpan.FromSeconds(5));//每5秒ping一次。
|
||||
//配置断线重连
|
||||
a.UseReconnection(-1, true, 1000);//-1表示一直重连
|
||||
}));
|
||||
|
||||
client.Connect();
|
||||
}
|
||||
|
||||
}
|
||||
public class WebSocketClientPlugin : PluginBase, IWebSocketReceivedPlugin
|
||||
{
|
||||
private readonly ILog m_logger;
|
||||
|
||||
public WebSocketClientPlugin(ILog logger)
|
||||
{
|
||||
this.m_logger = logger;
|
||||
}
|
||||
public async Task OnWebSocketReceived(IWebSocket client, WSDataFrameEventArgs e)
|
||||
{
|
||||
switch (e.DataFrame.Opcode)
|
||||
{
|
||||
case WSDataType.Cont:
|
||||
m_logger.Info($"收到中间数据,长度为:{e.DataFrame.PayloadLength}");
|
||||
return;
|
||||
|
||||
case WSDataType.Text:
|
||||
m_logger.Info(e.DataFrame.ToText());
|
||||
if (!client.Client.IsClient)
|
||||
{
|
||||
client.Send("我已收到");
|
||||
}
|
||||
//返回的报警信息 出入库盘点等日志信息
|
||||
else
|
||||
{
|
||||
TextBoxLog.AddLog(e.DataFrame.ToText(), "123", DateTime.Now);
|
||||
//Growl.Error(e.DataFrame.ToText());
|
||||
}
|
||||
return;
|
||||
|
||||
case WSDataType.Binary:
|
||||
if (e.DataFrame.FIN)
|
||||
{
|
||||
m_logger.Info($"收到二进制数据,长度为:{e.DataFrame.PayloadLength}");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_logger.Info($"收到未结束的二进制数据,长度为:{e.DataFrame.PayloadLength}");
|
||||
}
|
||||
return;
|
||||
|
||||
case WSDataType.Close:
|
||||
{
|
||||
m_logger.Info("远程请求断开");
|
||||
client.Close("断开");
|
||||
}
|
||||
return;
|
||||
|
||||
case WSDataType.Ping:
|
||||
client.Pong();
|
||||
break;
|
||||
case WSDataType.Pong:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
await e.InvokeNext();
|
||||
}
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@
|
||||
<PackageReference Include="SqlSugar" Version="5.1.4.149" />
|
||||
<PackageReference Include="SqlSugar.MySqlConnector" Version="5.1.3.42" />
|
||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.118" />
|
||||
<PackageReference Include="TouchSocket.Http" Version="2.0.3" />
|
||||
<PackageReference Include="TouchSocket.SerialPorts" Version="2.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
Reference in New Issue
Block a user