Browse Source

添加商家自取状态

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
30b5a3508a
  1. 83
      BBWY.Client/APIServices/QiKu/PackTaskService.cs
  2. 3
      BBWY.Client/Models/Enums.cs
  3. 2
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  4. 59
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  5. 126
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  6. 18
      BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs
  7. 2
      BBWY.Client/Views/PackTask/TaskList.xaml
  8. 2
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  9. 2
      BBWY.Client/Views/PackTask/WareHouseList.xaml
  10. 159
      BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
  11. 58
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  12. 4
      BBWY.Client/Views/QualityTask/QualityWindow.xaml

83
BBWY.Client/APIServices/QiKu/PackTaskService.cs

@ -11,6 +11,7 @@ using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Windows.Documents;
namespace BBWY.Client.APIServices
@ -58,7 +59,7 @@ namespace BBWY.Client.APIServices
ShopId = globalContext.User.Shop.ShopId.ToString()
}, null, HttpMethod.Post);
}
public ApiResponse<SearchTaskListResponse> GetWareHouseList(string WayBillNo=null,string SourceExpressName=null, int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null,
public ApiResponse<SearchTaskListResponse> GetWareHouseList(string WayBillNo = null, string SourceExpressName = null, int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null,
DateTime? startTime = null,
DateTime? endTime = null,
TaskState? TaskState = null,
@ -87,14 +88,14 @@ namespace BBWY.Client.APIServices
PageIndex = pageIndex,
PageSize = pageSize,
ShopName = ShopName,
WayBillNo= WayBillNo,
SourceExpressName=SourceExpressName,
WayBillNo = WayBillNo,
SourceExpressName = SourceExpressName,
}, null, HttpMethod.Post);
}
public ApiResponse<ProductSkuCountsResponse> GetTaskAllCount(string shopId=null)
public ApiResponse<ProductSkuCountsResponse> GetTaskAllCount(string shopId = null)
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={shopId}",
null
@ -172,7 +173,7 @@ namespace BBWY.Client.APIServices
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/SetPackTaskState", new
{
taskId = taskId,
TaskState= taskState
TaskState = taskState
}
, null, HttpMethod.Post);
}
@ -206,25 +207,6 @@ namespace BBWY.Client.APIServices
, null, HttpMethod.Get);
}
/// <summary>
/// 获取任务的服务
/// </summary>
/// <returns></returns>
public ApiResponse<PackServiceResponse> GetTaskService(long taskId)
{
return SendRequest<PackServiceResponse>(globalContext.QKApiHost, $"api/PackTask/GetTaskService?TaskId={taskId}",null
, null, HttpMethod.Get);
}
/// <summary>
/// 上传 更新任务的服务数据
/// </summary>
/// <returns></returns>
public ApiResponse<object> UploadService(UploadServiceRequest uploadService)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/UploadService", uploadService
, null, HttpMethod.Post);
}
public ApiResponse<ShopTotalResponse> ShopTotal(string skuId = null, string taskId = null,
DateTime? startTime = null,
@ -282,8 +264,8 @@ namespace BBWY.Client.APIServices
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<TotalPackUserSalaryResponse> TotalPackUserSalary(string PackUserName = null, DateTime? StartTime = null, DateTime? EndTime=null, int PageIndex=1
, int PageSize=10)
public ApiResponse<TotalPackUserSalaryResponse> TotalPackUserSalary(string PackUserName = null, DateTime? StartTime = null, DateTime? EndTime = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<TotalPackUserSalaryResponse>(globalContext.QKApiHost, "api/PackTask/TotalPackUserSalary", new
{
@ -295,55 +277,12 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
/// <summary>
/// 获取待封箱列表
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<SearchWaitSealBoxResponse> SearchWaitSealBoxList(string ShopName = null, long? TaskId=null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchWaitSealBoxResponse>(globalContext.QKApiHost, "api/PackTask/SearchWaitSealBoxList", new
{
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize
}, null, HttpMethod.Post);
}
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<bool> CompeteSealBox( CompeteSealBox CompeteSealBoxs)
public ApiResponse<bool> StoreGetBySelf(long taskId)
{
return SendRequest<bool>(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", CompeteSealBoxs, null, HttpMethod.Post);
}
/// <summary>
/// 获取待落仓列表
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResponse<SearchWaitFallWareResponse> SearchWaitFallWareList(string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1
, int PageSize = 10)
{
return SendRequest<SearchWaitFallWareResponse>(globalContext.QKApiHost, "api/PackTask/SearchWaitFallWareList", new
{
ShopName,
TaskId,
SkuId,
PageIndex,
PageSize
}, null, HttpMethod.Post);
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackTask/StoreGetBySelf?TaskId={taskId}", null, null, HttpMethod.Post);
}
}
public class CompeteSealBox

3
BBWY.Client/Models/Enums.cs

@ -242,7 +242,8 @@
= 6,
= 7,
= 8,
= 9
= 9,
= 10
}

2
BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs

@ -258,7 +258,7 @@ namespace BBWY.Client.ViewModels.PackTask
SetTaskState(null);
this.sealBoxService = sealBoxService;
SealBoxConfigureType = SealBoxConfigureType.;
SealBoxConfigureType = SealBoxConfigureType.;
SetFallWareConfiguredCommand = new RelayCommand<object>(SetFallWareConfigured);
}

59
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -24,6 +24,7 @@ using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.SealBox;
using BBWY.Client.Views.FallWare;
using BBWY.Client.Models.FallWare;
using WebSocketSharp;
namespace BBWY.Client.ViewModels.PackTask
{
@ -274,8 +275,8 @@ namespace BBWY.Client.ViewModels.PackTask
SetSealBoxCommand = new RelayCommand<object>(SetSealBox);
CompeteFallWareCommand = new RelayCommand<object>(CompeteFallWare);
SealBoxConfigureType = SealBoxConfigureType.;
PositionState = PositionState.;
SealBoxConfigureType = SealBoxConfigureType.;
PositionState = PositionState.;
SetSealBoxConfigureTypeCommand = new RelayCommand<SealBoxConfigureType>(s =>
{
PageIndex = 1;
@ -289,8 +290,43 @@ namespace BBWY.Client.ViewModels.PackTask
LookBoxConfigureCommand = new RelayCommand<object>(LookBoxConfigure);
PrintBoxConfigureCommand = new RelayCommand<object>(PrintBoxConfigure);
DeletedTaskCommand = new RelayCommand<object>(DeletedTask);
StoreGetBySelfCommand = new RelayCommand<object>(StoreGetBySelf);
}
private void StoreGetBySelf(object obj)
{
var packTaskmodel = (PackTaskModel)obj;
MessageBoxResult result = System.Windows.MessageBox.Show($"确定商家自取,任务id:{packTaskmodel.TaskId}?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
var res = packTaskService.StoreGetBySelf(packTaskmodel.TaskId);
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg,"错误信息");
return;
}
Task.Factory.StartNew(() => SearchTaskList());
}
private void DeletedTask(object obj)
{
var packTaskmodel = (PackTaskModel)obj;
//if (!packTaskmodel.OrderId.IsNullOrEmpty())
//{
// System.Windows.MessageBox.Show($"暂不支持删除采购组的任务,如要删除,请到采购列表取消订单:{packTaskmodel.OrderId}");
// return;
//}
MessageBoxResult result =System.Windows.MessageBox.Show($"确定取消任务{packTaskmodel.TaskId}?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
packTaskService.DeletedTask(packTaskmodel.TaskId);
Task.Factory.StartNew(() => SearchTaskList());
}
/// <summary>
/// todo: 打印数据
@ -452,12 +488,21 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand PrintBoxConfigureCommand { get; set; }
/// <summary>
/// 删除任务
/// </summary>
public ICommand DeletedTaskCommand { get; set; }
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="obj"></param>
private void CompeteSealBox(object obj)
/// <summary>
/// 商家自取
/// </summary>
public ICommand StoreGetBySelfCommand { get; set; }
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="obj"></param>
private void CompeteSealBox(object obj)
{
var model = (SealBoxModel)obj;

126
BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs

@ -112,19 +112,35 @@ namespace BBWY.Client.ViewModels
{
};
public ObservableCollection<string> PreCompeteTimeDayList { get => preCompeteTimeDayList; set { Set(ref preCompeteTimeDayList, value); } }
public ObservableCollection<string> PreCompeteTimeDayList
{
get => preCompeteTimeDayList; set
{
Set(ref preCompeteTimeDayList, value);
}
}
private ObservableCollection<string> preCompeteTimeHourList = new ObservableCollection<string> {
"12点前","18点前","22点前"
};
public ObservableCollection<string> PreCompeteTimeHourList { get => preCompeteTimeHourList; set { Set(ref preCompeteTimeHourList, value); } }
//
public string preCompeteTimeDay;
public string PreCompeteTimeDay { get => preCompeteTimeDay; set { Set(ref preCompeteTimeDay, value); } }
public string PreCompeteTimeDay
{
get => preCompeteTimeDay; set
{
Set(ref preCompeteTimeDay, value);
PreCompeteTimeDayOnChanged();//
}
}
public string preCompeteTimeHour;
public string PreCompeteTimeHour { get => preCompeteTimeHour; set { Set(ref preCompeteTimeHour, value); } }
@ -453,7 +469,7 @@ namespace BBWY.Client.ViewModels
}
request.BarcodeId = BarCodeModel.Id;
}
if(PurchaseSkuList != null && PurchaseSkuList.Count > 0&&purchaseSkuList.Any(p=> p.IsNeedCer)) //(IsNeedCertificateModel == Need.需要)
if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer)) //(IsNeedCertificateModel == Need.需要)
{
//if ()
//{
@ -591,6 +607,94 @@ namespace BBWY.Client.ViewModels
}
// "12点前","18点前","22点前"
private void PreCompeteTimeDayOnChanged()
{
var now = DateTime.Now;
if (now.Hour < 12)
{
if (PreCompeteTimeDay=="今天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHourList.Add("18点前");
PreCompeteTimeHourList.Add("22点前");
PreCompeteTimeHour = "12点前";
}
if (PreCompeteTimeDay == "明天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHour = "12点前";
}
}
else if (now.Hour < 18)
{
if (PreCompeteTimeDay == "今天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("18点前");
PreCompeteTimeHourList.Add("22点前");
PreCompeteTimeHour = "18点前";
}
if (PreCompeteTimeDay == "明天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHourList.Add("18点前");
PreCompeteTimeHour = "12点前";
}
}
else if (now.Hour < 22)
{
if (PreCompeteTimeDay == "今天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("22点前");
PreCompeteTimeHour = "22点前";
}
if (PreCompeteTimeDay == "明天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHourList.Add("18点前");
PreCompeteTimeHourList.Add("22点前");
PreCompeteTimeHour = "12点前";
}
}
else
{
if (PreCompeteTimeDay == "明天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHourList.Add("18点前");
PreCompeteTimeHourList.Add("22点前");
PreCompeteTimeHour = "12点前";
}
if (PreCompeteTimeDay == "后天")
{
PreCompeteTimeHourList.Clear();
PreCompeteTimeHourList.Add("12点前");
PreCompeteTimeHour = "12点前";
}
}
}
private void SetBarCode()
@ -663,7 +767,7 @@ namespace BBWY.Client.ViewModels
IsNeedCertificateModel = Need.;
return;
}
var skus = PurchaseSkuList.SingleOrDefault(p =>p.CerDTO!=null&& p.CerDTO.PurchaseSkuId == s.PurchaseSkuId);
var skus = PurchaseSkuList.SingleOrDefault(p => p.CerDTO != null && p.CerDTO.PurchaseSkuId == s.PurchaseSkuId);
skus.CerDTO = s;
skus.IsSetCertificate = false;
skus.IsNeedCer = PackCerState == PackCerState.;
@ -746,12 +850,12 @@ namespace BBWY.Client.ViewModels
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId);
if (packTaskRes==null)
if (packTaskRes == null)
{
MessageBox.Show("网络异常!");
return;
}
if (!packTaskRes.Success || packTaskRes.Data==null)
if (!packTaskRes.Success || packTaskRes.Data == null)
{
MessageBox.Show(packTaskRes.Msg);
return;
@ -853,7 +957,7 @@ namespace BBWY.Client.ViewModels
PreCompeteTimeDayList.Add("明天");
PreCompeteTimeDay = "今天";
PreCompeteTimeHour = "12点前";
}
else if (hour < 18)
@ -861,22 +965,20 @@ namespace BBWY.Client.ViewModels
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
PreCompeteTimeDay = "今天";
PreCompeteTimeHour = "18点前";
}
else if (hour < 22)
{
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
PreCompeteTimeDay = "今天";
PreCompeteTimeHour = "22点前";
}
else
{
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
PreCompeteTimeDayList.Add("后天");
PreCompeteTimeDay = "明天";
PreCompeteTimeHour = "12点前";
}

18
BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs

@ -189,6 +189,24 @@ namespace BBWY.Client.ViewModels.SealBox
IList<SetSealBoxConfiguredData> SetSealBoxConfiguredDatas = new List<SetSealBoxConfiguredData>();
foreach (var sealBoxConfigureModel in SealBoxConfigureModelList)
{
if (sealBoxConfigureModel.WareHourseDatas==null|| !sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count>0))
{
continue;
}
//判断存在0的报错
if (sealBoxConfigureModel.WareHourseDatas.Any(w=>w.Count==0))
{
System.Windows.MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,存在未配置的数据");
return;
}
////todo: 到分箱界面判断
//if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count())
//{

2
BBWY.Client/Views/PackTask/TaskList.xaml

@ -124,7 +124,7 @@
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.待出库}" Content="待完结" Tag="{Binding WaitOutbound,Mode=TwoWay}"/>
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" Content="已完成" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.商家自取}" Content="商家自取" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已取消}" Content="已取消" />

2
BBWY.Client/Views/PackTask/TaskListControl.xaml

@ -46,7 +46,7 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="SKU数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="件数" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="到货情况" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="组合类型" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="SKU配件商品" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>

2
BBWY.Client/Views/PackTask/WareHouseList.xaml

@ -162,6 +162,8 @@
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" Content="已完成" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.商家自取}" Content="商家自取" />
<RadioButton Height="35" Width="126" VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已取消}" Content="已取消" />

159
BBWY.Client/Views/PackTask/WareHouseList.xaml.cs

@ -34,14 +34,7 @@ namespace BBWY.Client.Views.PackTask
public WareHouseList()
{
InitializeComponent();
//Messenger.Default.Register<GlobalContext>(this,"AcceptGlobalContext", g => { globalContext = g; LoadShops(g); });
this.Loaded += Load;
// this.Unloaded += WareHouseList_Unloaded;
// GlobalContext.User.DepartmentList
}
//private void WareHouseList_Unloaded(object sender, RoutedEventArgs e)
@ -55,6 +48,8 @@ namespace BBWY.Client.Views.PackTask
{
this.globalContext = globalContext;
shops = globalContext.User.ShopList.Select(s => s.ShopName).ToList();
departments=globalContext.User.DepartmentList.Select(s=>s.Name).ToList();
}
private void Load(object sender, RoutedEventArgs e)
@ -62,7 +57,7 @@ namespace BBWY.Client.Views.PackTask
try
{
var model = new ViewModelLocator().Main;
var model = (App.Current.Resources["Locator"] as ViewModelLocator).Main;
LoadShops(model.GlobalContext);
}
@ -72,40 +67,43 @@ namespace BBWY.Client.Views.PackTask
}
//try
//{
// var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
// var builder = new ConfigurationBuilder().SetBasePath(applicationPath).AddJsonFile("BBWYAppSettings.json", false, true);
// var Configuration = builder.Build();
try
{
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;
QKApiHost = Configuration.GetSection("QKApiHost").Value;
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
// if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
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);
}
}
}
}
}
catch (Exception)
{
// 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);
// }
// }
// }
// }
//}
//catch (Exception)
//{
//}
}
@ -136,67 +134,70 @@ namespace BBWY.Client.Views.PackTask
List<string> shops = new List<string>();
private void tb_TextChanged(object sender, TextChangedEventArgs e)
{
try
{
var textBoxt = (TextBox)sender;
//创建一个ListBox
if (tipBox != null && tipBox.Items.Count > 0)
if (tipBox != null)
try
{
tipBox.Items.Clear();
var textBoxt = (TextBox)sender;
//创建一个ListBox
}
if (departments.Count <= 0)
{
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
var data = helper.Get(url);
}
var res = JsonConvert.DeserializeObject<ApiResponse<UserDepartment[]>>(data);
//创建一个ListBoxIem
if (res.Success)
if (departments.Count <= 0)
{
if (res.Data != null && res.Data.Count() > 0)
if (QKApiHost.IsNullOrEmpty()) QKApiHost = "http://qiku.qiyue666.com";
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)
{
foreach (var department in res.Data)
if (res.Data != null && res.Data.Count() > 0)
{
if (!departments.Contains(department.DePartmentName))
foreach (var department in res.Data)
{
departments.Add(department.DePartmentName);
}
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))
if (string.IsNullOrEmpty(textBoxt.Text))
{
ListBoxItem item = new ListBoxItem();
Label lb = new Label();
lb.Content = department;
item.Content = lb;
tipBox.Items.Add(item);
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)
{
tipBox.Visibility = Visibility.Visible;
}
catch (Exception)
{
}
}
}
@ -236,8 +237,8 @@ namespace BBWY.Client.Views.PackTask
}
}
if (tipBoxShop!=null)
tipBoxShop.Visibility = Visibility.Visible;
if (tipBoxShop != null)
tipBoxShop.Visibility = Visibility.Visible;
}
catch (Exception)
{

58
BBWY.Client/Views/PackTask/WareHouseListControl.xaml

@ -130,9 +130,15 @@
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="12" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"
Style="{StaticResource LinkButton}" Content="取消任务" Margin="0 5 0 5 "
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待质检:Visible:Collapsed}"
/>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
@ -196,7 +202,7 @@
<Run Text="{Binding BrandName}"/>
</TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock Text="店铺:"/>
<c:BButton Content="{Binding ShopName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
@ -205,7 +211,7 @@
Margin=" 5,0,7,0"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="20,11,0,5">
<TextBlock Foreground="{StaticResource Text.Gray}">
@ -278,7 +284,7 @@
<Run Text="{Binding Increment1}"/>
</TextBlock>
</Grid>
</StackPanel>
</Grid>
<Grid Grid.Column="6" >
@ -387,7 +393,7 @@
</StackPanel>
<Grid Grid.Row="1" Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待质检|已取消:Collapsed:Visible}">
<Grid Grid.Row="1" Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待质检|已取消|商家自取:Collapsed:Visible}">
<Border Grid.Row="0" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
@ -398,9 +404,9 @@
Visibility="Visible" />
</StackPanel>
</Grid>
</Grid>
</Grid>
@ -417,31 +423,25 @@
</Grid>
<Grid Grid.Column="12" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="10 0 0 0 " VerticalAlignment="Center" Grid.Row="1" Content="质检"
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="质检"
Command="{Binding QualityTaskCommand}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待质检:Visible:Collapsed}"
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" Margin="0 5 0 5 " VerticalAlignment="Center" Content="完成"
CommandParameter="{Binding}"
Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包:Visible:Collapsed}"
>
<!--<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="TaskId" />
<Binding Path="TaskState"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>-->
</c:BButton>
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Content="完成"
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="商家自取"
CommandParameter="{Binding}"
Command="{Binding DataContext.StoreGetBySelfCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待质检|待打包:Visible:Collapsed}"
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" Margin="0 5 0 5 " VerticalAlignment="Center" Content="完成"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待出库:Visible:Collapsed}"
>
<b:Interaction.Triggers>
@ -457,7 +457,7 @@
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BButton>
<Grid
<Grid Margin="0 5 0 5 "
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货:Visible:Collapsed}"
>
@ -466,12 +466,12 @@
CommandParameter="{Binding}"
Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
>
</c:BButton>
</Grid>
</StackPanel>
</Grid>
<!--<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>-->

4
BBWY.Client/Views/QualityTask/QualityWindow.xaml

@ -139,9 +139,9 @@
<StackPanel Orientation="Horizontal" Margin="10 0 0 0" Height="30">
<TextBlock Text="预计完成时间: " VerticalAlignment="Center" />
<Border BorderBrush="{StaticResource Border.Brush}" Height="30" BorderThickness="1">
<hc:ComboBox BorderThickness="0" ItemsSource="{Binding PreCompeteTimeDayList}" SelectedIndex="0" Text="{Binding PreCompeteTimeDay}">
<ComboBox BorderThickness="0" ItemsSource="{Binding PreCompeteTimeDayList,Mode=TwoWay}" SelectedIndex="0" Text="{Binding PreCompeteTimeDay,Mode=TwoWay}">
</hc:ComboBox>
</ComboBox>
</Border>
<Border BorderBrush="{StaticResource Border.Brush}" Height="30" Margin="10 0 0 0" BorderThickness="1">
<hc:ComboBox BorderThickness="0" ItemsSource="{Binding PreCompeteTimeHourList}" SelectedIndex="0" Text="{Binding PreCompeteTimeHour}">

Loading…
Cancel
Save