OutboundFinishedPage.xaml
12.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IndustrialControl.Pages.OutboundFinishedPage"
BackgroundColor="White" Shell.NavBarIsVisible="True">
<Grid RowDefinitions="Auto,Auto,Auto,*,Auto">
<!-- 顶部蓝色标题栏 -->
<Grid BackgroundColor="#007BFF" HeightRequest="60" Padding="16,0">
<Label Text="仓储管理系统"
VerticalOptions="Center"
TextColor="White"
FontSize="18"
FontAttributes="Bold"/>
</Grid>
<!-- 入库单/条码扫描 -->
<Grid Grid.Row="1" ColumnDefinitions="*,60" Padding="16,8">
<Entry x:Name="ScanEntry"
Placeholder="请扫描出库单/产品/包装条码"
FontSize="14"
VerticalOptions="Center"
BackgroundColor="White"
HeightRequest="40"
Text="{Binding ScanCode}" />
</Grid>
<!-- 基础信息 -->
<Frame Grid.Row="2" Margin="8,0" Padding="8" BorderColor="#CCCCCC" BackgroundColor="White">
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*,*" ColumnSpacing="16" RowSpacing="6">
<!-- 出库单号 -->
<Label Grid.Row="0" Grid.Column="0" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="出库单号:" FontAttributes="Bold"/>
<Span Text="{Binding OutstockNo}"/>
</FormattedString>
</Label.FormattedText>
</Label>
<!-- 发货单号 -->
<Label Grid.Row="1" Grid.Column="0" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="发货单号:" FontAttributes="Bold"/>
<Span Text="{Binding DeliveryNo}"/>
</FormattedString>
</Label.FormattedText>
</Label>
<!-- 客户 -->
<Label Grid.Row="1" Grid.Column="1" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="客户:" FontAttributes="Bold"/>
<Span Text="{Binding PurchaseNo}"/>
</FormattedString>
</Label.FormattedText>
</Label>
<!-- 要求发货时间 -->
<Label Grid.Row="2" Grid.Column="0" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="要求发货时间:" FontAttributes="Bold"/>
<Span Text="{Binding SupplierName}"/>
</FormattedString>
</Label.FormattedText>
</Label>
<!-- 关联销售单 -->
<Label Grid.Row="2" Grid.Column="1" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="关联销售单:" FontAttributes="Bold"/>
<Span Text="{Binding SupplierName}"/>
</FormattedString>
</Label.FormattedText>
</Label>
<!-- 发货单备注 -->
<Label Grid.Row="3" Grid.Column="0" FontSize="13" LineBreakMode="TailTruncation" MaxLines="1">
<Label.FormattedText>
<FormattedString>
<Span Text="发货单备注:" FontAttributes="Bold"/>
<Span Text="{Binding SupplierName}"/>
</FormattedString>
</Label.FormattedText>
</Label>
</Grid>
</Frame>
<!-- Tab切换 -->
<Grid Grid.Row="3" RowDefinitions="Auto,Auto,*" Margin="0">
<Grid ColumnDefinitions="*,*" BackgroundColor="White">
<Button Text="待入库明细"
Command="{Binding ShowPendingCommand}"
BackgroundColor="{Binding PendingTabColor}"
TextColor="{Binding PendingTextColor}" />
<Button Text="扫描明细"
Grid.Column="1"
Command="{Binding ShowScannedCommand}"
BackgroundColor="{Binding ScannedTabColor}"
TextColor="{Binding ScannedTextColor}" />
</Grid>
<!-- 待出库明细表头 -->
<Grid Grid.Row="1" ColumnDefinitions="*,*,*,*,*,*,*" BackgroundColor="#F2F2F2" IsVisible="{Binding IsPendingVisible}" Padding="8">
<Label Text="产品名称" FontAttributes="Bold" />
<Label Grid.Column="1" Text="产品编码" FontAttributes="Bold" />
<Label Grid.Column="2" Text="规格" FontAttributes="Bold" />
<Label Grid.Column="3" Text="出库库位" FontAttributes="Bold" />
<Label Grid.Column="4" Text="生产批号" FontAttributes="Bold" />
<Label Grid.Column="5" Text="出库数量" FontAttributes="Bold" />
<Label Grid.Column="6" Text="已扫描数" FontAttributes="Bold" />
</Grid>
<!-- 待入库明细列表 -->
<CollectionView Grid.Row="2"
ItemsSource="{Binding PendingList}"
IsVisible="{Binding IsPendingVisible}"
SelectionMode="Single">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="*,*,*,*,*,*,*" Padding="8" BackgroundColor="White">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup Name="CommonStates">
<VisualState Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#CCFFCC"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Label Text="{Binding Name}" />
<Label Grid.Column="1" Text="{Binding MaterialCode}" />
<Label Grid.Column="2" Text="{Binding Spec}" />
<Label Grid.Column="3" Text="{Binding Location}" />
<Label Grid.Column="4" Text="{Binding ProductionBatch}" />
<Label Grid.Column="5" Text="{Binding OutstockQty}" />
<Label Grid.Column="6" Text="{Binding Qty}" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<!-- 扫描明细表头 -->
<Grid Grid.Row="1" ColumnDefinitions="40,*,*,*" BackgroundColor="#F2F2F2" IsVisible="{Binding IsScannedVisible}" Padding="8">
<Label Text="选择" FontAttributes="Bold" />
<Label Grid.Column="1" Text="物料名称" FontAttributes="Bold" />
<Label Grid.Column="2" Text="条码" FontAttributes="Bold" />
<Label Grid.Column="3" Text="数量" FontAttributes="Bold" />
</Grid>
<!-- 扫描明细列表 -->
<CollectionView Grid.Row="2"
ItemsSource="{Binding ScannedList}"
IsVisible="{Binding IsScannedVisible}"
SelectionMode="Single"
SelectedItem="{Binding SelectedScanItem, Mode=TwoWay}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40,*,*,*" Padding="8" BackgroundColor="White">
<Grid.Triggers>
<!-- ScanStatus = true → 绿色 -->
<DataTrigger TargetType="Grid" Binding="{Binding ScanStatus}" Value="True">
<Setter Property="BackgroundColor" Value="#E6FFE6" />
</DataTrigger>
</Grid.Triggers>
<CheckBox IsChecked="{Binding IsSelected}" />
<Label Grid.Column="1" Text="{Binding Name}" />
<Label Grid.Column="2" Text="{Binding Barcode}" />
<Entry Grid.Column="3"
Keyboard="Numeric"
HorizontalTextAlignment="Center"
WidthRequest="64"
Completed="OnQtyCompleted"
Text="{Binding Qty, Mode=TwoWay, Converter={StaticResource IntConverter}}" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
<!-- 底部按钮 -->
<Grid Grid.Row="4" ColumnDefinitions="*,*,*" Padding="16,8" ColumnSpacing="10">
<!-- 扫描通过 -->
<Grid BackgroundColor="#4CAF50"
HorizontalOptions="Fill"
VerticalOptions="Fill"
HeightRequest="50">
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding PassScanCommand}" />
</Grid.GestureRecognizers>
<StackLayout Orientation="Horizontal"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image Source="pass.png" HeightRequest="20" WidthRequest="20" />
<Label Text="扫描通过"
Margin="5,0,0,0"
VerticalOptions="Center"
TextColor="White" />
</StackLayout>
</Grid>
<!-- 取消扫描 -->
<Grid Grid.Column="1"
BackgroundColor="#F44336"
HorizontalOptions="Fill"
VerticalOptions="Fill"
HeightRequest="50">
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding CancelScanCommand}" />
</Grid.GestureRecognizers>
<StackLayout Orientation="Horizontal"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image Source="cancel.png" HeightRequest="20" WidthRequest="20" />
<Label Text="取消扫描"
Margin="5,0,0,0"
VerticalOptions="Center"
TextColor="White" />
</StackLayout>
</Grid>
<!-- 确认入库 -->
<Grid Grid.Column="2"
BackgroundColor="#2196F3"
HorizontalOptions="Fill"
VerticalOptions="Fill"
HeightRequest="50">
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="OnConfirmClicked" />
</Grid.GestureRecognizers>
<StackLayout Orientation="Horizontal"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image Source="confirm.png" HeightRequest="20" WidthRequest="20" />
<Label Text="确认出库"
Margin="5,0,0,0"
VerticalOptions="Center"
TextColor="White" />
</StackLayout>
</Grid>
</Grid>
</Grid>
</ContentPage>