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.
105 lines
3.0 KiB
105 lines
3.0 KiB
2 years ago
|
using BBWY.Client.APIServices;
|
||
|
using BBWY.Client.APIServices.QiKu;
|
||
|
using BBWY.Client.Models;
|
||
|
using BBWY.Controls;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
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.Shapes;
|
||
|
using WebSocketSharp;
|
||
|
|
||
|
namespace BBWY.Client.Views.SplitTask
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// SplitTaskWindow.xaml 的交互逻辑
|
||
|
/// </summary>
|
||
|
public partial class SplitTaskWindow : BWindow
|
||
|
{
|
||
|
public SplitTaskWindow(PackTaskService packTaskService, long taskId, TaskState abortTaskState, Action splitTask)
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
|
||
|
this.TaskId = taskId;
|
||
|
this.DataContext = this;
|
||
|
AbortTaskState = abortTaskState;
|
||
|
this.packTaskService = packTaskService;
|
||
|
TaskId = taskId;
|
||
|
SplitTask = splitTask;
|
||
|
}
|
||
|
|
||
|
private Action SplitTask { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 任务挂起类型
|
||
|
/// </summary>
|
||
|
public TaskState AbortTaskState { get; set; }
|
||
|
|
||
|
|
||
|
PackTaskService packTaskService;
|
||
|
|
||
|
|
||
|
private long taskId;
|
||
|
/// <summary>
|
||
|
/// 任务id
|
||
|
/// </summary>
|
||
|
public long TaskId { get => taskId; set { Set(ref taskId, value); } }
|
||
|
|
||
|
|
||
|
private TaskExceptionType taskExceptionType;
|
||
|
/// <summary>
|
||
|
/// 验收异常类型
|
||
|
/// </summary>
|
||
|
public TaskExceptionType TaskExceptionType { get => taskExceptionType; set { Set(ref taskExceptionType, value); } }
|
||
|
|
||
|
|
||
|
private int exceptionCount;
|
||
|
/// <summary>
|
||
|
/// 验收异常类型
|
||
|
/// </summary>
|
||
|
public int ExceptionCount { get => exceptionCount; set { Set(ref exceptionCount, value); } }
|
||
|
|
||
|
|
||
|
private List<TaskExceptionType> taskExceptionTypeList = new List<TaskExceptionType> {
|
||
|
TaskExceptionType.配件未到齐, TaskExceptionType.数量不对
|
||
|
};
|
||
|
/// <summary>
|
||
|
/// 验收异常类型
|
||
|
/// </summary>
|
||
|
public List<TaskExceptionType> TaskExceptionTypeList { get => taskExceptionTypeList; set { Set(ref taskExceptionTypeList, value); } }
|
||
|
|
||
|
|
||
|
private string remarkMsg;
|
||
|
/// <summary>
|
||
|
/// 备注消息
|
||
|
/// </summary>
|
||
|
public string RemarkMsg { get => remarkMsg; set { Set(ref remarkMsg, value); } }
|
||
|
|
||
|
private void BButton_Click(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
|
||
|
if (RemarkMsg.IsNullOrEmpty())
|
||
|
{
|
||
|
MessageBox.Show("请输入具体问题描述.");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var res = packTaskService.SplitPackTask(TaskId, ExceptionCount, TaskExceptionType, RemarkMsg, AbortTaskState);
|
||
|
if (res == null || !res.Success)
|
||
|
{
|
||
|
MessageBox.Show(res?.Msg);
|
||
|
return;
|
||
|
}
|
||
|
SplitTask?.Invoke();
|
||
|
this.Close();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|