schangxiang@126.com
2025-07-30 a16904bd86f89e97a5e507e08003506c5dd8642e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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);
        }
 
    }
}