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.
94 lines
2.8 KiB
94 lines
2.8 KiB
using BBWY.Client.APIServices.QiKu;
|
|
using BBWY.Client.Models;
|
|
using BBWY.Controls;
|
|
using EnumsNET;
|
|
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.QualityTask
|
|
{
|
|
/// <summary>
|
|
/// AddExceptionWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class AddExceptionWindow : BWindow
|
|
{
|
|
public AddExceptionWindow(QualityTaskService qualityTaskService, long taskId, TaskState abortTaskState, Action taskAbort)
|
|
{
|
|
InitializeComponent();
|
|
this.qualityTaskService = qualityTaskService;
|
|
this.TaskId = taskId;
|
|
this.DataContext = this;
|
|
AbortTaskState = abortTaskState;
|
|
TaskAbort = taskAbort;
|
|
}
|
|
|
|
Action TaskAbort { get; set; }
|
|
|
|
/// <summary>
|
|
/// 任务挂起类型
|
|
/// </summary>
|
|
public TaskState AbortTaskState { get; set; }
|
|
|
|
|
|
QualityTaskService qualityTaskService;
|
|
|
|
|
|
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 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 = qualityTaskService.QualityTaskException(TaskId, TaskExceptionType, RemarkMsg, AbortTaskState);
|
|
if (res==null||!res.Success)
|
|
{
|
|
MessageBox.Show(res?.Msg);
|
|
return;
|
|
}
|
|
TaskAbort?.Invoke();
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|
|
|