agv任务
This commit is contained in:
379
货架标准上位机/ViewModels/AGVTaskViewModel.cs
Normal file
379
货架标准上位机/ViewModels/AGVTaskViewModel.cs
Normal file
@ -0,0 +1,379 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using Ping9719.WpfEx.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using SqlSugar;
|
||||||
|
using 智慧物流软件系统.Views.Controls;
|
||||||
|
using 智慧物流软件系统.Api;
|
||||||
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel;
|
||||||
|
using WCS.Model.ApiModel.MatBaseInfo;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using WCS.Model.ApiModel.Stocktaking;
|
||||||
|
|
||||||
|
namespace 智慧物流软件系统.ViewModel
|
||||||
|
{
|
||||||
|
public class AGVTaskViewModel : BindableBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public AGVTaskViewModel()
|
||||||
|
{
|
||||||
|
//初始化下拉列表框
|
||||||
|
StocktakingStatuses.Add("全部");
|
||||||
|
var statuses = Enum.GetValues(typeof(StocktakingStatusEnum))
|
||||||
|
.Cast<StocktakingStatusEnum>()
|
||||||
|
.ToList();
|
||||||
|
foreach (var status in statuses)
|
||||||
|
{
|
||||||
|
StocktakingStatuses.Add(status.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
private ObservableCollection<MatDetailStocktakingInfoModel> dataGridItemSource;
|
||||||
|
public ObservableCollection<MatDetailStocktakingInfoModel> DataGridItemSource
|
||||||
|
{
|
||||||
|
get { return dataGridItemSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref dataGridItemSource, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MatDetailStocktakingInfoModel selectedataGridItem;
|
||||||
|
public MatDetailStocktakingInfoModel SelectedataGridItem
|
||||||
|
{
|
||||||
|
get { return selectedataGridItem; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref selectedataGridItem, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string matCode;
|
||||||
|
public string MatCode
|
||||||
|
{
|
||||||
|
get { return matCode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref matCode, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
private string matName;
|
||||||
|
public string MatName
|
||||||
|
{
|
||||||
|
get { return matName; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref matName, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 盘点人
|
||||||
|
/// </summary>
|
||||||
|
private string stocktakingUser;
|
||||||
|
public string StocktakingUser
|
||||||
|
{
|
||||||
|
get { return stocktakingUser; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref stocktakingUser, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 盘点状态列表
|
||||||
|
/// </summary>
|
||||||
|
private List<string> stocktakingStatuses = new List<string>();
|
||||||
|
public List<string> StocktakingStatuses
|
||||||
|
{
|
||||||
|
get { return stocktakingStatuses; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref stocktakingStatuses, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string selectedStocktakingStatus;
|
||||||
|
public string SelectedStocktakingStatus
|
||||||
|
{
|
||||||
|
get { return selectedStocktakingStatus; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref selectedStocktakingStatus, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Command
|
||||||
|
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||||
|
public void BtnReset()
|
||||||
|
{
|
||||||
|
MatCode = string.Empty;
|
||||||
|
MatName = string.Empty;
|
||||||
|
StocktakingUser = string.Empty;
|
||||||
|
SelectedStocktakingStatus = StocktakingStatuses.Where(t => t.Contains("未提交")).First();
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
var isSelected = Enum.TryParse<StocktakingStatusEnum>(SelectedStocktakingStatus, out StocktakingStatusEnum status);
|
||||||
|
#region 调用接口获取数据
|
||||||
|
var dia = Dialog.Show(new TextDialog());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new GetStocktakingInfosRequest()
|
||||||
|
{
|
||||||
|
MatCode = MatCode,
|
||||||
|
MatName = MatName,
|
||||||
|
StocktakingUser = StocktakingUser,
|
||||||
|
StocktakingStatus = isSelected ? status : null,
|
||||||
|
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
PageNumber = CurrentPage,
|
||||||
|
PageSize = PageSize,
|
||||||
|
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatDetailStocktakingInfoModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/getStocktakingInfos", body, "POST");
|
||||||
|
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||||
|
{
|
||||||
|
DataGridItemSource = new ObservableCollection<MatDetailStocktakingInfoModel>(Result.Data.Lists);
|
||||||
|
MaxPage = Result.Data.MaxPage;
|
||||||
|
TotalCount = Result.Data.TotalCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("加载数据失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
dia.Close();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料删除操作
|
||||||
|
/// </summary>
|
||||||
|
public ICommand BtnCommitCommand { get => new DelegateCommand(BtnCommit); }
|
||||||
|
public async void BtnCommit()
|
||||||
|
{
|
||||||
|
Growl.Ask($"是否提交所有勾选的数据?", isConfirmed =>
|
||||||
|
{
|
||||||
|
if (isConfirmed)
|
||||||
|
{
|
||||||
|
//查询勾选的第一个数据
|
||||||
|
var needDeleteIds = DataGridItemSource?.Where(t => t.IsSelected == true)
|
||||||
|
.Select(t => t.Id)
|
||||||
|
.ToList();
|
||||||
|
if (needDeleteIds == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("请选择需要提交的数据!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var body = new DeleteInfosRequest()
|
||||||
|
{
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
needDeleteIds = needDeleteIds,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/commitStocktakingInfos", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
CurrentPage = 1;
|
||||||
|
Growl.Success("提交成功!" + Result?.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Error($"{Result?.Message?.ToString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料修改操作
|
||||||
|
/// </summary>
|
||||||
|
public ICommand BtnEditCommand { get => new DelegateCommand(BtnEdit); }
|
||||||
|
public async void BtnEdit()
|
||||||
|
{
|
||||||
|
//查询勾选的第一个数据
|
||||||
|
var matDetailStocktakingInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
|
||||||
|
if (matDetailStocktakingInfo == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("请选择需要修改的数据!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var updateView = new MatDetailStocktakingInfoUpdateView("修改盘点数据", matDetailStocktakingInfo);
|
||||||
|
updateView.ShowDialog();
|
||||||
|
if (updateView.DialogResult == true)
|
||||||
|
{
|
||||||
|
matDetailStocktakingInfo = updateView.matDetailStocktakingInfo;
|
||||||
|
var body = new UpdateStocktakingInfoRequest()
|
||||||
|
{
|
||||||
|
MatDetailStocktakingInfoId = matDetailStocktakingInfo.Id,
|
||||||
|
StocktakingQty = matDetailStocktakingInfo.StocktakingQty,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/updateStocktakingInfos", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
CurrentPage = 1;
|
||||||
|
Growl.Success("修改成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Error($"{Result?.Message?.ToString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料删除操作
|
||||||
|
/// </summary>
|
||||||
|
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||||
|
public async void BtnDelete()
|
||||||
|
{
|
||||||
|
Growl.Ask($"是否删除所有勾选得数据]!", isConfirmed =>
|
||||||
|
{
|
||||||
|
if (isConfirmed)
|
||||||
|
{
|
||||||
|
//查询勾选的第一个数据
|
||||||
|
var needDeleteIds = DataGridItemSource?.Where(t => t.IsSelected == true)
|
||||||
|
.Select(t => t.Id)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (needDeleteIds == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("请选择需要修改的数据!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var body = new DeleteInfosRequest()
|
||||||
|
{
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
needDeleteIds = needDeleteIds,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/deleteStocktakingInfos", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
CurrentPage = 1;
|
||||||
|
Growl.Success("删除成功!" + Result?.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Error($"{Result?.Message?.ToString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#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); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private int pageSize = 10;
|
||||||
|
public int PageSize
|
||||||
|
{
|
||||||
|
get => pageSize;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref pageSize, value);
|
||||||
|
BtnSearch(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
409
货架标准上位机/Views/AGVTaskView.xaml
Normal file
409
货架标准上位机/Views/AGVTaskView.xaml
Normal file
@ -0,0 +1,409 @@
|
|||||||
|
<pi:UserControlBase xmlns:pi="https://github.com/ping9719/wpfex"
|
||||||
|
x:Class="智慧物流软件系统.AGVTaskView"
|
||||||
|
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"
|
||||||
|
LoadedVisibleFirst="LoadedVisible">
|
||||||
|
<Border Margin="0"
|
||||||
|
Background="AliceBlue"
|
||||||
|
CornerRadius="3"
|
||||||
|
Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"></RowDefinition>
|
||||||
|
<RowDefinition Height="10*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Border Grid.Row="0"
|
||||||
|
Margin="5 5 5 0"
|
||||||
|
Background="AliceBlue"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Text="盘点状态:"
|
||||||
|
FontSize="18"></TextBlock>
|
||||||
|
<ComboBox Grid.Column="3"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
FontSize="18"
|
||||||
|
MinWidth="90"
|
||||||
|
ItemsSource="{Binding StocktakingStatuses}"
|
||||||
|
SelectedValue="{Binding SelectedStocktakingStatus}">
|
||||||
|
</ComboBox>
|
||||||
|
<TextBlock Grid.Column="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Text="物料编码:"
|
||||||
|
FontSize="18"></TextBlock>
|
||||||
|
<TextBox Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
FontSize="18"
|
||||||
|
MinWidth="90"
|
||||||
|
Text="{Binding MatCode}"></TextBox>
|
||||||
|
<TextBlock Grid.Column="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Text="起点:"
|
||||||
|
FontSize="18"></TextBlock>
|
||||||
|
<TextBox Grid.Column="5"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
FontSize="18"
|
||||||
|
MinWidth="90"
|
||||||
|
Text="{Binding StartPoint}"></TextBox>
|
||||||
|
<TextBlock Grid.Column="6"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Text="终点:"
|
||||||
|
FontSize="18">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBox Grid.Column="7"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
FontSize="18"
|
||||||
|
MinWidth="90"
|
||||||
|
Text="{Binding EndPoint}"></TextBox>
|
||||||
|
|
||||||
|
<Button Style="{StaticResource ButtonSuccess}"
|
||||||
|
hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Column="9"
|
||||||
|
MinHeight="40"
|
||||||
|
FontSize="18"
|
||||||
|
Content=" 搜索"
|
||||||
|
FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnSearchCommand}"></Button>
|
||||||
|
<Button Style="{StaticResource ButtonWarning}"
|
||||||
|
hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Column="10"
|
||||||
|
MinHeight="40"
|
||||||
|
FontSize="18"
|
||||||
|
Content=" 重置"
|
||||||
|
FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnResetCommand}"></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="9*"></RowDefinition>
|
||||||
|
<RowDefinition Height="0.8*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel Grid.Row="0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button MinHeight="40"
|
||||||
|
FontSize="18"
|
||||||
|
Margin="5"
|
||||||
|
Content="提 交"
|
||||||
|
FontFamily="{StaticResource IconFont}"
|
||||||
|
Foreground="WhiteSmoke"
|
||||||
|
Background="HotPink"
|
||||||
|
Command="{Binding BtnCommitCommand}"></Button>
|
||||||
|
<Button MinHeight="40"
|
||||||
|
FontSize="18"
|
||||||
|
Margin="5"
|
||||||
|
Content="修 改"
|
||||||
|
FontFamily="{StaticResource IconFont}"
|
||||||
|
Foreground="WhiteSmoke"
|
||||||
|
Background="CadetBlue"
|
||||||
|
Command="{Binding BtnEditCommand}"></Button>
|
||||||
|
<Button MinHeight="40"
|
||||||
|
FontSize="18"
|
||||||
|
Margin="5"
|
||||||
|
Content="删 除"
|
||||||
|
FontFamily="{StaticResource IconFont}"
|
||||||
|
Foreground="WhiteSmoke"
|
||||||
|
Command="{Binding BtnDeleteCommand}"
|
||||||
|
Style="{StaticResource ButtonDanger}"></Button>
|
||||||
|
</StackPanel>
|
||||||
|
<DataGrid Grid.Row="1"
|
||||||
|
SelectionChanged="DataGrid_SelectionChanged"
|
||||||
|
SelectedItem="{Binding SelectedataGridItem}"
|
||||||
|
Name="dataGrid"
|
||||||
|
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
RowHeight="39"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
FontSize="13">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn CanUserResize="False">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox Width="30"
|
||||||
|
Height="30"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
IsChecked="{Binding IsSelected}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox Width="30"
|
||||||
|
Height="30"
|
||||||
|
Unchecked="allChecked_Unchecked"
|
||||||
|
Checked="allChecked_Checked"
|
||||||
|
Name="allChecked" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True"
|
||||||
|
Header="序号"
|
||||||
|
Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="物料编码"
|
||||||
|
Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="物料名称"
|
||||||
|
MaxWidth="150"
|
||||||
|
Binding="{Binding MatName}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="物料规格"
|
||||||
|
MaxWidth="150"
|
||||||
|
Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="货架编号"
|
||||||
|
Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="货架区域"
|
||||||
|
Binding="{Binding ShelfArea}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="原数量"
|
||||||
|
Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="盘点数量"
|
||||||
|
Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True"
|
||||||
|
Header="盘点人"
|
||||||
|
Binding="{Binding StocktakingUser}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True"
|
||||||
|
Header="盘点时间"
|
||||||
|
Binding="{Binding StocktakingTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True"
|
||||||
|
Header="盘点状态"
|
||||||
|
Binding="{Binding StocktakingStatus}"></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"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Margin="5">
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="共"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="条记录 "></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="第"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="/"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||||
|
<TextBlock FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="页 "></TextBlock>
|
||||||
|
<ComboBox FontSize="14"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
SelectedValue="{Binding PageSize}"
|
||||||
|
SelectedValuePath="Tag">
|
||||||
|
<ComboBoxItem Tag="10"
|
||||||
|
IsSelected="True">10条/页</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
|
</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>
|
||||||
|
<!--<Border Grid.Row="1" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="0.8*"></RowDefinition>
|
||||||
|
<RowDefinition Height="8*"></RowDefinition>
|
||||||
|
<RowDefinition Height="0.7*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
|
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnExportCommand}"
|
||||||
|
Content=" 导 出" FontFamily="{StaticResource IconFont}"
|
||||||
|
Style="{StaticResource ButtonWarning}" Background="DarkOrange">
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<DataGrid Grid.Row="1"
|
||||||
|
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
RowHeight="39"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
FontSize="13">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="接口地址" Binding="{Binding RequestUrl}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="设备IP" Binding="{Binding DeviceIp}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="请求参数" Binding="{Binding RequestBody}" MaxWidth="100"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="QueryString" Binding="{Binding QueryString}" MaxWidth="100"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="请求时间" Binding="{Binding RequestTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="返回参数" Binding="{Binding ResponseJson}" MaxWidth="100"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="返回时间" Binding="{Binding ResponseTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="耗时(ms)" Binding="{Binding ExecutionTime}"></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>
|
77
货架标准上位机/Views/AGVTaskView.xaml.cs
Normal file
77
货架标准上位机/Views/AGVTaskView.xaml.cs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
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 智慧物流软件系统.ViewModel;
|
||||||
|
|
||||||
|
namespace 智慧物流软件系统
|
||||||
|
{
|
||||||
|
public partial class AGVTaskView : UserControlBase
|
||||||
|
{
|
||||||
|
public MatDetailStocktakingInfoViewModel viewModel { get; set; } = new MatDetailStocktakingInfoViewModel();
|
||||||
|
public AGVTaskView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadedVisible(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.BtnReset();
|
||||||
|
viewModel.BtnSearchReset();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (viewModel.SelectedataGridItem != null)
|
||||||
|
{
|
||||||
|
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||||
|
dataGrid.UnselectAllCells();//取消选中 避免手动点击check选项时反选失败 和重新点击该项时反选失败
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in viewModel.DataGridItemSource)
|
||||||
|
{
|
||||||
|
item.IsSelected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in viewModel.DataGridItemSource)
|
||||||
|
{
|
||||||
|
item.IsSelected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -241,7 +241,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
<View:InOutRecordView />
|
<View:AGVTaskView />
|
||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user