章政 8 жил өмнө
parent
commit
59ce042a0d

+ 8 - 9
UAS-MES/DbFind.Designer.cs

@@ -38,12 +38,11 @@
             this.DbFindGridView.AllowUserToAddRows = false;
             this.DbFindGridView.BackgroundColor = System.Drawing.SystemColors.Window;
             this.DbFindGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.DbFindGridView.Location = new System.Drawing.Point(0, 28);
-            this.DbFindGridView.Margin = new System.Windows.Forms.Padding(4);
+            this.DbFindGridView.Location = new System.Drawing.Point(0, 22);
             this.DbFindGridView.Name = "DbFindGridView";
             this.DbFindGridView.ReadOnly = true;
             this.DbFindGridView.RowTemplate.Height = 23;
-            this.DbFindGridView.Size = new System.Drawing.Size(986, 510);
+            this.DbFindGridView.Size = new System.Drawing.Size(740, 408);
             this.DbFindGridView.TabIndex = 0;
             this.DbFindGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DbFindGridView_CellDoubleClick);
             this.DbFindGridView.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.DbFindGridView_ColumnWidthChanged);
@@ -55,24 +54,24 @@
             this.pagination1.AddEnable = false;
             this.pagination1.Cursor = System.Windows.Forms.Cursors.Arrow;
             this.pagination1.DeleteEnable = false;
-            this.pagination1.Location = new System.Drawing.Point(0, 540);
-            this.pagination1.Margin = new System.Windows.Forms.Padding(5);
+            this.pagination1.Location = new System.Drawing.Point(0, 432);
+            this.pagination1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pagination1.Name = "pagination1";
-            this.pagination1.Size = new System.Drawing.Size(986, 40);
+            this.pagination1.Size = new System.Drawing.Size(740, 32);
             this.pagination1.TabIndex = 1;
             // 
             // DbFind
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(988, 580);
+            this.ClientSize = new System.Drawing.Size(741, 464);
             this.Controls.Add(this.pagination1);
             this.Controls.Add(this.DbFindGridView);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "DbFind";
             this.Tag = "ShowDialogWindow";
             this.Text = "放大镜";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DbFind_FormClosing);
             this.Load += new System.EventHandler(this.DbFind_Load);
             ((System.ComponentModel.ISupportInitialize)(this.DbFindGridView)).EndInit();
             this.ResumeLayout(false);

+ 5 - 0
UAS-MES/DbFind.cs

@@ -273,5 +273,10 @@ namespace UAS_MES
                 }
             }
         }
+
+        private void DbFind_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            dh.Dispose();
+        }
     }
 }

+ 125 - 127
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -35,8 +35,6 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.panel6 = new System.Windows.Forms.Panel();
-            this.pr_colorboxgw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.label22 = new System.Windows.Forms.Label();
             this.weight = new System.Windows.Forms.Label();
             this.panel4 = new System.Windows.Forms.Panel();
@@ -54,11 +52,13 @@
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer_label = new System.Windows.Forms.Label();
             this.PrintLabel_label = new System.Windows.Forms.Label();
+            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
+            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.StopWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.StartWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.mcd_waitqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_qty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Cancel = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -68,9 +68,9 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_colorboxgw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
             this.panel3.SuspendLayout();
@@ -81,22 +81,22 @@
             // mcd_waitqty_label
             // 
             this.mcd_waitqty_label.AutoSize = true;
-            this.mcd_waitqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_waitqty_label.Location = new System.Drawing.Point(14, 486);
+            this.mcd_waitqty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_waitqty_label.Location = new System.Drawing.Point(14, 512);
             this.mcd_waitqty_label.Name = "mcd_waitqty_label";
-            this.mcd_waitqty_label.Size = new System.Drawing.Size(46, 21);
+            this.mcd_waitqty_label.Size = new System.Drawing.Size(52, 27);
             this.mcd_waitqty_label.TabIndex = 65;
-            this.mcd_waitqty_label.Text = "待称:";
+            this.mcd_waitqty_label.Text = "待称";
             // 
             // mcd_okqty_label
             // 
             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(12, 434);
+            this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_okqty_label.Location = new System.Drawing.Point(14, 455);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(46, 21);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(52, 27);
             this.mcd_okqty_label.TabIndex = 64;
-            this.mcd_okqty_label.Text = "已称:";
+            this.mcd_okqty_label.Text = "已称";
             // 
             // pr_colorboxgw_label
             // 
@@ -143,31 +143,6 @@
             this.panel6.Size = new System.Drawing.Size(381, 124);
             this.panel6.TabIndex = 62;
             // 
-            // pr_colorboxgw
-            // 
-            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(141, 77);
-            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, 27);
-            this.pr_colorboxgw.TabIndex = 80;
-            this.pr_colorboxgw.Tag = "1";
-            // 
-            // pr_code
-            // 
-            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(141, 26);
-            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, 27);
-            this.pr_code.TabIndex = 79;
-            this.pr_code.Tag = "1";
-            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
-            // 
             // label22
             // 
             this.label22.AutoSize = true;
@@ -205,31 +180,31 @@
             // label15
             // 
             this.label15.AutoSize = true;
-            this.label15.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(15, 18);
+            this.label15.Font = new System.Drawing.Font("微软雅黑", 20F);
+            this.label15.Location = new System.Drawing.Point(8, 19);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(86, 31);
+            this.label15.Size = new System.Drawing.Size(96, 35);
             this.label15.TabIndex = 56;
             this.label15.Text = "条码号";
             // 
             // pr_detail_label
             // 
             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(14, 326);
+            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(14, 338);
             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(92, 27);
             this.pr_detail_label.TabIndex = 53;
             this.pr_detail_label.Text = "产品型号";
             // 
             // Temp1
             // 
             this.Temp1.AutoSize = true;
-            this.Temp1.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Temp1.Font = new System.Drawing.Font("微软雅黑", 20F);
             this.Temp1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp1.Location = new System.Drawing.Point(57, 37);
+            this.Temp1.Location = new System.Drawing.Point(57, 35);
             this.Temp1.Name = "Temp1";
-            this.Temp1.Size = new System.Drawing.Size(0, 30);
+            this.Temp1.Size = new System.Drawing.Size(0, 35);
             this.Temp1.TabIndex = 38;
             // 
             // panel3
@@ -245,11 +220,11 @@
             // Temp2
             // 
             this.Temp2.AutoSize = true;
-            this.Temp2.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Temp2.Font = new System.Drawing.Font("微软雅黑", 20F);
             this.Temp2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp2.Location = new System.Drawing.Point(57, 34);
+            this.Temp2.Location = new System.Drawing.Point(57, 32);
             this.Temp2.Name = "Temp2";
-            this.Temp2.Size = new System.Drawing.Size(0, 30);
+            this.Temp2.Size = new System.Drawing.Size(0, 35);
             this.Temp2.TabIndex = 39;
             // 
             // panel2
@@ -266,31 +241,31 @@
             // ma_qty_label
             // 
             this.ma_qty_label.AutoSize = true;
-            this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(14, 382);
+            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(14, 397);
             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(92, 27);
             this.ma_qty_label.TabIndex = 55;
             this.ma_qty_label.Text = "工单数量";
             // 
             // ma_salecode_label
             // 
             this.ma_salecode_label.AutoSize = true;
-            this.ma_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode_label.Location = new System.Drawing.Point(14, 270);
+            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(14, 277);
             this.ma_salecode_label.Name = "ma_salecode_label";
-            this.ma_salecode_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_salecode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_salecode_label.TabIndex = 54;
             this.ma_salecode_label.Text = "订单编号";
             // 
             // Temp3
             // 
             this.Temp3.AutoSize = true;
-            this.Temp3.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Temp3.Font = new System.Drawing.Font("微软雅黑", 20F);
             this.Temp3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp3.Location = new System.Drawing.Point(57, 35);
+            this.Temp3.Location = new System.Drawing.Point(57, 33);
             this.Temp3.Name = "Temp3";
-            this.Temp3.Size = new System.Drawing.Size(0, 30);
+            this.Temp3.Size = new System.Drawing.Size(0, 35);
             this.Temp3.TabIndex = 40;
             // 
             // panel1
@@ -306,10 +281,10 @@
             // ms_makecode_label
             // 
             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.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(14, 218);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
             this.ms_makecode_label.TabIndex = 72;
             this.ms_makecode_label.Text = "制造单号";
             // 
@@ -343,10 +318,34 @@
             this.PrintLabel_label.TabIndex = 163;
             this.PrintLabel_label.Text = "打印标签";
             // 
+            // ComList
+            // 
+            this.ComList.Location = new System.Drawing.Point(908, 54);
+            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(119, 20);
+            this.ComList.TabIndex = 167;
+            // 
+            // BaudRate
+            // 
+            this.BaudRate.AllPower = null;
+            this.BaudRate.BackColor = System.Drawing.Color.White;
+            this.BaudRate.ID = null;
+            this.BaudRate.Location = new System.Drawing.Point(908, 26);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.BaudRate.Name = "BaudRate";
+            this.BaudRate.Negative = false;
+            this.BaudRate.Power = null;
+            this.BaudRate.Size = new System.Drawing.Size(120, 21);
+            this.BaudRate.Str = null;
+            this.BaudRate.Str1 = null;
+            this.BaudRate.Str2 = null;
+            this.BaudRate.TabIndex = 166;
+            // 
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(908, 86);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(119, 20);
             this.Printer.TabIndex = 160;
@@ -358,7 +357,7 @@
             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(710, 25);
+            this.StopWeight.Location = new System.Drawing.Point(710, 22);
             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";
@@ -377,7 +376,7 @@
             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(621, 25);
+            this.StartWeight.Location = new System.Drawing.Point(621, 22);
             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";
@@ -393,24 +392,24 @@
             // 
             this.mcd_waitqty.AutoSize = true;
             this.mcd_waitqty.CutLength = null;
-            this.mcd_waitqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_waitqty.Location = new System.Drawing.Point(76, 486);
+            this.mcd_waitqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_waitqty.Location = new System.Drawing.Point(89, 512);
             this.mcd_waitqty.MaximumSize = new System.Drawing.Size(150, 0);
             this.mcd_waitqty.Name = "mcd_waitqty";
-            this.mcd_waitqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_waitqty.Size = new System.Drawing.Size(0, 27);
             this.mcd_waitqty.TabIndex = 155;
             // 
-            // mcd_qty
+            // mcd_okqty
             // 
-            this.mcd_qty.AutoSize = true;
-            this.mcd_qty.CutLength = null;
-            this.mcd_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_qty.Location = new System.Drawing.Point(77, 434);
-            this.mcd_qty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_qty.Name = "mcd_qty";
-            this.mcd_qty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_qty.TabIndex = 154;
-            this.mcd_qty.Tag = "1";
+            this.mcd_okqty.AutoSize = true;
+            this.mcd_okqty.CutLength = null;
+            this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_okqty.Location = new System.Drawing.Point(89, 455);
+            this.mcd_okqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_okqty.Name = "mcd_okqty";
+            this.mcd_okqty.Size = new System.Drawing.Size(0, 27);
+            this.mcd_okqty.TabIndex = 154;
+            this.mcd_okqty.Tag = "1";
             // 
             // Cancel
             // 
@@ -454,11 +453,11 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(104, 218);
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(125, 218);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 77;
             this.ms_makecode.Tag = "1";
             // 
@@ -466,33 +465,33 @@
             // 
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
-            this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(104, 382);
+            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(125, 397);
             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, 21);
+            this.ma_qty.Size = new System.Drawing.Size(0, 27);
             this.ma_qty.TabIndex = 76;
             // 
             // pr_detail
             // 
             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(104, 326);
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail.Location = new System.Drawing.Point(125, 338);
             this.pr_detail.MaximumSize = new System.Drawing.Size(150, 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, 27);
             this.pr_detail.TabIndex = 75;
             // 
             // ma_salecode
             // 
             this.ma_salecode.AutoSize = true;
             this.ma_salecode.CutLength = null;
-            this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode.Location = new System.Drawing.Point(104, 270);
+            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(125, 277);
             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, 21);
+            this.ma_salecode.Size = new System.Drawing.Size(0, 27);
             this.ma_salecode.TabIndex = 73;
             // 
             // Clean
@@ -502,7 +501,7 @@
             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(891, 554);
+            this.Clean.Location = new System.Drawing.Point(888, 557);
             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";
@@ -538,17 +537,42 @@
             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(106, 18);
+            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 = "ifwrite";
-            this.sncode.Size = new System.Drawing.Size(508, 39);
+            this.sncode.Size = new System.Drawing.Size(504, 39);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
             this.sncode.TabIndex = 57;
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
+            // pr_colorboxgw
+            // 
+            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(141, 77);
+            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, 27);
+            this.pr_colorboxgw.TabIndex = 80;
+            this.pr_colorboxgw.Tag = "1";
+            // 
+            // pr_code
+            // 
+            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(141, 26);
+            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, 27);
+            this.pr_code.TabIndex = 79;
+            this.pr_code.Tag = "1";
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -559,32 +583,6 @@
             this.OperateResult.TabIndex = 58;
             this.OperateResult.Text = "";
             // 
-            // BaudRate
-            // 
-            this.BaudRate.AllPower = null;
-            this.BaudRate.BackColor = System.Drawing.Color.White;
-            this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(908, 26);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Negative = false;
-            this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(120, 21);
-            this.BaudRate.Str = null;
-            this.BaudRate.Str1 = null;
-            this.BaudRate.Str2 = null;
-            this.BaudRate.TabIndex = 166;
-            this.BaudRate.Visible = false;
-            // 
-            // ComList
-            // 
-            this.ComList.Location = new System.Drawing.Point(908, 54);
-            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(119, 20);
-            this.ComList.TabIndex = 167;
-            this.ComList.Visible = false;
-            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -599,7 +597,7 @@
             this.Controls.Add(this.StopWeight);
             this.Controls.Add(this.StartWeight);
             this.Controls.Add(this.mcd_waitqty);
-            this.Controls.Add(this.mcd_qty);
+            this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.ms_makecode);
@@ -628,19 +626,19 @@
             this.Tag = "Make!ColorBoxWeigh";
             this.Text = "彩盒称重";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
-            this.Load += new System.EventHandler(this.彩盒上料打印_Load);
+            this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
-            this.panel6.ResumeLayout(true);
+            this.panel6.ResumeLayout(false);
             this.panel6.PerformLayout();
-            this.panel4.ResumeLayout(true);
+            this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
-            this.panel3.ResumeLayout(true);
+            this.panel3.ResumeLayout(false);
             this.panel3.PerformLayout();
-            this.panel2.ResumeLayout(true);
+            this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
-            this.panel1.ResumeLayout(true);
+            this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -678,7 +676,7 @@
         private CustomControl.ValueLabel.ValueLabel pr_colorboxgw;
         private CustomControl.ButtonUtil.NormalButton Cancel;
         private CustomControl.ButtonUtil.NormalButton Confirm;
-        private CustomControl.ValueLabel.ValueLabel mcd_qty;
+        private CustomControl.ValueLabel.ValueLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueLabel mcd_waitqty;
         private CustomControl.ButtonUtil.NormalButton StartWeight;
         private CustomControl.ButtonUtil.NormalButton StopWeight;

+ 33 - 25
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -12,6 +12,7 @@ using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 using System.Drawing;
 using LabelManager2;
+using UAS_MES.PublicForm;
 
 namespace UAS_MES.Make
 {
@@ -34,19 +35,30 @@ namespace UAS_MES.Make
         //是否通过串口获取数据
         bool GetData = true;
 
+        Thread InitPrint;
+
         public Make_ColorBoxWeigh()
         {
             InitializeComponent();
+            CheckForIllegalCrossThreadCalls = false;
         }
 
-        private void 彩盒上料打印_Load(object sender, EventArgs e)
+        private void Make_ColorBoxWeigh_Load(object sender, EventArgs e)
         {
-            lbl = new ApplicationClass();
-            CheckForIllegalCrossThreadCalls = false;
-            dh = new DataHelper();
             asc.controllInitializeSize(this);
+            dh = new DataHelper();
             ComList.Text = Properties.Settings.Default.PortName;
             BaudRate.Text = Properties.Settings.Default.BaudRate;
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            StartWeight.PerformClick();
+        }
+
+        private void InPrint()
+        {
+            lbl = new ApplicationClass();
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -78,16 +90,17 @@ namespace UAS_MES.Make
                         pr_colorboxgw.Text = MinWeight + "-" + MaxWeight;
                     }
                     string ErrorMessage;
-                    bool ifFirst;
-                    if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, "Make!ColorBoxWeigh", out ifFirst, out ErrorMessage))
+                    string oMakeCode = "";
+                    string oMsID = "";
+                    if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         string YN = dh.GetConfig("BatchNumber", "MESSetting").ToString();
                         //表示需要验证判断md_qty 是否大于等于md_baseqty
                         if (YN != "0")
                         {
                             sql.Clear();
-                            sql.Append("select wm_concat(md_prodcode) ,count(1)  cn from  makeprepare left join ");
-                            sql.Append("makepreparedetail  on mp_id=md_mpid  where mp_makecode='" + ms_makecode.Text + "' and md_qty<md_baseqty");
+                            sql.Append("select wm_concat(md_prodcode) ,count(1) cn from makeprepare left join makepreparedetail ");
+                            sql.Append("on mp_id=md_mpid where mp_makecode='" + ms_makecode.Text + "' and md_qty<md_baseqty");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows[0]["CN"].ToString() != "0")
                             {
@@ -99,26 +112,21 @@ namespace UAS_MES.Make
                         int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
                         if (ActualWeight > MinWeight && ActualWeight < MaxWeight)
                         {
-                            OperateResult.AppendText(">>检测合格\n", Color.Green);
                             //显示最近的三个称量记录
                             Temp3.Text = Temp2.Text;
                             Temp2.Text = Temp1.Text;
                             Temp1.Text = sncode.Text;
+                            if (LogicHandler.UpdateMakeMessage(sncode.Text, ms_makecode.Text, "彩盒称量", User.UserSourceCode, User.UserCode, "称量合格", out ErrorMessage))
+                            {
+                                OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);
+                            }
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         }
-                        else
-                            OperateResult.AppendText(">>检测未通过\n", Color.Red, sncode);
-                    }
-                    else
-                    {
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
+                        else OperateResult.AppendText(">>" + sncode.Text + "重量检测未通过\n", Color.Red, sncode);
                     }
-                    sncode.Text = "";
-                }
-                else
-                {
-                    OperateResult.AppendText(">>序列号不存在\n", Color.Red, sncode);
-                    return;
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                 }
+                else OperateResult.AppendText(">>序列号不存在\n", Color.Red, sncode);
             }
         }
 
@@ -145,8 +153,7 @@ namespace UAS_MES.Make
                     }
                     catch (IOException ex) { MessageBox.Show(ex.Message); }
                 }
-                else
-                    MessageBox.Show("端口已被占用,请关闭其他窗口");
+                else OperateResult.AppendText(">>端口已被占用,请关闭其他窗口\n", Color.Red);
             }
         }
 
@@ -163,6 +170,7 @@ namespace UAS_MES.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
+            StopWeight.PerformClick();
             if (serialPort1.IsOpen)
             {
                 GetData = false;
@@ -199,7 +207,7 @@ namespace UAS_MES.Make
                 if (BaudRate.Text == "" || ComList.Text == "")
                     OperateResult.AppendText(">>请先在电子秤调试界面维护波特率和串口\n", Color.Red);
                 else
-                    OperateResult.AppendText(">>"+ mes.Message + "\n", Color.Red);
+                    OperateResult.AppendText(">>" + mes.Message + "\n", Color.Red);
             }
         }
 
@@ -212,7 +220,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            PrintLabel.DataSource = dh.ExecuteSql("select pl_labelcode,pl_labelname from  productlabel  where pl_prodcode='" + pr_code.Text + "'", "select");
+            PrintLabel.DataSource = dh.ExecuteSql("select pl_labelcode,pl_labelname from  productlabel  where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";
         }

+ 45 - 44
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -56,8 +56,8 @@
             this.Printing = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.pa_packageqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ma_prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.pa_totalqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_outboxinnerqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pr_detail = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pa_restqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.barcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -87,7 +87,7 @@
             // 
             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(20, 102);
+            this.pr_detail_label.Location = new System.Drawing.Point(7, 102);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 80;
@@ -97,7 +97,7 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(283, 54);
+            this.ma_code_label.Location = new System.Drawing.Point(269, 53);
             this.ma_code_label.Name = "ma_code_label";
             this.ma_code_label.Size = new System.Drawing.Size(58, 21);
             this.ma_code_label.TabIndex = 76;
@@ -160,7 +160,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(52, 53);
+            this.pa_code_label.Location = new System.Drawing.Point(7, 55);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(42, 21);
             this.pa_code_label.TabIndex = 113;
@@ -222,7 +222,7 @@
             // 
             this.pa_id.AutoSize = true;
             this.pa_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_id.Location = new System.Drawing.Point(964, 46);
+            this.pa_id.Location = new System.Drawing.Point(964, 53);
             this.pa_id.Name = "pa_id";
             this.pa_id.Size = new System.Drawing.Size(50, 21);
             this.pa_id.TabIndex = 153;
@@ -253,7 +253,7 @@
             // 
             this.pr_id.AutoSize = true;
             this.pr_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_id.Location = new System.Drawing.Point(964, 80);
+            this.pr_id.Location = new System.Drawing.Point(964, 79);
             this.pr_id.Name = "pr_id";
             this.pr_id.Size = new System.Drawing.Size(47, 21);
             this.pr_id.TabIndex = 161;
@@ -388,37 +388,37 @@
             this.pa_packageqty.Tag = "NoAuto";
             this.pa_packageqty.TextChanged += new System.EventHandler(this.pa_packageqty_TextChanged);
             // 
-            // ma_prodcode
-            // 
-            this.ma_prodcode.AllPower = null;
-            this.ma_prodcode.BackColor = System.Drawing.Color.White;
-            this.ma_prodcode.Enabled = false;
-            this.ma_prodcode.ID = null;
-            this.ma_prodcode.Location = new System.Drawing.Point(611, 55);
-            this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Power = null;
-            this.ma_prodcode.Size = new System.Drawing.Size(150, 21);
-            this.ma_prodcode.Str = null;
-            this.ma_prodcode.Str1 = null;
-            this.ma_prodcode.Str2 = null;
-            this.ma_prodcode.TabIndex = 142;
-            this.ma_prodcode.Tag = "ma_prodcode";
-            this.ma_prodcode.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
-            // 
-            // pa_totalqty
-            // 
-            this.pa_totalqty.AllPower = null;
-            this.pa_totalqty.BackColor = System.Drawing.Color.White;
-            this.pa_totalqty.ID = null;
-            this.pa_totalqty.Location = new System.Drawing.Point(352, 149);
-            this.pa_totalqty.Name = "pa_totalqty";
-            this.pa_totalqty.Power = null;
-            this.pa_totalqty.Size = new System.Drawing.Size(150, 21);
-            this.pa_totalqty.Str = null;
-            this.pa_totalqty.Str1 = null;
-            this.pa_totalqty.Str2 = null;
-            this.pa_totalqty.TabIndex = 141;
-            this.pa_totalqty.Tag = "NoAuto";
+            // pr_code
+            // 
+            this.pr_code.AllPower = null;
+            this.pr_code.BackColor = System.Drawing.Color.White;
+            this.pr_code.Enabled = false;
+            this.pr_code.ID = null;
+            this.pr_code.Location = new System.Drawing.Point(611, 55);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Power = null;
+            this.pr_code.Size = new System.Drawing.Size(150, 21);
+            this.pr_code.Str = null;
+            this.pr_code.Str1 = null;
+            this.pr_code.Str2 = null;
+            this.pr_code.TabIndex = 142;
+            this.pr_code.Tag = "ma_prodcode";
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            // 
+            // pr_outboxinnerqty
+            // 
+            this.pr_outboxinnerqty.AllPower = null;
+            this.pr_outboxinnerqty.BackColor = System.Drawing.Color.White;
+            this.pr_outboxinnerqty.ID = null;
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(352, 149);
+            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
+            this.pr_outboxinnerqty.Power = null;
+            this.pr_outboxinnerqty.Size = new System.Drawing.Size(150, 21);
+            this.pr_outboxinnerqty.Str = null;
+            this.pr_outboxinnerqty.Str1 = null;
+            this.pr_outboxinnerqty.Str2 = null;
+            this.pr_outboxinnerqty.TabIndex = 141;
+            this.pr_outboxinnerqty.Tag = "NoAuto";
             // 
             // pr_detail
             // 
@@ -489,21 +489,21 @@
             // 
             // pd_barcode
             // 
-            this.pd_barcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
             this.pd_barcode.DataPropertyName = "pd_barcode";
             this.pd_barcode.HeaderText = "序号";
             this.pd_barcode.Name = "pd_barcode";
             this.pd_barcode.ReadOnly = true;
             this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
             this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
+            this.pd_barcode.Width = 202;
             // 
             // pa_outboxcode1
             // 
-            this.pa_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
             this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
             this.pa_outboxcode1.HeaderText = "箱号";
             this.pa_outboxcode1.Name = "pa_outboxcode1";
             this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Width = 201;
             // 
             // pd_innerqty
             // 
@@ -519,6 +519,7 @@
             this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.pa_indate.DataPropertyName = "pa_indate";
             this.pa_indate.HeaderText = "装箱日期";
+            this.pa_indate.MinimumWidth = 300;
             this.pa_indate.Name = "pa_indate";
             this.pa_indate.ReadOnly = true;
             this.pa_indate.Width = 300;
@@ -549,8 +550,8 @@
             this.Controls.Add(this.Printing);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.pa_packageqty);
-            this.Controls.Add(this.ma_prodcode);
-            this.Controls.Add(this.pa_totalqty);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.pr_outboxinnerqty);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.pa_restqty);
             this.Controls.Add(this.barcode);
@@ -605,8 +606,8 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox barcode;
         private CustomControl.TextBoxWithIcon.EnterTextBox pa_restqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox pr_detail;
-        private CustomControl.TextBoxWithIcon.EnterTextBox pa_totalqty;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ma_prodcode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_outboxinnerqty;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
         private CustomControl.TextBoxWithIcon.EnterTextBox pa_packageqty;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ButtonUtil.NormalButton Printing;

+ 59 - 62
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -21,6 +21,9 @@ namespace UAS_MES.Make
         ApplicationClass lbl;
         Thread thread;
         DataTable Dbfind;
+        string ErrorMessage = "";
+        string oMakeCode = "";
+        string oMsID = "";
 
         System.DateTime[] indate;
 
@@ -37,13 +40,12 @@ namespace UAS_MES.Make
 
         private void 包装采集_Load(object sender, EventArgs e)
         {
-            dh = new DataHelper();
             AutoPrint.Checked = true;
             //设置DbFind的必须的数据
             ma_code.FormName = Name;
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_prodname" };
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "ma_prodname" , "pr_outboxinnerqty" };
             ma_code.TableName = "Make left join product on  ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 物料编号,pr_detail # 物料名称";
+            ma_code.SelectField = "ma_code # 工单号,pr_code # 物料编号,pr_detail # 物料名称,pr_outboxinnerqty # 箱内容量";
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
             PrintNum.Value = 1;
@@ -52,6 +54,7 @@ namespace UAS_MES.Make
             SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+            dh = new DataHelper();
         }
 
         private void Ma_code_DbChange(object sender, EventArgs e)
@@ -75,12 +78,16 @@ namespace UAS_MES.Make
         {
             //加载表单数据
             sql.Clear();
-            sql.Append("select pa_outboxcode,pr_id,pa_id,pa_totalqty,pa_packageqty,pa_totalqty-pa_packageqty pa_restqty,ma_prodcode,pr_detail,");
-            sql.Append("pr_colorboxmaxw,pr_colorboxminw,pr_code,pa_makecode as ma_code from package left join packagedetail on  ");
-            sql.Append("pd_paid=pa_id left join product left join make on ma_prodcode=pr_code on pa_prodcode=pr_code where ");
+            sql.Append("select pa_outboxcode,pr_id,pa_id,pr_outboxinnerqty,pa_packageqty,pa_totalqty-pa_packageqty pa_restqty,pr_code,pr_detail,");
+            sql.Append("pr_colorboxmaxw,pr_colorboxminw,pr_code,pa_makecode as ma_code,pr_outboxinnerqty from package left join packagedetail on  ");
+            sql.Append("pd_paid=pa_id left join product on pa_prodcode=pr_code where ");
             sql.Append("(pa_outboxcode='" + pa_outboxcode.Text + "' or pd_barcode='" + barcode.Text + "') and rownum=1 ");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            BaseUtil.SetFormValue(this.Controls, dt);
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(this.Controls, dt);
+            }
+            else OperateResult.AppendText(">>序列号不存在\n", Color.Red);
             //加载Grid数据
             dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
@@ -107,7 +114,7 @@ namespace UAS_MES.Make
         private void Print_Click(object sender, EventArgs e)
         {
             //未采集满的时候点击打印,进行提示
-            if (pa_totalqty.Text != pa_packageqty.Text)
+            if (pr_outboxinnerqty.Text != pa_packageqty.Text)
             {
                 DialogResult result = MessageBox.Show("该箱未采集满,确定打印?", "提示", MessageBoxButtons.YesNo);
                 if (result.ToString() == "Yes")
@@ -158,75 +165,63 @@ namespace UAS_MES.Make
                 if (pa_outboxcode.Text != "" && barcode.Text != "")
                 {
                     //判断箱内总数必须大于0
-                    if (pa_totalqty.Text == "" || pa_totalqty.Text == "0")
+                    if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
                     {
                         OperateResult.AppendText(">>箱内数量必须大于0\n", Color.Red);
                         return;
                     }
-                    //如果未勾选了取消录入
-                    if (!Cancel.Checked)
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, barcode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage)) { }
                     {
-                        //判断序列号是否已经装箱
-                        if (dh.CheckExist("packagedetail", "pd_barcode='" + barcode.Text + "'"))
+                        //如果未勾选了取消录入
+                        if (!Cancel.Checked)
                         {
-                            OperateResult.AppendText("序列号" + barcode.Text + "已经装箱!\n", Color.Red);
-                            barcode.Clear();
-                        }
-                        else
-                        {
-                            //箱号不存在的情况
-                            if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                            //判断序列号是否已经装箱
+                            if (dh.CheckExist("packagedetail", "pd_barcode='" + barcode.Text + "'"))
                             {
-                                //插入Package主表箱号信息
-                                sql.Clear();
-                                sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,pa_custcode)");
-                                sql.Append("select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pa_totalqty.Text + ",0,");
-                                sql.Append("sysdate,'" + ma_code.Text + "', ma_prodcode,ma_salecode,ma_custcode from make where ma_code = '" + ma_code.Text + "'");
-                                dh.ExecuteSql(sql.GetString(), "insert");
-                                OperateResult.AppendText("箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
-                                //验证序列号插入明细表的数据
-                                InsertDetail();
+                                OperateResult.AppendText("序列号" + barcode.Text + "已经装箱!\n", Color.Red);
+                                barcode.Clear();
                             }
                             else
                             {
-                                //判断序列号是否存在于制造工序表中
-                                if (dh.getRowCount("makeserial", "ms_sncode='" + barcode.Text + "'") > 0)
+                                //箱号不存在的情况
+                                if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                 {
-                                    //如果存在则判断当前执行的工序是否是采集工序
-                                    string ErrorMessage = "";
-                                    bool ifFirst;
-                                    if (LogicHandler.CheckCurrentStepAndIfFirst(barcode.Text, ma_code.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
-                                    {
-                                        if (ifFirst)
-                                        {
-                                            InsertDetail();
-                                        }
-                                        else OperateResult.AppendText("序列号" + barcode.Text + "无效!\n", Color.Red);
-                                    }
-                                    else OperateResult.AppendText(">>" + ErrorMessage + "!\n", Color.Red);
+                                    //插入Package主表箱号信息
+                                    sql.Clear();
+                                    sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,pa_custcode)");
+                                    sql.Append("select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
+                                    sql.Append("sysdate,'" + ma_code.Text + "', ma_prodcode,ma_salecode,ma_custcode from make where ma_code = '" + ma_code.Text + "'");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                    OperateResult.AppendText("箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
+                                    //验证序列号插入明细表的数据
+                                    InsertDetail();
                                 }
                                 else
                                 {
-                                    InsertDetail();
+                                    //判断序列号是否存在于制造工序表中
+                                    if (dh.getRowCount("makeserial", "ms_sncode='" + barcode.Text + "'") > 0)
+                                    {
+                                        InsertDetail();
+                                    }
                                 }
                             }
                         }
-                    }
-                    //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
-                    else
-                    {
-                        dt = (DataTable)dh.ExecuteSql("select pd_outboxcode from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "' and pd_barcode='" + barcode.Text + "'", "select");
-                        if (dt.Rows.Count > 0)
+                        //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
+                        else
                         {
-                            //删除明细行的数据
-                            dh.ExecuteSql("delete from packagedetail where pd_barcode='" + barcode.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
-                            //更新已装数 
-                            dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                            dh.UpdateByCondition("makeserial", "ms_nextstepcode=ms_stepcode", "ms_sncode='" + barcode.Text + "'");
-                            OperateResult.AppendText(">>已从该箱中移除序列号" + barcode.Text + "\n", Color.Green);
-                            LoadData();
+                            dt = (DataTable)dh.ExecuteSql("select pd_outboxcode from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "' and pd_barcode='" + barcode.Text + "'", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                //删除明细行的数据
+                                dh.ExecuteSql("delete from packagedetail where pd_barcode='" + barcode.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
+                                //更新已装数 
+                                dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                dh.UpdateByCondition("makeserial", "ms_nextstepcode=ms_stepcode", "ms_sncode='" + barcode.Text + "'");
+                                OperateResult.AppendText(">>已从该箱中移除序列号" + barcode.Text + "\n", Color.Green);
+                                LoadData();
+                            }
+                            else OperateResult.AppendText(">>序列号" + barcode.Text + "不在该箱内,请输入正确的序列号\n", Color.Red);
                         }
-                        else OperateResult.AppendText(">>序列号" + barcode.Text + "不在该箱内,请输入正确的序列号\n", Color.Red);
                     }
                 }
                 else LoadData();
@@ -242,10 +237,12 @@ namespace UAS_MES.Make
         {
             if (AutoPrint.Checked)
             {
-                if (pa_totalqty.Text == pa_packageqty.Text)
+                if (pr_outboxinnerqty.Text == pa_packageqty.Text)
                 {
-                    OperateResult.AppendText(">>打印箱号"+pa_outboxcode.Text+"\n", Color.Green);
+                    OperateResult.AppendText(">>打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
                     Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                    PackageDetail.DataSource = null;
+                    BaseUtil.CleanForm(this);
                 }
             }
         }
@@ -260,7 +257,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + ma_prodcode.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -280,7 +277,7 @@ namespace UAS_MES.Make
 
         private void 包装采集_FormClosing(object sender, FormClosingEventArgs e)
         {
-            //lbl.Quit();
+            lbl.Quit();
         }
 
         private void ma_code_UserControlTextChanged(object sender, EventArgs e)

+ 11 - 10
UAS-MES/Login.Designer.cs

@@ -52,7 +52,7 @@
             this.UserName.Location = new System.Drawing.Point(94, 62);
             this.UserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.UserName.Name = "UserName";
-            this.UserName.Size = new System.Drawing.Size(200, 27);
+            this.UserName.Size = new System.Drawing.Size(200, 23);
             this.UserName.TabIndex = 0;
             // 
             // PassWord
@@ -61,7 +61,7 @@
             this.PassWord.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.PassWord.Name = "PassWord";
             this.PassWord.PasswordChar = '*';
-            this.PassWord.Size = new System.Drawing.Size(200, 27);
+            this.PassWord.Size = new System.Drawing.Size(200, 23);
             this.PassWord.TabIndex = 1;
             this.PassWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PassWord_KeyDown);
             // 
@@ -70,7 +70,7 @@
             this.ForGetPwd.AutoSize = true;
             this.ForGetPwd.Location = new System.Drawing.Point(295, 66);
             this.ForGetPwd.Name = "ForGetPwd";
-            this.ForGetPwd.Size = new System.Drawing.Size(84, 20);
+            this.ForGetPwd.Size = new System.Drawing.Size(68, 17);
             this.ForGetPwd.TabIndex = 5;
             this.ForGetPwd.TabStop = true;
             this.ForGetPwd.Text = "忘记密码?";
@@ -81,7 +81,7 @@
             this.label1.AutoSize = true;
             this.label1.Location = new System.Drawing.Point(42, 66);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(54, 20);
+            this.label1.Size = new System.Drawing.Size(44, 17);
             this.label1.TabIndex = 4;
             this.label1.Text = "用户名";
             // 
@@ -90,7 +90,7 @@
             this.label2.AutoSize = true;
             this.label2.Location = new System.Drawing.Point(42, 111);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(51, 20);
+            this.label2.Size = new System.Drawing.Size(44, 17);
             this.label2.TabIndex = 5;
             this.label2.Text = "密   码";
             // 
@@ -118,7 +118,7 @@
             this.label4.AutoSize = true;
             this.label4.Location = new System.Drawing.Point(42, 160);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(51, 20);
+            this.label4.Size = new System.Drawing.Size(44, 17);
             this.label4.TabIndex = 14;
             this.label4.Text = "资   源";
             // 
@@ -127,7 +127,7 @@
             this.Source.Location = new System.Drawing.Point(94, 157);
             this.Source.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.Source.Name = "Source";
-            this.Source.Size = new System.Drawing.Size(200, 27);
+            this.Source.Size = new System.Drawing.Size(200, 23);
             this.Source.TabIndex = 2;
             this.Source.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Source_KeyDown);
             // 
@@ -137,7 +137,7 @@
             this.DB.FormattingEnabled = true;
             this.DB.Location = new System.Drawing.Point(94, 204);
             this.DB.Name = "DB";
-            this.DB.Size = new System.Drawing.Size(200, 28);
+            this.DB.Size = new System.Drawing.Size(200, 25);
             this.DB.TabIndex = 3;
             // 
             // label3
@@ -145,7 +145,7 @@
             this.label3.AutoSize = true;
             this.label3.Location = new System.Drawing.Point(42, 209);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(54, 20);
+            this.label3.Size = new System.Drawing.Size(44, 17);
             this.label3.TabIndex = 11;
             this.label3.Text = "数据库";
             // 
@@ -185,7 +185,7 @@
             // 
             // Login
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.BackgroundImage = global::UAS_MES.Properties.Resources.LoginBG;
@@ -200,6 +200,7 @@
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Tag = "ShowDialogWindow";
             this.Text = "UAS-MES";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Login_FormClosing);
             this.Load += new System.EventHandler(this.Login_Load);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();

+ 5 - 0
UAS-MES/Login.cs

@@ -209,5 +209,10 @@ namespace UAS_MES
                 }
             }
         }
+
+        private void Login_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            dh.Dispose();
+        }
     }
 }