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
119
120
121
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 FrmHandOutStore : UIForm
    {
        private string _sourceStation = string.Empty;
        private string _materialCode = "";
        private string _materialName = "";
        public FrmHandOutStore(string sourceStation, string materialCode, string materialName)
        {
            InitializeComponent();
            _sourceStation = sourceStation;
            _materialCode = materialCode;
            _materialName = materialName;
            this.lbl_SourceStation.Text = sourceStation;
 
            this.lbl_materialCode.Text = materialCode;
            this.lbl_materialName.Text = materialName;
        }
 
        private void LoadItemType()
        {
            List<ListItem> itemList = new List<ListItem>();
            itemList.Add(new ListItem()
            {
                Text = "1-39-1",
                Value = "1-39-1"
            });
            itemList.Add(new ListItem()
            {
                Text = "2-39-1",
                Value = "2-39-1"
            });
            itemList.Add(new ListItem()
            {
                Text = "1-0-1",
                Value = "1-0-1"
            });
            itemList.Add(new ListItem()
            {
                Text = "2-0-1",
                Value = "2-0-1"
            });
            foreach (var item in itemList)
            {
                this.cmb_outStorePosition.Items.Add(item);
            }
 
            cmb_outStorePosition.SelectedIndex = 0;
        }
 
        private void FrmHandOutStore_Load(object sender, EventArgs e)
        {
            LoadItemType();
        }
 
        private void button_confirm_Click(object sender, EventArgs e)
        {
            ListItem selProFlag = null;
            var outStorePosition = ComboBoxHelper.GetComboxSelectValue(this.cmb_outStorePosition, ref selProFlag);
            if (string.IsNullOrEmpty(outStorePosition))
            {
                ShowErrorTip("请选择出库口!");
                return;
            }
            int flag = this.ck_IsPick.Checked ? 2 : 1;
            //创建任务
            var title = this.ck_IsPick.Checked ? "你选择的是分拣出库" : "你选择的是出库";
 
            if (this.ck_IsPick.Checked)
            {
                if (_materialCode == "GT-KTP" || _materialCode == "GG-KTP")
                {
                    ShowErrorTip("物料是空托盘,不允许被分拣!");
                    return;
                }
            }
            if (_materialCode == "GT-KTP" || _materialCode == "GG-KTP")
            {
                flag = 3;
            }
 
            DialogResult dr = MessageBox.Show(title + ",确定要新建任务吗", "新建出库任务", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.OK)
            {
                using (yunneiWCS.IyunneiWcfClient client = new yunneiWCS.IyunneiWcfClient())
                {
                    var result = client.CreateTaskForHandOutStore(flag, FLogin.user.UserName, _sourceStation, outStorePosition);
                    if (result.result)
                    {
                        ShowSuccessTip("新建人工出库任务成功");
                        this.Close();
                    }
                    else
                    {
                        ShowErrorTip(result.resMsg);
                    }
                }
            }
        }
 
        private void button_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
    }
}