WinSellerInfo.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <fw:NChildWindow x:Class="Com.FirmLib.UI.Seller.WinSellerInfo"
  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:bllCommon="clr-namespace:Com.FirmLib.UI.BllCommon"
  10. mc:Ignorable="d" Title="供应商信息"
  11. d:DesignHeight="300" d:DesignWidth="500" Name="this" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
  12. Width="{Binding Width,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" >
  13. <fw:NChildWindow.Resources>
  14. <wpf:BindingProxy x:Key="DATA" Data="{Binding}"></wpf:BindingProxy>
  15. </fw:NChildWindow.Resources>
  16. <fw:NChildWindow.AttachElement>
  17. <StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal" VerticalAlignment="Center">
  18. <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}}">
  19. <Button.Content>
  20. <StackPanel Orientation="Horizontal">
  21. <TextBlock Text="{wpf:FontIcon Icon=Save}" Width="30" FontSize="20"></TextBlock>
  22. <TextBlock Text="保存" VerticalAlignment="Center" Margin="-5,0,0,0"></TextBlock>
  23. </StackPanel>
  24. </Button.Content>
  25. </Button>
  26. </StackPanel>
  27. </fw:NChildWindow.AttachElement>
  28. <Grid Margin="5">
  29. <Grid.RowDefinitions>
  30. <RowDefinition Height="Auto"></RowDefinition>
  31. <RowDefinition MinHeight="150" MaxHeight="300"></RowDefinition>
  32. <RowDefinition></RowDefinition>
  33. </Grid.RowDefinitions>
  34. <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical"
  35. VerticalAlignment="Center" HorizontalAlignment="Left" Width="200">
  36. <fw:TextBoxEditor Text="{Binding Name,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5"
  37. Command="{x:Static bllCommon:EditCommands.SingleUpdate}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Name"></fw:TextBoxEditor>
  38. <fw:TextBoxEditor Text="{Binding Url,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5"
  39. Command="{x:Static bllCommon:EditCommands.SingleUpdate}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Url"></fw:TextBoxEditor>
  40. </StackPanel>
  41. <TabControl Grid.Row="1" Grid.Column="0" IsEnabled="True">
  42. <TabItem Header="供应产品目录">
  43. <Grid>
  44. <Grid.RowDefinitions>
  45. <RowDefinition Height="Auto"></RowDefinition>
  46. <RowDefinition Height="Auto"></RowDefinition>
  47. <RowDefinition ></RowDefinition>
  48. </Grid.RowDefinitions>
  49. <Grid Grid.Row="0">
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition></ColumnDefinition>
  52. <ColumnDefinition Width="110"></ColumnDefinition>
  53. </Grid.ColumnDefinitions>
  54. <ListBox Grid.Row="0" BorderThickness="0" VerticalAlignment="Center" Grid.Column="0" ItemsSource="{Binding Root.Items}" SelectedItem="{Binding Root.CurrentItem,Mode=TwoWay}">
  55. <ListBox.ItemsPanel >
  56. <ItemsPanelTemplate>
  57. <StackPanel Orientation="Horizontal" Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
  58. </ItemsPanelTemplate>
  59. </ListBox.ItemsPanel>
  60. <ListBox.ItemContainerStyle>
  61. <Style TargetType="{x:Type ListBoxItem}">
  62. <Setter Property="Template">
  63. <Setter.Value>
  64. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  65. <StackPanel Orientation="Horizontal">
  66. <Border x:Name="BTN" BorderThickness="0,1,1,1" BorderBrush="#D1D1D1">
  67. <TextBlock x:Name="TXT" Text="{Binding RefItem.Name}" Margin="5" Opacity="0.8"></TextBlock>
  68. </Border>
  69. </StackPanel>
  70. <ControlTemplate.Triggers>
  71. <DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}"
  72. Value="{x:Null}">
  73. <Setter TargetName="BTN" Property="BorderThickness" Value="1,1,1,1"></Setter>
  74. </DataTrigger>
  75. <Trigger Property="IsSelected" Value="True">
  76. <Setter TargetName="BTN" Property="Background" Value="#63B8FF"></Setter>
  77. <Setter TargetName="TXT" Property="Foreground" Value="Black"></Setter>
  78. </Trigger>
  79. </ControlTemplate.Triggers>
  80. </ControlTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. </Style>
  84. </ListBox.ItemContainerStyle>
  85. </ListBox>
  86. <Button Grid.Column="1" Grid.Row="0" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Command="{Binding Commands.AddProductTypeCommand}" Height="23" Margin="10,5" Content="添加供应型号"/>
  87. </Grid>
  88. <ListBox Grid.Row="1" Grid.Column="0" BorderThickness="0" ItemsSource="{Binding Root.CurrentItem.Nodes}" SelectedItem="{Binding Root.CurrentItem.CurrentItem,Mode=TwoWay}" SelectionChanged="ListBox_SelectionChanged">
  89. <ListBox.ItemsPanel >
  90. <ItemsPanelTemplate>
  91. <StackPanel Orientation="Horizontal" Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
  92. </ItemsPanelTemplate>
  93. </ListBox.ItemsPanel>
  94. <ListBox.ItemContainerStyle>
  95. <Style TargetType="{x:Type ListBoxItem}">
  96. <Setter Property="Template">
  97. <Setter.Value>
  98. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  99. <StackPanel Orientation="Horizontal">
  100. <TextBlock Text="|" x:Name="Txt"></TextBlock>
  101. <TextBlock Margin="5,0,5,0" x:Name="TXTN" Text="{Binding RefItem.Name}" Foreground="Blue" TextDecorations="Underline">
  102. </TextBlock>
  103. </StackPanel>
  104. <ControlTemplate.Triggers>
  105. <DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}"
  106. Value="{x:Null}">
  107. <Setter TargetName="Txt" Property="Visibility" Value="Collapsed"></Setter>
  108. </DataTrigger>
  109. <Trigger Property="IsSelected" Value="True">
  110. <Setter TargetName="TXTN" Property="Foreground" Value="Black"></Setter>
  111. </Trigger>
  112. </ControlTemplate.Triggers>
  113. </ControlTemplate>
  114. </Setter.Value>
  115. </Setter>
  116. </Style>
  117. </ListBox.ItemContainerStyle>
  118. </ListBox>
  119. <DataGrid Name="ProductTypeGrid" Grid.Row="2" Grid.Column="0" AutoGenerateColumns="False" SelectionMode="Single" FrozenColumnCount="1" ItemsSource="{Binding Root.CurrentItem.CurrentItem.Nodes}"
  120. CanUserAddRows="False"
  121. CanUserDeleteRows="False"
  122. VerticalScrollBarVisibility="Auto"
  123. HorizontalScrollBarVisibility="Auto"
  124. IsReadOnly="True"
  125. SelectionUnit="Cell"
  126. HeadersVisibility="Column"
  127. CanUserSortColumns="True"
  128. AlternationCount="2"
  129. >
  130. <DataGrid.CellStyle >
  131. <Style TargetType="DataGridCell" BasedOn="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}">
  132. <Setter Property="IsEnabled" Value="False"></Setter>
  133. <Style.Triggers>
  134. <DataTrigger Binding="{ Binding Column.DisplayIndex,RelativeSource={RelativeSource Self}}" Value="0">
  135. <Setter Property="IsEnabled" Value="True"></Setter>
  136. </DataTrigger>
  137. <DataTrigger Binding="{ Binding Column.DisplayIndex,RelativeSource={RelativeSource Self}}" Value="1">
  138. <Setter Property="IsEnabled" Value="True"></Setter>
  139. </DataTrigger>
  140. </Style.Triggers>
  141. </Style>
  142. </DataGrid.CellStyle >
  143. <DataGrid.RowStyle>
  144. <Style TargetType="DataGridRow">
  145. <Setter Property="ContextMenu">
  146. <Setter.Value>
  147. <ContextMenu>
  148. <MenuItem Header="删除供应型号" Command="{Binding Data.Commands.DeleteCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding }"></MenuItem>
  149. </ContextMenu>
  150. </Setter.Value>
  151. </Setter>
  152. <Setter Property="Height" Value="30"></Setter>
  153. <Style.Triggers>
  154. <Trigger Property="ItemsControl.AlternationIndex"
  155. Value="0">
  156. <Setter Property="Background" Value="White" />
  157. </Trigger>
  158. <Trigger Property="ItemsControl.AlternationIndex"
  159. Value="1">
  160. <Setter Property="Background" Value="#FFE6E3DD" />
  161. </Trigger>
  162. </Style.Triggers>
  163. </Style>
  164. </DataGrid.RowStyle>
  165. <DataGrid.Columns>
  166. <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" >
  167. <DataGridTemplateColumn.CellTemplate>
  168. <DataTemplate>
  169. <Button Command="{Binding DataContext.Commands.ManageCommand,ElementName=this}" CommandParameter="{Binding }" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" VerticalAlignment="Center" Content="查看型号详情" HorizontalAlignment="Left" Padding="5,0,5,0"/>
  170. </DataTemplate>
  171. </DataGridTemplateColumn.CellTemplate>
  172. </DataGridTemplateColumn>
  173. <fw:TDataGridTextColumn Header="型号" Width="100" IsReadOnly="True" Binding="{Binding Path=RefItem.TypeName}"></fw:TDataGridTextColumn>
  174. </DataGrid.Columns>
  175. </DataGrid>
  176. </Grid>
  177. </TabItem>
  178. </TabControl>
  179. <GroupBox Grid.Row="2" Grid.Column="0" Margin="0,10,0,10" Header="该厂家供应产品的所有项目" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.GroupBoxKey}}" >
  180. <Grid>
  181. <Grid.RowDefinitions>
  182. <RowDefinition Height="Auto"></RowDefinition>
  183. <RowDefinition ></RowDefinition>
  184. </Grid.RowDefinitions>
  185. <StackPanel HorizontalAlignment="Right">
  186. <Button Command="{Binding Commands.AddContract}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="10" Content="新项目添加供应合同" />
  187. </StackPanel>
  188. <ListBox Grid.Row="1" ItemsSource="{Binding ProjectItems}" BorderThickness="0" Padding="-5,0,-5,0">
  189. <ListBox.ItemsPanel >
  190. <ItemsPanelTemplate>
  191. <WrapPanel Orientation="Horizontal" Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
  192. </ItemsPanelTemplate>
  193. </ListBox.ItemsPanel>
  194. <ListBox.ItemContainerStyle>
  195. <Style TargetType="{x:Type ListBoxItem}">
  196. <Setter Property="Template">
  197. <Setter.Value>
  198. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  199. <Border BorderThickness="1" BorderBrush="Black" Margin="5" Padding="5">
  200. <Grid Width="150" Height="80" >
  201. <Grid.RowDefinitions>
  202. <RowDefinition></RowDefinition>
  203. <RowDefinition Height="Auto"></RowDefinition>
  204. </Grid.RowDefinitions>
  205. <StackPanel Orientation="Vertical" Grid.Row="0">
  206. <TextBlock Margin="5,0,5,0" Name="TxtName" FontSize="20" Text="{Binding ProjectLocalName}"></TextBlock>
  207. <StackPanel Orientation="Horizontal">
  208. <TextBlock Margin="5,0,5,0" Text="涉及供应合同:" />
  209. <TextBlock Margin="5,0,5,0" x:Name="TXTN" Text="{Binding ContractCount}" TextDecorations="Underline"/>
  210. <TextBlock Margin="5,0,5,0" Text="个" />
  211. </StackPanel>
  212. <StackPanel Orientation="Horizontal">
  213. <TextBlock Margin="5,0,5,0" Text="涉及供应资产:" />
  214. <TextBlock Margin="5,0,5,0" Text="{Binding AssetCount}" TextDecorations="Underline"/>
  215. <TextBlock Margin="5,0,5,0" Text="个" />
  216. </StackPanel>
  217. </StackPanel>
  218. <Button Grid.Row="1" Grid.Column="0" x:Name="BTNU" HorizontalAlignment="Right" Content="进入项目" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Command="{Binding Data.Commands.GoToProject,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding}" ></Button>
  219. </Grid>
  220. </Border>
  221. </ControlTemplate>
  222. </Setter.Value>
  223. </Setter>
  224. </Style>
  225. </ListBox.ItemContainerStyle>
  226. </ListBox>
  227. </Grid>
  228. </GroupBox>
  229. </Grid>
  230. </fw:NChildWindow>