238 lines
8.7 KiB
XML
238 lines
8.7 KiB
XML
<UserControl
|
|
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShowOrderDialogView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:comn="WxOrder.Framework"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:wpf="WPFCommon"
|
|
comn:DialogWindowProperty.Height="620"
|
|
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
|
comn:DialogWindowProperty.Width="1320"
|
|
d:Background="White"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="1000"
|
|
Focusable="True"
|
|
PreviewKeyDown="ShowOrderDialogView_PreviewKeyDown"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<wpf:BindingProxy x:Key="ViewModel" Data="{Binding}" />
|
|
<!-- 单元格文字居中 -->
|
|
<Style x:Key="CenterCellTextStyle" TargetType="TextBlock">
|
|
<Setter Property="TextAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
<!--
|
|
选中行高亮:用主题色填充选中行,并且不区分表格是否拥有焦点
|
|
(默认样式的选中色在焦点离开表格后会变成浅灰,点了“复制数据”就看不出选中了哪些行)
|
|
-->
|
|
<Style x:Key="SelectedCellStyle" TargetType="DataGridCell">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Style.Triggers>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="{StaticResource pageColorBrush}" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Grid.Row="0"
|
|
Padding="10"
|
|
BorderBrush="Gray"
|
|
BorderThickness="0,0,0,1">
|
|
<wpf:SpacingStackPanel HorizontalSpacing="10" Orientation="Horizontal">
|
|
<wpf:TitleContent
|
|
Title="订单号:"
|
|
Width="180"
|
|
Placement="Left"
|
|
TitleVerticalAlignment="Center">
|
|
<TextBox
|
|
Height="22"
|
|
Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}"
|
|
ToolTip="按订单号筛选;表格内可用 Ctrl+A 全选、Ctrl+C 复制数据" />
|
|
</wpf:TitleContent>
|
|
</wpf:SpacingStackPanel>
|
|
</Border>
|
|
<DataGrid
|
|
x:Name="dgOrders"
|
|
Grid.Row="1"
|
|
d:ItemsSource="{d:SampleData ItemCount=10}"
|
|
AlternatingRowBackground="#FAFAFA"
|
|
AutoGenerateColumns="False"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
CanUserAddRows="False"
|
|
CanUserDeleteRows="False"
|
|
CanUserReorderColumns="False"
|
|
CanUserResizeRows="False"
|
|
CellStyle="{StaticResource SelectedCellStyle}"
|
|
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
|
|
GridLinesVisibility="Horizontal"
|
|
HeadersVisibility="Column"
|
|
HorizontalGridLinesBrush="#EEEEEE"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding DataView}"
|
|
RowHeight="44"
|
|
SelectionMode="Extended"
|
|
SelectionUnit="FullRow"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<DataGrid.Columns>
|
|
<!-- 店名 -->
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding ShopName}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="店名" />
|
|
|
|
<!-- 订单(可复制) -->
|
|
<DataGridTemplateColumn Width="2*" Header="订单">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Text="{Binding OrderId}"
|
|
ToolTip="点击“复制”复制订单号" />
|
|
<Button
|
|
Margin="5,0,0,0"
|
|
Click="CopyOrderId_Click"
|
|
ToolTip="复制订单号">
|
|
<Button.Style>
|
|
<Style BasedOn="{StaticResource IconButtonStyle}" TargetType="Button">
|
|
<Setter Property="Foreground" Value="{StaticResource pageColorBrush}" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow}, Path=IsSelected}" Value="True">
|
|
<Setter Property="Foreground" Value="White" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
<TextBlock Style="{StaticResource TextBlockIcon}" Text="{StaticResource txt-copy}" />
|
|
|
|
</Button>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
|
|
<!-- 创建时间 -->
|
|
<DataGridTextColumn
|
|
Width="1.4*"
|
|
Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="创建时间" />
|
|
|
|
<!-- 金额(分转元) -->
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding OrderPrice, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="金额" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding OrderRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="退款金额" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding PlatformFee, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="平台费用" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding ProfitAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="利润" />
|
|
|
|
<!-- 买手订单:一笔买手订单占一行,不合并 -->
|
|
<DataGridTextColumn
|
|
Width="1.6*"
|
|
Binding="{Binding OutOrderSn}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="买手单号" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding BuyerOutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="外采金额" />
|
|
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding BuyerRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="买手退款" />
|
|
<DataGridTextColumn
|
|
Width="1.1*"
|
|
Binding="{Binding BuyerRefundStatusText}"
|
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
|
Header="退款状态" />
|
|
<DataGridTextColumn
|
|
Width="1.1*"
|
|
Binding="{Binding Remark}"
|
|
Header="备注"
|
|
Visibility="{Binding Source={StaticResource ViewModel}, Path=Data.IsBuyerUnrefunded, Converter={StaticResource Boolean2VisibilityConverter}}">
|
|
<DataGridTextColumn.ElementStyle>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="ToolTip" Value="{Binding Remark}" />
|
|
</Style>
|
|
</DataGridTextColumn.ElementStyle>
|
|
</DataGridTextColumn>
|
|
<!-- 操作:仅“买手未退回金额的订单”弹窗显示(列可见性在构造函数里按订单明细类型设置) -->
|
|
<DataGridTemplateColumn
|
|
x:Name="colUpdateRefund"
|
|
Width="*"
|
|
d:Visibility="Visible"
|
|
Header="操作"
|
|
Visibility="Collapsed">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Button
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Command="{Binding Source={StaticResource ViewModel}, Path=Data.UpdateBuyerRefundStatusCommand}"
|
|
CommandParameter="{Binding}"
|
|
Content="确认成功"
|
|
Style="{StaticResource BasePageButtonLightStyle}"
|
|
ToolTip="把该笔买手订单标记为退款成功" />
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<DataGridTemplateColumn
|
|
x:Name="colRemark"
|
|
Width="*"
|
|
d:Visibility="Visible"
|
|
Header="操作"
|
|
Visibility="{Binding Source={StaticResource ViewModel}, Path=Data.IsBuyerUnrefunded, Converter={StaticResource Boolean2VisibilityConverter}}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Button
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Command="{Binding Source={StaticResource ViewModel}, Path=Data.UpdateRemarkCommand}"
|
|
CommandParameter="{Binding}"
|
|
Content="备注"
|
|
Style="{StaticResource BasePageButtonLightStyle}"
|
|
ToolTip="设置备注" />
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
</UserControl> |