终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

387 lignes
20 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.JXJFoodBigStation.View.RecipeReceiveView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  10. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:RecipeReceiveViewModel/>
  16. </UserControl.DataContext>
  17. <UserControl.Resources>
  18. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  19. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  20. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  21. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  22. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  23. <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
  24. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  25. <Setter Property="FontFamily" Value="楷体" />
  26. <Setter Property="FontSize" Value="20" />
  27. <Setter Property="Background" Value="Transparent" />
  28. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  29. <Setter Property="VerticalAlignment" Value="Center" />
  30. <Setter Property="HorizontalAlignment" Value="Center" />
  31. </Style>
  32. <Style x:Key="buttonStyle" TargetType="Button">
  33. <Setter Property="Background" Value="Transparent" />
  34. <Setter Property="FontSize" Value="16" />
  35. <Setter Property="Foreground" Value="Aqua" />
  36. <Setter Property="HorizontalAlignment" Value="Center" />
  37. <Setter Property="BorderThickness" Value="0" />
  38. </Style>
  39. <!--#region 下拉列表样式-->
  40. <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  41. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  42. <!--<Setter Property="Height" Value="10" />-->
  43. <Setter Property="HorizontalContentAlignment" Value="Left" />
  44. <Setter Property="VerticalContentAlignment" Value="Top" />
  45. <Setter Property="Padding" Value="10,10" />
  46. <Setter Property="Template">
  47. <Setter.Value>
  48. <ControlTemplate TargetType="{x:Type ToggleButton}">
  49. <Grid>
  50. <Border
  51. x:Name="border2"
  52. Width="auto"
  53. Margin="{TemplateBinding Padding}"
  54. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  55. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  56. Background="{TemplateBinding Background}">
  57. <ContentPresenter
  58. Margin="{TemplateBinding Padding}"
  59. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  60. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  61. RecognizesAccessKey="True"
  62. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  63. </Border>
  64. </Grid>
  65. <ControlTemplate.Triggers>
  66. <!--<Trigger Property="IsPressed" Value="true">
  67. <Setter Property="Background" Value="#FFd2e7f4" />
  68. </Trigger>
  69. <Trigger Property="IsChecked" Value="true">
  70. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  71. </Trigger>
  72. <Trigger Property="IsChecked" Value="false">
  73. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  74. </Trigger>-->
  75. <!--<Trigger Property="IsEnabled" Value="false">
  76. <Setter Property="Foreground" Value="White" />
  77. </Trigger>-->
  78. <Trigger Property="IsMouseOver" Value="True">
  79. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  80. </Trigger>
  81. <Trigger Property="IsMouseOver" Value="False">
  82. <Setter TargetName="border2" Property="Background" Value="Transparent" />
  83. </Trigger>
  84. </ControlTemplate.Triggers>
  85. </ControlTemplate>
  86. </Setter.Value>
  87. </Setter>
  88. </Style>
  89. <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
  90. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  91. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  92. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  93. <Setter Property="BorderBrush" Value="Transparent" />
  94. <Setter Property="BorderThickness" Value="1" />
  95. <Setter Property="Template">
  96. <Setter.Value>
  97. <ControlTemplate TargetType="{x:Type Expander}">
  98. <DockPanel>
  99. <ToggleButton
  100. x:Name="HeaderSite"
  101. Height="20"
  102. Width="auto"
  103. MinWidth="0"
  104. MinHeight="0"
  105. Margin="1"
  106. Padding="{TemplateBinding Padding}"
  107. Background="Transparent"
  108. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  109. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  110. Content="{TemplateBinding Header}"
  111. ContentTemplate="{TemplateBinding HeaderTemplate}"
  112. ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
  113. DockPanel.Dock="Top"
  114. FontFamily="{TemplateBinding FontFamily}"
  115. FontSize="{TemplateBinding FontSize}"
  116. FontStretch="{TemplateBinding FontStretch}"
  117. FontStyle="{TemplateBinding FontStyle}"
  118. FontWeight="{TemplateBinding FontWeight}"
  119. Foreground="{TemplateBinding Foreground}"
  120. IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  121. Style="{StaticResource ToggleButtonStyle}" />
  122. <ContentPresenter
  123. x:Name="ExpandSite"
  124. Margin="{TemplateBinding Padding}"
  125. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  126. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  127. DockPanel.Dock="Left"
  128. Focusable="false"
  129. Visibility="Visible" />
  130. </DockPanel>
  131. <ControlTemplate.Triggers>
  132. <Trigger Property="IsExpanded" Value="True">
  133. <Setter TargetName="ExpandSite" Property="Visibility" Value="Collapsed" />
  134. </Trigger>
  135. </ControlTemplate.Triggers>
  136. </ControlTemplate>
  137. </Setter.Value>
  138. </Setter>
  139. </Style>
  140. <!--#endregion-->
  141. </UserControl.Resources>
  142. <Grid>
  143. <Grid.RowDefinitions>
  144. <RowDefinition Height="50"/>
  145. <RowDefinition />
  146. </Grid.RowDefinitions>
  147. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  148. <pry:IcoButton
  149. Width="140"
  150. Margin="10"
  151. HorizontalAlignment="Left"
  152. Command="{Binding NewRecipe}"
  153. Content="新建配方"
  154. FontSize="16"
  155. Foreground="Aqua"
  156. IcoText="&#xe626;"
  157. Style="{StaticResource IcoButtonStyle}" />
  158. <!--<pry:IcoButton
  159. Width="140"
  160. Margin="10"
  161. HorizontalAlignment="Left"
  162. Command="{Binding NewSimulateRecipe}"
  163. Content="新建模拟配方"
  164. FontSize="16"
  165. Foreground="Aqua"
  166. IcoText="&#xe626;"
  167. Style="{StaticResource IcoButtonStyle}" />-->
  168. <pry:IcoButton
  169. Grid.Column="3"
  170. Width="140"
  171. Margin="10"
  172. HorizontalAlignment="Left"
  173. Command="{Binding ClearAllRecipe}"
  174. Content="清除所有配方"
  175. FontSize="16"
  176. Foreground="Aqua"
  177. IcoText="&#xe635;"
  178. IsEnabled="True"
  179. Style="{StaticResource IcoButtonStyle}" />
  180. </StackPanel>
  181. <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Hidden">
  182. <ListBox
  183. Grid.Row="2"
  184. Margin="5"
  185. VerticalAlignment="Top"
  186. Background="Transparent"
  187. BorderThickness="0"
  188. ItemsSource="{Binding Recipes}"
  189. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  190. <ListBox.ItemsPanel>
  191. <ItemsPanelTemplate>
  192. <UniformGrid
  193. HorizontalAlignment="Left"
  194. VerticalAlignment="Top"
  195. Columns="8" />
  196. </ItemsPanelTemplate>
  197. </ListBox.ItemsPanel>
  198. <ListBox.ItemTemplate>
  199. <DataTemplate>
  200. <Grid
  201. Name="tt"
  202. Height="220"
  203. Margin="5">
  204. <Grid.RowDefinitions>
  205. <RowDefinition Height="30" />
  206. <RowDefinition Height="20" />
  207. <RowDefinition Height="128" />
  208. <RowDefinition Height="2" />
  209. <RowDefinition Height="40" />
  210. </Grid.RowDefinitions>
  211. <Image
  212. Grid.RowSpan="5"
  213. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  214. Stretch="Fill" />
  215. <TextBlock
  216. Grid.Row="0"
  217. Margin="2,5,0,0"
  218. HorizontalAlignment="Center"
  219. VerticalAlignment="Top"
  220. FontSize="18"
  221. Foreground="#FF2AB2E7"
  222. Text="{Binding RecipeName}" />
  223. <TextBlock
  224. Grid.Row="1"
  225. FontSize="16"
  226. Margin="5,0,0,0"
  227. VerticalAlignment="Top"
  228. Foreground="#FF2AB2E7"
  229. Text="配方信息:" />
  230. <ScrollViewer
  231. Grid.Row="2"
  232. VerticalAlignment="Top"
  233. Background="Transparent"
  234. HorizontalScrollBarVisibility="Hidden"
  235. VerticalScrollBarVisibility="Hidden">
  236. <ItemsControl ItemsSource="{Binding RawMaterial}">
  237. <ItemsControl.ItemsPanel>
  238. <ItemsPanelTemplate>
  239. <StackPanel/>
  240. </ItemsPanelTemplate>
  241. </ItemsControl.ItemsPanel>
  242. <ItemsControl.ItemTemplate>
  243. <DataTemplate>
  244. <Expander Style="{StaticResource ExpanderStyle}" Margin="40,0,0,0">
  245. <Expander.Header>
  246. <StackPanel Orientation="Horizontal">
  247. <Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="0,0,5,0">
  248. <Border.Background>
  249. <RadialGradientBrush>
  250. <GradientStop Color="#FF2AB2E7" Offset="0.5" />
  251. <GradientStop Color="White"/>
  252. </RadialGradientBrush>
  253. </Border.Background>
  254. </Border>
  255. <TextBlock Text="{Binding RawMaterialName }" Foreground="#FF2AB2E7" VerticalAlignment="Center" FontSize="14" />
  256. </StackPanel>
  257. </Expander.Header>
  258. <Expander.Content>
  259. <StackPanel Margin="36,0,0,0">
  260. <StackPanel Orientation="Horizontal">
  261. <TextBlock Text="托盘桶号:" Foreground="#FF2AB2E7"/>
  262. <TextBlock Text="{Binding RawMaterialBarrelNum}" Foreground="#FF2AB2E7"/>
  263. </StackPanel>
  264. <StackPanel Orientation="Horizontal">
  265. <TextBlock Text="原料重量:" Foreground="#FF2AB2E7"/>
  266. <TextBlock Text="{Binding RawMaterialWeight}" Foreground="#FF2AB2E7"/>
  267. </StackPanel>
  268. </StackPanel>
  269. </Expander.Content>
  270. </Expander>
  271. </DataTemplate>
  272. </ItemsControl.ItemTemplate>
  273. </ItemsControl>
  274. </ScrollViewer>
  275. <Image
  276. Grid.Row="3"
  277. Width="{Binding ElementName=tt, Path=ActualWidth}"
  278. Height="2"
  279. VerticalAlignment="Bottom"
  280. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  281. Stretch="Fill" />
  282. <Grid
  283. Name="gr"
  284. Grid.Row="4"
  285. Height="30"
  286. Margin="0,0,0,10"
  287. VerticalAlignment="Bottom"
  288. Background="Transparent">
  289. <Grid.ColumnDefinitions>
  290. <ColumnDefinition />
  291. <ColumnDefinition />
  292. </Grid.ColumnDefinitions>
  293. <!--<Image
  294. Height="2"
  295. Grid.ColumnSpan="2"
  296. Width="{Binding ElementName=gr, Path=ActualWidth}"
  297. VerticalAlignment="Top"
  298. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />-->
  299. <!--<pry:IcoButton
  300. Grid.Column="1"
  301. Width="{Binding ElementName=gr, Path=ActualWidth}"
  302. Height="{Binding ElementName=gr, Path=ActualHeight}"
  303. Margin="4,4,4,0"
  304. HorizontalAlignment="Center"
  305. VerticalAlignment="Center"
  306. Background="#11F53F62"
  307. BorderThickness="0"
  308. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  309. CommandParameter="{Binding RecipCode}"
  310. Content="删除"
  311. EnterBackground="#22F53F62"
  312. FontStyle="Normal"
  313. Foreground="#FFF53F62"
  314. IcoText="&#xe68e;"
  315. Style="{StaticResource IcoButtonStyle}" />-->
  316. <pry:IcoButton
  317. Grid.Column="1"
  318. Width="{Binding ElementName=gr, Path=ActualWidth}"
  319. Height="{Binding ElementName=gr, Path=ActualHeight}"
  320. Margin="3,4,4,0"
  321. HorizontalAlignment="Center"
  322. VerticalAlignment="Center"
  323. Background="#11F53F62"
  324. BorderThickness="0"
  325. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  326. CommandParameter="{Binding RecipeCode}"
  327. Content="删除"
  328. EnterBackground="#22F53F62"
  329. Foreground="#FFF53F62"
  330. IcoText="&#xe68e;"
  331. Style="{StaticResource IcoButtonStyle}" />
  332. <pry:IcoButton
  333. Width="{Binding ElementName=gr, Path=ActualWidth}"
  334. Height="{Binding ElementName=gr, Path=ActualHeight}"
  335. Margin="3,4,4,0"
  336. HorizontalAlignment="Center"
  337. VerticalAlignment="Center"
  338. Background="#112AB2E7"
  339. BorderThickness="0"
  340. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  341. CommandParameter="{Binding RecipeCode}"
  342. Content="编辑"
  343. EnterBackground="#222AB2E7"
  344. Foreground="#FF2AB2E7"
  345. IcoText="&#xe636;"
  346. Style="{StaticResource IcoButtonStyle}" />
  347. </Grid>
  348. </Grid>
  349. </DataTemplate>
  350. </ListBox.ItemTemplate>
  351. </ListBox>
  352. </ScrollViewer>
  353. </Grid>
  354. </UserControl>