Przeglądaj źródła

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 lat temu
rodzic
commit
cf803ee70f

+ 10 - 10
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.Designer.cs

@@ -109,7 +109,7 @@
             this.AutoPrint.Checked = true;
             this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoPrint.Location = new System.Drawing.Point(985, 204);
+            this.AutoPrint.Location = new System.Drawing.Point(1004, 216);
             this.AutoPrint.Margin = new System.Windows.Forms.Padding(4);
             this.AutoPrint.Name = "AutoPrint";
             this.AutoPrint.Size = new System.Drawing.Size(154, 31);
@@ -143,7 +143,7 @@
             // 
             this.palletcode_label.AutoSize = true;
             this.palletcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.palletcode_label.Location = new System.Drawing.Point(980, 339);
+            this.palletcode_label.Location = new System.Drawing.Point(957, 339);
             this.palletcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.palletcode_label.Name = "palletcode_label";
             this.palletcode_label.Size = new System.Drawing.Size(72, 27);
@@ -154,7 +154,7 @@
             // 
             this.outboxcode_label.AutoSize = true;
             this.outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.outboxcode_label.Location = new System.Drawing.Point(980, 394);
+            this.outboxcode_label.Location = new System.Drawing.Point(957, 394);
             this.outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.outboxcode_label.Name = "outboxcode_label";
             this.outboxcode_label.Size = new System.Drawing.Size(92, 27);
@@ -275,11 +275,11 @@
             this.outboxcode.AllPower = "ifall";
             this.outboxcode.BackColor = System.Drawing.Color.White;
             this.outboxcode.ID = null;
-            this.outboxcode.Location = new System.Drawing.Point(1105, 394);
+            this.outboxcode.Location = new System.Drawing.Point(1054, 394);
             this.outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.outboxcode.Name = "outboxcode";
             this.outboxcode.Power = "ifwrite";
-            this.outboxcode.Size = new System.Drawing.Size(195, 25);
+            this.outboxcode.Size = new System.Drawing.Size(140, 25);
             this.outboxcode.Str = null;
             this.outboxcode.Str1 = null;
             this.outboxcode.Str2 = null;
@@ -292,11 +292,11 @@
             this.bigoutboxcode.AllPower = "ifall";
             this.bigoutboxcode.BackColor = System.Drawing.Color.White;
             this.bigoutboxcode.ID = null;
-            this.bigoutboxcode.Location = new System.Drawing.Point(1105, 339);
+            this.bigoutboxcode.Location = new System.Drawing.Point(1054, 341);
             this.bigoutboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.bigoutboxcode.Name = "bigoutboxcode";
             this.bigoutboxcode.Power = "ifwrite";
-            this.bigoutboxcode.Size = new System.Drawing.Size(195, 25);
+            this.bigoutboxcode.Size = new System.Drawing.Size(140, 25);
             this.bigoutboxcode.Str = null;
             this.bigoutboxcode.Str1 = null;
             this.bigoutboxcode.Str2 = null;
@@ -517,12 +517,12 @@
             this.AutoOutBoxCode.Checked = true;
             this.AutoOutBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoOutBoxCode.Location = new System.Drawing.Point(1146, 204);
+            this.AutoOutBoxCode.Location = new System.Drawing.Point(1202, 338);
             this.AutoOutBoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoOutBoxCode.Name = "AutoOutBoxCode";
-            this.AutoOutBoxCode.Size = new System.Drawing.Size(154, 31);
+            this.AutoOutBoxCode.Size = new System.Drawing.Size(114, 31);
             this.AutoOutBoxCode.TabIndex = 179;
-            this.AutoOutBoxCode.Text = "自动生成箱号";
+            this.AutoOutBoxCode.Text = "自动生成";
             this.AutoOutBoxCode.UseVisualStyleBackColor = true;
             // 
             // pa_status

+ 2 - 7
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -85,11 +85,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (bigoutboxcode.Text == "")
-                {
-                    OperateResult.AppendText(">>大箱号不能为空\n", Color.Red);
-                    return;
-                }
                 sql.Clear();
                 sql.Append("select pa_makecode,pa_standardqty,pa_packageqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_currentqty,pa_custcode,pa_salecode ");
                 sql.Append("from package where pa_outboxcode='" + bigoutboxcode.Text + "'  and pa_type =2");
@@ -104,7 +99,7 @@ namespace UAS_MES.Make
                     FillPrintLabel();
                     outboxcode.Focus();
                 }
-                else OperateResult.AppendText(">>大箱号不存在\n", Color.Red);
+                else outboxcode.Focus();
             }
         }
 
@@ -164,7 +159,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "未采集内容,不允许装大箱\n", Color.Red, outboxcode);
+                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "未采集内容或不存在,不允许装大箱\n", Color.Red, outboxcode);
                         return;
                     }
                     pa_status.Text = dh.getFieldDataByCondition("package", "nvl(pa_status,0)pa_status", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString();

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -55,6 +55,7 @@ namespace UAS_MES.Make
             pa_outboxcode.ShowClickIcon = false;
             //设置DbFind的必须的数据
             PrintNum.Value = 1;
+            pr_outboxinnerqty.Controls[0].Visible = false;
             asc.controllInitializeSize(this);
             thread = new Thread(NewPrint);
             SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
@@ -93,7 +94,7 @@ namespace UAS_MES.Make
                     pr_outboxinnerqty.Text = pa_standardqty.Text;
                 }
             }
-            else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
+            else sn_code.Focus();
         }
 
         private void LoadGridData()

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -72,6 +72,7 @@ namespace UAS_MES.Make
             pa_outboxcode.ShowClickIcon = false;
             ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
             Baurate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
+            pr_outboxinnerqty.Controls[0].Visible = false;
             //设置DbFind的必须的数据
             PrintNum.Value = 1;
             asc.controllInitializeSize(this);
@@ -170,7 +171,7 @@ namespace UAS_MES.Make
                 else
                     pr_cartonboxgw.Text = MinWeight + "-" + MaxWeight;
             }
-            else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
+            else sn_code.Focus();
         }
 
         private void LoadGridData()

+ 9 - 9
UAS-MES/FunctionCode/Make/Make_PalletCollection.Designer.cs

@@ -128,7 +128,7 @@
             // 
             this.palletcode_label.AutoSize = true;
             this.palletcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.palletcode_label.Location = new System.Drawing.Point(980, 308);
+            this.palletcode_label.Location = new System.Drawing.Point(960, 308);
             this.palletcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.palletcode_label.Name = "palletcode_label";
             this.palletcode_label.Size = new System.Drawing.Size(72, 27);
@@ -139,7 +139,7 @@
             // 
             this.outboxcode_label.AutoSize = true;
             this.outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.outboxcode_label.Location = new System.Drawing.Point(980, 363);
+            this.outboxcode_label.Location = new System.Drawing.Point(960, 363);
             this.outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.outboxcode_label.Name = "outboxcode_label";
             this.outboxcode_label.Size = new System.Drawing.Size(52, 27);
@@ -303,11 +303,11 @@
             this.outboxcode.AllPower = "ifall";
             this.outboxcode.BackColor = System.Drawing.Color.White;
             this.outboxcode.ID = null;
-            this.outboxcode.Location = new System.Drawing.Point(1106, 363);
+            this.outboxcode.Location = new System.Drawing.Point(1047, 363);
             this.outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.outboxcode.Name = "outboxcode";
             this.outboxcode.Power = "ifwrite";
-            this.outboxcode.Size = new System.Drawing.Size(195, 25);
+            this.outboxcode.Size = new System.Drawing.Size(154, 25);
             this.outboxcode.Str = null;
             this.outboxcode.Str1 = null;
             this.outboxcode.Str2 = null;
@@ -320,11 +320,11 @@
             this.palletcode.AllPower = "ifall";
             this.palletcode.BackColor = System.Drawing.Color.White;
             this.palletcode.ID = null;
-            this.palletcode.Location = new System.Drawing.Point(1106, 308);
+            this.palletcode.Location = new System.Drawing.Point(1047, 308);
             this.palletcode.Margin = new System.Windows.Forms.Padding(4);
             this.palletcode.Name = "palletcode";
             this.palletcode.Power = "ifwrite";
-            this.palletcode.Size = new System.Drawing.Size(195, 25);
+            this.palletcode.Size = new System.Drawing.Size(154, 25);
             this.palletcode.Str = null;
             this.palletcode.Str1 = null;
             this.palletcode.Str2 = null;
@@ -502,12 +502,12 @@
             this.AutoOutBoxCode.Checked = true;
             this.AutoOutBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoOutBoxCode.Location = new System.Drawing.Point(1105, 204);
+            this.AutoOutBoxCode.Location = new System.Drawing.Point(1208, 305);
             this.AutoOutBoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoOutBoxCode.Name = "AutoOutBoxCode";
-            this.AutoOutBoxCode.Size = new System.Drawing.Size(174, 31);
+            this.AutoOutBoxCode.Size = new System.Drawing.Size(114, 31);
             this.AutoOutBoxCode.TabIndex = 180;
-            this.AutoOutBoxCode.Text = "自动生成栈板号";
+            this.AutoOutBoxCode.Text = "自动生成";
             this.AutoOutBoxCode.UseVisualStyleBackColor = true;
             // 
             // pa_status

+ 3 - 8
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -83,11 +83,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (palletcode.Text == "")
-                {
-                    OperateResult.AppendText(">>栈板号不能为空\n", Color.Red);
-                    return;
-                }
                 sql.Clear();
                 sql.Append("select pa_makecode,pa_status,pa_packageqty,pa_currentqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
                 sql.Append("from package where pa_outboxcode='" + palletcode.Text + "' and pa_type =3");
@@ -102,7 +97,7 @@ namespace UAS_MES.Make
                     FillPrintLabel();
                     outboxcode.Focus();
                 }
-                else OperateResult.AppendText(">>栈板号不存在\n", Color.Red);
+                else outboxcode.Focus();
             }
         }
 
@@ -155,7 +150,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "未采集内容,不允许装栈板\n", Color.Red, outboxcode);
+                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "未采集内容或不存在,不允许装栈板\n", Color.Red, outboxcode);
                         return;
                     }
                     pa_status.Text = dh.getFieldDataByCondition("package", "nvl(pa_status,0)pa_status", "pa_outboxcode='" + palletcode.Text + "'").ToString();
@@ -178,7 +173,7 @@ namespace UAS_MES.Make
                     }
                     else if (palletcode.Text == "" && !AutoOutBoxCode.Checked)
                     {
-                        OperateResult.AppendText(">>栈板号箱号不能为空\n", Color.Red, outboxcode);
+                        OperateResult.AppendText(">>栈板号不能为空\n", Color.Red, outboxcode);
                         return;
                     }
                     pa_outboxcode.Text = palletcode.Text;

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -71,6 +71,7 @@ namespace UAS_MES.Make
             pa_outboxcode.Caller = "PACKAGE";
             ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
             Baurate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
+            pr_outboxinnerqty.Controls[0].Visible = false;
             //设置DbFind的必须的数据
             PrintNum.Value = 1;
             asc.controllInitializeSize(this);
@@ -177,7 +178,7 @@ namespace UAS_MES.Make
                 else
                     pr_cartonboxgw.Text = MinWeight + "-" + MaxWeight;
             }
-            else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
+            else sn_code.Focus();
         }
 
         private void LoadGridData()

+ 111 - 105
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.Designer.cs

@@ -31,6 +31,13 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_OnlineTraceBack));
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.ms_status_label = new System.Windows.Forms.Label();
+            this.ms_stepcode_label = new System.Windows.Forms.Label();
+            this.ms_nextstepcode_label = new System.Windows.Forms.Label();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ms_nextstepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_stepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Query = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ms_status = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.SnInf = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
             this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.status = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -38,13 +45,6 @@
             this.ms_stepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ms_nextstepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ms_makecode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ms_status = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
-            this.Query = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ms_stepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ms_stepcode_label = new System.Windows.Forms.Label();
-            this.ms_nextstepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ms_nextstepcode_label = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.SnInf)).BeginInit();
             this.SuspendLayout();
             // 
@@ -70,6 +70,108 @@
             this.ms_status_label.TabIndex = 197;
             this.ms_status_label.Text = "SN状态";
             // 
+            // ms_stepcode_label
+            // 
+            this.ms_stepcode_label.AutoSize = true;
+            this.ms_stepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_stepcode_label.Location = new System.Drawing.Point(559, 24);
+            this.ms_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_stepcode_label.Name = "ms_stepcode_label";
+            this.ms_stepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_stepcode_label.TabIndex = 207;
+            this.ms_stepcode_label.Text = "当前工序";
+            // 
+            // ms_nextstepcode_label
+            // 
+            this.ms_nextstepcode_label.AutoSize = true;
+            this.ms_nextstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_nextstepcode_label.Location = new System.Drawing.Point(854, 24);
+            this.ms_nextstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_nextstepcode_label.Name = "ms_nextstepcode_label";
+            this.ms_nextstepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_nextstepcode_label.TabIndex = 209;
+            this.ms_nextstepcode_label.Text = "下一工序";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = "IFALL";
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = "";
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(79, 24);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = "";
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(188, 29);
+            this.ma_code.TabIndex = 211;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "makecode";
+            this.ma_code.TextBoxEnable = true;
+            // 
+            // ms_nextstepcode
+            // 
+            this.ms_nextstepcode.AllPower = null;
+            this.ms_nextstepcode.BackColor = System.Drawing.Color.White;
+            this.ms_nextstepcode.ID = null;
+            this.ms_nextstepcode.Location = new System.Drawing.Point(953, 24);
+            this.ms_nextstepcode.Name = "ms_nextstepcode";
+            this.ms_nextstepcode.Power = null;
+            this.ms_nextstepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_nextstepcode.Str = null;
+            this.ms_nextstepcode.Str1 = null;
+            this.ms_nextstepcode.Str2 = null;
+            this.ms_nextstepcode.TabIndex = 210;
+            this.ms_nextstepcode.Tag = "ms_nextstepcode";
+            // 
+            // ms_stepcode
+            // 
+            this.ms_stepcode.AllPower = null;
+            this.ms_stepcode.BackColor = System.Drawing.Color.White;
+            this.ms_stepcode.ID = null;
+            this.ms_stepcode.Location = new System.Drawing.Point(658, 24);
+            this.ms_stepcode.Name = "ms_stepcode";
+            this.ms_stepcode.Power = null;
+            this.ms_stepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_stepcode.Str = null;
+            this.ms_stepcode.Str1 = null;
+            this.ms_stepcode.Str2 = null;
+            this.ms_stepcode.TabIndex = 208;
+            this.ms_stepcode.Tag = "ms_stepcode";
+            // 
+            // Query
+            // 
+            this.Query.AllPower = null;
+            this.Query.BackColor = System.Drawing.Color.Transparent;
+            this.Query.DownImage = ((System.Drawing.Image)(resources.GetObject("Query.DownImage")));
+            this.Query.Image = null;
+            this.Query.IsShowBorder = true;
+            this.Query.Location = new System.Drawing.Point(1176, 16);
+            this.Query.MoveImage = ((System.Drawing.Image)(resources.GetObject("Query.MoveImage")));
+            this.Query.Name = "Query";
+            this.Query.NormalImage = ((System.Drawing.Image)(resources.GetObject("Query.NormalImage")));
+            this.Query.Power = null;
+            this.Query.Size = new System.Drawing.Size(75, 28);
+            this.Query.TabIndex = 206;
+            this.Query.Text = "查询";
+            this.Query.UseVisualStyleBackColor = false;
+            this.Query.Click += new System.EventHandler(this.Query_Click);
+            // 
+            // ms_status
+            // 
+            this.ms_status.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.ms_status.FormattingEnabled = true;
+            this.ms_status.Location = new System.Drawing.Point(362, 25);
+            this.ms_status.Name = "ms_status";
+            this.ms_status.Size = new System.Drawing.Size(167, 23);
+            this.ms_status.TabIndex = 205;
+            this.ms_status.Tag = "ms_status";
+            this.ms_status.SelectedIndexChanged += new System.EventHandler(this.ms_status_SelectedIndexChanged);
+            // 
             // SnInf
             // 
             this.SnInf.AllowUserToAddRows = false;
@@ -131,114 +233,18 @@
             this.Column5.Name = "Column5";
             this.Column5.ReadOnly = true;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AllPower = null;
-            this.ms_makecode.BackColor = System.Drawing.Color.White;
-            this.ms_makecode.ID = null;
-            this.ms_makecode.Location = new System.Drawing.Point(83, 25);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Power = null;
-            this.ms_makecode.Size = new System.Drawing.Size(167, 25);
-            this.ms_makecode.Str = null;
-            this.ms_makecode.Str1 = null;
-            this.ms_makecode.Str2 = null;
-            this.ms_makecode.TabIndex = 204;
-            this.ms_makecode.Tag = "makecode";
-            this.ms_makecode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ma_code_KeyDown);
-            // 
-            // ms_status
-            // 
-            this.ms_status.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.ms_status.FormattingEnabled = true;
-            this.ms_status.Location = new System.Drawing.Point(362, 25);
-            this.ms_status.Name = "ms_status";
-            this.ms_status.Size = new System.Drawing.Size(167, 23);
-            this.ms_status.TabIndex = 205;
-            this.ms_status.Tag = "ms_status";
-            // 
-            // Query
-            // 
-            this.Query.AllPower = null;
-            this.Query.BackColor = System.Drawing.Color.Transparent;
-            this.Query.DownImage = ((System.Drawing.Image)(resources.GetObject("Query.DownImage")));
-            this.Query.Image = null;
-            this.Query.IsShowBorder = true;
-            this.Query.Location = new System.Drawing.Point(1174, 20);
-            this.Query.MoveImage = ((System.Drawing.Image)(resources.GetObject("Query.MoveImage")));
-            this.Query.Name = "Query";
-            this.Query.NormalImage = ((System.Drawing.Image)(resources.GetObject("Query.NormalImage")));
-            this.Query.Power = null;
-            this.Query.Size = new System.Drawing.Size(75, 28);
-            this.Query.TabIndex = 206;
-            this.Query.Text = "查询";
-            this.Query.UseVisualStyleBackColor = false;
-            this.Query.Click += new System.EventHandler(this.Query_Click);
-            // 
-            // ms_stepcode
-            // 
-            this.ms_stepcode.AllPower = null;
-            this.ms_stepcode.BackColor = System.Drawing.Color.White;
-            this.ms_stepcode.ID = null;
-            this.ms_stepcode.Location = new System.Drawing.Point(658, 22);
-            this.ms_stepcode.Name = "ms_stepcode";
-            this.ms_stepcode.Power = null;
-            this.ms_stepcode.Size = new System.Drawing.Size(167, 25);
-            this.ms_stepcode.Str = null;
-            this.ms_stepcode.Str1 = null;
-            this.ms_stepcode.Str2 = null;
-            this.ms_stepcode.TabIndex = 208;
-            this.ms_stepcode.Tag = "ms_stepcode";
-            // 
-            // ms_stepcode_label
-            // 
-            this.ms_stepcode_label.AutoSize = true;
-            this.ms_stepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_stepcode_label.Location = new System.Drawing.Point(559, 21);
-            this.ms_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_stepcode_label.Name = "ms_stepcode_label";
-            this.ms_stepcode_label.Size = new System.Drawing.Size(92, 27);
-            this.ms_stepcode_label.TabIndex = 207;
-            this.ms_stepcode_label.Text = "当前工序";
-            // 
-            // ms_nextstepcode
-            // 
-            this.ms_nextstepcode.AllPower = null;
-            this.ms_nextstepcode.BackColor = System.Drawing.Color.White;
-            this.ms_nextstepcode.ID = null;
-            this.ms_nextstepcode.Location = new System.Drawing.Point(953, 20);
-            this.ms_nextstepcode.Name = "ms_nextstepcode";
-            this.ms_nextstepcode.Power = null;
-            this.ms_nextstepcode.Size = new System.Drawing.Size(167, 25);
-            this.ms_nextstepcode.Str = null;
-            this.ms_nextstepcode.Str1 = null;
-            this.ms_nextstepcode.Str2 = null;
-            this.ms_nextstepcode.TabIndex = 210;
-            this.ms_nextstepcode.Tag = "ms_nextstepcode";
-            // 
-            // ms_nextstepcode_label
-            // 
-            this.ms_nextstepcode_label.AutoSize = true;
-            this.ms_nextstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_nextstepcode_label.Location = new System.Drawing.Point(854, 20);
-            this.ms_nextstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_nextstepcode_label.Name = "ms_nextstepcode_label";
-            this.ms_nextstepcode_label.Size = new System.Drawing.Size(92, 27);
-            this.ms_nextstepcode_label.TabIndex = 209;
-            this.ms_nextstepcode_label.Text = "下一工序";
-            // 
             // Query_OnlineTraceBack
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1261, 694);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ms_nextstepcode);
             this.Controls.Add(this.ms_nextstepcode_label);
             this.Controls.Add(this.ms_stepcode);
             this.Controls.Add(this.ms_stepcode_label);
             this.Controls.Add(this.Query);
             this.Controls.Add(this.ms_status);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.SnInf);
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.ms_status_label);
@@ -259,7 +265,6 @@
         private System.Windows.Forms.Label ms_makecode_label;
         private System.Windows.Forms.Label ms_status_label;
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum SnInf;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ms_makecode;
         private CustomControl.ComBoxWithFocus.ComBoxWithFocus ms_status;
         private CustomControl.ButtonUtil.NormalButton Query;
         private CustomControl.TextBoxWithIcon.EnterTextBox ms_stepcode;
@@ -272,5 +277,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_stepcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_nextstepcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
     }
 }

+ 27 - 10
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.cs

@@ -21,6 +21,7 @@ namespace UAS_MES.Query
 
         DataTable ComBoxData = new DataTable();
 
+        DataTable Dbfind;
         public Query_OnlineTraceBack()
         {
             InitializeComponent();
@@ -49,11 +50,21 @@ namespace UAS_MES.Query
             ms_status.DataSource = ComBoxData;
             ms_status.DisplayMember = "status";
             ms_status.ValueMember = "statuscode";
-        }
 
-        private void ma_code_KeyDown(object sender, KeyEventArgs e)
+            //工单号放大镜配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_softversion # 软件版本";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ma_code_DbChange;
+        }
+        private void Ma_code_DbChange(object sender, EventArgs e)
         {
 
+            Dbfind = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+            Query.PerformClick();
         }
 
         private void Query_OnlineTraceBack_SizeChanged(object sender, EventArgs e)
@@ -63,18 +74,18 @@ namespace UAS_MES.Query
 
         private void Query_Click(object sender, EventArgs e)
         {
-            if (dh.CheckExist("make", "ma_code='" + ms_makecode.Text + "'"))
+            if (dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
             {
-                string condition = BaseUtil.GetScreenSqlCondition(ms_makecode, ms_stepcode, ms_nextstepcode);
+                string condition = BaseUtil.GetScreenSqlCondition(ma_code, ms_stepcode, ms_nextstepcode);
                 string statuscode = ms_status.SelectedValue.ToString();
                 sql.Clear();
                 sql.Append("select distinct sncode ms_sncode,ms_linecode,ms_stepcode,ms_nextstepcode,ms_craftcode,makecode ms_makecode, ");
                 sql.Append("case when ms_status is null then '未生产'  when ms_status=1 then '在线' when ms_status=2 ");
                 sql.Append(" then '已完工' when ms_status=3 then '不良待维修' when ms_status=4 then '已报废' ");
                 sql.Append("else 'null' end ms_status  from((select msd_sncode sncode,msd_makecode makecode,msd_type type ");
-                sql.Append("from makesnruledetail where msd_makecode='" + ms_makecode.Text + "') union (select msl_sncode sncode,msl_makecode ");
-                sql.Append("makecode,msl_type type from makesnlist where msl_makecode='" + ms_makecode.Text + "') union (");
-                sql.Append("select ms_sncode,ms_makecode,'' type from  makeserial where ms_makecode='" + ms_makecode.Text + "'))");
+                sql.Append("from makesnruledetail where msd_makecode='" + ma_code.Text + "') union (select msl_sncode sncode,msl_makecode ");
+                sql.Append("makecode,msl_type type from makesnlist where msl_makecode='" + ma_code.Text + "') union (");
+                sql.Append("select ms_sncode,ms_makecode,'' type from  makeserial where ms_makecode='" + ma_code.Text + "'))");
                 sql.Append("A left join makeserial on ms_code=sncode");
                 sql.Append(condition);
                 if (statuscode == "0")
@@ -95,10 +106,16 @@ namespace UAS_MES.Query
             }
             else
             {
-                MessageBox.Show("工单号" + ms_makecode.Text + "不存在");
+                MessageBox.Show("工单号" + ma_code.Text + "不存在");
                 BaseUtil.CleanDataGridView(SnInf);
-                ms_makecode.Clear();
+                ma_code.Text = "";
             }
         }
+
+        private void ms_status_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (ma_code.Text != "")
+                Query.PerformClick();
+        }
     }
-}
+}

+ 18 - 18
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.resx

@@ -117,24 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ms_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ms_stepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ms_nextstepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Query.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
@@ -174,4 +156,22 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_stepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_nextstepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 92 - 3
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1233,7 +1233,7 @@ namespace UAS_LabelMachine
                         }
                         catch (Exception ex) { LogManager.DoLog(ex.Message); }
                     }
-                    if (MidLabelAutoPrint.Checked && LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True" && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue !=null&& LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
+                    if (MidLabelAutoPrint.Checked && LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True" && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue != null && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
                     {
                         //判断当前行的盒号和下一行不相等或者已经是最后一行了
                         if (i + 1 == LabelInf.RowCount || LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1 == LabelInf.RowCount ? i : i + 1].Cells["pib_outboxcode1"].Value.ToString())
@@ -1437,6 +1437,9 @@ namespace UAS_LabelMachine
                 //中盒号所在的行
                 int MidLabelRowIndex = 0;
                 //查找是否存在该中盒号
+                List<int> MidRowIndex = new List<int>();
+                //缓存中盒数据
+                List<string> MidBoxCode = new List<string>();
                 for (int i = 0; i < LabelInf.RowCount; i++)
                 {
                     if (MidLabelNum.Text == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
@@ -1444,12 +1447,17 @@ namespace UAS_LabelMachine
                         //找到了输入的中盒号停止循环
                         FindMidLabel = true;
                         MidLabelRowIndex = i;
-                        break;
+                    }
+                    //设置所有的中盒号的索引
+                    if (!MidBoxCode.Contains(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
+                    {
+                        MidBoxCode.Add(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
+                        MidRowIndex.Add(i);
                     }
                 }
                 //找到了指定的盒号
                 if (FindMidLabel)
-                    MidBoxCodePrint(la_id, MidLabelRowIndex);
+                    MidBoxCodePrint(la_id, MidLabelRowIndex, MidRowIndex.ToArray());
                 else
                     MessageBox.Show("该出入库单未找到该中盒号!");
             }
@@ -1543,6 +1551,11 @@ namespace UAS_LabelMachine
 
         private void MidBoxCodePrint(string la_id, int rowindex)
         {
+            if (MidBoxCacheData.Rows.Count == 0)
+            {
+                MidIDAndOutboxcode.Add(LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString());
+                GetMidBoxData();
+            }
             DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");
             string[] arg = MidBoxArgument.ToArray();
             for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
@@ -1608,6 +1621,82 @@ namespace UAS_LabelMachine
             MidDoc.PrintDocument();
         }
 
+        private void MidBoxCodePrint(string la_id, int rowindex, int[] midindex)
+        {
+            if (MidBoxCacheData.Rows.Count == 0)
+            {
+                MidIDAndOutboxcode.Clear();
+                for (int i = 0; i < midindex.Length; i++)
+                {
+                    MidIDAndOutboxcode.Add(LabelInf.Rows[midindex[i]].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[midindex[i]].Cells["pib_outboxcode1"].Value.ToString());
+                }
+                GetMidBoxData();
+            }
+            DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");
+            string[] arg = MidBoxArgument.ToArray();
+            for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
+            {
+                //将维护的模板参数和模板本身的参数名称进行比对
+                for (int k = 0; k < dt.Rows.Count; k++)
+                {
+                    //名称相等的时候,取SQL进行值的查询
+                    if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
+                    {
+                        //获取对应行的pib_id
+                        string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
+                        string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
+                        //获取打印执行的SQL
+                        string sql = dt.Rows[k]["lp_sql"].ToString();
+                        try
+                        {
+                            //获取打印执行的SQL
+                            if (sql.IndexOf("{") == 0)
+                            {
+                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
+                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + dt.Rows[k]["lp_sql"].ToString() + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
+                            }
+                            else
+                            {
+                                DataRow[] dr = MidBoxCacheData.Select("pib_outboxcode1=" + pib_outboxcode1);
+                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode1"))
+                                {
+                                    if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["DateCode1"].Value.ToString();
+                                }
+                                else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("lotno"))
+                                {
+                                    if (LabelInf.Rows[rowindex].Cells["pib_lotno"].Value != null)
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_lotno"].Value.ToString();
+                                }
+                                else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode"))
+                                {
+                                    if (LabelInf.Rows[rowindex].Cells["pib_datecode"].Value != null)
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode"].Value.ToString();
+                                }
+                                else if (arg.Contains(MidDoc.Variables.FreeVariables.Item(j + 1).Name))
+                                {
+                                    if (dr.Length > 0)
+                                    {
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][MidDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
+                                    }
+                                }
+                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
+                            }
+                        }
+                        catch (Exception)
+                        {
+                            LogManager.DoLog("SQL维护不正确,请检查SQL语句\n" + sql);
+                            return;
+                        }
+                    }
+                }
+            }
+            //保存参数打印
+            MidDoc.Save();
+            MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
+            MidDoc.PrintDocument();
+        }
+
         private void MidBoxCodePrint(string la_id, int rowindex, string HandPrint)
         {
             DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");