18 changed files with 221 additions and 398 deletions
@ -1,95 +0,0 @@ |
|||
<Page x:Class="BBWY.Client.Views.PackTask.PersonList" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
xmlns:ctr="clr-namespace:BBWY.Client.Converters" |
|||
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
DataContext="{Binding WareHouseList,Source={StaticResource Locator}}" |
|||
mc:Ignorable="d" |
|||
d:DesignHeight="450" d:DesignWidth="2048" |
|||
Title="TaskList"> |
|||
<Page.Resources> |
|||
<sys:Int32 x:Key="d0">0</sys:Int32> |
|||
<sys:Int32 x:Key="d1">1</sys:Int32> |
|||
<sys:Int32 x:Key="d3">2</sys:Int32> |
|||
<sys:Int32 x:Key="d7">6</sys:Int32> |
|||
<sys:Int32 x:Key="d15">14</sys:Int32> |
|||
<sys:Int32 x:Key="d30">29</sys:Int32> |
|||
|
|||
</Page.Resources> |
|||
<Grid> |
|||
<StackPanel Panel.ZIndex="10" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="810,15,0,0"> |
|||
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox> |
|||
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}"> |
|||
</ListBox> |
|||
</StackPanel> |
|||
|
|||
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> |
|||
<Grid Margin="5,0"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="50"/> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition Height="*"/> |
|||
<RowDefinition Height="30"/> |
|||
<!----> |
|||
</Grid.RowDefinitions> |
|||
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" Width="1100"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition /> |
|||
<ColumnDefinition Width="auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30"> |
|||
<StackPanel.Resources> |
|||
<Style TargetType="DatePickerTextBox"> |
|||
<Setter Property="IsReadOnly" Value="True"/> |
|||
</Style> |
|||
</StackPanel.Resources> |
|||
<TextBlock Text="提交时间:" VerticalAlignment="Center" Margin="11,0,0,0"/> |
|||
<DatePicker SelectedDate="{Binding StartTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/> |
|||
<DatePicker SelectedDate="{Binding EndTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/> |
|||
<TextBlock Text="花名:" VerticalAlignment="Center" Margin="16,0,0,0"/> |
|||
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="" Text="{Binding SearchSkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
|||
<TextBlock Text="任务ID:" VerticalAlignment="Center" Margin="16,0,0,0"/> |
|||
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark=""/> |
|||
|
|||
<TextBlock Text="部门:" VerticalAlignment="Center" Margin="16,0,0,0"/> |
|||
|
|||
|
|||
</StackPanel> |
|||
|
|||
<Grid Grid.Column="1" > |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="5,0,0,0" |
|||
Command="{Binding SearchTaskCommand}" |
|||
Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/> |
|||
|
|||
</Grid> |
|||
</Grid> |
|||
|
|||
|
|||
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/> |
|||
|
|||
|
|||
|
|||
<c:PageControl PageIndex="{Binding PageIndex}" |
|||
PageSize="{Binding PageSize}" |
|||
RecordCount="{Binding OrderCount}" |
|||
Grid.Row="3" |
|||
HorizontalAlignment="Left" Width="450"> |
|||
<b:Interaction.Triggers> |
|||
<b:EventTrigger EventName="OnPageIndexChanged"> |
|||
<b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/> |
|||
</b:EventTrigger> |
|||
</b:Interaction.Triggers> |
|||
</c:PageControl> |
|||
</Grid> |
|||
</Grid> |
|||
</Page> |
@ -1,135 +0,0 @@ |
|||
using BBWY.Client.Helpers; |
|||
using BBWY.Client.Models.PackTask; |
|||
using BBWY.Common.Models; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Newtonsoft.Json; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Reflection; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Navigation; |
|||
using System.Windows.Shapes; |
|||
using System.Linq; |
|||
|
|||
namespace BBWY.Client.Views.PackTask |
|||
{ |
|||
/// <summary>
|
|||
/// PersonList.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class PersonList : Page |
|||
{ |
|||
public PersonList() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); |
|||
var builder = new ConfigurationBuilder().SetBasePath(applicationPath).AddJsonFile("BBWYAppSettings.json", false, true); |
|||
var Configuration = builder.Build(); |
|||
QKApiHost = Configuration.GetSection("QKApiHost").Value; |
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 主机域名
|
|||
/// </summary>
|
|||
string QKApiHost = ""; |
|||
public void SelectionChangeCommand(object sender, SelectionChangedEventArgs e) |
|||
{ |
|||
try |
|||
{ |
|||
var list = (ListBox)sender; |
|||
if (list.Items.Count <= 0) |
|||
{ |
|||
return; |
|||
} |
|||
var value = (ListBoxItem)list.SelectedValue; |
|||
var content = (Label)value.Content; |
|||
tb.Text = content.Content.ToString(); |
|||
tipBox.Visibility = Visibility.Collapsed; |
|||
} |
|||
catch (Exception) |
|||
{ |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
List<string> departments = new List<string>(); |
|||
|
|||
private void tb_TextChanged(object sender, TextChangedEventArgs e) |
|||
{ |
|||
try |
|||
{ |
|||
var textBoxt = (TextBox)sender; |
|||
//创建一个ListBox
|
|||
|
|||
if (tipBox != null && tipBox.Items.Count > 0) |
|||
{ |
|||
tipBox.Items.Clear(); |
|||
|
|||
} |
|||
|
|||
if (departments.Count <= 0) |
|||
{ |
|||
HttpClientHelper helper = new HttpClientHelper(QKApiHost); |
|||
|
|||
string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
|
|||
var data = helper.Get(url); |
|||
|
|||
var res = JsonConvert.DeserializeObject<ApiResponse<UserDepartment[]>>(data); |
|||
//创建一个ListBoxIem
|
|||
if (res.Success) |
|||
{ |
|||
if (res.Data != null && res.Data.Count() > 0) |
|||
{ |
|||
foreach (var department in res.Data) |
|||
{ |
|||
if (!departments.Contains(department.DePartmentName)) |
|||
{ |
|||
departments.Add(department.DePartmentName); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (string.IsNullOrEmpty(textBoxt.Text)) |
|||
{ |
|||
tipBox.Visibility = Visibility.Collapsed; |
|||
return; |
|||
} |
|||
foreach (var department in departments) |
|||
{ |
|||
if (department.Contains(textBoxt.Text)) |
|||
{ |
|||
ListBoxItem item = new ListBoxItem(); |
|||
Label lb = new Label(); |
|||
lb.Content = department; |
|||
item.Content = lb; |
|||
tipBox.Items.Add(item); |
|||
} |
|||
|
|||
} |
|||
|
|||
tipBox.Visibility = Visibility.Visible; |
|||
} |
|||
catch (Exception) |
|||
{ |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue