WinSellerProjectInfo.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <fw:NChildWindow x:Class="Com.FirmLib.UI.Seller.WinSellerProjectInfo"
  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"
  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}}">
  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>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="150"></ColumnDefinition>
  33. <ColumnDefinition Width="Auto"></ColumnDefinition>
  34. <ColumnDefinition></ColumnDefinition>
  35. </Grid.ColumnDefinitions>
  36. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
  37. <Label Content="{Binding SellerName}" Margin="5,0,0,0"></Label>
  38. <Label Content="{Binding SellerUrl}" Margin="5,0,0,0"></Label>
  39. <fw:LineSpliter Margin="5,0,5,0" VerticalAlignment="Center" ></fw:LineSpliter>
  40. <ui:ContactInformationEditor DataContext="{Binding ContactItem}" HorizontalAlignment="Stretch" ></ui:ContactInformationEditor>
  41. </StackPanel>
  42. <GridSplitter Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="White"></GridSplitter>
  43. <GroupBox Grid.Row="0" Grid.Column="2" Margin="-5,0,-5,0" Header="该厂家供应的项目资产清单" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.GroupBoxKey}}" >
  44. <Grid>
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="Auto"></RowDefinition>
  47. <RowDefinition></RowDefinition>
  48. </Grid.RowDefinitions>
  49. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  50. <Button Command="{Binding Commands.AddSupplyContract}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="5" Content="添加供应合同" />
  51. </StackPanel>
  52. <DataGrid fw:DataGridDragCopyOptions.CanDragCopy="True" Grid.Row="1" AutoGenerateColumns="False" FrozenColumnCount="1" ItemsSource="{Binding AssetItems,UpdateSourceTrigger=PropertyChanged}"
  53. CanUserAddRows="False"
  54. CanUserDeleteRows="False"
  55. VerticalScrollBarVisibility="Auto"
  56. HorizontalScrollBarVisibility="Auto"
  57. SelectionUnit="Cell"
  58. HeadersVisibility="Column"
  59. CanUserSortColumns="False"
  60. CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
  61. AlternationCount="2"
  62. >
  63. <DataGrid.RowStyle>
  64. <Style TargetType="DataGridRow" BasedOn="{StaticResource ResourceKey={x:Type DataGridRow}}">
  65. <Setter Property="ContextMenu">
  66. <Setter.Value>
  67. <ContextMenu>
  68. <MenuItem Header="从供应清单中删除该资产" Command="{Binding Data.Commands.DeleteCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding }"></MenuItem>
  69. </ContextMenu>
  70. </Setter.Value>
  71. </Setter>
  72. <Setter Property="Height" Value="30"></Setter>
  73. <Style.Triggers>
  74. <Trigger Property="ItemsControl.AlternationIndex"
  75. Value="0">
  76. <Setter Property="Background" Value="White" />
  77. </Trigger>
  78. <Trigger Property="ItemsControl.AlternationIndex"
  79. Value="1">
  80. <Setter Property="Background" Value="#FFE6E3DD" />
  81. </Trigger>
  82. </Style.Triggers>
  83. </Style>
  84. </DataGrid.RowStyle>
  85. <DataGrid.Columns>
  86. <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" >
  87. <DataGridTemplateColumn.CellTemplate>
  88. <DataTemplate>
  89. <Button Command="{Binding Data.Commands.ScanAssetInfo,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" HorizontalAlignment="Left" Content="查看资产详情" Padding="5,0,5,0"/>
  90. </DataTemplate>
  91. </DataGridTemplateColumn.CellTemplate>
  92. </DataGridTemplateColumn>
  93. <fw:TDataGridTextColumn Header="本地名称" Width="100" IsReadOnly="True" Binding="{Binding Path=LocalName}"></fw:TDataGridTextColumn>
  94. <fw:TDataGridTextColumn Header="本地编码" Width="80" IsReadOnly="True" Binding="{Binding Path=LocalCode}"></fw:TDataGridTextColumn>
  95. <fw:TDataGridTextColumn Header="资产编号" Width="80" IsReadOnly="True" Binding="{Binding Path=AssetNo}"></fw:TDataGridTextColumn>
  96. <fw:TDataGridTextColumn Header="品牌" Width="80" IsReadOnly="True" Binding="{Binding Path=Brand}"></fw:TDataGridTextColumn>
  97. <fw:TDataGridTextColumn Header="产品名" Width="80" IsReadOnly="True" Binding="{Binding Path=Product}"></fw:TDataGridTextColumn>
  98. <fw:TDataGridTextColumn Header="型号" Width="80" IsReadOnly="True" Binding="{Binding Path=Type}"></fw:TDataGridTextColumn>
  99. <DataGridTemplateColumn Header="采购价格" Width="80" fw:DataGridDragCopyOptions.CanColumnDragCopy="True">
  100. <DataGridTemplateColumn.CellTemplate>
  101. <DataTemplate>
  102. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=ProcurementPrice,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  103. <TextBlock Text="{Binding Path=ProcurementPrice}" VerticalAlignment="Center" ></TextBlock>
  104. </Border>
  105. </DataTemplate>
  106. </DataGridTemplateColumn.CellTemplate>
  107. <DataGridTemplateColumn.CellEditingTemplate>
  108. <DataTemplate>
  109. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=ProcurementPrice,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" >
  110. <fw:DescriptionDecorator Description="元" Background="Black">
  111. <fw:TTextBox Text="{Binding ProcurementPrice, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0">
  112. <fw:TTextBox.TextControl>
  113. <fw:AccessPlusDecimal></fw:AccessPlusDecimal>
  114. </fw:TTextBox.TextControl>
  115. </fw:TTextBox>
  116. </fw:DescriptionDecorator>
  117. </Border>
  118. </DataTemplate>
  119. </DataGridTemplateColumn.CellEditingTemplate>
  120. </DataGridTemplateColumn>
  121. <DataGridTemplateColumn Header="保修期" Width="80" fw:DataGridDragCopyOptions.CanColumnDragCopy="True">
  122. <DataGridTemplateColumn.CellTemplate>
  123. <DataTemplate>
  124. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Warranty,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  125. <TextBlock Text="{Binding Path=Warranty}" VerticalAlignment="Center" ></TextBlock>
  126. </Border>
  127. </DataTemplate>
  128. </DataGridTemplateColumn.CellTemplate>
  129. <DataGridTemplateColumn.CellEditingTemplate>
  130. <DataTemplate>
  131. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Warranty,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  132. <fw:DescriptionDecorator Description="天" Background="Black">
  133. <fw:TTextBox Text="{Binding Warranty, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0">
  134. <fw:TTextBox.TextControl>
  135. <fw:AccessPlusDecimal></fw:AccessPlusDecimal>
  136. </fw:TTextBox.TextControl>
  137. </fw:TTextBox>
  138. </fw:DescriptionDecorator>
  139. </Border>
  140. </DataTemplate>
  141. </DataGridTemplateColumn.CellEditingTemplate>
  142. </DataGridTemplateColumn>
  143. <DataGridTemplateColumn Header="生产日期" Width="120" fw:DataGridDragCopyOptions.CanColumnDragCopy="True">
  144. <DataGridTemplateColumn.CellTemplate>
  145. <DataTemplate>
  146. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=ProductionDate,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  147. <TextBlock Text="{Binding Path=ProductionDate,Converter={x:Static wpf:DateTimeConverter.Date},StringFormat=yyyy年MM月dd日}" VerticalAlignment="Center"></TextBlock>
  148. </Border>
  149. </DataTemplate>
  150. </DataGridTemplateColumn.CellTemplate>
  151. <DataGridTemplateColumn.CellEditingTemplate>
  152. <DataTemplate>
  153. <DatePicker fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=ProductionDate,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" SelectedDate="{Binding Path=ProductionDate,Converter={x:Static wpf:DateTimeConverter.Date}}" VerticalAlignment="Center"></DatePicker>
  154. </DataTemplate>
  155. </DataGridTemplateColumn.CellEditingTemplate>
  156. </DataGridTemplateColumn>
  157. <fw:TDataGridTextColumn Header="出厂编号" Width="80" IsReadOnly="True" Binding="{Binding Path=ManufacturingNo}"></fw:TDataGridTextColumn>
  158. <DataGridTemplateColumn Header="所属供应合同编号" Width="80" fw:DataGridDragCopyOptions.CanColumnDragCopy="True">
  159. <DataGridTemplateColumn.CellTemplate>
  160. <DataTemplate>
  161. <Border fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=SellerContractNo,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  162. <TextBlock Text="{Binding Path=SellerContractNo}" VerticalAlignment="Center"></TextBlock>
  163. </Border>
  164. </DataTemplate>
  165. </DataGridTemplateColumn.CellTemplate>
  166. <DataGridTemplateColumn.CellEditingTemplate>
  167. <DataTemplate>
  168. <Grid fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=SellerContractNo,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
  169. <Grid.ColumnDefinitions>
  170. <ColumnDefinition></ColumnDefinition>
  171. <ColumnDefinition Width="30"></ColumnDefinition>
  172. </Grid.ColumnDefinitions>
  173. <TextBox IsReadOnly="True" Text="{Binding Path=SellerContractNo}" VerticalContentAlignment="Center"></TextBox>
  174. <Button Grid.Column="1" Command="{Binding Data.Commands.SelectContractCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Content="…" Padding="5"/>
  175. </Grid>
  176. </DataTemplate>
  177. </DataGridTemplateColumn.CellEditingTemplate>
  178. </DataGridTemplateColumn>
  179. </DataGrid.Columns>
  180. <i:Interaction.Behaviors>
  181. <behaviors:GridCellSingleClickEditBehavior></behaviors:GridCellSingleClickEditBehavior>
  182. </i:Interaction.Behaviors>
  183. </DataGrid>
  184. </Grid>
  185. </GroupBox>
  186. </Grid>
  187. </fw:NChildWindow>