步步为盈
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.

289 lines
19 KiB

<Page x:Class="BBWY.Client.Views.FinancialTerminal.ProcurementAudit"
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.FinancialTerminal"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
mc:Ignorable="d"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
d:DesignHeight="450" d:DesignWidth="800"
Title="ProcurementAudit"
DataContext="{Binding ProcurementAudit,Source={StaticResource Locator}}">
<Page.Resources>
<ObjectDataProvider x:Key="auditCapitalTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:AuditCapitalType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="platformProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:Platform"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Page.Resources>
<Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="5"/>
<RowDefinition Height="30"/>
<RowDefinition Height="5"/>
<RowDefinition Height="30"/>
<RowDefinition Height="5"/>
<RowDefinition Height="40"/>
<RowDefinition Height="5"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Background="{StaticResource Border.Background}" Padding="5,0">
<Border.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Border.Resources>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<ComboBox Width="Auto" ItemsSource="{Binding DepartmentList}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<!--<ComboBox Width="100" Margin="5,0,0,0"/>-->
<hc:CheckComboBox ItemsSource="{Binding SelectedDepartment.ShopList}"
ShowClearButton="True"
MinWidth="150">
<hc:CheckComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2.5">
<CheckBox Content="{Binding ShopName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</DataTemplate>
</hc:CheckComboBox.ItemTemplate>
<hc:CheckComboBox.ItemContainerStyle>
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Style>
</hc:CheckComboBox.ItemContainerStyle>
</hc:CheckComboBox>
<DatePicker Width="100" Height="30" Margin="5,0,0,0" SelectedDate="{Binding StartDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<DatePicker Width="100" Height="30" Margin="5,0,0,0" SelectedDate="{Binding EndDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<c:BButton Content="查询" Margin="5,0,0,0" Padding="10,0" Command="{Binding SearchHistoryCommand}"/>
<c:BButton Content="审计" Padding="10,0" Command="{Binding AuditCommand}" Background="#02A7F0"/>
<c:BButton Content="清空" Padding="10,0" Command="{Binding ClearAuditCommand}" Background="#1CC2A2"/>
</StackPanel>
</Border>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border>
<StackPanel Orientation="Horizontal">
<c:BButton Content="导入支付宝账单" Padding="10,0" Margin="5,0,0,0" Command="{Binding ImportAliPayBillCommand}"/>
<c:BButton Content="导入微信账单" Padding="10,0" Margin="5,0,0,0"
IsEnabled="False" DisableText="{Binding Content,RelativeSource={RelativeSource Mode=Self}}"/>
</StackPanel>
</Border>
<ListBox ItemsSource="{Binding AuditFileList}"
SelectedItem="{Binding SelectAuditFile,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Grid.Column="1"
IsEnabled="{Binding IsAudited,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Margin="5,0,0,0">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding AuditFileType}" Value="销售订单">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1"
BorderBrush="{StaticResource Border.Brush}"
Height="30"
Padding="5,0"
Margin="0,0,-1,0">
<TextBlock x:Name="txtFileName" Text="{Binding FileName}"
VerticalAlignment="Center"/>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsSelected,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}}"
Value="True">
<DataTrigger.Setters>
<Setter TargetName="txtFileName" Property="Foreground" Value="{StaticResource Text.Link.Color }"/>
</DataTrigger.Setters>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid Grid.Row="4">
<StackPanel Orientation="Horizontal">
<CheckBox Content="仅显示异常"
IsChecked="{Binding OnlyException,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FocusVisualStyle="{x:Null}"/>
<CheckBox Content="未匹配采购单"
IsChecked="{Binding NoMatchPurchaseOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/>
<CheckBox Content="未选资金类型"
IsChecked="{Binding NoChooseFundType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
<Grid Grid.Row="6" Background="{StaticResource Border.Background}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="店铺名称" VerticalAlignment="Center" Margin="5,0,0,0"/>
<ComboBox Margin="5,0,0,0" ItemsSource="{Binding SelectedDepartment.ShopList}"
SelectedItem="{Binding SelectResultShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"
VerticalAlignment="Center" Height="25"/>
<TextBlock Text="采购平台" VerticalAlignment="Center" Margin="5,0,0,0"/>
<ComboBox Margin="5,0,0,0" Height="25"
ItemsSource="{Binding Source={StaticResource platformProvider}}"
SelectedItem="{Binding SelectPurchasePlatform,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"/>
<TextBlock Text="采购单号" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="100" Height="25" Margin="5,0,0,0"
Text="{Binding SearchResultPurchaseOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<c:BButton Content="结果搜索" Padding="10,0" Command="{Binding SearchLocalCommand}"/>
<c:BButton Content="清空条件" Padding="10,0" Command="{Binding ClearLocalConditionCommand}" Background="{StaticResource Text.Pink}"/>
<c:BButton Content="导出Excel" Padding="10,0" Background="#02A7F0" Command="{Binding ExportCommand}"/>
<c:BButton Content="保存" Padding="10,0" Background="#1CC2A2" Command="{Binding SaveCommand}"/>
</StackPanel>
</Grid>
<DataGrid ItemsSource="{Binding ShowAuditPayBillList}"
Grid.Row="8"
Visibility="{Binding IsShowPayBillPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}"
BorderThickness="1,1,0,0"
BorderBrush="{StaticResource Border.Brush}"
VirtualizingPanel.IsVirtualizing="True">
<DataGrid.Columns>
<DataGridTemplateColumn Header="账单流水号" Width="145">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PayBillNo}" Background="Transparent" BorderThickness="0"
IsReadOnly="True" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="商户订单号" Width="200">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding SourceMerchantOrderNo}" Background="Transparent" BorderThickness="0"
IsReadOnly="True" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="账单平台" Width="60" Binding="{Binding PayBillType}" ElementStyle="{StaticResource middleTextBlock}"/>
<DataGridTextColumn Header="支付时间" Width="130" Binding="{Binding PayTime,StringFormat=yyyy-MM-dd HH:mm:ss}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="对方账号" Width="100" Binding="{Binding OppositeAccount}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="收入金额" Width="60" Binding="{Binding IncomeAmount}" ElementStyle="{StaticResource middleTextBlock}"/>
<DataGridTextColumn Header="支出金额" Width="60" Binding="{Binding ExpenditureAmount}" ElementStyle="{StaticResource middleTextBlock}"/>
<DataGridTemplateColumn Header="资金类型" Width="120">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding Source={StaticResource auditCapitalTypeProvider}}"
SelectedItem="{Binding AuditCapitalType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"
Visibility="{Binding AuditCapitalTypeInputMode,ConverterParameter=0:Visible:Collapsed,Converter={StaticResource objConverter}}"/>
<c:BTextBox Text="{Binding CustomAuditCapitalType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding AuditCapitalTypeInputMode,ConverterParameter=1:Visible:Collapsed,Converter={StaticResource objConverter}}"
WaterRemark="自定义资金类型"/>
<c:BButton Grid.Column="1" Margin="3,0"
Background="Transparent"
CommandParameter="{Binding }"
Command="{Binding DataContext.ShowAuditCapitalTypeInputModeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<Path Style="{StaticResource path_input}" Width="16"/>
<c:BButton.Visibility>
<MultiBinding ConverterParameter="自定义;0:&amp;:Visible:Collapsed:1" Converter="{StaticResource mobjConverter}">
<Binding Path="AuditCapitalType"/>
<Binding Path="AuditCapitalTypeInputMode"/>
</MultiBinding>
</c:BButton.Visibility>
</c:BButton>
<c:BButton Grid.Column="1" Margin="3,0"
Background="Transparent"
CommandParameter="{Binding }"
Command="{Binding DataContext.HideAuditCapitalTypeInputModeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
Visibility="{Binding AuditCapitalTypeInputMode,ConverterParameter=1:Visible:Collapsed,Converter={StaticResource objConverter}}">
<Path Style="{StaticResource path_list}" Width="16"/>
</c:BButton>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Header="商户订单号" Width="200" Binding="{Binding SourceMerchantOrderNo}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>-->
<DataGridTemplateColumn Header="归属店铺" Width="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding DataContext.SelectedDepartment.ShopList,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGrid}}}"
SelectedItem="{Binding BelongShopModel,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="关联采购单" Width="140">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelationPurchaseOrderId}" Background="Transparent" BorderThickness="0"
IsReadOnly="True" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="关联销售单" Width="120">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelationShopOrderId}" Background="Transparent" BorderThickness="0"
IsReadOnly="True" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="订单日期" Width="80" Binding="{Binding OrderStartTime,StringFormat=yyyy-MM-dd}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="采购平台" Width="60" Binding="{Binding PurchasePlatform}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="备注" Width="*" Binding="{Binding Remark}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="异常内容" Width="*" Binding="{Binding ErrorMessage}" Foreground="Red" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</Page>