InboundProductionSearchPage.xaml
4.3 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
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Name="Page"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IndustrialControl.Pages.InboundProductionSearchPage"
xmlns:conv="clr-namespace:IndustrialControl.Converters"
Title="仓储管理系统">
<ContentPage.Resources>
<ResourceDictionary>
<!-- 空/非空转布尔:非空 => true(按钮可用) -->
<conv:NullToBoolConverter x:Key="NullToBoolConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<Grid RowDefinitions="Auto,*,Auto" Padding="16" BackgroundColor="#F6F7FB">
<!-- 顶部:输入条件(第0行) -->
<VerticalStackLayout Grid.Row="0" Spacing="10">
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto" ColumnSpacing="8" RowSpacing="8">
<Entry x:Name="OrderEntry"
Grid.Row="0" Grid.Column="0"
Placeholder="请输入入库单号/包裹条码"
VerticalOptions="Center"
BackgroundColor="White"
Text="{Binding SearchOrderNo}" />
<Button Grid.Row="0" Grid.Column="1"
Text="查询"
Command="{Binding SearchCommand}" />
<Grid Grid.Row="1" Grid.ColumnSpan="2" ColumnDefinitions="Auto,*,Auto,*" ColumnSpacing="8">
<Label Grid.Column="0" Text="开始:" VerticalTextAlignment="Center"/>
<DatePicker Grid.Column="1" Date="{Binding StartDate}" />
<Label Grid.Column="2" Text="结束:" VerticalTextAlignment="Center"/>
<DatePicker Grid.Column="3" Date="{Binding EndDate}" />
</Grid>
</Grid>
</VerticalStackLayout>
<!-- 中部:结果列表(第1行) -->
<CollectionView Grid.Row="1"
ItemsSource="{Binding Orders}"
SelectionMode="Single"
SelectedItem="{Binding SelectedOrder, Mode=TwoWay}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Margin="0,8,0,0" Padding="12" HasShadow="True" CornerRadius="10">
<!-- ⭐ 点击整卡片触发命令 -->
<Frame.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding BindingContext.GoInboundCommand, Source={x:Reference Page}}"
CommandParameter="{Binding .}" />
</Frame.GestureRecognizers>
<Grid RowDefinitions="Auto,Auto,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="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 supplierName}" />
<Label Grid.Row="4" Grid.Column="0" Text="关联到货单号:" FontAttributes="Bold"/>
<Label Grid.Row="4" Grid.Column="1" Text="{Binding arrivalNo}" />
<Label Grid.Row="5" Grid.Column="0" Text="创建日期:" FontAttributes="Bold"/>
<Label Grid.Row="5" Grid.Column="1" Text="{Binding createdTime}" />
</Grid>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>