add-物料库存型号数量显示

foamRearStore
liuwf 9 months ago
parent 75c33581cf
commit 873f85f369

Binary file not shown.

@ -183,10 +183,33 @@
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="发 泡 夹 具 状 态" Foreground="#FFFFFF" FontSize="20"/>
<TextBlock Text="泡 后 库 库 存" Foreground="#FFFFFF" FontSize="20"/>
</StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding FoamMaterialStockDataGrid}" Background="Transparent"
FontSize="20" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding typeNameA}" Header="物料型号" Width="2*" IsReadOnly="True"/>
<!--<DataGridTextColumn Binding="{Binding executePlanCode}" Header="物料编码" Width="1*" IsReadOnly="True"/>-->
<DataGridTextColumn Binding="{Binding spaceStock}" Header="在库数量" Width="1*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<!--<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="发 泡 夹 具 状 态" Foreground="#FFFFFF" FontSize="20"/>
</StackPanel>
</Grid>-->
</Border>
<Border Grid.Row="2" Grid.Column="1" BorderBrush="#1254AB" BorderThickness="2">

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2B679D4B17100EEB1BD654A7535A71C0857A955CFA0EB5E7BDC2D6ACEF450324"
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1822B6B242A4BF94E086D4EB3617AA3D8297B861C3B64EC9131DE8D2CF4F6CAA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2B679D4B17100EEB1BD654A7535A71C0857A955CFA0EB5E7BDC2D6ACEF450324"
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1822B6B242A4BF94E086D4EB3617AA3D8297B861C3B64EC9131DE8D2CF4F6CAA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -60,6 +60,18 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
get { return foamBeforeMaterialStockDataGrid; }
set { foamBeforeMaterialStockDataGrid = value; RaisePropertyChanged(() => FoamBeforeMaterialStockDataGrid); }
}
/// <summary>
/// 泡后库物料库存DataGrid
/// </summary>
private ObservableCollection<BaseSpaceInfo> foamMaterialStockDataGrid;
public ObservableCollection<BaseSpaceInfo> FoamMaterialStockDataGrid
{
get { return foamMaterialStockDataGrid; }
set { foamMaterialStockDataGrid = value; RaisePropertyChanged(() => FoamMaterialStockDataGrid); }
}
#endregion
@ -119,7 +131,41 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
if (string.IsNullOrEmpty(item.materialType)) continue;
FoamBeforeMaterialStockDataGrid.Add(new BaseSpaceInfo() { materialType = item.materialType, spaceStock = item.spaceStock });
}
//泡后库物料库存
FoamMaterialStockDataGrid = new ObservableCollection<BaseSpaceInfo>();
List<BaseSpaceInfo> foamList = _inventoryInfoBusiness.GetSpaceInfos(appConfig.foamStoreCode);
var foamResult = from m in foamList
group m by m.typeNameA into g
select new BaseSpaceInfo()
{
typeNameA = GetStringBetweenCommas(g.Key),
spaceStock = g.Sum(m => m.spaceStock)
};
foreach (var item in foamResult)
{
if (string.IsNullOrEmpty(item.typeNameA)) continue;
FoamMaterialStockDataGrid.Add(new BaseSpaceInfo() { typeNameA = item.typeNameA, spaceStock = item.spaceStock });
}
}
public static string GetStringBetweenCommas(string input)
{
if (string.IsNullOrEmpty(input)) return null;
int firstCommaIndex = input.IndexOf(',');
if (firstCommaIndex != -1)
{
int secondCommaIndex = input.IndexOf(',', firstCommaIndex + 1);
if (secondCommaIndex != -1)
{
return input.Substring(firstCommaIndex + 1, secondCommaIndex - firstCommaIndex - 1);
}
}
return null;
}
private void CloseWindow(object parameter)
{

Loading…
Cancel
Save