InboundProductionPage.xaml
8.4 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
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IndustrialControl.Pages.InboundProductionPage"
BackgroundColor="White">
<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}" />
<ImageButton Grid.Column="1"
Source="scan.png"
BackgroundColor="#E6F2FF"
CornerRadius="4"
Padding="10"
Clicked="OnScanClicked"/>
</Grid>
<!-- 基础信息 -->
<Frame Margin="0,8,0,0" Padding="12" HasShadow="True" CornerRadius="10">
<!-- 点击整卡片:直接调用 VM 的 GoInboundCommand,并把当前项作为参数 -->
<Frame.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding BindingContext.GoInboundCommand, Source={x:Reference Page}}"
CommandParameter="{Binding .}" />
</Frame.GestureRecognizers>
<Grid RowDefinitions="Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto,*" ColumnSpacing="8">
<Label Grid.Row="0" Grid.Column="0" Text="入库单号:" FontAttributes="Bold"/>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding instockNo}"/>
<Label Grid.Row="1" Grid.Column="0" Text="入库单类型:" FontAttributes="Bold"/>
<Label Grid.Row="1" Grid.Column="1" Text="{Binding orderTypeName}" />
<Label Grid.Row="1" Grid.Column="0" Text="产品名称:" FontAttributes="Bold"/>
<Label Grid.Row="1" Grid.Column="1" Text="{Binding orderTypeName}" />
<Label Grid.Row="2" Grid.Column="0" Text="供应商名称:" FontAttributes="Bold"/>
<Label Grid.Row="2" Grid.Column="1" Text="{Binding supplierName}" />
<Label Grid.Row="2" Grid.Column="0" Text="关工单号:" FontAttributes="Bold"/>
<Label Grid.Row="2" Grid.Column="1" Text="{Binding supplierName}" />
<Label Grid.Row="3" Grid.Column="0" Text="创建日期:" FontAttributes="Bold"/>
<Label Grid.Row="3" Grid.Column="1" Text="{Binding createdTime}" />
</Grid>
</Frame>
<!-- 扫描明细 -->
<Grid Grid.Row="3" RowDefinitions="Auto,*" Margin="0">
<!-- 表头 -->
<Grid ColumnDefinitions="40,*,*,*" BackgroundColor="#F2F2F2" 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="1"
ItemsSource="{Binding Lines}"
SelectionMode="Single">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40,*,*,*" 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>
<CheckBox IsChecked="{Binding IsSelected}" />
<Label Grid.Column="1" Text="{Binding Barcode}" />
<!-- 库位改成 Picker -->
<Picker Grid.Column="2"
ItemsSource="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.AvailableBins}"
SelectedItem="{Binding Bin, Mode=TwoWay}"
FontSize="14"
Title="请选择"
HorizontalOptions="FillAndExpand" />
<Label Grid.Column="3" Text="{Binding Qty}" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
<!-- 底部按钮 -->
<Grid Grid.Row="4" ColumnDefinitions="*,*,*" Padding="16,8" ColumnSpacing="10">
<!-- 扫描通过 -->
<Grid BackgroundColor="#4CAF50"
HorizontalOptions="Fill"
VerticalOptions="Fill">
<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">
<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">
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ConfirmCommand}" />
</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>