Files
qhmes/yy-admin-master/YY.Admin/Views/WeightRecord/WeightRecordEditDialogView.xaml

220 lines
13 KiB
XML

<UserControl x:Class="YY.Admin.Views.WeightRecord.WeightRecordEditDialogView"
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:hc="https://handyorg.github.io/handycontrol"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
Width="720"
MinHeight="500">
<Grid Background="{DynamicResource ThirdlyRegionBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 标题栏 -->
<hc:SimplePanel Margin="20">
<TextBlock FontSize="18" Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding DialogTitle}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}"
Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}"
Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
</hc:SimplePanel>
<!-- 表单区域 -->
<hc:ScrollViewer Grid.Row="1" IsInertiaEnabled="True">
<StackPanel Margin="20,0,20,0">
<hc:Row Gutter="10">
<!-- 磅单号 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.BillNo, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="磅单号"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="留空则自动生成"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 称重日期 -->
<hc:Col Span="12">
<hc:DatePicker SelectedDate="{Binding Record.WeighDate}"
hc:InfoElement.Title="称重日期"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Necessary="True"
hc:InfoElement.Symbol="*"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 进出方向 -->
<hc:Col Span="12">
<hc:ComboBox SelectedValuePath="Value"
DisplayMemberPath="Key"
ItemsSource="{Binding InoutDirectionOptions}"
SelectedValue="{Binding Record.InoutDirection}"
hc:InfoElement.Title="进出方向"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Necessary="True"
hc:InfoElement.Symbol="*"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 车牌号 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.PlateNumber, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="车牌号"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="请输入车牌号"
hc:InfoElement.Necessary="True"
hc:InfoElement.Symbol="*"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 发货单位 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.SenderUnit, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="发货单位"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="进厂时为供应商名称"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 收货单位 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.ReceiverUnit, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="收货单位"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="出厂时为客户简称"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 密炼物料 -->
<hc:Col Span="24">
<Grid Margin="0,0,0,16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="32"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="密炼物料" VerticalAlignment="Center"
FontSize="14" Foreground="{DynamicResource PrimaryTextBrush}"/>
<Border Grid.Column="1" CornerRadius="4" Height="32"
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
Background="{DynamicResource RegionBrush}">
<TextBlock Text="{Binding MixerMaterialDisplay}" VerticalAlignment="Center"
Margin="8,0" FontSize="13" TextTrimming="CharacterEllipsis">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedMixerMaterials}" Value="True">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Border>
<Button Grid.Column="2" Content="选 择"
Command="{Binding OpenMixerMaterialPickerCommand}"
Style="{StaticResource ButtonDefault}"
Height="32" Margin="6,0,0,0" FontSize="12"/>
<Button Grid.Column="3" Command="{Binding ClearMixerMaterialCommand}"
Style="{StaticResource ButtonIcon}"
Height="32" Width="28" Margin="4,0,0,0" Padding="0"
ToolTip="清除选择"
Foreground="{DynamicResource SecondaryTextBrush}"
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
</Grid>
</hc:Col>
<!-- 毛重 -->
<hc:Col Span="12">
<hc:NumericUpDown Value="{Binding Record.GrossWeight}"
Minimum="0"
DecimalPlaces="2"
Style="{StaticResource NumericUpDownPlus}"
hc:InfoElement.Title="毛重(KG)"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="请输入毛重"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 皮重 -->
<hc:Col Span="12">
<hc:NumericUpDown Value="{Binding Record.TareWeight}"
Minimum="0"
DecimalPlaces="2"
Style="{StaticResource NumericUpDownPlus}"
hc:InfoElement.Title="皮重(KG)"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="请输入皮重"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 净重(只读) -->
<hc:Col Span="12">
<hc:NumericUpDown Value="{Binding Record.NetWeight}"
Minimum="0"
DecimalPlaces="2"
Style="{StaticResource NumericUpDownPlus}"
IsEnabled="True"
hc:InfoElement.Title="净重(KG)"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="自动计算"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 司机 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.DriverName, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="司机姓名"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="请输入司机姓名"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 手机号 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Record.DriverPhone, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="手机号码"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.Placeholder="请输入手机号"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
</hc:Row>
</StackPanel>
</hc:ScrollViewer>
<!-- 按钮区域 -->
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="20">
<Button Content="取消" Command="{Binding CancelCommand}" Style="{StaticResource ButtonDefault}" Margin="0,0,15,0" Width="100"/>
<Button Content="确定" Command="{Binding SaveCommand}" Style="{StaticResource ButtonPrimary}" Width="100"/>
</StackPanel>
</Grid>
</UserControl>