فهرست منبع

1.上料界面提示语句修改
2.SMT采集界面按需求修改
3.转号界面判断序列号下地状态逻辑补充
4.CS_NEW项目代码同步

Hcsy 6 سال پیش
والد
کامیت
40ad87d4bf

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -156,7 +156,7 @@ namespace UAS_MES.Make
                             }
                             else
                             {
-                                OperateResult.AppendText(">>当前序列号" + ms_sncode.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                                OperateResult.AppendText(">>当前序列号" + ms_sncode.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                 else

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -135,7 +135,7 @@ namespace UAS_MES.Make
                             //索引超出长度表示内容均已提醒
                             if (RemainIndex >= RemainList.Length)
                             {
-                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                                 sn_code.Text = "";
                                 code.Text = "";
                                 return;
@@ -393,7 +393,7 @@ namespace UAS_MES.Make
             }
             else
             {
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                OperateResult.AppendText(">>序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 else

+ 7 - 2
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -112,11 +112,16 @@ namespace UAS_MES.Make
                                 }
                                 //根据ms_id查询
                                 sql.Clear();
-                                sql.Append("select ms_stepcode from makeserial where ms_id='" + oMsid + "' and ms_beforesn='" + code.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
+                                sql.Append("select ms_stepcode,nvl(ms_downstatus,'0') ms_downstatus from makeserial where ms_id='" + oMsid + "' and ms_beforesn='" + code.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 //如果行数大于0则允许转号
                                 if (dt.Rows.Count > 0)
                                 {
+                                    if (dt.Rows[0]["ms_downstatus"].ToString() != "0")
+                                    {
+                                        OperateResult.AppendText("<<当前TSN号处于下地状态不允许操作\n", Color.Red, code);
+                                        return;
+                                    }
                                     if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
                                     {
                                         step = 1;
@@ -134,7 +139,7 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText("<<TSN号" + code.Text + "当前状态不允许重新转号\n", Color.Red, code);
+                                    OperateResult.AppendText("<<TSN号" + code.Text + "未转号不允许重新转号\n", Color.Red, code);
                                     return;
                                 }
                             }

+ 28 - 1
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -63,6 +63,8 @@
             this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.ma_salecode = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -344,7 +346,7 @@
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(307, 51);
+            this.StepCount.Location = new System.Drawing.Point(687, 115);
             this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
@@ -484,11 +486,34 @@
             this.sncode.Tag = "IfRead";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
+            // ma_salecode
+            // 
+            this.ma_salecode.AutoSize = true;
+            this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_salecode.Location = new System.Drawing.Point(381, 51);
+            this.ma_salecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_salecode.Name = "ma_salecode";
+            this.ma_salecode.Size = new System.Drawing.Size(0, 21);
+            this.ma_salecode.TabIndex = 230;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label4.Location = new System.Drawing.Point(307, 51);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(58, 21);
+            this.label4.TabIndex = 229;
+            this.label4.Text = "合同号";
+            // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(849, 467);
+            this.Controls.Add(this.ma_salecode);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.Remark);
             this.Controls.Add(this.SameReamrk);
             this.Controls.Add(this.label3);
@@ -572,5 +597,7 @@
         private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
         private System.Windows.Forms.CheckBox IFONLY;
         private System.Windows.Forms.CheckBox CollectRemark;
+        private System.Windows.Forms.Label ma_salecode;
+        private System.Windows.Forms.Label label4;
     }
 }

+ 49 - 22
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -37,6 +37,7 @@ namespace UAS_MES.Make
         bool hasSnList = false;//记录是否有转换后SN清单
 
         bool hasMakeRule = false;//记录是否有工单防呆规则
+        bool hasSaleRule = false;//记录是否有合同防呆规则
 
         public Make_SeqTransform()
         {
@@ -76,11 +77,16 @@ namespace UAS_MES.Make
                                 }
                                 //根据ms_id查询
                                 sql.Clear();
-                                sql.Append("select ms_stepcode from makeserial where ms_id='" + oMsId + "' and ms_beforesn='" + sncode.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
+                                sql.Append("select ms_stepcode,nvl(ms_downstatus,'0') ms_downstatus from makeserial where ms_id='" + oMsId + "' and ms_beforesn='" + sncode.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 //如果行数大于0则允许转号
                                 if (dt.Rows.Count > 0)
                                 {
+                                    if (dt.Rows[0]["ms_downstatus"].ToString() != "0")
+                                    {
+                                        OperateResult.AppendText("<<当前TSN号处于下地状态不允许操作\n", Color.Red, sncode);
+                                        return;
+                                    }
                                     if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
                                     {
                                         bsncode = sncode.Text;
@@ -96,7 +102,7 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText("<<TSN号" + sncode.Text + "当前状态不允许重新转号\n", Color.Red, sncode);
+                                    OperateResult.AppendText("<<TSN号" + sncode.Text + "未转号不允许重新转号\n", Color.Red, sncode);
                                     return;
                                 }
                             }
@@ -105,7 +111,7 @@ namespace UAS_MES.Make
                             {
                                 //按照out出的工单号查出工单相关信息,并赋值到相关控件
                                 sql.Clear();
-                                sql.Append("select ma_code,ma_softversion,ma_prodcode,pr_detail,ma_qty,ma_qty-mcd_inqty as remain_qty ");
+                                sql.Append("select ma_code,ma_softversion,ma_prodcode,pr_detail,ma_salecode,ma_qty,ma_qty-mcd_inqty as remain_qty ");
                                 sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                                 sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_id='" + oMsId + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -207,6 +213,14 @@ namespace UAS_MES.Make
                                     return;
                                 }
                             }
+                            else if (hasSaleRule)//判断合同防呆
+                            {
+                                if (!dh.CheckExist("makesnruledetail", "msd_sncode='" + sncode.Text + "' and  msd_salecode='" + ma_salecode.Text + "' and msd_type='after'"))
+                                {
+                                    OperateResult.AppendText("<<SN号" + sncode.Text + "校验错误,不在合同防呆规则指定范围内!\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
                             else//判断产品防呆
                             {
                                 //判断用户是否锁定输入转换后序列号长度,
@@ -244,11 +258,12 @@ namespace UAS_MES.Make
                                         }
                                         LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
                                         OperateResult.AppendText(">>备注:" + Remark.Text + "\n", Color.Black);
-                                        if (CollectRemark.Checked) {
+                                        if (CollectRemark.Checked)
+                                        {
                                             Remark.Text = "";
                                         }
                                     }
-                                    else 
+                                    else
                                     {
                                         if (!CheckPre())
                                         {
@@ -377,6 +392,7 @@ namespace UAS_MES.Make
         {
             hasSnList = false;
             hasMakeRule = false;
+            hasSaleRule = false;
             //清空
             beforeTransSNPre.Text = "";
             beforeTransSNLength.Text = "";
@@ -413,25 +429,35 @@ namespace UAS_MES.Make
             }
             else
             {
-                /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
-                 *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
-                rules = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = '" + dt.Rows[0]["ma_prodcode"].ToString() + "' and psr_type='after'", "select");
+                ma_salecode.Text = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code='" + ma_code.Text + "'").ToString();
+                //查询表合同序列号防呆规则表
+                rules = (DataTable)dh.ExecuteSql("select msr_startno from makesnrule where msr_salecode='" + ma_salecode.Text + "' and msr_type='after'", "select");
                 if (rules.Rows.Count > 0)
                 {
-                    //将产品序列号防呆规则查出的数据填充
-                    if (rules.Rows[0]["psr_prefix"].ToString() != "")
-                    {
-                        afterTransSNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
-                        afterTransSNPre.Enabled = false;
-                        afterTransSNPre_checkBox.Checked = true;
-                        afterTransSNPre_checkBox.Enabled = false;
-                    }
-                    if (rules.Rows[0]["psr_length"].ToString() != "")
+                    hasSaleRule = true;
+                }
+                else
+                {
+                    /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
+                     *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
+                    rules = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = '" + dt.Rows[0]["ma_prodcode"].ToString() + "' and psr_type='after'", "select");
+                    if (rules.Rows.Count > 0)
                     {
-                        afterTransSNLength.Text = rules.Rows[0]["psr_length"].ToString();
-                        afterTransSNLength.Enabled = false;
-                        afterTransSNLength_checkBox.Checked = true;
-                        afterTransSNLength_checkBox.Enabled = false;
+                        //将产品序列号防呆规则查出的数据填充
+                        if (rules.Rows[0]["psr_prefix"].ToString() != "")
+                        {
+                            afterTransSNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
+                            afterTransSNPre.Enabled = false;
+                            afterTransSNPre_checkBox.Checked = true;
+                            afterTransSNPre_checkBox.Enabled = false;
+                        }
+                        if (rules.Rows[0]["psr_length"].ToString() != "")
+                        {
+                            afterTransSNLength.Text = rules.Rows[0]["psr_length"].ToString();
+                            afterTransSNLength.Enabled = false;
+                            afterTransSNLength_checkBox.Checked = true;
+                            afterTransSNLength_checkBox.Enabled = false;
+                        }
                     }
                 }
             }
@@ -536,7 +562,8 @@ namespace UAS_MES.Make
                         sncode.Focus();
                     }
                 }
-                catch {
+                catch
+                {
                     sncode.Enabled = true;
                     sncode.Focus();
                 }

+ 22 - 22
UAS-MES/FunctionCode/Make/Make_SmtTestCollection.Designer.cs

@@ -98,7 +98,7 @@
             this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.psl_location = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.psl_prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.bd_soncode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -819,25 +819,25 @@
             this.psl_location.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bad_loc_KeyDown);
             this.psl_location.Leave += new System.EventHandler(this.psl_location_Leave);
             // 
-            // psl_prodcode
-            // 
-            this.psl_prodcode.AllPower = null;
-            this.psl_prodcode.Caller = null;
-            this.psl_prodcode.Condition = null;
-            this.psl_prodcode.DBTitle = null;
-            this.psl_prodcode.FormName = null;
-            this.psl_prodcode.Location = new System.Drawing.Point(428, 236);
-            this.psl_prodcode.Margin = new System.Windows.Forms.Padding(2);
-            this.psl_prodcode.Name = "psl_prodcode";
-            this.psl_prodcode.Power = null;
-            this.psl_prodcode.ReturnData = null;
-            this.psl_prodcode.SelectField = null;
-            this.psl_prodcode.SetValueField = null;
-            this.psl_prodcode.Size = new System.Drawing.Size(114, 21);
-            this.psl_prodcode.TabIndex = 214;
-            this.psl_prodcode.TableName = null;
-            this.psl_prodcode.Tag = "psl_prodcode";
-            this.psl_prodcode.TextBoxEnable = true;
+            // bd_soncode
+            // 
+            this.bd_soncode.AllPower = null;
+            this.bd_soncode.Caller = null;
+            this.bd_soncode.Condition = null;
+            this.bd_soncode.DBTitle = null;
+            this.bd_soncode.FormName = null;
+            this.bd_soncode.Location = new System.Drawing.Point(428, 236);
+            this.bd_soncode.Margin = new System.Windows.Forms.Padding(2);
+            this.bd_soncode.Name = "bd_soncode";
+            this.bd_soncode.Power = null;
+            this.bd_soncode.ReturnData = null;
+            this.bd_soncode.SelectField = null;
+            this.bd_soncode.SetValueField = null;
+            this.bd_soncode.Size = new System.Drawing.Size(114, 21);
+            this.bd_soncode.TabIndex = 214;
+            this.bd_soncode.TableName = null;
+            this.bd_soncode.Tag = "psl_prodcode";
+            this.bd_soncode.TextBoxEnable = true;
             // 
             // StepCount
             // 
@@ -1046,7 +1046,7 @@
             this.ClientSize = new System.Drawing.Size(862, 535);
             this.Controls.Add(this.badloc_label);
             this.Controls.Add(this.psl_location);
-            this.Controls.Add(this.psl_prodcode);
+            this.Controls.Add(this.bd_soncode);
             this.Controls.Add(this.mbp_part_label);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.WaitChooseDGV);
@@ -1185,7 +1185,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc;
         private System.Windows.Forms.Label badloc_label;
         private UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox psl_location;
-        private UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox psl_prodcode;
+        private UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox bd_soncode;
         private System.Windows.Forms.Label mbp_part_label;
         private System.Windows.Forms.Label label5;
     }

+ 30 - 30
UAS-MES/FunctionCode/Make/Make_SmtTestCollection.cs

@@ -69,12 +69,12 @@ namespace UAS_MES.Make
 
       
 
-            psl_prodcode.FormName = Name;
-            psl_prodcode.TableName = "PRODUCTSMTLOCATION left join Product on psl_prodcode=pr_code left join PRODUCTSMT on ps_id = psl_psid";
-            psl_prodcode.SetValueField = new string[] { "psl_prodcode" , "psl_location" };
-            psl_prodcode.SelectField = "psl_prodcode # 物料编号,pr_detail # 物料名称,pr_spec # 物料规格,psl_location # 站位";
-            psl_prodcode.DBTitle = "不良零件";
-            psl_prodcode.DbChange += Prodcode_DbChange;
+            bd_soncode.FormName = Name;
+            bd_soncode.TableName = "bom left join bomdetail on bd_bomid=bo_id left join product on bd_soncode=pr_code";
+            bd_soncode.SetValueField = new string[] { "bd_soncode" };
+            bd_soncode.SelectField = "bd_soncode # 子件编号,pr_detail # 物料名称,pr_spec # 物料规格,bd_location # 位号";
+            bd_soncode.DBTitle = "不良零件";
+            bd_soncode.DbChange += Prodcode_DbChange;
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
@@ -562,24 +562,24 @@ namespace UAS_MES.Make
                             sql.Append(",:mbl_loc,'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
                             sql.Append("sysdate,'" + User.UserCode + "' from dual");
                             dh.BatchInsert(sql.GetString(),new string[] { "mbl_loc" }, mbl_loc);
-                            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='" + ma_prodcode + "' connect by bo_mothercode= prior bd_soncode) ");
-                            sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper() + ",')>0");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
-                            {
-                                for (int j = 0; j < dt.Rows.Count; i++)
-                                {
-                                    sql.Clear();
-                                    sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                                    sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                                    sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + dt.Rows[0][j].ToString() + "',");
-                                    sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                                    sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                                    dh.ExecuteSql(sql.GetString(), "insert");
-                                }  
-                            }
+                            //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='" + ma_prodcode.Text + "' connect by bo_mothercode= prior bd_soncode) ");
+                            //sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper() + ",')>0");
+                            //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            //if (dt.Rows.Count > 0)
+                            //{
+                            //    for (int j = 0; j < dt.Rows.Count; i++)
+                            //    {
+                            //        sql.Clear();
+                            //        sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                            //        sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                            //        sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + dt.Rows[0][j].ToString() + "',");
+                            //        sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                            //        sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                            //        dh.ExecuteSql(sql.GetString(), "insert");
+                            //    }  
+                            //}
                             sql.Clear();
                             sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
                             sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
@@ -828,7 +828,7 @@ namespace UAS_MES.Make
 
         private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
-            psl_prodcode.Condition = "ps_linecode = '"+User.UserLineCode+ "' and ps_prodcode = '"+ ma_prodcode.Text + "' and ps_table = '"+st_table+"'";
+            bd_soncode.Condition = "bo_mothercode = '" + ma_prodcode.Text + "'";
         }
 
         private void Filter_UserControlTextChanged(object sender, EventArgs e)
@@ -880,7 +880,7 @@ namespace UAS_MES.Make
         private void Prodcode_DbChange(object sender, EventArgs e)
         {
             MakeBadView.EndEdit();
-            if (psl_prodcode.Text != "")
+            if (bd_soncode.Text != "")
             {
                 for (int i = 0; i < MakeBadView.Rows.Count; i++)
                 {
@@ -890,10 +890,10 @@ namespace UAS_MES.Make
                         {
                             if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
                             {
-                                MakeBadView.Rows[i].Cells["mbp_part"].Value = psl_prodcode.Text;
+                                MakeBadView.Rows[i].Cells["mbp_part"].Value = bd_soncode.Text;
                             }
-                            else if (!MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Contains(psl_prodcode.Text))
-                                MakeBadView.Rows[i].Cells["mbp_part"].Value += "," + psl_prodcode.Text;
+                            else if (!MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Contains(bd_soncode.Text))
+                                MakeBadView.Rows[i].Cells["mbp_part"].Value += "," + bd_soncode.Text;
 
                             if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "")
                             {
@@ -926,7 +926,7 @@ namespace UAS_MES.Make
                 {
                     if (psl_location.Text != "")
                     {
-                        string psl_prodcode = dh.getFieldDataByCondition("PRODUCTSMTLOCATION left join Product on psl_prodcode=pr_code left join PRODUCTSMT on ps_id = psl_psid", "psl_prodcode", "ps_linecode = '" + User.UserLineCode + "' and ps_prodcode = '" + ma_prodcode.Text + "' and ps_table = '" + st_table + "' and psl_location = '"+ psl_location.Text.ToUpper() + "'").ToString();
+                        string psl_prodcode = dh.getFieldDataByCondition("bom left join bomdetail on bd_bomid=bo_id left join product on bd_soncode=pr_code", "bd_soncode", "bo_mothercode = '"+ma_prodcode.Text+ "' and bd_location like '%" + psl_location.Text.ToUpper() + "%'").ToString();
                         if (psl_prodcode != "")
                         {
                             for (int i = 0; i < MakeBadView.Rows.Count; i++)

+ 1 - 1
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -156,7 +156,7 @@ namespace UAS_MES_NEW.Make
                             }
                             else
                             {
-                                OperateResult.AppendText(">>当前序列号" + ms_sncode.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                                OperateResult.AppendText(">>当前序列号" + ms_sncode.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                 else

+ 2 - 2
UAS_MES_NEW/FunctionCode/Make/Make_FeedingCollection.cs

@@ -135,7 +135,7 @@ namespace UAS_MES_NEW.Make
                             //索引超出长度表示内容均已提醒
                             if (RemainIndex >= RemainList.Length)
                             {
-                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                                 sn_code.Text = "";
                                 code.Text = "";
                                 return;
@@ -393,7 +393,7 @@ namespace UAS_MES_NEW.Make
             }
             else
             {
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "已完成上料,请采集其他序列号\n", Color.Black);
+                OperateResult.AppendText(">>序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 else

+ 7 - 2
UAS_MES_NEW/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -112,11 +112,16 @@ namespace UAS_MES_NEW.Make
                                 }
                                 //根据ms_id查询
                                 sql.Clear();
-                                sql.Append("select ms_stepcode from makeserial where ms_id='" + oMsid + "' and ms_beforesn='" + code.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
+                                sql.Append("select ms_stepcode,nvl(ms_downstatus,'0') ms_downstatus from makeserial where ms_id='" + oMsid + "' and ms_beforesn='" + code.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 //如果行数大于0则允许转号
                                 if (dt.Rows.Count > 0)
                                 {
+                                    if (dt.Rows[0]["ms_downstatus"].ToString() != "0")
+                                    {
+                                        OperateResult.AppendText("<<当前TSN号处于下地状态不允许操作\n", Color.Red, code);
+                                        return;
+                                    }
                                     if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
                                     {
                                         step = 1;
@@ -134,7 +139,7 @@ namespace UAS_MES_NEW.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText("<<TSN号" + code.Text + "当前状态不允许重新转号\n", Color.Red, code);
+                                    OperateResult.AppendText("<<TSN号" + code.Text + "未转号不允许重新转号\n", Color.Red, code);
                                     return;
                                 }
                             }

+ 29 - 2
UAS_MES_NEW/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -63,6 +63,8 @@
             this.label3 = new System.Windows.Forms.Label();
             this.IFONLY = new System.Windows.Forms.CheckBox();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.ma_salecode = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -264,7 +266,7 @@
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(307, 51);
+            this.StepCount.Location = new System.Drawing.Point(698, 113);
             this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
@@ -482,11 +484,34 @@
             this.CollectRemark.UseVisualStyleBackColor = true;
             this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
             // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label4.Location = new System.Drawing.Point(307, 51);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(58, 21);
+            this.label4.TabIndex = 227;
+            this.label4.Text = "合同号";
+            // 
+            // ma_salecode
+            // 
+            this.ma_salecode.AutoSize = true;
+            this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_salecode.Location = new System.Drawing.Point(381, 51);
+            this.ma_salecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_salecode.Name = "ma_salecode";
+            this.ma_salecode.Size = new System.Drawing.Size(0, 21);
+            this.ma_salecode.TabIndex = 228;
+            // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(849, 467);
+            this.Controls.Add(this.ma_salecode);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.Remark);
             this.Controls.Add(this.Seq_Remark_PreFix);
             this.Controls.Add(this.SameReamrk);
@@ -529,7 +554,7 @@
             this.Load += new System.EventHandler(this.Make_SeqTransform_Load);
             this.SizeChanged += new System.EventHandler(this.Make_SeqTransform_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -570,5 +595,7 @@
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.CheckBox IFONLY;
         private System.Windows.Forms.CheckBox CollectRemark;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label ma_salecode;
     }
 }

+ 44 - 19
UAS_MES_NEW/FunctionCode/Make/Make_SeqTransform.cs

@@ -37,6 +37,7 @@ namespace UAS_MES_NEW.Make
         bool hasSnList = false;//记录是否有转换后SN清单
 
         bool hasMakeRule = false;//记录是否有工单防呆规则
+        bool hasSaleRule = false;//记录是否有合同防呆规则
 
         public Make_SeqTransform()
         {
@@ -76,11 +77,16 @@ namespace UAS_MES_NEW.Make
                                 }
                                 //根据ms_id查询
                                 sql.Clear();
-                                sql.Append("select ms_stepcode from makeserial where ms_id='" + oMsId + "' and ms_beforesn='" + sncode.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
+                                sql.Append("select ms_stepcode,nvl(ms_downstatus,'0') ms_downstatus from makeserial where ms_id='" + oMsId + "' and ms_beforesn='" + sncode.Text + "' and ms_nextmacode is null and ms_outboxcode is null");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 //如果行数大于0则允许转号
                                 if (dt.Rows.Count > 0)
                                 {
+                                    if (dt.Rows[0]["ms_downstatus"].ToString() != "0")
+                                    {
+                                        OperateResult.AppendText("<<当前TSN号处于下地状态不允许操作\n", Color.Red, sncode);
+                                        return;
+                                    }
                                     if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
                                     {
                                         bsncode = sncode.Text;
@@ -96,7 +102,7 @@ namespace UAS_MES_NEW.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText("<<TSN号" + sncode.Text + "当前状态不允许重新转号\n", Color.Red, sncode);
+                                    OperateResult.AppendText("<<TSN号" + sncode.Text + "未转号不允许重新转号\n", Color.Red, sncode);
                                     return;
                                 }
                             }
@@ -105,7 +111,7 @@ namespace UAS_MES_NEW.Make
                             {
                                 //按照out出的工单号查出工单相关信息,并赋值到相关控件
                                 sql.Clear();
-                                sql.Append("select ma_code,ma_softversion,ma_prodcode,pr_detail,ma_qty,ma_qty-mcd_inqty as remain_qty ");
+                                sql.Append("select ma_code,ma_softversion,ma_prodcode,pr_detail,ma_salecode,ma_qty,ma_qty-mcd_inqty as remain_qty ");
                                 sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                                 sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_id='" + oMsId + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -207,6 +213,14 @@ namespace UAS_MES_NEW.Make
                                     return;
                                 }
                             }
+                            else if (hasSaleRule)//判断合同防呆
+                            {
+                                if (!dh.CheckExist("makesnruledetail", "msd_sncode='" + sncode.Text + "' and  msd_salecode='" + ma_salecode.Text + "' and msd_type='after'"))
+                                {
+                                    OperateResult.AppendText("<<SN号" + sncode.Text + "校验错误,不在合同防呆规则指定范围内!\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
                             else//判断产品防呆
                             {
                                 //判断用户是否锁定输入转换后序列号长度,
@@ -378,6 +392,7 @@ namespace UAS_MES_NEW.Make
         {
             hasSnList = false;
             hasMakeRule = false;
+            hasSaleRule = false;
             //清空
             beforeTransSNPre.Text = "";
             beforeTransSNLength.Text = "";
@@ -414,25 +429,35 @@ namespace UAS_MES_NEW.Make
             }
             else
             {
-                /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
-                 *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
-                rules = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = '" + dt.Rows[0]["ma_prodcode"].ToString() + "' and psr_type='after'", "select");
+                ma_salecode.Text = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code='" + ma_code.Text + "'").ToString();
+                //查询表合同序列号防呆规则表
+                rules = (DataTable)dh.ExecuteSql("select msr_startno from makesnrule where msr_salecode='" + ma_salecode.Text + "' and msr_type='after'", "select");
                 if (rules.Rows.Count > 0)
                 {
-                    //将产品序列号防呆规则查出的数据填充
-                    if (rules.Rows[0]["psr_prefix"].ToString() != "")
-                    {
-                        afterTransSNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
-                        afterTransSNPre.Enabled = false;
-                        afterTransSNPre_checkBox.Checked = true;
-                        afterTransSNPre_checkBox.Enabled = false;
-                    }
-                    if (rules.Rows[0]["psr_length"].ToString() != "")
+                    hasSaleRule = true;
+                }
+                else
+                {
+                    /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
+                     *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
+                    rules = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = '" + dt.Rows[0]["ma_prodcode"].ToString() + "' and psr_type='after'", "select");
+                    if (rules.Rows.Count > 0)
                     {
-                        afterTransSNLength.Text = rules.Rows[0]["psr_length"].ToString();
-                        afterTransSNLength.Enabled = false;
-                        afterTransSNLength_checkBox.Checked = true;
-                        afterTransSNLength_checkBox.Enabled = false;
+                        //将产品序列号防呆规则查出的数据填充
+                        if (rules.Rows[0]["psr_prefix"].ToString() != "")
+                        {
+                            afterTransSNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
+                            afterTransSNPre.Enabled = false;
+                            afterTransSNPre_checkBox.Checked = true;
+                            afterTransSNPre_checkBox.Enabled = false;
+                        }
+                        if (rules.Rows[0]["psr_length"].ToString() != "")
+                        {
+                            afterTransSNLength.Text = rules.Rows[0]["psr_length"].ToString();
+                            afterTransSNLength.Enabled = false;
+                            afterTransSNLength_checkBox.Checked = true;
+                            afterTransSNLength_checkBox.Enabled = false;
+                        }
                     }
                 }
             }

+ 363 - 363
UAS_MES_NEW/FunctionCode/Make/Make_SmtTestCollection.Designer.cs

@@ -45,10 +45,16 @@
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.mc_restqty_label = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.label7 = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
+            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_batchqty_label = new System.Windows.Forms.Label();
+            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
+            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
@@ -58,31 +64,6 @@
             this.ma_salecode = new System.Windows.Forms.Label();
             this.pr_sendchecktype = new System.Windows.Forms.Label();
             this.MakeBadView = new System.Windows.Forms.DataGridView();
-            this.mbp_part_label = new System.Windows.Forms.Label();
-            this.WaitChooseDGV = new System.Windows.Forms.DataGridView();
-            this.badloc_label = new System.Windows.Forms.Label();
-            this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn3 = 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.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
-            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.psl_location = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ChooseAll = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.bc_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bc_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.psl_prodcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.choose1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.mb_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbr_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -93,15 +74,19 @@
             this.mbc_component = new System.Windows.Forms.DataGridViewComboBoxColumn();
             this.mbp_part = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbl_loc = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mbp_part_label = new System.Windows.Forms.Label();
+            this.WaitChooseDGV = new System.Windows.Forms.DataGridView();
+            this.ChooseAll = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.bc_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bc_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.badloc_label = new System.Windows.Forms.Label();
+            this.psl_location = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.bd_soncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.Save = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
@@ -114,6 +99,21 @@
             this.WaitReject = new UAS_MES_NEW.CustomControl.ButtonUtil.ArrowLeftButton();
             this.bc_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn3 = 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.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MakeBadView)).BeginInit();
@@ -295,6 +295,19 @@
             this.panel1.Size = new System.Drawing.Size(315, 127);
             this.panel1.TabIndex = 71;
             // 
+            // ob_sendqty
+            // 
+            this.ob_sendqty.AutoSize = true;
+            this.ob_sendqty.CutLength = null;
+            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
+            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_sendqty.Name = "ob_sendqty";
+            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_sendqty.TabIndex = 78;
+            this.ob_sendqty.Tag = "ob_batchqty";
+            // 
             // label7
             // 
             this.label7.AutoSize = true;
@@ -319,6 +332,39 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = null;
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Enabled = false;
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(229, 90);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
+            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
+            this.SendCheck.Name = "SendCheck";
+            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
+            this.SendCheck.Power = null;
+            this.SendCheck.Size = new System.Drawing.Size(65, 26);
+            this.SendCheck.TabIndex = 72;
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = false;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.CutLength = null;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
+            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_batchqty.TabIndex = 75;
+            this.ob_batchqty.Tag = "ob_batchqty";
+            // 
             // ob_batchqty_label
             // 
             this.ob_batchqty_label.AutoSize = true;
@@ -330,6 +376,19 @@
             this.ob_batchqty_label.TabIndex = 74;
             this.ob_batchqty_label.Text = "抽检批数";
             // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.CutLength = null;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
+            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_nowcheckqty.TabIndex = 73;
+            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
+            // 
             // ob_nowcheckqty_label
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
@@ -341,6 +400,30 @@
             this.ob_nowcheckqty_label.TabIndex = 72;
             this.ob_nowcheckqty_label.Text = "当前批数";
             // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            this.mcd_remainqty.CutLength = null;
+            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.TabIndex = 57;
+            this.mcd_remainqty.Tag = "mcd_remainqty";
+            // 
+            // mcd_inqty
+            // 
+            this.mcd_inqty.AutoSize = true;
+            this.mcd_inqty.CutLength = null;
+            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_inqty.Name = "mcd_inqty";
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.TabIndex = 54;
+            this.mcd_inqty.Tag = "mcd_inqty";
+            // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
@@ -428,6 +511,82 @@
             this.MakeBadView.Size = new System.Drawing.Size(412, 223);
             this.MakeBadView.TabIndex = 195;
             // 
+            // choose1
+            // 
+            this.choose1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose1.HeaderText = "勾选";
+            this.choose1.MinimumWidth = 80;
+            this.choose1.Name = "choose1";
+            this.choose1.Width = 80;
+            // 
+            // mb_id
+            // 
+            this.mb_id.DataPropertyName = "mb_id";
+            this.mb_id.HeaderText = "mb_id";
+            this.mb_id.Name = "mb_id";
+            this.mb_id.Visible = false;
+            // 
+            // mbr_id
+            // 
+            this.mbr_id.DataPropertyName = "mbr_id";
+            this.mbr_id.HeaderText = "mbr_id";
+            this.mbr_id.Name = "mbr_id";
+            this.mbr_id.Visible = false;
+            // 
+            // mb_badcode
+            // 
+            this.mb_badcode.DataPropertyName = "mb_badcode";
+            this.mb_badcode.HeaderText = "不良代码";
+            this.mb_badcode.Name = "mb_badcode";
+            this.mb_badcode.ReadOnly = true;
+            // 
+            // mb_badname
+            // 
+            this.mb_badname.DataPropertyName = "mb_badname";
+            this.mb_badname.HeaderText = "不良名称";
+            this.mb_badname.Name = "mb_badname";
+            this.mb_badname.ReadOnly = true;
+            // 
+            // mb_bgname
+            // 
+            this.mb_bgname.DataPropertyName = "mb_bgname";
+            this.mb_bgname.HeaderText = "不良代码组描述";
+            this.mb_bgname.Name = "mb_bgname";
+            this.mb_bgname.Visible = false;
+            // 
+            // mb_bgcode
+            // 
+            this.mb_bgcode.DataPropertyName = "mb_bgcode";
+            this.mb_bgcode.HeaderText = "不良代码组编号";
+            this.mb_bgcode.Name = "mb_bgcode";
+            this.mb_bgcode.Visible = false;
+            // 
+            // mbc_component
+            // 
+            this.mbc_component.DataPropertyName = "mbc_component";
+            this.mbc_component.HeaderText = "不良组件";
+            this.mbc_component.Items.AddRange(new object[] {
+            "",
+            "主板",
+            "液晶屏",
+            "电路板",
+            "其他"});
+            this.mbc_component.Name = "mbc_component";
+            // 
+            // mbp_part
+            // 
+            this.mbp_part.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbp_part.DataPropertyName = "mbp_part";
+            this.mbp_part.HeaderText = "不良零件";
+            this.mbp_part.Name = "mbp_part";
+            // 
+            // mbl_loc
+            // 
+            this.mbl_loc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbl_loc.DataPropertyName = "mbl_loc";
+            this.mbl_loc.HeaderText = "不良位置";
+            this.mbl_loc.Name = "mbl_loc";
+            // 
             // mbp_part_label
             // 
             this.mbp_part_label.AutoSize = true;
@@ -457,166 +616,24 @@
             this.WaitChooseDGV.Size = new System.Drawing.Size(235, 223);
             this.WaitChooseDGV.TabIndex = 209;
             // 
-            // badloc_label
-            // 
-            this.badloc_label.AutoSize = true;
-            this.badloc_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.badloc_label.ForeColor = System.Drawing.Color.Black;
-            this.badloc_label.Location = new System.Drawing.Point(547, 241);
-            this.badloc_label.Name = "badloc_label";
-            this.badloc_label.Size = new System.Drawing.Size(56, 17);
-            this.badloc_label.TabIndex = 211;
-            this.badloc_label.Text = "不良零件";
-            // 
-            // dataGridViewCheckBoxColumn1
+            // ChooseAll
             // 
-            this.dataGridViewCheckBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn1.HeaderText = "勾选";
-            this.dataGridViewCheckBoxColumn1.MinimumWidth = 80;
-            this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
-            this.dataGridViewCheckBoxColumn1.Width = 80;
+            this.ChooseAll.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.ChooseAll.HeaderText = "勾选";
+            this.ChooseAll.MinimumWidth = 80;
+            this.ChooseAll.Name = "ChooseAll";
+            this.ChooseAll.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.ChooseAll.Width = 80;
             // 
-            // dataGridViewTextBoxColumn1
+            // bc_code
             // 
-            this.dataGridViewTextBoxColumn1.DataPropertyName = "mb_id";
-            this.dataGridViewTextBoxColumn1.HeaderText = "mb_id";
-            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
-            this.dataGridViewTextBoxColumn1.Visible = false;
+            this.bc_code.DataPropertyName = "bc_code";
+            this.bc_code.HeaderText = "不良代码";
+            this.bc_code.Name = "bc_code";
+            this.bc_code.ReadOnly = true;
+            this.bc_code.Width = 130;
             // 
-            // dataGridViewTextBoxColumn2
-            // 
-            this.dataGridViewTextBoxColumn2.DataPropertyName = "mbr_id";
-            this.dataGridViewTextBoxColumn2.HeaderText = "mbr_id";
-            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
-            this.dataGridViewTextBoxColumn2.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn3
-            // 
-            this.dataGridViewTextBoxColumn3.DataPropertyName = "mb_badcode";
-            this.dataGridViewTextBoxColumn3.HeaderText = "不良代码";
-            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
-            this.dataGridViewTextBoxColumn3.ReadOnly = true;
-            // 
-            // dataGridViewTextBoxColumn4
-            // 
-            this.dataGridViewTextBoxColumn4.DataPropertyName = "mb_badname";
-            this.dataGridViewTextBoxColumn4.HeaderText = "不良名称";
-            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
-            this.dataGridViewTextBoxColumn4.ReadOnly = true;
-            // 
-            // dataGridViewTextBoxColumn5
-            // 
-            this.dataGridViewTextBoxColumn5.DataPropertyName = "mbp_part";
-            this.dataGridViewTextBoxColumn5.HeaderText = "不良零件";
-            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
-            this.dataGridViewTextBoxColumn5.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.DataPropertyName = "mbl_loc";
-            this.dataGridViewTextBoxColumn6.HeaderText = "不良位置";
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.Visible = false;
-            // 
-            // dataGridViewComboBoxColumn1
-            // 
-            this.dataGridViewComboBoxColumn1.DataPropertyName = "mbc_component";
-            this.dataGridViewComboBoxColumn1.HeaderText = "不良组件";
-            this.dataGridViewComboBoxColumn1.Items.AddRange(new object[] {
-            "",
-            "主板",
-            "液晶屏",
-            "电路板",
-            "其他"});
-            this.dataGridViewComboBoxColumn1.Name = "dataGridViewComboBoxColumn1";
-            // 
-            // dataGridViewTextBoxColumn7
-            // 
-            this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.dataGridViewTextBoxColumn7.DataPropertyName = "mbp_part";
-            this.dataGridViewTextBoxColumn7.HeaderText = "不良零件";
-            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
-            // 
-            // dataGridViewTextBoxColumn8
-            // 
-            this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.dataGridViewTextBoxColumn8.DataPropertyName = "mbl_loc";
-            this.dataGridViewTextBoxColumn8.HeaderText = "不良位置";
-            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
-            // 
-            // dataGridViewCheckBoxColumn2
-            // 
-            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn2.HeaderText = "勾选";
-            this.dataGridViewCheckBoxColumn2.MinimumWidth = 80;
-            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
-            this.dataGridViewCheckBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridViewCheckBoxColumn2.Width = 80;
-            // 
-            // dataGridViewTextBoxColumn9
-            // 
-            this.dataGridViewTextBoxColumn9.DataPropertyName = "bc_code";
-            this.dataGridViewTextBoxColumn9.HeaderText = "不良代码";
-            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
-            this.dataGridViewTextBoxColumn9.ReadOnly = true;
-            this.dataGridViewTextBoxColumn9.Width = 130;
-            // 
-            // dataGridViewTextBoxColumn10
-            // 
-            this.dataGridViewTextBoxColumn10.DataPropertyName = "bc_name";
-            this.dataGridViewTextBoxColumn10.HeaderText = "不良名称";
-            this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
-            this.dataGridViewTextBoxColumn10.ReadOnly = true;
-            this.dataGridViewTextBoxColumn10.Width = 130;
-            // 
-            // dataGridViewTextBoxColumn11
-            // 
-            this.dataGridViewTextBoxColumn11.DataPropertyName = "bg_code";
-            this.dataGridViewTextBoxColumn11.HeaderText = "不良组别编号";
-            this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
-            this.dataGridViewTextBoxColumn11.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn12
-            // 
-            this.dataGridViewTextBoxColumn12.DataPropertyName = "bg_name";
-            this.dataGridViewTextBoxColumn12.HeaderText = "不良组别名称";
-            this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
-            this.dataGridViewTextBoxColumn12.Visible = false;
-            // 
-            // psl_location
-            // 
-            this.psl_location.AllPower = null;
-            this.psl_location.BackColor = System.Drawing.Color.White;
-            this.psl_location.ID = null;
-            this.psl_location.Location = new System.Drawing.Point(618, 237);
-            this.psl_location.Name = "psl_location";
-            this.psl_location.Power = null;
-            this.psl_location.Size = new System.Drawing.Size(94, 21);
-            this.psl_location.Str = null;
-            this.psl_location.Str1 = null;
-            this.psl_location.Str2 = null;
-            this.psl_location.TabIndex = 210;
-            this.psl_location.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bad_loc_KeyDown);
-            this.psl_location.Leave += new System.EventHandler(this.psl_location_Leave);
-            // 
-            // ChooseAll
-            // 
-            this.ChooseAll.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.ChooseAll.HeaderText = "勾选";
-            this.ChooseAll.MinimumWidth = 80;
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.ChooseAll.Width = 80;
-            // 
-            // bc_code
-            // 
-            this.bc_code.DataPropertyName = "bc_code";
-            this.bc_code.HeaderText = "不良代码";
-            this.bc_code.Name = "bc_code";
-            this.bc_code.ReadOnly = true;
-            this.bc_code.Width = 130;
-            // 
-            // bc_name
+            // bc_name
             // 
             this.bc_name.DataPropertyName = "bc_name";
             this.bc_name.HeaderText = "不良名称";
@@ -638,101 +655,52 @@
             this.bg_name.Name = "bg_name";
             this.bg_name.Visible = false;
             // 
-            // psl_prodcode
-            // 
-            this.psl_prodcode.AllPower = null;
-            this.psl_prodcode.Caller = null;
-            this.psl_prodcode.Condition = null;
-            this.psl_prodcode.DBTitle = null;
-            this.psl_prodcode.FormName = null;
-            this.psl_prodcode.Location = new System.Drawing.Point(428, 238);
-            this.psl_prodcode.Margin = new System.Windows.Forms.Padding(2);
-            this.psl_prodcode.Name = "psl_prodcode";
-            this.psl_prodcode.Power = null;
-            this.psl_prodcode.ReturnData = null;
-            this.psl_prodcode.SelectField = null;
-            this.psl_prodcode.SetValueField = null;
-            this.psl_prodcode.Size = new System.Drawing.Size(114, 21);
-            this.psl_prodcode.TabIndex = 207;
-            this.psl_prodcode.TableName = null;
-            this.psl_prodcode.Tag = "psl_prodcode";
-            this.psl_prodcode.TextBoxEnable = true;
-            // 
-            // choose1
-            // 
-            this.choose1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.choose1.HeaderText = "勾选";
-            this.choose1.MinimumWidth = 80;
-            this.choose1.Name = "choose1";
-            this.choose1.Width = 80;
-            // 
-            // mb_id
-            // 
-            this.mb_id.DataPropertyName = "mb_id";
-            this.mb_id.HeaderText = "mb_id";
-            this.mb_id.Name = "mb_id";
-            this.mb_id.Visible = false;
-            // 
-            // mbr_id
-            // 
-            this.mbr_id.DataPropertyName = "mbr_id";
-            this.mbr_id.HeaderText = "mbr_id";
-            this.mbr_id.Name = "mbr_id";
-            this.mbr_id.Visible = false;
-            // 
-            // mb_badcode
-            // 
-            this.mb_badcode.DataPropertyName = "mb_badcode";
-            this.mb_badcode.HeaderText = "不良代码";
-            this.mb_badcode.Name = "mb_badcode";
-            this.mb_badcode.ReadOnly = true;
-            // 
-            // mb_badname
-            // 
-            this.mb_badname.DataPropertyName = "mb_badname";
-            this.mb_badname.HeaderText = "不良名称";
-            this.mb_badname.Name = "mb_badname";
-            this.mb_badname.ReadOnly = true;
-            // 
-            // mb_bgname
-            // 
-            this.mb_bgname.DataPropertyName = "mb_bgname";
-            this.mb_bgname.HeaderText = "不良代码组描述";
-            this.mb_bgname.Name = "mb_bgname";
-            this.mb_bgname.Visible = false;
-            // 
-            // mb_bgcode
-            // 
-            this.mb_bgcode.DataPropertyName = "mb_bgcode";
-            this.mb_bgcode.HeaderText = "不良代码组编号";
-            this.mb_bgcode.Name = "mb_bgcode";
-            this.mb_bgcode.Visible = false;
-            // 
-            // mbc_component
-            // 
-            this.mbc_component.DataPropertyName = "mbc_component";
-            this.mbc_component.HeaderText = "不良组件";
-            this.mbc_component.Items.AddRange(new object[] {
-            "",
-            "主板",
-            "液晶屏",
-            "电路板",
-            "其他"});
-            this.mbc_component.Name = "mbc_component";
+            // badloc_label
             // 
-            // mbp_part
+            this.badloc_label.AutoSize = true;
+            this.badloc_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.badloc_label.ForeColor = System.Drawing.Color.Black;
+            this.badloc_label.Location = new System.Drawing.Point(547, 241);
+            this.badloc_label.Name = "badloc_label";
+            this.badloc_label.Size = new System.Drawing.Size(56, 17);
+            this.badloc_label.TabIndex = 211;
+            this.badloc_label.Text = "不良位置";
             // 
-            this.mbp_part.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbp_part.DataPropertyName = "mbp_part";
-            this.mbp_part.HeaderText = "不良零件";
-            this.mbp_part.Name = "mbp_part";
+            // psl_location
             // 
-            // mbl_loc
+            this.psl_location.AllPower = null;
+            this.psl_location.BackColor = System.Drawing.Color.White;
+            this.psl_location.ID = null;
+            this.psl_location.Location = new System.Drawing.Point(618, 237);
+            this.psl_location.Name = "psl_location";
+            this.psl_location.Power = null;
+            this.psl_location.Size = new System.Drawing.Size(94, 21);
+            this.psl_location.Str = null;
+            this.psl_location.Str1 = null;
+            this.psl_location.Str2 = null;
+            this.psl_location.TabIndex = 210;
+            this.psl_location.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bad_loc_KeyDown);
+            this.psl_location.Leave += new System.EventHandler(this.psl_location_Leave);
             // 
-            this.mbl_loc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbl_loc.DataPropertyName = "mbl_loc";
-            this.mbl_loc.HeaderText = "不良位置";
-            this.mbl_loc.Name = "mbl_loc";
+            // bd_soncode
+            // 
+            this.bd_soncode.AllPower = null;
+            this.bd_soncode.Caller = null;
+            this.bd_soncode.Condition = null;
+            this.bd_soncode.DBTitle = null;
+            this.bd_soncode.FormName = null;
+            this.bd_soncode.Location = new System.Drawing.Point(428, 238);
+            this.bd_soncode.Margin = new System.Windows.Forms.Padding(2);
+            this.bd_soncode.Name = "bd_soncode";
+            this.bd_soncode.Power = null;
+            this.bd_soncode.ReturnData = null;
+            this.bd_soncode.SelectField = null;
+            this.bd_soncode.SetValueField = null;
+            this.bd_soncode.Size = new System.Drawing.Size(114, 21);
+            this.bd_soncode.TabIndex = 207;
+            this.bd_soncode.TableName = null;
+            this.bd_soncode.Tag = "psl_prodcode";
+            this.bd_soncode.TextBoxEnable = true;
             // 
             // StepCount
             // 
@@ -768,89 +736,6 @@
             this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 73;
             // 
-            // ob_sendqty
-            // 
-            this.ob_sendqty.AutoSize = true;
-            this.ob_sendqty.CutLength = null;
-            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
-            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_sendqty.Name = "ob_sendqty";
-            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_sendqty.TabIndex = 78;
-            this.ob_sendqty.Tag = "ob_batchqty";
-            // 
-            // SendCheck
-            // 
-            this.SendCheck.AllPower = null;
-            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
-            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
-            this.SendCheck.Enabled = false;
-            this.SendCheck.Image = null;
-            this.SendCheck.IsShowBorder = true;
-            this.SendCheck.Location = new System.Drawing.Point(229, 90);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
-            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
-            this.SendCheck.Name = "SendCheck";
-            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
-            this.SendCheck.Power = null;
-            this.SendCheck.Size = new System.Drawing.Size(65, 26);
-            this.SendCheck.TabIndex = 72;
-            this.SendCheck.Text = "送检";
-            this.SendCheck.UseVisualStyleBackColor = false;
-            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
-            // 
-            // ob_batchqty
-            // 
-            this.ob_batchqty.AutoSize = true;
-            this.ob_batchqty.CutLength = null;
-            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
-            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_batchqty.TabIndex = 75;
-            this.ob_batchqty.Tag = "ob_batchqty";
-            // 
-            // ob_nowcheckqty
-            // 
-            this.ob_nowcheckqty.AutoSize = true;
-            this.ob_nowcheckqty.CutLength = null;
-            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
-            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
-            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_nowcheckqty.TabIndex = 73;
-            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
-            // 
-            // mcd_remainqty
-            // 
-            this.mcd_remainqty.AutoSize = true;
-            this.mcd_remainqty.CutLength = null;
-            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_remainqty.TabIndex = 57;
-            this.mcd_remainqty.Tag = "mcd_remainqty";
-            // 
-            // mcd_inqty
-            // 
-            this.mcd_inqty.AutoSize = true;
-            this.mcd_inqty.CutLength = null;
-            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_inqty.TabIndex = 54;
-            this.mcd_inqty.Tag = "mcd_inqty";
-            // 
             // Save
             // 
             this.Save.AllPower = null;
@@ -1016,6 +901,121 @@
             this.ms_sncode.Tag = "IfRead";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
             // 
+            // dataGridViewCheckBoxColumn1
+            // 
+            this.dataGridViewCheckBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewCheckBoxColumn1.HeaderText = "勾选";
+            this.dataGridViewCheckBoxColumn1.MinimumWidth = 80;
+            this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
+            this.dataGridViewCheckBoxColumn1.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn1
+            // 
+            this.dataGridViewTextBoxColumn1.DataPropertyName = "mb_id";
+            this.dataGridViewTextBoxColumn1.HeaderText = "mb_id";
+            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.DataPropertyName = "mbr_id";
+            this.dataGridViewTextBoxColumn2.HeaderText = "mbr_id";
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn3
+            // 
+            this.dataGridViewTextBoxColumn3.DataPropertyName = "mb_badcode";
+            this.dataGridViewTextBoxColumn3.HeaderText = "不良代码";
+            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.ReadOnly = true;
+            // 
+            // dataGridViewTextBoxColumn4
+            // 
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "mb_badname";
+            this.dataGridViewTextBoxColumn4.HeaderText = "不良名称";
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.ReadOnly = true;
+            // 
+            // dataGridViewTextBoxColumn5
+            // 
+            this.dataGridViewTextBoxColumn5.DataPropertyName = "mbp_part";
+            this.dataGridViewTextBoxColumn5.HeaderText = "不良零件";
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "mbl_loc";
+            this.dataGridViewTextBoxColumn6.HeaderText = "不良位置";
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.Visible = false;
+            // 
+            // dataGridViewComboBoxColumn1
+            // 
+            this.dataGridViewComboBoxColumn1.DataPropertyName = "mbc_component";
+            this.dataGridViewComboBoxColumn1.HeaderText = "不良组件";
+            this.dataGridViewComboBoxColumn1.Items.AddRange(new object[] {
+            "",
+            "主板",
+            "液晶屏",
+            "电路板",
+            "其他"});
+            this.dataGridViewComboBoxColumn1.Name = "dataGridViewComboBoxColumn1";
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "mbp_part";
+            this.dataGridViewTextBoxColumn7.HeaderText = "不良零件";
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.dataGridViewTextBoxColumn8.DataPropertyName = "mbl_loc";
+            this.dataGridViewTextBoxColumn8.HeaderText = "不良位置";
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            // 
+            // dataGridViewCheckBoxColumn2
+            // 
+            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewCheckBoxColumn2.HeaderText = "勾选";
+            this.dataGridViewCheckBoxColumn2.MinimumWidth = 80;
+            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
+            this.dataGridViewCheckBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.dataGridViewCheckBoxColumn2.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn9
+            // 
+            this.dataGridViewTextBoxColumn9.DataPropertyName = "bc_code";
+            this.dataGridViewTextBoxColumn9.HeaderText = "不良代码";
+            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
+            this.dataGridViewTextBoxColumn9.ReadOnly = true;
+            this.dataGridViewTextBoxColumn9.Width = 130;
+            // 
+            // dataGridViewTextBoxColumn10
+            // 
+            this.dataGridViewTextBoxColumn10.DataPropertyName = "bc_name";
+            this.dataGridViewTextBoxColumn10.HeaderText = "不良名称";
+            this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
+            this.dataGridViewTextBoxColumn10.ReadOnly = true;
+            this.dataGridViewTextBoxColumn10.Width = 130;
+            // 
+            // dataGridViewTextBoxColumn11
+            // 
+            this.dataGridViewTextBoxColumn11.DataPropertyName = "bg_code";
+            this.dataGridViewTextBoxColumn11.HeaderText = "不良组别编号";
+            this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
+            this.dataGridViewTextBoxColumn11.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn12
+            // 
+            this.dataGridViewTextBoxColumn12.DataPropertyName = "bg_name";
+            this.dataGridViewTextBoxColumn12.HeaderText = "不良组别名称";
+            this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
+            this.dataGridViewTextBoxColumn12.Visible = false;
+            // 
             // Make_SmtTestCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1025,7 +1025,7 @@
             this.Controls.Add(this.badloc_label);
             this.Controls.Add(this.psl_location);
             this.Controls.Add(this.WaitChooseDGV);
-            this.Controls.Add(this.psl_prodcode);
+            this.Controls.Add(this.bd_soncode);
             this.Controls.Add(this.mbp_part_label);
             this.Controls.Add(this.MakeBadView);
             this.Controls.Add(this.StepCount);
@@ -1139,7 +1139,7 @@
         private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
-        private CustomControl.TextBoxWithIcon.SearchTextBox psl_prodcode;
+        private CustomControl.TextBoxWithIcon.SearchTextBox bd_soncode;
         private System.Windows.Forms.Label mbp_part_label;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;

+ 30 - 30
UAS_MES_NEW/FunctionCode/Make/Make_SmtTestCollection.cs

@@ -69,12 +69,12 @@ namespace UAS_MES_NEW.Make
 
 
 
-            psl_prodcode.FormName = Name;
-            psl_prodcode.TableName = "PRODUCTSMTLOCATION left join Product on psl_prodcode=pr_code left join PRODUCTSMT on ps_id = psl_psid";
-            psl_prodcode.SetValueField = new string[] { "psl_prodcode", "psl_location" };
-            psl_prodcode.SelectField = "psl_prodcode # 物料编号,pr_detail # 物料名称,pr_spec # 物料规格,psl_location # 站位";
-            psl_prodcode.DBTitle = "不良零件";
-            psl_prodcode.DbChange += Prodcode_DbChange;
+            bd_soncode.FormName = Name;
+            bd_soncode.TableName = "bom left join bomdetail on bd_bomid=bo_id left join product on bd_soncode=pr_code";
+            bd_soncode.SetValueField = new string[] { "bd_soncode" };
+            bd_soncode.SelectField = "bd_soncode # 子件编号,pr_detail # 物料名称,pr_spec # 物料规格,bd_location # 位号";
+            bd_soncode.DBTitle = "不良零件";
+            bd_soncode.DbChange += Prodcode_DbChange;
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
@@ -563,24 +563,24 @@ namespace UAS_MES_NEW.Make
                             sql.Append(",:mbl_loc,'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
                             sql.Append("sysdate,'" + User.UserCode + "' from dual");
                             dh.BatchInsert(sql.GetString(), new string[] { "mbl_loc" }, mbl_loc);
-                            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='" + ma_prodcode + "' connect by bo_mothercode= prior bd_soncode) ");
-                            sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper() + ",')>0");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
-                            {
-                                for (int j = 0; j < dt.Rows.Count; i++)
-                                {
-                                    sql.Clear();
-                                    sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                                    sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                                    sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + dt.Rows[0][j].ToString() + "',");
-                                    sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                                    sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                                    dh.ExecuteSql(sql.GetString(), "insert");
-                                }
-                            }
+                            //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='" + ma_prodcode.Text + "' connect by bo_mothercode= prior bd_soncode) ");
+                            //sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper() + ",')>0");
+                            //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            //if (dt.Rows.Count > 0)
+                            //{
+                            //    for (int j = 0; j < dt.Rows.Count; i++)
+                            //    {
+                            //        sql.Clear();
+                            //        sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                            //        sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                            //        sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + dt.Rows[0][j].ToString() + "',");
+                            //        sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                            //        sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                            //        dh.ExecuteSql(sql.GetString(), "insert");
+                            //    }  
+                            //}
                             sql.Clear();
                             sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
                             sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
@@ -829,7 +829,7 @@ namespace UAS_MES_NEW.Make
 
         private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
-            psl_prodcode.Condition = "ps_linecode = '" + User.UserLineCode + "' and ps_prodcode = '" + ma_prodcode.Text + "' and ps_table = '" + st_table + "'";
+            bd_soncode.Condition = "bo_mothercode = '" + ma_prodcode.Text + "'";
         }
 
         private void Filter_UserControlTextChanged(object sender, EventArgs e)
@@ -882,7 +882,7 @@ namespace UAS_MES_NEW.Make
         private void Prodcode_DbChange(object sender, EventArgs e)
         {
             MakeBadView.EndEdit();
-            if (psl_prodcode.Text != "")
+            if (bd_soncode.Text != "")
             {
                 for (int i = 0; i < MakeBadView.Rows.Count; i++)
                 {
@@ -892,10 +892,10 @@ namespace UAS_MES_NEW.Make
                         {
                             if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
                             {
-                                MakeBadView.Rows[i].Cells["mbp_part"].Value = psl_prodcode.Text;
+                                MakeBadView.Rows[i].Cells["mbp_part"].Value = bd_soncode.Text;
                             }
-                            else if (!MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Contains(psl_prodcode.Text))
-                                MakeBadView.Rows[i].Cells["mbp_part"].Value += "," + psl_prodcode.Text;
+                            else if (!MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Contains(bd_soncode.Text))
+                                MakeBadView.Rows[i].Cells["mbp_part"].Value += "," + bd_soncode.Text;
 
                             if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "")
                             {
@@ -928,7 +928,7 @@ namespace UAS_MES_NEW.Make
                 {
                     if (psl_location.Text != "")
                     {
-                        string psl_prodcode = dh.getFieldDataByCondition("PRODUCTSMTLOCATION left join Product on psl_prodcode=pr_code left join PRODUCTSMT on ps_id = psl_psid", "psl_prodcode", "ps_linecode = '" + User.UserLineCode + "' and ps_prodcode = '" + ma_prodcode.Text + "' and ps_table = '" + st_table + "' and psl_location = '" + psl_location.Text.ToUpper() + "'").ToString();
+                        string psl_prodcode = dh.getFieldDataByCondition("bom left join bomdetail on bd_bomid=bo_id left join product on bd_soncode=pr_code", "bd_soncode", "bo_mothercode = '" + ma_prodcode.Text + "' and bd_location like '%" + psl_location.Text.ToUpper() + "%'").ToString();
                         if (psl_prodcode != "")
                         {
                             for (int i = 0; i < MakeBadView.Rows.Count; i++)

+ 36 - 35
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW.Packing
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
-            catch (Exception)
+            catch (Exception ex)
             {
                 OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
             }
@@ -190,7 +190,7 @@ namespace UAS_MES_NEW.Packing
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_prodcode,ms_craftcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
                         if (oMsID == "" || oMsID == "null" || oMsID == "0")
@@ -199,6 +199,7 @@ namespace UAS_MES_NEW.Packing
                             oMsStatus = dt.Rows[0]["ms_status"].ToString();
                             oMakeCode = dt.Rows[0]["ms_makecode"].ToString();
                         }
+                        //如果是已完工序列号验证装箱工序是否存在于途程中
                         if (oMsStatus == "2")
                         {
                             string prodcode = dt.Rows[0]["ms_prodcode"].ToString();
@@ -609,7 +610,7 @@ namespace UAS_MES_NEW.Packing
                     return;
                 }
                 sql.Clear();
-                sql.Append("update oqcbatch set ob_status='UNCHECK' where ob_checkno ='" + ob_checkno.Text + "'");
+                sql.Append("update oqcbatch set ob_status='UNCHECK',ob_breakingdate=sysdate where ob_checkno ='" + ob_checkno.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "select");
                 ob_nowcheckqty.Text = "";
                 ob_batchqty.Text = "";
@@ -906,38 +907,6 @@ namespace UAS_MES_NEW.Packing
             return true;
         }
 
-
-        private bool CheckOutBoxLength(string ms_salecode_text)
-        {
-            if (AutoGenBoxCode.Checked)
-            {
-                if (ms_salecode_text != "")
-                {
-                    DataTable dt = (DataTable)dh.ExecuteSql(" select pn_number,pn_id,pn_caller,pn_numberlength,pn_leadcode  from PACKAGENUMBER where pn_caller='" + ms_salecode_text + "'", "select");
-                    if (dt.Rows.Count > 0)
-                    {
-                        string pn_leadcode = dt.Rows[0]["pn_leadcode"].ToString();
-                        int pn_numberlength = int.Parse(dt.Rows[0]["pn_numberlength"].ToString());
-                        if (OutBoxLength.Text != (pn_leadcode.Length + pn_numberlength).ToString())
-                        {
-                            OutBoxLength.Text = (pn_leadcode.Length + pn_numberlength).ToString();
-                            BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
-                        }
-                        if (PreFix.Text != pn_leadcode)
-                        {
-                            PreFix.Text = pn_leadcode;
-                            BaseUtil.SetCacheData("PreFix", PreFix.Text);
-                        }
-                    }
-                    else {
-                        OperateResult.AppendText(">>订单号" + ms_salecode_text + "未维护箱号规则\n", Color.Black);
-                    }
-                }
-                return true;
-            }
-            return CheckOutBoxLength();
-        }
-    
         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");
@@ -1050,6 +1019,38 @@ namespace UAS_MES_NEW.Packing
                 }
             }
         }
+        private bool CheckOutBoxLength(string ms_salecode_text)
+        {
+            if (AutoGenBoxCode.Checked)
+            {
+                if (ms_salecode_text != "")
+                {
+                    DataTable dt = (DataTable)dh.ExecuteSql(" select pn_number,pn_id,pn_caller,pn_numberlength,pn_leadcode  from PACKAGENUMBER where pn_caller='" + ms_salecode_text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        string pn_leadcode = dt.Rows[0]["pn_leadcode"].ToString();
+                        int pn_numberlength = int.Parse(dt.Rows[0]["pn_numberlength"].ToString());
+                        if (OutBoxLength.Text != (pn_leadcode.Length + pn_numberlength).ToString())
+                        {
+                            OutBoxLength.Text = (pn_leadcode.Length + pn_numberlength).ToString();
+                            BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
+                        }
+                        if (PreFix.Text != pn_leadcode)
+                        {
+                            PreFix.Text = pn_leadcode;
+                            BaseUtil.SetCacheData("PreFix", PreFix.Text);
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>订单号" + ms_salecode_text + "未维护箱号规则\n", Color.Black);
+                    }
+                }
+                return true;
+            }
+            return CheckOutBoxLength();
+        }
+
 
         private void AutoGenBoxCode_CheckedChanged(object sender, EventArgs e)
         {

+ 3 - 2
UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -175,7 +175,7 @@ namespace UAS_MES_NEW.Packing
                         if (pa_nextstep == "")
                         {
                             //判断线外,必须已完工并且未入库
-                            dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view  left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
+                            dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view  left join makeserial on v_barcode=ms_sncode and v_makecode = ms_makecode where  v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
                             if (dt.Rows[0][0].ToString() != "" && (unfinpack != "0" || unfinpack == ""))
                             {
                                 OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "尚未完工\n", Color.Red);
@@ -412,7 +412,8 @@ namespace UAS_MES_NEW.Packing
                         pa_outboxcode.Focus();
                         pa_outboxcode.SelectAll();
                     }
-                    else {
+                    else
+                    {
                         outboxcode.Focus();
                         outboxcode.SelectAll();
                     }