步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
13 KiB

<Page x:Class="BBWY.Client.Views.PackTask.Consumable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding Consumable,Source={StaticResource Locator}}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1300"
Title="Consumable">
<!--DataContext="{Binding Consumable,Source={StaticResource Locator}}"-->
<Page.Resources>
<sys:Int32 x:Key="d0">0</sys:Int32>
<sys:Int32 x:Key="d1">1</sys:Int32>
<sys:Int32 x:Key="d3">2</sys:Int32>
<sys:Int32 x:Key="d7">6</sys:Int32>
<sys:Int32 x:Key="d15">14</sys:Int32>
<sys:Int32 x:Key="d30">29</sys:Int32>
</Page.Resources>
<Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="100" Margin="220 25 0 0" >
<c:BTextBox x:Name="consumableName" Width="150" Height="30" TextChanged="consumableName_TextChanged" Text="{Binding SearchName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="ListBox_SelectionChanged" Background="{StaticResource Border.Background}">
</ListBox>
</StackPanel>
<Grid Margin="0 10 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="54"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Stretch" Panel.ZIndex="10" Margin="10,5,0,0" >
<StackPanel Orientation="Horizontal" Height="35">
<!-- Command="{Binding AddConsumableCommand}"-->
<c:BButton Content="添加耗材" Width="118" VerticalAlignment="Stretch" Margin="15,0,0,0"
Command="{Binding AddConsumableCommand}"
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White">
</c:BButton>
<TextBlock Text="耗材品名:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Visibility="Hidden" Width="150" Height="30" />
<!--<TextBlock Text="耗材类型:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<ComboBox Width="100" Height="30" />-->
</StackPanel>
<Button Content="搜索" Height="35" Width="66" VerticalAlignment="Stretch" Margin="5,0,10,0"
Command="{Binding SearchConsumableCommand}" HorizontalAlignment="Right"
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
<Grid Grid.Row="1" Margin="0,29,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" Margin="10 0 5 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition/>
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
<TextBlock Text="耗材归类" Grid.Column="0" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="耗材品名" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="金额" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="重量" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="尺寸(cm)" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="备注" Grid.Column="5" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="6" Style="{StaticResource middleTextBlock}"/>
<Border Height="1" BorderBrush="{StaticResource Border.Brush}" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="7" BorderThickness="1"/>
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
</Grid>
<!--ItemsSource="{Binding OrderList}"-->
<ListBox x:Name="listbox_order" Margin="10 0 5 0"
Grid.Row="1"
ItemsSource="{Binding ConsumableList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,1,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="60">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<TextBlock
Text="{Binding ConsumableTypeName}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="1">
<TextBlock
Text="{Binding Name}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="2">
<TextBlock
Text="{Binding Price}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="3">
<TextBlock
Text="{Binding Weigth}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
TextWrapping="Wrap"
>
<Run Text="{Binding Length}"/>
<Run Text="*" />
<Run Text="{Binding Width}"/>
<Run Text="*" />
<Run Text="{Binding Heigth}"/>
</TextBlock>
</Grid>
<Grid Grid.Column="5" HorizontalAlignment="Center" VerticalAlignment="Center" >
<TextBlock TextAlignment="Center"
Text="{Binding Remark}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="6">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<c:BButton Background="Transparent" Foreground="Blue" Content="编辑" Command="{Binding EditConsumableCommand}" CommandParameter="" Margin="0 0 10 0"/>
<c:BButton Background="Transparent" Foreground="Blue" Content="删除" Command="{Binding DeletedConsumableCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}"
/>
</StackPanel>
</Grid>
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Height="1" VerticalAlignment="Bottom" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="7"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
Grid.Row="3"
HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers>
<b:EventTrigger EventName="OnPageIndexChanged">
<b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:PageControl>
</Grid>
</Grid>
</Page>