Files
qhmes/yy-admin-master/YY.Admin/Views/Vehicle/VehicleEditDialogView.xaml

166 lines
9.1 KiB
XML

<UserControl x:Class="YY.Admin.Views.Vehicle.VehicleEditDialogView"
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="700"
MinHeight="400">
<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 x:Name="RootPanel" Margin="20,0,20,0">
<hc:Row Gutter="10">
<!-- 车牌号 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Vehicle.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:ComboBox SelectedValuePath="Value"
DisplayMemberPath="Key"
ItemsSource="{Binding VehicleBelongOptions}"
SelectedValue="{Binding Vehicle.VehicleBelong}"
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:NumericUpDown Value="{Binding Vehicle.TareWeightKg}"
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 Vehicle.LoadCapacity}"
Minimum="0"
DecimalPlaces="2"
Style="{StaticResource NumericUpDownPlus}"
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 Vehicle.CustomerShortName, 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 Vehicle.SupplierName, 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 Vehicle.SupplierShortName, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="供应商简称"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,16"/>
</hc:Col>
<!-- 司机 -->
<hc:Col Span="12">
<hc:TextBox Text="{Binding Vehicle.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 Vehicle.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:Col Span="12">
<hc:ComboBox SelectedValuePath="Value"
DisplayMemberPath="Key"
ItemsSource="{Binding StatusOptions}"
SelectedValue="{Binding Vehicle.Status}"
hc:InfoElement.Title="状态"
hc:InfoElement.TitleWidth="80"
hc:InfoElement.TitlePlacement="Left"
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>