章政 8 жил өмнө
parent
commit
f4bcf6e8f8

+ 28 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -66,6 +66,8 @@
             this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
             this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.Packing = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.pr_packrule = new System.Windows.Forms.Label();
+            this.pa_status = new System.Windows.Forms.Label();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -452,7 +454,6 @@
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
             this.pa_currentqty.TabIndex = 169;
-            this.pa_currentqty.TextChanged += new System.EventHandler(this.pa_packageqty_TextChanged);
             // 
             // pr_outboxinnerqty
             // 
@@ -540,11 +541,35 @@
             this.Packing.UseVisualStyleBackColor = true;
             this.Packing.Click += new System.EventHandler(this.Packing_Click);
             // 
+            // pr_packrule
+            // 
+            this.pr_packrule.AutoSize = true;
+            this.pr_packrule.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_packrule.Location = new System.Drawing.Point(1132, 556);
+            this.pr_packrule.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_packrule.Name = "pr_packrule";
+            this.pr_packrule.Size = new System.Drawing.Size(0, 27);
+            this.pr_packrule.TabIndex = 173;
+            this.pr_packrule.Visible = false;
+            // 
+            // pa_status
+            // 
+            this.pa_status.AutoSize = true;
+            this.pa_status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_status.Location = new System.Drawing.Point(1040, 604);
+            this.pa_status.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_status.Name = "pa_status";
+            this.pa_status.Size = new System.Drawing.Size(0, 27);
+            this.pa_status.TabIndex = 174;
+            this.pa_status.Visible = false;
+            // 
             // Make_PackageCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1172, 760);
+            this.Controls.Add(this.pa_status);
+            this.Controls.Add(this.pr_packrule);
             this.Controls.Add(this.groupBoxWithBorder2);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.OperateResult);
@@ -617,5 +642,7 @@
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
         private CustomControl.ButtonUtil.NormalButton Packing;
         private System.Windows.Forms.CheckBox AutoGenBoxCode;
+        private System.Windows.Forms.Label pr_packrule;
+        private System.Windows.Forms.Label pa_status;
     }
 }

+ 28 - 19
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -180,26 +180,35 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                 {
                     //按工单核对装箱
-                    if (pr_packrule.Text == "M")
+                    switch (pr_packrule.Text)
                     {
-                        if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
-                        {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red);
-                            return;
-                        }
-                    }
-                    //按销售订单核对装箱
-                    else if (pr_packrule.Text == "S")
-                    {
-                        sql.Clear();
-                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                        sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                        DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                        if (dt.Rows.Count == 0)
-                        {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red);
-                            return;
-                        }
+                        case "M":
+                            if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
+                                return;
+                            }
+                            break;
+                        case "S":
+                            sql.Clear();
+                            sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                            sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count == 0)
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                return;
+                            }
+                            break;
+                        case "":
+                            if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
+                                return;
+                            }
+                            break;
+                        default:
+                            break;
                     }
                     if (pa_outboxcode.Text == "")
                     {