Browse Source

修改提交

callm 6 months ago
parent
commit
b852db104f

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs

@@ -64,7 +64,7 @@
             this.ma_salecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.fileSystemWatcher1 = new System.IO.FileSystemWatcher();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -778,7 +778,7 @@
         private System.Windows.Forms.Label ma_code_label;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ButtonUtil.NormalButton normalButton1;
-        private CustomControl.TextBoxWithIcon.SnCollectionBox outboxcode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox outboxcode;
         private CustomControl.ValueLabel.ValueLabel pr_cartongw;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private System.Windows.Forms.Label pr_cartongw_label;

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_CartonBoxWeighN.Designer.cs

@@ -64,7 +64,7 @@
             this.ma_salecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.fileSystemWatcher1 = new System.IO.FileSystemWatcher();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -82,7 +82,7 @@
             this.weight_label = new System.Windows.Forms.Label();
             this.weight = new System.Windows.Forms.Label();
             this.label122 = new System.Windows.Forms.Label();
-            this.lpn = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.lpn = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -813,7 +813,7 @@
         private System.Windows.Forms.Label ma_code_label;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ButtonUtil.NormalButton normalButton1;
-        private CustomControl.TextBoxWithIcon.SnCollectionBox outboxcode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox outboxcode;
         private CustomControl.ValueLabel.ValueLabel pr_cartongw;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private System.Windows.Forms.Label pr_cartongw_label;
@@ -857,6 +857,6 @@
         private System.Windows.Forms.Label weight_label;
         private System.Windows.Forms.Label weight;
         private System.Windows.Forms.Label label122;
-        private CustomControl.TextBoxWithIcon.SnCollectionBox lpn;
+        private CustomControl.TextBoxWithIcon.EnterTextBox lpn;
     }
 }

+ 26 - 0
UAS-MES/FunctionCode/Special/Special_Reset.Designer.cs

@@ -51,6 +51,8 @@
             this.OperatResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.input = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Split = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.label1 = new System.Windows.Forms.Label();
+            this.remark = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.SuspendLayout();
             // 
             // Pallet_label
@@ -146,6 +148,7 @@
             this.WeighRecord.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnHeader3});
             this.WeighRecord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.WeighRecord.HideSelection = false;
             this.WeighRecord.Location = new System.Drawing.Point(16, 162);
             this.WeighRecord.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.WeighRecord.Name = "WeighRecord";
@@ -194,6 +197,7 @@
             this.oqcBtn.TabIndex = 248;
             this.oqcBtn.Text = "抽检批";
             this.oqcBtn.UseVisualStyleBackColor = true;
+            this.oqcBtn.Visible = false;
             this.oqcBtn.Click += new System.EventHandler(this.bigboxBtn_Click);
             // 
             // excelim
@@ -344,11 +348,31 @@
             this.Split.UseVisualStyleBackColor = false;
             this.Split.Click += new System.EventHandler(this.Split_Click);
             // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(707, 267);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(44, 18);
+            this.label1.TabIndex = 250;
+            this.label1.Text = "备注";
+            // 
+            // remark
+            // 
+            this.remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.remark.Location = new System.Drawing.Point(710, 302);
+            this.remark.Name = "remark";
+            this.remark.Size = new System.Drawing.Size(416, 193);
+            this.remark.TabIndex = 251;
+            this.remark.Text = "";
+            // 
             // Special_Reset
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1208, 870);
+            this.Controls.Add(this.remark);
+            this.Controls.Add(this.label1);
             this.Controls.Add(this.oqcBtn);
             this.Controls.Add(this.excelim);
             this.Controls.Add(this.checkBox1);
@@ -403,5 +427,7 @@
         private CustomControl.ButtonUtil.NormalButton excelim;
         private System.Windows.Forms.OpenFileDialog openFileDialog1;
         private System.Windows.Forms.RadioButton oqcBtn;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.RichText.RichTextAutoBottom remark;
     }
 }

+ 8 - 2
UAS-MES/FunctionCode/Special/Special_Reset.cs

@@ -58,13 +58,14 @@ namespace UAS_MES.Special
             //    dh.ExecuteSql("update makeserial set ms_bs = '',ms_key='',ms_keyid='',MS_HARDWREID='',MS_KEYSTATEID='',MS_BIOS='',ms_ec='',ms_uuid='',MS_KEYPARTNUMBER='',ms_bt='',ms_mac='',ms_imei='' where ms_sncode = '" + sncode + "' and ms_makecode = '" + ms_makecode.Text + "'", "update");
             //}
             dh.ExecuteSql("delete makebad where mb_sncode = '" + sncode + "' and mb_status = 0", "delete");
+            dh.ExecuteSql("delete OQCBATCHDETAIL where obd_sncode = '" + sncode + "' ", "delete");
             dh.ExecuteSql("delete from LABELPRINTLOG where lpl_value = '" + sncode + "'", "delete");
             sql.Clear();
             sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");
             sql.Append("cm_dropdate =sysdate,CM_REMARK = '重置站点拆解',cm_dropstep='" + User.CurrentStepCode + "',");
             sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_sncode = '" + sncode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
             dh.ExecuteSql(sql.GetString(), "update");
-            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname,  sncode, "");
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "重置SN 备注:" + remark.Text + " 站点重置至" + stname,  sncode, "");
         }
 
 
@@ -76,6 +77,11 @@ namespace UAS_MES.Special
                 OperatResult.AppendText(">>采集数与回流工位不能为空\n", Color.Red);
                 return;
             }
+            if (remark.Text == "")
+            {
+                OperatResult.AppendText(">>备注不能为空\n", Color.Red);
+                return;
+            }
             string Delete = MessageBox.Show(this.ParentForm, "是否确认重置站点?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
             if (Delete == "Yes")
             {
@@ -105,7 +111,7 @@ namespace UAS_MES.Special
                        dh.ExecuteSql("delete from LABELPRINTLOG where lpl_value = '" + sb[i].ToString() + "'", "delete");
                         //删除箱的明细
                         dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + sb[i].ToString() + "'", "delete");
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname, sb[i].ToString(), "");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "重置箱 备注:" + remark.Text + " 站点重置至" + stname, sb[i].ToString(), "");
                         String ErrorMessage = "";
                         if (!LogicHandler.resetOutBoxStatus(sb[i].ToString(), out ErrorMessage))
                         {

+ 1 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -143,7 +143,7 @@ namespace UAS_MES.PublicMethod
                     dic = BaseUtil.ToDictionary(Content);
                     if (!dic.ContainsKey("erpaccount"))
                     {
-                        oMsg = dic["code"].ToString();
+                        oMsg = dic["Code"].ToString();
                         //LogManager.DoLog("oMsg:"+ oMsg);
                         if (oMsg.Contains("200"))
                         {

+ 161 - 192
UAS_MES_HGS/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -35,7 +35,7 @@
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.weight_label = new System.Windows.Forms.Label();
             this.panel4 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.weight = new System.Windows.Forms.TextBox();
+            this.weight = new System.Windows.Forms.Label();
             this.label15 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_qty_label = new System.Windows.Forms.Label();
@@ -56,7 +56,6 @@
             this.mcd_remainqty_label = new System.Windows.Forms.Label();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
             this.locksalecode = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -87,6 +86,7 @@
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.Remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.panel4.SuspendLayout();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
@@ -95,10 +95,9 @@
             // 
             this.pr_colorboxgw_label.AutoSize = true;
             this.pr_colorboxgw_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_colorboxgw_label.Location = new System.Drawing.Point(32, 434);
-            this.pr_colorboxgw_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_colorboxgw_label.Location = new System.Drawing.Point(16, 217);
             this.pr_colorboxgw_label.Name = "pr_colorboxgw_label";
-            this.pr_colorboxgw_label.Size = new System.Drawing.Size(183, 52);
+            this.pr_colorboxgw_label.Size = new System.Drawing.Size(92, 27);
             this.pr_colorboxgw_label.TabIndex = 42;
             this.pr_colorboxgw_label.Text = "标准重量";
             // 
@@ -106,10 +105,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(32, 614);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(16, 307);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(183, 52);
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
             this.pr_code_label.TabIndex = 40;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -119,13 +117,11 @@
             this.pr_colorboxunit.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.pr_colorboxunit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pr_colorboxunit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.pr_colorboxunit.Location = new System.Drawing.Point(32, 196);
-            this.pr_colorboxunit.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_colorboxunit.Location = new System.Drawing.Point(287, 36);
             this.pr_colorboxunit.Name = "pr_colorboxunit";
-            this.pr_colorboxunit.Size = new System.Drawing.Size(60, 50);
+            this.pr_colorboxunit.Size = new System.Drawing.Size(50, 25);
             this.pr_colorboxunit.TabIndex = 42;
-            this.pr_colorboxunit.Text = "克";
-            this.pr_colorboxunit.Visible = false;
+            this.pr_colorboxunit.Text = "千克";
             // 
             // weight_label
             // 
@@ -133,13 +129,11 @@
             this.weight_label.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.weight_label.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.weight_label.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.weight_label.Location = new System.Drawing.Point(32, 68);
-            this.weight_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.weight_label.Location = new System.Drawing.Point(16, 34);
             this.weight_label.Name = "weight_label";
-            this.weight_label.Size = new System.Drawing.Size(98, 50);
+            this.weight_label.Size = new System.Drawing.Size(50, 25);
             this.weight_label.TabIndex = 20;
             this.weight_label.Text = "重量";
-            this.weight_label.Visible = false;
             // 
             // panel4
             // 
@@ -148,10 +142,11 @@
             this.panel4.Controls.Add(this.pr_colorboxunit);
             this.panel4.Controls.Add(this.weight_label);
             this.panel4.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.panel4.Location = new System.Drawing.Point(32, 156);
-            this.panel4.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.panel4.Location = new System.Drawing.Point(16, 78);
+            this.panel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(690, 246);
+            this.panel4.Padding = new System.Windows.Forms.Padding(2);
+            this.panel4.Size = new System.Drawing.Size(345, 123);
             this.panel4.TabIndex = 63;
             this.panel4.TabStop = false;
             this.panel4.Text = "重量";
@@ -159,21 +154,21 @@
             // 
             // weight
             // 
-            this.weight.Font = new System.Drawing.Font("微软雅黑", 40F);
-            this.weight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.weight.Location = new System.Drawing.Point(148, 100);
+            this.weight.AutoSize = true;
+            this.weight.Font = new System.Drawing.Font("微软雅黑", 35F);
+            this.weight.ForeColor = System.Drawing.Color.DarkGreen;
+            this.weight.Location = new System.Drawing.Point(72, 24);
             this.weight.Name = "weight";
-            this.weight.Size = new System.Drawing.Size(249, 148);
-            this.weight.TabIndex = 43;
+            this.weight.Size = new System.Drawing.Size(0, 60);
+            this.weight.TabIndex = 181;
             // 
             // label15
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.label15.Location = new System.Drawing.Point(16, 36);
-            this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label15.Location = new System.Drawing.Point(8, 18);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(192, 70);
+            this.label15.Size = new System.Drawing.Size(96, 35);
             this.label15.TabIndex = 56;
             this.label15.Text = "条码号";
             // 
@@ -181,10 +176,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(32, 804);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(16, 402);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(183, 52);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 53;
             this.pr_detail_label.Text = "产品规格";
             // 
@@ -192,10 +186,9 @@
             // 
             this.ma_qty_label.AutoSize = true;
             this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(32, 894);
-            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty_label.Location = new System.Drawing.Point(16, 447);
             this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(183, 52);
+            this.ma_qty_label.Size = new System.Drawing.Size(92, 27);
             this.ma_qty_label.TabIndex = 55;
             this.ma_qty_label.Text = "工单数量";
             // 
@@ -203,10 +196,9 @@
             // 
             this.ma_salecode_label.AutoSize = true;
             this.ma_salecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode_label.Location = new System.Drawing.Point(32, 710);
-            this.ma_salecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_salecode_label.Location = new System.Drawing.Point(16, 355);
             this.ma_salecode_label.Name = "ma_salecode_label";
-            this.ma_salecode_label.Size = new System.Drawing.Size(183, 52);
+            this.ma_salecode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_salecode_label.TabIndex = 54;
             this.ma_salecode_label.Text = "订单编号";
             // 
@@ -214,10 +206,9 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(32, 522);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(16, 261);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(183, 52);
+            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
             this.ms_makecode_label.TabIndex = 72;
             this.ms_makecode_label.Text = "制造单号";
             // 
@@ -225,10 +216,9 @@
             // 
             this.Printer_label.AutoSize = true;
             this.Printer_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Printer_label.Location = new System.Drawing.Point(1540, 172);
-            this.Printer_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.Printer_label.Location = new System.Drawing.Point(770, 86);
             this.Printer_label.Name = "Printer_label";
-            this.Printer_label.Size = new System.Drawing.Size(162, 38);
+            this.Printer_label.Size = new System.Drawing.Size(84, 20);
             this.Printer_label.TabIndex = 162;
             this.Printer_label.Text = "打印机列表";
             // 
@@ -236,10 +226,9 @@
             // 
             this.PrintLabel_label.AutoSize = true;
             this.PrintLabel_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintLabel_label.Location = new System.Drawing.Point(1540, 236);
-            this.PrintLabel_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.PrintLabel_label.Location = new System.Drawing.Point(770, 118);
             this.PrintLabel_label.Name = "PrintLabel_label";
-            this.PrintLabel_label.Size = new System.Drawing.Size(133, 38);
+            this.PrintLabel_label.Size = new System.Drawing.Size(69, 20);
             this.PrintLabel_label.TabIndex = 163;
             this.PrintLabel_label.Text = "打印标签";
             // 
@@ -247,10 +236,9 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1540, 116);
-            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Location = new System.Drawing.Point(770, 58);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(133, 38);
+            this.label1.Size = new System.Drawing.Size(69, 20);
             this.label1.TabIndex = 170;
             this.label1.Text = "打印张数";
             // 
@@ -258,10 +246,9 @@
             // 
             this.BaudRate.AutoSize = true;
             this.BaudRate.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BaudRate.Location = new System.Drawing.Point(1768, 64);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.BaudRate.Location = new System.Drawing.Point(884, 32);
             this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Size = new System.Drawing.Size(150, 38);
+            this.BaudRate.Size = new System.Drawing.Size(78, 20);
             this.BaudRate.TabIndex = 171;
             this.BaudRate.Text = "BaudRate";
             this.BaudRate.Visible = false;
@@ -270,10 +257,9 @@
             // 
             this.ComList.AutoSize = true;
             this.ComList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ComList.Location = new System.Drawing.Point(1768, 12);
-            this.ComList.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ComList.Location = new System.Drawing.Point(884, 6);
             this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(128, 38);
+            this.ComList.Size = new System.Drawing.Size(68, 20);
             this.ComList.TabIndex = 172;
             this.ComList.Text = "ComList";
             this.ComList.Visible = false;
@@ -286,10 +272,10 @@
             this.columnHeader3,
             this.columnHeader4});
             this.WeighRecord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeighRecord.Location = new System.Drawing.Point(754, 436);
-            this.WeighRecord.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.WeighRecord.Location = new System.Drawing.Point(377, 218);
+            this.WeighRecord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.WeighRecord.Name = "WeighRecord";
-            this.WeighRecord.Size = new System.Drawing.Size(758, 664);
+            this.WeighRecord.Size = new System.Drawing.Size(381, 334);
             this.WeighRecord.TabIndex = 173;
             this.WeighRecord.UseCompatibleStateImageBehavior = false;
             this.WeighRecord.View = System.Windows.Forms.View.Details;
@@ -317,10 +303,9 @@
             // pr_sendchecktype
             // 
             this.pr_sendchecktype.AutoSize = true;
-            this.pr_sendchecktype.Location = new System.Drawing.Point(1012, 1124);
-            this.pr_sendchecktype.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_sendchecktype.Location = new System.Drawing.Point(506, 562);
             this.pr_sendchecktype.Name = "pr_sendchecktype";
-            this.pr_sendchecktype.Size = new System.Drawing.Size(0, 24);
+            this.pr_sendchecktype.Size = new System.Drawing.Size(0, 12);
             this.pr_sendchecktype.TabIndex = 1;
             this.pr_sendchecktype.Visible = false;
             // 
@@ -328,10 +313,9 @@
             // 
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty_label.Location = new System.Drawing.Point(32, 986);
-            this.mcd_inqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_inqty_label.Location = new System.Drawing.Point(16, 493);
             this.mcd_inqty_label.Name = "mcd_inqty_label";
-            this.mcd_inqty_label.Size = new System.Drawing.Size(183, 52);
+            this.mcd_inqty_label.Size = new System.Drawing.Size(92, 27);
             this.mcd_inqty_label.TabIndex = 190;
             this.mcd_inqty_label.Text = "已采集数";
             // 
@@ -339,25 +323,21 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(32, 1072);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(16, 536);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(183, 52);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(92, 27);
             this.mcd_remainqty_label.TabIndex = 192;
             this.mcd_remainqty_label.Text = "待采集数";
             // 
             // CollectRemark
             // 
             this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(1544, 348);
-            this.CollectRemark.Margin = new System.Windows.Forms.Padding(6);
+            this.CollectRemark.Location = new System.Drawing.Point(772, 174);
             this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(155, 39);
+            this.CollectRemark.Size = new System.Drawing.Size(84, 24);
             this.CollectRemark.TabIndex = 195;
-            this.CollectRemark.Text = "采集备注";
+            this.CollectRemark.Text = "数据核对";
             this.CollectRemark.UseVisualStyleBackColor = true;
             // 
             // locksalecode
@@ -365,34 +345,22 @@
             this.locksalecode.AutoSize = true;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(820, 1122);
-            this.locksalecode.Margin = new System.Windows.Forms.Padding(6);
+            this.locksalecode.Location = new System.Drawing.Point(410, 561);
             this.locksalecode.Name = "locksalecode";
-            this.locksalecode.Size = new System.Drawing.Size(186, 28);
+            this.locksalecode.Size = new System.Drawing.Size(96, 16);
             this.locksalecode.TabIndex = 204;
             this.locksalecode.Text = "当前订单锁定";
             this.locksalecode.UseVisualStyleBackColor = true;
             // 
-            // Remark
-            // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(1536, 404);
-            this.Remark.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
-            this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(476, 156);
-            this.Remark.TabIndex = 194;
-            this.Remark.Text = "";
-            // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.CutLength = null;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(258, 1072);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(300, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(129, 536);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 52);
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 27);
             this.mcd_remainqty.TabIndex = 193;
             // 
             // mcd_inqty
@@ -400,20 +368,19 @@
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.CutLength = null;
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(258, 986);
-            this.mcd_inqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(300, 0);
+            this.mcd_inqty.Location = new System.Drawing.Point(129, 493);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
             this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 52);
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 27);
             this.mcd_inqty.TabIndex = 191;
             // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(1546, 292);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.StepCount.Location = new System.Drawing.Point(773, 146);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(160, 44);
+            this.StepCount.Size = new System.Drawing.Size(80, 22);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 189;
@@ -425,13 +392,13 @@
             this.RefreshWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.DownImage")));
             this.RefreshWeigh.Image = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.Image")));
             this.RefreshWeigh.IsShowBorder = true;
-            this.RefreshWeigh.Location = new System.Drawing.Point(616, 442);
-            this.RefreshWeigh.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.RefreshWeigh.Location = new System.Drawing.Point(308, 221);
+            this.RefreshWeigh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.RefreshWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.MoveImage")));
             this.RefreshWeigh.Name = "RefreshWeigh";
             this.RefreshWeigh.NormalImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.NormalImage")));
             this.RefreshWeigh.Power = null;
-            this.RefreshWeigh.Size = new System.Drawing.Size(108, 48);
+            this.RefreshWeigh.Size = new System.Drawing.Size(54, 24);
             this.RefreshWeigh.TabIndex = 177;
             this.RefreshWeigh.Text = "刷新重量";
             this.RefreshWeigh.UseVisualStyleBackColor = true;
@@ -443,11 +410,11 @@
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(1756, 116);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.PrintNum.Location = new System.Drawing.Point(878, 58);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(152, 35);
+            this.PrintNum.Size = new System.Drawing.Size(78, 21);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
@@ -464,11 +431,11 @@
             this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty_label);
             this.groupBoxWithBorder2.Controls.Add(this.SendCheck);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(754, 156);
-            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(4);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(377, 78);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
-            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(4);
-            this.groupBoxWithBorder2.Size = new System.Drawing.Size(760, 244);
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(380, 122);
             this.groupBoxWithBorder2.TabIndex = 175;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.Text = "送检信息";
@@ -478,10 +445,9 @@
             // 
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno_label.Location = new System.Drawing.Point(48, 154);
-            this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_checkno_label.Location = new System.Drawing.Point(24, 78);
             this.ob_checkno_label.Name = "ob_checkno_label";
-            this.ob_checkno_label.Size = new System.Drawing.Size(160, 46);
+            this.ob_checkno_label.Size = new System.Drawing.Size(82, 24);
             this.ob_checkno_label.TabIndex = 180;
             this.ob_checkno_label.Text = "当前批号";
             // 
@@ -489,10 +455,9 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno.Location = new System.Drawing.Point(236, 154);
-            this.ob_checkno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_checkno.Location = new System.Drawing.Point(118, 78);
             this.ob_checkno.Name = "ob_checkno";
-            this.ob_checkno.Size = new System.Drawing.Size(0, 46);
+            this.ob_checkno.Size = new System.Drawing.Size(0, 24);
             this.ob_checkno.TabIndex = 179;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
@@ -500,30 +465,27 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(586, 62);
-            this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(294, 32);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
-            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 46);
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 24);
             this.ob_nowcheckqty.TabIndex = 178;
             // 
             // ob_batchqty
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty.Location = new System.Drawing.Point(236, 62);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_batchqty.Location = new System.Drawing.Point(118, 32);
             this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Size = new System.Drawing.Size(0, 46);
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 24);
             this.ob_batchqty.TabIndex = 177;
             // 
             // ob_nowcheckqty_label
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(398, 62);
-            this.ob_nowcheckqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(200, 32);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
-            this.ob_nowcheckqty_label.Size = new System.Drawing.Size(160, 46);
+            this.ob_nowcheckqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_nowcheckqty_label.TabIndex = 176;
             this.ob_nowcheckqty_label.Text = "当前批数";
             // 
@@ -531,10 +493,9 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty_label.Location = new System.Drawing.Point(48, 62);
-            this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(24, 32);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
-            this.ob_batchqty_label.Size = new System.Drawing.Size(160, 46);
+            this.ob_batchqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_batchqty_label.TabIndex = 175;
             this.ob_batchqty_label.Text = "标准批数";
             // 
@@ -547,13 +508,13 @@
             this.SendCheck.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.SendCheck.Image = null;
             this.SendCheck.IsShowBorder = true;
-            this.SendCheck.Location = new System.Drawing.Point(580, 172);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.SendCheck.Location = new System.Drawing.Point(290, 86);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
             this.SendCheck.Name = "SendCheck";
             this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
             this.SendCheck.Power = null;
-            this.SendCheck.Size = new System.Drawing.Size(90, 48);
+            this.SendCheck.Size = new System.Drawing.Size(45, 24);
             this.SendCheck.TabIndex = 174;
             this.SendCheck.Tag = "ifread";
             this.SendCheck.Text = "送检";
@@ -565,21 +526,20 @@
             this.pr_colorboxgw.AutoSize = true;
             this.pr_colorboxgw.CutLength = null;
             this.pr_colorboxgw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_colorboxgw.Location = new System.Drawing.Point(258, 434);
-            this.pr_colorboxgw.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_colorboxgw.MaximumSize = new System.Drawing.Size(300, 0);
+            this.pr_colorboxgw.Location = new System.Drawing.Point(129, 217);
+            this.pr_colorboxgw.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_colorboxgw.Name = "pr_colorboxgw";
-            this.pr_colorboxgw.Size = new System.Drawing.Size(0, 52);
+            this.pr_colorboxgw.Size = new System.Drawing.Size(0, 27);
             this.pr_colorboxgw.TabIndex = 80;
             this.pr_colorboxgw.Tag = "1";
             // 
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(1548, 44);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4);
+            this.AutoPrint.Location = new System.Drawing.Point(774, 22);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(210, 44);
+            this.AutoPrint.Size = new System.Drawing.Size(105, 22);
             this.AutoPrint.TabIndex = 174;
             // 
             // pr_code
@@ -587,31 +547,30 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(256, 614);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_code.MaximumSize = new System.Drawing.Size(300, 0);
+            this.pr_code.Location = new System.Drawing.Point(128, 307);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 52);
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
             this.pr_code.TabIndex = 79;
             this.pr_code.Tag = "1";
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(1756, 172);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(8);
+            this.PrinterList.Location = new System.Drawing.Point(878, 86);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(236, 40);
+            this.PrinterList.Size = new System.Drawing.Size(118, 20);
             this.PrinterList.TabIndex = 160;
             // 
             // PrintLabel
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1756, 236);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.PrintLabel.Location = new System.Drawing.Point(878, 118);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(236, 32);
+            this.PrintLabel.Size = new System.Drawing.Size(120, 20);
             this.PrintLabel.TabIndex = 159;
             this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             // 
@@ -622,13 +581,13 @@
             this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
             this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
             this.StopWeight.IsShowBorder = true;
-            this.StopWeight.Location = new System.Drawing.Point(1362, 48);
-            this.StopWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.StopWeight.Location = new System.Drawing.Point(681, 24);
+            this.StopWeight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
             this.StopWeight.Name = "StopWeight";
             this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
             this.StopWeight.Power = null;
-            this.StopWeight.Size = new System.Drawing.Size(108, 48);
+            this.StopWeight.Size = new System.Drawing.Size(54, 24);
             this.StopWeight.TabIndex = 158;
             this.StopWeight.Text = "停止称量";
             this.StopWeight.UseVisualStyleBackColor = true;
@@ -641,13 +600,13 @@
             this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
             this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
             this.StartWeight.IsShowBorder = true;
-            this.StartWeight.Location = new System.Drawing.Point(1204, 48);
-            this.StartWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.StartWeight.Location = new System.Drawing.Point(602, 24);
+            this.StartWeight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
             this.StartWeight.Name = "StartWeight";
             this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
             this.StartWeight.Power = null;
-            this.StartWeight.Size = new System.Drawing.Size(108, 48);
+            this.StartWeight.Size = new System.Drawing.Size(54, 24);
             this.StartWeight.TabIndex = 157;
             this.StartWeight.Text = "开始称量";
             this.StartWeight.UseVisualStyleBackColor = true;
@@ -660,13 +619,13 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(1756, 292);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.Confirm.Location = new System.Drawing.Point(878, 146);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(100, 48);
+            this.Confirm.Size = new System.Drawing.Size(50, 24);
             this.Confirm.TabIndex = 152;
             this.Confirm.Text = "打印";
             this.Confirm.UseVisualStyleBackColor = true;
@@ -677,11 +636,10 @@
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(256, 894);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ma_qty.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ma_qty.Location = new System.Drawing.Point(128, 447);
+            this.ma_qty.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 52);
+            this.ma_qty.Size = new System.Drawing.Size(0, 27);
             this.ma_qty.TabIndex = 76;
             // 
             // pr_spec
@@ -689,11 +647,10 @@
             this.pr_spec.AutoSize = true;
             this.pr_spec.CutLength = null;
             this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_spec.Location = new System.Drawing.Point(256, 804);
-            this.pr_spec.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_spec.MaximumSize = new System.Drawing.Size(300, 0);
+            this.pr_spec.Location = new System.Drawing.Point(128, 402);
+            this.pr_spec.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Size = new System.Drawing.Size(0, 52);
+            this.pr_spec.Size = new System.Drawing.Size(0, 27);
             this.pr_spec.TabIndex = 75;
             // 
             // ma_salecode
@@ -701,11 +658,10 @@
             this.ma_salecode.AutoSize = true;
             this.ma_salecode.CutLength = null;
             this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode.Location = new System.Drawing.Point(256, 710);
-            this.ma_salecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ma_salecode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ma_salecode.Location = new System.Drawing.Point(128, 355);
+            this.ma_salecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_salecode.Name = "ma_salecode";
-            this.ma_salecode.Size = new System.Drawing.Size(0, 52);
+            this.ma_salecode.Size = new System.Drawing.Size(0, 27);
             this.ma_salecode.TabIndex = 75;
             // 
             // Clean
@@ -715,13 +671,13 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1716, 1116);
-            this.Clean.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.Clean.Location = new System.Drawing.Point(858, 558);
+            this.Clean.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(120, 48);
+            this.Clean.Size = new System.Drawing.Size(60, 24);
             this.Clean.TabIndex = 60;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -734,8 +690,8 @@
             this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
             this.normalButton1.Image = ((System.Drawing.Image)(resources.GetObject("normalButton1.Image")));
             this.normalButton1.IsShowBorder = true;
-            this.normalButton1.Location = new System.Drawing.Point(42, 108);
-            this.normalButton1.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.normalButton1.Location = new System.Drawing.Point(21, 54);
+            this.normalButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
             this.normalButton1.Name = "normalButton1";
             this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
@@ -751,11 +707,11 @@
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(220, 36);
-            this.sncode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.sncode.Location = new System.Drawing.Point(110, 18);
+            this.sncode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.sncode.Name = "sncode";
             this.sncode.Power = "";
-            this.sncode.Size = new System.Drawing.Size(934, 71);
+            this.sncode.Size = new System.Drawing.Size(469, 39);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -765,10 +721,10 @@
             // 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(1536, 578);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.OperateResult.Location = new System.Drawing.Point(768, 289);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(476, 518);
+            this.OperateResult.Size = new System.Drawing.Size(240, 261);
             this.OperateResult.TabIndex = 58;
             this.OperateResult.Text = "";
             // 
@@ -777,10 +733,9 @@
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
-            this.LockMakeCode.Location = new System.Drawing.Point(560, 536);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(6);
+            this.LockMakeCode.Location = new System.Drawing.Point(280, 268);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(94, 35);
+            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 206;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -792,28 +747,42 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(228, 534);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Location = new System.Drawing.Point(114, 267);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(298, 42);
+            this.ma_code.Size = new System.Drawing.Size(149, 21);
             this.ma_code.TabIndex = 205;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
             // 
+            // Remark
+            // 
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(774, 217);
+            this.Remark.Name = "Remark";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(241, 21);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 207;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            // 
             // Make_ColorBoxWeigh
             // 
-            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(2026, 1168);
+            this.ClientSize = new System.Drawing.Size(1027, 594);
+            this.Controls.Add(this.Remark);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.locksalecode);
             this.Controls.Add(this.CollectRemark);
-            this.Controls.Add(this.Remark);
             this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_remainqty_label);
             this.Controls.Add(this.mcd_inqty);
@@ -853,18 +822,18 @@
             this.Controls.Add(this.ma_salecode_label);
             this.Controls.Add(this.OperateResult);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Make_ColorBoxWeigh";
             this.Tag = "Make!ColorBoxWeigh";
             this.Text = "彩盒称重";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
             this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
-            this.panel4.ResumeLayout(true);
+            this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.ResumeLayout(false);
             this.groupBoxWithBorder2.PerformLayout();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -920,12 +889,12 @@
         private System.Windows.Forms.Label mcd_inqty_label;
         private CustomControl.ValueLabel.ValueLabel mcd_remainqty;
         private System.Windows.Forms.Label mcd_remainqty_label;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
         private System.Windows.Forms.CheckBox CollectRemark;
         private System.Windows.Forms.CheckBox locksalecode;
         public System.Windows.Forms.Label ob_checkno;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
-        private System.Windows.Forms.TextBox weight;
+        private System.Windows.Forms.Label weight;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
     }
 }

+ 131 - 51
UAS_MES_HGS/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -14,8 +14,6 @@ using UAS_MES_NEW.PublicForm;
 using System.Net.Sockets;
 using System.Collections.Generic;
 using System.Net;
-using Seagull.BarTender.Print;
-
 
 namespace UAS_MES_NEW.Make
 {
@@ -30,7 +28,7 @@ namespace UAS_MES_NEW.Make
         Thread thread;
         SerialPort serialPort1 = new SerialPort();
         //称量的标准重量
-        Double Weight;
+        Double Weight1;
         //最大重量
         Double MaxWeight;
         //最小重量
@@ -46,6 +44,7 @@ namespace UAS_MES_NEW.Make
         string ErrorMessage;
 
         Thread InitPrint;
+        BarTender.Application engine;
 
         private bool AutoCut;
 
@@ -104,7 +103,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine(true);
+                lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
             catch (Exception)
@@ -121,7 +120,7 @@ namespace UAS_MES_NEW.Make
                 {
                     string oMakeCode = "";
                     string oMsID = "";
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
                         //if (nextstepcode != User.CurrentStepCode)
@@ -146,7 +145,7 @@ namespace UAS_MES_NEW.Make
                             string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
                             string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
                             //赋值重量单位
-                            Weight = double.Parse(_weight == "" ? "0" : _weight);
+                            Weight1 = double.Parse(_weight == "" ? "0" : _weight);
                             MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                             MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                             if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
@@ -156,13 +155,22 @@ namespace UAS_MES_NEW.Make
                             }
                             ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
                             BaseUtil.SetFormValue(this.Controls, dt);
-                            if (Weight - MinWeight == MaxWeight - Weight)
-                                pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                            if (Weight1 - MinWeight == MaxWeight - Weight1)
+                                pr_colorboxgw.Text = Weight1 + "±" + (MaxWeight - Weight1) + dt.Rows[0]["pr_colorboxunit"].ToString();
                             else
                                 pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
 
                             //重量信息若需要检测则必须符合检测要求才更新
                             double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim());
+
+                            if (CollectRemark.Checked && (Remark.Text == ""|| Remark.Text.Trim()!= sncode.Text))
+                            {
+                                OperateResult.AppendText(">>标签核对,SN与录入信息不一致\n", Color.Red);
+                                Remark.Focus();
+                                Remark.SelectAll();
+                                return;
+                            }
+
                             if (PR_CHECKCOLORBOXW != "0")
                             {
                                 if (MinWeight == 0 || MaxWeight == 0)
@@ -199,7 +207,6 @@ namespace UAS_MES_NEW.Make
                             lsi.SubItems.Add(ActualWeight.ToString());
                             lsi.SubItems.Add(System.DateTime.Now.ToString());
                             WeighRecord.Items.Add(lsi);
-                            WeighRecord.Items[this.WeighRecord.Items.Count - 1].EnsureVisible();
                             OperateResult.AppendText(">>彩盒" + sncode.Text + "称重完成\n", Color.Green);
                             //显示最近的三个称量记录
                             if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
@@ -217,12 +224,13 @@ namespace UAS_MES_NEW.Make
                                 }
                             }
                             else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                            if (CollectRemark.Checked && Remark.Text != "")
-                            {
-                                LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
-                            }
                             LoadCollectedNum();
                             sncode.Clear();
+                            Remark.Clear();
+                            if (CollectRemark.Checked)
+                                Remark.Focus();
+                            else
+                                sncode.Focus();
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
@@ -234,6 +242,31 @@ namespace UAS_MES_NEW.Make
 
         private void getSerialData()
         {
+            //if (serialPort1.IsOpen)
+            //{
+            //    if (!SystemInf.OpenPort.Contains(serialPort1.PortName))
+            //    {
+            //        SystemInf.OpenPort.Add(serialPort1.PortName);
+            //        try
+            //        {
+            //            while (GetData)
+            //            {
+            //                try
+            //                {
+            //                    weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+            //                }
+            //                catch (Exception)
+            //                {
+            //                    GetData = false;
+            //                }
+            //            }
+            //        }
+            //        catch (IOException ex) { MessageBox.Show(ex.Message); }
+            //    }
+            //    else OperateResult.AppendText(">>端口已被占用,请关闭其他窗口\n", Color.Red);
+            //}
+
+
             if (serialPort1.IsOpen)
             {
                 if (!SystemInf.OpenPort.Contains(serialPort1.PortName))
@@ -245,7 +278,25 @@ namespace UAS_MES_NEW.Make
                         {
                             try
                             {
-                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                Thread.Sleep(100);
+                                int len = serialPort1.BytesToRead;
+                                Byte[] readBuffer = new Byte[len];
+                                serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
+                                string weigh = Encoding.Default.GetString(readBuffer);
+                                if (weigh != "" && weigh.Length > 10)
+                                {
+                                    int firstIndex = weigh.IndexOf("="); // 查找第一个"="的索引  
+                                    int secondIndex = weigh.IndexOf("=", firstIndex + 1); // 查找第二个"="的索引  
+                                    string result = weigh.Substring(firstIndex + 1, secondIndex - firstIndex - 1);// 提取第一个"="和第二个"="之间的字符
+                                    result = new string(result.ToCharArray().Reverse().ToArray());
+                                    int index = 0;
+                                    while (index < result.Length && result[index] == '0')
+                                    {
+                                        index++;
+                                    }
+                                    result = result.Substring(index);
+                                    weight.Text = result;
+                                }
                             }
                             catch (Exception)
                             {
@@ -255,7 +306,8 @@ namespace UAS_MES_NEW.Make
                     }
                     catch (IOException ex) { MessageBox.Show(ex.Message); }
                 }
-                else OperateResult.AppendText(">>端口已被占用,请关闭其他窗口\n", Color.Red);
+                else
+                    MessageBox.Show("端口已被占用,请关闭其他窗口");
             }
         }
 
@@ -292,6 +344,9 @@ namespace UAS_MES_NEW.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
             //thread.Abort();
         }
         Engine engine;
@@ -300,9 +355,9 @@ namespace UAS_MES_NEW.Make
             if (PrintLabel.Items.Count != 0)
             {
                 string oErrorMessage;
-                if (!Print.BarTender1(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
                 {
-                    OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
+                    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                 }
             }
             else
@@ -317,29 +372,47 @@ namespace UAS_MES_NEW.Make
 
         private void StartWeight_Click(object sender, EventArgs e)
         {
+            //try
+            //{
+            //    //定义一个套接字用于监听客户端发来的信息  包含3个参数(IP4寻址协议,流式连接,TCP协议)
+            //    socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+            //    //服务端发送信息 需要1个IP地址和端口号
+            //    IPAddress ipaddress = IPAddress.Parse("192.168.1.4");
+            //    //将IP地址和端口号绑定到网络节点endpoint上 
+            //    IPEndPoint endpoint = new IPEndPoint(ipaddress, int.Parse("2000"));
+            //    //监听绑定的网络节点
+            //    socketWatch.Bind(endpoint);
+            //    //将套接字的监听队列长度限制为20
+            //    socketWatch.Listen(20);
+            //    //创建一个监听线程 
+            //    threadWatch = new Thread(WatchConnecting);
+            //    //将窗体线程设置为与后台同步
+            //    threadWatch.IsBackground = true;
+            //    //启动线程
+            //    threadWatch.Start();
+            //}
+            //catch (Exception ex)
+            //{
+            //    MessageBox.Show(ex.Message);
+            //}
+
+            thread = new Thread(getSerialData);
             try
             {
-                //定义一个套接字用于监听客户端发来的信息  包含3个参数(IP4寻址协议,流式连接,TCP协议)
-                socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                //服务端发送信息 需要1个IP地址和端口号
-                IPAddress ipaddress = IPAddress.Parse("192.168.1.4");
-                //将IP地址和端口号绑定到网络节点endpoint上 
-                IPEndPoint endpoint = new IPEndPoint(ipaddress, int.Parse("2000"));
-                //监听绑定的网络节点
-                socketWatch.Bind(endpoint);
-                //将套接字的监听队列长度限制为20
-                socketWatch.Listen(20);
-                //创建一个监听线程 
-                threadWatch = new Thread(WatchConnecting);
-                //将窗体线程设置为与后台同步
-                threadWatch.IsBackground = true;
-                //启动线程
-                threadWatch.Start();
+                serialPort1.PortName = ComList.Text;
+                serialPort1.BaudRate = int.Parse(BaudRate.Text);
+                serialPort1.Open();
+                GetData = true;
+                thread.Start();
             }
-            catch (Exception ex)
+            catch (Exception mes)
             {
-                MessageBox.Show(ex.Message);
+                if (BaudRate.Text == "" || ComList.Text == "")
+                    OperateResult.AppendText(">>请先在电子秤调试界面维护波特率和串口\n", Color.Red);
+                else
+                    OperateResult.AppendText(">>" + mes.Message + "\n", Color.Red);
             }
+
         }
 
         private void WatchConnecting()
@@ -360,11 +433,9 @@ namespace UAS_MES_NEW.Make
                     byteTemp[0] = Convert.ToByte("00", 16);
                     for (int i = 0; i < 10; i++)
                     {
-                        if (i >= 4) {
-                            if (data[i].ToString() == "0")
-                                continue;
-                            arr.Add(data[i]);
-                        }
+                        if (data[i].ToString() == "0")
+                            continue;
+                        arr.Add(data[i]);
                     }
                     for (int i = 0; i < arr.Count; i++)
                     {
@@ -401,14 +472,14 @@ namespace UAS_MES_NEW.Make
 
         private void StopWeight_Click(object sender, EventArgs e)
         {
-            socketWatch.Close();
-            //if (serialPort1.IsOpen)
-            //{
-            //    GetData = false;
-            //    serialPort1.Close();
-            //    SystemInf.OpenPort.Remove(serialPort1.PortName);
-            //    thread.Abort();
-            //}
+          //  socketWatch.Close();
+            if (serialPort1.IsOpen)
+            {
+                GetData = false;
+                serialPort1.Close();
+                SystemInf.OpenPort.Remove(serialPort1.PortName);
+                thread.Abort();
+            }
         }
 
         private void pr_code_TextChanged(object sender, EventArgs e)
@@ -526,11 +597,11 @@ namespace UAS_MES_NEW.Make
                 string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
                 string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
                 //赋值重量单位
-                Weight = double.Parse(_weight == "" ? "0" : _weight);
+                Weight1 = double.Parse(_weight == "" ? "0" : _weight);
                 MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                 MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                if (Weight - MinWeight == MaxWeight - Weight)
-                    pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                if (Weight1 - MinWeight == MaxWeight - Weight1)
+                    pr_colorboxgw.Text = Weight1 + "±" + (MaxWeight - Weight1) + dt.Rows[0]["pr_colorboxunit"].ToString();
                 else
                     pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
             }
@@ -541,5 +612,14 @@ namespace UAS_MES_NEW.Make
             dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                sncode.Focus();
+                sncode.SelectAll();
+            }
+        }
     }
 }

+ 15 - 9
UAS_MES_HGS/FunctionCode/Make/Make_FeedingCollection.cs

@@ -144,6 +144,9 @@ namespace UAS_MES_NEW.Make
                             if (RemainIndex >= RemainList.Length)
                             {
                                 OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
+                                SetCheck set = new SetCheck("NG", Color.Red);
+                                BaseUtil.SetFormCenter(set);
+                                set.ShowDialog();
                                 sn_code.Text = "";
                                 code.Text = "";
                                 return;
@@ -407,15 +410,18 @@ namespace UAS_MES_NEW.Make
             else
             {
                 OperateResult.AppendText(">>序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
-                if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                else
-                {
-                    //提示正确返回时传递的信息
-                    if (ErrorMessage.Contains("AFTERSUCCESS"))
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                }
+                SetCheck set = new SetCheck("NG", Color.Red);
+                BaseUtil.SetFormCenter(set);
+                set.ShowDialog();
+                //if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
+                //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                //else
+                //{
+                //    //提示正确返回时传递的信息
+                //    if (ErrorMessage.Contains("AFTERSUCCESS"))
+                //        OperateResult.AppendText(">>" + ErrorMessage + "\n");
+                //    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                //}
                 code.Text = "";
                 sn_code.Text = "";
             }

+ 75 - 76
UAS_MES_HGS/FunctionCode/Make/Make_FuselageLabelPrint.Designer.cs

@@ -58,10 +58,10 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(1398, 38);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Location = new System.Drawing.Point(1048, 28);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(114, 41);
+            this.label2.Size = new System.Drawing.Size(86, 31);
             this.label2.TabIndex = 180;
             this.label2.Text = "打印机";
             // 
@@ -69,10 +69,10 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1422, 216);
-            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Location = new System.Drawing.Point(1066, 162);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.Size = new System.Drawing.Size(62, 31);
             this.label1.TabIndex = 179;
             this.label1.Text = "标签";
             // 
@@ -80,10 +80,10 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(931, 42);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(698, 32);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 171;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -93,10 +93,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(24, 830);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.sncode_label.Location = new System.Drawing.Point(18, 622);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(114, 41);
+            this.sncode_label.Size = new System.Drawing.Size(86, 31);
             this.sncode_label.TabIndex = 170;
             this.sncode_label.Text = "序列号";
             // 
@@ -104,10 +104,10 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(1366, 138);
-            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Location = new System.Drawing.Point(1024, 104);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(146, 41);
+            this.label4.Size = new System.Drawing.Size(110, 31);
             this.label4.TabIndex = 167;
             this.label4.Text = "打印张数";
             // 
@@ -115,10 +115,10 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(493, 136);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(370, 102);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(114, 41);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(86, 31);
             this.mcd_remainqty_label.TabIndex = 166;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -126,10 +126,10 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(24, 136);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(18, 102);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(146, 41);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(110, 31);
             this.mcd_okqty_label.TabIndex = 165;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -137,10 +137,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(493, 42);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(370, 32);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_code_label.Size = new System.Drawing.Size(110, 31);
             this.pr_code_label.TabIndex = 164;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -148,36 +148,35 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(25, 42);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(19, 32);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_makecode_label.Size = new System.Drawing.Size(110, 31);
             this.ms_makecode_label.TabIndex = 163;
             this.ms_makecode_label.Text = "工单编号";
             // 
             // CollectRemark
             // 
             this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(1437, 315);
-            this.CollectRemark.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.CollectRemark.Location = new System.Drawing.Point(1078, 236);
+            this.CollectRemark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(155, 39);
+            this.CollectRemark.Size = new System.Drawing.Size(118, 31);
             this.CollectRemark.TabIndex = 197;
             this.CollectRemark.Text = "采集备注";
             this.CollectRemark.UseVisualStyleBackColor = true;
+            this.CollectRemark.Visible = false;
             // 
             // LockMakeCode
             // 
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
-            this.LockMakeCode.Location = new System.Drawing.Point(392, 48);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(6);
+            this.LockMakeCode.Location = new System.Drawing.Point(294, 36);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(94, 35);
+            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
             this.LockMakeCode.TabIndex = 199;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -189,14 +188,14 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(177, 46);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Location = new System.Drawing.Point(133, 34);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(203, 42);
+            this.ma_code.Size = new System.Drawing.Size(152, 32);
             this.ma_code.TabIndex = 198;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
@@ -204,20 +203,20 @@
             // Remark
             // 
             this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(1430, 370);
-            this.Remark.Margin = new System.Windows.Forms.Padding(6, 3, 6, 3);
+            this.Remark.Location = new System.Drawing.Point(1072, 278);
+            this.Remark.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(378, 156);
+            this.Remark.Size = new System.Drawing.Size(284, 118);
             this.Remark.TabIndex = 196;
             this.Remark.Text = "";
             // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(931, 136);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StepCount.Location = new System.Drawing.Point(698, 102);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(176, 45);
+            this.StepCount.Size = new System.Drawing.Size(132, 34);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 183;
@@ -226,29 +225,29 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1534, 216);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(1150, 162);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(200, 32);
+            this.PrintLabel.Size = new System.Drawing.Size(151, 26);
             this.PrintLabel.TabIndex = 181;
             this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1526, 38);
-            this.Printer.Margin = new System.Windows.Forms.Padding(8);
+            this.Printer.Location = new System.Drawing.Point(1144, 28);
+            this.Printer.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(212, 50);
+            this.Printer.Size = new System.Drawing.Size(159, 38);
             this.Printer.TabIndex = 178;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(617, 136);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(463, 102);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(37, 41);
+            this.mcd_remainqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_remainqty.TabIndex = 177;
             this.mcd_remainqty.Text = "0";
             // 
@@ -256,10 +255,10 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(170, 136);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(128, 102);
+            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(37, 41);
+            this.mcd_okqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_okqty.TabIndex = 176;
             this.mcd_okqty.Text = "0";
             // 
@@ -268,11 +267,11 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(639, 42);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(266, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(479, 32);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 31);
             this.ma_prodcode.TabIndex = 175;
             this.ma_prodcode.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -281,11 +280,11 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(1089, 42);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(266, 0);
+            this.pr_detail.Location = new System.Drawing.Point(817, 32);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 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, 31);
             this.pr_detail.TabIndex = 174;
             // 
             // PrintNum
@@ -295,12 +294,12 @@
             this.PrintNum.Enabled = false;
             this.PrintNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(1534, 131);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(6);
+            this.PrintNum.Location = new System.Drawing.Point(1150, 98);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(200, 39);
+            this.PrintNum.Size = new System.Drawing.Size(151, 31);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
@@ -314,11 +313,11 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(190, 830);
-            this.sncode.Margin = new System.Windows.Forms.Padding(6);
+            this.sncode.Location = new System.Drawing.Point(142, 622);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(388, 35);
+            this.sncode.Size = new System.Drawing.Size(292, 28);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -329,18 +328,18 @@
             // 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(1, 204);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperateResult.Location = new System.Drawing.Point(1, 153);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1360, 580);
+            this.OperateResult.Size = new System.Drawing.Size(1021, 436);
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
             // Make_FuselageLabelPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1828, 896);
+            this.ClientSize = new System.Drawing.Size(1371, 672);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.CollectRemark);
@@ -365,7 +364,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Make_FuselageLabelPrint";
             this.Tag = "Make!FuselageLabelPrint";
             this.Text = "Make_FuselageLabelPrint";

+ 14 - 7
UAS_MES_HGS/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -10,6 +10,7 @@ using LabelManager2;
 using System.IO;
 using System.Threading;
 using UAS_MES_NEW.PublicForm;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
@@ -30,6 +31,8 @@ namespace UAS_MES_NEW.Make
 
         ApplicationClass lbl;
 
+        BarTender.Application engine;
+
         string oMakeCode = "";
         string oMsId = "";
 
@@ -94,12 +97,13 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new BarTender.Application();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装打印软件\n", Color.Red);
             }
         }
 
@@ -129,8 +133,8 @@ namespace UAS_MES_NEW.Make
                             //获取工单的其他信息
                             sql.Clear();
                             sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode,pr_detail,nvl(ma_unlimitin,0)ma_unlimitin,");
-                            sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
-                            sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                            sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail_view on ");
+                            sql.Append("mcd_macode=ma_code left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                             mapB = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             //如果有数据的话
                             if (mapB.Rows.Count > 0)
@@ -179,7 +183,7 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
                             //按照打印张数打印
                             //doc = lbl.Documents.Open(PrintLabel.Text);
-                            if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
+                            if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
                             {
                                 //提示用户打印成功
                                 OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
@@ -204,7 +208,7 @@ namespace UAS_MES_NEW.Make
                                 sncode.Text = "";
                                 sncode.Focus();
                                 //刷新打印数量和剩余数量
-                                dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,nvl(ma_unlimitin,0)ma_unlimitin from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+                                dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,nvl(ma_unlimitin,0)ma_unlimitin from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
                                 BaseUtil.SetFormValue(Controls, dt);
                                 mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
                                 //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
@@ -264,6 +268,9 @@ namespace UAS_MES_NEW.Make
         private void Make_FuselageLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Make_FuselageLabelPrint_SizeChanged(object sender, EventArgs e)

+ 89 - 116
UAS_MES_HGS/FunctionCode/Make/Make_GetReMakeSN.Designer.cs

@@ -45,6 +45,7 @@
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_qty_label = new System.Windows.Forms.Label();
             this.groupBoxWithBorder2 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label2 = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.PrintLabel_label = new System.Windows.Forms.Label();
@@ -57,7 +58,6 @@
             this.ReWorkAsCurrentSN = new System.Windows.Forms.RadioButton();
             this.label1 = new System.Windows.Forms.Label();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.groupBoxWithBorder1.SuspendLayout();
             this.groupBoxWithBorder2.SuspendLayout();
             this.groupBoxWithBorder3.SuspendLayout();
@@ -82,11 +82,9 @@
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
             this.groupBoxWithBorder1.Controls.Add(this.ma_qty_label);
             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(9, 10);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(14, 15);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(818, 146);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1227, 219);
             this.groupBoxWithBorder1.TabIndex = 0;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "工单信息";
@@ -96,11 +94,10 @@
             // 
             this.ma_id.AutoSize = true;
             this.ma_id.CutLength = null;
-            this.ma_id.Location = new System.Drawing.Point(592, 110);
-            this.ma_id.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.ma_id.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_id.Location = new System.Drawing.Point(886, 164);
+            this.ma_id.MaximumSize = new System.Drawing.Size(225, 0);
             this.ma_id.Name = "ma_id";
-            this.ma_id.Size = new System.Drawing.Size(0, 21);
+            this.ma_id.Size = new System.Drawing.Size(0, 31);
             this.ma_id.TabIndex = 16;
             this.ma_id.Visible = false;
             // 
@@ -108,36 +105,35 @@
             // 
             this.ma_craftcode.AutoSize = true;
             this.ma_craftcode.CutLength = null;
-            this.ma_craftcode.Location = new System.Drawing.Point(537, 110);
-            this.ma_craftcode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.ma_craftcode.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_craftcode.Location = new System.Drawing.Point(804, 164);
+            this.ma_craftcode.MaximumSize = new System.Drawing.Size(225, 0);
             this.ma_craftcode.Name = "ma_craftcode";
-            this.ma_craftcode.Size = new System.Drawing.Size(0, 21);
+            this.ma_craftcode.Size = new System.Drawing.Size(0, 31);
             this.ma_craftcode.TabIndex = 15;
             this.ma_craftcode.Visible = false;
             // 
             // ma_saveimei
             // 
+            this.ma_saveimei.AllPower = null;
             this.ma_saveimei.AutoSize = true;
             this.ma_saveimei.Enabled = false;
-            this.ma_saveimei.Location = new System.Drawing.Point(311, 108);
-            this.ma_saveimei.Margin = new System.Windows.Forms.Padding(2);
+            this.ma_saveimei.Location = new System.Drawing.Point(465, 160);
             this.ma_saveimei.Name = "ma_saveimei";
             this.ma_saveimei.Power = null;
-            this.ma_saveimei.Size = new System.Drawing.Size(199, 25);
+            this.ma_saveimei.Size = new System.Drawing.Size(292, 35);
             this.ma_saveimei.TabIndex = 14;
             this.ma_saveimei.Text = "保留原有IMEI/网标信息";
             this.ma_saveimei.UseVisualStyleBackColor = true;
             // 
             // ma_savemacbt
             // 
+            this.ma_savemacbt.AllPower = null;
             this.ma_savemacbt.AutoSize = true;
             this.ma_savemacbt.Enabled = false;
-            this.ma_savemacbt.Location = new System.Drawing.Point(29, 108);
-            this.ma_savemacbt.Margin = new System.Windows.Forms.Padding(2);
+            this.ma_savemacbt.Location = new System.Drawing.Point(42, 160);
             this.ma_savemacbt.Name = "ma_savemacbt";
             this.ma_savemacbt.Power = null;
-            this.ma_savemacbt.Size = new System.Drawing.Size(189, 25);
+            this.ma_savemacbt.Size = new System.Drawing.Size(279, 35);
             this.ma_savemacbt.TabIndex = 13;
             this.ma_savemacbt.Text = "保留原有MAC/BT信息";
             this.ma_savemacbt.UseVisualStyleBackColor = true;
@@ -147,10 +143,9 @@
             this.LockCheckBox.AutoSize = true;
             this.LockCheckBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockCheckBox.LeaveEvent = false;
-            this.LockCheckBox.Location = new System.Drawing.Point(239, 33);
-            this.LockCheckBox.Margin = new System.Windows.Forms.Padding(2);
+            this.LockCheckBox.Location = new System.Drawing.Point(357, 48);
             this.LockCheckBox.Name = "LockCheckBox";
-            this.LockCheckBox.Size = new System.Drawing.Size(51, 21);
+            this.LockCheckBox.Size = new System.Drawing.Size(72, 28);
             this.LockCheckBox.TabIndex = 12;
             this.LockCheckBox.Text = "锁定";
             this.LockCheckBox.UseVisualStyleBackColor = true;
@@ -158,10 +153,9 @@
             // ma_code_label
             // 
             this.ma_code_label.AutoSize = true;
-            this.ma_code_label.Location = new System.Drawing.Point(25, 30);
-            this.ma_code_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_code_label.Location = new System.Drawing.Point(36, 44);
             this.ma_code_label.Name = "ma_code_label";
-            this.ma_code_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_code_label.Size = new System.Drawing.Size(110, 31);
             this.ma_code_label.TabIndex = 11;
             this.ma_code_label.Text = "返工单号";
             // 
@@ -173,14 +167,13 @@
             this.ma_code.DBTitle = null;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(115, 34);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
+            this.ma_code.Location = new System.Drawing.Point(172, 51);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(117, 22);
+            this.ma_code.Size = new System.Drawing.Size(176, 33);
             this.ma_code.TabIndex = 10;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
@@ -190,22 +183,20 @@
             // 
             this.getsnqty.AutoSize = true;
             this.getsnqty.CutLength = null;
-            this.getsnqty.Location = new System.Drawing.Point(617, 28);
-            this.getsnqty.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.getsnqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.getsnqty.Location = new System.Drawing.Point(924, 40);
+            this.getsnqty.MaximumSize = new System.Drawing.Size(225, 0);
             this.getsnqty.Name = "getsnqty";
-            this.getsnqty.Size = new System.Drawing.Size(0, 21);
+            this.getsnqty.Size = new System.Drawing.Size(0, 31);
             this.getsnqty.TabIndex = 8;
             // 
             // pr_code
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
-            this.pr_code.Location = new System.Drawing.Point(108, 73);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_code.Location = new System.Drawing.Point(160, 108);
+            this.pr_code.MaximumSize = new System.Drawing.Size(225, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 21);
+            this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 7;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -213,61 +204,55 @@
             // 
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
-            this.ma_qty.Location = new System.Drawing.Point(389, 28);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.ma_qty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_qty.Location = new System.Drawing.Point(582, 40);
+            this.ma_qty.MaximumSize = new System.Drawing.Size(225, 0);
             this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 21);
+            this.ma_qty.Size = new System.Drawing.Size(0, 31);
             this.ma_qty.TabIndex = 6;
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
-            this.pr_detail.Location = new System.Drawing.Point(389, 73);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_detail.Location = new System.Drawing.Point(582, 108);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(225, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 5;
             // 
             // pr_code_label
             // 
             this.pr_code_label.AutoSize = true;
-            this.pr_code_label.Location = new System.Drawing.Point(25, 73);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(36, 108);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.Size = new System.Drawing.Size(110, 31);
             this.pr_code_label.TabIndex = 4;
             this.pr_code_label.Text = "产品编号";
             // 
             // getsnqty_label
             // 
             this.getsnqty_label.AutoSize = true;
-            this.getsnqty_label.Location = new System.Drawing.Point(537, 28);
-            this.getsnqty_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.getsnqty_label.Location = new System.Drawing.Point(804, 40);
             this.getsnqty_label.Name = "getsnqty_label";
-            this.getsnqty_label.Size = new System.Drawing.Size(74, 21);
+            this.getsnqty_label.Size = new System.Drawing.Size(110, 31);
             this.getsnqty_label.TabIndex = 2;
             this.getsnqty_label.Text = "已维护数";
             // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
-            this.pr_detail_label.Location = new System.Drawing.Point(307, 73);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(459, 108);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 1;
             this.pr_detail_label.Text = "产品名称";
             // 
             // ma_qty_label
             // 
             this.ma_qty_label.AutoSize = true;
-            this.ma_qty_label.Location = new System.Drawing.Point(307, 28);
-            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_qty_label.Location = new System.Drawing.Point(459, 40);
             this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_qty_label.Size = new System.Drawing.Size(110, 31);
             this.ma_qty_label.TabIndex = 0;
             this.ma_qty_label.Text = "工单数量";
             // 
@@ -282,23 +267,37 @@
             this.groupBoxWithBorder2.Controls.Add(this.PrinterList_label);
             this.groupBoxWithBorder2.Controls.Add(this.PrinterList);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(9, 161);
-            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(14, 242);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
-            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder2.Size = new System.Drawing.Size(402, 142);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(603, 213);
             this.groupBoxWithBorder2.TabIndex = 13;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.Text = "打印设置";
             this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
             // 
+            // PrintNum
+            // 
+            this.PrintNum.AllPower = null;
+            this.PrintNum.BackColor = System.Drawing.Color.White;
+            this.PrintNum.Enabled = false;
+            this.PrintNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintNum.ID = null;
+            this.PrintNum.Location = new System.Drawing.Point(466, 166);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Power = null;
+            this.PrintNum.Size = new System.Drawing.Size(79, 31);
+            this.PrintNum.Str = null;
+            this.PrintNum.Str1 = null;
+            this.PrintNum.Str2 = null;
+            this.PrintNum.TabIndex = 19;
+            // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(221, 111);
-            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Location = new System.Drawing.Point(330, 165);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.Size = new System.Drawing.Size(110, 31);
             this.label2.TabIndex = 18;
             this.label2.Text = "打印份数";
             // 
@@ -307,58 +306,54 @@
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(106, 74);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.PrintLabel.Location = new System.Drawing.Point(159, 111);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(190, 25);
+            this.PrintLabel.Size = new System.Drawing.Size(283, 32);
             this.PrintLabel.TabIndex = 16;
             this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             // 
             // PrintLabel_label
             // 
             this.PrintLabel_label.AutoSize = true;
-            this.PrintLabel_label.Location = new System.Drawing.Point(11, 73);
-            this.PrintLabel_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.PrintLabel_label.Location = new System.Drawing.Point(15, 108);
             this.PrintLabel_label.Name = "PrintLabel_label";
-            this.PrintLabel_label.Size = new System.Drawing.Size(74, 21);
+            this.PrintLabel_label.Size = new System.Drawing.Size(110, 31);
             this.PrintLabel_label.TabIndex = 15;
             this.PrintLabel_label.Text = "产品名称";
             // 
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(106, 111);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.AutoPrint.Location = new System.Drawing.Point(159, 166);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(93, 25);
+            this.AutoPrint.Size = new System.Drawing.Size(140, 38);
             this.AutoPrint.TabIndex = 14;
             // 
             // PrinterList_label
             // 
             this.PrinterList_label.AutoSize = true;
-            this.PrinterList_label.Location = new System.Drawing.Point(11, 28);
-            this.PrinterList_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.PrinterList_label.Location = new System.Drawing.Point(15, 40);
             this.PrinterList_label.Name = "PrinterList_label";
-            this.PrinterList_label.Size = new System.Drawing.Size(90, 21);
+            this.PrinterList_label.Size = new System.Drawing.Size(134, 31);
             this.PrinterList_label.TabIndex = 13;
             this.PrinterList_label.Text = "打印机列表";
             // 
             // PrinterList
             // 
             this.PrinterList.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.PrinterList.Location = new System.Drawing.Point(106, 31);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
+            this.PrinterList.Location = new System.Drawing.Point(159, 46);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(6, 9, 6, 9);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(189, 22);
+            this.PrinterList.Size = new System.Drawing.Size(284, 33);
             this.PrinterList.TabIndex = 0;
             // 
             // 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(9, 307);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperateResult.Location = new System.Drawing.Point(14, 460);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(819, 171);
+            this.OperateResult.Size = new System.Drawing.Size(1226, 254);
             this.OperateResult.TabIndex = 14;
             this.OperateResult.Text = "";
             // 
@@ -370,11 +365,9 @@
             this.groupBoxWithBorder3.Controls.Add(this.label1);
             this.groupBoxWithBorder3.Controls.Add(this.sn_code);
             this.groupBoxWithBorder3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder3.Location = new System.Drawing.Point(9, 482);
-            this.groupBoxWithBorder3.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder3.Location = new System.Drawing.Point(14, 723);
             this.groupBoxWithBorder3.Name = "groupBoxWithBorder3";
-            this.groupBoxWithBorder3.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder3.Size = new System.Drawing.Size(818, 62);
+            this.groupBoxWithBorder3.Size = new System.Drawing.Size(1227, 93);
             this.groupBoxWithBorder3.TabIndex = 14;
             this.groupBoxWithBorder3.TabStop = false;
             this.groupBoxWithBorder3.Text = "输入信息";
@@ -383,10 +376,9 @@
             // ReWorkAsRelateTSN
             // 
             this.ReWorkAsRelateTSN.AutoSize = true;
-            this.ReWorkAsRelateTSN.Location = new System.Drawing.Point(487, 22);
-            this.ReWorkAsRelateTSN.Margin = new System.Windows.Forms.Padding(2);
+            this.ReWorkAsRelateTSN.Location = new System.Drawing.Point(729, 32);
             this.ReWorkAsRelateTSN.Name = "ReWorkAsRelateTSN";
-            this.ReWorkAsRelateTSN.Size = new System.Drawing.Size(177, 25);
+            this.ReWorkAsRelateTSN.Size = new System.Drawing.Size(265, 35);
             this.ReWorkAsRelateTSN.TabIndex = 15;
             this.ReWorkAsRelateTSN.Text = "以SN关联的TSN返工";
             this.ReWorkAsRelateTSN.UseVisualStyleBackColor = true;
@@ -396,10 +388,9 @@
             // 
             this.ReWorkAsCurrentSN.AutoSize = true;
             this.ReWorkAsCurrentSN.Checked = true;
-            this.ReWorkAsCurrentSN.Location = new System.Drawing.Point(346, 22);
-            this.ReWorkAsCurrentSN.Margin = new System.Windows.Forms.Padding(2);
+            this.ReWorkAsCurrentSN.Location = new System.Drawing.Point(518, 32);
             this.ReWorkAsCurrentSN.Name = "ReWorkAsCurrentSN";
-            this.ReWorkAsCurrentSN.Size = new System.Drawing.Size(124, 25);
+            this.ReWorkAsCurrentSN.Size = new System.Drawing.Size(183, 35);
             this.ReWorkAsCurrentSN.TabIndex = 14;
             this.ReWorkAsCurrentSN.TabStop = true;
             this.ReWorkAsCurrentSN.Text = "以当前号返工";
@@ -408,10 +399,9 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(39, 23);
-            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Location = new System.Drawing.Point(57, 33);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(58, 21);
+            this.label1.Size = new System.Drawing.Size(86, 31);
             this.label1.TabIndex = 13;
             this.label1.Text = "输入框";
             // 
@@ -421,47 +411,30 @@
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(115, 26);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(2);
+            this.sn_code.Location = new System.Drawing.Point(172, 39);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(148, 23);
+            this.sn_code.Size = new System.Drawing.Size(220, 31);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 0;
             this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
             // 
-            // PrintNum
-            // 
-            this.PrintNum.AllPower = null;
-            this.PrintNum.BackColor = System.Drawing.Color.White;
-            this.PrintNum.Enabled = false;
-            this.PrintNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(311, 111);
-            this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(54, 23);
-            this.PrintNum.Str = null;
-            this.PrintNum.Str1 = null;
-            this.PrintNum.Str2 = null;
-            this.PrintNum.TabIndex = 19;
-            // 
             // Make_GetReMakeSN
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(836, 554);
+            this.ClientSize = new System.Drawing.Size(1254, 831);
             this.Controls.Add(this.groupBoxWithBorder3);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.groupBoxWithBorder2);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Make_GetReMakeSN";
             this.Tag = "Make!GetReMakeSN";
             this.Text = "返工数据采集";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_GetReMakeSN_FormClosing);
             this.Load += new System.EventHandler(this.Make_GetReMakeSN_Load);
             this.SizeChanged += new System.EventHandler(this.Make_GetReMakeSN_SizeChanged);
             this.groupBoxWithBorder1.ResumeLayout(true);

+ 15 - 6
UAS_MES_HGS/FunctionCode/Make/Make_GetReMakeSN.cs

@@ -26,6 +26,8 @@ namespace UAS_MES_NEW.Make
 
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
+        BarTender.Application engine;
+
         DataHelper dh;
 
         DataTable dt;
@@ -45,8 +47,9 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new BarTender.Application();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception ex)
             {
@@ -60,7 +63,7 @@ namespace UAS_MES_NEW.Make
             ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,pr_spec # 产品规格,ma_craftcode # 途程编号";
             ma_code.FormName = Name;
             ma_code.SetValueField = new string[] { "ma_code", "pr_code", "ma_qty", "pr_detail", "pr_spec", "ma_craftcode" };
-            ma_code.Condition = "ma_kind='返工' and ma_statuscode='STARTED'";
+            ma_code.Condition = "ma_kind like '%返%' and ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
 
             ma_code.SetLockCheckBox(LockCheckBox);
@@ -137,7 +140,7 @@ namespace UAS_MES_NEW.Make
                                 sql.Append("select ma_salecode,nvl(ma_checksacode,0)ma_checksacode,ma_prodcode,ma_craftname,ma_inqty,ma_craftcode,ma_qty,nvl(ma_inqty,0) ma_inqty,");
                                 sql.Append("nvl(ma_scrapqty,0)ma_scrapqty,ma_id,nvl(ma_unlimitin,0) ma_unlimitin,ma_wccode,NVL(re_autodecom,0)");
                                 sql.Append("re_autodecom,nvl(re_ifsnok,0)re_ifsnok,re_code from make left join rework on ma_screcode=re_code where ");
-                                sql.Append("ma_code='" + ma_code.Text + "'and ma_kind='返工' and  ma_statuscode='STARTED'");
+                                sql.Append("ma_code='" + ma_code.Text + "'and ma_kind like '%返%' and  ma_statuscode='STARTED'");
                                 DataTable MaInf = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 string ma_prodcode = MaInf.Rows[0]["ma_prodcode"].ToString();
                                 string ma_salecode = MaInf.Rows[0]["ma_salecode"].ToString();
@@ -330,7 +333,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         OperateResult.AppendText(">>打印序列号" + sn_code.Text + "\n", Color.Black);
                                         //doc = lbl.Documents.Open(PrintLabel.Text);
-                                        if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sn_code.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "SN标签", "0", out ErrMessage))
+                                        if (!Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sn_code.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "SN标签", "0", out ErrMessage))
                                         {
                                             OperateResult.AppendText(ErrMessage + "\n", Color.Red);
                                             return;
@@ -355,7 +358,7 @@ namespace UAS_MES_NEW.Make
         {
             if (ma_code.Text.Length >= 5)
             {
-                if (dh.CheckExist("make", "ma_kind='返工' and ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'"))
+                if (dh.CheckExist("make", "ma_kind like '%返%' and ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'"))
                 {
                     sql.Clear();
                     sql.Append("select ma_id,ma_craftcode,ma_code,pr_code,pr_detail,pr_spec,ma_qty,nvl(ma_savemacbt,0) ma_savemacbt,nvl(ma_saveimei, 0)");
@@ -382,5 +385,11 @@ namespace UAS_MES_NEW.Make
                 PrintNum.Text = (PrintNums == "" ? "1" : PrintNums);
             }
         }
+
+        private void Make_GetReMakeSN_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+        }
     }
 }

+ 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();

File diff suppressed because it is too large
+ 192 - 266
UAS_MES_HGS/FunctionCode/Packing/Packing_PackageCollection.Designer.cs


+ 90 - 43
UAS_MES_HGS/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -10,7 +10,8 @@ using System.Threading;
 using UAS_MES_NEW.PublicForm;
 using System.Collections.Generic;
 using System.Diagnostics;
-using Seagull.BarTender.Print;
+using UAS_MES_NEW.CustomControl.BaseForm;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Packing
 {
@@ -21,8 +22,8 @@ namespace UAS_MES_NEW.Packing
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
         ApplicationClass lbl;
+        BarTender.Application engine;
         Thread thread;
-        Engine engine;
 
         DataTable Dbfind;
         string ErrorMessage = "";
@@ -48,11 +49,13 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Engine(true);
+                engine = new BarTender.Application();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n" + ex.Message, Color.Red);
+                OperateResult.AppendText("未正确安装打印软件\n" + ex.Message, Color.Red);
             }
         }
 
@@ -110,7 +113,7 @@ namespace UAS_MES_NEW.Packing
         {
             //加载表单数据
             sql.Clear();
-            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
+            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail||'-'||pr_orispeccode pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
             sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
@@ -157,17 +160,17 @@ namespace UAS_MES_NEW.Packing
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    for (int i = 0; i < _dt.Rows.Count; i++)
-                    {
-                        if (Print.BarTender1(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    //for (int i = 0; i < _dt.Rows.Count; i++)
+                    //{
+                        if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                         {
-                            OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
+                            OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Aqua);
                         }
                         else
                         {
                             OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                         }
-                    }
+                    //}
                     if (!AutoGenBoxCode.Checked)
                     {
                         pa_outboxcode.SelectAll();
@@ -193,10 +196,10 @@ namespace UAS_MES_NEW.Packing
             {
                 LoadData();
                 LoadGridData();
-                if (CheckOutBoxLength())
-                {
+              //  if (CheckOutBoxLength())
+               // {
                     sn_code.Focus();
-                }
+               // }
             }
             //}
             //catch (Exception ex)
@@ -248,7 +251,7 @@ namespace UAS_MES_NEW.Packing
                         //获取序列号信息
                         sql.Clear();
                         sql.Append("select nvl(ms_iostatus,0) ms_iostatus,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pr_code from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
@@ -313,7 +316,13 @@ namespace UAS_MES_NEW.Packing
                                 //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
                             }
@@ -392,13 +401,45 @@ namespace UAS_MES_NEW.Packing
                                     pa_outboxcode.Text = "";
                                     pa_status.Text = "0";
                                     BaseUtil.CleanDGVData(PackageDetail);
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
+                                    //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
-                                if (!CheckOutBoxLength(ms_salecode_text))
+                                if (dh.CheckExist("MAKEADDRESSLIST", "mal_sncode='" + sn_code.Text + "' and mal_outboxcode is not null"))
                                 {
-                                    return;
+                                    if (!dh.CheckExist("MAKEADDRESSLIST", "mal_sncode='" + sn_code.Text + "' and mal_outboxcode ='" + pa_outboxcode.Text + "' "))
+                                    {
+                                        OperateResult.AppendText(">>SN号" + sn_code.Text + ",卡通箱号" + pa_outboxcode.Text + "不属于卡通箱绑定关系\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    //if (!dh.CheckExist("packagedetail", "pd_outboxcode='" + pa_outboxcode.Text + "'"))
+                                    //{
+                                    //    if (dh.getFieldDataByCondition("PACKBIND", "min(pkb_sn)", "pkb_box ='" + pa_outboxcode.Text + "'").ToString() != sn_code.Text)
+                                    //    {
+                                    //        OperateResult.AppendText(">>SN号" + sn_code.Text + "不属于卡通箱号" + pa_outboxcode.Text + "关联第一个号\n", Color.Red, sn_code);
+                                    //        return;
+                                    //    }
+                                    //}
+                                    //else
+                                    //{
+                                    //    string maxout = dh.getFieldDataByCondition("packagedetail", "max(pd_barcode)", "pd_outboxcode ='" + pa_outboxcode.Text + "'").ToString();
+                                    //    if (int.Parse(dh.getFieldDataByCondition("PACKBIND", "count(1)", "pkb_sn between '" + maxout + "' and '" + sn_code.Text + "'").ToString()) > 2)
+                                    //    {
+                                    //        OperateResult.AppendText(">>SN号" + sn_code.Text + "需要顺序采集进卡通箱" + pa_outboxcode.Text + ",暂时无法采集此号\n", Color.Red, sn_code);
+                                    //        return;
+                                    //    }
+                                    //}
                                 }
+                                //if (!CheckOutBoxLength(ms_salecode_text))
+                                //{
+                                //    return;
+                                //}
                                 ////箱号不存在的情况
                                 if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
@@ -449,11 +490,11 @@ namespace UAS_MES_NEW.Packing
                                     if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                     {
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
+                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.ForestGreen);
+                                       //ClickToCloseForm form = new ClickToCloseForm("箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功");
+                                        //form.ShowDialog();
                                         pa_status.Text = "1";
                                         pa_standardqty.Text = "";
-                                        if (AutoPrint.Checked)
-                                            Print_Click(new object(), new EventArgs());
                                         if (!CollecRemark.Checked)
                                         {
                                             if (!AutoGenBoxCode.Checked)
@@ -485,6 +526,8 @@ namespace UAS_MES_NEW.Packing
                                         {
                                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         }
+                                        if (AutoPrint.Checked)
+                                            Print_Click(new object(), new EventArgs());
                                         LoadCollectedNum();
                                         LoadCheckQTY();
                                     }
@@ -569,6 +612,8 @@ namespace UAS_MES_NEW.Packing
         private void PackCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
             BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();
         }
 
@@ -579,7 +624,7 @@ namespace UAS_MES_NEW.Packing
                 string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (Seal == "Yes")
                 {
-                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.Green);
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.ForestGreen);
                     dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     pa_status.Text = "1";
                     pa_standardqty.Text = "";
@@ -616,6 +661,8 @@ namespace UAS_MES_NEW.Packing
                     {
                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     }
+                    if (AutoPrint.Checked)
+                        Print_Click(new object(), new EventArgs());
                     LoadCheckQTY();
                 }
             }
@@ -831,7 +878,7 @@ namespace UAS_MES_NEW.Packing
                                     SQLS1.Add("delete from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "'");
                                 }
                                 //更新序列号状态
-                                SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
+                                SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= '" + User.CurrentStepCode + "',ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
                                 string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
@@ -1048,26 +1095,26 @@ namespace UAS_MES_NEW.Packing
             {
                 if (ms_salecode_text != "")
                 {
-                    //DataTable dt = (DataTable)dh.ExecuteSql(" select pn_number,pn_id,pn_caller,pn_numberlength,pn_leadcode  from PACKAGENUMBER where pn_caller='" + pr_code.Text + "'", "select");
-                    //if (dt.Rows.Count > 0)
-                    //{
-                    //    string pn_leadcode = dt.Rows[0]["pn_leadcode"].ToString();
-                    //    int pn_numberlength = int.Parse(dt.Rows[0]["pn_numberlength"].ToString());
-                    //    if (OutBoxLength.Text != (pn_leadcode.Length + pn_numberlength).ToString())
-                    //    {
-                    //        OutBoxLength.Text = (pn_leadcode.Length + pn_numberlength).ToString();
-                    //        BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
-                    //    }
-                    //    if (PreFix.Text != pn_leadcode)
-                    //    {
-                    //        PreFix.Text = pn_leadcode;
-                    //        BaseUtil.SetCacheData("PreFix", PreFix.Text);
-                    //    }
-                    //}
-                    //else
-                    //{
-                    //    OperateResult.AppendText(">>产品" + pr_code.Text + "未维护箱号规则\n", Color.Black);
-                    //}
+                    DataTable dt = (DataTable)dh.ExecuteSql(" select pn_number,pn_id,pn_caller,pn_numberlength,pn_leadcode  from PACKAGENUMBER where pn_caller='" + pr_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        string pn_leadcode = dt.Rows[0]["pn_leadcode"].ToString();
+                        int pn_numberlength = int.Parse(dt.Rows[0]["pn_numberlength"].ToString());
+                        if (OutBoxLength.Text != (pn_leadcode.Length + pn_numberlength).ToString())
+                        {
+                            OutBoxLength.Text = (pn_leadcode.Length + pn_numberlength).ToString();
+                            BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
+                        }
+                        if (PreFix.Text != pn_leadcode)
+                        {
+                            PreFix.Text = pn_leadcode;
+                            BaseUtil.SetCacheData("PreFix", PreFix.Text);
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>产品" + pr_code.Text + "未维护箱号规则\n", Color.Black);
+                    }
                 }
                 return true;
             }

+ 18 - 36
UAS_MES_HGS/UAS_MES_HGS.csproj

@@ -567,12 +567,6 @@
     <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrintBZ.Designer.cs">
       <DependentUpon>Make_ColorBoxLoadPrintBZ.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxWeigh_ReadLine.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxWeigh_ReadLine.Designer.cs">
-      <DependentUpon>Make_ColorBoxWeigh_ReadLine.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_FeedingCollectionCombineFix.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -585,6 +579,12 @@
     <Compile Include="FunctionCode\Make\Make_FeedingCollectionCombine.Designer.cs">
       <DependentUpon>Make_FeedingCollectionCombine.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_FuselageLabelPrint.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_FuselageLabelPrint.Designer.cs">
+      <DependentUpon>Make_FuselageLabelPrint.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_GetTestFileData.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -609,6 +609,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>
@@ -675,12 +681,6 @@
     <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrint.Designer.cs">
       <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxWeigh.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxWeigh.Designer.cs">
-      <DependentUpon>Make_ColorBoxWeigh.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_CustomLabelPrint.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -699,12 +699,6 @@
     <Compile Include="FunctionCode\Make\Make_FeedingCollection.Designer.cs">
       <DependentUpon>Make_FeedingCollection.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_FuselageLabelPrint.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_FuselageLabelPrint.Designer.cs">
-      <DependentUpon>Make_FuselageLabelPrint.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_GetReMakeSN.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -813,12 +807,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>
@@ -1361,15 +1349,15 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrintBZ.resx">
       <DependentUpon>Make_ColorBoxLoadPrintBZ.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxWeigh_ReadLine.resx">
-      <DependentUpon>Make_ColorBoxWeigh_ReadLine.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_FeedingCollectionCombineFix.resx">
       <DependentUpon>Make_FeedingCollectionCombineFix.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_FeedingCollectionCombine.resx">
       <DependentUpon>Make_FeedingCollectionCombine.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_FuselageLabelPrint.resx">
+      <DependentUpon>Make_FuselageLabelPrint.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_GetTestFileData.resx">
       <DependentUpon>Make_GetTestFileData.cs</DependentUpon>
     </EmbeddedResource>
@@ -1382,6 +1370,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>
@@ -1415,9 +1406,6 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrint.resx">
       <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxWeigh.resx">
-      <DependentUpon>Make_ColorBoxWeigh.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_CustomLabelPrint.resx">
       <DependentUpon>Make_CustomLabelPrint.cs</DependentUpon>
     </EmbeddedResource>
@@ -1427,9 +1415,6 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_FeedingCollection.resx">
       <DependentUpon>Make_FeedingCollection.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_FuselageLabelPrint.resx">
-      <DependentUpon>Make_FuselageLabelPrint.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_GetReMakeSN.resx">
       <DependentUpon>Make_GetReMakeSN.cs</DependentUpon>
     </EmbeddedResource>
@@ -1484,9 +1469,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>

Some files were not shown because too many files changed in this diff