소스 검색

标签核对修改

callm 3 달 전
부모
커밋
caa2f27cd0

+ 90 - 85
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheck.Designer.cs

@@ -39,18 +39,16 @@
             this.UnLoading = new System.Windows.Forms.RadioButton();
             this.UnLoading = new System.Windows.Forms.RadioButton();
             this.sn_code_label = new System.Windows.Forms.Label();
             this.sn_code_label = new System.Windows.Forms.Label();
             this.code_label = new System.Windows.Forms.Label();
             this.code_label = new System.Windows.Forms.Label();
-            this.iflastsn = new System.Windows.Forms.CheckBox();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.ms_craftcode = new System.Windows.Forms.Label();
             this.ms_craftcode = new System.Windows.Forms.Label();
             this.ma_craftcode = new System.Windows.Forms.Label();
             this.ma_craftcode = new System.Windows.Forms.Label();
             this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.sir_remark_label = new System.Windows.Forms.CheckBox();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.sir_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sir_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
@@ -65,10 +63,13 @@
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.sir_remark_label = new System.Windows.Forms.CheckBox();
+            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lcd_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lcd_labeltype = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lcd_prefix = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lcd_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lcd_content = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
@@ -189,19 +190,6 @@
             this.code_label.TabIndex = 66;
             this.code_label.TabIndex = 66;
             this.code_label.Text = "录入框";
             this.code_label.Text = "录入框";
             // 
             // 
-            // iflastsn
-            // 
-            this.iflastsn.AutoSize = true;
-            this.iflastsn.Enabled = false;
-            this.iflastsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.iflastsn.Location = new System.Drawing.Point(578, 796);
-            this.iflastsn.Margin = new System.Windows.Forms.Padding(6);
-            this.iflastsn.Name = "iflastsn";
-            this.iflastsn.Size = new System.Drawing.Size(222, 45);
-            this.iflastsn.TabIndex = 72;
-            this.iflastsn.Text = "前一工单SN";
-            this.iflastsn.UseVisualStyleBackColor = true;
-            // 
             // ClearSn_code
             // ClearSn_code
             // 
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
@@ -255,9 +243,11 @@
             this.LabelDataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
             this.LabelDataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
             this.LabelDataGridView.ColumnHeadersHeight = 46;
             this.LabelDataGridView.ColumnHeadersHeight = 46;
             this.LabelDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.LabelDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.cm_makecode,
-            this.cm_soncode,
-            this.pr_detail_});
+            this.lcd_detno,
+            this.lcd_labeltype,
+            this.lcd_prefix,
+            this.lcd_length,
+            this.lcd_content});
             this.LabelDataGridView.Location = new System.Drawing.Point(36, 216);
             this.LabelDataGridView.Location = new System.Drawing.Point(36, 216);
             this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(6);
             this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(6);
             this.LabelDataGridView.Name = "LabelDataGridView";
             this.LabelDataGridView.Name = "LabelDataGridView";
@@ -267,6 +257,20 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(1282, 454);
             this.LabelDataGridView.Size = new System.Drawing.Size(1282, 454);
             this.LabelDataGridView.TabIndex = 193;
             this.LabelDataGridView.TabIndex = 193;
             // 
             // 
+            // sir_remark_label
+            // 
+            this.sir_remark_label.AutoSize = true;
+            this.sir_remark_label.Checked = true;
+            this.sir_remark_label.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.sir_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sir_remark_label.Location = new System.Drawing.Point(1360, 481);
+            this.sir_remark_label.Margin = new System.Windows.Forms.Padding(6);
+            this.sir_remark_label.Name = "sir_remark_label";
+            this.sir_remark_label.Size = new System.Drawing.Size(178, 45);
+            this.sir_remark_label.TabIndex = 190;
+            this.sir_remark_label.Text = "备注信息";
+            this.sir_remark_label.UseVisualStyleBackColor = true;
+            // 
             // dataGridViewTextBoxColumn1
             // dataGridViewTextBoxColumn1
             // 
             // 
             this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -286,7 +290,7 @@
             this.dataGridViewTextBoxColumn2.MinimumWidth = 10;
             this.dataGridViewTextBoxColumn2.MinimumWidth = 10;
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
             this.dataGridViewTextBoxColumn2.ReadOnly = true;
             this.dataGridViewTextBoxColumn2.ReadOnly = true;
-            this.dataGridViewTextBoxColumn2.Width = 200;
+            this.dataGridViewTextBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             // 
             // 
             // dataGridViewTextBoxColumn3
             // dataGridViewTextBoxColumn3
             // 
             // 
@@ -297,7 +301,6 @@
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             this.dataGridViewTextBoxColumn3.ReadOnly = true;
             this.dataGridViewTextBoxColumn3.ReadOnly = true;
             this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn3.Width = 200;
             // 
             // 
             // dataGridViewTextBoxColumn4
             // dataGridViewTextBoxColumn4
             // 
             // 
@@ -310,27 +313,6 @@
             this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn4.Width = 200;
             this.dataGridViewTextBoxColumn4.Width = 200;
             // 
             // 
-            // dataGridViewTextBoxColumn5
-            // 
-            this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.dataGridViewTextBoxColumn5.DataPropertyName = "sp_length";
-            this.dataGridViewTextBoxColumn5.HeaderText = "条码号";
-            this.dataGridViewTextBoxColumn5.MinimumWidth = 300;
-            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
-            this.dataGridViewTextBoxColumn5.ReadOnly = true;
-            this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn5.Width = 200;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.dataGridViewTextBoxColumn6.HeaderText = "条码号";
-            this.dataGridViewTextBoxColumn6.MinimumWidth = 300;
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.ReadOnly = true;
-            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn6.Width = 200;
-            // 
             // sir_remark
             // sir_remark
             // 
             // 
             this.sir_remark.AllPower = null;
             this.sir_remark.AllPower = null;
@@ -537,47 +519,70 @@
             this.sn_code.Str2 = null;
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 65;
             this.sn_code.TabIndex = 65;
             // 
             // 
-            // cm_makecode
+            // dataGridViewTextBoxColumn5
             // 
             // 
-            this.cm_makecode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
-            this.cm_makecode.DataPropertyName = "sp_fsoncode";
-            this.cm_makecode.HeaderText = "标签类型";
-            this.cm_makecode.MinimumWidth = 100;
-            this.cm_makecode.Name = "cm_makecode";
-            this.cm_makecode.ReadOnly = true;
+            this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.dataGridViewTextBoxColumn5.DataPropertyName = "sp_length";
+            this.dataGridViewTextBoxColumn5.HeaderText = "条码号";
+            this.dataGridViewTextBoxColumn5.MinimumWidth = 300;
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.ReadOnly = true;
+            this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn5.Width = 200;
             // 
             // 
-            // cm_soncode
+            // dataGridViewTextBoxColumn6
             // 
             // 
-            this.cm_soncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
-            this.cm_soncode.DataPropertyName = "sp_prefix";
-            this.cm_soncode.HeaderText = "核对规则";
-            this.cm_soncode.MinimumWidth = 100;
-            this.cm_soncode.Name = "cm_soncode";
-            this.cm_soncode.ReadOnly = true;
-            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.dataGridViewTextBoxColumn6.HeaderText = "条码号";
+            this.dataGridViewTextBoxColumn6.MinimumWidth = 300;
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn6.Width = 200;
             // 
             // 
-            // pr_detail_
+            // lcd_detno
             // 
             // 
-            this.pr_detail_.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
-            this.pr_detail_.DataPropertyName = "pr_spec";
-            this.pr_detail_.HeaderText = "条码内容";
-            this.pr_detail_.MinimumWidth = 100;
-            this.pr_detail_.Name = "pr_detail_";
-            this.pr_detail_.ReadOnly = true;
+            this.lcd_detno.DataPropertyName = "lcd_detno";
+            this.lcd_detno.HeaderText = "序号";
+            this.lcd_detno.MinimumWidth = 10;
+            this.lcd_detno.Name = "lcd_detno";
+            this.lcd_detno.Width = 200;
             // 
             // 
-            // sir_remark_label
+            // lcd_labeltype
             // 
             // 
-            this.sir_remark_label.AutoSize = true;
-            this.sir_remark_label.Checked = true;
-            this.sir_remark_label.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.sir_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sir_remark_label.Location = new System.Drawing.Point(1360, 481);
-            this.sir_remark_label.Margin = new System.Windows.Forms.Padding(6);
-            this.sir_remark_label.Name = "sir_remark_label";
-            this.sir_remark_label.Size = new System.Drawing.Size(178, 45);
-            this.sir_remark_label.TabIndex = 190;
-            this.sir_remark_label.Text = "备注信息";
-            this.sir_remark_label.UseVisualStyleBackColor = true;
+            this.lcd_labeltype.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.lcd_labeltype.DataPropertyName = "lcd_labeltype";
+            this.lcd_labeltype.HeaderText = "标签类型";
+            this.lcd_labeltype.MinimumWidth = 100;
+            this.lcd_labeltype.Name = "lcd_labeltype";
+            this.lcd_labeltype.ReadOnly = true;
+            // 
+            // lcd_prefix
+            // 
+            this.lcd_prefix.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.lcd_prefix.DataPropertyName = "lcd_prefix";
+            this.lcd_prefix.HeaderText = "前缀";
+            this.lcd_prefix.MinimumWidth = 100;
+            this.lcd_prefix.Name = "lcd_prefix";
+            this.lcd_prefix.ReadOnly = true;
+            this.lcd_prefix.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // lcd_length
+            // 
+            this.lcd_length.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.lcd_length.DataPropertyName = "lcd_length";
+            this.lcd_length.HeaderText = "截取长度";
+            this.lcd_length.MinimumWidth = 100;
+            this.lcd_length.Name = "lcd_length";
+            this.lcd_length.ReadOnly = true;
+            // 
+            // lcd_content
+            // 
+            this.lcd_content.DataPropertyName = "lcd_content";
+            this.lcd_content.HeaderText = "核对内容";
+            this.lcd_content.MinimumWidth = 10;
+            this.lcd_content.Name = "lcd_content";
+            this.lcd_content.Width = 200;
             // 
             // 
             // Make_SNLabelCheck
             // Make_SNLabelCheck
             // 
             // 
@@ -602,7 +607,6 @@
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.iflastsn);
             this.Controls.Add(this.code);
             this.Controls.Add(this.code);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code);
@@ -642,7 +646,6 @@
         private System.Windows.Forms.Label sn_code_label;
         private System.Windows.Forms.Label sn_code_label;
         private System.Windows.Forms.Label code_label;
         private System.Windows.Forms.Label code_label;
         private CustomControl.TextBoxWithIcon.SnCollectionBox code;
         private CustomControl.TextBoxWithIcon.SnCollectionBox code;
-        private System.Windows.Forms.CheckBox iflastsn;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
@@ -666,9 +669,11 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
-        private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn cm_soncode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail_;
         private System.Windows.Forms.CheckBox sir_remark_label;
         private System.Windows.Forms.CheckBox sir_remark_label;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lcd_detno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lcd_labeltype;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lcd_prefix;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lcd_length;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lcd_content;
     }
     }
 }
 }

+ 80 - 50
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheck.cs

@@ -87,11 +87,6 @@ namespace UAS_MES_NEW.Make
         {
         {
             DBFind = ma_code.ReturnData;
             DBFind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, DBFind);
             BaseUtil.SetFormValue(this.Controls, DBFind);
-            string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "'  order by sp_detno").ToString();
-            if (ifforsn != "" && ifforsn != "0")
-                iflastsn.Checked = true;
-            else
-                iflastsn.Checked = false;
         }
         }
 
 
         private void Make_FeedingCollection_SizeChanged(object sender, EventArgs e)
         private void Make_FeedingCollection_SizeChanged(object sender, EventArgs e)
@@ -137,62 +132,46 @@ namespace UAS_MES_NEW.Make
                         }
                         }
                         else if (sn_code.Text != "")
                         else if (sn_code.Text != "")
                         {
                         {
+                            bool AllCheck = false;
                             //索引超出长度表示内容均已提醒
                             //索引超出长度表示内容均已提醒
-                            if (RemainIndex >= RemainList.Length)
+                            for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                             {
                             {
-                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Red);
-                                sn_code.Text = "";
-                                code.Text = "";
-                                return;
-                            }
-                            string sp_soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
-                            string sp_fsoncode = dt1.Rows[RemainIndex]["sp_fsoncode"].ToString();
-                            string sp_prefix = dt1.Rows[RemainIndex]["sp_prefix"].ToString();
-                            string sp_regex = dt1.Rows[RemainIndex]["sp_regex"].ToString();
-                            string length = dt1.Rows[RemainIndex]["sp_length"].ToString();
-                            string sp_id = dt1.Rows[RemainIndex]["sp_id"].ToString();
-                            string sp_ifrepeat = dt1.Rows[RemainIndex]["sp_ifrepeat"].ToString();
-                            string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
-                            string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                            string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                            string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
-                            {
-                                //判断采集的条码和本次采集的也不能重复
-                                if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
+                                if (LabelDataGridView.Rows[i].Cells["lcd_content"].Value == null)
                                 {
                                 {
-                                    OperateResult.AppendText(">>条码" + code.Text + "已经上料\n", Color.Red, code);
-                                    return;
-                                }
-                                if (sp_checkbarcode != "")
-                                {
-                                    if (CheckBarcode.ContainsKey(sp_checkbarcode))
+                                    string labeltype = LabelDataGridView.Rows[i].Cells["lcd_labeltype"].Value.ToString();
+                                    string length = LabelDataGridView.Rows[i].Cells["lcd_length"].Value.ToString();
+                                    string prefix = LabelDataGridView.Rows[i].Cells["lcd_prefix"].Value.ToString();
+                                    if (!code.Text.StartsWith(prefix))
                                     {
                                     {
-                                        if (CheckBarcode[sp_checkbarcode] != code.Text)
-                                        {
-                                            OperateResult.AppendText(">>条码" + code.Text + "需要检查物料,未匹配到之前上料数据\n", Color.Red, code);
-                                            return;
-                                        }
+                                        OperateResult.AppendText(">>" + labeltype + "前缀不匹配" + code.Text + "\n", Color.Red, code);
+                                        return;
                                     }
                                     }
-                                    else
+                                    string tempstr = code.Text.Replace(prefix, "");
+                                    if (!(tempstr.Length >= int.Parse(length) && code.Text.Replace(prefix, "").Substring(0, int.Parse(length)) == sn_code.Text))
                                     {
                                     {
-                                        OperateResult.AppendText(">>条码" + code.Text + "需要检查物料,未匹配到之前上料数据\n", Color.Red, code);
+                                        OperateResult.AppendText(">>" + labeltype + "截取SN" + code.Text + "不匹配\n", Color.Red, code);
                                         return;
                                         return;
                                     }
                                     }
+                                    LabelDataGridView.Rows[i].Cells["lcd_content"].Value = code.Text;
                                 }
                                 }
-                                TSN.Add(code.Text);
-                                if (sp_barcoderule == "BARCODE")
+                            }
+                            //循环所有行,判断是否所有的内容都有值
+                            int checkcount = 0;
+                            for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
+                            {
+                                if (LabelDataGridView.Rows[i].Cells["lcd_content"].Value != null)
                                 {
                                 {
-                                    sp_soncode = ErrorMessage;
+                                    checkcount = checkcount + 1;
                                 }
                                 }
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上物料", sn_code.Text + "上物料" + code.Text + "料号" + sp_fsoncode, sn_code.Text, "");
                             }
                             }
-                            else
+                            //如果达到了行数,则判定校验通过
+                            if (checkcount == LabelDataGridView.Rows.Count)
                             {
                             {
-                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                                SetCheck set = new SetCheck("NG", Color.Red);
-                                BaseUtil.SetFormCenter(set);
-                                set.ShowDialog();
+                                AllCheck = true;
+                            }
+                            if (AllCheck)
+                            {
+                                OperateResult.AppendText(">>校验完成\n", Color.Green, code);
                             }
                             }
                         }
                         }
                     }
                     }
@@ -255,15 +234,66 @@ namespace UAS_MES_NEW.Make
         //获取采集的项目
         //获取采集的项目
         private void GetCollectItem()
         private void GetCollectItem()
         {
         {
+            if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
+            {
+                nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsid + "'").ToString();
+                if (nextstepcode != User.CurrentStepCode)
+                {
+                    string stname = dh.getFieldDataByCondition("step", "st_name", "st_code='" + nextstepcode + "'").ToString();
+                    OperateResult.AppendText("<<序列号:" + code.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, code);
+                    return;
+                }
+                //将录入框的值给序列号
+                sn_code.Text = code.Text;
+                sql.Clear();
+                sql.Append("select ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_spec,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+                sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
+                sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    ms_id = dt.Rows[0]["ms_id"].ToString();
+                    make_code = dt.Rows[0]["ma_code"].ToString();
+                    mabomversion = dt.Rows[0]["ma_bomversion"].ToString();
+                    make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                    nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                    ms_status = dt.Rows[0]["ms_status"].ToString();
+                    ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                    LockMakeCode.Checked = true;
+                    //勾选了前一工单
 
 
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_sncode='" + code.Text + "' and ms_makecode='" + ma_code.Text + "' order by ms_id desc", "select");
+                    nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                    ms_status = dt.Rows[0]["ms_status"].ToString();
+                    sn_code.Text = code.Text;
+                    sql.Clear();
+                    sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_spec,ma_qty from makeserial left join product ");
+                    sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
+                    sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                    OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
+                    GetItem();
+                }
+                else
+                {
+                    OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red, code);
+                    code.Text = "";
+                    sn_code.Text = "";
+                }
+            }
+            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
         }
         }
 
 
         private void GetItem()
         private void GetItem()
         {
         {
-
+            dt1 = (DataTable)dh.ExecuteSql("select lcd_detno,LCD_LABELTYPE, nvl(LCD_LENGTH,0)LCD_LENGTH, LCD_PREFIX from LABELCHECKdetail left join labelcheck " +
+                   "on lcd_lcid=lc_id where lc_prodcode='" + ma_prodcode.Text + "' and LCD_LABELTYPE not in (select LCL_LABELVALUE from labelchecklog where " +
+                   "LCL_SN='" + sn_code.Text + "') order by lcd_detno", "select");
+            BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
         }
         }
 
 
-
         private void ClearSn_code_Click(object sender, EventArgs e)
         private void ClearSn_code_Click(object sender, EventArgs e)
         {
         {
             sn_code.Clear();
             sn_code.Clear();

+ 11 - 5
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheck.resx

@@ -117,13 +117,19 @@
   <resheader name="writer">
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   </resheader>
-  <metadata name="cm_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="lcd_detno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="cm_soncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="lcd_labeltype.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="pr_detail_.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="lcd_prefix.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lcd_length.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lcd_content.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -186,7 +192,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDwAACw8BkvkDpQAACdNJREFUeF7t3dtOW4cW
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACdNJREFUeF7t3dtOW4cW
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
@@ -317,7 +323,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDwAACw8BkvkDpQAACdNJREFUeF7t3dtOW4cW
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACdNJREFUeF7t3dtOW4cW
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN