Browse Source

单板维修,单板测试

callm 1 year ago
parent
commit
fb77a04531

+ 47 - 71
UAS_MES_JC/FunctionCode/Make/Make_Repair_AfterSale.Designer.cs

@@ -61,14 +61,13 @@
             this.ms_sncode_label = new System.Windows.Forms.Label();
             this.ms_checkno = new System.Windows.Forms.Label();
             this.RepairComplete = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ms_sncode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.Scrap = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.sb_sncode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.nr_code = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ms_prodcode_label = new System.Windows.Forms.Label();
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ms_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ms_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.pr_code = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.sb_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.mb_badremark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
             this.bd_soncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.mbp_partdgv = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
@@ -405,14 +404,13 @@
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode_label);
             this.groupBoxWithBorder1.Controls.Add(this.ms_checkno);
             this.groupBoxWithBorder1.Controls.Add(this.RepairComplete);
-            this.groupBoxWithBorder1.Controls.Add(this.ms_sncode);
-            this.groupBoxWithBorder1.Controls.Add(this.Scrap);
+            this.groupBoxWithBorder1.Controls.Add(this.sb_sncode);
             this.groupBoxWithBorder1.Controls.Add(this.nr_code);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
             this.groupBoxWithBorder1.Controls.Add(this.ms_prodcode_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
-            this.groupBoxWithBorder1.Controls.Add(this.ms_prodcode);
-            this.groupBoxWithBorder1.Controls.Add(this.ms_makecode);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.sb_makecode);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F);
             this.groupBoxWithBorder1.Location = new System.Drawing.Point(18, 16);
             this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4);
@@ -486,7 +484,7 @@
             this.RepairComplete.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.RepairComplete.Image = null;
             this.RepairComplete.IsShowBorder = true;
-            this.RepairComplete.Location = new System.Drawing.Point(1110, 132);
+            this.RepairComplete.Location = new System.Drawing.Point(1282, 119);
             this.RepairComplete.Margin = new System.Windows.Forms.Padding(6);
             this.RepairComplete.MoveImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.MoveImage")));
             this.RepairComplete.Name = "RepairComplete";
@@ -499,40 +497,19 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
-            // ms_sncode
+            // sb_sncode
             // 
-            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.sb_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
-            this.ms_sncode.AutoSize = true;
-            this.ms_sncode.CutLength = null;
-            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(181, 55);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_sncode.MaximumSize = new System.Drawing.Size(300, 0);
-            this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.Size = new System.Drawing.Size(0, 41);
-            this.ms_sncode.TabIndex = 126;
-            // 
-            // Scrap
-            // 
-            this.Scrap.AllPower = "ifall";
-            this.Scrap.BackColor = System.Drawing.Color.Transparent;
-            this.Scrap.DownImage = ((System.Drawing.Image)(resources.GetObject("Scrap.DownImage")));
-            this.Scrap.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.Scrap.Image = null;
-            this.Scrap.IsShowBorder = true;
-            this.Scrap.Location = new System.Drawing.Point(1300, 132);
-            this.Scrap.Margin = new System.Windows.Forms.Padding(6);
-            this.Scrap.MoveImage = ((System.Drawing.Image)(resources.GetObject("Scrap.MoveImage")));
-            this.Scrap.Name = "Scrap";
-            this.Scrap.NormalImage = ((System.Drawing.Image)(resources.GetObject("Scrap.NormalImage")));
-            this.Scrap.Power = null;
-            this.Scrap.Size = new System.Drawing.Size(136, 48);
-            this.Scrap.TabIndex = 56;
-            this.Scrap.Tag = "IfRead";
-            this.Scrap.Text = "报废";
-            this.Scrap.UseVisualStyleBackColor = true;
-            this.Scrap.Click += new System.EventHandler(this.Scrap_Click);
+            this.sb_sncode.AutoSize = true;
+            this.sb_sncode.CutLength = null;
+            this.sb_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sb_sncode.Location = new System.Drawing.Point(181, 55);
+            this.sb_sncode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.sb_sncode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.sb_sncode.Name = "sb_sncode";
+            this.sb_sncode.Size = new System.Drawing.Size(0, 41);
+            this.sb_sncode.TabIndex = 126;
             // 
             // nr_code
             // 
@@ -585,33 +562,33 @@
             this.pr_detail.Size = new System.Drawing.Size(0, 41);
             this.pr_detail.TabIndex = 82;
             // 
-            // ms_prodcode
+            // pr_code
             // 
-            this.ms_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.pr_code.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
-            this.ms_prodcode.AutoSize = true;
-            this.ms_prodcode.CutLength = null;
-            this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode.Location = new System.Drawing.Point(1009, 55);
-            this.ms_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
-            this.ms_prodcode.Name = "ms_prodcode";
-            this.ms_prodcode.Size = new System.Drawing.Size(0, 41);
-            this.ms_prodcode.TabIndex = 20;
-            // 
-            // ms_makecode
-            // 
-            this.ms_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.pr_code.AutoSize = true;
+            this.pr_code.CutLength = null;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(1009, 55);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_code.MaximumSize = new System.Drawing.Size(300, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 41);
+            this.pr_code.TabIndex = 20;
+            // 
+            // sb_makecode
+            // 
+            this.sb_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.CutLength = null;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(567, 55);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(300, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
-            this.ms_makecode.TabIndex = 85;
+            this.sb_makecode.AutoSize = true;
+            this.sb_makecode.CutLength = null;
+            this.sb_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sb_makecode.Location = new System.Drawing.Point(567, 55);
+            this.sb_makecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.sb_makecode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.sb_makecode.Name = "sb_makecode";
+            this.sb_makecode.Size = new System.Drawing.Size(0, 41);
+            this.sb_makecode.TabIndex = 85;
             // 
             // mb_badremark
             // 
@@ -1011,19 +988,18 @@
             this.SizeChanged += new System.EventHandler(this.Make_Repair_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.mbp_partdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.mbl_locdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.RefreshTreeView)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
 
         #endregion
         private CustomControl.ButtonUtil.NormalButton RepairComplete;
-        private CustomControl.ButtonUtil.NormalButton Scrap;
         private CustomControl.ButtonUtil.NormalButton SaveBadLocation;
         private CustomControl.ButtonUtil.NormalButton NewBadCode;
         private System.Windows.Forms.Label ms_prodcode_label;
@@ -1034,8 +1010,8 @@
         private System.Windows.Forms.Label ms_makecode_label;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
-        private CustomControl.ValueLabel.ValueLabel ms_prodcode;
-        private CustomControl.ValueLabel.ValueLabel ms_makecode;
+        private CustomControl.ValueLabel.ValueLabel pr_code;
+        private CustomControl.ValueLabel.ValueLabel sb_makecode;
         private CustomControl.RichText.RichTextAutoBottom OperatResult;
         private CustomControl.TextBoxWithIcon.EnterTextBox bg_name;
         private CustomControl.TextBoxWithIcon.EnterTextBox bc_name;
@@ -1063,7 +1039,7 @@
         private System.Windows.Forms.Label bg_code;
         private CustomControl.TextBoxWithIcon.SearchTextBox bd_soncode;
         private System.Windows.Forms.Label nr_code;
-        private CustomControl.ValueLabel.ValueLabel ms_sncode;
+        private CustomControl.ValueLabel.ValueLabel sb_sncode;
         private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_part1;
         private System.Windows.Forms.DataGridViewImageColumn DeleteCom;

+ 17 - 63
UAS_MES_JC/FunctionCode/Make/Make_Repair_AfterSale.cs

@@ -144,23 +144,22 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 sql.Clear();
-                sql.Append("select ms_status,ms_outboxcode,ms_paststep,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
-                sql.Append("on ms_makecode=ma_code where ms_sncode = '" + GetSNCode.Text + "' order by ms_id desc");
+                sql.Append("select sb_status,sb_makecode,pr_detail,pr_spec,sb_sncode from SINGLEBOARD left join make ");
+                sql.Append("on SB_MAKECODE=ma_code left join product on ma_prodcode=pr_code where SB_SNCODE = '" + GetSNCode.Text + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                string ms_paststep = "";
                 if (dt.Rows.Count > 0)
                 {
-                    string ms_status = dt.Rows[0]["ms_status"].ToString();
-                    ms_paststep = dt.Rows[0]["ms_paststep"].ToString();
-                    ifrework = dt.Rows[0]["ms_ifrework"].ToString();
-                    reworkstatus = dt.Rows[0]["ms_reworkstatus"].ToString();
-                    if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
+                    if (dt.Rows[0]["sb_status"].ToString() != "3")
                     {
-                        OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "已装箱,请先进行拆箱\n", Color.Red);
+                        OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "不处于维修状态\n", Color.Red);
                         BaseUtil.CleanForm(this);
                         BadCodeTree.Nodes.Clear();
                         return;
                     }
+                    else
+                    {
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                    }
                 }
                 else
                 {
@@ -169,6 +168,7 @@ namespace UAS_MES_NEW.Make
                     BadCodeTree.Nodes.Clear();
                     return;
                 }
+                LoadBadInfTree(sender, e);
             }
         }
 
@@ -240,14 +240,14 @@ namespace UAS_MES_NEW.Make
             //不是返工工单时的取当前工单
             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 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) + "' or mb_mscode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' ) and mb_makecode='" + macode + "' and mb_status=0");
+            sql.Append("on bg_code=mb_bgcode where (mb_sncode='" + (GetSNCode.Text == "" ? sb_sncode.Text : GetSNCode.Text) + "' or mb_mscode='" + (GetSNCode.Text == "" ? sb_sncode.Text : GetSNCode.Text) + "' ) and mb_makecode='" + sb_makecode.Text + "' and mb_status=0");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count == 0)
             {
                 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 makebad left join badcode on bc_code=mb_badcode left join badgroup on bg_code=mb_bgcode  ");
-                sql.Append("left join make on ma_code=mb_makecode where mb_sncode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' and mb_makecode<>'" + macode + "' and mb_status=0");
+                sql.Append("left join make on ma_code=mb_makecode where mb_sncode='" + (GetSNCode.Text == "" ? sb_sncode.Text : GetSNCode.Text) + "' and mb_makecode<>'" + sb_makecode.Text + "' and mb_status=0");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             }
             for (int i = 0; i < dt.Rows.Count; i++)
@@ -325,53 +325,7 @@ namespace UAS_MES_NEW.Make
 
         private void RepairComplete_Click(object sender, EventArgs e)
         {
-             
-        }
 
-        private void Scrap_Click(object sender, EventArgs e)
-        {
-            if (ms_sncode.Text != "")
-            {
-                //判断是否有无法维修的记录
-                int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebadreason left join makebad on mb_id=mbr_mbid", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0").ToString());
-                if (ScrapNum == 0)
-                    OperatResult.AppendText(">>" + ms_sncode.Text + "报废必须维护不良原因\n", Color.Red);
-                else
-                {
-                    string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
-                    if (confirm == "Yes")
-                    {
-                        DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcode" }, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
-                        if (dt.Rows.Count > 0)
-                        {
-                            string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
-                            string reworkcode = dt.Rows[0]["ms_reworkcode"].ToString();
-                            if (ms_ifrework == "0")
-                            {
-                                dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
-                            }
-                            else
-                            {
-                                sqls.Clear();
-                                sqls.Add("update makeserial set ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_reworkstatus= 4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "' where ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
-                                sqls.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + ms_reworkcheckno.Text + "'");
-                                sqls.Add("delete from oqcbatchdetail where obd_sncode='" + ms_sncode.Text + "' and obd_checkno='" + ms_reworkcheckno.Text + "'");
-                                sqls.Add("update ReworkDetail set rd_rwstatus='报废' where rd_reid=(select re_id from rework where re_code='" + reworkcode + "') and rd_sncode='" + reworkcode + "'");
-                                dh.ExecuteSQLTran(sqls.ToArray());
-                            }
-                        }
-                        dh.UpdateByCondition("makecraftdetail", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1", "mcd_macode='" + ms_makecode.Text + "' and mcd_stepcode='" + ms_stepcode + "'");
-                        dh.UpdateByCondition("make", "MA_NGMADEQTY=nvl(MA_NGMADEQTY,0)+1", "ma_code='" + macode + "'");
-                        LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "报废", "序列号报废", User.UserCode);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "报废", "序列号报废", ms_sncode.Text, ms_checkno.Text);
-                        OperatResult.AppendText(">>报废成功\n", Color.Green);
-                        GetSNCode.Clear();
-                        BaseUtil.CleanForm(this);
-                        BadCodeTree.Nodes.Clear();
-                    }
-                }
-            }
-            else OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
         }
 
         private void NewBadCode_Click(object sender, EventArgs e)
@@ -428,7 +382,7 @@ namespace UAS_MES_NEW.Make
             }
             string mbr_id = dh.GetSEQ("makebadreason_seq");
             //存在不良组件进行提示
-            if (dh.CheckExist("makebadreason left join makebad on mbr_mbid=mb_id and mbr_sncode=mb_sncode", "mbr_badcode='" + bc_code.Text + "' and mbr_sncode='" + ms_sncode.Text + "' and mbr_brcode='" + nr_code.Text + "' and mb_status=0"))
+            if (dh.CheckExist("makebadreason left join makebad on mbr_mbid=mb_id and mbr_sncode=mb_sncode", "mbr_badcode='" + bc_code.Text + "' and mbr_sncode='" + sb_sncode.Text + "' and mbr_brcode='" + nr_code.Text + "' and mb_status=0"))
             {
                 OperatResult.AppendText(">>不良代码【" + bc_name.Text + "】已存在不良原因【" + nr_name.Text + "】\n", Color.Red);
                 return;
@@ -468,7 +422,7 @@ namespace UAS_MES_NEW.Make
             sql.Append("mbr_dutycode,mbr_brgcode,mbr_badcode,mbr_sncode,mbr_makecode,mbr_indate,");
             sql.Append("mbr_inman,mbr_brname,mbr_solutionname,mbr_badname,mbr_brgname,mbr_dutyname,mbr_remark) select '" + mb_id + "','" + mbr_id + "','" + nr_code.Text + "',");
             sql.Append("'" + so_code.Text + "','" + mbr_dutyname.Text + "','" + nrg_code.Text + "','" + bc_code.Text + "',");
-            sql.Append("'" + ms_sncode.Text + "','" + ms_makecode.Text + "',sysdate,'" + User.UserCode + "','" + nr_name.Text + "','" + so_name.Text + "','" + bc_name.Text + "','" + nrg_name.Text + "','" + mbr_dutyname.Text + "','" + mb_badremark.Text + "' from dual");
+            sql.Append("'" + sb_sncode.Text + "','" + sb_makecode.Text + "',sysdate,'" + User.UserCode + "','" + nr_name.Text + "','" + so_name.Text + "','" + bc_name.Text + "','" + nrg_name.Text + "','" + mbr_dutyname.Text + "','" + mb_badremark.Text + "' from dual");
             dh.ExecuteSql(sql.GetString(), "insert");
             if (mbc_component.Text != "")
             {
@@ -476,7 +430,7 @@ namespace UAS_MES_NEW.Make
                 sql.Append("insert into makebadrscom (mbc_id,mbc_mbrid,mbc_component,mbc_badcode,");
                 sql.Append("mbc_brcode,mbc_sncode,mbc_makecode,mbc_indate,mbc_inman ) values ");
                 sql.Append("(makebadrscom_seq.nextval,'" + mbr_id + "' ,'" + mbc_component.Text + "',");
-                sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + ms_sncode.Text + "','" + ms_makecode.Text + "',sysdate,'" + User.UserCode + "')");
+                sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + sb_sncode.Text + "','" + sb_makecode.Text + "',sysdate,'" + User.UserCode + "')");
                 dh.ExecuteSql(sql.GetString(), "insert");
             }
             OperatResult.AppendText(">>不良原因保存成功\n", Color.Green);
@@ -486,7 +440,7 @@ namespace UAS_MES_NEW.Make
 
         private void DeleteRepairInf_Click(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode from makeserial where ms_id='" + msid + "' and ms_sncode='" + GetSNCode.Text + "' and ms_status=3", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select sb_makecode from SINGLEBOARD where sb_sncode='" + GetSNCode.Text + "' and sb_status=3", "select");
             if (dt.Rows.Count > 0)
             {
                 if (mbr_id != "")
@@ -511,7 +465,7 @@ namespace UAS_MES_NEW.Make
 
         private void SaveBadLocation_Click(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode from makeserial where ms_id='" + msid + "' and ms_sncode='" + GetSNCode.Text + "' and ms_status=3", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select sb_makecode from SINGLEBOARD where sb_sncode='" + GetSNCode.Text + "' and sb_status=3", "select");
             if (dt.Rows.Count > 0)
             {
                 if (mbl_loc.Text != "")
@@ -530,7 +484,7 @@ namespace UAS_MES_NEW.Make
                             BaseUtil.FillDgvWithDataTable(mbl_locdgv, dt);
                             sql.Clear();
                             sql.Append("with temp1 as (select bd_soncode,bd_location from bomdetail,bom where bo_id=bd_bomid ");
-                            sql.Append(" start with bo_mothercode='" + ms_prodcode.Text + "' connect by bo_mothercode= prior bd_soncode) ");
+                            sql.Append(" start with bo_mothercode='" + pr_code.Text + "' connect by bo_mothercode= prior bd_soncode) ");
                             sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + mbl_loc.Text.ToUpper() + ",')>0");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)

+ 12 - 38
UAS_MES_JC/FunctionCode/Make/Make_Repair_AfterSale.resx

@@ -160,44 +160,6 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="Scrap.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="Scrap.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="Scrap.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>
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -206,6 +168,18 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 11 - 0
UAS_MES_JC/FunctionCode/Make/Make_SingleBoard.cs

@@ -270,6 +270,17 @@ namespace UAS_MES_NEW.Make
                         "values(singleboard_seq.nextval,'" + ma_code.Text + "','" + SN.Text + "',sysdate,'刷三防漆',0,'1')", "insert");
                 }
             }
+            DataTable dt = (DataTable)dh.ExecuteSql("select SB_NEXTSTEPCODE,sb_status from singleboard where sb_sncode='" + SN.Text + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string SB_NEXTSTEPCODE = dt.Rows[0]["SB_NEXTSTEPCODE"].ToString();
+                string sb_status = dt.Rows[0]["sb_status"].ToString();
+                if (sb_status == "3")
+                {
+                    OperateResult.AppendText(">>" + SN.Text + "已经采集不良,不允许重复采集\n", Color.Red);
+                    return;
+                }
+            }
             if (NG.Checked)
             {
                 int RejectCount = ChoosedRejectList.Items.Count;