提交代码
This commit is contained in:
@ -27,6 +27,8 @@ using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using HandyControl.Tools.Extension;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
using System.Collections.ObjectModel;
|
||||
using static 货架标准上位机.ViewModel.InOutRecordViewModel;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
@ -162,6 +164,44 @@ namespace 货架标准上位机.ViewModel
|
||||
SetProperty(ref matSN, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DirectionEnum? selectedDirection;
|
||||
public DirectionEnum? SelectedDirection
|
||||
{
|
||||
get { return selectedDirection; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedDirection, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<DirectionItem> Directions => GetEnumValues();
|
||||
private ObservableCollection<DirectionItem> GetEnumValues()
|
||||
{
|
||||
// 初始化ObservableCollection
|
||||
var directions = new ObservableCollection<DirectionItem>();
|
||||
// 添加“全部”选项
|
||||
directions.Add(new DirectionItem { Text = "全部", Value = null }); // Value设置为null或某个表示“全部”的值
|
||||
|
||||
// 遍历DirectionEnum枚举并添加项
|
||||
foreach (DirectionEnum direction in Enum.GetValues(typeof(DirectionEnum)))
|
||||
{
|
||||
directions.Add(new DirectionItem { Text = direction.ToString(), Value = direction });
|
||||
}
|
||||
return directions;
|
||||
}
|
||||
|
||||
public class DirectionItem
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
@ -192,11 +232,13 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
var body = new GetInOutRecordRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
|
||||
MatSN = MatSN,
|
||||
MatName = MatName,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
Direction = SelectedDirection,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
@ -90,7 +90,7 @@ namespace 货架标准上位机.ViewModels
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
#region 调用接口获取单据
|
||||
try
|
||||
{
|
||||
var body = new GetStockTakingOrdersRequest()
|
||||
@ -113,7 +113,7 @@ namespace 货架标准上位机.ViewModels
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
Growl.Error("加载单据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -138,20 +138,20 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
//判断是否勾选单据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
#region 调用接口获取单据
|
||||
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
@ -203,19 +203,19 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
//判断是否勾选单据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
#region 调用接口获取单据
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
@ -267,15 +267,15 @@ namespace 货架标准上位机.ViewModels
|
||||
//是否已搜索
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
//判断是否已勾选数据
|
||||
//判断是否已勾选单据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -321,15 +321,15 @@ namespace 货架标准上位机.ViewModels
|
||||
//是否已搜索
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
//判断是否已勾选数据
|
||||
//判断是否已勾选单据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -364,6 +364,59 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnCommitCommand { get => new DelegateCommand(BtnCommit); }
|
||||
public void BtnCommit()
|
||||
{
|
||||
try
|
||||
{
|
||||
//是否已搜索
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
//判断是否已勾选单据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口提交盘点
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectetOrder.Id,
|
||||
StockTakingOrderNumber = selectetOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/commitStockTakingOrder", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("单据已提交,库存数据已修改!");
|
||||
BtnSearch();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
|
@ -54,7 +54,7 @@
|
||||
ItemsSource="{Binding Items}"
|
||||
Text="{Binding MatCode}"
|
||||
DisplayMemberPath="MatCode"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="2" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料名称:" FontSize="18" ></TextBlock>
|
||||
@ -62,6 +62,14 @@
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="2" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text=" 库 位 :" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding StoreCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="4" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料批次:" FontSize="18" ></TextBlock>
|
||||
@ -69,19 +77,24 @@
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="2" Margin="5"
|
||||
<TextBlock Grid.Row="2" Grid.Column="4" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料条码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding MatSN}"
|
||||
<TextBox Grid.Row="2" Grid.Column="5" Text="{Binding MatSN}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text=" 库 位 :" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding StoreCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="160" ></TextBox>
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text=" 类 型 :" FontSize="18" ></TextBlock>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1"
|
||||
ItemsSource="{Binding Directions}"
|
||||
DisplayMemberPath="Text"
|
||||
SelectedValuePath="Value"
|
||||
SelectedValue="{Binding SelectedDirection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
FontSize="18"
|
||||
Height="20"
|
||||
IsEditable="False"/>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
Margin="2"
|
||||
@ -121,14 +134,17 @@
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="100" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已锁定" Binding="{Binding IsLockedStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="入库时间" Binding="{Binding InstoreTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="100" Header="供应商" Binding="{Binding MatSupplier}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="100" Header="客户" Binding="{Binding MatCustomer}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="类型" Binding="{Binding Direction}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="操作人" Binding="{Binding OperateUser}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="操作时间" Binding="{Binding OperateTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
@ -121,7 +121,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="绑定后货架编码:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="txtBindShelfCode" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
|
||||
<TextBox Name="txtBindShelfCode" MinWidth="150" MaxWidth="150" Grid.Row="0" Grid.Column="1" FontSize="15"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
Text="{Binding BindShelfCode}"
|
||||
Style="{StaticResource TextBoxExtend}">
|
||||
|
@ -91,6 +91,10 @@
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnPauseCommand}"
|
||||
Content="暂停盘点" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White">
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnCommitCommand}"
|
||||
Content="提交盘点" FontFamily="{StaticResource IconFont}" Background="SaddleBrown" Foreground="White">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
|
Reference in New Issue
Block a user