瀏覽代碼

修改包装采集改为调用存储过程,箱内容量可编辑

章政 8 年之前
父節點
當前提交
21d90a7131

+ 142 - 126
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -32,8 +32,6 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ms_makecode = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
             this.pa_currentqty_label = new System.Windows.Forms.Label();
             this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
@@ -52,12 +50,18 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.PackageDetail = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
             this.pr_code = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
             this.pa_currentqty = new System.Windows.Forms.Label();
-            this.pr_outboxinnerqty = new System.Windows.Forms.Label();
             this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pr_outboxinnerqty = new System.Windows.Forms.NumericUpDown();
             this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
             this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.ob_nowcheckqty = new System.Windows.Forms.Label();
@@ -69,16 +73,13 @@
             this.pr_packrule = new System.Windows.Forms.Label();
             this.pa_status = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
-            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.panel2.SuspendLayout();
+            this.pa_sccode = new System.Windows.Forms.Label();
+            this.pa_checkno = new System.Windows.Forms.Label();
+            this.pa_downstatus = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).BeginInit();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -86,7 +87,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(13, 93);
+            this.pr_code_label.Location = new System.Drawing.Point(13, 157);
             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);
@@ -97,7 +98,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(279, 93);
+            this.pr_detail_label.Location = new System.Drawing.Point(279, 157);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -108,43 +109,18 @@
             // 
             this.ms_makecode.AutoSize = true;
             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(1108, 568);
+            this.ms_makecode.Location = new System.Drawing.Point(1108, 534);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 76;
             this.ms_makecode.Visible = false;
-            this.ms_makecode.TextChanged += new System.EventHandler(this.ms_makecode_TextChanged);
-            // 
-            // panel2
-            // 
-            this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.panel2.Controls.Add(this.label1);
-            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
-            this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1172, 36);
-            this.panel2.TabIndex = 88;
-            this.panel2.Tag = "NoAuto";
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(6, 5);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "工单信息";
             // 
             // pa_currentqty_label
             // 
             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(279, 152);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(279, 104);
             this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(92, 27);
@@ -155,7 +131,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(13, 152);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(13, 104);
             this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(92, 27);
@@ -167,7 +143,7 @@
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label13.ForeColor = System.Drawing.Color.Black;
-            this.label13.Location = new System.Drawing.Point(11, 723);
+            this.label13.Location = new System.Drawing.Point(11, 689);
             this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(72, 27);
@@ -211,7 +187,7 @@
             // 
             this.Cancel.AutoSize = true;
             this.Cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Cancel.Location = new System.Drawing.Point(413, 723);
+            this.Cancel.Location = new System.Drawing.Point(413, 689);
             this.Cancel.Margin = new System.Windows.Forms.Padding(4);
             this.Cancel.Name = "Cancel";
             this.Cancel.Size = new System.Drawing.Size(114, 31);
@@ -223,7 +199,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(1065, 568);
+            this.pa_id.Location = new System.Drawing.Point(1065, 534);
             this.pa_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_id.Name = "pa_id";
             this.pa_id.Size = new System.Drawing.Size(0, 27);
@@ -277,7 +253,7 @@
             this.pa_outboxcode.Pr_id = null;
             this.pa_outboxcode.ProdCode = null;
             this.pa_outboxcode.ShowClickIcon = false;
-            this.pa_outboxcode.Size = new System.Drawing.Size(176, 28);
+            this.pa_outboxcode.Size = new System.Drawing.Size(173, 28);
             this.pa_outboxcode.TabIndex = 163;
             this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
             // 
@@ -293,7 +269,7 @@
             // 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(5, 556);
+            this.OperateResult.Location = new System.Drawing.Point(5, 522);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(595, 149);
@@ -328,7 +304,7 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(618, 675);
+            this.Clean.Location = new System.Drawing.Point(618, 641);
             this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
@@ -345,7 +321,7 @@
             this.sn_code.AllPower = "ifall";
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(101, 723);
+            this.sn_code.Location = new System.Drawing.Point(101, 689);
             this.sn_code.Margin = new System.Windows.Forms.Padding(4);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = "ifwrite";
@@ -370,7 +346,7 @@
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
-            this.PackageDetail.Location = new System.Drawing.Point(5, 246);
+            this.PackageDetail.Location = new System.Drawing.Point(5, 212);
             this.PackageDetail.Margin = new System.Windows.Forms.Padding(4);
             this.PackageDetail.Name = "PackageDetail";
             this.PackageDetail.ReadOnly = true;
@@ -378,6 +354,59 @@
             this.PackageDetail.Size = new System.Drawing.Size(1150, 300);
             this.PackageDetail.TabIndex = 134;
             // 
+            // pd_barcode
+            // 
+            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.DataPropertyName = "pa_outboxcode";
+            this.pa_outboxcode1.HeaderText = "箱号";
+            this.pa_outboxcode1.Name = "pa_outboxcode1";
+            this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Width = 201;
+            // 
+            // pa_prodcode1
+            // 
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            this.pa_prodcode1.Visible = false;
+            // 
+            // pd_innerqty
+            // 
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
+            // 
+            // pa_indate
+            // 
+            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;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
@@ -391,7 +420,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(130, 93);
+            this.pr_code.Location = new System.Drawing.Point(130, 157);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_code.Name = "pr_code";
@@ -403,7 +432,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(389, 93);
+            this.pr_detail.Location = new System.Drawing.Point(389, 157);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -413,28 +442,18 @@
             // 
             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(389, 152);
+            this.pa_currentqty.Location = new System.Drawing.Point(389, 104);
             this.pa_currentqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
             this.pa_currentqty.TabIndex = 169;
             // 
-            // pr_outboxinnerqty
-            // 
-            this.pr_outboxinnerqty.AutoSize = true;
-            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty.Location = new System.Drawing.Point(130, 152);
-            this.pr_outboxinnerqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
-            this.pr_outboxinnerqty.Size = new System.Drawing.Size(0, 27);
-            this.pr_outboxinnerqty.TabIndex = 170;
-            // 
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
             this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
-            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
             this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty);
@@ -444,7 +463,7 @@
             this.groupBoxWithBorder1.Controls.Add(this.pr_code);
             this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(5, 43);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(5, 7);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
             this.groupBoxWithBorder1.Size = new System.Drawing.Size(548, 196);
             this.groupBoxWithBorder1.TabIndex = 171;
@@ -452,6 +471,21 @@
             this.groupBoxWithBorder1.Text = "装箱信息";
             this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
             // 
+            // pr_outboxinnerqty
+            // 
+            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(130, 104);
+            this.pr_outboxinnerqty.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
+            this.pr_outboxinnerqty.Size = new System.Drawing.Size(142, 27);
+            this.pr_outboxinnerqty.TabIndex = 172;
+            this.pr_outboxinnerqty.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_outboxinnerqty_KeyDown);
+            this.pr_outboxinnerqty.Leave += new System.EventHandler(this.pr_outboxinnerqty_Leave);
+            // 
             // AutoGenBoxCode
             // 
             this.AutoGenBoxCode.AutoSize = true;
@@ -482,7 +516,7 @@
             this.groupBoxWithBorder2.Controls.Add(this.PrintList_label);
             this.groupBoxWithBorder2.Controls.Add(this.PrintNum_label);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(560, 43);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(565, 7);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
             this.groupBoxWithBorder2.Size = new System.Drawing.Size(595, 196);
             this.groupBoxWithBorder2.TabIndex = 172;
@@ -578,7 +612,7 @@
             // 
             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.Location = new System.Drawing.Point(1132, 522);
             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);
@@ -589,7 +623,7 @@
             // 
             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.Location = new System.Drawing.Point(1040, 570);
             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);
@@ -600,7 +634,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(1074, 604);
+            this.ob_checkno.Location = new System.Drawing.Point(1074, 570);
             this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 27);
@@ -608,64 +642,47 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
-            // pd_barcode
-            // 
-            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.DataPropertyName = "pa_outboxcode";
-            this.pa_outboxcode1.HeaderText = "箱号";
-            this.pa_outboxcode1.Name = "pa_outboxcode1";
-            this.pa_outboxcode1.ReadOnly = true;
-            this.pa_outboxcode1.Visible = false;
-            this.pa_outboxcode1.Width = 201;
-            // 
-            // pa_prodcode1
-            // 
-            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
-            this.pa_prodcode1.HeaderText = "产品编号";
-            this.pa_prodcode1.Name = "pa_prodcode1";
-            this.pa_prodcode1.ReadOnly = true;
-            // 
-            // pd_innerqty
-            // 
-            this.pd_innerqty.DataPropertyName = "pd_innerqty";
-            this.pd_innerqty.HeaderText = "箱内数量";
-            this.pd_innerqty.Name = "pd_innerqty";
-            this.pd_innerqty.ReadOnly = true;
-            this.pd_innerqty.Visible = false;
-            this.pd_innerqty.Width = 80;
-            // 
-            // pa_indate
-            // 
-            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;
-            // 
-            // pd_id
-            // 
-            this.pd_id.DataPropertyName = "pd_id";
-            this.pd_id.HeaderText = "ID";
-            this.pd_id.Name = "pd_id";
-            this.pd_id.ReadOnly = true;
-            this.pd_id.Visible = false;
+            // pa_sccode
+            // 
+            this.pa_sccode.AutoSize = true;
+            this.pa_sccode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_sccode.Location = new System.Drawing.Point(1108, 570);
+            this.pa_sccode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_sccode.Name = "pa_sccode";
+            this.pa_sccode.Size = new System.Drawing.Size(0, 27);
+            this.pa_sccode.TabIndex = 176;
+            this.pa_sccode.Visible = false;
+            // 
+            // pa_checkno
+            // 
+            this.pa_checkno.AutoSize = true;
+            this.pa_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_checkno.Location = new System.Drawing.Point(1100, 570);
+            this.pa_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_checkno.Name = "pa_checkno";
+            this.pa_checkno.Size = new System.Drawing.Size(0, 27);
+            this.pa_checkno.TabIndex = 177;
+            this.pa_checkno.Visible = false;
+            // 
+            // pa_downstatus
+            // 
+            this.pa_downstatus.AutoSize = true;
+            this.pa_downstatus.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_downstatus.Location = new System.Drawing.Point(1116, 570);
+            this.pa_downstatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_downstatus.Name = "pa_downstatus";
+            this.pa_downstatus.Size = new System.Drawing.Size(0, 27);
+            this.pa_downstatus.TabIndex = 178;
+            this.pa_downstatus.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.ClientSize = new System.Drawing.Size(1172, 730);
+            this.Controls.Add(this.pa_downstatus);
+            this.Controls.Add(this.pa_checkno);
+            this.Controls.Add(this.pa_sccode);
             this.Controls.Add(this.ob_checkno);
             this.Controls.Add(this.pa_status);
             this.Controls.Add(this.pr_packrule);
@@ -678,7 +695,6 @@
             this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label13);
-            this.Controls.Add(this.panel2);
             this.Controls.Add(this.ms_makecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
@@ -689,12 +705,11 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.包装采集_FormClosing);
             this.Load += new System.EventHandler(this.包装采集_Load);
             this.SizeChanged += new System.EventHandler(this.包装采集_SizeChanged);
-            this.panel2.ResumeLayout(true);
-            this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
             this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).EndInit();
             this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
             this.ResumeLayout(true);
@@ -706,8 +721,6 @@
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label pr_detail_label;
         private System.Windows.Forms.Label ms_makecode;
-        private System.Windows.Forms.Panel panel2;
-        private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label pa_currentqty_label;
         private System.Windows.Forms.Label pr_outboxinnerqty_label;
         private System.Windows.Forms.Label label13;
@@ -731,7 +744,6 @@
         private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pa_currentqty;
-        private System.Windows.Forms.Label pr_outboxinnerqty;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
         private CustomControl.ButtonUtil.NormalButton Packing;
@@ -744,11 +756,15 @@
         private System.Windows.Forms.Label ob_batchqty_label;
         private System.Windows.Forms.Label ob_nowcheckqty;
         private System.Windows.Forms.Label ob_checkno;
+        private System.Windows.Forms.NumericUpDown pr_outboxinnerqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pa_prodcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
+        private System.Windows.Forms.Label pa_sccode;
+        private System.Windows.Forms.Label pa_checkno;
+        private System.Windows.Forms.Label pa_downstatus;
     }
 }

+ 102 - 56
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -24,6 +24,8 @@ namespace UAS_MES.Make
         string ErrorMessage = "";
         string oMakeCode = "";
         string oMsID = "";
+        string oOutBoxCode = "";
+        decimal StandardQTY = 0;
 
         System.DateTime[] indate;
 
@@ -78,14 +80,14 @@ namespace UAS_MES.Make
             if (pa_outboxcode.Text != "")
             {
                 sql.Clear();
-                sql.Append("select pa_outboxcode,pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join product on pa_prodcode=");
+                sql.Append("select pr_code,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join product on pa_prodcode=");
                 sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
                 Err = "箱号";
             }
             else
             {
                 sql.Clear();
-                sql.Append("select ms_makecode,pa_status,pr_packrule,pr_code,pr_detail,pr_outboxinnerqty,pa_standardqty,pa_packageqty,pa_currentqty,");
+                sql.Append("select ms_makecode,pr_code,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
                 sql.Append("pa_outboxcode from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                 sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                 Err = "序列号";
@@ -97,10 +99,10 @@ namespace UAS_MES.Make
                 {
                     dt.Columns.Remove(dt.Columns["pa_standardqty"]);
                 }
+                StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
             }
             else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
-
         }
 
         private void LoadGridData()
@@ -126,7 +128,6 @@ namespace UAS_MES.Make
                     dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
                     if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
                     {
-                        LoadCheckQTY();
                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
                         //满箱更新状态为1
@@ -142,7 +143,7 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
             }
-            else OperateResult.AppendText(">>序列号"+sn_code.Text+"不存在\n", Color.Red,sn_code);
+            else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
         }
 
         private void Print_Click(object sender, EventArgs e)
@@ -165,18 +166,8 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                sql.Clear();
-                sql.Append("select pr_code,pr_detail,pr_outboxinnerqty,pa_currentqty,pa_packageqty from package left join product ");
-                sql.Append("on pr_code=pa_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    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);
-                    sn_code.Focus();
-                }
-                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在\n", Color.Red);
+                LoadData();
+                LoadGridData();
             }
         }
 
@@ -192,28 +183,31 @@ namespace UAS_MES.Make
                     {
                         if (pa_outboxcode.Text == "")
                         {
+                            LoadData();
                             if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
-                            {
-                                LoadData();
                                 LoadGridData();
-                            }
                             else
                             {
-                                LoadData();
-                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                                if (AutoGenBoxCode.Checked)
+                                    pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                             }
                         }
+                        if (pa_outboxcode.Text == "")
+                        {
+                            OperateResult.AppendText(">>箱号不能为空\n", Color.Red, sn_code);
+                            return;
+                        }
                         //按工单核对装箱
-                        switch (pr_packrule.Text)
+                        switch (pr_packrule.Text.ToUpper())
                         {
-                            case "M":
+                            case "MAKE":
                                 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":
+                            case "SALE":
                                 if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                 {
                                     sql.Clear();
@@ -227,13 +221,17 @@ namespace UAS_MES.Make
                                     }
                                 }
                                 break;
-                            case "P":
+                            case "PROD":
                                 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;
+                            case "MIX":
+                                break;
+                            case "SPEC":
+                                break;
                             default:
                                 break;
                         }
@@ -262,45 +260,49 @@ namespace UAS_MES.Make
                                     BaseUtil.CleanDGVData(PackageDetail);
                                     pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                                 }
-                                //箱号不存在的情况
-                                if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                ////箱号不存在的情况
+                                if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
-                                    //插入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,");
-                                    sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
-                                    sql.Append("sysdate,'" + oMakeCode + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + oMakeCode + "'");
-                                    dh.ExecuteSql(sql.GetString(), "insert");
-                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
+                                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
+                                        //满箱更新状态为1
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == pr_outboxinnerqty.Value)
+                                        {
+                                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            if (AutoPrint.Checked)
+                                                Print_Click(new object(), new EventArgs());
+                                        }
+                                        LoadGridData();
+                                        sn_code.Clear();
+                                    }
                                 }
-                                InsertDetail();
+                                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             }
                         }
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
                         else
                         {
-                            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
+                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            if (outboxcode != "")
                             {
-                                string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                                if (outboxcode != "")
+                                if (outboxcode == pa_outboxcode.Text)
                                 {
-                                    if (outboxcode == pa_outboxcode.Text)
-                                    {
-                                        //删除明细行的数据
-                                        dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.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_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                        //清除序列号箱号
-                                        dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
-                                        OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
-                                        LoadGridData();
-                                    }
-                                    else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
+                                    dh.UpdateByCondition("package", "pa_status=0", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                    //删除明细行的数据
+                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.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_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                    //清除序列号箱号
+                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
+                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
+                                    LoadGridData();
                                 }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
                             }
-                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
+                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
                         }
                     }
                     else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
@@ -434,9 +436,53 @@ namespace UAS_MES.Make
             }
         }
 
-        private void ms_makecode_TextChanged(object sender, EventArgs e)
+        private void pr_outboxinnerqty_KeyDown(object sender, KeyEventArgs e)
         {
-            LoadCheckQTY();
+            if (e.KeyCode == Keys.Enter)
+                ResetPackQTY();
+        }
+
+        private void pr_outboxinnerqty_Leave(object sender, EventArgs e)
+        {
+            ResetPackQTY();
+        }
+
+        private void ResetPackQTY()
+        {
+            //数据不符合限制的时候保持原有值
+            int curretnqty = int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text);
+            if (!(pr_outboxinnerqty.Value >= curretnqty))
+            {
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
+            else
+            {
+                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                {
+                    string checknostatus = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno='" + pa_checkno.Text + "'").ToString();
+                    if (checknostatus == "" || checknostatus == "ENTERING")
+                    {
+                        if (pa_downstatus.Text == "0")
+                        {
+                            if (dh.CheckExist("source", "sc_code='" + pa_sccode.Text + "' and  sc_stepcode='" + User.CurrentStepCode + "'"))
+                            {
+                                dh.UpdateByCondition("package", "pa_standardqty='" + pr_outboxinnerqty.Value + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "修改箱内容量", "原容量" + StandardQTY + ",修改为" + pr_outboxinnerqty.Value + "'", pa_outboxcode.Text, pa_checkno.Text);
+                                return;
+                            }
+                            else
+                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "当前所在工序不是登录岗位资源所在工序,不允许修改数量\n", Color.Red);
+                        }
+                        else
+                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于下地状态,不允许修改标准容量\n", Color.Red);
+                    }
+                    else
+                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于送检中,不允许修改标准容量\n", Color.Red);
+                }
+                else
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在,修改容量无效\n", Color.Red);
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
         }
     }
 }

+ 0 - 18
UAS-MES/FunctionCode/Make/Make_PackageCollection.resx

@@ -194,24 +194,6 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pa_prodcode1.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="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <data name="SendCheck.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m

+ 228 - 212
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -29,13 +29,7 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_PackageCollectionWeigh));
-            this.pr_code_label = new System.Windows.Forms.Label();
-            this.pr_detail_label = new System.Windows.Forms.Label();
             this.ms_makecode = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
-            this.pa_currentqty_label = new System.Windows.Forms.Label();
-            this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
             this.pa_code_label = new System.Windows.Forms.Label();
             this.PrintList_label = new System.Windows.Forms.Label();
@@ -52,12 +46,22 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.PackageDetail = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
-            this.pr_code = new System.Windows.Forms.Label();
-            this.pr_detail = new System.Windows.Forms.Label();
-            this.pa_currentqty = new System.Windows.Forms.Label();
-            this.pr_outboxinnerqty = new System.Windows.Forms.Label();
             this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pr_outboxinnerqty = new System.Windows.Forms.NumericUpDown();
+            this.pa_currentqty_label = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.pa_currentqty = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
             this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
             this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.ob_nowcheckqty = new System.Windows.Forms.Label();
@@ -78,105 +82,34 @@
             this.label2 = new System.Windows.Forms.Label();
             this.Baurate = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
-            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.panel2.SuspendLayout();
+            this.pa_downstatus = new System.Windows.Forms.Label();
+            this.pa_checkno = new System.Windows.Forms.Label();
+            this.pa_sccode = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).BeginInit();
             this.groupBoxWithBorder2.SuspendLayout();
             this.groupBoxWithBorder3.SuspendLayout();
             this.SuspendLayout();
             // 
-            // pr_code_label
-            // 
-            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(13, 93);
-            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 = 81;
-            this.pr_code_label.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(279, 93);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
-            this.pr_detail_label.TabIndex = 80;
-            this.pr_detail_label.Text = "产品名称";
-            // 
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
             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(1108, 568);
+            this.ms_makecode.Location = new System.Drawing.Point(1108, 536);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 76;
             this.ms_makecode.Visible = false;
             // 
-            // panel2
-            // 
-            this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.panel2.Controls.Add(this.label1);
-            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
-            this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1172, 36);
-            this.panel2.TabIndex = 88;
-            this.panel2.Tag = "NoAuto";
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(6, 5);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "工单信息";
-            // 
-            // pa_currentqty_label
-            // 
-            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(279, 152);
-            this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_currentqty_label.Name = "pa_currentqty_label";
-            this.pa_currentqty_label.Size = new System.Drawing.Size(92, 27);
-            this.pa_currentqty_label.TabIndex = 95;
-            this.pa_currentqty_label.Text = "已装数量";
-            // 
-            // pr_outboxinnerqty_label
-            // 
-            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(13, 152);
-            this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
-            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(92, 27);
-            this.pr_outboxinnerqty_label.TabIndex = 97;
-            this.pr_outboxinnerqty_label.Text = "箱内容量";
-            // 
             // label13
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label13.ForeColor = System.Drawing.Color.Black;
-            this.label13.Location = new System.Drawing.Point(11, 723);
+            this.label13.Location = new System.Drawing.Point(13, 689);
             this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(72, 27);
@@ -220,7 +153,7 @@
             // 
             this.Cancel.AutoSize = true;
             this.Cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Cancel.Location = new System.Drawing.Point(413, 723);
+            this.Cancel.Location = new System.Drawing.Point(413, 691);
             this.Cancel.Margin = new System.Windows.Forms.Padding(4);
             this.Cancel.Name = "Cancel";
             this.Cancel.Size = new System.Drawing.Size(114, 31);
@@ -232,7 +165,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(1065, 568);
+            this.pa_id.Location = new System.Drawing.Point(1065, 536);
             this.pa_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_id.Name = "pa_id";
             this.pa_id.Size = new System.Drawing.Size(0, 27);
@@ -302,7 +235,7 @@
             // 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(5, 556);
+            this.OperateResult.Location = new System.Drawing.Point(5, 524);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(595, 149);
@@ -337,7 +270,7 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(618, 675);
+            this.Clean.Location = new System.Drawing.Point(618, 643);
             this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
@@ -354,7 +287,7 @@
             this.sn_code.AllPower = "ifall";
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(101, 723);
+            this.sn_code.Location = new System.Drawing.Point(101, 691);
             this.sn_code.Margin = new System.Windows.Forms.Padding(4);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = "ifwrite";
@@ -379,7 +312,7 @@
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
-            this.PackageDetail.Location = new System.Drawing.Point(5, 246);
+            this.PackageDetail.Location = new System.Drawing.Point(5, 214);
             this.PackageDetail.Margin = new System.Windows.Forms.Padding(4);
             this.PackageDetail.Name = "PackageDetail";
             this.PackageDetail.ReadOnly = true;
@@ -387,73 +320,84 @@
             this.PackageDetail.Size = new System.Drawing.Size(881, 300);
             this.PackageDetail.TabIndex = 134;
             // 
-            // AutoPrint
+            // pd_barcode
             // 
-            this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(126, 147);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(112, 27);
-            this.AutoPrint.TabIndex = 166;
+            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;
             // 
-            // pr_code
+            // pa_outboxcode1
             // 
-            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(130, 93);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
-            this.pr_code.TabIndex = 167;
-            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            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;
             // 
-            // pr_detail
+            // pa_prodcode1
             // 
-            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(389, 93);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
-            this.pr_detail.TabIndex = 168;
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            this.pa_prodcode1.Visible = false;
             // 
-            // pa_currentqty
+            // pd_innerqty
             // 
-            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(389, 152);
-            this.pa_currentqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_currentqty.Name = "pa_currentqty";
-            this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
-            this.pa_currentqty.TabIndex = 169;
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
             // 
-            // pr_outboxinnerqty
+            // pa_indate
             // 
-            this.pr_outboxinnerqty.AutoSize = true;
-            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty.Location = new System.Drawing.Point(130, 152);
-            this.pr_outboxinnerqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
-            this.pr_outboxinnerqty.Size = new System.Drawing.Size(0, 27);
-            this.pr_outboxinnerqty.TabIndex = 170;
+            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;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
+            // AutoPrint
+            // 
+            this.AutoPrint.Checked = false;
+            this.AutoPrint.Location = new System.Drawing.Point(126, 147);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(112, 27);
+            this.AutoPrint.TabIndex = 166;
             // 
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
-            this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
-            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
-            this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty);
             this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(5, 43);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(5, 8);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
             this.groupBoxWithBorder1.Size = new System.Drawing.Size(548, 196);
             this.groupBoxWithBorder1.TabIndex = 171;
@@ -461,6 +405,96 @@
             this.groupBoxWithBorder1.Text = "装箱信息";
             this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
             // 
+            // pr_outboxinnerqty
+            // 
+            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(130, 94);
+            this.pr_outboxinnerqty.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
+            this.pr_outboxinnerqty.Size = new System.Drawing.Size(142, 27);
+            this.pr_outboxinnerqty.TabIndex = 180;
+            this.pr_outboxinnerqty.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_outboxinnerqty_KeyDown);
+            this.pr_outboxinnerqty.Leave += new System.EventHandler(this.pr_outboxinnerqty_Leave);
+            // 
+            // pa_currentqty_label
+            // 
+            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(279, 94);
+            this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_currentqty_label.Name = "pa_currentqty_label";
+            this.pa_currentqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_currentqty_label.TabIndex = 175;
+            this.pa_currentqty_label.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(279, 147);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.TabIndex = 173;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // pa_currentqty
+            // 
+            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(389, 94);
+            this.pa_currentqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_currentqty.Name = "pa_currentqty";
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
+            this.pa_currentqty.TabIndex = 179;
+            // 
+            // pr_code_label
+            // 
+            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(13, 147);
+            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 = 174;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // pr_detail
+            // 
+            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(389, 147);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.TabIndex = 178;
+            // 
+            // pr_outboxinnerqty_label
+            // 
+            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(13, 94);
+            this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
+            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_outboxinnerqty_label.TabIndex = 176;
+            this.pr_outboxinnerqty_label.Text = "箱内容量";
+            // 
+            // pr_code
+            // 
+            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(130, 147);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 177;
+            // 
             // AutoGenBoxCode
             // 
             this.AutoGenBoxCode.AutoSize = true;
@@ -491,7 +525,7 @@
             this.groupBoxWithBorder2.Controls.Add(this.PrintList_label);
             this.groupBoxWithBorder2.Controls.Add(this.PrintNum_label);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(560, 43);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(560, 8);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
             this.groupBoxWithBorder2.Size = new System.Drawing.Size(595, 196);
             this.groupBoxWithBorder2.TabIndex = 172;
@@ -597,7 +631,7 @@
             // 
             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(1036, 568);
+            this.pa_status.Location = new System.Drawing.Point(1036, 536);
             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);
@@ -608,7 +642,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(1090, 568);
+            this.ob_checkno.Location = new System.Drawing.Point(1090, 536);
             this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 27);
@@ -626,7 +660,7 @@
             this.groupBoxWithBorder3.Controls.Add(this.weight);
             this.groupBoxWithBorder3.Controls.Add(this.label2);
             this.groupBoxWithBorder3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder3.Location = new System.Drawing.Point(898, 245);
+            this.groupBoxWithBorder3.Location = new System.Drawing.Point(898, 213);
             this.groupBoxWithBorder3.Name = "groupBoxWithBorder3";
             this.groupBoxWithBorder3.Size = new System.Drawing.Size(257, 301);
             this.groupBoxWithBorder3.TabIndex = 172;
@@ -704,7 +738,7 @@
             // 
             this.Baurate.AutoSize = true;
             this.Baurate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Baurate.Location = new System.Drawing.Point(955, 568);
+            this.Baurate.Location = new System.Drawing.Point(955, 536);
             this.Baurate.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Baurate.Name = "Baurate";
             this.Baurate.Size = new System.Drawing.Size(0, 27);
@@ -715,71 +749,54 @@
             // 
             this.ComList.AutoSize = true;
             this.ComList.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ComList.Location = new System.Drawing.Point(977, 568);
+            this.ComList.Location = new System.Drawing.Point(977, 536);
             this.ComList.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ComList.Name = "ComList";
             this.ComList.Size = new System.Drawing.Size(0, 27);
             this.ComList.TabIndex = 177;
             this.ComList.Visible = false;
             // 
-            // pd_barcode
-            // 
-            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.DataPropertyName = "pa_outboxcode";
-            this.pa_outboxcode1.HeaderText = "箱号";
-            this.pa_outboxcode1.Name = "pa_outboxcode1";
-            this.pa_outboxcode1.ReadOnly = true;
-            this.pa_outboxcode1.Visible = false;
-            this.pa_outboxcode1.Width = 201;
-            // 
-            // pa_prodcode1
-            // 
-            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
-            this.pa_prodcode1.HeaderText = "产品编号";
-            this.pa_prodcode1.Name = "pa_prodcode1";
-            this.pa_prodcode1.ReadOnly = true;
-            // 
-            // pd_innerqty
-            // 
-            this.pd_innerqty.DataPropertyName = "pd_innerqty";
-            this.pd_innerqty.HeaderText = "箱内数量";
-            this.pd_innerqty.Name = "pd_innerqty";
-            this.pd_innerqty.ReadOnly = true;
-            this.pd_innerqty.Visible = false;
-            this.pd_innerqty.Width = 80;
-            // 
-            // pa_indate
-            // 
-            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;
-            // 
-            // pd_id
-            // 
-            this.pd_id.DataPropertyName = "pd_id";
-            this.pd_id.HeaderText = "ID";
-            this.pd_id.Name = "pd_id";
-            this.pd_id.ReadOnly = true;
-            this.pd_id.Visible = false;
+            // pa_downstatus
+            // 
+            this.pa_downstatus.AutoSize = true;
+            this.pa_downstatus.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_downstatus.Location = new System.Drawing.Point(1108, 568);
+            this.pa_downstatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_downstatus.Name = "pa_downstatus";
+            this.pa_downstatus.Size = new System.Drawing.Size(0, 27);
+            this.pa_downstatus.TabIndex = 179;
+            this.pa_downstatus.Visible = false;
+            // 
+            // pa_checkno
+            // 
+            this.pa_checkno.AutoSize = true;
+            this.pa_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_checkno.Location = new System.Drawing.Point(1116, 589);
+            this.pa_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_checkno.Name = "pa_checkno";
+            this.pa_checkno.Size = new System.Drawing.Size(0, 27);
+            this.pa_checkno.TabIndex = 180;
+            this.pa_checkno.Visible = false;
+            // 
+            // pa_sccode
+            // 
+            this.pa_sccode.AutoSize = true;
+            this.pa_sccode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_sccode.Location = new System.Drawing.Point(1100, 568);
+            this.pa_sccode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_sccode.Name = "pa_sccode";
+            this.pa_sccode.Size = new System.Drawing.Size(0, 27);
+            this.pa_sccode.TabIndex = 181;
+            this.pa_sccode.Visible = false;
             // 
             // Make_PackageCollectionWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1172, 760);
+            this.ClientSize = new System.Drawing.Size(1172, 727);
+            this.Controls.Add(this.pa_sccode);
+            this.Controls.Add(this.pa_checkno);
+            this.Controls.Add(this.pa_downstatus);
             this.Controls.Add(this.ComList);
             this.Controls.Add(this.Baurate);
             this.Controls.Add(this.groupBoxWithBorder3);
@@ -795,7 +812,6 @@
             this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label13);
-            this.Controls.Add(this.panel2);
             this.Controls.Add(this.ms_makecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
@@ -806,12 +822,11 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.包装采集_FormClosing);
             this.Load += new System.EventHandler(this.包装采集_Load);
             this.SizeChanged += new System.EventHandler(this.包装采集_SizeChanged);
-            this.panel2.ResumeLayout(true);
-            this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
             this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).EndInit();
             this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
             this.groupBoxWithBorder3.ResumeLayout(true);
@@ -822,19 +837,13 @@
         }
 
         #endregion
-        private System.Windows.Forms.Label pr_code_label;
-        private System.Windows.Forms.Label pr_detail_label;
         private System.Windows.Forms.Label ms_makecode;
-        private System.Windows.Forms.Panel panel2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Label pa_currentqty_label;
-        private System.Windows.Forms.Label pr_outboxinnerqty_label;
         private System.Windows.Forms.Label label13;
         private System.Windows.Forms.Label pa_code_label;
         private System.Windows.Forms.Label PrintList_label;
-        private System.Windows.Forms.Label PrintNum_label; 
+        private System.Windows.Forms.Label PrintNum_label;
         private System.Windows.Forms.CheckBox Cancel;
-  
+
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum PackageDetail;
         private CustomControl.TextBoxWithIcon.EnterTextBox sn_code;
         private CustomControl.ButtonUtil.NormalButton Clean;
@@ -847,10 +856,6 @@
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
         private System.Windows.Forms.NumericUpDown PrintNum;
         private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
-        private System.Windows.Forms.Label pr_code;
-        private System.Windows.Forms.Label pr_detail;
-        private System.Windows.Forms.Label pa_currentqty;
-        private System.Windows.Forms.Label pr_outboxinnerqty;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
         private CustomControl.ButtonUtil.NormalButton Packing;
@@ -878,5 +883,16 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
+        private System.Windows.Forms.Label pa_downstatus;
+        private System.Windows.Forms.Label pa_checkno;
+        private System.Windows.Forms.Label pa_sccode;
+        private System.Windows.Forms.NumericUpDown pr_outboxinnerqty;
+        private System.Windows.Forms.Label pa_currentqty_label;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label pa_currentqty;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_outboxinnerqty_label;
+        private System.Windows.Forms.Label pr_code;
     }
 }

+ 94 - 42
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -34,6 +34,10 @@ namespace UAS_MES.Make
         //最小重量
         double MinWeight;
 
+        decimal StandardQTY = 0;
+
+        string oOutBoxCode = "";
+
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
 
@@ -142,16 +146,18 @@ namespace UAS_MES.Make
             if (pa_outboxcode.Text != "")
             {
                 sql.Clear();
-                sql.Append("select pa_outboxcode,pr_code,pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty,pr_cartonminw, ");
-                sql.Append("pr_cartonmaxw,pr_cartonunit,pr_cartongw from package left join product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                sql.Append("select pr_cartonmaxw,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+                sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join ");
+                sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
                 Err = "箱号";
             }
             else
             {
                 sql.Clear();
-                sql.Append("select ms_makecode,pr_cartonunit,pa_status,pr_packrule,pr_code,pr_detail,pr_outboxinnerqty,pa_standardqty,pa_packageqty,pa_currentqty,");
-                sql.Append("pa_outboxcode,pr_cartonminw,pr_cartonmaxw,pr_cartongw from makeserial left join product on ms_prodcode=pr_code left ");
-                sql.Append("join packagedetail on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                sql.Append("select pr_cartonmaxw,pr_cartonminw,pr_cartongw,ms_makecode,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,");
+                sql.Append("pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
+                sql.Append("pa_outboxcode from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                 Err = "序列号";
             }
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -169,6 +175,7 @@ namespace UAS_MES.Make
                 Weight = double.Parse(_weight == "" ? "0" : _weight);
                 MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                 MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
                 if (Weight - MinWeight == MaxWeight - Weight)
                     pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight);
@@ -261,11 +268,9 @@ namespace UAS_MES.Make
                     {
                         if (pa_outboxcode.Text == "")
                         {
+                            LoadData();
                             if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
-                            {
-                                LoadData();
                                 LoadGridData();
-                            }
                             else
                             {
                                 LoadData();
@@ -331,51 +336,49 @@ namespace UAS_MES.Make
                                     BaseUtil.CleanDGVData(PackageDetail);
                                     pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                                 }
-                                //箱号不存在的情况
-                                if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                ////箱号不存在的情况
+                                if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
-                                    //插入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,");
-                                    sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
-                                    sql.Append("sysdate,'" + ms_makecode.Text + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + ms_makecode.Text + "'");
-                                    dh.ExecuteSql(sql.GetString(), "insert");
-                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
-                                    InsertDetail();
-                                }
-                                else
-                                {
-                                    if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
-                                        InsertDetail();
-                                    else
-                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
+                                        //满箱更新状态为1
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == pr_outboxinnerqty.Value)
+                                        {
+                                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            if (AutoPrint.Checked)
+                                                Print_Click(new object(), new EventArgs());
+                                        }
+                                        LoadGridData();
+                                        sn_code.Clear();
+                                    }
                                 }
+                                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             }
                         }
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
                         else
                         {
-                            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
+                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            if (outboxcode != "")
                             {
-                                string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                                if (outboxcode != "")
+                                if (outboxcode == pa_outboxcode.Text)
                                 {
-                                    if (outboxcode == pa_outboxcode.Text)
-                                    {
-                                        //删除明细行的数据
-                                        dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.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_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                        //清除序列号箱号
-                                        dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                        OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
-                                        LoadGridData();
-                                    }
-                                    else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red, sn_code);
+                                    dh.UpdateByCondition("package", "pa_status=0", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                    //删除明细行的数据
+                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.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_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                    //清除序列号箱号
+                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
+                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
+                                    LoadGridData();
                                 }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
                             }
-                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
+                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
                         }
                     }
                     else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
@@ -516,5 +519,54 @@ namespace UAS_MES.Make
                 SendCheck.Enabled = true;
             }
         }
+
+        private void pr_outboxinnerqty_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+                ResetPackQTY();
+        }
+
+        private void pr_outboxinnerqty_Leave(object sender, EventArgs e)
+        {
+            ResetPackQTY();
+        }
+
+        private void ResetPackQTY()
+        {
+            //数据不符合限制的时候保持原有值
+            int curretnqty = int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text);
+            if (!(pr_outboxinnerqty.Value >= curretnqty))
+            {
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
+            else
+            {
+                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                {
+                    string checknostatus = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno='" + pa_checkno.Text + "'").ToString();
+                    if (checknostatus == "" || checknostatus == "ENTERING")
+                    {
+                        if (pa_downstatus.Text == "0")
+                        {
+                            if (dh.CheckExist("source", "sc_code='" + pa_sccode.Text + "' and  sc_stepcode='" + User.CurrentStepCode + "'"))
+                            {
+                                dh.UpdateByCondition("package", "pa_standardqty='" + pr_outboxinnerqty.Value + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "修改箱内容量", "原容量" + StandardQTY + ",修改为" + pr_outboxinnerqty.Value + "'", pa_outboxcode.Text, pa_checkno.Text);
+                                return;
+                            }
+                            else
+                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "当前所在工序不是登录岗位资源所在工序,不允许修改数量\n", Color.Red);
+                        }
+                        else
+                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于下地状态,不允许修改标准容量\n", Color.Red);
+                    }
+                    else
+                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于送检中,不允许修改标准容量\n", Color.Red);
+                }
+                else
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在,修改容量无效\n", Color.Red);
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
+        }
     }
 }

+ 18 - 0
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.resx

@@ -212,6 +212,24 @@
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode1.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="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="SendCheck.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m