WinInsurancePolicyEditor.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <fw:NChildWindow x:Class="Com.FirmLib.UI.Insuer.WinInsurancePolicyEditor"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:fw="http://schemas.FWind/xaml"
  7. xmlns:wpf="clr-namespace:FWindSoft.Wpf;assembly=FWindSoft.Wpf"
  8. xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
  9. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  10. xmlns:behaviors="clr-namespace:FWindSoft.Wpf.Behaviors;assembly=FWindSoft.Wpf"
  11. xmlns:ui="clr-namespace:Com.FirmLib.UI"
  12. mc:Ignorable="d" Title="添加保险"
  13. d:DesignHeight="300" d:DesignWidth="500" Name="this" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
  14. Width="{Binding Width,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" >
  15. <fw:NChildWindow.Resources>
  16. <wpf:BindingProxy x:Key="DATA" Data="{Binding}"></wpf:BindingProxy>
  17. </fw:NChildWindow.Resources>
  18. <fw:NChildWindow.AttachElement>
  19. <StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal" VerticalAlignment="Center">
  20. <Button Command="{Binding Data.Commands.SaveCommand,Source={StaticResource ResourceKey=DATA}}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" BorderThickness="0" FontFamily="{DynamicResource ResourceKey={x:Static wpf:FontsUtil.AwesomeKey}}" Click="btnOK_Click">
  21. <Button.Content>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="{wpf:FontIcon Icon=Save}" Width="30" FontSize="20"></TextBlock>
  24. <TextBlock Text="保存" VerticalAlignment="Center" Margin="-5,0,0,0"></TextBlock>
  25. </StackPanel>
  26. </Button.Content>
  27. </Button>
  28. </StackPanel>
  29. </fw:NChildWindow.AttachElement>
  30. <Grid Margin="5" >
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="Auto"></RowDefinition>
  33. <RowDefinition Height="Auto"></RowDefinition>
  34. <RowDefinition MinHeight="100" ></RowDefinition>
  35. </Grid.RowDefinitions>
  36. <Grid>
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="Auto"></ColumnDefinition>
  39. <ColumnDefinition></ColumnDefinition>
  40. </Grid.ColumnDefinitions>
  41. <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Width="200">
  42. <Label Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.StarLableKey}}" Content="保单编号:"></Label>
  43. <TextBox IsEnabled="{Binding PolicyFixed,Converter={x:Static fw:ConverterFactory.BoolOpposition}}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.TextBoxKey}}" Margin="5">
  44. <Binding Path="PolicyNo" Mode="TwoWay" UpdateSourceTrigger="LostFocus" >
  45. <Binding.ValidationRules>
  46. <fw:RequireValidationRule ></fw:RequireValidationRule>
  47. <fw:LengthValidationRule MaxLength="50" ></fw:LengthValidationRule>
  48. </Binding.ValidationRules>
  49. </Binding>
  50. </TextBox>
  51. <Label Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.StarLableKey}}" Content="保单截止日期:"></Label>
  52. <DatePicker Margin="5">
  53. <DatePicker.SelectedDate>
  54. <Binding Path="PolicyEndDate" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" Converter="{x:Static wpf:DateTimeConverter.Date}">
  55. <Binding.ValidationRules>
  56. <fw:RequireValidationRule ValidationStep="ConvertedProposedValue"></fw:RequireValidationRule>
  57. </Binding.ValidationRules>
  58. </Binding>
  59. </DatePicker.SelectedDate>
  60. </DatePicker>
  61. <Label Content="保险文件:"></Label>
  62. <Grid HorizontalAlignment="Stretch" IsEnabled="{Binding IsEpire,Converter={x:Static fw:ConverterFactory.BoolOpposition}}">
  63. <Grid.ColumnDefinitions>
  64. <ColumnDefinition></ColumnDefinition>
  65. <ColumnDefinition Width="Auto"></ColumnDefinition>
  66. </Grid.ColumnDefinitions>
  67. <TextBox Text="{Binding PolicyFile.Name}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.TextBoxKey}}" IsReadOnly="True" Margin="5">
  68. </TextBox>
  69. <Button Command="{Binding Commands.UploadCommand}" Grid.Column="1" Content="上传" Width="40" Height="23"></Button>
  70. </Grid>
  71. <Label Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.StarLableKey}}" Content="所属项目:"></Label>
  72. <TextBox IsEnabled="{Binding ProjectFixed,Converter={x:Static fw:ConverterFactory.BoolOpposition}}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.TextBoxKey}}" Margin="5">
  73. <Binding Path="ProjectNo" Mode="TwoWay" UpdateSourceTrigger="LostFocus" >
  74. <Binding.ValidationRules>
  75. <fw:RequireValidationRule ></fw:RequireValidationRule>
  76. </Binding.ValidationRules>
  77. </Binding>
  78. </TextBox>
  79. <Label Content="项目本地名称:"></Label>
  80. <TextBlock Margin="5" Text="{Binding LocalProjectName}">
  81. </TextBlock>
  82. </StackPanel>
  83. <StackPanel Grid.Column="1">
  84. <Label Content="" Margin="1"></Label>
  85. <Button Margin="5" Command="{Binding Commands.SelectPolicyCommand}" IsEnabled="{Binding PolicyFixed,Converter={x:Static fw:ConverterFactory.BoolOpposition}}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" VerticalAlignment="Center" Content="从项目已有保单中选择" HorizontalAlignment="Left" Padding="5,0,5,0"/>
  86. </StackPanel>
  87. </Grid>
  88. <GroupBox IsEnabled="{Binding ProjectFixed,Converter={x:Static fw:ConverterFactory.BoolOpposition}}" Grid.Row="1" Grid.Column="0" Margin="0,10,0,10" Header="保险商联系信息" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.GroupBoxKey}}" >
  89. <ui:ContactInformationInput DataContext="{Binding ContactItem}" Width="200" HorizontalAlignment="Left"></ui:ContactInformationInput>
  90. </GroupBox>
  91. <GroupBox IsEnabled="{Binding IsEpire,Converter={x:Static fw:ConverterFactory.BoolOpposition}}" Grid.Row="2" Grid.Column="0" Margin="0,10,0,10" Header="保单中包含的资产" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.GroupBoxKey}}" >
  92. <Grid>
  93. <Grid.RowDefinitions>
  94. <RowDefinition Height="Auto"></RowDefinition>
  95. <RowDefinition ></RowDefinition>
  96. </Grid.RowDefinitions>
  97. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  98. <Button IsEnabled="True" Command="{Binding Commands.SelectAssetCommand}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="5" Content="选择项目内已存在的资产" />
  99. </StackPanel>
  100. <DataGrid Grid.Row="1" AutoGenerateColumns="False" SelectionMode="Single" FrozenColumnCount="1" ItemsSource="{Binding AssetItems,UpdateSourceTrigger=PropertyChanged}"
  101. CanUserAddRows="False"
  102. CanUserDeleteRows="False"
  103. VerticalScrollBarVisibility="Auto"
  104. HorizontalScrollBarVisibility="Auto"
  105. SelectionUnit="FullRow"
  106. HeadersVisibility="Column"
  107. CanUserSortColumns="True"
  108. CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
  109. AlternationCount="2"
  110. >
  111. <DataGrid.RowStyle>
  112. <Style TargetType="DataGridRow" BasedOn="{StaticResource ResourceKey={x:Type DataGridRow}}">
  113. <Setter Property="ContextMenu">
  114. <Setter.Value>
  115. <ContextMenu>
  116. <MenuItem Header="在保清单中删除资产" Command="{Binding Data.Commands.DeleteCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding }"></MenuItem>
  117. </ContextMenu>
  118. </Setter.Value>
  119. </Setter>
  120. <Setter Property="Height" Value="30"></Setter>
  121. <Style.Triggers>
  122. <Trigger Property="ItemsControl.AlternationIndex"
  123. Value="0">
  124. <Setter Property="Background" Value="White" />
  125. </Trigger>
  126. <Trigger Property="ItemsControl.AlternationIndex"
  127. Value="1">
  128. <Setter Property="Background" Value="#FFE6E3DD" />
  129. </Trigger>
  130. </Style.Triggers>
  131. </Style>
  132. </DataGrid.RowStyle>
  133. <DataGrid.Columns>
  134. <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" >
  135. <DataGridTemplateColumn.CellTemplate>
  136. <DataTemplate>
  137. <Button Command="{Binding Data.Commands.ScanAsset,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Content="查看资产详情" Padding="5,0,5,0"/>
  138. </DataTemplate>
  139. </DataGridTemplateColumn.CellTemplate>
  140. </DataGridTemplateColumn>
  141. <fw:TDataGridTextColumn Header="本地名称" Width="100" IsReadOnly="True" Binding="{Binding Path=LocalName}"></fw:TDataGridTextColumn>
  142. <fw:TDataGridTextColumn Header="本地编码" Width="100" IsReadOnly="True" Binding="{Binding Path=LocalCode}"></fw:TDataGridTextColumn>
  143. <fw:TDataGridTextColumn Header="品牌" Width="100" IsReadOnly="True" Binding="{Binding Path=Brand}"></fw:TDataGridTextColumn>
  144. <fw:TDataGridTextColumn Header="产品名" Width="100" IsReadOnly="True" Binding="{Binding Path=Product}"></fw:TDataGridTextColumn>
  145. <fw:TDataGridTextColumn Header="型号" Width="100" IsReadOnly="True" Binding="{Binding Path=Type}"></fw:TDataGridTextColumn>
  146. </DataGrid.Columns>
  147. </DataGrid>
  148. </Grid>
  149. </GroupBox>
  150. </Grid>
  151. </fw:NChildWindow>