Browse Source

修改包装采集序列号不存在的提示和箱内容量的赋值

章政 8 years ago
parent
commit
883d7b4855

+ 47 - 47
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.Designer.cs

@@ -47,7 +47,7 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.palletcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.bigoutboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Printlab = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ReleasePallet = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.NewPallet = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -59,9 +59,9 @@
             this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pa_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.pa_totalqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.pa_outboxcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pa_packageqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_outboxcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_totalqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pa_packageqty_label = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).BeginInit();
@@ -281,22 +281,22 @@
             this.outboxcode.Tag = "NoAuto";
             this.outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.outboxcode_KeyDown);
             // 
-            // palletcode
-            // 
-            this.palletcode.AllPower = "ifall";
-            this.palletcode.BackColor = System.Drawing.Color.White;
-            this.palletcode.ID = null;
-            this.palletcode.Location = new System.Drawing.Point(1105, 319);
-            this.palletcode.Margin = new System.Windows.Forms.Padding(4);
-            this.palletcode.Name = "palletcode";
-            this.palletcode.Power = "ifwrite";
-            this.palletcode.Size = new System.Drawing.Size(195, 25);
-            this.palletcode.Str = null;
-            this.palletcode.Str1 = null;
-            this.palletcode.Str2 = null;
-            this.palletcode.TabIndex = 163;
-            this.palletcode.Tag = "NoAuto";
-            this.palletcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.palletcode_KeyDown);
+            // bigoutboxcode
+            // 
+            this.bigoutboxcode.AllPower = "ifall";
+            this.bigoutboxcode.BackColor = System.Drawing.Color.White;
+            this.bigoutboxcode.ID = null;
+            this.bigoutboxcode.Location = new System.Drawing.Point(1105, 319);
+            this.bigoutboxcode.Margin = new System.Windows.Forms.Padding(4);
+            this.bigoutboxcode.Name = "bigoutboxcode";
+            this.bigoutboxcode.Power = "ifwrite";
+            this.bigoutboxcode.Size = new System.Drawing.Size(195, 25);
+            this.bigoutboxcode.Str = null;
+            this.bigoutboxcode.Str1 = null;
+            this.bigoutboxcode.Str2 = null;
+            this.bigoutboxcode.TabIndex = 163;
+            this.bigoutboxcode.Tag = "NoAuto";
+            this.bigoutboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.palletcode_KeyDown);
             // 
             // Printlab
             // 
@@ -434,18 +434,18 @@
             this.pa_makecode.TabIndex = 109;
             this.pa_makecode.Tag = "1";
             // 
-            // pa_totalqty
+            // pa_packageqty
             // 
-            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(439, 96);
-            this.pa_totalqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            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, 27);
-            this.pa_totalqty.TabIndex = 105;
-            this.pa_totalqty.Tag = "1";
+            this.pa_packageqty.AutoSize = true;
+            this.pa_packageqty.CutLength = null;
+            this.pa_packageqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_packageqty.Location = new System.Drawing.Point(439, 96);
+            this.pa_packageqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            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, 27);
+            this.pa_packageqty.TabIndex = 105;
+            this.pa_packageqty.Tag = "1";
             // 
             // pa_outboxcode
             // 
@@ -460,18 +460,18 @@
             this.pa_outboxcode.TabIndex = 103;
             this.pa_outboxcode.Tag = "1";
             // 
-            // pa_packageqty
+            // pa_totalqty
             // 
-            this.pa_packageqty.AutoSize = true;
-            this.pa_packageqty.CutLength = null;
-            this.pa_packageqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_packageqty.Location = new System.Drawing.Point(157, 96);
-            this.pa_packageqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            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, 27);
-            this.pa_packageqty.TabIndex = 177;
-            this.pa_packageqty.Tag = "1";
+            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(157, 96);
+            this.pa_totalqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            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, 27);
+            this.pa_totalqty.TabIndex = 177;
+            this.pa_totalqty.Tag = "1";
             // 
             // pa_packageqty_label
             // 
@@ -489,7 +489,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1329, 690);
-            this.Controls.Add(this.pa_packageqty);
+            this.Controls.Add(this.pa_totalqty);
             this.Controls.Add(this.pa_packageqty_label);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.PrintLabel_label);
@@ -503,7 +503,7 @@
             this.Controls.Add(this.outboxcode_label);
             this.Controls.Add(this.palletcode_label);
             this.Controls.Add(this.outboxcode);
-            this.Controls.Add(this.palletcode);
+            this.Controls.Add(this.bigoutboxcode);
             this.Controls.Add(this.Printlab);
             this.Controls.Add(this.ReleasePallet);
             this.Controls.Add(this.NewPallet);
@@ -514,7 +514,7 @@
             this.Controls.Add(this.AutoPrint);
             this.Controls.Add(this.pa_makecode);
             this.Controls.Add(this.pa_makecode_label);
-            this.Controls.Add(this.pa_totalqty);
+            this.Controls.Add(this.pa_packageqty);
             this.Controls.Add(this.pa_totalqty_label);
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.pa_outboxcode_label);
@@ -536,7 +536,7 @@
 
         private CustomControl.ValueLabel.ValueLabel pa_outboxcode;
         private System.Windows.Forms.Label pa_outboxcode_label;
-        private CustomControl.ValueLabel.ValueLabel pa_totalqty;
+        private CustomControl.ValueLabel.ValueLabel pa_packageqty;
         private System.Windows.Forms.Label pa_totalqty_label;
         private CustomControl.ValueLabel.ValueLabel pa_makecode;
         private System.Windows.Forms.Label pa_makecode_label;
@@ -548,7 +548,7 @@
         private CustomControl.ButtonUtil.NormalButton NewPallet;
         private CustomControl.ButtonUtil.NormalButton ReleasePallet;
         private CustomControl.ButtonUtil.NormalButton Printlab;
-        private CustomControl.TextBoxWithIcon.EnterTextBox palletcode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox bigoutboxcode;
         private CustomControl.TextBoxWithIcon.EnterTextBox outboxcode;
         private System.Windows.Forms.Label palletcode_label;
         private System.Windows.Forms.Label outboxcode_label;
@@ -566,7 +566,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
-        private CustomControl.ValueLabel.ValueLabel pa_packageqty;
+        private CustomControl.ValueLabel.ValueLabel pa_totalqty;
         private System.Windows.Forms.Label pa_packageqty_label;
     }
 }

+ 40 - 22
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -25,14 +25,14 @@ namespace UAS_MES.Make
 
         LogStringBuilder sql = new LogStringBuilder();
 
-        Make_BigBox NewBigBox;
+        Make_NewBigBox NewBigBox;
 
         //箱类型
         string pa_type;
         //物料编号
         string pr_code;
         //箱内件数
-        int pa_packqty;
+        int pa_totqty;
         //Package表的主键
         string pa_id;
 
@@ -81,21 +81,21 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (palletcode.Text == "")
+                if (bigoutboxcode.Text == "")
                 {
                     OperateResult.AppendText(">>大箱号不能为空\n", Color.Red);
                     return;
                 }
                 sql.Clear();
                 sql.Append("select pa_makecode,pa_packageqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
-                sql.Append("from package where pa_outboxcode='" + palletcode.Text + "'  and pa_type =2");
+                sql.Append("from package where pa_outboxcode='" + bigoutboxcode.Text + "'  and pa_type =2");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 BaseUtil.SetFormValue(Controls, dt);
                 if (dt.Rows.Count > 0)
                 {
                     LoadGridData();
-                    dt = dh.getFieldsDataByCondition("Package", new string[] { "pa_packageqty", "pa_id" }, "pa_outboxcode='" + palletcode.Text + "'");
-                    pa_packqty = int.Parse(dt.Rows[0]["pa_packageqty"].ToString());
+                    dt = dh.getFieldsDataByCondition("Package", new string[] { "pa_totalqty", "pa_id" }, "pa_outboxcode='" + bigoutboxcode.Text + "'");
+                    pa_totqty = int.Parse(dt.Rows[0]["pa_totalqty"].ToString());
                     pa_id = dt.Rows[0]["pa_id"].ToString();
                     FillPrintLabel();
                     outboxcode.Focus();
@@ -114,17 +114,18 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>卡通箱号不能为空\n", Color.Red);
                     return;
                 }
-                if (!dh.CheckExist("package", "pa_outboxcode='" + palletcode.Text + "' and pa_type=2"))
+                if (!dh.CheckExist("package", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2"))
                 {
                     OperateResult.AppendText(">>大箱号不存在\n", Color.Red);
                     return;
                 }
                 sql.Clear();
                 sql.Append("select count(0) cn from package left join packagedetail on pa_id=pd_paid  where ");
-                sql.Append("pa_outboxcode='" + palletcode.Text + "'");
+                sql.Append("pa_outboxcode='" + bigoutboxcode.Text + "'");
                 int packageqty = int.Parse((dh.ExecuteSql(sql.GetString(), "select") as DataTable).Rows[0][0].ToString());
                 //如果未装满的话
-                if (packageqty < pa_packqty)
+                Console.WriteLine(packageqty);
+                if (packageqty < pa_totqty)
                 {
                     if (dh.CheckExist("Package", "pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_type,1)=1"))
                     {
@@ -132,25 +133,41 @@ namespace UAS_MES.Make
                         if (!dh.CheckExist("PackageDetail", "pd_innerboxcode='" + outboxcode.Text + "'"))
                         {
                             sql.Clear();
-                            sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode, pd_innerboxcode, pd_innerqty)");
-                            sql.Append("values(packagedetail_seq.nextval,'" + pa_id + "','" + palletcode.Text + "','" + outboxcode.Text + "','" + pa_totalqty.Text + "')");
+                            sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode,pd_innerboxcode, pd_innerqty)");
+                            sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + bigoutboxcode.Text + "','" + outboxcode.Text + "'");
+                            sql.Append(",pa_packageqty from package where pa_outboxcode='" + outboxcode.Text + "'");
                             dh.ExecuteSql(sql.GetString(), "insert");
-                            dh.UpdateByCondition("package", "pa_totalqty=pa_totalqty+1", "pa_outboxcode='" + palletcode.Text + "' and pa_type=2");
+                            dh.UpdateByCondition("package", "pa_packageqty=pa_packageqty+1", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2");
+                            if (dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString() == "")
+                            {
+                                string carton_macode = dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
+                                pa_makecode.Text = carton_macode;
+                                dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
+                            }
                             OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
                             LoadGridData();
                             LoadCollectNum();
                             //判断明细和箱内的件数的差是不是1,如果只相差1则表示此时已经采集慢了
-                            if (packageqty + 1 == pa_packqty && AutoPrint.Checked)
+                            if (packageqty + 1 == pa_totqty)
                             {
-                                OperateResult.AppendText(">>箱已装满,自动打印!\n", Color.Green);
-                                Printlab.PerformClick();
+                                if (AutoPrint.Checked)
+                                {
+                                    OperateResult.AppendText(">>箱已装满,自动打印!\n", Color.Green);
+                                    Printlab.PerformClick();
+                                }
+                                bigoutboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", "", pa_prodcode.Text, User.UserCode);
+                                sql.Clear();
+                                sql.Append("insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_totalqty)values");
+                                sql.Append("(package_seq.nextval,'" + bigoutboxcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',2,'" + pa_prodcode.Text + "',0,'','" + pa_totalqty.Text + "')");
+                                dh.ExecuteSql(sql.GetString(), "insert");
+                                palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                             }
                         }
                         else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
                     }
                     else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "不存在\n", Color.Red, outboxcode);
                 }
-                else OperateResult.AppendText(">>大箱" + palletcode.Text + "已装满\n", Color.Red, outboxcode);
+                else OperateResult.AppendText(">>大箱" + bigoutboxcode.Text + "已装满\n", Color.Red, outboxcode);
             }
         }
 
@@ -159,7 +176,7 @@ namespace UAS_MES.Make
             sql.Clear();
             sql.Append("select pa_prodcode,nvl(pd_barcode,PD_INNERBOXCODE) code ,pd_innerqty,pa_salecode");
             sql.Append(",pa_makecode,pa_custcode,pa_packageqty from packagedetail left join package on pd_paid=pa_id left ");
-            sql.Append("join product on pr_code=pa_prodcode where pa_outboxcode ='" + palletcode.Text + "' and pa_type=2");
+            sql.Append("join product on pr_code=pa_prodcode where pa_outboxcode ='" + bigoutboxcode.Text + "' and pa_type=2");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(PackageInf, dt);
         }
@@ -181,7 +198,7 @@ namespace UAS_MES.Make
 
         private void LoadCollectNum()
         {
-            pa_totalqty.Text = dh.getFieldDataByCondition("package", "pa_totalqty", "pa_outboxcode='" + outboxcode.Text + "' and pa_type=2").ToString();
+            pa_packageqty.Text = dh.getFieldDataByCondition("package", "pa_packageqty", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2").ToString();
         }
 
         private void 栈板称重_SizeChanged(object sender, EventArgs e)
@@ -191,7 +208,7 @@ namespace UAS_MES.Make
 
         private void NewPallet_Click(object sender, EventArgs e)
         {
-            NewBigBox = new Make_BigBox("PACKAGE", pa_makecode.Text);
+            NewBigBox = new Make_NewBigBox("PACKAGE", pa_makecode.Text);
             NewBigBox.Controls["Confirm"].Click += Make_BigBoxCollection_Click;
             BaseUtil.SetFormCenter(NewBigBox);
             NewBigBox.ShowDialog();
@@ -199,7 +216,8 @@ namespace UAS_MES.Make
 
         private void Make_BigBoxCollection_Click(object sender, EventArgs e)
         {
-            palletcode.Text = NewBigBox.OutBoxCode;
+            bigoutboxcode.Text = NewBigBox.OutBoxCode;
+            palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
             NewBigBox.Close();
         }
 
@@ -213,8 +231,8 @@ namespace UAS_MES.Make
 
         private void ReleasePallet_Click(object sender, EventArgs e)
         {
-            dh.ExecuteSql("delete from packagedetail where pd_paid=(select pa_id from package where pa_outboxcode='" + palletcode.Text + "' and pa_type=2)", "delete");
-            dh.ExecuteSql("update package set pa_totalqty=0 where pa_outboxcode='" + palletcode.Text + "' and pa_type=2", "update");
+            dh.ExecuteSql("delete from packagedetail where pd_paid=(select pa_id from package where pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2)", "delete");
+            dh.ExecuteSql("update package set pa_packageqty=0 where pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2", "update");
             OperateResult.AppendText(">>箱号" + outboxcode.Text + "解除成功\n", Color.Green);
             palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
         }

+ 15 - 0
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.resx

@@ -657,4 +657,19 @@
   <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 40 - 7
UAS-MES/FunctionCode/Make/Make_NewBigBox.Designer.cs

@@ -1,6 +1,6 @@
 namespace UAS_MES.Make
 {
-    partial class Make_BigBox
+    partial class Make_NewBigBox
     {
         /// <summary>
         /// Required designer variable.
@@ -28,12 +28,14 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_BigBox));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewPallet));
             this.pr_code_label = new System.Windows.Forms.Label();
+            this.pa_packageqty_label = new System.Windows.Forms.Label();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
             this.title = new System.Windows.Forms.Label();
             this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
             this.headBar1 = new UAS_MES.CustomControl.HeadBar();
+            this.pr_bigboxinnerqty = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.pr_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SuspendLayout();
@@ -49,11 +51,22 @@
             this.pr_code_label.TabIndex = 0;
             this.pr_code_label.Text = "产品编号";
             // 
+            // pa_packageqty_label
+            // 
+            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(25, 131);
+            this.pa_packageqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_packageqty_label.Name = "pa_packageqty_label";
+            this.pa_packageqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_packageqty_label.TabIndex = 1;
+            this.pa_packageqty_label.Text = "箱内数量";
+            // 
             // pa_outboxcode_label
             // 
             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(25, 142);
+            this.pa_outboxcode_label.Location = new System.Drawing.Point(25, 189);
             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);
@@ -75,7 +88,7 @@
             // pa_outboxcode
             // 
             this.pa_outboxcode.Caller = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(128, 142);
+            this.pa_outboxcode.Location = new System.Drawing.Point(128, 189);
             this.pa_outboxcode.MakeCode = null;
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
             this.pa_outboxcode.Name = "pa_outboxcode";
@@ -96,6 +109,22 @@
             this.headBar1.TabIndex = 7;
             this.headBar1.Title = null;
             // 
+            // pr_bigboxinnerqty
+            // 
+            this.pr_bigboxinnerqty.AllPower = null;
+            this.pr_bigboxinnerqty.BackColor = System.Drawing.Color.White;
+            this.pr_bigboxinnerqty.ID = null;
+            this.pr_bigboxinnerqty.Location = new System.Drawing.Point(128, 131);
+            this.pr_bigboxinnerqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_bigboxinnerqty.Name = "pr_bigboxinnerqty";
+            this.pr_bigboxinnerqty.Negative = false;
+            this.pr_bigboxinnerqty.Power = null;
+            this.pr_bigboxinnerqty.Size = new System.Drawing.Size(207, 25);
+            this.pr_bigboxinnerqty.Str = null;
+            this.pr_bigboxinnerqty.Str1 = null;
+            this.pr_bigboxinnerqty.Str2 = null;
+            this.pr_bigboxinnerqty.TabIndex = 6;
+            // 
             // pr_code
             // 
             this.pr_code.AllPower = null;
@@ -123,7 +152,7 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = null;
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(163, 218);
+            this.Confirm.Location = new System.Drawing.Point(164, 236);
             this.Confirm.Margin = new System.Windows.Forms.Padding(4);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
@@ -136,7 +165,7 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // Make_BigBox
+            // Make_NewPallet
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -144,13 +173,15 @@
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.title);
             this.Controls.Add(this.headBar1);
+            this.Controls.Add(this.pr_bigboxinnerqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.pa_outboxcode_label);
+            this.Controls.Add(this.pa_packageqty_label);
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "Make_BigBox";
+            this.Name = "Make_NewPallet";
             this.Tag = "ShowDialogWindow";
             this.Text = "新增栈板";
             this.Load += new System.EventHandler(this.新增栈板_Load);
@@ -162,9 +193,11 @@
         #endregion
 
         private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label pa_packageqty_label;
         private System.Windows.Forms.Label pa_outboxcode_label;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox pr_bigboxinnerqty;
         private CustomControl.HeadBar headBar1;
         private System.Windows.Forms.Label title;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;

+ 10 - 8
UAS-MES/FunctionCode/Make/Make_NewBigBox.cs

@@ -6,7 +6,7 @@ using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Make
 {
-    public partial class Make_BigBox : Form
+    public partial class Make_NewBigBox : Form
     {
         DataHelper dh;
         DataTable Dbfind;
@@ -28,7 +28,7 @@ namespace UAS_MES.Make
             }
         }
 
-        public Make_BigBox(string Caller, string MakeCode)
+        public Make_NewBigBox(string Caller, string MakeCode)
         {
             InitializeComponent();
             switch (Caller)
@@ -39,6 +39,7 @@ namespace UAS_MES.Make
                     break;
                 case "PALLET":
                     title.Text = "新增栈板号";
+                    pr_bigboxinnerqty.Enabled = false;
                     pa_type = "3";
                     break;
                 default:
@@ -52,9 +53,9 @@ namespace UAS_MES.Make
         {
             dh = new DataHelper();
             pr_code.FormName = Name;
-            pr_code.SetValueField = new string[] { "pr_code" };
+            pr_code.SetValueField = new string[] { "pr_code", "pr_bigboxinnerqty" };
             pr_code.TableName = "product";
-            pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格";
+            pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格,pr_bigboxinnerqty # 大箱容量";
             pr_code.DbChange += Pr_code_DbChange;
         }
 
@@ -71,13 +72,14 @@ namespace UAS_MES.Make
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            if (pa_outboxcode.Text != "" && pr_code.Text != "")
+            if (pa_outboxcode.Text != "" && pr_bigboxinnerqty.Text != "" && pr_code.Text != "")
             {
-                string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_type,pa_prodcode,pa_level,PA_STATUS)values";
-                sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,'" + pa_type + "','" + pr_code.Text + "',0,'')";
+                string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_totalqty)values";
+                sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,'0','" + pa_type + "','" + pr_code.Text + "',0,'','" + pr_bigboxinnerqty.Text + "')";
                 dh.ExecuteSql(sql, "insert");
             }
-            else MessageBox.Show("请先填写完整信息");
+            else
+                MessageBox.Show("请先填写完整信息");
         }
 
         private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e)

+ 6 - 39
UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs

@@ -30,12 +30,10 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewPallet));
             this.pr_code_label = new System.Windows.Forms.Label();
-            this.pa_packageqty_label = new System.Windows.Forms.Label();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
             this.title = new System.Windows.Forms.Label();
             this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
             this.headBar1 = new UAS_MES.CustomControl.HeadBar();
-            this.pr_bigboxinnerqty = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.pr_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SuspendLayout();
@@ -44,29 +42,18 @@
             // 
             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(25, 75);
+            this.pr_code_label.Location = new System.Drawing.Point(25, 89);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
             this.pr_code_label.TabIndex = 0;
             this.pr_code_label.Text = "产品编号";
             // 
-            // pa_packageqty_label
-            // 
-            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(25, 131);
-            this.pa_packageqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_packageqty_label.Name = "pa_packageqty_label";
-            this.pa_packageqty_label.Size = new System.Drawing.Size(92, 27);
-            this.pa_packageqty_label.TabIndex = 1;
-            this.pa_packageqty_label.Text = "箱内数量";
-            // 
             // pa_outboxcode_label
             // 
             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(25, 189);
+            this.pa_outboxcode_label.Location = new System.Drawing.Point(25, 158);
             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);
@@ -88,7 +75,7 @@
             // pa_outboxcode
             // 
             this.pa_outboxcode.Caller = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(128, 189);
+            this.pa_outboxcode.Location = new System.Drawing.Point(128, 158);
             this.pa_outboxcode.MakeCode = null;
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
             this.pa_outboxcode.Name = "pa_outboxcode";
@@ -109,22 +96,6 @@
             this.headBar1.TabIndex = 7;
             this.headBar1.Title = null;
             // 
-            // pr_bigboxinnerqty
-            // 
-            this.pr_bigboxinnerqty.AllPower = null;
-            this.pr_bigboxinnerqty.BackColor = System.Drawing.Color.White;
-            this.pr_bigboxinnerqty.ID = null;
-            this.pr_bigboxinnerqty.Location = new System.Drawing.Point(128, 131);
-            this.pr_bigboxinnerqty.Margin = new System.Windows.Forms.Padding(4);
-            this.pr_bigboxinnerqty.Name = "pr_bigboxinnerqty";
-            this.pr_bigboxinnerqty.Negative = false;
-            this.pr_bigboxinnerqty.Power = null;
-            this.pr_bigboxinnerqty.Size = new System.Drawing.Size(207, 25);
-            this.pr_bigboxinnerqty.Str = null;
-            this.pr_bigboxinnerqty.Str1 = null;
-            this.pr_bigboxinnerqty.Str2 = null;
-            this.pr_bigboxinnerqty.TabIndex = 6;
-            // 
             // pr_code
             // 
             this.pr_code.AllPower = null;
@@ -132,7 +103,7 @@
             this.pr_code.Condition = null;
             this.pr_code.DBTitle = "产品编号查询";
             this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(128, 75);
+            this.pr_code.Location = new System.Drawing.Point(128, 89);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = "ifread";
@@ -152,7 +123,7 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = null;
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(164, 236);
+            this.Confirm.Location = new System.Drawing.Point(163, 218);
             this.Confirm.Margin = new System.Windows.Forms.Padding(4);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
@@ -169,15 +140,13 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(399, 280);
+            this.ClientSize = new System.Drawing.Size(399, 270);
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.title);
             this.Controls.Add(this.headBar1);
-            this.Controls.Add(this.pr_bigboxinnerqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.pa_outboxcode_label);
-            this.Controls.Add(this.pa_packageqty_label);
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
@@ -193,11 +162,9 @@
         #endregion
 
         private System.Windows.Forms.Label pr_code_label;
-        private System.Windows.Forms.Label pa_packageqty_label;
         private System.Windows.Forms.Label pa_outboxcode_label;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
-        private CustomControl.TextBoxWithIcon.NumOnlyTextBox pr_bigboxinnerqty;
         private CustomControl.HeadBar headBar1;
         private System.Windows.Forms.Label title;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;

+ 6 - 8
UAS-MES/FunctionCode/Make/Make_NewPallet.cs

@@ -39,7 +39,6 @@ namespace UAS_MES.Make
                     break;
                 case "PALLET":
                     title.Text = "新增栈板号";
-                    pr_bigboxinnerqty.Enabled = false;
                     pa_type = "3";
                     break;
                 default:
@@ -53,9 +52,9 @@ namespace UAS_MES.Make
         {
             dh = new DataHelper();
             pr_code.FormName = Name;
-            pr_code.SetValueField = new string[] { "pr_code", "pr_bigboxinnerqty" };
+            pr_code.SetValueField = new string[] { "pr_code" };
             pr_code.TableName = "product";
-            pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格,pr_bigboxinnerqty # 大箱容量";
+            pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格";
             pr_code.DbChange += Pr_code_DbChange;
         }
 
@@ -72,14 +71,13 @@ namespace UAS_MES.Make
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            if (pa_outboxcode.Text != "" && pr_bigboxinnerqty.Text != "" && pr_code.Text != "")
+            if (pa_outboxcode.Text != "" && pr_code.Text != "")
             {
-                string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS)values";
-                sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,'" + pr_bigboxinnerqty.Text + "','" + pa_type + "','" + pr_code.Text + "',0,'')";
+                string sql = "insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_type,pa_prodcode,pa_level,PA_STATUS)values";
+                sql += "(package_seq.nextval,'" + pa_outboxcode.Text + "','" + pa_outboxcode.MakeCode + "',sysdate,'" + pa_type + "','" + pr_code.Text + "',0,'')";
                 dh.ExecuteSql(sql, "insert");
             }
-            else
-                MessageBox.Show("请先填写完整信息");
+            else MessageBox.Show("请先填写完整信息");
         }
 
         private void pa_outboxcode_UserControlTextChanged(object sender, EventArgs e)

+ 4 - 3
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -136,7 +136,8 @@ namespace UAS_MES.Make
 
         private void Print_Click(object sender, EventArgs e)
         {
-            if (PrintLabel.Items.Count != 0) {
+            if (PrintLabel.Items.Count != 0)
+            {
                 //未采集满的时候点击打印,进行提示
                 if (pr_outboxinnerqty.Text != pa_packageqty.Text)
                 {
@@ -222,9 +223,9 @@ namespace UAS_MES.Make
                                 {
                                     //判断序列号是否存在于制造工序表中
                                     if (dh.getRowCount("makeserial", "ms_sncode='" + barcode.Text + "'") > 0)
-                                    {
                                         InsertDetail();
-                                    }
+                                    else
+                                        OperateResult.AppendText(">>序列号" + barcode.Text + "不存在\n", Color.Red, barcode);
                                 }
                             }
                         }

+ 1 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -125,7 +125,7 @@ namespace UAS_MES.PublicMethod
                     string controlName = collection[i].Name;
                     string controlsTag = collection[i].Tag == null ? "" : collection[i].Tag.ToString();
                     //默认给TextBox和Label赋值
-                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is MaCodeSearchTextBox || collection[i] is EnterTextBox || collection[i] is TextBoxGeneratePaCode)
+                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is MaCodeSearchTextBox || collection[i] is EnterTextBox || collection[i] is TextBoxGeneratePaCode||collection[i] is NumericUpDown)
                     {
                         for (int j = 0; j < dt.Columns.Count; j++)
                         {