callm 1 месяц назад
Родитель
Сommit
b516f34df8

+ 48 - 50
UAS_MES_ZT/FunctionCode/Packing/Packing_PackageCollectionWeigh.Designer.cs

@@ -30,9 +30,9 @@
         {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Packing_PackageCollectionWeigh));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
             this.pa_makecode = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
             this.Cancel = new System.Windows.Forms.CheckBox();
@@ -145,7 +145,7 @@
             this.Cancel.AutoSize = true;
             this.Cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Cancel.Location = new System.Drawing.Point(563, 1108);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(5);
             this.Cancel.Name = "Cancel";
             this.Cancel.Size = new System.Drawing.Size(178, 45);
             this.Cancel.TabIndex = 129;
@@ -387,7 +387,7 @@
             // 
             this.CollecRemark.AutoSize = true;
             this.CollecRemark.Location = new System.Drawing.Point(1053, 1116);
-            this.CollecRemark.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.CollecRemark.Margin = new System.Windows.Forms.Padding(5);
             this.CollecRemark.Name = "CollecRemark";
             this.CollecRemark.Size = new System.Drawing.Size(186, 28);
             this.CollecRemark.TabIndex = 202;
@@ -398,7 +398,7 @@
             // 
             this.AllowRepeat.AutoSize = true;
             this.AllowRepeat.Location = new System.Drawing.Point(1259, 1116);
-            this.AllowRepeat.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.AllowRepeat.Margin = new System.Windows.Forms.Padding(5);
             this.AllowRepeat.Name = "AllowRepeat";
             this.AllowRepeat.Size = new System.Drawing.Size(186, 28);
             this.AllowRepeat.TabIndex = 209;
@@ -430,12 +430,10 @@
             // locksalecode
             // 
             this.locksalecode.AutoSize = true;
-            this.locksalecode.Checked = true;
-            this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
             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(485, 28);
-            this.locksalecode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.locksalecode.Margin = new System.Windows.Forms.Padding(5);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(186, 28);
             this.locksalecode.TabIndex = 231;
@@ -578,7 +576,7 @@
             this.AutoGenBoxCode.Checked = true;
             this.AutoGenBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoGenBoxCode.Location = new System.Drawing.Point(503, 91);
-            this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(138, 28);
             this.AutoGenBoxCode.TabIndex = 215;
@@ -698,7 +696,7 @@
             this.getwei.Checked = true;
             this.getwei.CheckState = System.Windows.Forms.CheckState.Checked;
             this.getwei.Location = new System.Drawing.Point(1279, 361);
-            this.getwei.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.getwei.Margin = new System.Windows.Forms.Padding(4);
             this.getwei.Name = "getwei";
             this.getwei.Size = new System.Drawing.Size(138, 28);
             this.getwei.TabIndex = 248;
@@ -724,7 +722,7 @@
             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(1399, 230);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(5);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Power = null;
             this.PrintNum.Size = new System.Drawing.Size(60, 39);
@@ -739,7 +737,7 @@
             this.PrintLabel.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.PrintLabel.FormattingEnabled = true;
             this.PrintLabel.Location = new System.Drawing.Point(1080, 165);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(296, 39);
             this.PrintLabel.TabIndex = 237;
@@ -778,7 +776,7 @@
             this.SendCheck.Image = null;
             this.SendCheck.IsShowBorder = true;
             this.SendCheck.Location = new System.Drawing.Point(1468, 225);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(5);
             this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
             this.SendCheck.Name = "SendCheck";
             this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
@@ -815,7 +813,7 @@
             this.Packing.Image = null;
             this.Packing.IsShowBorder = true;
             this.Packing.Location = new System.Drawing.Point(888, 222);
-            this.Packing.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Packing.Margin = new System.Windows.Forms.Padding(5);
             this.Packing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Packing.MoveImage")));
             this.Packing.Name = "Packing";
             this.Packing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Packing.NormalImage")));
@@ -834,7 +832,7 @@
             this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pr_outboxinnerqty.ID = null;
             this.pr_outboxinnerqty.Location = new System.Drawing.Point(201, 155);
-            this.pr_outboxinnerqty.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.pr_outboxinnerqty.Margin = new System.Windows.Forms.Padding(5);
             this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
             this.pr_outboxinnerqty.Power = null;
             this.pr_outboxinnerqty.Size = new System.Drawing.Size(216, 39);
@@ -852,7 +850,7 @@
             this.DeleteAll.Image = null;
             this.DeleteAll.IsShowBorder = true;
             this.DeleteAll.Location = new System.Drawing.Point(721, 84);
-            this.DeleteAll.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.DeleteAll.Margin = new System.Windows.Forms.Padding(5);
             this.DeleteAll.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteAll.MoveImage")));
             this.DeleteAll.Name = "DeleteAll";
             this.DeleteAll.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteAll.NormalImage")));
@@ -872,7 +870,7 @@
             this.Printing.Image = null;
             this.Printing.IsShowBorder = true;
             this.Printing.Location = new System.Drawing.Point(1193, 222);
-            this.Printing.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Printing.Margin = new System.Windows.Forms.Padding(5);
             this.Printing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Printing.MoveImage")));
             this.Printing.Name = "Printing";
             this.Printing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Printing.NormalImage")));
@@ -911,7 +909,7 @@
             this.RefreshWeigh.Image = null;
             this.RefreshWeigh.IsShowBorder = true;
             this.RefreshWeigh.Location = new System.Drawing.Point(1492, 592);
-            this.RefreshWeigh.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.RefreshWeigh.Margin = new System.Windows.Forms.Padding(5);
             this.RefreshWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.MoveImage")));
             this.RefreshWeigh.Name = "RefreshWeigh";
             this.RefreshWeigh.NormalImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.NormalImage")));
@@ -946,7 +944,7 @@
             this.pa_remark.BackColor = System.Drawing.Color.White;
             this.pa_remark.ID = null;
             this.pa_remark.Location = new System.Drawing.Point(1053, 1005);
-            this.pa_remark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pa_remark.Margin = new System.Windows.Forms.Padding(4);
             this.pa_remark.Multiline = true;
             this.pa_remark.Name = "pa_remark";
             this.pa_remark.Power = null;
@@ -961,7 +959,7 @@
             // 
             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(8, 853);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(5);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(860, 236);
             this.OperateResult.TabIndex = 155;
@@ -975,7 +973,7 @@
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
             this.Clean.Location = new System.Drawing.Point(752, 1109);
-            this.Clean.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Clean.Margin = new System.Windows.Forms.Padding(5);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -992,7 +990,7 @@
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
             this.sn_code.Location = new System.Drawing.Point(152, 1108);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(5);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = "ifread";
             this.sn_code.Size = new System.Drawing.Size(336, 35);
@@ -1008,14 +1006,14 @@
             this.PackageDetail.AllowUserToAddRows = false;
             this.PackageDetail.AllowUserToDeleteRows = false;
             this.PackageDetail.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
-            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.PackageDetail.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.PackageDetail.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
             this.PackageDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.PackageDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_barcode,
@@ -1024,27 +1022,27 @@
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
-            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.PackageDetail.DefaultCellStyle = dataGridViewCellStyle5;
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.PackageDetail.DefaultCellStyle = dataGridViewCellStyle2;
             this.PackageDetail.EnableContentClick = true;
             this.PackageDetail.Location = new System.Drawing.Point(23, 343);
-            this.PackageDetail.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.PackageDetail.Margin = new System.Windows.Forms.Padding(5);
             this.PackageDetail.Name = "PackageDetail";
             this.PackageDetail.ReadOnly = true;
-            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.PackageDetail.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
+            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.PackageDetail.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
             this.PackageDetail.RowHeadersWidth = 82;
             this.PackageDetail.RowTemplate.Height = 23;
             this.PackageDetail.Size = new System.Drawing.Size(1243, 480);
@@ -1221,7 +1219,7 @@
             this.Controls.Add(this.label13);
             this.Controls.Add(this.pa_makecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Margin = new System.Windows.Forms.Padding(5);
             this.Name = "Packing_PackageCollectionWeigh";
             this.Tag = "Packing!PackageCollectionWeigh";
             this.Activated += new System.EventHandler(this.Make_PackageCollectionWeigh_Activated);
@@ -1229,7 +1227,7 @@
             this.Load += new System.EventHandler(this.Make_PackageCollectionWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.Make_PackageCollectionWeigh_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 12 - 7
UAS_MES_ZT/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -143,7 +143,12 @@ namespace UAS_MES_NEW.Packing
                                 //{
                                 //    weight.Text = re.Match(weigh).Value; ;
                                 //}
-                                weight.Text = re.Match(serialPort1.ReadLine()).Groups[0].Value;
+
+                                string weigh = re.Match(serialPort1.ReadLine()).Groups[0].Value;
+                                if (weigh != "0" && weigh != "")
+                                {
+                                    weight.Text = weigh;
+                                }
                             }
                             catch (Exception)
                             {
@@ -235,7 +240,7 @@ namespace UAS_MES_NEW.Packing
                         dh.ExecuteSql("update package set pa_weight=" + weigh + " where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    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))
+                    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.Aqua);
                     }
@@ -264,11 +269,11 @@ namespace UAS_MES_NEW.Packing
         {
             if (e.KeyCode == Keys.Enter)
             {
-               // if (CheckOutBoxLength())
-               // {
-                    LoadData();
-                    LoadGridData();
-                    sn_code.Focus();
+                // if (CheckOutBoxLength())
+                // {
+                LoadData();
+                LoadGridData();
+                sn_code.Focus();
                 //}
             }
         }