步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

925 lines
34 KiB

2 years ago
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Linq;
using System.Windows.Controls;
using System.ComponentModel;
using HandyControl.Controls;
using System.Windows;
using System.Collections;
using NPOI.SS.Formula.Functions;
2 years ago
using GalaSoft.MvvmLight.Messaging;
2 years ago
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.PackTask;
2 years ago
using BBWY.Client.Views.SealBox;
2 years ago
using BBWY.Client.Views.FallWare;
using BBWY.Client.Models.FallWare;
using WebSocketSharp;
2 years ago
2 years ago
namespace BBWY.Client.ViewModels.PackTask
{
public partial class WareHouseListViewModel : BaseVM, IDenpendency//注入服务
{
#region 属性绑定
2 years ago
private string searchWayBillNo;
public string SearchWayBillNo
{
get => searchWayBillNo; set
{
Set(ref searchWayBillNo, value);
}
}
private string searchExpressName;
public string SearchExpressName
{
get => searchExpressName; set
{
Set(ref searchExpressName, value);
}
}
2 years ago
public string fallWareWaitConfigureCount;
public string FallWareWaitConfigureCount { get => fallWareWaitConfigureCount; set { Set(ref fallWareWaitConfigureCount, value); } }
public string fallWareConfiguredCount;
public string FallWareConfiguredCount { get => fallWareConfiguredCount; set { Set(ref fallWareConfiguredCount, value); } }
2 years ago
2 years ago
private ObservableCollection<WaitFallWareModel> waitFallWareList;
/// <summary>
/// 待落仓列表
/// </summary>
public ObservableCollection<WaitFallWareModel> WaitFallWareList { get => waitFallWareList; set { Set(ref waitFallWareList, value); } }
private ObservableCollection<WareNoSealBoxModel> wareNoSealBoxModels;
/// <summary>
/// 分箱列表(未配置)
/// </summary>
public ObservableCollection<WareNoSealBoxModel> WareNoSealBoxModels { get => wareNoSealBoxModels; set { Set(ref wareNoSealBoxModels, value); } }
2 years ago
2 years ago
private ObservableCollection<SealBoxModel> waitSealBoxModels;
/// <summary>
/// 分箱列表(已配置)
2 years ago
/// </summary>
public ObservableCollection<SealBoxModel> WaitSealBoxModels { get => waitSealBoxModels; set { Set(ref waitSealBoxModels, value); } }
2 years ago
private ObservableCollection<PackTaskModel> packTaskList;
/// <summary>
/// 打包任务列表
/// </summary>
public ObservableCollection<PackTaskModel> PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } }
2 years ago
2 years ago
/// <summary>
/// 查询时间段
/// </summary>
private DateTime startTime;
public DateTime StartTime { get => startTime; set { Set(ref startTime, value); } }
private DateTime endTime;
public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } }
2 years ago
private string searchShopName;
2 years ago
public string SearchShopName
{
get => searchShopName; set
{
Set(ref searchShopName, value);
}
}
2 years ago
/// <summary>
/// 查询任务id
/// </summary>
private string searchTaskId;
public string SearchTaskId
{
get => searchTaskId; set
{
Set(ref searchTaskId, value);
}
}
/// <summary>
/// 查询Sku
/// </summary>
private string searchSkuId;
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } }
2 years ago
private TaskState? taskState;
2 years ago
/// <summary>
/// 任务状态
/// </summary>
2 years ago
public TaskState? TaskState
2 years ago
{
2 years ago
get => taskState; set
2 years ago
{
Set(ref taskState, value);
}
}
private int pageIndex = 1;
private int pageSize = 10;
private int orderCount;//总数量
private Visibility tipVisitity;
/// <summary>
///
/// </summary>
public Visibility TipVisitity { get => tipVisitity; set { Set(ref tipVisitity, value); } }
/// <summary>
/// 未到货数量
/// </summary>
2 years ago
public string NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } }
private string noArrivedCount;
private string someArrivedCount;
2 years ago
/// <summary>
/// 部分到货数量
/// </summary>
2 years ago
public string SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } }
private string worryCount;
2 years ago
/// <summary>
/// 加急数
/// </summary>
2 years ago
public string WorryCount { get => worryCount; set { Set(ref worryCount, value); } }
2 years ago
2 years ago
private string arrivedCount;
2 years ago
/// <summary>
/// 已到货数量
/// </summary>
2 years ago
public string ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } }
private string waitPackCount;
/// <summary>
2 years ago
/// 待打包任务数
2 years ago
/// </summary>
public string WaitPackCount { get => waitPackCount; set { Set(ref waitPackCount, value); } }
2 years ago
private string waitSealBoxCount;
2 years ago
/// <summary>
2 years ago
/// 带封箱任务数
2 years ago
/// </summary>
2 years ago
public string WaitSealBoxCount { get => waitSealBoxCount; set { Set(ref waitSealBoxCount, value); } }
private string waitFallWareCount;
/// <summary>
/// 待落仓任务数
/// </summary>
public string WaitFallWareCount { get => waitFallWareCount; set { Set(ref waitFallWareCount, value); } }
2 years ago
private string waitOutbound;
/// <summary>
2 years ago
/// 待出库任务数
2 years ago
/// </summary>
public string WaitOutbound { get => waitOutbound; set { Set(ref waitOutbound, value); } }
2 years ago
private string waitCompleted;
/// <summary>
/// 待完成任务数
/// </summary>
public string WaitCompleted { get => waitCompleted; set { Set(ref waitCompleted, value); } }
2 years ago
public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } }
public int PageSize { get => pageSize; set { Set(ref pageSize, value); } }
public int OrderCount { get => orderCount; set { Set(ref orderCount, value); } }
private bool isLoading;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
2 years ago
2 years ago
private int? IsWorry { get; set; }
public int? taskStatus { get; set; }
public string searchDepartment;
public string SearchDepartment
{
get => searchDepartment; set
{
Set(ref searchDepartment, value);
}
}
2 years ago
private SealBoxConfigureType sealBoxConfigureType;
/// <summary>
/// 封箱配置状态
/// </summary>
public SealBoxConfigureType SealBoxConfigureType { get => sealBoxConfigureType; set { Set(ref sealBoxConfigureType, value); } }
2 years ago
#endregion
private readonly PackTaskService packTaskService;
private readonly SealBoxService sealBoxService;
2 years ago
public GlobalContext globalContext;
public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService)
2 years ago
{
2 years ago
this.globalContext = globalContext;
this.sealBoxService = sealBoxService;
2 years ago
this.packTaskService = packTaskService;
2 years ago
//Messenger.Default.Send(globalContext, "AcceptGlobalContext");
2 years ago
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
2 years ago
SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState);
2 years ago
SearchTaskCommand = new RelayCommand(() =>
{
PageIndex = 1;
Task.Factory.StartNew(() => SearchTaskList()); //手动点击查询订单
});
TaskPageIndexChangedCommand = new RelayCommand<PageArgs>(p =>
{
LoadIndex(p.PageIndex);
});
2 years ago
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
2 years ago
StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date;
IsLoading = false;
2 years ago
SetTaskStatusCommand = new RelayCommand<object>(SetTaskStatus);
2 years ago
2 years ago
TaskState = null;
2 years ago
//加载数据
2 years ago
SetTaskState(null);
2 years ago
UpdateTaskStateCommand = new RelayCommand<object>(UpdateTaskState);
2 years ago
2 years ago
CompeteSealBoxCommand = new RelayCommand<object>(CompeteSealBox);
2 years ago
SetSealBoxCommand = new RelayCommand<object>(SetSealBox);
2 years ago
CompeteFallWareCommand = new RelayCommand<object>(CompeteFallWare);
SealBoxConfigureType = SealBoxConfigureType.;
PositionState = PositionState.;
2 years ago
SetSealBoxConfigureTypeCommand = new RelayCommand<SealBoxConfigureType>(s =>
{
PageIndex = 1;
SealBoxConfigureType = s;
PositionState = s == SealBoxConfigureType. ? PositionState. : PositionState.;
Task.Factory.StartNew(() => SearchTaskList());
});
2 years ago
LookBoxConfigureCommand = new RelayCommand<object>(LookBoxConfigure);
2 years ago
PrintBoxConfigureCommand = new RelayCommand<object>(PrintBoxConfigure);
DeletedTaskCommand = new RelayCommand<object>(DeletedTask);
StoreGetBySelfCommand = new RelayCommand<object>(StoreGetBySelf);
2 years ago
}
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;
2 years ago
var res = packTaskService.StoreGetBySelf(packTaskmodel.TaskId);
if (!res.Success)
{
2 years ago
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;
//}
2 years ago
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());
}
2 years ago
/// <summary>
/// todo: 打印数据
/// </summary>
/// <param name="obj"></param>
private void PrintBoxConfigure(object obj)
{
var fallware = obj as WaitFallWareModel;
JDWareBoxModel model = new JDWareBoxModel
{
ShopName = globalContext.User.Shop.ShopName,
WareName = fallware.WareName,
SealBoxId = fallware.SealBoxId,
ProductCount = fallware.ProductCount,
BoxCount = fallware.SealBoxCount,
PrewOrder = fallware.BoxConfigureData.PrewOrder,
ProductTitle = fallware.BoxConfigureData.ProductTitle,
PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder,
WaybillNo = fallware.BoxConfigureData.WaybillNo
};
if (fallware.WareType == WareType.)
{
2 years ago
//加载模板数据
2 years ago
}
if (fallware.WareType == WareType.)
{
2 years ago
2 years ago
}
2 years ago
//打印
2 years ago
}
private void LookBoxConfigure(object obj)
{
var fallware = obj as WaitFallWareModel;
JDWareBoxModel model = new JDWareBoxModel
{
ShopName = globalContext.User.Shop.ShopName,
WareName = fallware.WareName,
SealBoxId = fallware.SealBoxId,
ProductCount = fallware.ProductCount,
BoxCount = fallware.SealBoxCount,
PrewOrder = fallware.BoxConfigureData.PrewOrder,
ProductTitle = fallware.BoxConfigureData.ProductTitle,
PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder,
WaybillNo = fallware.BoxConfigureData.WaybillNo
};
if (fallware.WareType == WareType.)
{
//SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask,false);
//window.Show();
var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType, ReflashTask, false);
w.ShowDialog();
2 years ago
}
if (fallware.WareType == WareType.)
{
SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false);
window.Show();
}
2 years ago
}
2 years ago
public PositionState PositionState { get; set; }
2 years ago
/// <summary>
/// 完成落仓(todo:)
/// </summary>
/// <param name="obj"></param>
private void CompeteFallWare(object obj)
{
2 years ago
if (System.Windows.MessageBox.Show("是否完成落仓?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
var model = obj as WaitFallWareModel;
var res = sealBoxService.WareCompeteFallWare(model.SealBoxId);
2 years ago
if (res != null && res.Success)
2 years ago
{
2 years ago
ReflashTask(); return;
2 years ago
}
2 years ago
if (res == null)
2 years ago
{
System.Windows.MessageBox.Show("网络异常");
return;
}
System.Windows.MessageBox.Show(res.Msg);
2 years ago
}
private void SetSealBox(object obj)
{
2 years ago
var model = (SealBoxModel)obj;
2 years ago
if (model.SealBoxSkus.Any(s => s.TaskState == Models.TaskState. || s.TaskState == Models.TaskState.))
{
2 years ago
System.Windows.MessageBox.Show("无法封箱,存在未打包完成的任务");
2 years ago
return;
}
2 years ago
SetSealBoxWindow setSealBoxWindow = new SetSealBoxWindow(model);
setSealBoxWindow.SendBoxCount = boxCount =>
{
model.SealBoxCount = boxCount;
2 years ago
};
setSealBoxWindow.ShowDialog();
2 years ago
}
2 years ago
2 years ago
#region 事件绑定
2 years ago
public ICommand LookBoxConfigureCommand { get; set; }
/// <summary>
/// 待配置 /已配置
/// </summary>
public ICommand SetSealBoxConfigureTypeCommand { get; set; }
2 years ago
public ICommand CompeteFallWareCommand { get; set; }
2 years ago
public ICommand CompeteSealBoxCommand { get; set; }
2 years ago
2 years ago
public ICommand SetTaskStatusCommand { get; set; }
2 years ago
/// <summary>
/// 打开图片链接
/// </summary>
public ICommand OpenSkuDetailCommand { get; set; }
2 years ago
2 years ago
/// <summary>
/// 筛选数据
/// </summary>
public ICommand SetTaskStateCommand { get; set; }
/// <summary>
/// 修改任务状态
/// </summary>
public ICommand UpdateTaskStateCommand { get; set; }
2 years ago
/// <summary>
/// 搜索数据
/// </summary>
public ICommand SearchTaskCommand { get; set; }
/// <summary>
/// 创建任务
/// </summary>
public ICommand CreateTaskCommand { get; set; }
/// <summary>
/// 页面改变事件
/// </summary>
public ICommand TaskPageIndexChangedCommand { get; set; }
2 years ago
/// <summary>
/// 设置分箱数量
/// </summary>
public ICommand SetSealBoxCommand { get; set; }
2 years ago
2 years ago
2 years ago
/// <summary>
/// 打印封箱数据
/// </summary>
public ICommand PrintBoxConfigureCommand { get; set; }
2 years ago
/// <summary>
/// 删除任务
/// </summary>
public ICommand DeletedTaskCommand { get; set; }
2 years ago
/// <summary>
/// 商家自取
/// </summary>
public ICommand StoreGetBySelfCommand { get; set; }
/// <summary>
/// 完成封箱
/// </summary>
/// <param name="obj"></param>
private void CompeteSealBox(object obj)
2 years ago
{
2 years ago
var model = (SealBoxModel)obj;
2 years ago
2 years ago
if (model.SealBoxCount == null || model.SealBoxCount.Value <= 0)
2 years ago
{
System.Windows.MessageBox.Show("请先设置封箱数量");
return;
}
2 years ago
var res = sealBoxService.WareCompeteSealBox(model.SealBoxId, model.SealBoxCount);
if (res == null)
{
2 years ago
System.Windows.MessageBox.Show("网络异常", "");
return;
}
2 years ago
2 years ago
if (!res.Success || !res.Data)
2 years ago
{
System.Windows.MessageBox.Show(res.Msg);
return;
2 years ago
}
SearchTaskList();
2 years ago
}
private void UpdateTaskState(object obj)
{
2 years ago
var model = (PackTaskModel)obj;
long taskId = model.TaskId;
var packTaskState = model.TaskState;
ApiResponse<object> res = null;
2 years ago
switch (packTaskState)
{
2 years ago
case Models.TaskState.:
case Models.TaskState.:
2 years ago
if (System.Windows.MessageBox.Show("是否确认收货?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
2 years ago
res = packTaskService.SetPackTaskState(taskId, Models.TaskState.);
break;
2 years ago
case Models.TaskState.:
break;
2 years ago
case Models.TaskState.:
2 years ago
var packModel = PackTaskList.SingleOrDefault(p => p.TaskId == taskId);
if (packModel == null || packModel.FeesItemResponse == null || packModel.FeesItemResponse.DiscountAllFees == 0)
{
System.Windows.MessageBox.Show("请先设置打包费用!");
return;
}
if (System.Windows.MessageBox.Show("是否完成打包?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
2 years ago
res = packTaskService.SetPackTaskState(taskId, Models.TaskState.);
break;
2 years ago
case Models.TaskState.:
break;
2 years ago
case Models.TaskState.:
2 years ago
break;
2 years ago
case Models.TaskState.:
break;
2 years ago
case Models.TaskState.:
break;
default:
break;
}
2 years ago
if (res != null && res.Success)
{
SearchTaskList();
}
2 years ago
}
2 years ago
public void SetTaskStatus(object obj)
2 years ago
{
var objList = (object[])obj;
long taskId = (long)objList[0];
2 years ago
string orderId = (string)objList[1];
2 years ago
///修改完成
2 years ago
var model = packTaskService.UpdateTaskStatus(taskId, 1, orderId);
2 years ago
if (model != null && model.Success)
2 years ago
SearchTaskList();
2 years ago
2 years ago
}
2 years ago
public void SetTaskState(TaskState? taskState)
2 years ago
{
PageIndex = 1;
2 years ago
TaskState = taskState;
2 years ago
SearchTaskList();
}
2 years ago
2 years ago
2 years ago
/// <summary>
/// 搜索任务列表
/// </summary>
public void SearchTaskList()
{
2 years ago
long? taskId = null;
2 years ago
try
{
2 years ago
if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim()))
2 years ago
taskId = Convert.ToInt64(SearchTaskId);
2 years ago
}
catch
{
2 years ago
taskId = null;
2 years ago
}
2 years ago
IsLoading = true;
2 years ago
if (TaskState == Models.TaskState.)
2 years ago
Task.Factory.StartNew(() =>
{
2 years ago
2 years ago
WaitFallWareList = new ObservableCollection<WaitFallWareModel>();
2 years ago
var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
2 years ago
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.WaitFallWareList)
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
WaitFallWareList.Add(new WaitFallWareModel
{
AcceptUserNames = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus,
ShopId = item.ShopId,
ShopName = item.ShopName,
WareId = item.WareId,
WareName = item.WareName,
SealBoxCount = item.SealBoxCount,
SealBoxId = item.SealBoxId,
2 years ago
BoxConfigureData = item.BoxConfigureData,
ProductCount = item.ProductCount,
WareType = item.WareType,
2 years ago
});
}));
}
}
else
{
if (datas != null) System.Windows.MessageBox.Show(datas.Msg);
2 years ago
}
IsLoadCount();
2 years ago
IsLoadFallWareCount();
2 years ago
IsLoading = false;
2 years ago
});
2 years ago
else if (TaskState == Models.TaskState.)
2 years ago
Task.Factory.StartNew(() =>
2 years ago
{
2 years ago
//var randNum = new Random().Next(81, 90);
var randNum = 90;
2 years ago
2 years ago
if (SealBoxConfigureType == SealBoxConfigureType.)
2 years ago
{
WaitSealBoxModels = new ObservableCollection<SealBoxModel>();
2 years ago
var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.WaitSealBoxModels)
2 years ago
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
2 years ago
{
WaitSealBoxModels.Add(new SealBoxModel
2 years ago
{
AcceptUserName = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus.Select(s =>
{
s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}");
return s;
}).ToList(),
ShopId = item.ShopId,
ShopName = item.ShopName,
WareId = item.WareId,
WareName = item.WareName,
SealBoxId = item.SealBoxId,
});
}));
2 years ago
}
}
else
{
if (datas != null) System.Windows.MessageBox.Show(datas.Msg);
2 years ago
}
}
if (SealBoxConfigureType == SealBoxConfigureType.)
2 years ago
{
WareNoSealBoxModels = new ObservableCollection<WareNoSealBoxModel>();
var datas = sealBoxService.GetWareSealBoxWaitConfigureList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.WaitSealBoxModels)
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
2 years ago
WareNoSealBoxModels.Add(new WareNoSealBoxModel
{
AcceptUserName = string.Join("|", item.AcceptUserNames),
DepartmentName = item.DepartmentName,
SealBoxSkus = item.SealBoxSkus.Select(s =>
{
s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}");
return s;
}).ToList(),
ShopId = item.ShopId,
ShopName = item.ShopName,
2 years ago
});
}));
}
}
else
{
if (datas != null) System.Windows.MessageBox.Show(datas.Msg);
}
2 years ago
}
IsLoadSealBoxCount();
2 years ago
IsLoadCount();
IsLoading = false;
});
else
Task.Factory.StartNew(() =>
{
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.GetWareHouseList(SearchWayBillNo, SearchExpressName, IsWorry, SearchDepartment, SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), SearchShopName,
2 years ago
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
{
var data = new PackTaskModel()
{
AcceptName = item.UserName,
2 years ago
Availability = (Availability)item.Availability,
2 years ago
BasicPack = (BasicPack)item.BasicPack,
DepartmentName = item.DepartmentName,
CertificatePosition = (CertificatePosition)item.CertificatePosition,
GoodsNumber = item.GoodsNumber,
Increment1 = item.Increment1,
ItemList = new List<SkuMessage>() { new SkuMessage
2 years ago
{ BrandName = item.BrandName,
GoodsNo = item.ProductItemNum, Logo= item.Logo,
2 years ago
ShopName = item.ShopName, SkuName = item.SkuName,
Id = item.SkuId
2 years ago
} },
2 years ago
MarkMessage = item.MarkMessage,
PackType = (PackType)item.PackType,
TaskState = item.TaskState,
PositionType = item.PositionType,
SkuCount = item.SkuCount,
SkuTitle = item.SkuGoodsTitle,
TaskId = item.TaskId,
EndTime = item.CreateTime,
OrderId = item.OrderId,
SkuId = item.SkuId,
SkuName = item.SkuName,
2 years ago
FloorDragNumber = item.FloorDragNumber,
2 years ago
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{
data.BarCodeModel = item.BarCodeDTO;
}
if (item.Cers != null)
{
data.CertificateModel = item.Cers;
}
data.ReflashTask = ReflashTask;
if (item.FeesItemResponse != null)
{
data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees;
data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees *
item.FeesItemResponse.disCount;
data.IsShowFees = data.FeesMoney > 0 ? true : false;
}
else
{
data.IsShowFees = false;
}
if (item.PackUserName != null && item.PackUserName.Count() > 0)
{
data.PackUser = string.Join("\r\n", item.PackUserName);
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PackTaskList.Add(data);
}));
2 years ago
}
2 years ago
}
else
{
}
IsLoadCount();
IsLoading = false;
});
2 years ago
}
private void IsLoadSealBoxCount()
{
var res = sealBoxService.GetWareSealBoxConfigureCounts();
if (res != null && res.Success && res.Data != null)
{
FallWareWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString();
2 years ago
FallWareConfiguredCount = res.Data.SealBoxConfiguredCount.ToString();
}
}
2 years ago
private void IsLoadFallWareCount()
{
var res = sealBoxService.GetFallWareConfigureCounts(null);
if (res != null && res.Success && res.Data != null)
{
FallWareWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString();
FallWareConfiguredCount = res.Data.FallWareConfiguredCount.ToString();
}
}
private void IsLoadCount()
{
2 years ago
var packTaskResult = packTaskService.GetTaskAllCount();
2 years ago
if (packTaskResult != null && packTaskResult.Success && packTaskResult.Data != null)
{
2 years ago
App.Current.Dispatcher.Invoke(new Action(() =>
{
2 years ago
ArrivedCount = packTaskResult.Data.ArrivedCount.ToString();
NoArrivedCount = packTaskResult.Data.NoArrivedCount.ToString();
SomeArrivedCount = packTaskResult.Data.SomeArrivedCount.ToString();
WorryCount = packTaskResult.Data.WorryCount.ToString();
WaitOutbound = packTaskResult.Data.WaitOutbound?.ToString();
WaitPackCount = packTaskResult.Data.WaitPackCount?.ToString();
2 years ago
WaitSealBoxCount = packTaskResult.Data.WaitSealBox?.ToString();
2 years ago
WaitFallWareCount = packTaskResult.Data.WaitFallWareCount?.ToString();
2 years ago
WaitCompleted = packTaskResult.Data.WaitCompleted?.ToString();
2 years ago
}));
}
}
private void LoadIndex(int pageIndex)
{
PageIndex = pageIndex;//
SearchTaskList();
}
2 years ago
public void ReflashTask()//刷新界面
{
SearchTaskList();
}
2 years ago
2 years ago
private void OpenSkuDetail(object param)
{
2 years ago
var paramList = (object[])param;
2 years ago
var skuId = paramList.Last().ToString();
2 years ago
var url = $"https://item.jd.com/{skuId}.html";
try
{
System.Diagnostics.Process.Start("explorer.exe", url);
}
catch (Exception ex)
{
Clipboard.SetText(url);
System.Windows.MessageBox.Show($"{ex.Message}\r\n调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示");
}
}
2 years ago
#endregion
}
}