Browse Source

OQC不良查询不良代码

章政 8 years ago
parent
commit
4ebb20a1fd

+ 82 - 65
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -35,7 +35,6 @@
             this.ma_craftcode_label = new System.Windows.Forms.Label();
             this.st_rstepcode_label = new System.Windows.Forms.Label();
             this.ms_prodcode_label = new System.Windows.Forms.Label();
-            this.pr_detail_label = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.bc_name_label = new System.Windows.Forms.Label();
             this.bg_name_label = new System.Windows.Forms.Label();
@@ -62,7 +61,13 @@
             this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.mbp_partdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
+            this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DeleteCom = new System.Windows.Forms.DataGridViewImageColumn();
+            this.mbp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbl_locdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
+            this.mbl_loc1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DeletePos = new System.Windows.Forms.DataGridViewImageColumn();
+            this.mbl_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.RefreshTreeView = new UAS_MES.CustomControl.ClickPicBox.ClickPicBox();
             this.GetSNCode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.NewRepairInf = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -87,12 +92,8 @@
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.mbl_loc1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.DeletePos = new System.Windows.Forms.DataGridViewImageColumn();
-            this.mbl_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.DeleteCom = new System.Windows.Forms.DataGridViewImageColumn();
-            this.mbp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.ms_checkno = new System.Windows.Forms.Label();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -163,19 +164,6 @@
             this.ms_prodcode_label.TabIndex = 62;
             this.ms_prodcode_label.Text = "产品编号";
             // 
-            // pr_detail_label
-            // 
-            this.pr_detail_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.pr_detail_label.AutoSize = true;
-            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(840, 55);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
-            this.pr_detail_label.TabIndex = 61;
-            this.pr_detail_label.Text = "产品名称";
-            // 
             // label14
             // 
             this.label14.AutoSize = true;
@@ -466,6 +454,31 @@
             this.mbp_partdgv.TabIndex = 121;
             this.mbp_partdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbp_partdgv_CellContentClick);
             // 
+            // mbp_part1
+            // 
+            this.mbp_part1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbp_part1.DataPropertyName = "mbp_part";
+            this.mbp_part1.HeaderText = "已选择不良零件";
+            this.mbp_part1.Name = "mbp_part1";
+            this.mbp_part1.ReadOnly = true;
+            // 
+            // DeleteCom
+            // 
+            this.DeleteCom.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.DeleteCom.HeaderText = "删除";
+            this.DeleteCom.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.DeleteCom.Name = "DeleteCom";
+            this.DeleteCom.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.DeleteCom.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.DeleteCom.Width = 80;
+            // 
+            // mbp_id
+            // 
+            this.mbp_id.DataPropertyName = "mbp_id";
+            this.mbp_id.HeaderText = "mbp_id";
+            this.mbp_id.Name = "mbp_id";
+            this.mbp_id.Visible = false;
+            // 
             // mbl_locdgv
             // 
             this.mbl_locdgv.AllowUserToAddRows = false;
@@ -482,6 +495,29 @@
             this.mbl_locdgv.TabIndex = 120;
             this.mbl_locdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbl_locdgv_CellContentClick);
             // 
+            // mbl_loc1
+            // 
+            this.mbl_loc1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbl_loc1.DataPropertyName = "mbl_loc";
+            this.mbl_loc1.HeaderText = "已选择不良位置";
+            this.mbl_loc1.Name = "mbl_loc1";
+            this.mbl_loc1.ReadOnly = true;
+            // 
+            // DeletePos
+            // 
+            this.DeletePos.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.DeletePos.HeaderText = "删除";
+            this.DeletePos.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.DeletePos.Name = "DeletePos";
+            this.DeletePos.Width = 80;
+            // 
+            // mbl_id
+            // 
+            this.mbl_id.DataPropertyName = "mbl_id";
+            this.mbl_id.HeaderText = "mbl_id";
+            this.mbl_id.Name = "mbl_id";
+            this.mbl_id.Visible = false;
+            // 
             // RefreshTreeView
             // 
             this.RefreshTreeView.AllPower = null;
@@ -927,59 +963,39 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
-            // mbl_loc1
-            // 
-            this.mbl_loc1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbl_loc1.DataPropertyName = "mbl_loc";
-            this.mbl_loc1.HeaderText = "已选择不良位置";
-            this.mbl_loc1.Name = "mbl_loc1";
-            this.mbl_loc1.ReadOnly = true;
-            // 
-            // DeletePos
-            // 
-            this.DeletePos.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.DeletePos.HeaderText = "删除";
-            this.DeletePos.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.DeletePos.Name = "DeletePos";
-            this.DeletePos.Width = 80;
-            // 
-            // mbl_id
-            // 
-            this.mbl_id.DataPropertyName = "mbl_id";
-            this.mbl_id.HeaderText = "mbl_id";
-            this.mbl_id.Name = "mbl_id";
-            this.mbl_id.Visible = false;
-            // 
-            // mbp_part1
-            // 
-            this.mbp_part1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbp_part1.DataPropertyName = "mbp_part";
-            this.mbp_part1.HeaderText = "已选择不良零件";
-            this.mbp_part1.Name = "mbp_part1";
-            this.mbp_part1.ReadOnly = true;
-            // 
-            // DeleteCom
+            // pr_detail_label
             // 
-            this.DeleteCom.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.DeleteCom.HeaderText = "删除";
-            this.DeleteCom.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.DeleteCom.Name = "DeleteCom";
-            this.DeleteCom.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.DeleteCom.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.DeleteCom.Width = 80;
+            this.pr_detail_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(840, 55);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.TabIndex = 61;
+            this.pr_detail_label.Text = "产品名称";
             // 
-            // mbp_id
+            // ms_checkno
             // 
-            this.mbp_id.DataPropertyName = "mbp_id";
-            this.mbp_id.HeaderText = "mbp_id";
-            this.mbp_id.Name = "mbp_id";
-            this.mbp_id.Visible = false;
+            this.ms_checkno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_checkno.AutoSize = true;
+            this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_checkno.Location = new System.Drawing.Point(1045, 53);
+            this.ms_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_checkno.Name = "ms_checkno";
+            this.ms_checkno.Size = new System.Drawing.Size(92, 27);
+            this.ms_checkno.TabIndex = 128;
+            this.ms_checkno.Text = "送检批号";
+            this.ms_checkno.Visible = false;
             // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1200, 735);
+            this.Controls.Add(this.ms_checkno);
             this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.nr_code);
@@ -1065,7 +1081,6 @@
         private System.Windows.Forms.Label ma_craftcode_label;
         private System.Windows.Forms.Label st_rstepcode_label;
         private System.Windows.Forms.Label ms_prodcode_label;
-        private System.Windows.Forms.Label pr_detail_label;
         private System.Windows.Forms.Label label14;
         private System.Windows.Forms.Label bc_name_label;
         private System.Windows.Forms.Label bg_name_label;
@@ -1117,5 +1132,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
         private System.Windows.Forms.DataGridViewImageColumn DeletePos;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_id;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label ms_checkno;
     }
 }

+ 8 - 4
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -109,10 +109,10 @@ namespace UAS_MES.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode ");
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode,ms_checkno ");
                         sql.Append("from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
                         sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where ");
-                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode");
+                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode,ms_checkno");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -178,9 +178,13 @@ namespace UAS_MES.Make
             sql.Append("mb_badremark from makebad left join badcode on bc_code=mb_badcode left join badgroup ");
             sql.Append("on bg_code=mb_bgcode where mb_sncode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' and mb_makecode='" + macode + "' and mb_status=0");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            if (dt.Rows.Count == 0)
+            if (dt.Rows.Count == 0 && ms_checkno.Text != "")
             {
-
+                sql.Clear();
+                sql.Append("select mb_id,mb_sncode,mb_badcode,mb_bgcode,nvl(bc_name,mb_badcode) bc_name,nvl(bg_name,mb_bgcode) bg_name,");
+                sql.Append("mb_badremark from oqcngreason left join makebad on mb_badcode=or_badcode and mb_bgcode=or_bgcode left join badcode on bc_code=mb_badcode left join badgroup ");
+                sql.Append("on bg_code=mb_bgcode where or_sncode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' and or_makecode='" + macode + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             }
             for (int i = 0; i < dt.Rows.Count; i++)
             {