Эх сурвалжийг харах

Merge remote-tracking branch 'refs/remotes/origin/master'

章政 6 жил өмнө
parent
commit
85e90a907f

+ 0 - 37
UAS-出货标签管理(标签复核)/PublicMethod/DataHelper.cs

@@ -187,42 +187,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        /// <summary>
-        /// 执行打印的SQL
-        /// </summary>
-        /// <param name="SQL">SQL语句</param>
-        /// <param name="Parameters">动态添加的参数,主要根据条码枪扫描获取</param>
-        /// <returns></returns>
-        public object ExecutePrintSQL(string SQL, params string[] Parameters)
-        {
-            //按照?拆分数据,然后以:Param替换问号,同时添加参数
-            string[] Param = SQL.Split('?');
-            int ParamNum = Param.Length - 1;
-            //条码打印必然存在需要维护的参数
-            if (ParamNum > 0)
-            {
-                StringBuilder sb = new StringBuilder();
-                for (int i = 0; i < ParamNum; i++)
-                {
-                    sb.Append(Param[i] + ":Param" + i);
-                }
-                command = new OracleCommand(sb.ToString(), connection);
-
-                for (int i = 0; i < ParamNum; i++)
-                {
-                    command.Parameters.Add("Param" + i, OracleDbType.Varchar2, Parameters[i], ParameterDirection.Input);
-                }
-
-                OracleDataAdapter ad = new OracleDataAdapter(command);
-                DataTable dt = new DataTable();
-                ad.Fill(dt);
-                ad.Dispose();
-                command.Dispose();
-                return dt;
-            }
-            return "参数错误,请检查SQL语句";
-        }
-
         /// <summary>
         /// 获取指定表的记录的条数 ,带条件
         /// </summary>
@@ -826,7 +790,6 @@ namespace UAS_LabelMachine
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
             object result = null;
-            Console.WriteLine(SQL);
             command = new OracleCommand(SQL, connection);
             //用来拼接参数的
             if (names.Length > 0)

+ 247 - 169
UAS-出货标签管理(标签复核)/UAS_出货标签管理.Designer.cs

@@ -56,7 +56,6 @@
             this.Fresh = new System.Windows.Forms.LinkLabel();
             this.label3 = new System.Windows.Forms.Label();
             this.CleanInputAfterCollect = new System.Windows.Forms.CheckBox();
-            this.GetGridOnly = new System.Windows.Forms.CheckBox();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -89,8 +88,9 @@
             this.pi_date = new System.Windows.Forms.Label();
             this.CleanBarCode = new System.Windows.Forms.Button();
             this.ExportData = new System.Windows.Forms.Button();
-            this.CollectAll = new System.Windows.Forms.Button();
-            this.cu_needrecheck = new System.Windows.Forms.Label();
+            this.sg_code = new System.Windows.Forms.Label();
+            this.pi_inoutno = new System.Windows.Forms.Label();
+            this.AllCollect = new System.Windows.Forms.Button();
             this.cu_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.pr_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.CollectionProcess = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
@@ -130,7 +130,11 @@
             this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.pi_invoicecode = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.cu_needrecheck = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.needcheck = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.CollectionProcess.SuspendLayout();
@@ -141,19 +145,21 @@
             // 
             this.pi_inoutno_label.AutoSize = true;
             this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(3, 10);
+            this.pi_inoutno_label.Location = new System.Drawing.Point(6, 20);
+            this.pi_inoutno_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pi_inoutno_label.Name = "pi_inoutno_label";
-            this.pi_inoutno_label.Size = new System.Drawing.Size(65, 20);
+            this.pi_inoutno_label.Size = new System.Drawing.Size(99, 36);
             this.pi_inoutno_label.TabIndex = 3;
-            this.pi_inoutno_label.Text = "出货单号";
+            this.pi_inoutno_label.Text = "发票号";
             // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(3, 66);
+            this.label1.Location = new System.Drawing.Point(6, 190);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(65, 20);
+            this.label1.Size = new System.Drawing.Size(127, 36);
             this.label1.TabIndex = 31;
             this.label1.Text = "采集策略";
             // 
@@ -161,9 +167,10 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(5, 106);
+            this.label2.Location = new System.Drawing.Point(10, 270);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(65, 20);
+            this.label2.Size = new System.Drawing.Size(127, 36);
             this.label2.TabIndex = 33;
             this.label2.Text = "当前采集";
             // 
@@ -171,9 +178,10 @@
             // 
             this.label22.AutoSize = true;
             this.label22.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label22.Location = new System.Drawing.Point(72, 106);
+            this.label22.Location = new System.Drawing.Point(144, 270);
+            this.label22.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(65, 20);
+            this.label22.Size = new System.Drawing.Size(127, 36);
             this.label22.TabIndex = 34;
             this.label22.Text = "明细序号";
             // 
@@ -181,10 +189,10 @@
             // 
             this.AutoMatch.AutoSize = true;
             this.AutoMatch.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoMatch.Location = new System.Drawing.Point(144, 106);
-            this.AutoMatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.AutoMatch.Location = new System.Drawing.Point(288, 270);
+            this.AutoMatch.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AutoMatch.Name = "AutoMatch";
-            this.AutoMatch.Size = new System.Drawing.Size(84, 24);
+            this.AutoMatch.Size = new System.Drawing.Size(159, 40);
             this.AutoMatch.TabIndex = 49;
             this.AutoMatch.Text = "自动匹配";
             this.AutoMatch.UseVisualStyleBackColor = true;
@@ -193,9 +201,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(72, 158);
+            this.pr_code_label.Location = new System.Drawing.Point(18, 374);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(65, 20);
+            this.pr_code_label.Size = new System.Drawing.Size(127, 36);
             this.pr_code_label.TabIndex = 51;
             this.pr_code_label.Text = "物料编号";
             // 
@@ -203,19 +212,20 @@
             // 
             this.label24.AutoSize = true;
             this.label24.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label24.Location = new System.Drawing.Point(9, 218);
+            this.label24.Location = new System.Drawing.Point(18, 447);
+            this.label24.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label24.Name = "label24";
-            this.label24.Size = new System.Drawing.Size(51, 20);
+            this.label24.Size = new System.Drawing.Size(99, 36);
             this.label24.TabIndex = 55;
             this.label24.Text = "输入框";
             // 
             // GenerateBarCode
             // 
             this.GenerateBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GenerateBarCode.Location = new System.Drawing.Point(374, 180);
-            this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.GenerateBarCode.Location = new System.Drawing.Point(748, 371);
+            this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.GenerateBarCode.Name = "GenerateBarCode";
-            this.GenerateBarCode.Size = new System.Drawing.Size(68, 26);
+            this.GenerateBarCode.Size = new System.Drawing.Size(136, 52);
             this.GenerateBarCode.TabIndex = 41;
             this.GenerateBarCode.Text = "生成条码";
             this.GenerateBarCode.UseVisualStyleBackColor = true;
@@ -224,10 +234,10 @@
             // SaveGrid
             // 
             this.SaveGrid.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SaveGrid.Location = new System.Drawing.Point(448, 216);
-            this.SaveGrid.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.SaveGrid.Location = new System.Drawing.Point(896, 443);
+            this.SaveGrid.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SaveGrid.Name = "SaveGrid";
-            this.SaveGrid.Size = new System.Drawing.Size(68, 26);
+            this.SaveGrid.Size = new System.Drawing.Size(136, 52);
             this.SaveGrid.TabIndex = 59;
             this.SaveGrid.Text = "保存明细";
             this.SaveGrid.UseVisualStyleBackColor = true;
@@ -237,19 +247,20 @@
             // 
             this.sg_separator_label.AutoSize = true;
             this.sg_separator_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sg_separator_label.Location = new System.Drawing.Point(233, 66);
+            this.sg_separator_label.Location = new System.Drawing.Point(486, 196);
+            this.sg_separator_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.sg_separator_label.Name = "sg_separator_label";
-            this.sg_separator_label.Size = new System.Drawing.Size(51, 20);
+            this.sg_separator_label.Size = new System.Drawing.Size(99, 36);
             this.sg_separator_label.TabIndex = 61;
             this.sg_separator_label.Text = "分隔符";
             // 
             // CollectionSetting
             // 
             this.CollectionSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionSetting.Location = new System.Drawing.Point(230, 104);
-            this.CollectionSetting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CollectionSetting.Location = new System.Drawing.Point(492, 266);
+            this.CollectionSetting.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CollectionSetting.Name = "CollectionSetting";
-            this.CollectionSetting.Size = new System.Drawing.Size(88, 26);
+            this.CollectionSetting.Size = new System.Drawing.Size(176, 52);
             this.CollectionSetting.TabIndex = 63;
             this.CollectionSetting.Text = "采集策略设置";
             this.CollectionSetting.UseVisualStyleBackColor = true;
@@ -269,11 +280,11 @@
             this.si_expression,
             this.si_item,
             this.si_expressionitem});
-            this.Si_ItemDGV.Location = new System.Drawing.Point(324, 14);
-            this.Si_ItemDGV.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Si_ItemDGV.Location = new System.Drawing.Point(680, 28);
+            this.Si_ItemDGV.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.Si_ItemDGV.Name = "Si_ItemDGV";
             this.Si_ItemDGV.RowTemplate.Height = 23;
-            this.Si_ItemDGV.Size = new System.Drawing.Size(134, 146);
+            this.Si_ItemDGV.Size = new System.Drawing.Size(268, 292);
             this.Si_ItemDGV.TabIndex = 65;
             // 
             // si_detno
@@ -341,10 +352,10 @@
             // CleanDetail
             // 
             this.CleanDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanDetail.Location = new System.Drawing.Point(374, 216);
-            this.CleanDetail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CleanDetail.Location = new System.Drawing.Point(748, 443);
+            this.CleanDetail.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CleanDetail.Name = "CleanDetail";
-            this.CleanDetail.Size = new System.Drawing.Size(68, 26);
+            this.CleanDetail.Size = new System.Drawing.Size(136, 52);
             this.CleanDetail.TabIndex = 66;
             this.CleanDetail.Text = "清除明细";
             this.CleanDetail.UseVisualStyleBackColor = true;
@@ -354,9 +365,10 @@
             // 
             this.pib_id.AutoSize = true;
             this.pib_id.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pib_id.Location = new System.Drawing.Point(142, 160);
+            this.pib_id.Location = new System.Drawing.Point(284, 331);
+            this.pib_id.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pib_id.Name = "pib_id";
-            this.pib_id.Size = new System.Drawing.Size(0, 20);
+            this.pib_id.Size = new System.Drawing.Size(0, 36);
             this.pib_id.TabIndex = 69;
             this.pib_id.Visible = false;
             // 
@@ -364,18 +376,20 @@
             // 
             this.pi_cardcode_label.AutoSize = true;
             this.pi_cardcode_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_cardcode_label.Location = new System.Drawing.Point(3, 38);
+            this.pi_cardcode_label.Location = new System.Drawing.Point(6, 134);
+            this.pi_cardcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pi_cardcode_label.Name = "pi_cardcode_label";
-            this.pi_cardcode_label.Size = new System.Drawing.Size(65, 20);
+            this.pi_cardcode_label.Size = new System.Drawing.Size(127, 36);
             this.pi_cardcode_label.TabIndex = 72;
             this.pi_cardcode_label.Text = "客户编号";
             // 
             // Fresh
             // 
             this.Fresh.AutoSize = true;
-            this.Fresh.Location = new System.Drawing.Point(228, 14);
+            this.Fresh.Location = new System.Drawing.Point(456, 28);
+            this.Fresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Fresh.Name = "Fresh";
-            this.Fresh.Size = new System.Drawing.Size(29, 12);
+            this.Fresh.Size = new System.Drawing.Size(58, 24);
             this.Fresh.TabIndex = 73;
             this.Fresh.TabStop = true;
             this.Fresh.Text = "刷新";
@@ -385,9 +399,10 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(5, 587);
+            this.label3.Location = new System.Drawing.Point(10, 1174);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.Size = new System.Drawing.Size(146, 41);
             this.label3.TabIndex = 29;
             this.label3.Text = "输出日志";
             // 
@@ -397,26 +412,14 @@
             this.CleanInputAfterCollect.Checked = true;
             this.CleanInputAfterCollect.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CleanInputAfterCollect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanInputAfterCollect.Location = new System.Drawing.Point(232, 219);
-            this.CleanInputAfterCollect.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CleanInputAfterCollect.Location = new System.Drawing.Point(464, 449);
+            this.CleanInputAfterCollect.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CleanInputAfterCollect.Name = "CleanInputAfterCollect";
-            this.CleanInputAfterCollect.Size = new System.Drawing.Size(123, 21);
+            this.CleanInputAfterCollect.Size = new System.Drawing.Size(238, 35);
             this.CleanInputAfterCollect.TabIndex = 74;
             this.CleanInputAfterCollect.Text = "采集后清除输入框";
             this.CleanInputAfterCollect.UseVisualStyleBackColor = true;
             // 
-            // GetGridOnly
-            // 
-            this.GetGridOnly.AutoSize = true;
-            this.GetGridOnly.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetGridOnly.Location = new System.Drawing.Point(230, 38);
-            this.GetGridOnly.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.GetGridOnly.Name = "GetGridOnly";
-            this.GetGridOnly.Size = new System.Drawing.Size(77, 20);
-            this.GetGridOnly.TabIndex = 82;
-            this.GetGridOnly.Text = "仅获取表格";
-            this.GetGridOnly.UseVisualStyleBackColor = true;
-            // 
             // dataGridViewCheckBoxColumn1
             // 
             this.dataGridViewCheckBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -625,10 +628,10 @@
             // 
             // ChooseAll
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(4, 252);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseAll.Location = new System.Drawing.Point(8, 504);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
             this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(38, 22);
+            this.ChooseAll.Size = new System.Drawing.Size(76, 44);
             this.ChooseAll.TabIndex = 84;
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
@@ -638,19 +641,20 @@
             // 
             this.pi_date.AutoSize = true;
             this.pi_date.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_date.Location = new System.Drawing.Point(5, 158);
+            this.pi_date.Location = new System.Drawing.Point(10, 316);
+            this.pi_date.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pi_date.Name = "pi_date";
-            this.pi_date.Size = new System.Drawing.Size(0, 20);
+            this.pi_date.Size = new System.Drawing.Size(0, 36);
             this.pi_date.TabIndex = 86;
             this.pi_date.Visible = false;
             // 
             // CleanBarCode
             // 
             this.CleanBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanBarCode.Location = new System.Drawing.Point(448, 180);
-            this.CleanBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CleanBarCode.Location = new System.Drawing.Point(896, 371);
+            this.CleanBarCode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CleanBarCode.Name = "CleanBarCode";
-            this.CleanBarCode.Size = new System.Drawing.Size(68, 26);
+            this.CleanBarCode.Size = new System.Drawing.Size(136, 52);
             this.CleanBarCode.TabIndex = 87;
             this.CleanBarCode.Text = "清空条码";
             this.CleanBarCode.UseVisualStyleBackColor = true;
@@ -659,36 +663,47 @@
             // ExportData
             // 
             this.ExportData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ExportData.Location = new System.Drawing.Point(522, 180);
-            this.ExportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ExportData.Location = new System.Drawing.Point(1044, 371);
+            this.ExportData.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.ExportData.Name = "ExportData";
-            this.ExportData.Size = new System.Drawing.Size(68, 26);
+            this.ExportData.Size = new System.Drawing.Size(136, 52);
             this.ExportData.TabIndex = 91;
             this.ExportData.Text = "导出数据";
             this.ExportData.UseVisualStyleBackColor = true;
             this.ExportData.Click += new System.EventHandler(this.ExportData_Click);
             // 
-            // CollectAll
+            // sg_code
             // 
-            this.CollectAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectAll.Location = new System.Drawing.Point(522, 216);
-            this.CollectAll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CollectAll.Name = "CollectAll";
-            this.CollectAll.Size = new System.Drawing.Size(68, 26);
-            this.CollectAll.TabIndex = 92;
-            this.CollectAll.Text = "全部已采";
-            this.CollectAll.UseVisualStyleBackColor = true;
-            this.CollectAll.Click += new System.EventHandler(this.CollectAll_Click);
+            this.sg_code.AutoSize = true;
+            this.sg_code.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sg_code.Location = new System.Drawing.Point(649, 136);
+            this.sg_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.sg_code.Name = "sg_code";
+            this.sg_code.Size = new System.Drawing.Size(0, 36);
+            this.sg_code.TabIndex = 92;
+            this.sg_code.TextChanged += new System.EventHandler(this.sg_brand_UserControlTextChanged);
             // 
-            // cu_needrecheck
+            // pi_inoutno
             // 
-            this.cu_needrecheck.AutoSize = true;
-            this.cu_needrecheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_needrecheck.Location = new System.Drawing.Point(640, 96);
-            this.cu_needrecheck.Name = "cu_needrecheck";
-            this.cu_needrecheck.Size = new System.Drawing.Size(0, 20);
-            this.cu_needrecheck.TabIndex = 93;
-            this.cu_needrecheck.Visible = false;
+            this.pi_inoutno.AutoSize = true;
+            this.pi_inoutno.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_inoutno.Location = new System.Drawing.Point(146, 80);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.Size = new System.Drawing.Size(0, 36);
+            this.pi_inoutno.TabIndex = 93;
+            // 
+            // AllCollect
+            // 
+            this.AllCollect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.AllCollect.Location = new System.Drawing.Point(1044, 443);
+            this.AllCollect.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.AllCollect.Name = "AllCollect";
+            this.AllCollect.Size = new System.Drawing.Size(136, 52);
+            this.AllCollect.TabIndex = 94;
+            this.AllCollect.Text = "全部采集";
+            this.AllCollect.UseVisualStyleBackColor = true;
+            this.AllCollect.Click += new System.EventHandler(this.AllCollect_Click);
             // 
             // cu_code
             // 
@@ -697,14 +712,14 @@
             this.cu_code.Condition = null;
             this.cu_code.DBTitle = null;
             this.cu_code.FormName = null;
-            this.cu_code.Location = new System.Drawing.Point(75, 38);
-            this.cu_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_code.Location = new System.Drawing.Point(150, 134);
+            this.cu_code.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_code.Name = "cu_code";
             this.cu_code.Power = null;
             this.cu_code.ReturnData = null;
             this.cu_code.SelectField = null;
             this.cu_code.SetValueField = null;
-            this.cu_code.Size = new System.Drawing.Size(149, 21);
+            this.cu_code.Size = new System.Drawing.Size(298, 35);
             this.cu_code.TabIndex = 88;
             this.cu_code.TableName = null;
             this.cu_code.TextBoxEnable = false;
@@ -716,14 +731,14 @@
             this.pr_code.Condition = null;
             this.pr_code.DBTitle = null;
             this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(76, 182);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pr_code.Location = new System.Drawing.Point(152, 375);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
             this.pr_code.ReturnData = null;
             this.pr_code.SelectField = null;
             this.pr_code.SetValueField = null;
-            this.pr_code.Size = new System.Drawing.Size(149, 22);
+            this.pr_code.Size = new System.Drawing.Size(298, 44);
             this.pr_code.TabIndex = 68;
             this.pr_code.TableName = null;
             this.pr_code.TextBoxEnable = false;
@@ -743,11 +758,11 @@
             this.CollectionProcess.Controls.Add(this.label13);
             this.CollectionProcess.Controls.Add(this.Installed);
             this.CollectionProcess.Controls.Add(this.Process);
-            this.CollectionProcess.Location = new System.Drawing.Point(464, 10);
-            this.CollectionProcess.Margin = new System.Windows.Forms.Padding(2);
+            this.CollectionProcess.Location = new System.Drawing.Point(960, 20);
+            this.CollectionProcess.Margin = new System.Windows.Forms.Padding(4);
             this.CollectionProcess.Name = "CollectionProcess";
-            this.CollectionProcess.Padding = new System.Windows.Forms.Padding(2);
-            this.CollectionProcess.Size = new System.Drawing.Size(130, 152);
+            this.CollectionProcess.Padding = new System.Windows.Forms.Padding(4);
+            this.CollectionProcess.Size = new System.Drawing.Size(260, 304);
             this.CollectionProcess.TabIndex = 80;
             this.CollectionProcess.TabStop = false;
             this.CollectionProcess.Text = " ";
@@ -756,18 +771,20 @@
             // 
             this.Capacity.AutoSize = true;
             this.Capacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Capacity.Location = new System.Drawing.Point(60, 64);
+            this.Capacity.Location = new System.Drawing.Point(125, 133);
+            this.Capacity.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Capacity.Name = "Capacity";
-            this.Capacity.Size = new System.Drawing.Size(0, 17);
+            this.Capacity.Size = new System.Drawing.Size(0, 31);
             this.Capacity.TabIndex = 75;
             // 
             // Process_midboxcode
             // 
             this.Process_midboxcode.AutoSize = true;
             this.Process_midboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_midboxcode.Location = new System.Drawing.Point(60, 110);
+            this.Process_midboxcode.Location = new System.Drawing.Point(125, 225);
+            this.Process_midboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_midboxcode.Name = "Process_midboxcode";
-            this.Process_midboxcode.Size = new System.Drawing.Size(15, 17);
+            this.Process_midboxcode.Size = new System.Drawing.Size(28, 31);
             this.Process_midboxcode.TabIndex = 74;
             this.Process_midboxcode.Text = "0";
             // 
@@ -775,9 +792,10 @@
             // 
             this.Process_outboxcode.AutoSize = true;
             this.Process_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_outboxcode.Location = new System.Drawing.Point(60, 86);
+            this.Process_outboxcode.Location = new System.Drawing.Point(125, 177);
+            this.Process_outboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_outboxcode.Name = "Process_outboxcode";
-            this.Process_outboxcode.Size = new System.Drawing.Size(15, 17);
+            this.Process_outboxcode.Size = new System.Drawing.Size(28, 31);
             this.Process_outboxcode.TabIndex = 73;
             this.Process_outboxcode.Text = "0";
             // 
@@ -786,9 +804,10 @@
             this.TotalCount.AutoSize = true;
             this.TotalCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.TotalCount.ForeColor = System.Drawing.Color.Blue;
-            this.TotalCount.Location = new System.Drawing.Point(94, 16);
+            this.TotalCount.Location = new System.Drawing.Point(193, 37);
+            this.TotalCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.TotalCount.Name = "TotalCount";
-            this.TotalCount.Size = new System.Drawing.Size(15, 17);
+            this.TotalCount.Size = new System.Drawing.Size(28, 31);
             this.TotalCount.TabIndex = 72;
             this.TotalCount.Text = "0";
             // 
@@ -796,9 +815,10 @@
             // 
             this.label17.AutoSize = true;
             this.label17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(82, 16);
+            this.label17.Location = new System.Drawing.Point(169, 37);
+            this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(13, 17);
+            this.label17.Size = new System.Drawing.Size(24, 31);
             this.label17.TabIndex = 71;
             this.label17.Text = "/";
             // 
@@ -807,9 +827,10 @@
             this.CollectedCount.AutoSize = true;
             this.CollectedCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectedCount.ForeColor = System.Drawing.Color.Red;
-            this.CollectedCount.Location = new System.Drawing.Point(64, 16);
+            this.CollectedCount.Location = new System.Drawing.Point(133, 37);
+            this.CollectedCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.CollectedCount.Name = "CollectedCount";
-            this.CollectedCount.Size = new System.Drawing.Size(15, 17);
+            this.CollectedCount.Size = new System.Drawing.Size(28, 31);
             this.CollectedCount.TabIndex = 70;
             this.CollectedCount.Text = "0";
             // 
@@ -817,9 +838,10 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(10, 86);
+            this.label14.Location = new System.Drawing.Point(25, 177);
+            this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(32, 17);
+            this.label14.Size = new System.Drawing.Size(62, 31);
             this.label14.TabIndex = 69;
             this.label14.Text = "箱号";
             // 
@@ -827,9 +849,10 @@
             // 
             this.label11.AutoSize = true;
             this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(10, 110);
+            this.label11.Location = new System.Drawing.Point(25, 225);
+            this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(32, 17);
+            this.label11.Size = new System.Drawing.Size(62, 31);
             this.label11.TabIndex = 68;
             this.label11.Text = "盒号";
             // 
@@ -837,9 +860,10 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(10, 46);
+            this.label13.Location = new System.Drawing.Point(25, 97);
+            this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(44, 17);
+            this.label13.Size = new System.Drawing.Size(86, 31);
             this.label13.TabIndex = 67;
             this.label13.Text = "当前盒";
             // 
@@ -847,18 +871,20 @@
             // 
             this.Installed.AutoSize = true;
             this.Installed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Installed.Location = new System.Drawing.Point(60, 46);
+            this.Installed.Location = new System.Drawing.Point(125, 97);
+            this.Installed.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Installed.Name = "Installed";
-            this.Installed.Size = new System.Drawing.Size(0, 17);
+            this.Installed.Size = new System.Drawing.Size(0, 31);
             this.Installed.TabIndex = 66;
             // 
             // Process
             // 
             this.Process.AutoSize = true;
             this.Process.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process.Location = new System.Drawing.Point(10, 16);
+            this.Process.Location = new System.Drawing.Point(25, 37);
+            this.Process.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process.Name = "Process";
-            this.Process.Size = new System.Drawing.Size(44, 17);
+            this.Process.Size = new System.Drawing.Size(86, 31);
             this.Process.TabIndex = 65;
             this.Process.Text = "总进度";
             // 
@@ -866,10 +892,10 @@
             // 
             this.sg_separator.Enabled = false;
             this.sg_separator.ID = null;
-            this.sg_separator.Location = new System.Drawing.Point(290, 66);
-            this.sg_separator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.sg_separator.Location = new System.Drawing.Point(608, 197);
+            this.sg_separator.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.sg_separator.Name = "sg_separator";
-            this.sg_separator.Size = new System.Drawing.Size(28, 21);
+            this.sg_separator.Size = new System.Drawing.Size(52, 35);
             this.sg_separator.Str = null;
             this.sg_separator.Str1 = null;
             this.sg_separator.Str2 = null;
@@ -878,10 +904,10 @@
             // Input
             // 
             this.Input.ID = null;
-            this.Input.Location = new System.Drawing.Point(76, 218);
-            this.Input.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Input.Location = new System.Drawing.Point(152, 447);
+            this.Input.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.Input.Name = "Input";
-            this.Input.Size = new System.Drawing.Size(150, 21);
+            this.Input.Size = new System.Drawing.Size(296, 35);
             this.Input.Str = null;
             this.Input.Str1 = null;
             this.Input.Str2 = null;
@@ -891,10 +917,10 @@
             // griddetno
             // 
             this.griddetno.ID = null;
-            this.griddetno.Location = new System.Drawing.Point(76, 132);
-            this.griddetno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.griddetno.Location = new System.Drawing.Point(152, 322);
+            this.griddetno.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.griddetno.Name = "griddetno";
-            this.griddetno.Size = new System.Drawing.Size(102, 21);
+            this.griddetno.Size = new System.Drawing.Size(200, 35);
             this.griddetno.Str = null;
             this.griddetno.Str1 = null;
             this.griddetno.Str2 = null;
@@ -908,14 +934,14 @@
             this.sg_brand.Condition = null;
             this.sg_brand.DBTitle = null;
             this.sg_brand.FormName = null;
-            this.sg_brand.Location = new System.Drawing.Point(76, 66);
-            this.sg_brand.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.sg_brand.Location = new System.Drawing.Point(150, 193);
+            this.sg_brand.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.sg_brand.Name = "sg_brand";
             this.sg_brand.Power = null;
             this.sg_brand.ReturnData = null;
             this.sg_brand.SelectField = null;
             this.sg_brand.SetValueField = null;
-            this.sg_brand.Size = new System.Drawing.Size(149, 24);
+            this.sg_brand.Size = new System.Drawing.Size(298, 35);
             this.sg_brand.TabIndex = 32;
             this.sg_brand.TableName = null;
             this.sg_brand.TextBoxEnable = false;
@@ -923,20 +949,20 @@
             // 
             // MessageLog
             // 
-            this.MessageLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            this.MessageLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
             this.MessageLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MessageLog.Location = new System.Drawing.Point(4, 610);
-            this.MessageLog.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.MessageLog.Location = new System.Drawing.Point(8, 1220);
+            this.MessageLog.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MessageLog.Name = "MessageLog";
-            this.MessageLog.Size = new System.Drawing.Size(1299, 97);
+            this.MessageLog.Size = new System.Drawing.Size(2594, 190);
             this.MessageLog.TabIndex = 28;
             this.MessageLog.Text = "";
             // 
             // LabelInf
             // 
             this.LabelInf.AllowUserToAddRows = false;
-            this.LabelInf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            this.LabelInf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
             this.LabelInf.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
             this.LabelInf.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
@@ -961,11 +987,11 @@
             this.pib_lotno,
             this.pib_datecode,
             this.pib_qty});
-            this.LabelInf.Location = new System.Drawing.Point(2, 252);
-            this.LabelInf.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.LabelInf.Location = new System.Drawing.Point(4, 504);
+            this.LabelInf.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.LabelInf.Name = "LabelInf";
             this.LabelInf.RowTemplate.Height = 23;
-            this.LabelInf.Size = new System.Drawing.Size(1009, 326);
+            this.LabelInf.Size = new System.Drawing.Size(2018, 652);
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
@@ -1029,7 +1055,7 @@
             this.pr_detail.DataPropertyName = "pr_detail";
             this.pr_detail.HeaderText = "物料名称";
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Width = 78;
+            this.pr_detail.Width = 151;
             // 
             // pr_spec
             // 
@@ -1074,7 +1100,7 @@
             this.pd_custprodspec.HeaderText = "客户型号";
             this.pd_custprodspec.Name = "pd_custprodspec";
             this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
+            this.pd_custprodspec.Width = 151;
             // 
             // pib_brand
             // 
@@ -1082,14 +1108,14 @@
             this.pib_brand.HeaderText = "品牌";
             this.pib_brand.Name = "pib_brand";
             this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
+            this.pib_brand.Width = 103;
             // 
             // pib_madein
             // 
             this.pib_madein.DataPropertyName = "pib_madein";
             this.pib_madein.HeaderText = "产地";
             this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Width = 54;
+            this.pib_madein.Width = 103;
             // 
             // pr_zxbzs
             // 
@@ -1112,14 +1138,14 @@
             this.pib_lotno.DataPropertyName = "pib_lotno";
             this.pib_lotno.HeaderText = "LotNo";
             this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
+            this.pib_lotno.Width = 115;
             // 
             // pib_datecode
             // 
             this.pib_datecode.DataPropertyName = "pib_datecode";
             this.pib_datecode.HeaderText = "DC";
             this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 42;
+            this.pib_datecode.Width = 79;
             // 
             // pib_qty
             // 
@@ -1128,34 +1154,82 @@
             this.pib_qty.MinimumWidth = 100;
             this.pib_qty.Name = "pib_qty";
             this.pib_qty.ReadOnly = true;
+            this.pib_qty.Width = 103;
             // 
-            // pi_inoutno
+            // pi_invoicecode
             // 
-            this.pi_inoutno.ID = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
-            this.pi_inoutno.Str = null;
-            this.pi_inoutno.Str1 = null;
-            this.pi_inoutno.Str2 = null;
-            this.pi_inoutno.TabIndex = 2;
-            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
+            this.pi_invoicecode.ID = null;
+            this.pi_invoicecode.Location = new System.Drawing.Point(152, 20);
+            this.pi_invoicecode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.pi_invoicecode.Name = "pi_invoicecode";
+            this.pi_invoicecode.Size = new System.Drawing.Size(296, 35);
+            this.pi_invoicecode.Str = null;
+            this.pi_invoicecode.Str1 = null;
+            this.pi_invoicecode.Str2 = null;
+            this.pi_invoicecode.TabIndex = 2;
+            this.pi_invoicecode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
+            // 
+            // cu_needrecheck
+            // 
+            this.cu_needrecheck.AutoSize = true;
+            this.cu_needrecheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_needrecheck.Location = new System.Drawing.Point(1407, 240);
+            this.cu_needrecheck.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.cu_needrecheck.Name = "cu_needrecheck";
+            this.cu_needrecheck.Size = new System.Drawing.Size(0, 36);
+            this.cu_needrecheck.TabIndex = 95;
+            this.cu_needrecheck.Visible = false;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(6, 80);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(127, 36);
+            this.label4.TabIndex = 96;
+            this.label4.Text = "出货单号";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(486, 134);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(127, 36);
+            this.label5.TabIndex = 97;
+            this.label5.Text = "是否复核";
+            // 
+            // needcheck
+            // 
+            this.needcheck.AutoSize = true;
+            this.needcheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.needcheck.Location = new System.Drawing.Point(612, 134);
+            this.needcheck.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.needcheck.Name = "needcheck";
+            this.needcheck.Size = new System.Drawing.Size(0, 36);
+            this.needcheck.TabIndex = 98;
             // 
             // UAS_出货标签打印
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(1012, 709);
+            this.ClientSize = new System.Drawing.Size(2024, 1418);
+            this.Controls.Add(this.needcheck);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.cu_needrecheck);
-            this.Controls.Add(this.CollectAll);
+            this.Controls.Add(this.AllCollect);
+            this.Controls.Add(this.pi_inoutno);
+            this.Controls.Add(this.sg_code);
             this.Controls.Add(this.ExportData);
             this.Controls.Add(this.cu_code);
             this.Controls.Add(this.CleanBarCode);
             this.Controls.Add(this.pi_date);
             this.Controls.Add(this.ChooseAll);
-            this.Controls.Add(this.GetGridOnly);
             this.Controls.Add(this.CleanInputAfterCollect);
             this.Controls.Add(this.Fresh);
             this.Controls.Add(this.pi_cardcode_label);
@@ -1182,10 +1256,10 @@
             this.Controls.Add(this.MessageLog);
             this.Controls.Add(this.LabelInf);
             this.Controls.Add(this.pi_inoutno_label);
-            this.Controls.Add(this.pi_inoutno);
+            this.Controls.Add(this.pi_invoicecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.Name = "UAS_出货标签打印";
             this.Text = " UAS-出货标签管理";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
@@ -1194,10 +1268,10 @@
             this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
-            this.CollectionProcess.ResumeLayout(false);
+            this.CollectionProcess.ResumeLayout(true);
             this.CollectionProcess.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -1221,7 +1295,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
-        private CustomControl.EnterTextBox pi_inoutno;
+        private CustomControl.EnterTextBox pi_invoicecode;
         private System.Windows.Forms.Label pi_inoutno_label;
         private CustomControl.DataGridViewWithSerialNum LabelInf;
         private CustomControl.RichText.RichTextAutoBottom MessageLog;
@@ -1259,7 +1333,6 @@
         private System.Windows.Forms.LinkLabel Fresh;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.CheckBox CleanInputAfterCollect;
-        private System.Windows.Forms.CheckBox GetGridOnly;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn18;
@@ -1302,7 +1375,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
-        private System.Windows.Forms.Button CollectAll;
+        private System.Windows.Forms.Label sg_code;
+        private System.Windows.Forms.Label pi_inoutno;
+        private System.Windows.Forms.Button AllCollect;
         private System.Windows.Forms.Label cu_needrecheck;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label needcheck;
     }
 }

+ 47 - 27
UAS-出货标签管理(标签复核)/UAS_出货标签管理.cs

@@ -97,10 +97,10 @@ namespace UAS_LabelMachine
             dh = SystemInf.dh;
             CheckForIllegalCrossThreadCalls = false;
             CloumnCount = LabelInf.Columns.Count;
-            pi_inoutno.Focus();
+            pi_invoicecode.Focus();
             //将本地读取的打印机设置进Combox,并选中默认打印机
             sg_brand.FormName = Name;
-            sg_brand.SetValueField = new string[] { "sg_brand" };
+            sg_brand.SetValueField = new string[] { "sg_brand", "sg_code" };
             sg_brand.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
             sg_brand.TableName = "scangroup";
             sg_brand.DbChange += Sg_brand_DbChange;
@@ -170,6 +170,26 @@ namespace UAS_LabelMachine
         {
         }
 
+        /// <summary>
+        /// 刷新采集进度
+        /// </summary>
+        private void RefreshProcessData()
+        {
+            if (LabelInf.Rows.Count > 0)
+            {
+                //设置初始化的采集进度
+                int Count = 0;
+                //未超出当前范围的时候
+                for (int i = 0; i < LabelInf.RowCount; i++)
+                {
+                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
+                        Count++;
+                }
+                //设置当前的箱号和盒号
+                CollectedCount.Text = Count.ToString();
+            }
+        }
+
         /// <summary>
         /// 保存明细
         /// </summary>
@@ -182,7 +202,6 @@ namespace UAS_LabelMachine
             {
                 MidSource.EndEdit();
                 dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
-                CheckRecheckStatus();
                 MessageBox.Show("保存成功!");
             }
         }
@@ -194,7 +213,7 @@ namespace UAS_LabelMachine
             DataTable dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_brand='" + sg_brand.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
             if (dt.Rows.Count == 0)
             {
-                dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where nvl(sg_brand,' ')=' ' and si_enable<>0 order by si_detno,si_innerdetno", "select");
+                dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where nvl(sg_brand,' ')=' ' and sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
             }
             BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
             if (dt.Rows.Count > 0)
@@ -292,8 +311,6 @@ namespace UAS_LabelMachine
                 for (int j = 0; j < arr.Length; j++)
                 {
                     string orispeccode = LabelInf.Rows[i].Cells["pr_orispeccode"].Value.ToString();
-                    Console.WriteLine((MatchStr(arr[j].ToString(), "MPN")));
-                    Console.WriteLine(MatchStr(arr[j].ToString(), "MPN").Trim().Replace(" ", ""));
                     if ((MatchStr(arr[j].ToString(), "MPN").Contains(orispeccode) || MatchStr(arr[j].ToString(), "MPN").Trim().Replace(" ", "").Contains(orispeccode) || orispeccode == MatchStr(arr[j].ToString(), "MPN") || LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "CPN")) && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
                     {
                         CurrentRowIndex = i;
@@ -417,7 +434,8 @@ namespace UAS_LabelMachine
                     string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
                     ErrorType.Clear();
                     dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
-                    CheckRecheckStatus();
+                    UpdateCustomer();
+                    RefreshProcessData();
                     LabelInf.Invalidate();
                 }
                 //采集未通过的时候
@@ -523,7 +541,6 @@ namespace UAS_LabelMachine
                             if (cell.Value.ToString() == Matchstr || Matchstr.Trim().Replace(" ", "").Contains(cell.Value.ToString()) || Matchstr.Contains(cell.Value.ToString()))
                             {
                                 ErrorType.Add("OK_MPN");
-                                BaseUtil.PlaySound("OK.wav");
                                 LabelInf.Refresh();
                                 CollectVeProdCodePass = true;
                             }
@@ -531,7 +548,6 @@ namespace UAS_LabelMachine
                             {
                                 ErrorType.Add("NG_MPN");
                                 CollectVeProdCodePass = false;
-                                BaseUtil.PlaySound("NG.wav");
                                 //添加需要重绘的Cell
                                 LabelInf.Refresh();
                                 MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
@@ -564,7 +580,6 @@ namespace UAS_LabelMachine
                             if (cell.Value.ToString() != Matchstr)
                             {
                                 ErrorType.Add("NG_CPN");
-                                BaseUtil.PlaySound("NG.wav");
                                 CollectQTYPass = false;
                                 LabelInf.Refresh();
                                 MessageLog.AppendText(">>CPN不匹配\n", Color.Red);
@@ -572,7 +587,6 @@ namespace UAS_LabelMachine
                             else
                             {
                                 ErrorType.Add("OK_CPN");
-                                BaseUtil.PlaySound("OK.wav");
                                 LabelInf.Refresh();
                                 CollectQTYPass = true;
                             }
@@ -713,13 +727,15 @@ namespace UAS_LabelMachine
             if (e.KeyCode == Keys.Enter)
             {
                 sql.Clear();
-                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date,nvl(cu_needrecheck,0)cu_needrecheck from prodinout left join customer on cu_code=pi_cardcode where pi_inoutno='" + pi_inoutno.Text + "' ");
+                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date,pi_inoutno,case when nvl(cu_needrecheck,0)=0 then '否' else '是' end needcheck,nvl(cu_needrecheck,0)cu_needrecheck from prodinout left join customer on pi_cardcode=cu_code where pi_invoicecode='" + pi_invoicecode.Text + "' ");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 ErrorType.Clear();
                 if (dt.Rows.Count > 0)
                 {
+                    needcheck.Text = dt.Rows[0]["needcheck"].ToString();
                     cu_code.Text = dt.Rows[0]["pi_cardcode"].ToString();
                     cu_needrecheck.Text = dt.Rows[0]["cu_needrecheck"].ToString();
+                    pi_inoutno.Text = dt.Rows[0]["pi_inoutno"].ToString();
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
                     dt = (DataTable)dh.ExecuteSql("select 1 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "select");
@@ -730,6 +746,7 @@ namespace UAS_LabelMachine
                         dh.CallProcedure("GetCustBarcode", param);
                     }
                     LoadGridData(sender, e);
+                    RefreshProcessData();
                     //设置当前的最大箱号
                     CurrentItemIndex = 0;
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
@@ -1023,10 +1040,10 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
-                eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text);
+                eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_invoicecode.Text);
                 string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (close.ToString() == "Yes")
-                    System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
+                    System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_invoicecode.Text + ".xls");
             }
         }
 
@@ -1040,39 +1057,42 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void CollectAll_Click(object sender, EventArgs e)
+        private void AllCollect_Click(object sender, EventArgs e)
         {
-            int PickedCount = 0;
+            int Count = 0;
             for (int i = 0; i < LabelInf.Rows.Count; i++)
             {
                 if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
                 {
-                    LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
+                    for (int j = 0; j < LabelInf.Rows.Count; j++)
+                    {
+                        LabelInf.Rows[j].Cells["pib_ifpick"].Value = true;
+                    }
+                    break;
                 }
                 else
                 {
-                    PickedCount = PickedCount + 1;
+                    Count = Count + 1;
                 }
             }
-            if (PickedCount == LabelInf.Rows.Count)
+            if (Count == LabelInf.Rows.Count)
             {
-                for (int i = 0; i < LabelInf.Rows.Count; i++)
+                for (int j = 0; j < LabelInf.Rows.Count; j++)
                 {
-                    LabelInf.Rows[i].Cells["pib_ifpick"].Value = false;
+                    LabelInf.Rows[j].Cells["pib_ifpick"].Value = false;
                 }
             }
+            RefreshProcessData();
         }
 
-        private void CheckRecheckStatus()
+        private void UpdateCustomer()
         {
             if (cu_needrecheck.Text == "0")
             {
                 dh.ExecuteSql("update customer set cu_needrecheck=-1 where cu_code='" + cu_code.Text + "'", "update");
-            }
-            if (dh.getRowCount("prodiobarcode", "nvl(pib_ifpick,0)<>0 and pib_inoutno='" + pi_inoutno.Text + "'") == LabelInf.Rows.Count)
-            {
-                dh.ExecuteSql("update prodinout set pi_recheckstatus='已复核' where pi_inoutno='" + pi_inoutno.Text + "'", "update");
-            }
+                cu_needrecheck.Text = "-1";
+                needcheck.Text = "是";
+;            }
         }
     }
 }

+ 6 - 6
UAS_MES_NEW/CustomControl/TextBoxWithIcon/BlurSearch.cs

@@ -131,10 +131,10 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
         {
             if (TableName1 != null && EnterTextBox.Focused)
             {
-                string con = Field1 + " like '%" + EnterTextBox.Text + "%' and rownum<=10 ";
+                string con = Field1 + " like '%" + EnterTextBox.Text + "%'  ";
                 if (condition != "" && condition != null)
                 {
-                    con = Field1 + " like '%" + EnterTextBox.Text + "%' and rownum<=10 and " + condition;
+                    con = Field1 + " like '%" + EnterTextBox.Text + "%' and " + condition;
                 }
                 dt = dh.getFieldsDatasByCondition(TableName1, new string[] { Field1, valueField, "rownum" }, con.ToUpper());
                 if (dt.Rows.Count > 0)
@@ -146,7 +146,7 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
                     }
                     //每次数据查询之后将索引重置
                     ItemSelectIndex = 0;
-                    ListBox.Height = ListBox.ItemHeight * (dt.Rows.Count + 1);
+                    ListBox.Height = ListBox.ItemHeight  *10;
                     ListBox.Visible = true;
                     Height = ListBox.Height + EnterTextBox.Height;
                 }
@@ -209,10 +209,10 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 
         private void EnterTextBox_Enter(object sender, EventArgs e)
         {
-            string con = Field1 + " like '%" + EnterTextBox.Text + "%' and rownum<=10 ";
+            string con = Field1 + " like '%" + EnterTextBox.Text + "%' ";
             if (condition != "" && condition != null)
             {
-                con = Field1 + " like '%" + EnterTextBox.Text + "%' and rownum<=10 and " + condition;
+                con = Field1 + " like '%" + EnterTextBox.Text + "%' and " + condition;
             }
             dt = dh.getFieldsDatasByCondition(TableName1, new string[] { Field1, valueField, "rownum" }, con.ToUpper());
             if (dt.Rows.Count > 0)
@@ -224,7 +224,7 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
                 }
                 //每次数据查询之后将索引重置
                 ItemSelectIndex = 0;
-                ListBox.Height = ListBox.ItemHeight * (dt.Rows.Count + 1);
+                ListBox.Height = ListBox.ItemHeight * 10;
                 ListBox.Visible = true;
                 Height = ListBox.Height + EnterTextBox.Height;
             }

+ 47 - 26
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -78,7 +78,6 @@
             this.StopWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.StartWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ms_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ma_qty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ma_salecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
@@ -86,6 +85,8 @@
             this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.panel4.SuspendLayout();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
@@ -344,7 +345,7 @@
             this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(273, 266);
+            this.locksalecode.Location = new System.Drawing.Point(410, 561);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(96, 16);
             this.locksalecode.TabIndex = 204;
@@ -387,7 +388,7 @@
             // 
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(773, 146);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(80, 22);
             this.StepCount.Source = null;
@@ -454,7 +455,7 @@
             // 
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno_label.Location = new System.Drawing.Point(20, 73);
+            this.ob_checkno_label.Location = new System.Drawing.Point(19, 72);
             this.ob_checkno_label.Name = "ob_checkno_label";
             this.ob_checkno_label.Size = new System.Drawing.Size(82, 24);
             this.ob_checkno_label.TabIndex = 180;
@@ -464,7 +465,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno.Location = new System.Drawing.Point(114, 73);
+            this.ob_checkno.Location = new System.Drawing.Point(113, 72);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 24);
             this.ob_checkno.TabIndex = 179;
@@ -474,7 +475,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(289, 27);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(288, 26);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 24);
             this.ob_nowcheckqty.TabIndex = 178;
@@ -483,7 +484,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty.Location = new System.Drawing.Point(114, 27);
+            this.ob_batchqty.Location = new System.Drawing.Point(113, 26);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 24);
             this.ob_batchqty.TabIndex = 177;
@@ -492,7 +493,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(195, 27);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(194, 26);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_nowcheckqty_label.TabIndex = 176;
@@ -502,7 +503,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty_label.Location = new System.Drawing.Point(20, 27);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(19, 26);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_batchqty_label.TabIndex = 175;
@@ -640,18 +641,6 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.CutLength = null;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(129, 261);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 77;
-            this.ms_makecode.Tag = "1";
-            // 
             // ma_qty
             // 
             this.ma_qty.AutoSize = true;
@@ -749,11 +738,43 @@
             this.OperateResult.TabIndex = 58;
             this.OperateResult.Text = "";
             // 
+            // LockMakeCode
+            // 
+            this.LockMakeCode.AutoSize = true;
+            this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LockMakeCode.LeaveEvent = false;
+            this.LockMakeCode.Location = new System.Drawing.Point(280, 268);
+            this.LockMakeCode.Name = "LockMakeCode";
+            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
+            this.LockMakeCode.TabIndex = 206;
+            this.LockMakeCode.Text = "锁定";
+            this.LockMakeCode.UseVisualStyleBackColor = true;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(114, 267);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(149, 21);
+            this.ma_code.TabIndex = 205;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = true;
+            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1013, 584);
+            this.Controls.Add(this.LockMakeCode);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.locksalecode);
             this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.Remark);
@@ -782,7 +803,6 @@
             this.Controls.Add(this.StopWeight);
             this.Controls.Add(this.StartWeight);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.ma_qty);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.ma_salecode);
@@ -804,11 +824,11 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
             this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
-            this.panel4.ResumeLayout(true);
+            this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.ResumeLayout(false);
             this.groupBoxWithBorder2.PerformLayout();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -832,7 +852,6 @@
         private CustomControl.ValueLabel.ValueLabel ma_salecode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
         private CustomControl.ValueLabel.ValueLabel ma_qty;
-        private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ValueLabel.ValueLabel pr_colorboxgw;
         private CustomControl.ButtonUtil.NormalButton Confirm;
@@ -870,5 +889,7 @@
         private System.Windows.Forms.CheckBox CollectRemark;
         private System.Windows.Forms.CheckBox locksalecode;
         public System.Windows.Forms.Label ob_checkno;
+        private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
     }
 }

+ 49 - 20
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -38,6 +38,8 @@ namespace UAS_MES_NEW.Make
         string LastSncode;
         bool WeightChange = false;
 
+        DataTable Dbfind;
+
         Regex re = new Regex("\\d+.\\d+\\w+");
 
         string ErrorMessage;
@@ -62,6 +64,16 @@ namespace UAS_MES_NEW.Make
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+            //设置锁定工单
+            LockMakeCode.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(LockMakeCode);
+            //工单号放大镜配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ma_code_DbChange;
             StartWeight.PerformClick();
             dh = SystemInf.dh;
             StepCount.StepCode = User.CurrentStepCode;
@@ -71,6 +83,22 @@ namespace UAS_MES_NEW.Make
             StepCount.Start();
         }
 
+        private void Ma_code_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+            //获取工单的其他信息
+            sql.Clear();
+            sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+            sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
+            sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(this.Controls, dt);
+            }
+        }
+
         private void InPrint()
         {
             try
@@ -90,8 +118,18 @@ namespace UAS_MES_NEW.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
+                   string oMakeCode = "";
+                   string oMsID = "";
+                   if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                   {
+                      //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
+                      //if (nextstepcode != User.CurrentStepCode)
+                      //{
+                      //    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
+                      //    return;
+                      //}
                     sql.Clear();
-                    sql.Append("select ms_makecode,ma_qty,ma_salecode,pr_detail,pr_colorboxunit,pr_code,pr_colorboxgw,");
+                    sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,pr_detail,pr_colorboxunit,pr_code,pr_colorboxgw,");
                     sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
                     sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
                     sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
@@ -121,16 +159,7 @@ namespace UAS_MES_NEW.Make
                             pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
                         else
                             pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
-                        string oMakeCode = "";
-                        string oMsID = "";
-                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
-                        {
-                            string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
-                            if (nextstepcode != User.CurrentStepCode)
-                            {
-                                OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
-                                return;
-                            }
+                    
                             //如果未打开串口设置为0
                             //if (pr_colorboxunit.Text == "kg" && !WeightChange)
                             //{
@@ -148,21 +177,21 @@ namespace UAS_MES_NEW.Make
                                 if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                                 {
                                     OperateResult.AppendText(">>彩盒" + sncode.Text + "重量检测检测合格\n", Color.Green);
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量合格", sncode.Text, "");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量合格", sncode.Text, "");
                                     LogicHandler.RecordProdWeight(sncode.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                     dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
                                 }
                                 else
                                 {
                                     OperateResult.AppendText(">>彩盒" + sncode.Text + "重量检测未通过\n", Color.Red);
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量不合格", sncode.Text, "");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量不合格", sncode.Text, "");
                                     LogicHandler.RecordProdWeight(sncode.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                     return;
                                 }
                             }
                             else
                             {
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量完成", sncode.Text, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量完成", sncode.Text, "");
                                 LogicHandler.RecordProdWeight(sncode.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                 dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
                             }
@@ -173,7 +202,7 @@ namespace UAS_MES_NEW.Make
                             WeighRecord.Items.Add(lsi);
                             OperateResult.AppendText(">>彩盒" + sncode.Text + "称重完成\n", Color.Green);
                             //显示最近的三个称量记录
-                            if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
+                            if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
                             {
                                 //提示正确返回时传递的信息
                                 if (ErrorMessage.Contains("AFTERSUCCESS"))
@@ -197,7 +226,7 @@ namespace UAS_MES_NEW.Make
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
-                    else OperateResult.AppendText(">>序列号不存在\n", Color.Red, sncode);
+                    else OperateResult.AppendText(">>"+ErrorMessage+"\n", Color.Red, sncode);
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
             }
@@ -272,7 +301,7 @@ namespace UAS_MES_NEW.Make
             {
                 //doc = lbl.Documents.Open(PrintLabel.Text);
                 string oErrorMessage;
-                if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ms_makecode.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
                 {
                     OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
                 }
@@ -333,9 +362,9 @@ namespace UAS_MES_NEW.Make
             ob_nowcheckqty.ForeColor = Color.Black;
             SendCheck.Enabled = false;
             OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
-            LogicHandler.InsertMakeProcess(LastSncode, ms_makecode.Text, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
+            LogicHandler.InsertMakeProcess(LastSncode, ma_code.Text, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
             //记录操作日志
-            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
             ob_checkno.Text = "";
         }
 
@@ -441,7 +470,7 @@ namespace UAS_MES_NEW.Make
 
         private void LoadCollectedNum()
         {
-            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
     }

+ 39 - 17
UAS_MES_NEW/FunctionCode/OQC/OQC_BatchResultJudge.Designer.cs

@@ -46,6 +46,8 @@
             this.Remark = new System.Windows.Forms.RichTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.ob_status_label = new System.Windows.Forms.Label();
+            this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ob_maxngacceptqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_status = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_source = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_id = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -69,7 +71,6 @@
             this.WithdrawRejection = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.BatchPass = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Clean = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ob_maxngacceptqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             // 
             // ob_batchqty_label
@@ -221,6 +222,7 @@
             this.Remark.Name = "Remark";
             this.Remark.Size = new System.Drawing.Size(411, 225);
             this.Remark.TabIndex = 225;
+            this.Remark.Tag = "Remark";
             this.Remark.Text = "";
             // 
             // label5
@@ -243,6 +245,39 @@
             this.ob_status_label.TabIndex = 232;
             this.ob_status_label.Text = "批次状态";
             // 
+            // normalButton1
+            // 
+            this.normalButton1.AllPower = null;
+            this.normalButton1.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
+            this.normalButton1.Image = null;
+            this.normalButton1.IsShowBorder = true;
+            this.normalButton1.Location = new System.Drawing.Point(428, 396);
+            this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
+            this.normalButton1.Name = "normalButton1";
+            this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
+            this.normalButton1.Power = null;
+            this.normalButton1.Size = new System.Drawing.Size(75, 28);
+            this.normalButton1.TabIndex = 234;
+            this.normalButton1.Text = "保存备注";
+            this.normalButton1.UseVisualStyleBackColor = false;
+            this.normalButton1.Click += new System.EventHandler(this.normalButton1_Click);
+            // 
+            // ob_maxngacceptqty
+            // 
+            this.ob_maxngacceptqty.AllPower = "";
+            this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
+            this.ob_maxngacceptqty.ID = null;
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(201, 398);
+            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
+            this.ob_maxngacceptqty.Power = "";
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(194, 21);
+            this.ob_maxngacceptqty.Str = null;
+            this.ob_maxngacceptqty.Str1 = null;
+            this.ob_maxngacceptqty.Str2 = null;
+            this.ob_maxngacceptqty.TabIndex = 233;
+            this.ob_maxngacceptqty.Tag = "NoAuto";
+            // 
             // ob_status
             // 
             this.ob_status.AllPower = null;
@@ -628,26 +663,12 @@
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.Click += new System.EventHandler(this.Clean_Click);
             // 
-            // ob_maxngacceptqty
-            // 
-            this.ob_maxngacceptqty.AllPower = "";
-            this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
-            this.ob_maxngacceptqty.ID = null;
-            this.ob_maxngacceptqty.Location = new System.Drawing.Point(201, 398);
-            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
-            this.ob_maxngacceptqty.Power = "";
-            this.ob_maxngacceptqty.Size = new System.Drawing.Size(194, 21);
-            this.ob_maxngacceptqty.Str = null;
-            this.ob_maxngacceptqty.Str1 = null;
-            this.ob_maxngacceptqty.Str2 = null;
-            this.ob_maxngacceptqty.TabIndex = 233;
-            this.ob_maxngacceptqty.Tag = "NoAuto";
-            // 
             // OQC_BatchResultJudge
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(975, 537);
+            this.Controls.Add(this.normalButton1);
             this.Controls.Add(this.ob_maxngacceptqty);
             this.Controls.Add(this.ob_status_label);
             this.Controls.Add(this.ob_status);
@@ -696,7 +717,7 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OQC_BatchResultJudge_FormClosing);
             this.Load += new System.EventHandler(this.抽检批维护_Load);
             this.SizeChanged += new System.EventHandler(this.抽检批维护_SizeChanged);
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -743,5 +764,6 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_status;
         private System.Windows.Forms.Label ob_status_label;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_maxngacceptqty;
+        private CustomControl.ButtonUtil.NormalButton normalButton1;
     }
 }

+ 13 - 0
UAS_MES_NEW/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -348,5 +348,18 @@ namespace UAS_MES_NEW.OQC
         {
             dh.Dispose();
         }
+
+        private void normalButton1_Click(object sender, EventArgs e)
+        {
+            if (ob_checkno.Text != "")
+            {
+                dh.UpdateByCondition("oqcbatch", "ob_remark = '" + Remark.Text + "'", "ob_checkno = '" + ob_checkno.Text + "'");
+                OperateResult.AppendText(">>抽检批" + ob_checkno.Text + "备注维护完成\n", Color.Green);
+            }
+            else
+            {
+                OperateResult.AppendText(">>抽检批号不可为空\n", Color.Red);
+            }
+        }
     }
 }

+ 38 - 0
UAS_MES_NEW/FunctionCode/OQC/OQC_BatchResultJudge.resx

@@ -118,6 +118,44 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="normalButton1.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="normalButton1.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="normalButton1.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
   <data name="GetBatch.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m

+ 2 - 1
UAS_MES_NEW/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -311,7 +311,8 @@ namespace UAS_MES_NEW.OQC
                             sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + User.UserCode + "',sysdate,'" + User.CurrentStepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
                             sql.Append("sp_soncode,:bc_name,'0',:bg_name from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
                             sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ob_makecode.Text + "'");
-                            dh.BatchInsert(sql.GetString(), new string[] { "bc_name", "bc_code", "bg_code", "bg_name" }, bc_name.ToArray(), bc_code.ToArray(), bg_code.ToArray(), bg_name.ToArray());
+                            dh.BatchInsert(sql.GetString(), new string[] { "bc_code", "bg_code", "bc_name", "bg_name" }, bc_code.ToArray(), bg_code.ToArray(), bc_name.ToArray(), bg_name.ToArray());
+                            dh.ExecuteSql("update oqcbatchdetail set obd_ifng = -1 where obd_checkno='" + ob_checkno.Text + "' and obd_sncode='" + sncode.Text + "'", "update");
                         }
                         //更新项目编号中的抽检数、不合格数,根据采样项目记录
                         sql.Clear();

+ 1 - 1
UAS_MES_NEW/PublicMethod/BaseUtil.cs

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

+ 7 - 2
UAS_MES_NEW/PublicMethod/LogicHandler.cs

@@ -397,7 +397,7 @@ namespace UAS_MES_NEW.PublicMethod
                     break;
                 case "OQCRESULTDETERMINE":
                     sql.Clear();
-                    sql.Append("select ob_id,ob_aqlcode,ob_makecode,ob_status,ob_prodcode,(select max(oi_checkqty)from OQCItems where oi_checkno='" + iCheckNo + "') oi_checkqty,");
+                    sql.Append("select ob_remark Remark,ob_id,ob_aqlcode,ob_makecode,ob_status,ob_prodcode,(select max(oi_checkqty)from OQCItems where oi_checkno='" + iCheckNo + "') oi_checkqty,");
                     sql.Append("ob_nowcheckqty,nvl(ob_okqty,0) ob_okqty,nvl(ob_ngqty,0) ob_ngqty,ob_maxngacceptqty,ob_source,ob_checkno,ob_result from OQCBatch where ob_checkno='" + iCheckNo + "'");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                     if (Form.Rows.Count == 0)
@@ -773,8 +773,13 @@ namespace UAS_MES_NEW.PublicMethod
             if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" + iSnCode + "'"))
             {
                 string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" + iSnCode + "'").ToString();
+                string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" + iSnCode + "'").ToString();
+                if (ifng == "-1")
+                {
+                    dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + iSnCode + "'","select");
+                    dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
+                }
                 dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
-                dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + checkno + "'", "update");
             }
             //之前保存的不良就不再调用
             DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");

+ 107 - 0
UAS_MES_NEW/PublicMethod/Print.cs

@@ -6,6 +6,7 @@ using System.IO;
 using UAS_MES_NEW.Entity;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -14,6 +15,7 @@ namespace UAS_MES_NEW.PublicMethod
         static DataHelper dh = SystemInf.dh;
         //CodeSoft打印的驱动和文件
         static Document doc;
+        static LabelFormatDocument doc2;
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
         static FileInfo info;
@@ -207,5 +209,110 @@ namespace UAS_MES_NEW.PublicMethod
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             return true;
         }
+
+
+
+        public static bool SinglePrint(string iCaller, ref Engine lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+        {
+            ErrorMessage = "";
+            DataTable dt = new DataTable();
+            if (IfRePrint != "-1")
+            {
+                if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                //////如果已经打印过了,则不允许再打印
+                //if (dt.Rows.Count > 0)
+                //{
+                //    ErrorMessage = SnCode + LabelType + "已打印";
+                //    return false;
+                //}
+            }
+            string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
+            FileInfo PrintFile = new FileInfo(LabelName);
+            //打开模板路径
+            //查询模板对应的取值SQL和参数名称
+            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
+            StringBuilder sb = new StringBuilder();
+            if (!PrintFile.Exists)
+            {
+                MessageBox.Show("打印文件不存在");
+                return false;
+            }
+            string filechangetime = PrintFile.LastWriteTime.ToString();
+            if (filechangetime != filelastwritetime)
+            {
+                lbl.Dispose();
+                lbl = new Engine(true);
+              //  BaseUtil.WriteLbl();
+                filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
+                string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
+                dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
+            }
+            doc2 = lbl.Documents.Open(LabelName);
+            if (doc2 == null)
+            {
+                MessageBox.Show("标签文件打开失败");
+                return false;
+            }
+            //执行全部的SQL
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                string sql = dt.Rows[i]["lp_sql"].ToString();
+                try
+                {
+                    Regex ConnoteA = new Regex("{\\w+}");
+                    foreach (Match mch in ConnoteA.Matches(sql))
+                    {
+                        string x = mch.Value.Trim();
+                        sql = sql.Replace(x, "'" + SnCode + "'");
+                    }
+                    DataTable Param = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    if (Param.Rows.Count == 0)
+                        continue;
+                    //查询的结果的参数个数大于1需要给标签的多个参数赋值
+                    if (Param.Rows.Count > 0)
+                    {
+                        int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
+                        for (int j = 0; j < LoopTime; j++)
+                        {
+                            for (int k = 0; k < doc2.SubStrings.Count; k++)
+                            {
+                                if (j == 0 & doc2.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                {
+                                    doc2.SubStrings[k].Value = Param.Rows[0][0].ToString();
+                                }
+                                //使用SN开头的参数赋值SN1,SN2,SN3等参数
+                                if (doc2.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                                {
+                                    doc2.SubStrings[k].Value = Param.Rows[j][0].ToString();
+                                }
+                            }
+                        }
+                    }
+                }
+                catch (System.Exception ex)
+                {
+                    MessageBox.Show("SQL维护不正确"+ex.Message);
+                }
+            }
+            LogManager.DoLog(sb.ToString());
+            //保存本次赋值进行打印
+           // doc2.Printer.SwitchTo(PrinterName);
+            doc2.PrintSetup.PrinterName = PrinterName;
+            doc2.PrintSetup.IdenticalCopiesOfLabel = 1;
+            doc2.Print();
+            doc2.Close(SaveOptions.DoNotSaveChanges);
+            LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
+            LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
+            return true;
+        }
+
+
     }
 }