Browse Source

【海格森MES】修改2

caosy 6 months ago
parent
commit
be45123cde

+ 83 - 71
UAS_MES_HGS/FunctionCode/Make/Make_RePrintLabel.Designer.cs

@@ -43,6 +43,7 @@
             this.ms_makecode = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
             this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.jishen = new System.Windows.Forms.RadioButton();
             this.CartonBox = new System.Windows.Forms.RadioButton();
             this.fuselagel = new System.Windows.Forms.RadioButton();
             this.giftBox = new System.Windows.Forms.RadioButton();
@@ -59,10 +60,10 @@
             // 
             this.label.AutoSize = true;
             this.label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label.Location = new System.Drawing.Point(50, 178);
-            this.label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label.Location = new System.Drawing.Point(25, 89);
+            this.label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label.Name = "label";
-            this.label.Size = new System.Drawing.Size(114, 41);
+            this.label.Size = new System.Drawing.Size(58, 21);
             this.label.TabIndex = 4;
             this.label.Text = "输入值";
             // 
@@ -70,10 +71,10 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(728, 178);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(364, 89);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(146, 41);
+            this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 5;
             this.label3.Text = "工单代码";
             // 
@@ -81,10 +82,10 @@
             // 
             this.label111.AutoSize = true;
             this.label111.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label111.Location = new System.Drawing.Point(50, 230);
-            this.label111.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label111.Location = new System.Drawing.Point(25, 115);
+            this.label111.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label111.Name = "label111";
-            this.label111.Size = new System.Drawing.Size(146, 41);
+            this.label111.Size = new System.Drawing.Size(74, 21);
             this.label111.TabIndex = 6;
             this.label111.Text = "产品编号";
             // 
@@ -92,10 +93,10 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(728, 230);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Location = new System.Drawing.Point(364, 115);
+            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.Size = new System.Drawing.Size(42, 21);
             this.label5.TabIndex = 7;
             this.label5.Text = "名称";
             // 
@@ -103,10 +104,9 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(50, 290);
-            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label6.Location = new System.Drawing.Point(25, 145);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(178, 41);
+            this.label6.Size = new System.Drawing.Size(90, 21);
             this.label6.TabIndex = 188;
             this.label6.Text = "打印机列表";
             // 
@@ -114,10 +114,9 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(50, 352);
-            this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label7.Location = new System.Drawing.Point(25, 176);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(146, 41);
+            this.label7.Size = new System.Drawing.Size(74, 21);
             this.label7.TabIndex = 187;
             this.label7.Text = "标签模板";
             // 
@@ -125,10 +124,10 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label8.Location = new System.Drawing.Point(726, 296);
-            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Location = new System.Drawing.Point(363, 148);
+            this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(114, 41);
+            this.label8.Size = new System.Drawing.Size(58, 21);
             this.label8.TabIndex = 190;
             this.label8.Text = "输入框";
             // 
@@ -136,10 +135,10 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label9.Location = new System.Drawing.Point(728, 358);
-            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Location = new System.Drawing.Point(364, 179);
+            this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(82, 41);
+            this.label9.Size = new System.Drawing.Size(42, 21);
             this.label9.TabIndex = 192;
             this.label9.Text = "份数";
             // 
@@ -147,20 +146,20 @@
             // 
             this.inputValue.AutoSize = true;
             this.inputValue.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.inputValue.Location = new System.Drawing.Point(242, 178);
-            this.inputValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.inputValue.Location = new System.Drawing.Point(121, 89);
+            this.inputValue.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.inputValue.Name = "inputValue";
-            this.inputValue.Size = new System.Drawing.Size(0, 41);
+            this.inputValue.Size = new System.Drawing.Size(0, 21);
             this.inputValue.TabIndex = 199;
             // 
             // pr_code
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_code.Location = new System.Drawing.Point(242, 230);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.Location = new System.Drawing.Point(121, 115);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 41);
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
             this.pr_code.TabIndex = 200;
             this.pr_code.TextChanged += new System.EventHandler(this.PrintLabel_TextChanged);
             // 
@@ -168,47 +167,60 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_makecode.Location = new System.Drawing.Point(874, 178);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Location = new System.Drawing.Point(437, 89);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode.TabIndex = 201;
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(874, 230);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(437, 115);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 202;
             // 
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.jishen);
             this.groupBoxWithBorder1.Controls.Add(this.CartonBox);
             this.groupBoxWithBorder1.Controls.Add(this.fuselagel);
             this.groupBoxWithBorder1.Controls.Add(this.giftBox);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(58, 18);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(29, 9);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4, 6, 4, 6);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1512, 144);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(756, 72);
             this.groupBoxWithBorder1.TabIndex = 204;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "打印类型";
             this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
             // 
+            // jishen
+            // 
+            this.jishen.AutoSize = true;
+            this.jishen.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.jishen.Location = new System.Drawing.Point(200, 35);
+            this.jishen.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.jishen.Name = "jishen";
+            this.jishen.Size = new System.Drawing.Size(108, 25);
+            this.jishen.TabIndex = 4;
+            this.jishen.Text = "机身标打印";
+            this.jishen.UseVisualStyleBackColor = true;
+            // 
             // CartonBox
             // 
             this.CartonBox.AutoSize = true;
             this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.CartonBox.Location = new System.Drawing.Point(574, 70);
-            this.CartonBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.CartonBox.Location = new System.Drawing.Point(363, 35);
+            this.CartonBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.CartonBox.Name = "CartonBox";
-            this.CartonBox.Size = new System.Drawing.Size(216, 45);
+            this.CartonBox.Size = new System.Drawing.Size(112, 25);
             this.CartonBox.TabIndex = 2;
             this.CartonBox.Text = "Carton打印";
             this.CartonBox.UseVisualStyleBackColor = true;
@@ -218,12 +230,12 @@
             // 
             this.fuselagel.AutoSize = true;
             this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.fuselagel.Location = new System.Drawing.Point(1126, 70);
-            this.fuselagel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.fuselagel.Location = new System.Drawing.Point(563, 35);
+            this.fuselagel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.fuselagel.Name = "fuselagel";
-            this.fuselagel.Size = new System.Drawing.Size(209, 45);
+            this.fuselagel.Size = new System.Drawing.Size(108, 25);
             this.fuselagel.TabIndex = 3;
-            this.fuselagel.Text = "机身标打印";
+            this.fuselagel.Text = "栈板标打印";
             this.fuselagel.UseVisualStyleBackColor = true;
             this.fuselagel.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
             // 
@@ -232,10 +244,10 @@
             this.giftBox.AutoSize = true;
             this.giftBox.Checked = true;
             this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.giftBox.Location = new System.Drawing.Point(110, 70);
-            this.giftBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.giftBox.Location = new System.Drawing.Point(55, 35);
+            this.giftBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.giftBox.Name = "giftBox";
-            this.giftBox.Size = new System.Drawing.Size(177, 45);
+            this.giftBox.Size = new System.Drawing.Size(92, 25);
             this.giftBox.TabIndex = 1;
             this.giftBox.TabStop = true;
             this.giftBox.Text = "彩标打印";
@@ -245,10 +257,9 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(58, 422);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperateResult.Location = new System.Drawing.Point(29, 211);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1510, 326);
+            this.OperateResult.Size = new System.Drawing.Size(757, 165);
             this.OperateResult.TabIndex = 195;
             this.OperateResult.Text = "";
             // 
@@ -259,13 +270,13 @@
             this.printBtn.DownImage = ((System.Drawing.Image)(resources.GetObject("printBtn.DownImage")));
             this.printBtn.Image = null;
             this.printBtn.IsShowBorder = true;
-            this.printBtn.Location = new System.Drawing.Point(1230, 356);
-            this.printBtn.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.printBtn.Location = new System.Drawing.Point(615, 178);
+            this.printBtn.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.printBtn.MoveImage = ((System.Drawing.Image)(resources.GetObject("printBtn.MoveImage")));
             this.printBtn.Name = "printBtn";
             this.printBtn.NormalImage = ((System.Drawing.Image)(resources.GetObject("printBtn.NormalImage")));
             this.printBtn.Power = null;
-            this.printBtn.Size = new System.Drawing.Size(100, 48);
+            this.printBtn.Size = new System.Drawing.Size(50, 24);
             this.printBtn.TabIndex = 194;
             this.printBtn.Text = "打印";
             this.printBtn.UseVisualStyleBackColor = false;
@@ -276,12 +287,12 @@
             this.printNum.AllPower = null;
             this.printNum.BackColor = System.Drawing.Color.White;
             this.printNum.ID = null;
-            this.printNum.Location = new System.Drawing.Point(884, 364);
-            this.printNum.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.printNum.Location = new System.Drawing.Point(442, 182);
+            this.printNum.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.printNum.Name = "printNum";
             this.printNum.Negative = false;
             this.printNum.Power = null;
-            this.printNum.Size = new System.Drawing.Size(294, 35);
+            this.printNum.Size = new System.Drawing.Size(149, 21);
             this.printNum.Str = null;
             this.printNum.Str1 = null;
             this.printNum.Str2 = null;
@@ -293,11 +304,11 @@
             this.inputText.AllPower = null;
             this.inputText.BackColor = System.Drawing.Color.White;
             this.inputText.ID = null;
-            this.inputText.Location = new System.Drawing.Point(882, 298);
-            this.inputText.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.inputText.Location = new System.Drawing.Point(441, 149);
+            this.inputText.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.inputText.Name = "inputText";
             this.inputText.Power = null;
-            this.inputText.Size = new System.Drawing.Size(294, 35);
+            this.inputText.Size = new System.Drawing.Size(149, 21);
             this.inputText.Str = null;
             this.inputText.Str1 = null;
             this.inputText.Str2 = null;
@@ -308,25 +319,25 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(250, 358);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(125, 179);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(294, 32);
+            this.PrintLabel.Size = new System.Drawing.Size(149, 20);
             this.PrintLabel.TabIndex = 189;
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(250, 290);
-            this.Printer.Margin = new System.Windows.Forms.Padding(8);
+            this.Printer.Location = new System.Drawing.Point(125, 145);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(296, 50);
+            this.Printer.Size = new System.Drawing.Size(148, 25);
             this.Printer.TabIndex = 186;
             // 
             // Make_RePrintLabel
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1636, 834);
+            this.ClientSize = new System.Drawing.Size(818, 417);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.ms_makecode);
@@ -347,7 +358,7 @@
             this.Controls.Add(this.label3);
             this.Controls.Add(this.label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.Name = "Make_RePrintLabel";
             this.Tag = "Make!RePrintLabel";
             this.Text = "Make_RePrintLabel";
@@ -384,5 +395,6 @@
         private System.Windows.Forms.Label ms_makecode;
         private System.Windows.Forms.Label pr_detail;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private System.Windows.Forms.RadioButton jishen;
     }
 }

+ 137 - 24
UAS_MES_HGS/FunctionCode/Make/Make_RePrintLabel.cs

@@ -1,5 +1,4 @@
 using LabelManager2;
-using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -22,20 +21,32 @@ namespace UAS_MES_NEW.Make
 
         LogStringBuilder sql = new LogStringBuilder();
 
+        public BarTender.Application engine;
+
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
-        Engine engine;
+        ApplicationClass lbl;
+
+        Document doc;
 
         Thread InitPrint;//实例化打印进程
 
         DataTable dt;
 
+        ftpOperater ftp;
+
         DataTable listA;
 
         string getlabel = "";
 
         DataTable mapB;
 
+        String TSN = "";//记录第一次输入的SN
+
+        DataTable infoc;
+
+        string re_ms_id = "";
+
         string ms_id = "";
 
         DataTable formValue;//界面赋值
@@ -64,12 +75,13 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine(true);
+                engine = new BarTender.Application();
+                lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
-            catch (Exception)
+            catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装Bartender软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
             }
         }
 
@@ -81,14 +93,18 @@ namespace UAS_MES_NEW.Make
 
         private void Make_RePrintLabel_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             //窗口关闭的时候
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
+            dh.Dispose();
+
         }
 
         private void radioButton_CheckedChange(object sender, EventArgs e)
         {
             RadioButton btn = sender as RadioButton;
-            if ((btn.Name == "giftBox" || btn.Name == "fuselagel") && btn.Checked)
+            if ((btn.Name == "giftBox" ) && btn.Checked)
             {
                 //如果是切换成彩盒或者机身标提示用户 输入SN
                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
@@ -99,6 +115,16 @@ namespace UAS_MES_NEW.Make
                 OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
                 clearAll();
             }
+            else if (btn.Name == "fuselagel" && btn.Checked)
+            {
+                OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
+                clearAll();
+            }
+            else if (btn.Name == "jishen" && btn.Checked)
+            {
+                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                clearAll();
+            }
         }
 
         private void inputText_KeyDown(object sender, KeyEventArgs e)
@@ -113,7 +139,7 @@ namespace UAS_MES_NEW.Make
                 }
                 OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
                 //打印类型为彩盒或者机身标
-                if (giftBox.Checked || fuselagel.Checked)
+                if (giftBox.Checked||jishen.Checked)
                 {
                     //select max(ms_id)ms_id from makeserial where ms_sncode=? 
                     ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
@@ -154,6 +180,24 @@ namespace UAS_MES_NEW.Make
                     //展示产品编号和标签模板到界面
                     inputValue.Text = inputText.Text;
                     inputText.Text = "";
+                }//打印类型为栈板
+                else if (fuselagel.Checked)
+                {
+                    //查询箱号是否存在
+                    dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=3", "select");
+                    if (dt.Rows.Count == 0)
+                    {
+                        //无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
+                        OperateResult.AppendText("<<栈板号:" + inputText.Text + "不存在\n", Color.Red, inputText);
+                        OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
+                        return;
+                    }
+                    //界面赋值
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                    //有值,可以打
+                    //展示产品编号和标签模板到界面
+                    inputValue.Text = inputText.Text;
+                    inputText.Text = "";
                 }
                 print_Click(sender, new EventArgs());
             }
@@ -166,9 +210,11 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             if (fuselagel.Checked)
-                type = "机身标";
+                type = "栈板标";
             else if (giftBox.Checked)
                 type = "彩盒标";
+            else if (jishen.Checked)
+                type = "机身标";
             else
                 type = "卡通箱标";
 
@@ -197,7 +243,7 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             //打印类型 彩盒或者标签,再次判断是否已装箱,未转号
-            if (giftBox.Checked || fuselagel.Checked)
+            if (giftBox.Checked)
             {
                 mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
                 if (mapB.Rows.Count == 0)
@@ -206,15 +252,50 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
                     return;
                 }
-                //如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
-                if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                ////如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
+                //if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                //{
+                //    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                //    return;
+                //}
+                //判定通过进行打印 
+                //doc = lbl.Documents.Open(PrintLabel.Text);
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "彩盒标", "-1", out errorMessage))
+                {
+                    //按照打印张数打印
+                    OperateResult.AppendText("<<打印成功\n", Color.Green);
+                }
+                else
+                {
+                    OperateResult.AppendText(errorMessage + "\n", Color.Red);
+                }
+                //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
+                ////如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
+                //if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
+                //{
+                //    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                //    //插入数据
+                //    putInfo2MakeDown();
+                //}
+            }else if (jishen.Checked)
+            {
+                mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
+                if (mapB.Rows.Count == 0)
                 {
-                    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                    //无值提示用户序列号错误,不存在或者已经发生转号
+                    OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
                     return;
                 }
+                ////如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
+                //if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                //{
+                //    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                //    return;
+                //}
                 //判定通过进行打印 
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.BarTender1(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "机身标", "-1", out errorMessage))
                 {
                     //按照打印张数打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -225,13 +306,13 @@ namespace UAS_MES_NEW.Make
                 }
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
-                //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
-                if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
-                {
-                    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
-                    //插入数据
-                    putInfo2MakeDown();
-                }
+                ////如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
+                //if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
+                //{
+                //    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                //    //插入数据
+                //    putInfo2MakeDown();
+                //}
             }
             //打印类型为卡通箱标签
             else if (CartonBox.Checked)
@@ -245,7 +326,7 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.BarTender1(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
                 {
                     //判断通过,打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -256,7 +337,38 @@ namespace UAS_MES_NEW.Make
                 }
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
-                //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
+                ////如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
+                //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
+                //{
+                //    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
+                //    //插入MakeDown表
+                //    putInfo2MakeDown();
+                //}
+            }
+            //打印类型为栈板标签
+            else if (fuselagel.Checked)
+            {
+                //select pa_downstatus from package where pa_outboxcode=? 输入值code
+                mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
+                //无值提示用户箱号错误,不存在。
+                if (mapB.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<栈板标号:" + inputValue.Text + "错误,不存在\n", Color.Red);
+                    return;
+                }
+                //doc = lbl.Documents.Open(PrintLabel.Text);
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "栈板标", "-1", out errorMessage))
+                {
+                    //判断通过,打印
+                    OperateResult.AppendText("<<打印成功\n", Color.Green);
+                }
+                else
+                {
+                    OperateResult.AppendText(errorMessage + "\n", Color.Red);
+                }
+                //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板标标签补打印,栈板标号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
+                ////如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
                 //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
                 //{
                 //    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
@@ -305,7 +417,7 @@ namespace UAS_MES_NEW.Make
 
         private void rePrintCheck_KeyDown(object sender, KeyEventArgs e)
         {
-
+          
         }
         /// <summary>
         /// 清除信息
@@ -317,6 +429,7 @@ namespace UAS_MES_NEW.Make
             ms_makecode.Text = "";
             pr_code.Text = "";
             pr_detail.Text = "";
+            TSN = "";
             if (listA != null)
             {
                 listA.Clear();

+ 9 - 9
UAS_MES_HGS/UAS_MES_HGS.csproj

@@ -615,6 +615,12 @@
     <Compile Include="FunctionCode\Make\Make_PreFeedingCollection.Designer.cs">
       <DependentUpon>Make_PreFeedingCollection.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_RePrintLabel.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_RePrintLabel.Designer.cs">
+      <DependentUpon>Make_RePrintLabel.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_SeqTransformPrint.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -807,12 +813,6 @@
     <Compile Include="FunctionCode\Make\Make_Repair.Designer.cs">
       <DependentUpon>Make_Repair.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_RePrintLabel.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_RePrintLabel.Designer.cs">
-      <DependentUpon>Make_RePrintLabel.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_SeqProgramTransform.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1379,6 +1379,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_PreFeedingCollection.resx">
       <DependentUpon>Make_PreFeedingCollection.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_RePrintLabel.resx">
+      <DependentUpon>Make_RePrintLabel.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_SeqTransformPrint.resx">
       <DependentUpon>Make_SeqTransformPrint.cs</DependentUpon>
     </EmbeddedResource>
@@ -1475,9 +1478,6 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_Repair.resx">
       <DependentUpon>Make_Repair.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_RePrintLabel.resx">
-      <DependentUpon>Make_RePrintLabel.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_SeqProgramTransform.resx">
       <DependentUpon>Make_SeqProgramTransform.cs</DependentUpon>
     </EmbeddedResource>