|
|
@ -127,6 +127,11 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
|
|
|
|
|
|
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService) |
|
|
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService) |
|
|
{ |
|
|
{ |
|
|
|
|
|
this.globalContext = globalContext; |
|
|
|
|
|
this.productService = productService; |
|
|
|
|
|
this.consumableService = consumableService; |
|
|
|
|
|
this.workProcessService = workProcessService; |
|
|
|
|
|
this.increateServiceService = increateServiceService; |
|
|
this.packTaskService = packTaskService; |
|
|
this.packTaskService = packTaskService; |
|
|
//TaskState = BBWY.Client.Models. TaskState.全部;
|
|
|
//TaskState = BBWY.Client.Models. TaskState.全部;
|
|
|
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
|
|
|
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
|
|
|
@ -144,35 +149,28 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
|
|
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
|
|
CopyTextCommand = new RelayCommand<object>(s => |
|
|
DeletedTaskCommand = new RelayCommand<object>(DeletedTask); |
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
Clipboard.SetText(s.ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Red; |
|
|
|
|
|
Console.WriteLine(ex); |
|
|
|
|
|
Console.ResetColor(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
StartTime = DateTime.Now.Date; |
|
|
StartTime = DateTime.Now.Date; |
|
|
EndTime = DateTime.Now.Date; |
|
|
EndTime = DateTime.Now.Date; |
|
|
IsLoading = false; |
|
|
IsLoading = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//加载数据
|
|
|
//加载数据
|
|
|
SetTaskState(Models.TaskState.全部); |
|
|
SetTaskState(Models.TaskState.全部); |
|
|
this.globalContext = globalContext; |
|
|
|
|
|
this.productService = productService; |
|
|
|
|
|
this.consumableService = consumableService; |
|
|
|
|
|
this.workProcessService = workProcessService; |
|
|
|
|
|
this.increateServiceService = increateServiceService; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DeletedTask(object obj) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
MessageBoxResult result = MessageBox.Show("确定删除?", "提示", |
|
|
|
|
|
MessageBoxButton.YesNo, |
|
|
|
|
|
MessageBoxImage.Warning); |
|
|
|
|
|
long taskId = (long)obj; |
|
|
|
|
|
if (result != MessageBoxResult.Yes) return; |
|
|
|
|
|
packTaskService.DeletedTask(taskId); |
|
|
|
|
|
Task.Factory.StartNew(() => SearchTaskList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void IsLoadCount() |
|
|
private void IsLoadCount() |
|
|
@ -227,11 +225,11 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public ICommand OpenSkuDetailCommand { get; set; } |
|
|
public ICommand OpenSkuDetailCommand { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 复制
|
|
|
/// 删除任务
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public ICommand CopyTextCommand { get; set; } |
|
|
public ICommand DeletedTaskCommand { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SetTaskState(TaskState? taskState) |
|
|
public void SetTaskState(TaskState? taskState) |
|
|
{ |
|
|
{ |
|
|
@ -293,7 +291,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
foreach (var item in dataModel.Items) |
|
|
foreach (var item in dataModel.Items) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var data = new PackTaskModel(packTaskService, consumableService, workProcessService, increateServiceService) |
|
|
var data = new PackTaskModel() |
|
|
{ |
|
|
{ |
|
|
Brand = item.Brand, |
|
|
Brand = item.Brand, |
|
|
SkuId = item.SkuId, |
|
|
SkuId = item.SkuId, |
|
|
@ -322,10 +320,7 @@ namespace BBWY.Client.ViewModels.PackTask |
|
|
TaskId = item.TaskId, |
|
|
TaskId = item.TaskId, |
|
|
TaskStatus = (TaskStateType)item.TaskStatus, |
|
|
TaskStatus = (TaskStateType)item.TaskStatus, |
|
|
EndTime = item.CreateTime, |
|
|
EndTime = item.CreateTime, |
|
|
IsWorry = (Worry)item.IsWorry |
|
|
IsWorry = (Worry)item.IsWorry, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) |
|
|
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) |
|
|
{ |
|
|
{ |
|
|
|