修改统计功能 使用新API接口

This commit is contained in:
chfei committed 2026-10-08 12:07:30 +08:00
1 parent 03f71a5d64
commit 8431a8f6b0
6 files changed
+1117 -708

No files matched your search

@@ -1,15 +1,20 @@
<UserControl
<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="clr-namespace:_29WxOrderWpf.Common"
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="800"
Focusable="True"
PreviewKeyDown="ShowOrderDialogView_PreviewKeyDown"
mc:Ignorable="d">
<UserControl.Resources>
<!-- 单元格文字居中 -->
@@ -18,6 +23,21 @@
<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>
@@ -36,15 +56,15 @@
Width="180"
Placement="Left"
TitleVerticalAlignment="Center">
<TextBox Height="22" Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}" />
<TextBox
Height="22"
Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}"
ToolTip="按订单号筛选;表格内可用 Ctrl+A 全选、Ctrl+C 复制数据" />
</wpf:TitleContent>
<Button
Command="{Binding SelectAllCommand}"
Content="复制数据"
Style="{StaticResource BaseButtonLightStyle}" />
</wpf:SpacingStackPanel>
</Border>
<DataGrid
x:Name="dgOrders"
Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=10}"
AlternatingRowBackground="#FAFAFA"
@@ -55,6 +75,7 @@
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeRows="False"
CellStyle="{StaticResource SelectedCellStyle}"
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
GridLinesVisibility="Horizontal"
HeadersVisibility="Column"
@@ -62,14 +83,9 @@
IsReadOnly="True"
ItemsSource="{Binding DataView}"
RowHeight="44"
SelectionMode="Single"
SelectionMode="Extended"
SelectionUnit="FullRow"
VerticalScrollBarVisibility="Auto">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<!-- 店名 -->
<DataGridTextColumn
@@ -93,7 +109,6 @@
<Button
Margin="5,0,0,0"
Click="CopyOrderId_Click"
Foreground="{StaticResource pageColorBrush}"
ToolTip="复制订单号">
<Button.Style>
<Style BasedOn="{StaticResource IconButtonStyle}" TargetType="Button">
@@ -113,6 +128,13 @@
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- 创建时间 -->
<DataGridTextColumn
Width="1.4*"
Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
ElementStyle="{StaticResource CenterCellTextStyle}"
Header="创建时间" />
<!-- 金额(分转元) -->
<DataGridTextColumn
Width="*"
@@ -121,7 +143,7 @@
Header="金额" />
<DataGridTextColumn
Width="*"
Binding="{Binding RefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
Binding="{Binding OrderRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
ElementStyle="{StaticResource CenterCellTextStyle}"
Header="退款金额" />
<DataGridTextColumn
@@ -129,6 +151,33 @@
Binding="{Binding OutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
ElementStyle="{StaticResource CenterCellTextStyle}"
Header="外采金额" />
<DataGridTextColumn
Width="*"
Binding="{Binding UnrefundedAmount, 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="退款状态" />
</DataGrid.Columns>
</DataGrid>
</Grid>