Hcsy 7 years ago
parent
commit
dcbf0a2ca8

+ 25 - 25
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.Designer.cs

@@ -123,7 +123,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(7, 37);
+            this.pa_code_label.Location = new System.Drawing.Point(6, 36);
             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;
@@ -133,7 +133,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(8, 40);
+            this.PrintList_label.Location = new System.Drawing.Point(7, 39);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
@@ -143,7 +143,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum_label.Location = new System.Drawing.Point(182, 122);
+            this.PrintNum_label.Location = new System.Drawing.Point(181, 121);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 124;
@@ -186,7 +186,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(8, 79);
+            this.label3.Location = new System.Drawing.Point(7, 78);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 160;
@@ -429,7 +429,7 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(206, 73);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(205, 72);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_currentqty_label.TabIndex = 175;
@@ -439,7 +439,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(206, 111);
+            this.pr_detail_label.Location = new System.Drawing.Point(205, 110);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 173;
@@ -449,7 +449,7 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty.Location = new System.Drawing.Point(289, 73);
+            this.pa_currentqty.Location = new System.Drawing.Point(288, 72);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
             this.pa_currentqty.TabIndex = 179;
@@ -458,7 +458,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(7, 111);
+            this.pr_code_label.Location = new System.Drawing.Point(6, 110);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 174;
@@ -468,7 +468,7 @@
             // 
             this.pr_detail.AutoSize = true;
             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(289, 111);
+            this.pr_detail.Location = new System.Drawing.Point(288, 110);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 178;
@@ -477,7 +477,7 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(7, 73);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(6, 72);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(74, 21);
             this.pr_outboxinnerqty_label.TabIndex = 176;
@@ -487,7 +487,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(95, 111);
+            this.pr_code.Location = new System.Drawing.Point(94, 110);
             this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 21);
@@ -497,7 +497,7 @@
             // AutoGenBoxCode
             // 
             this.AutoGenBoxCode.AutoSize = true;
-            this.AutoGenBoxCode.Location = new System.Drawing.Point(210, 37);
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(209, 36);
             this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(2);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(93, 25);
@@ -539,7 +539,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(273, 17);
+            this.label1.Location = new System.Drawing.Point(272, 16);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 184;
@@ -549,7 +549,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno.Location = new System.Drawing.Point(354, 17);
+            this.ob_checkno.Location = new System.Drawing.Point(353, 16);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 21);
             this.ob_checkno.TabIndex = 183;
@@ -574,7 +574,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(354, 79);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(353, 78);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
             this.ob_nowcheckqty.TabIndex = 178;
@@ -583,7 +583,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.Location = new System.Drawing.Point(354, 40);
+            this.ob_batchqty.Location = new System.Drawing.Point(353, 39);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
             this.ob_batchqty.TabIndex = 177;
@@ -592,7 +592,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(273, 79);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(272, 78);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_nowcheckqty_label.TabIndex = 176;
@@ -602,7 +602,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(273, 40);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(272, 39);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_batchqty_label.TabIndex = 175;
@@ -691,7 +691,7 @@
             // 
             this.pr_cartonunit1.AutoSize = true;
             this.pr_cartonunit1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit1.Location = new System.Drawing.Point(92, 131);
+            this.pr_cartonunit1.Location = new System.Drawing.Point(91, 130);
             this.pr_cartonunit1.Name = "pr_cartonunit1";
             this.pr_cartonunit1.Size = new System.Drawing.Size(20, 21);
             this.pr_cartonunit1.TabIndex = 184;
@@ -703,7 +703,7 @@
             // 
             this.pr_cartonunit.AutoSize = true;
             this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit.Location = new System.Drawing.Point(61, 30);
+            this.pr_cartonunit.Location = new System.Drawing.Point(60, 29);
             this.pr_cartonunit.Name = "pr_cartonunit";
             this.pr_cartonunit.Size = new System.Drawing.Size(20, 21);
             this.pr_cartonunit.TabIndex = 183;
@@ -714,7 +714,7 @@
             // 
             this.pr_cartonboxgw.AutoSize = true;
             this.pr_cartonboxgw.Font = new System.Drawing.Font("微软雅黑", 35F);
-            this.pr_cartonboxgw.Location = new System.Drawing.Point(35, 167);
+            this.pr_cartonboxgw.Location = new System.Drawing.Point(34, 166);
             this.pr_cartonboxgw.Name = "pr_cartonboxgw";
             this.pr_cartonboxgw.Size = new System.Drawing.Size(0, 60);
             this.pr_cartonboxgw.TabIndex = 182;
@@ -723,7 +723,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(19, 131);
+            this.label4.Location = new System.Drawing.Point(18, 130);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 181;
@@ -734,7 +734,7 @@
             this.weight.AutoSize = true;
             this.weight.Font = new System.Drawing.Font("微软雅黑", 35F);
             this.weight.ForeColor = System.Drawing.Color.Green;
-            this.weight.Location = new System.Drawing.Point(35, 61);
+            this.weight.Location = new System.Drawing.Point(34, 60);
             this.weight.Name = "weight";
             this.weight.Size = new System.Drawing.Size(0, 60);
             this.weight.TabIndex = 180;
@@ -743,7 +743,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(19, 30);
+            this.label2.Location = new System.Drawing.Point(18, 29);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(42, 21);
             this.label2.TabIndex = 179;
@@ -853,6 +853,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(879, 582);
+            this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ms_salecode);
             this.Controls.Add(this.pr_sendchecktype);
@@ -872,7 +873,6 @@
             this.Controls.Add(this.pa_id);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.sn_code);
-            this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label13);
             this.Controls.Add(this.ms_makecode);

+ 6 - 2
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -30,6 +30,8 @@ namespace UAS_MES.Make
         string ActWeigh;
         string oMsStatus = "";
 
+        Regex re = new Regex("\\d+.\\d+\\w+");
+
         //称量的标准重量
         double Weight;
         //最大重量
@@ -115,7 +117,7 @@ namespace UAS_MES.Make
                         {
                             try
                             {
-                                weight.Text = serialPort1.ReadLine();
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
                                 ActWeigh = weight.Text.Replace("kg", "").Trim();
                             }
                             catch (Exception)
@@ -410,8 +412,10 @@ namespace UAS_MES.Make
                 string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (Seal == "Yes")
                 {
+                    ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim();
+                    float weigh = float.Parse(ActWeigh);
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.Green);
-                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     pa_status.Text = "1";
                     pa_standardqty.Text = "";
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");