add-库位信息界面添加过道展示

dev
liuwf 4 days ago
parent 8405d6a397
commit c74a686824

@ -122,12 +122,114 @@ namespace SlnMesnac.WPF.Page
List<WmsBaseLocation> locations = wmsBaseLocations.Where(t => t.WarehouseId == list[i]).ToList();
var row = locations.Max(t => t.LocRow);
column = locations.Max(t => t.LocColumn);
if (list[0] == 231 && i == 0)
{
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
for(int h=0; h < 25; h++)
{
var button2 = new Button()
{
Content = "过道",
Name = "road1",
Width = 40,
Height = 25,
FontSize = 15,
Margin = new Thickness(0),
Background = new SolidColorBrush(Colors.Transparent),
Foreground = new SolidColorBrush(Colors.White),
};
var button3 = new Button()
{
Content = "过道",
Name = "road2",
Width = 40,
Height = 25,
FontSize = 15,
Margin = new Thickness(0),
Background = new SolidColorBrush(Colors.Transparent),
Foreground = new SolidColorBrush(Colors.White),
};
Grid.SetColumn(button2, h );
Grid.SetRow(button2, 2);
Grid.SetColumnSpan(button2, 2);
grid.Children.Add(button2);
Grid.SetColumn(button3, h);
Grid.SetRow(button3, 5);
Grid.SetColumnSpan(button3, 2);
grid.Children.Add(button3);
}
}else if(list[0] == 311 && i == 0)
{
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
for(int h=0; h < 25; h++)
{
var button2 = new Button()
{
Content = "过道",
Name = "road1",
Width = 40,
Height = 25,
FontSize = 15,
Margin = new Thickness(0),
Background = new SolidColorBrush(Colors.Transparent),
Foreground = new SolidColorBrush(Colors.White),
};
var button3 = new Button()
{
Content = "过道",
Name = "road2",
Width = 40,
Height = 25,
FontSize = 15,
Margin = new Thickness(0),
Background = new SolidColorBrush(Colors.Transparent),
Foreground = new SolidColorBrush(Colors.White),
};
var button4 = new Button()
{
Content = "过道",
Name = "road2",
Width = 40,
Height = 25,
FontSize = 15,
Margin = new Thickness(0),
Background = new SolidColorBrush(Colors.Transparent),
Foreground = new SolidColorBrush(Colors.White),
};
Grid.SetColumn(button2, h );
Grid.SetRow(button2, 2);
Grid.SetColumnSpan(button2, 2);
grid.Children.Add(button2);
Grid.SetColumn(button3, h);
Grid.SetRow(button3, 6);
Grid.SetColumnSpan(button3, 2);
grid.Children.Add(button3);
Grid.SetColumn(button4, h);
Grid.SetRow(button4, 7);
Grid.SetColumnSpan(button4, 2);
grid.Children.Add(button4);
}
}
for (var j = 0; j < row; j++)
for (var j = 0; j < row+1; j++)
{
grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) });
}
@ -151,7 +253,17 @@ namespace SlnMesnac.WPF.Page
Grid.SetColumn(button, location.LocColumn.Value - 1);
if (list[0] == 231)
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 2);
if(location.LocRow.Value <= 2)
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 4);
}
else
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 3);
}
for (var k = 0; k < 8; k++)
{
var button2 = new Button()
@ -172,7 +284,22 @@ namespace SlnMesnac.WPF.Page
}
else
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value));
if(location.LocRow.Value <= 2)
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value)+3);
}else if(location.LocRow.Value <= 4 && location.LocRow.Value > 2)
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value) +2);
}else if(location.LocRow.Value<=6 && location.LocRow.Value > 4)
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value)+1);
}
else
{
Grid.SetRow(button, -(location.LocRow.Value - row.Value));
}
if (list[0] == 311)
{
for (var k = 0; k < 3; k++)

Loading…
Cancel
Save