SaleOrderFrame.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <Window x:Class="Muchinfo.MTPClient.Sale.Views.SaleOrderFrame"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
  5. xmlns:resources="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
  6. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  7. x:Name="openOrderWindow"
  8. Width="450"
  9. Background="{DynamicResource DialogBackgroundBrush}"
  10. MouseDown="Window_MouseDown"
  11. ResizeMode="NoResize"
  12. ShowInTaskbar="False"
  13. SizeToContent="Height"
  14. WindowStyle="None">
  15. <Window.Resources>
  16. <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
  17. <converters:EnumBooleanConvert x:Key="EnumBooleanConvert" />
  18. <Style TargetType="{x:Type TextBlock}">
  19. <Setter Property="HorizontalAlignment" Value="Right" />
  20. <Setter Property="VerticalAlignment" Value="Center" />
  21. <Setter Property="Foreground" Value="{DynamicResource TextBlockForeground}" />
  22. </Style>
  23. <Style TargetType="{x:Type RadioButton}">
  24. <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
  25. </Style>
  26. <DataTemplate x:Key="saleGoodsDatatTemplate">
  27. <TextBlock>
  28. <Run Text="{Binding GoodsName}" />
  29. <Run Text=" " />
  30. <Run Text="{Binding GoodsCode}" />
  31. </TextBlock>
  32. </DataTemplate>
  33. </Window.Resources>
  34. <Border BorderBrush="{DynamicResource CommonBorderBrush}" BorderThickness="1">
  35. <xctk:BusyIndicator BusyContent="{Binding BusyTips,
  36. Mode=OneWay}"
  37. Foreground="Black"
  38. IsBusy="{Binding IsBusy,
  39. Mode=OneWay}">
  40. <Grid>
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="40" />
  43. <RowDefinition Height="30" />
  44. <RowDefinition Height="30" />
  45. <RowDefinition Height="Auto" />
  46. <RowDefinition Height="Auto" />
  47. <RowDefinition Height="Auto" />
  48. <RowDefinition Height="Auto" />
  49. <RowDefinition Height="*" />
  50. <RowDefinition Height="80" />
  51. </Grid.RowDefinitions>
  52. <Grid.ColumnDefinitions>
  53. <ColumnDefinition Width="70" />
  54. <ColumnDefinition />
  55. </Grid.ColumnDefinitions>
  56. <Grid Grid.ColumnSpan="2"
  57. Height="40"
  58. VerticalAlignment="Top">
  59. <TextBlock HorizontalAlignment="Center"
  60. VerticalAlignment="Center"
  61. FontSize="18"
  62. FontWeight="Bold"
  63. Foreground="{DynamicResource MainForegroundBrush}">
  64. <Run Text="{x:Static resources:Client_Resource.Infrastructure_Entrust}" />
  65. <Run Text="{x:Static resources:Client_Resource.Content_SaleApply}" />
  66. </TextBlock>
  67. <Button x:Name="btnClose"
  68. Width="20"
  69. Margin="10,2"
  70. HorizontalAlignment="Right"
  71. Click="btnClose_Click"
  72. Padding="2"
  73. Style="{DynamicResource DialogCloseButtonStyle}" />
  74. <Path Width="406"
  75. Height="3"
  76. VerticalAlignment="Bottom"
  77. Data="F1M1,2C1,2 1,1 1,1 1,1 405,1 405,1 405,1 405,2 405,2 405,2 1,2 1,2z"
  78. Fill="#FF3A3232">
  79. <Path.Effect>
  80. <DropShadowEffect BlurRadius="0"
  81. Direction="-270"
  82. Opacity="0.25"
  83. ShadowDepth="1"
  84. Color="#FF010101" />
  85. </Path.Effect>
  86. </Path>
  87. </Grid>
  88. <TextBlock Grid.Row="1" Text="{x:Static resources:Client_Resource.Trade_Xaml_Accout_Title}" />
  89. <TextBlock Grid.Row="1"
  90. Grid.Column="1"
  91. Margin="20,0,0,0"
  92. HorizontalAlignment="Left"
  93. TextTrimming="CharacterEllipsis"
  94. TextWrapping="NoWrap">
  95. <Run Text="{Binding CurrentAccount.AccountId, Mode=OneWay}" />
  96. <Run Text=" " />
  97. <Run Text="{Binding CurrentAccount.CustomerName, Mode=OneWay}" />
  98. </TextBlock>
  99. <TextBlock Grid.Row="2" Text="{x:Static resources:Client_Resource.Trade_Xaml_Goods_Title}" />
  100. <ComboBox Grid.Row="2"
  101. Grid.Column="1"
  102. Width="200"
  103. Margin="20,0,0,0"
  104. HorizontalAlignment="Left"
  105. VerticalAlignment="Center"
  106. ItemTemplate="{StaticResource saleGoodsDatatTemplate}"
  107. ItemsSource="{Binding SaleGoodses}"
  108. SelectedIndex="0"
  109. SelectedItem="{Binding CurrentSaleGoods,
  110. Mode=TwoWay}"
  111. Style="{DynamicResource SimpleComboBoxStyle}" />
  112. <StackPanel Grid.Row="3" Grid.ColumnSpan="2">
  113. <StackPanel Style="{DynamicResource NoTitleExpanderStyle}">
  114. <Grid>
  115. <Grid.RowDefinitions>
  116. <RowDefinition Height="40" />
  117. <RowDefinition Height="Auto" />
  118. <RowDefinition Height="Auto" />
  119. </Grid.RowDefinitions>
  120. <Grid.ColumnDefinitions>
  121. <ColumnDefinition Width="70" />
  122. <ColumnDefinition />
  123. </Grid.ColumnDefinitions>
  124. <TextBlock Grid.Row="0" Text="{x:Static resources:Client_Resource.Trade_Xaml_OrderDir_Title}" />
  125. <StackPanel Grid.Row="0"
  126. Grid.Column="2"
  127. VerticalAlignment="Center"
  128. Orientation="Horizontal">
  129. <RadioButton Margin="20,0"
  130. Content="{x:Static resources:Client_Resource.Order_Sale_Buy}"
  131. IsChecked="{Binding Direction,
  132. Converter={StaticResource EnumBooleanConvert},
  133. ConverterParameter=0}"
  134. IsEnabled="False"
  135. Style="{DynamicResource RadioButtonStyle}" />
  136. <RadioButton Margin="20,0"
  137. Content="{x:Static resources:Client_Resource.Content_SellOut}"
  138. IsChecked="{Binding Direction,
  139. Converter={StaticResource EnumBooleanConvert},
  140. ConverterParameter=1}"
  141. IsEnabled="False"
  142. Style="{DynamicResource RadioButtonStyle}"
  143. Visibility="Collapsed" />
  144. </StackPanel>
  145. <StackPanel Grid.Row="1"
  146. Grid.Column="1"
  147. VerticalAlignment="Center"
  148. Orientation="Horizontal"
  149. Visibility="Collapsed">
  150. <RadioButton x:Name="RadMarketPrice"
  151. Margin="20,0"
  152. Content="{x:Static resources:Client_Resource.EntrustOrderFrame_Market}"
  153. IsEnabled="False"
  154. Style="{DynamicResource RadioButtonStyle}" />
  155. <RadioButton x:Name="radLimitPrice"
  156. Margin="20,0"
  157. Content="{x:Static resources:Client_Resource.EntrustOrderFrame_Limit}"
  158. IsChecked="True"
  159. IsEnabled="False"
  160. Style="{DynamicResource RadioButtonStyle}" />
  161. </StackPanel>
  162. </Grid>
  163. </StackPanel>
  164. <StackPanel Orientation="Vertical">
  165. <Grid>
  166. <Grid.RowDefinitions>
  167. <RowDefinition Height="40" />
  168. <RowDefinition Height="Auto" />
  169. <RowDefinition Height="40" />
  170. <RowDefinition Height="Auto" />
  171. </Grid.RowDefinitions>
  172. <Grid.ColumnDefinitions>
  173. <ColumnDefinition Width="70" />
  174. <ColumnDefinition />
  175. </Grid.ColumnDefinitions>
  176. <TextBlock Grid.Row="0" Text="{x:Static resources:Client_Resource.EntrustOrderFrame_Price}" />
  177. <xctk:DecimalUpDown Grid.Column="1"
  178. Width="180"
  179. Margin="20,0,0,0"
  180. HorizontalAlignment="Left"
  181. VerticalAlignment="Center"
  182. FormatString="{Binding PriceFormat}"
  183. Increment="{Binding PriceMinUnit}"
  184. IsEnabled="False"
  185. Style="{DynamicResource DecimalNewUpDownStyle}"
  186. TabIndex="5"
  187. Text="{Binding QuotePrice,
  188. Mode=TwoWay,
  189. UpdateSourceTrigger=PropertyChanged}"
  190. Visibility="{Binding IsChecked,
  191. ElementName=radLimitPrice,
  192. Converter={StaticResource BooleanToVisibilityConverter}}" />
  193. <xctk:DecimalUpDown Grid.Column="1"
  194. Width="180"
  195. Margin="20,0,0,0"
  196. HorizontalAlignment="Left"
  197. VerticalAlignment="Center"
  198. FormatString="{Binding PriceFormat}"
  199. Increment="{Binding PriceMinUnit}"
  200. IsEnabled="False"
  201. Style="{DynamicResource DecimalNewUpDownStyle}"
  202. TabIndex="5"
  203. Text="{Binding ExecutePrice,
  204. Mode=TwoWay,
  205. UpdateSourceTrigger=PropertyChanged}"
  206. Visibility="{Binding IsChecked,
  207. ElementName=radLimitPrice,
  208. Converter={StaticResource BooleanToVisibilityConverter}}" />
  209. <TextBlock Grid.Row="1" Text="{x:Static resources:Client_Resource.EntrustOrderFrame_Lot}" />
  210. <StackPanel Grid.Row="1"
  211. Grid.Column="1"
  212. Orientation="Horizontal">
  213. <xctk:DecimalUpDown Width="120"
  214. Margin="20,0,0,0"
  215. VerticalAlignment="Center"
  216. DefaultValue="0"
  217. DisplayDefaultValueOnEmptyText="True"
  218. KeyDown="DecimalUpDown_KeyDown"
  219. Minimum="{Binding PerOrderQty}"
  220. Style="{DynamicResource DecimalNewUpDownStyle}"
  221. TabIndex="5"
  222. Value="{Binding Lot,
  223. Mode=TwoWay}" />
  224. <TextBlock Margin="5,0" Text="{x:Static resources:Client_Resource.EntrustOrderFrame_Hand}" />
  225. <TextBox Width="60"
  226. Margin="60,0,0,0"
  227. VerticalAlignment="Center"
  228. Style="{DynamicResource RectangleTextBox}"
  229. Text="{Binding AgreeUnitLot}" />
  230. <TextBlock Margin="10,0,0,0" Text="{Binding CurrentSaleGoods.AgreeUnitString}" />
  231. </StackPanel>
  232. <TextBlock Grid.Row="2"
  233. Grid.Column="1"
  234. Margin="20,0,0,0"
  235. HorizontalAlignment="Left">
  236. <Run Text="{Binding MinLot, Mode=OneWay}" />
  237. <Run Text="≤" />
  238. <Run Text="{x:Static resources:Client_Resource.SaleOrderFrame_CanBuyQty}" />
  239. <Run Text="≤" />
  240. <Run Text="{Binding MaxLot, Mode=OneWay}" />
  241. <Run Text="{x:Static resources:Client_Resource.SaleOrderFrame_AndMust}" />
  242. <Run Text="{Binding PerOrderQty, Mode=OneWay}" />
  243. <Run Text="{x:Static resources:Client_Resource.SaleOrderFrame_NumsDoulbe}" />
  244. </TextBlock>
  245. </Grid>
  246. </StackPanel>
  247. </StackPanel>
  248. <!-- 确定 -->
  249. <StackPanel Grid.Row="10"
  250. Grid.ColumnSpan="3"
  251. HorizontalAlignment="Center"
  252. Orientation="Horizontal">
  253. <Button Width="82"
  254. Height="26"
  255. Command="{Binding OKCommand}"
  256. CommandParameter="{Binding ElementName=openOrderWindow}"
  257. Content="{x:Static resources:Client_Resource.Button_Confirm}"
  258. IsEnabled="{Binding OKButtonEnabled}"
  259. Style="{DynamicResource CommonButtonStyle}" />
  260. <Button Width="82"
  261. Height="26"
  262. Margin="60,0,0,0"
  263. Command="{Binding CancelCommand}"
  264. CommandParameter="{Binding ElementName=openOrderWindow}"
  265. Content="{x:Static resources:Client_Resource.Button_Cancel}"
  266. IsCancel="True"
  267. Style="{DynamicResource CommonButtonStyle}" />
  268. </StackPanel>
  269. <Button Grid.Row="10"
  270. Grid.Column="1"
  271. Margin="0,0,10,10"
  272. HorizontalAlignment="Right"
  273. VerticalAlignment="Bottom"
  274. Content="{x:Static resources:Client_Resource.EntrustOrderFrame_SetTrade}"
  275. Style="{DynamicResource TextButtonStyle}"
  276. Visibility="Collapsed" />
  277. </Grid>
  278. </xctk:BusyIndicator>
  279. </Border>
  280. </Window>