OutboundFinishedSearchPage.xaml 3.7 KB
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="IndustrialControl.Pages.OutboundFinishedSearchPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Name="Page"
    Shell.NavBarIsVisible="True">

    <ScrollView>
        <VerticalStackLayout Spacing="12" Padding="12">

            <!-- 查询区域 -->
            <Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto" ColumnSpacing="8" RowSpacing="8">
                <Entry x:Name="OrderEntry"
                       Grid.Row="0" Grid.Column="0"
                       Placeholder="请扫描输入出库单条码"
                       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>

            <!-- 列表区域 -->
            <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">
                            <!-- 点击整卡片:直接调用 VM 的 GoOutboundCommand,并把当前项作为参数 -->
                            <Frame.GestureRecognizers>
                                <TapGestureRecognizer
                                    Command="{Binding BindingContext.GoOutboundCommand, Source={x:Reference Page}}"
                                    CommandParameter="{Binding .}" />
                            </Frame.GestureRecognizers>

                            <Grid RowDefinitions="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 outstockNo}"/>

                                <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 deliveryNo}" />

                                <Label Grid.Row="3" Grid.Column="0" Text="关联销售号:" FontAttributes="Bold"/>
                                <Label Grid.Row="3" Grid.Column="1" Text="{Binding saleNo}" />

                                <Label Grid.Row="4" Grid.Column="0" Text="创建日期:" FontAttributes="Bold"/>
                                <Label Grid.Row="4" Grid.Column="1" Text="{Binding createdTime}" />
                            </Grid>
                        </Frame>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>

        </VerticalStackLayout>
    </ScrollView>
</ContentPage>