MoldOutboundExecutePage.xaml
6.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IndustrialControl.Pages.MoldOutboundExecutePage"
Title="出库执行">
<ContentPage.Resources>
<!-- 表头与行样式 -->
<Style TargetType="Grid" x:Key="TableHeader">
<Setter Property="BackgroundColor" Value="#F5F7FA"/>
<Setter Property="Padding" Value="8,6"/>
<Setter Property="ColumnSpacing" Value="8"/>
</Style>
<Style TargetType="Grid" x:Key="TableRow">
<Setter Property="Padding" Value="8,6"/>
<Setter Property="ColumnSpacing" Value="8"/>
</Style>
</ContentPage.Resources>
<Grid RowDefinitions="Auto,*,Auto">
<!-- 顶部蓝条 -->
<Grid Grid.Row="0" BackgroundColor="#007BFF" HeightRequest="56" Padding="16,0">
<Label Text="仓储管理系统"
VerticalOptions="Center"
TextColor="White" FontSize="18" FontAttributes="Bold"/>
</Grid>
<!-- 主体 -->
<ScrollView Grid.Row="1">
<VerticalStackLayout Padding="12" Spacing="12">
<!-- 模具编码 -->
<Grid ColumnDefinitions="Auto,*" ColumnSpacing="12">
<Label Text="模具编码" VerticalTextAlignment="Center" />
<Entry x:Name="MoldEntry"
Grid.Column="1"
Placeholder="请扫描模具或输入具编码"
Completed="OnMoldCompleted" />
</Grid>
<!-- 需求基础信息 -->
<Label Text="需求基础信息" FontAttributes="Bold" />
<Frame Padding="0" HasShadow="False" BorderColor="#E0E6EF">
<VerticalStackLayout Spacing="0">
<!-- 顶部两列 -->
<Grid ColumnDefinitions="*,*" Style="{StaticResource TableHeader}">
<Grid ColumnDefinitions="Auto,*">
<Label Text="工单号:" />
<Label Grid.Column="1" Text="{Binding OrderNo}" />
</Grid>
<Grid Grid.Column="1" ColumnDefinitions="Auto,*">
<Label Text="产品名称:" />
<Label Grid.Column="1" Text="XXXXX" />
<!-- 需要时可绑定到 VM 的 ProductName -->
</Grid>
</Grid>
<!-- 模具型号表(示例样式;后续可替换为绑定集合) -->
<Grid Padding="8,6" ColumnDefinitions="Auto,*" BackgroundColor="#FFFFFF">
<Label Text="序号" FontAttributes="Bold"/>
<Label Grid.Column="1" Text="模具型号" FontAttributes="Bold"/>
</Grid>
<Grid Padding="8,6" ColumnDefinitions="Auto,*">
<Label Text="1"/>
<Label Grid.Column="1" Text="MU_DHJD_01"/>
</Grid>
<Grid Padding="8,6" ColumnDefinitions="Auto,*">
<Label Text="2"/>
<Label Grid.Column="1" Text="MU_DHJD_02"/>
</Grid>
</VerticalStackLayout>
</Frame>
<!-- 扫描明细 -->
<Label Text="扫描明细" TextColor="#17A673" FontAttributes="Bold" />
<!-- 表头 -->
<Grid ColumnDefinitions="40,Auto,*,*,Auto,*"
Style="{StaticResource TableHeader}">
<Label Text="#" />
<Label Grid.Column="1" Text="选择" />
<Label Grid.Column="2" Text="模具编码" />
<Label Grid.Column="3" Text="模具型号" />
<Label Grid.Column="4" Text="出库数量" />
<Label Grid.Column="5" Text="出库库位" />
</Grid>
<!-- 明细列表 -->
<CollectionView ItemsSource="{Binding ScanDetails}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40,Auto,*,*,Auto,*"
Style="{StaticResource TableRow}">
<!-- 背景根据 Selected 高亮为绿色 -->
<Grid.Triggers>
<DataTrigger TargetType="Grid" Binding="{Binding Selected}" Value="True">
<Setter Property="BackgroundColor" Value="#6EF593"/>
</DataTrigger>
</Grid.Triggers>
<Label Text="{Binding Index}" />
<CheckBox Grid.Column="1" IsChecked="{Binding Selected, Mode=TwoWay}" />
<Label Grid.Column="2" Text="{Binding MoldCode}" />
<Label Grid.Column="3" Text="{Binding MoldModel}" />
<Label Grid.Column="4" Text="{Binding Qty}" HorizontalTextAlignment="Center" />
<Label Grid.Column="5" Text="{Binding Bin}" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
<!-- 底部操作条 -->
<Grid Grid.Row="2" BackgroundColor="White" Padding="16,8" ColumnDefinitions="*,Auto,*">
<!-- 取消扫描 -->
<Button Grid.Column="0"
Text="取消扫描"
TextColor="#C62828"
BorderColor="#C62828"
BorderWidth="1"
CornerRadius="8"
Command="{Binding CancelScanCommand}" />
<!-- 占位间距 -->
<BoxView Grid.Column="1" WidthRequest="16" />
<!-- 确认出库 -->
<Button Grid.Column="2"
Text="确认出库"
BackgroundColor="#0EA5E9"
TextColor="White"
CornerRadius="8"
Command="{Binding ConfirmCommand}" />
</Grid>
</Grid>
</ContentPage>