终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

388 lines
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.Resources>
  15. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  16. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  17. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  18. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  19. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  20. <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
  21. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  22. <Setter Property="FontFamily" Value="楷体" />
  23. <Setter Property="FontSize" Value="20" />
  24. <Setter Property="Background" Value="Transparent" />
  25. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  26. <Setter Property="VerticalAlignment" Value="Center" />
  27. <Setter Property="HorizontalAlignment" Value="Center" />
  28. </Style>
  29. <Style x:Key="buttonStyle" TargetType="Button">
  30. <Setter Property="Background" Value="Transparent" />
  31. <Setter Property="FontSize" Value="16" />
  32. <Setter Property="Foreground" Value="Aqua" />
  33. <Setter Property="HorizontalAlignment" Value="Center" />
  34. <Setter Property="BorderThickness" Value="0" />
  35. </Style>
  36. <!--#region 下拉列表样式-->
  37. <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  38. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  39. <!--<Setter Property="Height" Value="10" />-->
  40. <Setter Property="HorizontalContentAlignment" Value="Left" />
  41. <Setter Property="VerticalContentAlignment" Value="Top" />
  42. <Setter Property="Padding" Value="10,10" />
  43. <Setter Property="Template">
  44. <Setter.Value>
  45. <ControlTemplate TargetType="{x:Type ToggleButton}">
  46. <Grid>
  47. <Border
  48. x:Name="border2"
  49. Width="auto"
  50. Margin="{TemplateBinding Padding}"
  51. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  52. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  53. Background="{TemplateBinding Background}">
  54. <ContentPresenter
  55. Margin="{TemplateBinding Padding}"
  56. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  57. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  58. RecognizesAccessKey="True"
  59. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  60. </Border>
  61. </Grid>
  62. <ControlTemplate.Triggers>
  63. <!--<Trigger Property="IsPressed" Value="true">
  64. <Setter Property="Background" Value="#FFd2e7f4" />
  65. </Trigger>
  66. <Trigger Property="IsChecked" Value="true">
  67. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  68. </Trigger>
  69. <Trigger Property="IsChecked" Value="false">
  70. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  71. </Trigger>-->
  72. <!--<Trigger Property="IsEnabled" Value="false">
  73. <Setter Property="Foreground" Value="White" />
  74. </Trigger>-->
  75. <Trigger Property="IsMouseOver" Value="True">
  76. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  77. </Trigger>
  78. <Trigger Property="IsMouseOver" Value="False">
  79. <Setter TargetName="border2" Property="Background" Value="Transparent" />
  80. </Trigger>
  81. </ControlTemplate.Triggers>
  82. </ControlTemplate>
  83. </Setter.Value>
  84. </Setter>
  85. </Style>
  86. <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
  87. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  88. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  89. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  90. <Setter Property="BorderBrush" Value="Transparent" />
  91. <Setter Property="BorderThickness" Value="1" />
  92. <Setter Property="Template">
  93. <Setter.Value>
  94. <ControlTemplate TargetType="{x:Type Expander}">
  95. <DockPanel>
  96. <ToggleButton
  97. x:Name="HeaderSite"
  98. Height="20"
  99. Width="auto"
  100. MinWidth="0"
  101. MinHeight="0"
  102. Margin="1"
  103. Padding="{TemplateBinding Padding}"
  104. Background="Transparent"
  105. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  106. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  107. Content="{TemplateBinding Header}"
  108. ContentTemplate="{TemplateBinding HeaderTemplate}"
  109. ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
  110. DockPanel.Dock="Top"
  111. FontFamily="{TemplateBinding FontFamily}"
  112. FontSize="{TemplateBinding FontSize}"
  113. FontStretch="{TemplateBinding FontStretch}"
  114. FontStyle="{TemplateBinding FontStyle}"
  115. FontWeight="{TemplateBinding FontWeight}"
  116. Foreground="{TemplateBinding Foreground}"
  117. IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  118. Style="{StaticResource ToggleButtonStyle}" />
  119. <ContentPresenter
  120. x:Name="ExpandSite"
  121. Margin="{TemplateBinding Padding}"
  122. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  123. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  124. DockPanel.Dock="Left"
  125. Focusable="false"
  126. Visibility="Visible" />
  127. </DockPanel>
  128. <ControlTemplate.Triggers>
  129. <Trigger Property="IsExpanded" Value="True">
  130. <Setter TargetName="ExpandSite" Property="Visibility" Value="Collapsed" />
  131. </Trigger>
  132. </ControlTemplate.Triggers>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. <!--#endregion-->
  138. </UserControl.Resources>
  139. <UserControl.DataContext>
  140. <vm:RecipeReceiveViewModel/>
  141. </UserControl.DataContext>
  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>