Quellcode durchsuchen

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

Hcsy vor 8 Jahren
Ursprung
Commit
0df03ab3c4

+ 1 - 1
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxGeneratePaCode.cs

@@ -54,7 +54,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
 
-        private void GeneratePaCode_Click(object sender, EventArgs e)
+        public void GeneratePaCode_Click(object sender, EventArgs e)
         {
             IconClick?.Invoke(sender, new EventArgs());
             //如果未实现则继续

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

+ 155 - 133
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -54,12 +54,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.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
+            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.PrinterList = 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.Cancel = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_qty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -69,34 +70,36 @@
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             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.AutoPrint = new System.Windows.Forms.CheckBox();
+            this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.label1 = new System.Windows.Forms.Label();
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
             this.panel3.SuspendLayout();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
             // 
             // 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
             // 
@@ -205,31 +208,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 +248,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 +269,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 +309,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 = "制造单号";
             // 
@@ -327,7 +330,7 @@
             // 
             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(800, 86);
+            this.Printer_label.Location = new System.Drawing.Point(800, 87);
             this.Printer_label.Name = "Printer_label";
             this.Printer_label.Size = new System.Drawing.Size(84, 20);
             this.Printer_label.TabIndex = 162;
@@ -337,19 +340,43 @@
             // 
             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(814, 118);
+            this.PrintLabel_label.Location = new System.Drawing.Point(800, 117);
             this.PrintLabel_label.Name = "PrintLabel_label";
             this.PrintLabel_label.Size = new System.Drawing.Size(69, 20);
             this.PrintLabel_label.TabIndex = 163;
             this.PrintLabel_label.Text = "打印标签";
             // 
-            // Printer
+            // ComList
+            // 
+            this.ComList.Location = new System.Drawing.Point(908, 2);
+            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;
+            // 
+            // PrinterList
             // 
-            this.Printer.Location = new System.Drawing.Point(908, 86);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(119, 20);
-            this.Printer.TabIndex = 160;
+            this.PrinterList.Location = new System.Drawing.Point(908, 87);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
+            this.PrinterList.Name = "PrinterList";
+            this.PrinterList.Size = new System.Drawing.Size(119, 20);
+            this.PrinterList.TabIndex = 160;
             // 
             // StopWeight
             // 
@@ -358,7 +385,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 +404,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,43 +420,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
-            // 
-            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";
-            // 
-            // Cancel
-            // 
-            this.Cancel.AllPower = null;
-            this.Cancel.BackColor = System.Drawing.Color.Transparent;
-            this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
-            this.Cancel.Image = ((System.Drawing.Image)(resources.GetObject("Cancel.Image")));
-            this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(939, 150);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
-            this.Cancel.Name = "Cancel";
-            this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
-            this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(60, 24);
-            this.Cancel.TabIndex = 153;
-            this.Cancel.Text = "取消";
-            this.Cancel.UseVisualStyleBackColor = true;
-            this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
+            // mcd_okqty
+            // 
+            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";
             // 
             // Confirm
             // 
@@ -438,7 +446,7 @@
             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(846, 150);
+            this.Confirm.Location = new System.Drawing.Point(888, 156);
             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";
@@ -454,11 +462,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 +474,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 +510,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,11 +546,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(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;
@@ -559,48 +567,59 @@
             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;
+            // AutoPrint
+            // 
+            this.AutoPrint.AutoSize = true;
+            this.AutoPrint.Checked = true;
+            this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 10.8F);
+            this.AutoPrint.Location = new System.Drawing.Point(804, 23);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(88, 24);
+            this.AutoPrint.TabIndex = 168;
+            this.AutoPrint.Text = "自动打印";
+            this.AutoPrint.UseVisualStyleBackColor = true;
+            // 
+            // PrintNum
+            // 
+            this.PrintNum.Location = new System.Drawing.Point(908, 56);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Size = new System.Drawing.Size(120, 21);
+            this.PrintNum.TabIndex = 169;
+            this.PrintNum.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // label1
+            // 
+            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(800, 57);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(69, 20);
+            this.label1.TabIndex = 170;
+            this.label1.Text = "打印张数";
             // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1042, 584);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.PrintNum);
+            this.Controls.Add(this.AutoPrint);
             this.Controls.Add(this.ComList);
             this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.PrintLabel_label);
             this.Controls.Add(this.Printer_label);
-            this.Controls.Add(this.Printer);
+            this.Controls.Add(this.PrinterList);
             this.Controls.Add(this.PrintLabel);
             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.Cancel);
+            this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.ma_qty);
@@ -628,19 +647,20 @@
             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);
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -676,17 +696,19 @@
         private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         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;
         private System.Windows.Forms.ComboBox PrintLabel;
-        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
         private System.Windows.Forms.Label Printer_label;
         private System.Windows.Forms.Label PrintLabel_label;
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
         private CustomControl.ComBoxWithFocus.SerialPortCombox ComList;
+        private System.Windows.Forms.CheckBox AutoPrint;
+        private System.Windows.Forms.NumericUpDown PrintNum;
+        private System.Windows.Forms.Label label1;
     }
 }

+ 52 - 33
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,32 @@ namespace UAS_MES.Make
         //是否通过串口获取数据
         bool GetData = true;
 
+        Thread InitPrint;
+
+        System.DateTime[] indate;
+
         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);
             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();
+            dh = new DataHelper();
+        }
+
+        private void InPrint()
+        {
+            lbl = new ApplicationClass();
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -78,16 +92,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")
                             {
@@ -97,28 +112,29 @@ namespace UAS_MES.Make
                         }
                         //如果未打开串口设置为0
                         int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
-                        if (ActualWeight > MinWeight && ActualWeight < MaxWeight)
+                        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);
+                                if (AutoPrint.Checked)
+                                {
+                                    OperateResult.AppendText(">>打印条码号" + sncode.Text + "\n", Color.Green);
+                                    Confirm.PerformClick();
+                                }
+                                sncode.Text = "";
+                            }
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                         }
-                        else
-                            OperateResult.AppendText(">>检测未通过\n", Color.Red, sncode);
+                        else OperateResult.AppendText(">>" + sncode.Text + "重量检测未通过\n", Color.Red, sncode);
                     }
-                    else
-                    {
-                        OperateResult.AppendText(">>" + ErrorMessage + "\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 +161,7 @@ namespace UAS_MES.Make
                     }
                     catch (IOException ex) { MessageBox.Show(ex.Message); }
                 }
-                else
-                    MessageBox.Show("端口已被占用,请关闭其他窗口");
+                else OperateResult.AppendText(">>端口已被占用,请关闭其他窗口\n", Color.Red);
             }
         }
 
@@ -163,6 +178,7 @@ namespace UAS_MES.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
+            StopWeight.PerformClick();
             if (serialPort1.IsOpen)
             {
                 GetData = false;
@@ -175,12 +191,7 @@ namespace UAS_MES.Make
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
-        }
-
-        private void Cancel_Click(object sender, EventArgs e)
-        {
-            string Error = "";
+            Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
         }
 
         private void StartWeight_Click(object sender, EventArgs e)
@@ -199,7 +210,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,9 +223,17 @@ 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.DisplayMember = "pl_labelname";
+            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";
+            ftpOperater ftp = new ftpOperater();
+            indate = new System.DateTime[dt.Rows.Count];
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
+                indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+            }
         }
     }
 }

+ 0 - 131
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.resx

@@ -378,137 +378,6 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="Cancel.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
-        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
-        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
-        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
-        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
-        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
-        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="Cancel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
-        DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
-        bGUAAEjHnZZ3VFTXFofPvXd6oc0w0hl6ky4wgPQuIB0EURhmBhjKAMMMTWyIqEBEEREBRZCggAGjoUis
-        iGIhKKhgD0gQUGIwiqioZEbWSnx5ee/l5ffHvd/aZ+9z99l7n7UuACRPHy4vBZYCIJkn4Ad6ONNXhUfQ
-        sf0ABniAAaYAMFnpqb5B7sFAJC83F3q6yAn8i94MAUj8vmXo6U+ng/9P0qxUvgAAyF/E5mxOOkvE+SJO
-        yhSkiu0zIqbGJIoZRomZL0pQxHJijlvkpZ99FtlRzOxkHlvE4pxT2clsMfeIeHuGkCNixEfEBRlcTqaI
-        b4tYM0mYzBXxW3FsMoeZDgCKJLYLOKx4EZuImMQPDnQR8XIAcKS4LzjmCxZwsgTiQ7mkpGbzuXHxArou
-        S49uam3NoHtyMpM4AoGhP5OVyOSz6S4pyalMXjYAi2f+LBlxbemiIluaWltaGpoZmX5RqP+6+Dcl7u0i
-        vQr43DOI1veH7a/8UuoAYMyKarPrD1vMfgA6tgIgd/8Pm+YhACRFfWu/8cV5aOJ5iRcIUm2MjTMzM424
-        HJaRuKC/6386/A198T0j8Xa/l4fuyollCpMEdHHdWClJKUI+PT2VyeLQDf88xP848K/zWBrIieXwOTxR
-        RKhoyri8OFG7eWyugJvCo3N5/6mJ/zDsT1qca5Eo9Z8ANcoISN2gAuTnPoCiEAESeVDc9d/75oMPBeKb
-        F6Y6sTj3nwX9+65wifiRzo37HOcSGExnCfkZi2viawnQgAAkARXIAxWgAXSBITADVsAWOAI3sAL4gWAQ
-        DtYCFogHyYAPMkEu2AwKQBHYBfaCSlAD6kEjaAEnQAc4DS6Ay+A6uAnugAdgBIyD52AGvAHzEARhITJE
-        geQhVUgLMoDMIAZkD7lBPlAgFA5FQ3EQDxJCudAWqAgqhSqhWqgR+hY6BV2ArkID0D1oFJqCfoXewwhM
-        gqmwMqwNG8MM2An2hoPhNXAcnAbnwPnwTrgCroOPwe3wBfg6fAcegZ/DswhAiAgNUUMMEQbigvghEUgs
-        wkc2IIVIOVKHtCBdSC9yCxlBppF3KAyKgqKjDFG2KE9UCIqFSkNtQBWjKlFHUe2oHtQt1ChqBvUJTUYr
-        oQ3QNmgv9Cp0HDoTXYAuRzeg29CX0HfQ4+g3GAyGhtHBWGE8MeGYBMw6TDHmAKYVcx4zgBnDzGKxWHms
-        AdYO64dlYgXYAux+7DHsOewgdhz7FkfEqeLMcO64CBwPl4crxzXhzuIGcRO4ebwUXgtvg/fDs/HZ+BJ8
-        Pb4LfwM/jp8nSBN0CHaEYEICYTOhgtBCuER4SHhFJBLVidbEACKXuIlYQTxOvEIcJb4jyZD0SS6kSJKQ
-        tJN0hHSedI/0ikwma5MdyRFkAXknuZF8kfyY/FaCImEk4SXBltgoUSXRLjEo8UISL6kl6SS5VjJHslzy
-        pOQNyWkpvJS2lIsUU2qDVJXUKalhqVlpirSptJ90snSxdJP0VelJGayMtoybDFsmX+awzEWZMQpC0aC4
-        UFiULZR6yiXKOBVD1aF6UROoRdRvqP3UGVkZ2WWyobJZslWyZ2RHaAhNm+ZFS6KV0E7QhmjvlygvcVrC
-        WbJjScuSwSVzcopyjnIcuUK5Vrk7cu/l6fJu8onyu+U75B8poBT0FQIUMhUOKlxSmFakKtoqshQLFU8o
-        3leClfSVApXWKR1W6lOaVVZR9lBOVd6vfFF5WoWm4qiSoFKmclZlSpWiaq/KVS1TPaf6jC5Ld6In0Svo
-        PfQZNSU1TzWhWq1av9q8uo56iHqeeqv6Iw2CBkMjVqNMo1tjRlNV01czV7NZ874WXouhFa+1T6tXa05b
-        RztMe5t2h/akjpyOl06OTrPOQ12yroNumm6d7m09jB5DL1HvgN5NfVjfQj9ev0r/hgFsYGnANThgMLAU
-        vdR6KW9p3dJhQ5Khk2GGYbPhqBHNyMcoz6jD6IWxpnGE8W7jXuNPJhYmSSb1Jg9MZUxXmOaZdpn+aqZv
-        xjKrMrttTjZ3N99o3mn+cpnBMs6yg8vuWlAsfC22WXRbfLS0suRbtlhOWWlaRVtVWw0zqAx/RjHjijXa
-        2tl6o/Vp63c2ljYCmxM2v9ga2ibaNtlOLtdZzllev3zMTt2OaVdrN2JPt4+2P2Q/4qDmwHSoc3jiqOHI
-        dmxwnHDSc0pwOub0wtnEme/c5jznYuOy3uW8K+Lq4Vro2u8m4xbiVun22F3dPc692X3Gw8Jjncd5T7Sn
-        t+duz2EvZS+WV6PXzAqrFetX9HiTvIO8K72f+Oj78H26fGHfFb57fB+u1FrJW9nhB/y8/Pb4PfLX8U/z
-        /z4AE+AfUBXwNNA0MDewN4gSFBXUFPQm2Dm4JPhBiG6IMKQ7VDI0MrQxdC7MNaw0bGSV8ar1q66HK4Rz
-        wzsjsBGhEQ0Rs6vdVu9dPR5pEVkQObRGZ03WmqtrFdYmrT0TJRnFjDoZjY4Oi26K/sD0Y9YxZ2O8Yqpj
-        ZlgurH2s52xHdhl7imPHKeVMxNrFlsZOxtnF7YmbineIL4+f5rpwK7kvEzwTahLmEv0SjyQuJIUltSbj
-        kqOTT/FkeIm8nhSVlKyUgVSD1ILUkTSbtL1pM3xvfkM6lL4mvVNAFf1M9Ql1hVuFoxn2GVUZbzNDM09m
-        SWfxsvqy9bN3ZE/kuOd8vQ61jrWuO1ctd3Pu6Hqn9bUboA0xG7o3amzM3zi+yWPT0c2EzYmbf8gzySvN
-        e70lbEtXvnL+pvyxrR5bmwskCvgFw9tst9VsR23nbu/fYb5j/45PhezCa0UmReVFH4pZxde+Mv2q4quF
-        nbE7+0ssSw7uwuzi7Rra7bD7aKl0aU7p2B7fPe1l9LLCstd7o/ZeLV9WXrOPsE+4b6TCp6Jzv+b+Xfs/
-        VMZX3qlyrmqtVqreUT13gH1g8KDjwZYa5ZqimveHuIfu1nrUttdp15UfxhzOOPy0PrS+92vG140NCg1F
-        DR+P8I6MHA082tNo1djYpNRU0gw3C5unjkUeu/mN6zedLYYtta201qLj4Ljw+LNvo78dOuF9ovsk42TL
-        d1rfVbdR2grbofbs9pmO+I6RzvDOgVMrTnV32Xa1fW/0/ZHTaqerzsieKTlLOJt/duFczrnZ86nnpy/E
-        XRjrjup+cHHVxds9AT39l7wvXbnsfvlir1PvuSt2V05ftbl66hrjWsd1y+vtfRZ9bT9Y/NDWb9nffsPq
-        RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
-        lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
-        f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALEwAACxMBAJqcGAAACfBJREFUeF7t3dtuFFcC
-        heFc5VWQRsrL5T0iRcrDkJAjJOADNjbdbvD5iE9tu302RIq0Z6+ynWkmS6oZrlys/+KT8FJX3f2bcmPa
-        X5RSAISyI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCD
-        HQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0B
-        ZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSw
-        I4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOA
-        DHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2
-        BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEf5/vsnj6pvqpnqr6oAePDU
-        qppVu49c2+PsWC/8urpZXV0rR8fH5f2HD+XDGH0N4GH47zbVrNpVw2rZNX7voy/qi7+sHvd6C2U0Oi03
-        7z+Um5v35RpAZ6hZtauG1bKaVtvjrd/76Iv6om/7/UG9+PZGV9c3d67L5RWAh06t3nfbHAa1ZTVd2/5m
-        vPV7f/+hvuCr6q8r3UQ3u7wqF9X5xSWAjlG7avi+ZbVd/Ws8fhk/AL5dXl75O/qz84tyenZ+56yMTgE8
-        dGr1vls1fH8YLNW2a+P/eAoYPwAWD4ZH5fT8sozqxSf1Zsejs3J0cgqgY9SuGlbLavrgcKgDYDAev4wf
-        AH+OTmv4o/NyrJscjcqwOhyeAOgYtauG1fJ907Xxs/H4ZfwAqC+sf+Mfn9aLT+qJcVwdlf0DAF2jdtWw
-        WlbTaluN3/d+76MDQC88PDxpbrC7N6wOy7tdAF2jdtWwWlbTarv1ANCJsbc/bG6ws7Nftrb3AHSUGlbL
-        avqwtt16AOzV02Jn96Bs1Qs3t3fLxua7sg6gc9SuGlbLalpttx4AOi10wcbmblnb2Cmr69tlZQ1A16hd
-        NayW1bTabj0AtncObuNf3ykrq1tleWWzLC0D6Bq1q4bVsppW260HwObWbfy6eHFpo7xdXC9v3q4B6Bi1
-        q4bVsppW260HwPr6u3rBVr14owzerJWFwWrpL6wA6Bi1q4bVsppW260HwMrqdnNq6MJef6W87i2X+ddL
-        ADpG7aphtaym1XbrAbBUHxcG9fGht7Bc5l4vllfzb8vs3BsAHaN21bBaVtNqu/UA0PcNenzQhTOv3pSX
-        s4MyPbMAoGPUrhpWy2pabbceAHpceN1bKrOKv95karpfJqd6ADpG7aphtaym1XbrAdAf1L/95xfrhYMy
-        Od0rLyZfl+cT8wA6Ru2qYbWsptV26wHQ6y833z9MvezXG8yXP17Mld+fvwLQMWpXDatlNa22Ww8AvXuo
-        E2Nislf+eD5Xnv3+qjx9NgugY9SuGlbLalpttx4Ac3OLZXp6oTx/MV9vMFt+ezpTfv3tJYCOUbtqWC2r
-        abXdegDMzr2t3zf06yPEXPnt2Uz5pd7o51+nAXSM2lXDallNq+3WA2BmdtC8eaCTQzf46Zep8uPPkwA6
-        Ru2qYbWsptV26wGg7xX0DuLT32eaU0Q3evLTBICOUbtqWC2rabXdegDoBwiev7h9/NcJohv98OMLAB2j
-        dtWwWlbTarv1AJh6udC8c/jr05l6gkzVG02U75+8ANAxalcNq2U1rbbbD4C7NwD1vcOTnyabGz3+4TmA
-        jlG7algtq2m1zQEAhOAAAIJ92gHAewDAZ+GT3gPgXwGAz8Mn/SsAPwcAfB4+6ecA+ElA4POgdtXw//WT
-        gPxfAODzoHbVsFr+n/8vgD44YPrlQn1kqE8Bf7yqN5ht3kQA0C1qVw2rZTWttlsPgPneUvNZYhNTveYD
-        BXSDp/URAkC3qF01rJbVtNpuPQB6CyvlVX1U0DuGE1O3HwemmwDoFrWrhtWymlbbrQfAYLDafHLIzOyb
-        +thw+4GgE5OvAXSM2lXDallNq+3WA+DN4vrtU0D9fqE5BGYGzQ8QAOgWtauG1bKaVtutB8Di8mZZ0EeD
-        95ebC/XOoT5bHEC3qF01rJbVtNpuPQD020TfLq3XC1abC/XGgX6xAIBuUbu38a82Tavt1gNgbf1dWVrZ
-        qo8LG82p0a/fN+jxAUC3qF01rJbVtNpuPQD49eDA5+GTfj349s5B2di8PQT020R18VL93gFAt6hdNayW
-        1bTabj0AdncP6wv3y2a9YH1jp168XVbXAHSN2lXDallN7+4dth8A+wfHd4fAQdna3quPDXvN6QGgW9Su
-        GlbLalpttx4Aw+FJfeFRPS2G5d3uQdl5d9CcHgC6Re2qYbWsptV22wHw59HxqAyPTsrB4XFz0d7+sHl0
-        ANAtalcNq2U1LbXxy/H4ZfwAWNk/GJaT0Vk5Oj6tF4zKYT01dAMA3aJ21bBaVtN7+817AIPx+GX8APhu
-        aXmlnJ1flNHZeXPR8clpOboz1NMBgAftvle1q4bVsppeXGr+M9C34/HL+AHwVfXXxcVVOa/Ozi/L6dlF
-        dV5GpwC6Qs2qXTWsltW02lbj4/HLR1/UF3zX7w/K1fVNuby6LheXt4fBLd3sjm4M4GEYb/OuV7WrhtWy
-        mq5t/+Nvf/noi/qiL6vHvV6/PkKMynW9WDe4uq43qjfTDQE8TGq0abU2q3bVsFpW02p7vPV7/xikvvjr
-        6mZlZbUcHR2Xm/cfxrwH8OD8p1E1q3bVsFp2jd+zo9QLH1XfVHOVbgagG9Ss2n3k2h5nRwAZ7Agggx0B
-        ZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSw
-        I4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOA
-        DHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2
-        BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQ
-        wY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGO
-        ADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy
-        2BFABjsCSFC++DdnYZod1cA/NQAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="Cancel.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
-        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
-        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
-        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
-        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
-        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
-        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
-        gg==
-</value>
-  </data>
-  <data name="Cancel.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
-        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
-        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
-        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
-        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
-        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
-        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
-        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="Confirm.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_LabelCheck.Designer.cs

@@ -1,4 +1,4 @@
-namespace UAS_MES.FunctionCode.Make
+namespace UAS_MES.Make
 {
     partial class Make_LabelCheck
     {
@@ -257,6 +257,7 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Name = "Make_LabelCheck";
             this.Tag = "Make!LabelCheck";
+            this.Text = "标签核对";
             this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
             this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
             this.ResumeLayout(false);

+ 37 - 30
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -10,7 +10,7 @@ using UAS_MES.DataOperate;
 using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 
-namespace UAS_MES.FunctionCode.Make
+namespace UAS_MES.Make
 {
     public partial class Make_LabelCheck : Form
     {
@@ -94,28 +94,37 @@ namespace UAS_MES.FunctionCode.Make
                         sql.Clear();
                         sql.Append("select ms_imei1 from  makeserial  where ms_id=:msid");
                         info = (DataTable)dh.ExecuteSql(sql.GetString(), "select", dt.Rows[0]["ms_id"].ToString());
-                        //不为null 并且不为””才继续
-                        if (info.Rows[0]["ms_imei1"].ToString() == null || info.Rows[0]["ms_imei1"].ToString() == "")
+                        if (info.Rows.Count > 0)
                         {
-                            // SN对应的IMEI不存在
-                            //>> 请输入SN
-                            OperateResult.AppendText("<<SN" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
-                            sncode.Text = "";
-                            OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                            //不为null 并且不为””才继续
+                            if (info.Rows[0]["ms_imei1"].ToString() == null || info.Rows[0]["ms_imei1"].ToString() == "")
+                            {
+                                // SN对应的IMEI不存在
+                                //>> 请输入SN
+                                OperateResult.AppendText("<<SN" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
+                                sncode.Text = "";
+                                OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                            }
+                            else
+                            //存在该imei信息
+                            {
+                                //用变量记录imei1和makecode
+                                imei1 = info.Rows[0]["ms_imei1"].ToString();
+                                SN = sncode.Text;
+                                //>>SN对应的IMEI号为:xxxxxxxxx
+                                //>> 请输入彩盒上的IMEI
+                                OperateResult.AppendText("<<SN对应的IMEI号为:" + imei1 + "\n", Color.Green);
+                                OperateResult.AppendText(">>请输入彩盒上的IMEI\n", Color.Green);
+                                sncode.Text = "";
+                                //设定要输入imei1
+                                isImei1 = true;
+                            }
                         }
                         else
-                        //存在该imei信息
                         {
-                            //用变量记录imei1和makecode
-                            imei1 = info.Rows[0]["ms_imei1"].ToString();
-                            SN = sncode.Text;
-                            //>>SN对应的IMEI号为:xxxxxxxxx
-                            //>> 请输入彩盒上的IMEI
-                            OperateResult.AppendText("<<SN对应的IMEI号为:" + imei1 + "\n", Color.Green);
-                            OperateResult.AppendText(">>请输入彩盒上的IMEI\n", Color.Green);
+                            OperateResult.AppendText("<<SN" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
                             sncode.Text = "";
-                            //设定要输入imei1
-                            isImei1 = true;
+                            OperateResult.AppendText(">>请输入SN\n", Color.Green);
                         }
                     }
                 }
@@ -189,23 +198,21 @@ namespace UAS_MES.FunctionCode.Make
                 }
             }
         }
-        private void recordResult(string SN, string time, string result) {
+        private void recordResult(string SN, string time, string result)
+        {
             if (showResult.Items.Count >= 10)
             {
                 //如果有10行的话,则删除最前一行
                 showResult.Items.RemoveAt(0);
             }
-            else
-            {
-                //创建一个item
-                ListViewItem lvi = new ListViewItem();
-                //分条赋值
-                lvi.SubItems[1].Text = SN;
-                lvi.SubItems[2].Text = time;
-                lvi.SubItems[3].Text = result;
-                //添加结果的信息进去
-                showResult.Items.Add(lvi);
-            }
+            //创建一个item
+            ListViewItem lvi = new ListViewItem();
+            //分条赋值
+            lvi.SubItems.Add(SN);
+            lvi.SubItems.Add(time);
+            lvi.SubItems.Add(result);
+            //添加结果的信息进去
+            showResult.Items.Add(lvi);
         }
         private void clear() {
             //清空变量的值

+ 57 - 55
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(12, 101);
             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(271, 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;
@@ -129,7 +129,7 @@
             // 
             this.pa_packageqty_label.AutoSize = true;
             this.pa_packageqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_packageqty_label.Location = new System.Drawing.Point(268, 102);
+            this.pa_packageqty_label.Location = new System.Drawing.Point(270, 102);
             this.pa_packageqty_label.Name = "pa_packageqty_label";
             this.pa_packageqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_packageqty_label.TabIndex = 95;
@@ -139,7 +139,7 @@
             // 
             this.pa_totalqty_label.AutoSize = true;
             this.pa_totalqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty_label.Location = new System.Drawing.Point(269, 149);
+            this.pa_totalqty_label.Location = new System.Drawing.Point(271, 149);
             this.pa_totalqty_label.Name = "pa_totalqty_label";
             this.pa_totalqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_totalqty_label.TabIndex = 97;
@@ -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(12, 54);
             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;
@@ -170,7 +170,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(7, 149);
+            this.PrintList_label.Location = new System.Drawing.Point(12, 148);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
@@ -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;
@@ -288,20 +288,21 @@
             // pa_outboxcode
             // 
             this.pa_outboxcode.ErrorMsg = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(108, 54);
+            this.pa_outboxcode.Location = new System.Drawing.Point(109, 54);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(149, 21);
+            this.pa_outboxcode.Size = new System.Drawing.Size(148, 21);
             this.pa_outboxcode.TabIndex = 163;
+            this.pa_outboxcode.IconClick += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode.OnTextChange(this.pa_outboxcode_IconClick);
             this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
             // 
             // PrintList
             // 
-            this.PrintList.Location = new System.Drawing.Point(108, 149);
+            this.PrintList.Location = new System.Drawing.Point(109, 149);
             this.PrintList.Margin = new System.Windows.Forms.Padding(4);
             this.PrintList.Name = "PrintList";
-            this.PrintList.Size = new System.Drawing.Size(150, 25);
+            this.PrintList.Size = new System.Drawing.Size(148, 25);
             this.PrintList.TabIndex = 158;
             // 
             // OperateResult
@@ -321,7 +322,7 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = "工单查询";
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(352, 54);
+            this.ma_code.Location = new System.Drawing.Point(355, 54);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -377,7 +378,7 @@
             this.pa_packageqty.BackColor = System.Drawing.Color.White;
             this.pa_packageqty.Enabled = false;
             this.pa_packageqty.ID = null;
-            this.pa_packageqty.Location = new System.Drawing.Point(351, 102);
+            this.pa_packageqty.Location = new System.Drawing.Point(354, 102);
             this.pa_packageqty.Name = "pa_packageqty";
             this.pa_packageqty.Power = null;
             this.pa_packageqty.Size = new System.Drawing.Size(150, 21);
@@ -388,37 +389,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(355, 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
             // 
@@ -426,10 +427,10 @@
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.Enabled = false;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(108, 102);
+            this.pr_detail.Location = new System.Drawing.Point(109, 102);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
-            this.pr_detail.Size = new System.Drawing.Size(150, 21);
+            this.pr_detail.Size = new System.Drawing.Size(149, 21);
             this.pr_detail.Str = null;
             this.pr_detail.Str1 = null;
             this.pr_detail.Str2 = null;
@@ -489,21 +490,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 +520,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 +551,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 +607,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;

+ 88 - 75
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,16 +78,32 @@ 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)
+            {
+                if (pr_code.Text != "")
+                {
+                    dt.Columns.Remove(dt.Columns["pr_outboxinnerqty"]);
+                }
+                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);
             barcode.Clear();
+            if (pr_outboxinnerqty.Text == pa_packageqty.Text)
+            {
+                pa_restqty.Text = "";
+                pa_packageqty.Text = "";
+                pa_outboxcode.Text = "";
+                BaseUtil.CleanDGVData(PackageDetail);
+                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+            }
         }
 
         private void InsertDetail()
@@ -96,37 +115,35 @@ namespace UAS_MES.Make
                 sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + barcode.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "insert");
                 dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                OperateResult.AppendText("序列号" + barcode.Text + "采集成功!\n", Color.Green);
-                barcode.Clear();
-                LoadData();
+                if (LogicHandler.UpdateMakeMessage(barcode.Text, ma_code.Text, "包装采集", User.UserSourceCode, User.UserCode, "装箱成功", out ErrorMessage))
+                {
+                    OperateResult.AppendText(">>序列号" + barcode.Text + "采集成功!\n", Color.Green);
+                    barcode.Clear();
+                    LoadData();
+                }
             }
             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
-
         }
 
         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")
                 {
-                    try
-                    {
-                        OperateResult.AppendText("开始打印\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]);
-                    }
-                    catch
-                    {
-                        OperateResult.AppendText(">>打印程序异常,请检查是否连接打印机或者打印软件是否安装\n", Color.Red);
-                    }
+                    OperateResult.AppendText(">>开始打印\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]);
                 }
             }
             else
             {
                 if (PrintLabel.SelectedValue != null)
+                {
+                    OperateResult.AppendText(">>开始打印\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]);
+                }
             }
         }
 
@@ -158,76 +175,64 @@ 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 + "'");
+                                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 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
                 else LoadData();
             }
@@ -242,9 +247,9 @@ 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]);
                 }
             }
@@ -260,7 +265,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 +285,8 @@ namespace UAS_MES.Make
 
         private void 包装采集_FormClosing(object sender, FormClosingEventArgs e)
         {
-            //lbl.Quit();
+            lbl.Quit();
+            dh.Dispose();
         }
 
         private void ma_code_UserControlTextChanged(object sender, EventArgs e)
@@ -294,5 +300,12 @@ namespace UAS_MES.Make
                 BaseUtil.SetFormValue(this.Controls, dt);
             }
         }
+
+        private void pa_outboxcode_IconClick(object sender, EventArgs e)
+        {
+            pa_restqty.Text = "";
+            pa_packageqty.Text = "";
+            BaseUtil.CleanDGVData(PackageDetail);
+        }
     }
 }

+ 92 - 80
UAS-MES/FunctionCode/Make/Make_PalletCollection.Designer.cs

@@ -71,10 +71,10 @@
             // 
             this.pa_outboxcode_label.AutoSize = true;
             this.pa_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_outboxcode_label.Location = new System.Drawing.Point(27, 38);
+            this.pa_outboxcode_label.Location = new System.Drawing.Point(30, 46);
             this.pa_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_outboxcode_label.Name = "pa_outboxcode_label";
-            this.pa_outboxcode_label.Size = new System.Drawing.Size(52, 27);
+            this.pa_outboxcode_label.Size = new System.Drawing.Size(62, 31);
             this.pa_outboxcode_label.TabIndex = 102;
             this.pa_outboxcode_label.Text = "箱号";
             // 
@@ -82,10 +82,10 @@
             // 
             this.pa_totalqty_label.AutoSize = true;
             this.pa_totalqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty_label.Location = new System.Drawing.Point(314, 34);
+            this.pa_totalqty_label.Location = new System.Drawing.Point(353, 41);
             this.pa_totalqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_totalqty_label.Name = "pa_totalqty_label";
-            this.pa_totalqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_totalqty_label.Size = new System.Drawing.Size(110, 31);
             this.pa_totalqty_label.TabIndex = 104;
             this.pa_totalqty_label.Text = "箱内数量";
             // 
@@ -93,10 +93,10 @@
             // 
             this.pa_salecode_label.AutoSize = true;
             this.pa_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode_label.Location = new System.Drawing.Point(27, 98);
+            this.pa_salecode_label.Location = new System.Drawing.Point(30, 118);
             this.pa_salecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_salecode_label.Name = "pa_salecode_label";
-            this.pa_salecode_label.Size = new System.Drawing.Size(72, 27);
+            this.pa_salecode_label.Size = new System.Drawing.Size(86, 31);
             this.pa_salecode_label.TabIndex = 106;
             this.pa_salecode_label.Text = "订单号";
             // 
@@ -104,10 +104,10 @@
             // 
             this.pa_makecode_label.AutoSize = true;
             this.pa_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_makecode_label.Location = new System.Drawing.Point(604, 34);
+            this.pa_makecode_label.Location = new System.Drawing.Point(680, 41);
             this.pa_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_makecode_label.Name = "pa_makecode_label";
-            this.pa_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_makecode_label.Size = new System.Drawing.Size(110, 31);
             this.pa_makecode_label.TabIndex = 108;
             this.pa_makecode_label.Text = "制造单号";
             // 
@@ -115,10 +115,10 @@
             // 
             this.AutoPrint.AutoSize = true;
             this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoPrint.Location = new System.Drawing.Point(966, 204);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4);
+            this.AutoPrint.Location = new System.Drawing.Point(1087, 245);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(154, 31);
+            this.AutoPrint.Size = new System.Drawing.Size(184, 35);
             this.AutoPrint.TabIndex = 153;
             this.AutoPrint.Text = "满箱自动打印";
             this.AutoPrint.UseVisualStyleBackColor = true;
@@ -127,10 +127,10 @@
             // 
             this.pa_restqty_label.AutoSize = true;
             this.pa_restqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_restqty_label.Location = new System.Drawing.Point(961, 166);
+            this.pa_restqty_label.Location = new System.Drawing.Point(1081, 199);
             this.pa_restqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_restqty_label.Name = "pa_restqty_label";
-            this.pa_restqty_label.Size = new System.Drawing.Size(52, 27);
+            this.pa_restqty_label.Size = new System.Drawing.Size(62, 31);
             this.pa_restqty_label.TabIndex = 154;
             this.pa_restqty_label.Text = "容量";
             // 
@@ -138,10 +138,10 @@
             // 
             this.pa_custcode_label.AutoSize = true;
             this.pa_custcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_custcode_label.Location = new System.Drawing.Point(314, 98);
+            this.pa_custcode_label.Location = new System.Drawing.Point(353, 118);
             this.pa_custcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_custcode_label.Name = "pa_custcode_label";
-            this.pa_custcode_label.Size = new System.Drawing.Size(52, 27);
+            this.pa_custcode_label.Size = new System.Drawing.Size(62, 31);
             this.pa_custcode_label.TabIndex = 157;
             this.pa_custcode_label.Text = "客户";
             // 
@@ -149,10 +149,10 @@
             // 
             this.palletcode_label.AutoSize = true;
             this.palletcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.palletcode_label.Location = new System.Drawing.Point(963, 363);
+            this.palletcode_label.Location = new System.Drawing.Point(1083, 436);
             this.palletcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.palletcode_label.Name = "palletcode_label";
-            this.palletcode_label.Size = new System.Drawing.Size(72, 27);
+            this.palletcode_label.Size = new System.Drawing.Size(86, 31);
             this.palletcode_label.TabIndex = 165;
             this.palletcode_label.Text = "栈板号";
             // 
@@ -160,10 +160,10 @@
             // 
             this.outboxcode_label.AutoSize = true;
             this.outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.outboxcode_label.Location = new System.Drawing.Point(963, 418);
+            this.outboxcode_label.Location = new System.Drawing.Point(1083, 502);
             this.outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.outboxcode_label.Name = "outboxcode_label";
-            this.outboxcode_label.Size = new System.Drawing.Size(52, 27);
+            this.outboxcode_label.Size = new System.Drawing.Size(62, 31);
             this.outboxcode_label.TabIndex = 166;
             this.outboxcode_label.Text = "箱号";
             // 
@@ -171,21 +171,23 @@
             // 
             this.pa_prodcode_label.AutoSize = true;
             this.pa_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_prodcode_label.Location = new System.Drawing.Point(980, 34);
+            this.pa_prodcode_label.Location = new System.Drawing.Point(1102, 41);
             this.pa_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_prodcode_label.Name = "pa_prodcode_label";
-            this.pa_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_prodcode_label.Size = new System.Drawing.Size(110, 31);
             this.pa_prodcode_label.TabIndex = 169;
             this.pa_prodcode_label.Text = "产品编号";
             // 
             // pa_prodcode
             // 
             this.pa_prodcode.AutoSize = true;
+            this.pa_prodcode.CutLength = null;
             this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_prodcode.Location = new System.Drawing.Point(1106, 34);
+            this.pa_prodcode.Location = new System.Drawing.Point(1244, 41);
             this.pa_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_prodcode.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_prodcode.Name = "pa_prodcode";
-            this.pa_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.pa_prodcode.Size = new System.Drawing.Size(0, 31);
             this.pa_prodcode.TabIndex = 170;
             this.pa_prodcode.Tag = "1";
             // 
@@ -196,13 +198,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(1105, 651);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.Location = new System.Drawing.Point(1243, 781);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4, 5, 4, 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")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(80, 30);
+            this.Clean.Size = new System.Drawing.Size(90, 36);
             this.Clean.TabIndex = 168;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -211,10 +213,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(968, 479);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(1089, 575);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(353, 162);
+            this.OperateResult.Size = new System.Drawing.Size(397, 194);
             this.OperateResult.TabIndex = 167;
             this.OperateResult.Text = "";
             // 
@@ -223,11 +225,11 @@
             this.outboxcode.AllPower = "ifall";
             this.outboxcode.BackColor = System.Drawing.Color.White;
             this.outboxcode.ID = null;
-            this.outboxcode.Location = new System.Drawing.Point(1056, 418);
-            this.outboxcode.Margin = new System.Windows.Forms.Padding(4);
+            this.outboxcode.Location = new System.Drawing.Point(1188, 502);
+            this.outboxcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.outboxcode.Name = "outboxcode";
             this.outboxcode.Power = "ifwrite";
-            this.outboxcode.Size = new System.Drawing.Size(195, 25);
+            this.outboxcode.Size = new System.Drawing.Size(219, 28);
             this.outboxcode.Str = null;
             this.outboxcode.Str1 = null;
             this.outboxcode.Str2 = null;
@@ -240,11 +242,11 @@
             this.palletcode.AllPower = "ifall";
             this.palletcode.BackColor = System.Drawing.Color.White;
             this.palletcode.ID = null;
-            this.palletcode.Location = new System.Drawing.Point(1056, 363);
-            this.palletcode.Margin = new System.Windows.Forms.Padding(4);
+            this.palletcode.Location = new System.Drawing.Point(1188, 436);
+            this.palletcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.palletcode.Name = "palletcode";
             this.palletcode.Power = "ifwrite";
-            this.palletcode.Size = new System.Drawing.Size(195, 25);
+            this.palletcode.Size = new System.Drawing.Size(219, 28);
             this.palletcode.Str = null;
             this.palletcode.Str1 = null;
             this.palletcode.Str2 = null;
@@ -259,13 +261,13 @@
             this.SearchPallet.DownImage = ((System.Drawing.Image)(resources.GetObject("SearchPallet.DownImage")));
             this.SearchPallet.Image = ((System.Drawing.Image)(resources.GetObject("SearchPallet.Image")));
             this.SearchPallet.IsShowBorder = true;
-            this.SearchPallet.Location = new System.Drawing.Point(1131, 308);
-            this.SearchPallet.Margin = new System.Windows.Forms.Padding(4);
+            this.SearchPallet.Location = new System.Drawing.Point(1272, 370);
+            this.SearchPallet.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.SearchPallet.MoveImage = ((System.Drawing.Image)(resources.GetObject("SearchPallet.MoveImage")));
             this.SearchPallet.Name = "SearchPallet";
             this.SearchPallet.NormalImage = ((System.Drawing.Image)(resources.GetObject("SearchPallet.NormalImage")));
             this.SearchPallet.Power = null;
-            this.SearchPallet.Size = new System.Drawing.Size(93, 30);
+            this.SearchPallet.Size = new System.Drawing.Size(105, 36);
             this.SearchPallet.TabIndex = 162;
             this.SearchPallet.Text = "栈板查询";
             this.SearchPallet.UseVisualStyleBackColor = true;
@@ -278,13 +280,13 @@
             this.Print.DownImage = ((System.Drawing.Image)(resources.GetObject("Print.DownImage")));
             this.Print.Image = ((System.Drawing.Image)(resources.GetObject("Print.Image")));
             this.Print.IsShowBorder = true;
-            this.Print.Location = new System.Drawing.Point(1016, 308);
-            this.Print.Margin = new System.Windows.Forms.Padding(4);
+            this.Print.Location = new System.Drawing.Point(1143, 370);
+            this.Print.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.Print.MoveImage = ((System.Drawing.Image)(resources.GetObject("Print.MoveImage")));
             this.Print.Name = "Print";
             this.Print.NormalImage = ((System.Drawing.Image)(resources.GetObject("Print.NormalImage")));
             this.Print.Power = null;
-            this.Print.Size = new System.Drawing.Size(93, 30);
+            this.Print.Size = new System.Drawing.Size(105, 36);
             this.Print.TabIndex = 161;
             this.Print.Text = "打印";
             this.Print.UseVisualStyleBackColor = true;
@@ -297,13 +299,13 @@
             this.ReleasePallet.DownImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.DownImage")));
             this.ReleasePallet.Image = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.Image")));
             this.ReleasePallet.IsShowBorder = true;
-            this.ReleasePallet.Location = new System.Drawing.Point(1131, 246);
-            this.ReleasePallet.Margin = new System.Windows.Forms.Padding(4);
+            this.ReleasePallet.Location = new System.Drawing.Point(1272, 295);
+            this.ReleasePallet.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ReleasePallet.MoveImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.MoveImage")));
             this.ReleasePallet.Name = "ReleasePallet";
             this.ReleasePallet.NormalImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.NormalImage")));
             this.ReleasePallet.Power = null;
-            this.ReleasePallet.Size = new System.Drawing.Size(93, 30);
+            this.ReleasePallet.Size = new System.Drawing.Size(105, 36);
             this.ReleasePallet.TabIndex = 160;
             this.ReleasePallet.Text = "解除栈板";
             this.ReleasePallet.UseVisualStyleBackColor = true;
@@ -316,13 +318,13 @@
             this.NewPallet.DownImage = ((System.Drawing.Image)(resources.GetObject("NewPallet.DownImage")));
             this.NewPallet.Image = ((System.Drawing.Image)(resources.GetObject("NewPallet.Image")));
             this.NewPallet.IsShowBorder = true;
-            this.NewPallet.Location = new System.Drawing.Point(1016, 246);
-            this.NewPallet.Margin = new System.Windows.Forms.Padding(4);
+            this.NewPallet.Location = new System.Drawing.Point(1143, 295);
+            this.NewPallet.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.NewPallet.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewPallet.MoveImage")));
             this.NewPallet.Name = "NewPallet";
             this.NewPallet.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewPallet.NormalImage")));
             this.NewPallet.Power = "ifwrite";
-            this.NewPallet.Size = new System.Drawing.Size(93, 30);
+            this.NewPallet.Size = new System.Drawing.Size(105, 36);
             this.NewPallet.TabIndex = 159;
             this.NewPallet.Text = "新增栈板";
             this.NewPallet.UseVisualStyleBackColor = true;
@@ -331,11 +333,13 @@
             // pa_custcode
             // 
             this.pa_custcode.AutoSize = true;
+            this.pa_custcode.CutLength = null;
             this.pa_custcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_custcode.Location = new System.Drawing.Point(438, 98);
+            this.pa_custcode.Location = new System.Drawing.Point(493, 118);
             this.pa_custcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_custcode.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_custcode.Name = "pa_custcode";
-            this.pa_custcode.Size = new System.Drawing.Size(0, 27);
+            this.pa_custcode.Size = new System.Drawing.Size(0, 31);
             this.pa_custcode.TabIndex = 158;
             this.pa_custcode.Tag = "1";
             // 
@@ -349,11 +353,11 @@
             this.Column3,
             this.Column4,
             this.Column5});
-            this.PackageInf.Location = new System.Drawing.Point(4, 162);
-            this.PackageInf.Margin = new System.Windows.Forms.Padding(4);
+            this.PackageInf.Location = new System.Drawing.Point(4, 194);
+            this.PackageInf.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.PackageInf.Name = "PackageInf";
             this.PackageInf.RowTemplate.Height = 23;
-            this.PackageInf.Size = new System.Drawing.Size(941, 519);
+            this.PackageInf.Size = new System.Drawing.Size(1059, 623);
             this.PackageInf.TabIndex = 156;
             // 
             // Column1
@@ -396,11 +400,11 @@
             this.pa_restqty.AllPower = null;
             this.pa_restqty.BackColor = System.Drawing.Color.White;
             this.pa_restqty.ID = null;
-            this.pa_restqty.Location = new System.Drawing.Point(1056, 166);
-            this.pa_restqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pa_restqty.Location = new System.Drawing.Point(1188, 199);
+            this.pa_restqty.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.pa_restqty.Name = "pa_restqty";
             this.pa_restqty.Power = null;
-            this.pa_restqty.Size = new System.Drawing.Size(195, 25);
+            this.pa_restqty.Size = new System.Drawing.Size(219, 28);
             this.pa_restqty.Str = null;
             this.pa_restqty.Str1 = null;
             this.pa_restqty.Str2 = null;
@@ -410,73 +414,81 @@
             // pa_makecode
             // 
             this.pa_makecode.AutoSize = true;
+            this.pa_makecode.CutLength = null;
             this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_makecode.Location = new System.Drawing.Point(752, 34);
+            this.pa_makecode.Location = new System.Drawing.Point(846, 41);
             this.pa_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_makecode.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_makecode.Name = "pa_makecode";
-            this.pa_makecode.Size = new System.Drawing.Size(0, 27);
+            this.pa_makecode.Size = new System.Drawing.Size(0, 31);
             this.pa_makecode.TabIndex = 109;
             this.pa_makecode.Tag = "1";
             // 
             // pa_salecode
             // 
             this.pa_salecode.AutoSize = true;
+            this.pa_salecode.CutLength = null;
             this.pa_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode.Location = new System.Drawing.Point(131, 98);
+            this.pa_salecode.Location = new System.Drawing.Point(147, 118);
             this.pa_salecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_salecode.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_salecode.Name = "pa_salecode";
-            this.pa_salecode.Size = new System.Drawing.Size(0, 27);
+            this.pa_salecode.Size = new System.Drawing.Size(0, 31);
             this.pa_salecode.TabIndex = 107;
             this.pa_salecode.Tag = "1";
             // 
             // pa_totalqty
             // 
             this.pa_totalqty.AutoSize = true;
+            this.pa_totalqty.CutLength = null;
             this.pa_totalqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty.Location = new System.Drawing.Point(438, 34);
+            this.pa_totalqty.Location = new System.Drawing.Point(493, 41);
             this.pa_totalqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_totalqty.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_totalqty.Name = "pa_totalqty";
-            this.pa_totalqty.Size = new System.Drawing.Size(0, 27);
+            this.pa_totalqty.Size = new System.Drawing.Size(0, 31);
             this.pa_totalqty.TabIndex = 105;
             this.pa_totalqty.Tag = "1";
             // 
             // pa_outboxcode
             // 
             this.pa_outboxcode.AutoSize = true;
+            this.pa_outboxcode.CutLength = null;
             this.pa_outboxcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_outboxcode.Location = new System.Drawing.Point(131, 40);
+            this.pa_outboxcode.Location = new System.Drawing.Point(147, 48);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_outboxcode.MaximumSize = new System.Drawing.Size(225, 0);
             this.pa_outboxcode.Name = "pa_outboxcode";
-            this.pa_outboxcode.Size = new System.Drawing.Size(0, 27);
+            this.pa_outboxcode.Size = new System.Drawing.Size(0, 31);
             this.pa_outboxcode.TabIndex = 103;
             this.pa_outboxcode.Tag = "1";
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(750, 98);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(5);
+            this.PrinterList.Location = new System.Drawing.Point(844, 118);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(195, 25);
+            this.PrinterList.Size = new System.Drawing.Size(219, 30);
             this.PrinterList.TabIndex = 171;
             // 
             // PrintLabel
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1106, 102);
+            this.PrintLabel.Location = new System.Drawing.Point(1244, 122);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(195, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(219, 26);
             this.PrintLabel.TabIndex = 172;
             // 
             // PrintLabel_label
             // 
             this.PrintLabel_label.AutoSize = true;
             this.PrintLabel_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintLabel_label.Location = new System.Drawing.Point(980, 98);
+            this.PrintLabel_label.Location = new System.Drawing.Point(1102, 118);
             this.PrintLabel_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.PrintLabel_label.Name = "PrintLabel_label";
-            this.PrintLabel_label.Size = new System.Drawing.Size(92, 27);
+            this.PrintLabel_label.Size = new System.Drawing.Size(110, 31);
             this.PrintLabel_label.TabIndex = 174;
             this.PrintLabel_label.Text = "标签文件";
             // 
@@ -484,18 +496,18 @@
             // 
             this.PrinterList_label.AutoSize = true;
             this.PrinterList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrinterList_label.Location = new System.Drawing.Point(604, 98);
+            this.PrinterList_label.Location = new System.Drawing.Point(680, 118);
             this.PrinterList_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.PrinterList_label.Name = "PrinterList_label";
-            this.PrinterList_label.Size = new System.Drawing.Size(112, 27);
+            this.PrinterList_label.Size = new System.Drawing.Size(134, 31);
             this.PrinterList_label.TabIndex = 173;
             this.PrinterList_label.Text = "打印机列表";
             // 
-            // Make_PalletWeigh
+            // Make_PalletCollection
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1329, 690);
+            this.ClientSize = new System.Drawing.Size(1495, 828);
             this.Controls.Add(this.PrintLabel_label);
             this.Controls.Add(this.PrinterList_label);
             this.Controls.Add(this.PrintLabel);
@@ -527,14 +539,14 @@
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.pa_outboxcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "Make_PalletWeigh";
-            this.Tag = "Make!PalletWeigh";
-            this.Text = "栈板称重";
+            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Name = "Make_PalletCollection";
+            this.Tag = "Make!PalletCollection";
+            this.Text = "栈板采集";
             this.Load += new System.EventHandler(this.栈板称重_Load);
             this.SizeChanged += new System.EventHandler(this.栈板称重_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 583 - 0
UAS-MES/FunctionCode/Make/Make_PalletWeigh.Designer.cs

@@ -0,0 +1,583 @@
+namespace UAS_MES.Make
+{
+    partial class Make_PalletWeigh
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_PalletWeigh));
+            this.panel4 = new System.Windows.Forms.Panel();
+            this.pr_cartonunit = new System.Windows.Forms.Label();
+            this.label22 = new System.Windows.Forms.Label();
+            this.weight = new System.Windows.Forms.Label();
+            this.palletcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.Printer_label = new System.Windows.Forms.Label();
+            this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.PrintLabel = new System.Windows.Forms.ComboBox();
+            this.autoPrint = new System.Windows.Forms.CheckBox();
+            this.printNum_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.label8 = new System.Windows.Forms.Label();
+            this.printNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.pa_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_totalqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_detailspec = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_salecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.PA_PACKAGEQTY = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.weightedNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.startWeigh = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.stopWeigh = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
+            this.showResult = new System.Windows.Forms.ListView();
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.panel4.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel4
+            // 
+            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel4.Controls.Add(this.pr_cartonunit);
+            this.panel4.Controls.Add(this.label22);
+            this.panel4.Controls.Add(this.weight);
+            this.panel4.Location = new System.Drawing.Point(46, 92);
+            this.panel4.Margin = new System.Windows.Forms.Padding(4);
+            this.panel4.Name = "panel4";
+            this.panel4.Size = new System.Drawing.Size(553, 186);
+            this.panel4.TabIndex = 92;
+            // 
+            // pr_cartonunit
+            // 
+            this.pr_cartonunit.AutoSize = true;
+            this.pr_cartonunit.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
+            this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonunit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
+            this.pr_cartonunit.Location = new System.Drawing.Point(460, 76);
+            this.pr_cartonunit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartonunit.Name = "pr_cartonunit";
+            this.pr_cartonunit.Size = new System.Drawing.Size(46, 38);
+            this.pr_cartonunit.TabIndex = 42;
+            this.pr_cartonunit.Text = "克";
+            // 
+            // label22
+            // 
+            this.label22.AutoSize = true;
+            this.label22.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
+            this.label22.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label22.ForeColor = System.Drawing.SystemColors.ControlLightLight;
+            this.label22.Location = new System.Drawing.Point(22, 76);
+            this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(75, 38);
+            this.label22.TabIndex = 20;
+            this.label22.Text = "重量";
+            // 
+            // weight
+            // 
+            this.weight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.weight.AutoSize = true;
+            this.weight.Font = new System.Drawing.Font("微软雅黑", 22.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.weight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+            this.weight.Location = new System.Drawing.Point(156, 64);
+            this.weight.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.weight.Name = "weight";
+            this.weight.Size = new System.Drawing.Size(0, 58);
+            this.weight.TabIndex = 41;
+            // 
+            // palletcode
+            // 
+            this.palletcode.AllPower = null;
+            this.palletcode.BackColor = System.Drawing.Color.White;
+            this.palletcode.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.palletcode.ID = null;
+            this.palletcode.Location = new System.Drawing.Point(183, 14);
+            this.palletcode.Margin = new System.Windows.Forms.Padding(4);
+            this.palletcode.Name = "palletcode";
+            this.palletcode.Power = null;
+            this.palletcode.Size = new System.Drawing.Size(416, 55);
+            this.palletcode.Str = null;
+            this.palletcode.Str1 = null;
+            this.palletcode.Str2 = null;
+            this.palletcode.TabIndex = 94;
+            this.palletcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.palletcode_KeyDown);
+            // 
+            // 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(47, 17);
+            this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(128, 46);
+            this.label15.TabIndex = 93;
+            this.label15.Text = "栈板号";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label1.Location = new System.Drawing.Point(988, 119);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.TabIndex = 165;
+            this.label1.Text = "打印标签";
+            // 
+            // Printer_label
+            // 
+            this.Printer_label.AutoSize = true;
+            this.Printer_label.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.Printer_label.Location = new System.Drawing.Point(966, 24);
+            this.Printer_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Printer_label.Name = "Printer_label";
+            this.Printer_label.Size = new System.Drawing.Size(134, 31);
+            this.Printer_label.TabIndex = 164;
+            this.Printer_label.Text = "打印机列表";
+            // 
+            // Printer
+            // 
+            this.Printer.Font = new System.Drawing.Font("宋体", 9F);
+            this.Printer.Location = new System.Drawing.Point(1218, 24);
+            this.Printer.Margin = new System.Windows.Forms.Padding(6);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(196, 33);
+            this.Printer.TabIndex = 163;
+            // 
+            // PrintLabel
+            // 
+            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(1218, 116);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(196, 26);
+            this.PrintLabel.TabIndex = 162;
+            // 
+            // autoPrint
+            // 
+            this.autoPrint.AutoSize = true;
+            this.autoPrint.Checked = true;
+            this.autoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.autoPrint.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.autoPrint.Location = new System.Drawing.Point(971, 207);
+            this.autoPrint.Name = "autoPrint";
+            this.autoPrint.Size = new System.Drawing.Size(136, 35);
+            this.autoPrint.TabIndex = 166;
+            this.autoPrint.Text = "自动打印";
+            this.autoPrint.UseVisualStyleBackColor = true;
+            // 
+            // printNum_label
+            // 
+            this.printNum_label.AutoSize = true;
+            this.printNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.printNum_label.Location = new System.Drawing.Point(1146, 208);
+            this.printNum_label.Name = "printNum_label";
+            this.printNum_label.Size = new System.Drawing.Size(62, 31);
+            this.printNum_label.TabIndex = 167;
+            this.printNum_label.Text = "份数";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label2.Location = new System.Drawing.Point(46, 317);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(107, 39);
+            this.label2.TabIndex = 169;
+            this.label2.Text = "工单号";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label3.Location = new System.Drawing.Point(39, 378);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(137, 39);
+            this.label3.TabIndex = 170;
+            this.label3.Text = "栈内总数";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label4.Location = new System.Drawing.Point(39, 445);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(137, 39);
+            this.label4.TabIndex = 171;
+            this.label4.Text = "产品编号";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label5.Location = new System.Drawing.Point(43, 513);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(137, 39);
+            this.label5.TabIndex = 172;
+            this.label5.Text = "名称规格";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label6.Location = new System.Drawing.Point(430, 317);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(137, 39);
+            this.label6.TabIndex = 173;
+            this.label6.Text = "订单编号";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label7.Location = new System.Drawing.Point(430, 445);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(137, 39);
+            this.label7.TabIndex = 174;
+            this.label7.Text = "栈内件数";
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(33, 574);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(663, 310);
+            this.OperateResult.TabIndex = 175;
+            this.OperateResult.Text = "";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.label8.Location = new System.Drawing.Point(1001, 301);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(77, 39);
+            this.label8.TabIndex = 176;
+            this.label8.Text = "已称";
+            // 
+            // printNum
+            // 
+            this.printNum.AllPower = null;
+            this.printNum.BackColor = System.Drawing.Color.White;
+            this.printNum.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.printNum.ID = null;
+            this.printNum.Location = new System.Drawing.Point(1218, 207);
+            this.printNum.Name = "printNum";
+            this.printNum.Negative = false;
+            this.printNum.Power = null;
+            this.printNum.Size = new System.Drawing.Size(196, 39);
+            this.printNum.Str = null;
+            this.printNum.Str1 = null;
+            this.printNum.Str2 = null;
+            this.printNum.TabIndex = 178;
+            this.printNum.Text = "1";
+            // 
+            // pa_makecode
+            // 
+            this.pa_makecode.AutoSize = true;
+            this.pa_makecode.CutLength = null;
+            this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.pa_makecode.Location = new System.Drawing.Point(176, 317);
+            this.pa_makecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_makecode.Name = "pa_makecode";
+            this.pa_makecode.Size = new System.Drawing.Size(0, 39);
+            this.pa_makecode.TabIndex = 179;
+            // 
+            // pa_totalqty
+            // 
+            this.pa_totalqty.AutoSize = true;
+            this.pa_totalqty.CutLength = null;
+            this.pa_totalqty.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.pa_totalqty.Location = new System.Drawing.Point(176, 378);
+            this.pa_totalqty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_totalqty.Name = "pa_totalqty";
+            this.pa_totalqty.Size = new System.Drawing.Size(0, 39);
+            this.pa_totalqty.TabIndex = 180;
+            // 
+            // pa_prodcode
+            // 
+            this.pa_prodcode.AutoSize = true;
+            this.pa_prodcode.CutLength = null;
+            this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.pa_prodcode.Location = new System.Drawing.Point(176, 445);
+            this.pa_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_prodcode.Name = "pa_prodcode";
+            this.pa_prodcode.Size = new System.Drawing.Size(0, 39);
+            this.pa_prodcode.TabIndex = 181;
+            this.pa_prodcode.TextChanged += new System.EventHandler(this.pa_prodcode_TextChanged);
+            // 
+            // pr_detailspec
+            // 
+            this.pr_detailspec.AutoSize = true;
+            this.pr_detailspec.CutLength = null;
+            this.pr_detailspec.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.pr_detailspec.Location = new System.Drawing.Point(176, 513);
+            this.pr_detailspec.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_detailspec.Name = "pr_detailspec";
+            this.pr_detailspec.Size = new System.Drawing.Size(0, 39);
+            this.pr_detailspec.TabIndex = 182;
+            // 
+            // pa_salecode
+            // 
+            this.pa_salecode.AutoSize = true;
+            this.pa_salecode.CutLength = null;
+            this.pa_salecode.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.pa_salecode.Location = new System.Drawing.Point(560, 317);
+            this.pa_salecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_salecode.Name = "pa_salecode";
+            this.pa_salecode.Size = new System.Drawing.Size(0, 39);
+            this.pa_salecode.TabIndex = 183;
+            // 
+            // PA_PACKAGEQTY
+            // 
+            this.PA_PACKAGEQTY.AutoSize = true;
+            this.PA_PACKAGEQTY.CutLength = null;
+            this.PA_PACKAGEQTY.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.PA_PACKAGEQTY.Location = new System.Drawing.Point(560, 445);
+            this.PA_PACKAGEQTY.MaximumSize = new System.Drawing.Size(200, 0);
+            this.PA_PACKAGEQTY.Name = "PA_PACKAGEQTY";
+            this.PA_PACKAGEQTY.Size = new System.Drawing.Size(0, 39);
+            this.PA_PACKAGEQTY.TabIndex = 184;
+            // 
+            // weightedNum
+            // 
+            this.weightedNum.AllPower = null;
+            this.weightedNum.BackColor = System.Drawing.Color.White;
+            this.weightedNum.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.weightedNum.ID = null;
+            this.weightedNum.Location = new System.Drawing.Point(1218, 301);
+            this.weightedNum.Name = "weightedNum";
+            this.weightedNum.Negative = false;
+            this.weightedNum.Power = null;
+            this.weightedNum.Size = new System.Drawing.Size(196, 39);
+            this.weightedNum.Str = null;
+            this.weightedNum.Str1 = null;
+            this.weightedNum.Str2 = null;
+            this.weightedNum.TabIndex = 185;
+            this.weightedNum.Text = "0";
+            // 
+            // startWeigh
+            // 
+            this.startWeigh.AllPower = null;
+            this.startWeigh.BackColor = System.Drawing.Color.Transparent;
+            this.startWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("startWeigh.DownImage")));
+            this.startWeigh.Image = null;
+            this.startWeigh.IsShowBorder = true;
+            this.startWeigh.Location = new System.Drawing.Point(649, 21);
+            this.startWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("startWeigh.MoveImage")));
+            this.startWeigh.Name = "startWeigh";
+            this.startWeigh.NormalImage = ((System.Drawing.Image)(resources.GetObject("startWeigh.NormalImage")));
+            this.startWeigh.Power = null;
+            this.startWeigh.Size = new System.Drawing.Size(91, 38);
+            this.startWeigh.TabIndex = 186;
+            this.startWeigh.Text = "开始称重";
+            this.startWeigh.UseVisualStyleBackColor = false;
+            this.startWeigh.Click += new System.EventHandler(this.startWeigh_Click);
+            // 
+            // stopWeigh
+            // 
+            this.stopWeigh.AllPower = null;
+            this.stopWeigh.BackColor = System.Drawing.Color.Transparent;
+            this.stopWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("stopWeigh.DownImage")));
+            this.stopWeigh.Image = null;
+            this.stopWeigh.IsShowBorder = true;
+            this.stopWeigh.Location = new System.Drawing.Point(793, 21);
+            this.stopWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("stopWeigh.MoveImage")));
+            this.stopWeigh.Name = "stopWeigh";
+            this.stopWeigh.NormalImage = ((System.Drawing.Image)(resources.GetObject("stopWeigh.NormalImage")));
+            this.stopWeigh.Power = null;
+            this.stopWeigh.Size = new System.Drawing.Size(108, 38);
+            this.stopWeigh.TabIndex = 187;
+            this.stopWeigh.Text = "停止称重";
+            this.stopWeigh.UseVisualStyleBackColor = false;
+            this.stopWeigh.Click += new System.EventHandler(this.stopWeigh_Click);
+            // 
+            // BaudRate
+            // 
+            this.BaudRate.AllPower = null;
+            this.BaudRate.BackColor = System.Drawing.Color.White;
+            this.BaudRate.ID = null;
+            this.BaudRate.Location = new System.Drawing.Point(671, 133);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(4);
+            this.BaudRate.Name = "BaudRate";
+            this.BaudRate.Negative = false;
+            this.BaudRate.Power = null;
+            this.BaudRate.Size = new System.Drawing.Size(178, 28);
+            this.BaudRate.Str = null;
+            this.BaudRate.Str1 = null;
+            this.BaudRate.Str2 = null;
+            this.BaudRate.TabIndex = 189;
+            this.BaudRate.Visible = false;
+            // 
+            // ComList
+            // 
+            this.ComList.Location = new System.Drawing.Point(669, 185);
+            this.ComList.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(182, 30);
+            this.ComList.TabIndex = 188;
+            this.ComList.Visible = false;
+            // 
+            // showResult
+            // 
+            this.showResult.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+            this.showResult.Location = new System.Drawing.Point(829, 406);
+            this.showResult.Name = "showResult";
+            this.showResult.Size = new System.Drawing.Size(585, 478);
+            this.showResult.TabIndex = 190;
+            this.showResult.UseCompatibleStateImageBehavior = false;
+            this.showResult.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Text = "";
+            this.columnHeader1.Width = 69;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Text = "栈板号";
+            this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader2.Width = 150;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "重量";
+            this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader3.Width = 159;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "称量时间";
+            this.columnHeader4.Width = 96;
+            // 
+            // Make_PalletWeigh
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1451, 896);
+            this.Controls.Add(this.showResult);
+            this.Controls.Add(this.BaudRate);
+            this.Controls.Add(this.ComList);
+            this.Controls.Add(this.stopWeigh);
+            this.Controls.Add(this.startWeigh);
+            this.Controls.Add(this.weightedNum);
+            this.Controls.Add(this.PA_PACKAGEQTY);
+            this.Controls.Add(this.pa_salecode);
+            this.Controls.Add(this.pr_detailspec);
+            this.Controls.Add(this.pa_prodcode);
+            this.Controls.Add(this.pa_totalqty);
+            this.Controls.Add(this.pa_makecode);
+            this.Controls.Add(this.printNum);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.printNum_label);
+            this.Controls.Add(this.autoPrint);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.Printer_label);
+            this.Controls.Add(this.Printer);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.palletcode);
+            this.Controls.Add(this.label15);
+            this.Controls.Add(this.panel4);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_PalletWeigh";
+            this.Tag = "Make!PalletWeigh";
+            this.Text = "栈板称重";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_PalletWeigh_FormClosing);
+            this.Load += new System.EventHandler(this.Make_PalletWeigh_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_PalletWeigh_SizeChanged);
+            this.panel4.ResumeLayout(true);
+            this.panel4.PerformLayout();
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel4;
+        private System.Windows.Forms.Label pr_cartonunit;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label weight;
+        private CustomControl.TextBoxWithIcon.EnterTextBox palletcode;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label Printer_label;
+        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
+        private System.Windows.Forms.ComboBox PrintLabel;
+        private System.Windows.Forms.CheckBox autoPrint;
+        private System.Windows.Forms.Label printNum_label;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label7;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label label8;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox printNum;
+        private CustomControl.ValueLabel.ValueLabel pa_makecode;
+        private CustomControl.ValueLabel.ValueLabel pa_totalqty;
+        private CustomControl.ValueLabel.ValueLabel pa_prodcode;
+        private CustomControl.ValueLabel.ValueLabel pr_detailspec;
+        private CustomControl.ValueLabel.ValueLabel pa_salecode;
+        private CustomControl.ValueLabel.ValueLabel PA_PACKAGEQTY;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox weightedNum;
+        private CustomControl.ButtonUtil.NormalButton startWeigh;
+        private CustomControl.ButtonUtil.NormalButton stopWeigh;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
+        private CustomControl.ComBoxWithFocus.SerialPortCombox ComList;
+        private System.Windows.Forms.ListView showResult;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
+    }
+}

+ 251 - 0
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -0,0 +1,251 @@
+using LabelManager2;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.IO.Ports;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicForm;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Make
+{
+    public partial class Make_PalletWeigh : Form
+    {
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        ApplicationClass lbl;
+
+        Thread InitPrint;
+
+        Thread thread;
+
+        DataHelper dh;
+
+        DataTable dt;
+
+        DataTable listc;
+
+        DataTable info;
+
+        System.DateTime[] indate;
+
+        //创建串口实例
+        SerialPort serialPort1 = new SerialPort();
+        //true的时候表示从串口读取数据
+        bool GetData = true;
+        public Make_PalletWeigh()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_PalletWeigh_Load(object sender, EventArgs e)
+        {
+            CheckForIllegalCrossThreadCalls = false;
+            asc.controllInitializeSize(this);
+            OperateResult.AppendText(">>请输入栈板号\n", Color.Green);
+            //栈板号输入框聚焦
+            palletcode.Focus();
+            ComList.Text = Properties.Settings.Default.PortName;
+            BaudRate.Text = Properties.Settings.Default.BaudRate;
+            dh = new DataHelper();
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+        }
+        private void InPrint()
+        {
+            lbl = new ApplicationClass();
+        }
+        private void Make_PalletWeigh_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void palletcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下了enter键
+            if (e.KeyCode==Keys.Enter) {
+                if (palletcode.Text=="") {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                //校验栈板号
+                sql.Clear();
+                sql.Append("select pa_id,pa_prodcode,pr_spec ||','|| pr_detail pr_detailspec,pa_makecode,pa_salecode,pa_totalqty,");
+                sql.Append("pa_packageqty from package left join product on pr_code=pa_prodcode where ");
+                sql.Append("pa_outboxcode=:code and pa_type='3'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(),"select",palletcode.Text);
+                if (dt.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<无该栈板号\n", Color.Red);
+                    palletcode.Text = "";
+                }
+                else
+                {
+                    //给页面赋值
+                    BaseUtil.SetFormValue(this.Controls,dt);
+                    // 更新大箱重量
+                    sql.Clear();
+                    sql.Append("update package set pa_weight=:weight where pa_id=:pa_id ");
+                    dh.ExecuteSql(sql.GetString(),"update",weight.Text,dt.Rows[0]["pa_id"].ToString());
+                    //记录makeprocess    
+                    //查询maid
+                    info = (DataTable)dh.ExecuteSql("select ma_id,ma_wccode from make where ma_code='"+pa_makecode.Text+"'","select");
+                    if (info.Rows.Count>0)
+                    {
+                        //有值
+                        //查询
+                        sql.Clear();
+                        sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid,mp_stepcode,mp_stepname ,");
+                        sql.Append("mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,");
+                        sql.Append("mp_snoutboxcode) values ( makeprocess_seq.nextval,:makecode,:ma_id,:craftcode,:craftname,'栈板称重','称重");
+                        sql.Append("成功',:result,sysdate,:inman,:workcenter,:linecode,:source,:palletcode) ");
+                        dh.ExecuteSql(sql.GetString(), "insert", pa_makecode.Text, info.Rows[0]["ma_id"].ToString(), User.CurrentStepCode, User.CurrentStepName, "栈板号:" + palletcode.Text + ",重量:" + weight.Text + "克", User.UserName, info.Rows[0]["ma_wccode"].ToString(), User.UserLineCode, User.UserSourceCode, palletcode.Text);
+                        //提示信息栏显示:<< 栈板号:XXXX,重量:xxxx 克,
+                        OperateResult.AppendText("<<栈板号:" + palletcode.Text + ",重量:" + weight.Text + "克\n", Color.Green);
+                        //如果用户勾选了自动打印,调用打印, 打印成功,消息提示栏显示“打印成功”,“请输入栈板号”
+                        if (autoPrint.Checked == true)
+                        {
+                            try
+                            {
+                                Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, palletcode.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
+                            }
+                            catch (Exception ex)
+                            {
+                                OperateResult.AppendText("<<打印失败\n", Color.Red);
+                                OperateResult.AppendText(">>请输入栈板号\n", Color.Green);
+                                palletcode.Text = "";
+                            }
+                            //打印成功,请输入栈板号
+                            OperateResult.AppendText("<<打印成功\n", Color.Green);
+                            OperateResult.AppendText(">>请输入栈板号\n", Color.Green);
+                            //更新栈板打印次数
+                            sql.Clear();
+                            sql.Append("update package set pa_printcount= pa_printcount+1  where pa_id=:pa_id");
+                            dh.ExecuteSql(sql.GetString(), "update", dt.Rows[0]["pa_id"].ToString());
+                            //刷新称重计数+1
+                            weightedNum.Text = int.Parse(weightedNum.Text) + 1 + "";
+                            //刷新grid的历史称重信息;
+                            recordResult(palletcode.Text,weight.Text, System.DateTime.Now.ToString());
+                            //清空输入框中的值,扫描框置空定焦
+                            palletcode.Text = "";
+                        }
+                    }
+                }
+            }
+        }
+
+        private void pa_prodcode_TextChanged(object sender, EventArgs e)
+        {
+            listc = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pa_prodcode.Text + "'and PL_LABELTYPE='栈板标' order by pl_isdefault desc", "select");
+            if (listc.Rows.Count == 0)
+            {
+                OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护栈板标签模板\n", Color.Red);
+            }
+            PrintLabel.DataSource = listc;
+            PrintLabel.DisplayMember = "pl_name";
+            PrintLabel.ValueMember = "pl_labelcode";
+            ftpOperater ftp = new ftpOperater();
+            indate = new System.DateTime[listc.Rows.Count];
+            for (int i = 0; i < listc.Rows.Count; i++)
+            {
+                BaseUtil.GetPrintLabel(listc.Rows[i]["pl_labelname"].ToString(), listc.Rows[i]["pl_labelurl"].ToString(), listc.Rows[i]["pl_indate"].ToString());
+                indate[i] = Convert.ToDateTime(listc.Rows[i]["pl_indate"].ToString());
+            }
+        }
+
+        private void startWeigh_Click(object sender, EventArgs e)
+        {
+            thread = new Thread(getSerialData);
+            try
+            {
+                GetData = true;
+                serialPort1.PortName = this.ComList.Text;
+                serialPort1.BaudRate = int.Parse(BaudRate.Text);
+                serialPort1.Open();
+                thread.Start();
+            }
+            catch (Exception mes)
+            {
+                if (BaudRate.Text == "" || ComList.Text == "")
+                    OperateResult.AppendText(">>请先在电子秤调试界面维护波特率和串口\n", Color.Red);
+                else
+                    OperateResult.AppendText(">>" + mes.Message + "\n", Color.Red);
+            }
+        }
+        //停止称重
+        private void stopWeigh_Click(object sender, EventArgs e)
+        {
+            GetData = false;
+            SystemInf.OpenPort.Remove(serialPort1.PortName);
+            serialPort1.Close();
+        }
+        private void getSerialData()
+        {
+            if (serialPort1.IsOpen)
+            {
+                if (!SystemInf.OpenPort.Contains(serialPort1.PortName))
+                {
+                    SystemInf.OpenPort.Add(serialPort1.PortName);
+                    try
+                    {
+                        while (GetData)
+                        {
+                            try
+                            {
+                                weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
+                            }
+                            catch (Exception)
+                            {
+                                GetData = false;
+                            }
+                        }
+                    }
+                    catch (IOException ex) { MessageBox.Show(ex.Message); }
+                }
+                else
+                    MessageBox.Show("端口已被占用,请关闭其他窗口");
+            }
+        }
+
+        private void Make_PalletWeigh_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            lbl.Quit();
+            if (serialPort1.IsOpen)
+            {
+                GetData = false;
+                serialPort1.Close();
+                SystemInf.OpenPort.Remove(serialPort1.PortName);
+                thread.Interrupt();
+            }
+        }
+        private void recordResult(string palletcode, string weigh, string time)
+        {
+            if (showResult.Items.Count >= 50)
+            {
+                //如果有10行的话,则删除最前一行
+                showResult.Items.RemoveAt(0);
+            }
+            //创建一个item
+            ListViewItem lvi = new ListViewItem();
+            //分条赋值
+            lvi.SubItems.Add(palletcode);
+            lvi.SubItems.Add(weigh);
+            lvi.SubItems.Add(time);
+            //添加结果的信息进去
+            showResult.Items.Add(lvi);
+        }
+    }
+}

+ 197 - 0
UAS-MES/FunctionCode/Make/Make_PalletWeigh.resx

@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="startWeigh.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="startWeigh.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="startWeigh.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="stopWeigh.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="stopWeigh.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="stopWeigh.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

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

+ 0 - 5
UAS-MES/Main.cs

@@ -112,11 +112,6 @@ namespace UAS_MES
             SystemInf.HeadBarHeight = headBar1.Height;
         }
 
-        private void RefreshDB(object sender, EventArgs e)
-        {
-            DataHelper dh = new DataHelper();
-        }
-
         /// <summary>
         ///设置窗体的最大化和最小化状态
         /// </summary>

+ 14 - 14
UAS_KanBan/Process.Designer.cs

@@ -51,7 +51,7 @@
             this.收益率 = new CCWin.SkinControl.SkinLabel();
             this.故障数 = new CCWin.SkinControl.SkinLabel();
             this.直通率 = new CCWin.SkinControl.SkinLabel();
-            this.班 = new CCWin.SkinControl.SkinLabel();
+            this.班 = new CCWin.SkinControl.SkinLabel();
             this.Line = new CCWin.SkinControl.SkinLabel();
             this.Title2 = new CCWin.SkinControl.SkinLabel();
             this.Refresh = new System.Windows.Forms.Timer(this.components);
@@ -369,18 +369,18 @@
             this.直通率.TabIndex = 20;
             this.直通率.Tag = "AutoFont";
             // 
-            // 班
+            // 班
             // 
-            this.班.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.班.AutoSize = true;
-            this.班.BackColor = System.Drawing.Color.Transparent;
-            this.班.BorderColor = System.Drawing.Color.Red;
-            this.班.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.班.ForeColor = System.Drawing.Color.Red;
-            this.班.Location = new System.Drawing.Point(909, 88);
-            this.班制.Name = "班制";
-            this.班.Size = new System.Drawing.Size(0, 40);
-            this.班.TabIndex = 24;
+            this.班.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.班.AutoSize = true;
+            this.班.BackColor = System.Drawing.Color.Transparent;
+            this.班.BorderColor = System.Drawing.Color.Red;
+            this.班.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.班.ForeColor = System.Drawing.Color.Red;
+            this.班.Location = new System.Drawing.Point(909, 88);
+            this.班次.Name = "班次";
+            this.班.Size = new System.Drawing.Size(0, 40);
+            this.班.TabIndex = 24;
             // 
             // Line
             // 
@@ -429,7 +429,7 @@
             this.BackColor = System.Drawing.Color.Black;
             this.ClientSize = new System.Drawing.Size(1036, 687);
             this.Controls.Add(this.Title2);
-            this.Controls.Add(this.班);
+            this.Controls.Add(this.班);
             this.Controls.Add(this.Line);
             this.Controls.Add(this.收益率);
             this.Controls.Add(this.故障数);
@@ -493,7 +493,7 @@
         private CCWin.SkinControl.SkinLabel 收益率;
         private CCWin.SkinControl.SkinLabel 故障数;
         private CCWin.SkinControl.SkinLabel 直通率;
-        private CCWin.SkinControl.SkinLabel 班;
+        private CCWin.SkinControl.SkinLabel 班;
         private CCWin.SkinControl.SkinLabel Line;
         private CCWin.SkinControl.SkinLabel Title2;
         private System.Windows.Forms.Timer Refresh;

+ 3 - 3
UAS_KanBan/Process.cs

@@ -22,7 +22,7 @@ namespace UAS_KanBan
         {
             InitializeComponent();
             Line.Text = LineCode;
-            班.Text = WcCode;
+            班.Text = WcCode;
             int WorkHeight = Screen.PrimaryScreen.Bounds.Width;
             if (WorkHeight <= 1024)
             {
@@ -51,7 +51,7 @@ namespace UAS_KanBan
 
         private void Refresh_Tick(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select KBI_LINE_ZTL('" + Line.Text + "','" + 班.Text + "') from dual", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select KBI_LINE_ZTL('" + Line.Text + "','" + 班.Text + "') from dual", "select");
             string Data = dt.Rows[0][0].ToString();
             string[] Item = Data.Split(':');
             string[] ItemName = new string[Item.Length];
@@ -85,7 +85,7 @@ namespace UAS_KanBan
             WorkShift_label.Location = new Point(Line2.Location.X + (Line3.Location.X - Line2.Location.X - WorkShift_label.Size.Width) / 2, MidLine.Location.Y + (BottomLine.Location.Y - MidLine.Location.Y - WorkShift_label.Size.Height) / 2);
             LineCode_label.Location = new Point(Line2.Location.X + (Line3.Location.X - Line2.Location.X - LineCode_label.Size.Width) / 2, TopLine.Location.Y + (MidLine.Location.Y - TopLine.Location.Y - LineCode_label.Size.Height) / 2);
             Line.Location = new Point(Line.Location.X, TopLine.Location.Y + (MidLine.Location.Y - TopLine.Location.Y - LineCode_label.Size.Height) / 2);
-            班制.Location = new Point(班制.Location.X, MidLine.Location.Y + (BottomLine.Location.Y - MidLine.Location.Y - WorkShift_label.Size.Height) / 2);
+            班次.Location = new Point(班次.Location.X, MidLine.Location.Y + (BottomLine.Location.Y - MidLine.Location.Y - WorkShift_label.Size.Height) / 2);
             Logo.Size = new Size(Line1.Location.X - 20, BottomLine.Location.Y - TopLine.Location.Y - 20);
             机型.Location = new Point(机型_label.Location.X + 机型_label.Width + 30, 机型_label.Location.Y);
             投入.Location = new Point(投入_label.Location.X + 机型_label.Width + 30, 投入_label.Location.Y);

+ 3 - 0
UAS_KanBan/Process.resx

@@ -120,6 +120,9 @@
   <metadata name="Refresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>62</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 1 - 0
UAS_XmlAnalysor/Form1.Designer.cs

@@ -212,6 +212,7 @@
             this.AutoStart.TabIndex = 16;
             this.AutoStart.Text = "开机自动启动";
             this.AutoStart.UseVisualStyleBackColor = true;
+            this.AutoStart.CheckedChanged += new System.EventHandler(this.AutoStart_CheckedChanged);
             // 
             // Form1
             // 

+ 5 - 1
UAS_XmlAnalysor/Form1.cs

@@ -118,7 +118,6 @@ namespace UAS_XmlAnalysor
             ChooseFolder.Enabled = false;
             ChooseBackUpFolder.Enabled = false;
             StopWatch.Enabled = true;
-            SetAutoRun();
             OperateResult.AppendText("开始执行监控\n");
         }
 
@@ -285,5 +284,10 @@ namespace UAS_XmlAnalysor
                 e.Cancel = true;
             }
         }
+
+        private void AutoStart_CheckedChanged(object sender, EventArgs e)
+        {
+            SetAutoRun();
+        }
     }
 }