using Sunny.UI; using sunui.forms; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using WMS.Model; using WMS.Untils; namespace WMS.UI.SynthesizeQuery { public partial class FrmTaskHandOperation : UIForm { private string _createListCode = string.Empty; private string _taskName = string.Empty; private string taskid = ""; public FrmTaskHandOperation(string taskId, string createListCode, string taskName) { InitializeComponent(); taskid = taskId; // this.lbl_SourceStation.Text = sourceStation; this.label1.Text = "任务号:" + taskid; this.lbl_createListCode.Text = "来源单号:" + createListCode; this.lbl_taskName.Text = "任务名称:" + taskName; } private void FrmHandOutStore_Load(object sender, EventArgs e) { } private void button_confirm_Click(object sender, EventArgs e) { ListItem selProFlag = null; // 1删除 2 强制完成 int flag = this.ck_IsDelete.Checked ? 2 : 1; if (this.ck_IsDelete.Checked) { flag = 1; DialogResult dr = MessageBox.Show("作废是将该任务状态修改为已作废,并不处理库存,请谨慎操作,确认要作废此任务吗", "任务作废", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { var res = FLogin.wcsWcf.deleteTask(taskid); int statu = res.status == 200 ? 1 : 2; WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(statu, res.msg); ms.Show(); this.Close(); } } else if (this.ck_IsForceComplete.Checked) { flag = 2; //创建任务 var title = "你选择的是强制完成任务"; DialogResult dr = MessageBox.Show(title + ",确定要强制完成该任务吗", "强制完成任务", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { var res = FLogin.wcsWcf.forceCompleteTask(taskid, FLogin.user.UserName, "你选择的是强制完成任务"); int statu = res.status == 200 ? 1 : 2; WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(statu, res.msg); ms.Show(); this.Close(); } } else { ShowErrorTip("请选择操作类型(作废还是强制完成)!"); return; } } private void button_cancel_Click(object sender, EventArgs e) { this.Close(); } private void cb_IsForceComplete_CheckedChanged(object sender, EventArgs e) { checkedChanged(sender, e); } private void checkedChanged(object sender, EventArgs e) { if ((sender as CheckBox).Checked == true) { foreach (Control chk in (sender as CheckBox).Parent.Controls) { if (chk is CheckBox) { var _chk = chk as CheckBox; if (_chk != sender) { _chk.Checked = false; } } } } } private void ck_IsDelete_CheckedChanged(object sender, EventArgs e) { checkedChanged(sender, e); } } }