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

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

章政 8 жил өмнө
parent
commit
0c3ee155af

+ 108 - 99
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -32,22 +32,22 @@
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.sncode_label = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.mcd_remainqty_label = new System.Windows.Forms.Label();
+            this.mcd_okqty_label = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.pr_detail_label = new System.Windows.Forms.Label();
-            this.sncode_label = new System.Windows.Forms.Label();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.label4 = new System.Windows.Forms.Label();
-            this.mcd_remainqty_label = new System.Windows.Forms.Label();
-            this.mcd_okqty_label = new System.Windows.Forms.Label();
-            this.pr_code_label = new System.Windows.Forms.Label();
-            this.ms_makecode_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // PrintLabel
@@ -82,6 +82,102 @@
             this.label1.TabIndex = 179;
             this.label1.Text = "标签";
             // 
+            // pr_detail_label
+            // 
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(648, 52);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.TabIndex = 171;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // sncode_label
+            // 
+            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode_label.AutoSize = true;
+            this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode_label.Location = new System.Drawing.Point(64, 561);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Name = "sncode_label";
+            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.TabIndex = 170;
+            this.sncode_label.Text = "序列号";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(648, 113);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.TabIndex = 167;
+            this.label4.Text = "打印张数";
+            // 
+            // mcd_remainqty_label
+            // 
+            this.mcd_remainqty_label.AutoSize = true;
+            this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(356, 113);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Name = "mcd_remainqty_label";
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
+            this.mcd_remainqty_label.TabIndex = 166;
+            this.mcd_remainqty_label.Text = "剩余数";
+            // 
+            // mcd_okqty_label
+            // 
+            this.mcd_okqty_label.AutoSize = true;
+            this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_okqty_label.Location = new System.Drawing.Point(64, 113);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Name = "mcd_okqty_label";
+            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_okqty_label.TabIndex = 165;
+            this.mcd_okqty_label.Text = "打印计数";
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(356, 52);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.TabIndex = 164;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.AutoSize = true;
+            this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_label.Location = new System.Drawing.Point(64, 52);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.TabIndex = 163;
+            this.ms_makecode_label.Text = "归属工单";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(172, 55);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(163, 22);
+            this.ma_code.TabIndex = 182;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = false;
+            // 
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(1116, 50);
@@ -121,6 +217,7 @@
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 27);
             this.pr_code.TabIndex = 175;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // pr_detail
             // 
@@ -132,16 +229,6 @@
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 174;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(189, 52);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 173;
-            // 
             // PrintNum
             // 
             this.PrintNum.AllPower = null;
@@ -158,30 +245,6 @@
             this.PrintNum.Str2 = null;
             this.PrintNum.TabIndex = 172;
             // 
-            // pr_detail_label
-            // 
-            this.pr_detail_label.AutoSize = true;
-            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(648, 52);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
-            this.pr_detail_label.TabIndex = 171;
-            this.pr_detail_label.Text = "产品名称";
-            // 
-            // sncode_label
-            // 
-            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.sncode_label.AutoSize = true;
-            this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(64, 561);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
-            this.sncode_label.TabIndex = 170;
-            this.sncode_label.Text = "序列号";
-            // 
             // sncode
             // 
             this.sncode.AllPower = "ifall";
@@ -199,6 +262,7 @@
             this.sncode.Str2 = null;
             this.sncode.TabIndex = 169;
             this.sncode.Tag = "ifwrite";
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
             // 
             // OperateResult
             // 
@@ -210,66 +274,12 @@
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(648, 113);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
-            this.label4.TabIndex = 167;
-            this.label4.Text = "打印张数";
-            // 
-            // mcd_remainqty_label
-            // 
-            this.mcd_remainqty_label.AutoSize = true;
-            this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(356, 113);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
-            this.mcd_remainqty_label.TabIndex = 166;
-            this.mcd_remainqty_label.Text = "剩余数";
-            // 
-            // mcd_okqty_label
-            // 
-            this.mcd_okqty_label.AutoSize = true;
-            this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(64, 113);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
-            this.mcd_okqty_label.TabIndex = 165;
-            this.mcd_okqty_label.Text = "打印计数";
-            // 
-            // pr_code_label
-            // 
-            this.pr_code_label.AutoSize = true;
-            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(356, 52);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
-            this.pr_code_label.TabIndex = 164;
-            this.pr_code_label.Text = "产品编号";
-            // 
-            // ms_makecode_label
-            // 
-            this.ms_makecode_label.AutoSize = true;
-            this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(64, 52);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
-            this.ms_makecode_label.TabIndex = 163;
-            this.ms_makecode_label.Text = "归属工单";
-            // 
             // Make_ColorBoxLabelPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1344, 651);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
@@ -278,7 +288,6 @@
             this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.pr_detail);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.sncode_label);
@@ -313,7 +322,6 @@
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
-        private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
         private System.Windows.Forms.Label pr_detail_label;
         private System.Windows.Forms.Label sncode_label;
@@ -324,5 +332,6 @@
         private System.Windows.Forms.Label mcd_okqty_label;
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label ms_makecode_label;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
     }
 }

+ 65 - 173
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -29,29 +29,29 @@ namespace UAS_MES.Make
         //工艺路线编号
         string craftcode;
         //制造单号
-        string ma_code;
+        string macode;
         //当前工单的序列号
         string sn_code;
         //当前提示的索引
         int RemainIndex = 0;
-
-        string Step = "Loading";
-
         ApplicationClass lbl;
-
         public Make_ColorBoxLabelPrint()
         {
             InitializeComponent();
         }
-
         private void Make_ColorBoxLabelPrint_Load(object sender, EventArgs e)
         {
             dh = new DataHelper();
             lbl = new ApplicationClass();
             sncode.Focus();
             asc.controllInitializeSize(this);
+            //工单放大镜的配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,pr_detail # 产品名称";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
         }
-
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -61,195 +61,90 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
                     return;
                 }
-                //通过输入指定字符来设置当前执行的步骤
-                if (sncode.Text == "L")
-                {
-                    Step = " ";
-                    OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
-                }
-                else if (sncode.Text == "R")
+                string oMsID;
+                string ErrorMessage2;
+                string oMakeCode;
+                // 获取工单归属工单下一工序是否正确
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                 {
-                    Step = "UnLoading";
-                    OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
-                }
-                //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
-                if (ms_makecode.Text != ma_code || ma_code == "")
-                {
-                    //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
-                    if (ma_code != "" && ms_makecode.Text != "")
-                    {
-                        OperateResult.AppendText(">>切换工单至工单号" + ma_code + "\n", Color.Red);
-                    }
-                    sql.Clear();
-                    sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
-                    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_sncode=:sncode");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
-                    if (dt.Rows.Count > 0)
-                    {
-                        BaseUtil.SetFormValue(this.Controls, dt);
-                        sn_code = sncode.Text;
-                    }
-                    else
+                    if (LogicHandler.GetMakeInfo(sncode.Text, out macode, out ErrorMessage2))
                     {
-                        OperateResult.AppendText(">>序列号" + sncode.Text + "不存在\n", Color.Red);
-                        return;
-                    }
-
-                    //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                    if (Step == "Loading")
-                    {
-                        sql.Clear();
-                        sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
-                        sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
-                        //记录一些变量
-                        stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                        nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                        craftcode = dt.Rows[0]["ma_craftcode"].ToString();
-                        string ErrorMessage;
-                        bool ifFirst;
-                        //检测当前序列号和岗位资源是否对应
-                        if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
+                        //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
+                      //  macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
+                        if (ma_code.Text != macode || macode == "")
                         {
-                            //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
-                            sql.Clear();
-                            sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
-                            sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
+                            //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
+                            if (macode != "" && ma_code.Text != "")
                             {
-                                //如果是上料工序
-                                if (dt.Rows[0]["cd_ifinput"].ToString() != "0")
-                                {
-                                    // 查询没有结果,提示该上料工序没有需要上料的数据,请先维护对应的数据
-                                    sql.Clear();
-                                    sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
-                                    sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                                    sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cd_ifinput"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
-                                    sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
-                                    sql.Append("order by SP_DETNO asc");
-                                    ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                    //获取对应 产品的机身标的打印模板
-                                    if (ListA.Rows.Count > 0)
-                                    {
-                                        OperateResult.AppendText(">>请采集" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                                    }
-                                    //未查询到数据时标识是测试工序
-                                    else
-                                    {
-                                        DoTestProcedure();
-                                    }
-                                }
-                                //同上,如果,iftest不等于0也进入测试工序
-                                else if (dt.Rows[0]["cd_iftest"].ToString() != "0")
-                                {
-                                    DoTestProcedure();
-                                }
+                                OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
                             }
                         }
-                        else
-                        {
-                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                        }
-                    }
-                    //如果执行的是下料操作
-                    else if (Step == "UnLoading")
-                    {
-                        string ErrorMessage1 = "";
-                        if (LogicHandler.SetMaterialDown(sn_code, sncode.Text, User.CurrentStepCode, User.UserName, out ErrorMessage1))
+                        sql.Clear();
+                        sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_okqty as mcd_remainqty,pr_detail,pr_code ");
+                        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_sncode=:sncode");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
+                        if (dt.Rows.Count > 0)
                         {
-                            OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            sn_code = sncode.Text;
                         }
                         else
                         {
-                            OperateResult.AppendText(">>" + ErrorMessage1 + "\n", Color.Red);
+                            OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+
                         }
-                    }
-                }
-                else
-                {
-                    //如果ListA中没有数据执行的是测试工序
-                    if (ListA.Rows.Count == 0)
-                    {
-                        DoTestProcedure();
-                    }
-                    //存在数据执行的是上料采集
-                    else
-                    {
-                        //如果当前的索引和长度相等则表示采集完成
-                        if (RemainIndex == ListA.Rows.Count - 1)
+                        string ErrorMessage = "";
+                        string result = "";
+                        if (int.Parse(mcd_remainqty.Text) <= 0)
                         {
-                            OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                            sn_code = "";
+                            macode = ma_code.Text;
+                            BaseUtil.CleanForm(this);
+                            ErrorMessage = "工单" + macode + "打印完成>>>请输入SN";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
                             return;
                         }
-                        string ErrorMessage;
-                        //获取上料需要传递的参数,sp_soncode,sp_id
-                        string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
-                        string sonID = ListA.Rows[RemainIndex]["sp_id"].ToString();
-                        //执行上料
-                        if (LogicHandler.SetMaterialUp(sn_code, ms_makecode.Text, sncode.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
-                        {
-                            RemainIndex = RemainIndex + 1;
-                            OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                        }
                         else
                         {
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                            if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
+                            {
+                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text));
+                                if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "colorbox", User.UserSourceCode, User.UserName, result, out ErrorMessage))
+                                {
+                                    ErrorMessage = "打印完成,执行更新";
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                                    mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
+                                    mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
+                                }
+                            }
+                            else
+                            {
+                                ErrorMessage = "该序列号对应的产品未维护(彩盒)标签模板或打印张数没有选择";
+                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                                return;
+                            }
+                            ErrorMessage = ">>>请输入SN";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
                         }
                     }
-                }
-            }
-        }
-
-     
-
-        //执行测试工序
-        private void DoTestProcedure()
-        {
-            //局部变量ErrorMessage1
-            string ErrorMessage1;
-            //由于打印驱动暂时不可用,暂时注释打印方法
-            if (LogicHandler.SetCollectionFinish(sncode.Text, ms_makecode.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
-            {
-                sncode.Text = "";
-                //如果值为空默认设置为0
-                if (int.Parse(mcd_remainqty.Text) > 0)
-                {
-                    dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty+1,mcd_inqty=mcd_inqty+1", "mcd_macode='" + ms_makecode.Text + "'");
-                    sql.Clear();
-                    sql.Append("select mcd_okqty,ma_qty-mcd_inqty mcd_remainqty from makecraftdetail left join make on ");
-                    sql.Append("ma_code=mcd_macode where mcd_macode='" + ms_makecode.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    if (mcd_remainqty.Text == "0")
+                    else
                     {
-                        OperateResult.AppendText(">>工单" + ms_makecode.Text + "采集完成\n", Color.Green);
-                        BaseUtil.CleanForm(this);
+                        OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
                     }
                 }
-                else
-                {
-                    BaseUtil.CleanForm(this);
-                    OperateResult.AppendText(">>该序列号所属工单" + ms_makecode.Text + "已全部采集完成\n", Color.Green);
+                else {
+                    OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
                 }
             }
-            else
-                MessageBox.Show(ErrorMessage1);
         }
-
-     
-
+        //根据产品编号获取打印模板
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标'", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -259,17 +154,14 @@ namespace UAS_MES.Make
                 ftp.Download(dt.Rows[i]["pl_labelname"].ToString());
             }
         }
-
         private void Make_ColorBoxLabelPrint_Activated(object sender, EventArgs e)
         {
             sncode.Focus();
         }
-
         private void Make_ColorBoxLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             lbl.Quit();
         }
-
         private void Make_ColorBoxLabelPrint_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);

+ 19 - 3
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -65,6 +65,9 @@ namespace UAS_MES.OQC
                     ErrorMessage = "";
                 }
             }
+            else {
+                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+            }
         }
 
         private void SaveConfiguration_Click(object sender, EventArgs e)
@@ -144,9 +147,10 @@ namespace UAS_MES.OQC
         {
             if (ob_aqlcode.Text != "" || ob_maxngacceptqty.Text != "")
             {
+                GetBatch.PerformClick();
                 SaveConfiguration.PerformClick();
                 Checkob_maxngacceptqty();
-                GetBatch.PerformClick();
+               
             }
             else
                 OperateResult.AppendText(">>AQL和最大不合格允许通过数至少填写一个\n", Color.Red);
@@ -162,8 +166,14 @@ namespace UAS_MES.OQC
             }
             else
             {
-                dh.ExecuteSql("update OQCBatch set ob_projectcode='" + ob_projectcode.Text + "',ob_remark = '" + ob_remark.Text + "',ob_aqlcode='" + ob_aqlcode.Text + "',ob_maxngacceptqty='" + ob_maxngacceptqty.Text + "' where ob_checkno='" + ob_checkno.Text + "' ", "update");
-                OperateResult.AppendText(">>保存成功\n", Color.Green);
+               int result =  (int)dh.ExecuteSql("update OQCBatch set ob_projectcode='" + ob_projectcode.Text + "',ob_remark = '" + ob_remark.Text + "',ob_aqlcode='" + ob_aqlcode.Text + "',ob_maxngacceptqty='" + ob_maxngacceptqty.Text + "' where ob_checkno='" + ob_checkno.Text + "' ", "update");
+                if (result > 0)
+                {
+                    OperateResult.AppendText(">>保存成功\n", Color.Green);
+                }
+                else {
+                    OperateResult.AppendText(">>保存失败\n", Color.Red);
+                }
             }
         }
 
@@ -188,5 +198,11 @@ namespace UAS_MES.OQC
             if (e.KeyCode == Keys.Enter)
                 GetBatch.PerformClick();
         }
+
+        private void obd_outboxcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+                GetBatch.PerformClick();
+        }
     }
 }

+ 107 - 75
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -77,9 +77,10 @@
             // 
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(526, 49);
+            this.ms_sncode_label.Location = new System.Drawing.Point(701, 61);
+            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_sncode_label.TabIndex = 152;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -87,9 +88,10 @@
             // 
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno_label.Location = new System.Drawing.Point(21, 45);
+            this.ob_checkno_label.Location = new System.Drawing.Point(28, 56);
+            this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_checkno_label.Name = "ob_checkno_label";
-            this.ob_checkno_label.Size = new System.Drawing.Size(58, 21);
+            this.ob_checkno_label.Size = new System.Drawing.Size(72, 27);
             this.ob_checkno_label.TabIndex = 154;
             this.ob_checkno_label.Text = "批次号";
             // 
@@ -100,8 +102,9 @@
             this.panel2.Controls.Add(this.label2);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1022, 33);
+            this.panel2.Size = new System.Drawing.Size(1363, 41);
             this.panel2.TabIndex = 156;
             this.panel2.Tag = "NoAuto";
             // 
@@ -110,9 +113,10 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label2.Location = new System.Drawing.Point(12, 4);
+            this.label2.Location = new System.Drawing.Point(16, 5);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(143, 21);
+            this.label2.Size = new System.Drawing.Size(177, 27);
             this.label2.TabIndex = 0;
             this.label2.Text = "OQC采样计划维护";
             // 
@@ -120,9 +124,10 @@
             // 
             this.obd_outboxcode_label.AutoSize = true;
             this.obd_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.obd_outboxcode_label.Location = new System.Drawing.Point(268, 47);
+            this.obd_outboxcode_label.Location = new System.Drawing.Point(357, 59);
+            this.obd_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.obd_outboxcode_label.Name = "obd_outboxcode_label";
-            this.obd_outboxcode_label.Size = new System.Drawing.Size(42, 21);
+            this.obd_outboxcode_label.Size = new System.Drawing.Size(52, 27);
             this.obd_outboxcode_label.TabIndex = 157;
             this.obd_outboxcode_label.Text = "箱号";
             // 
@@ -130,9 +135,10 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(21, 95);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(28, 119);
+            this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
-            this.ob_batchqty_label.Size = new System.Drawing.Size(58, 21);
+            this.ob_batchqty_label.Size = new System.Drawing.Size(72, 27);
             this.ob_batchqty_label.TabIndex = 159;
             this.ob_batchqty_label.Text = "批数量";
             // 
@@ -140,9 +146,10 @@
             // 
             this.ob_source_label.AutoSize = true;
             this.ob_source_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_source_label.Location = new System.Drawing.Point(268, 97);
+            this.ob_source_label.Location = new System.Drawing.Point(357, 121);
+            this.ob_source_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_source_label.Name = "ob_source_label";
-            this.ob_source_label.Size = new System.Drawing.Size(58, 21);
+            this.ob_source_label.Size = new System.Drawing.Size(72, 27);
             this.ob_source_label.TabIndex = 161;
             this.ob_source_label.Text = "批类型";
             // 
@@ -150,9 +157,10 @@
             // 
             this.pr_kind_label.AutoSize = true;
             this.pr_kind_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_kind_label.Location = new System.Drawing.Point(526, 98);
+            this.pr_kind_label.Location = new System.Drawing.Point(701, 122);
+            this.pr_kind_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_kind_label.Name = "pr_kind_label";
-            this.pr_kind_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_kind_label.Size = new System.Drawing.Size(92, 27);
             this.pr_kind_label.TabIndex = 165;
             this.pr_kind_label.Text = "产品类型";
             // 
@@ -160,9 +168,10 @@
             // 
             this.ob_prodcode_label.AutoSize = true;
             this.ob_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_prodcode_label.Location = new System.Drawing.Point(789, 52);
+            this.ob_prodcode_label.Location = new System.Drawing.Point(1052, 65);
+            this.ob_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_prodcode_label.Name = "ob_prodcode_label";
-            this.ob_prodcode_label.Size = new System.Drawing.Size(74, 21);
+            this.ob_prodcode_label.Size = new System.Drawing.Size(92, 27);
             this.ob_prodcode_label.TabIndex = 163;
             this.ob_prodcode_label.Text = "产品编号";
             // 
@@ -170,9 +179,10 @@
             // 
             this.ob_remark_label.AutoSize = true;
             this.ob_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_remark_label.Location = new System.Drawing.Point(39, 544);
+            this.ob_remark_label.Location = new System.Drawing.Point(52, 680);
+            this.ob_remark_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_remark_label.Name = "ob_remark_label";
-            this.ob_remark_label.Size = new System.Drawing.Size(42, 21);
+            this.ob_remark_label.Size = new System.Drawing.Size(52, 27);
             this.ob_remark_label.TabIndex = 172;
             this.ob_remark_label.Text = "备注";
             // 
@@ -180,9 +190,10 @@
             // 
             this.ob_status_label.AutoSize = true;
             this.ob_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_status_label.Location = new System.Drawing.Point(789, 98);
+            this.ob_status_label.Location = new System.Drawing.Point(1052, 122);
+            this.ob_status_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_status_label.Name = "ob_status_label";
-            this.ob_status_label.Size = new System.Drawing.Size(42, 21);
+            this.ob_status_label.Size = new System.Drawing.Size(52, 27);
             this.ob_status_label.TabIndex = 178;
             this.ob_status_label.Text = "状态";
             // 
@@ -190,9 +201,10 @@
             // 
             this.ob_maxacceptqty_label.AutoSize = true;
             this.ob_maxacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_maxacceptqty_label.Location = new System.Drawing.Point(39, 584);
+            this.ob_maxacceptqty_label.Location = new System.Drawing.Point(52, 730);
+            this.ob_maxacceptqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_maxacceptqty_label.Name = "ob_maxacceptqty_label";
-            this.ob_maxacceptqty_label.Size = new System.Drawing.Size(170, 21);
+            this.ob_maxacceptqty_label.Size = new System.Drawing.Size(212, 27);
             this.ob_maxacceptqty_label.TabIndex = 182;
             this.ob_maxacceptqty_label.Text = "最大不合格允许通过数";
             // 
@@ -200,9 +212,10 @@
             // 
             this.ob_aqlcode_label.AutoSize = true;
             this.ob_aqlcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_aqlcode_label.Location = new System.Drawing.Point(410, 544);
+            this.ob_aqlcode_label.Location = new System.Drawing.Point(547, 680);
+            this.ob_aqlcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_aqlcode_label.Name = "ob_aqlcode_label";
-            this.ob_aqlcode_label.Size = new System.Drawing.Size(42, 21);
+            this.ob_aqlcode_label.Size = new System.Drawing.Size(52, 27);
             this.ob_aqlcode_label.TabIndex = 184;
             this.ob_aqlcode_label.Text = "AQL";
             // 
@@ -210,9 +223,10 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(789, 139);
+            this.label1.Location = new System.Drawing.Point(1052, 174);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 186;
             this.label1.Text = "检验方案";
             // 
@@ -220,10 +234,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(21, 136);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(28, 170);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 188;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -234,13 +247,13 @@
             this.ob_aqlcode.Condition = null;
             this.ob_aqlcode.DBTitle = null;
             this.ob_aqlcode.FormName = null;
-            this.ob_aqlcode.Location = new System.Drawing.Point(460, 542);
-            this.ob_aqlcode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ob_aqlcode.Location = new System.Drawing.Point(613, 678);
+            this.ob_aqlcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ob_aqlcode.Name = "ob_aqlcode";
             this.ob_aqlcode.Power = null;
             this.ob_aqlcode.SelectField = null;
             this.ob_aqlcode.SetValueField = null;
-            this.ob_aqlcode.Size = new System.Drawing.Size(193, 21);
+            this.ob_aqlcode.Size = new System.Drawing.Size(257, 26);
             this.ob_aqlcode.TabIndex = 191;
             this.ob_aqlcode.TableName = null;
             this.ob_aqlcode.Tag = "AL_CODE";
@@ -252,12 +265,12 @@
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.Enabled = false;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(101, 141);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pr_detail.Location = new System.Drawing.Point(135, 176);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
             this.pr_detail.ReadOnly = true;
-            this.pr_detail.Size = new System.Drawing.Size(136, 21);
+            this.pr_detail.Size = new System.Drawing.Size(180, 25);
             this.pr_detail.Str = null;
             this.pr_detail.Str1 = null;
             this.pr_detail.Str2 = null;
@@ -271,13 +284,13 @@
             this.ob_projectcode.Condition = null;
             this.ob_projectcode.DBTitle = null;
             this.ob_projectcode.FormName = null;
-            this.ob_projectcode.Location = new System.Drawing.Point(872, 141);
-            this.ob_projectcode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ob_projectcode.Location = new System.Drawing.Point(1163, 176);
+            this.ob_projectcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ob_projectcode.Name = "ob_projectcode";
             this.ob_projectcode.Power = null;
             this.ob_projectcode.SelectField = null;
             this.ob_projectcode.SetValueField = null;
-            this.ob_projectcode.Size = new System.Drawing.Size(136, 21);
+            this.ob_projectcode.Size = new System.Drawing.Size(181, 26);
             this.ob_projectcode.TabIndex = 187;
             this.ob_projectcode.TableName = null;
             this.ob_projectcode.Tag = "pr_code";
@@ -289,10 +302,11 @@
             this.ob_status.BackColor = System.Drawing.Color.White;
             this.ob_status.Enabled = false;
             this.ob_status.ID = null;
-            this.ob_status.Location = new System.Drawing.Point(872, 98);
+            this.ob_status.Location = new System.Drawing.Point(1163, 122);
+            this.ob_status.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_status.Name = "ob_status";
             this.ob_status.Power = null;
-            this.ob_status.Size = new System.Drawing.Size(136, 21);
+            this.ob_status.Size = new System.Drawing.Size(180, 25);
             this.ob_status.Str = null;
             this.ob_status.Str1 = null;
             this.ob_status.Str2 = null;
@@ -302,9 +316,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(805, 173);
+            this.OperateResult.Location = new System.Drawing.Point(1073, 216);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(203, 318);
+            this.OperateResult.Size = new System.Drawing.Size(269, 396);
             this.OperateResult.TabIndex = 177;
             this.OperateResult.Text = "";
             // 
@@ -316,12 +331,13 @@
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(874, 498);
+            this.Clean.Location = new System.Drawing.Point(1165, 622);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(68, 24);
+            this.Clean.Size = new System.Drawing.Size(91, 30);
             this.Clean.TabIndex = 176;
             this.Clean.Tag = "";
             this.Clean.Text = "清除";
@@ -333,10 +349,11 @@
             this.ob_remark.AllPower = null;
             this.ob_remark.BackColor = System.Drawing.Color.White;
             this.ob_remark.ID = null;
-            this.ob_remark.Location = new System.Drawing.Point(102, 546);
+            this.ob_remark.Location = new System.Drawing.Point(136, 682);
+            this.ob_remark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_remark.Name = "ob_remark";
             this.ob_remark.Power = null;
-            this.ob_remark.Size = new System.Drawing.Size(282, 21);
+            this.ob_remark.Size = new System.Drawing.Size(375, 25);
             this.ob_remark.Str = null;
             this.ob_remark.Str1 = null;
             this.ob_remark.Str2 = null;
@@ -351,12 +368,13 @@
             this.GetBatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.GetBatch.Image = ((System.Drawing.Image)(resources.GetObject("GetBatch.Image")));
             this.GetBatch.IsShowBorder = true;
-            this.GetBatch.Location = new System.Drawing.Point(507, 136);
+            this.GetBatch.Location = new System.Drawing.Point(676, 170);
+            this.GetBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.GetBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.MoveImage")));
             this.GetBatch.Name = "GetBatch";
             this.GetBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.NormalImage")));
             this.GetBatch.Power = "ifRead";
-            this.GetBatch.Size = new System.Drawing.Size(68, 24);
+            this.GetBatch.Size = new System.Drawing.Size(91, 30);
             this.GetBatch.TabIndex = 171;
             this.GetBatch.Tag = "OQC!Inspection";
             this.GetBatch.Text = "获取批";
@@ -371,12 +389,13 @@
             this.SaveConfiguration.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.SaveConfiguration.Image = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.Image")));
             this.SaveConfiguration.IsShowBorder = true;
-            this.SaveConfiguration.Location = new System.Drawing.Point(299, 507);
+            this.SaveConfiguration.Location = new System.Drawing.Point(399, 634);
+            this.SaveConfiguration.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.SaveConfiguration.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.MoveImage")));
             this.SaveConfiguration.Name = "SaveConfiguration";
             this.SaveConfiguration.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.NormalImage")));
             this.SaveConfiguration.Power = "ifWrite";
-            this.SaveConfiguration.Size = new System.Drawing.Size(68, 24);
+            this.SaveConfiguration.Size = new System.Drawing.Size(91, 30);
             this.SaveConfiguration.TabIndex = 170;
             this.SaveConfiguration.Tag = "OQC!Inspection";
             this.SaveConfiguration.Text = "保存配置";
@@ -391,12 +410,13 @@
             this.RefreshConfiguration.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.RefreshConfiguration.Image = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.Image")));
             this.RefreshConfiguration.IsShowBorder = true;
-            this.RefreshConfiguration.Location = new System.Drawing.Point(460, 507);
+            this.RefreshConfiguration.Location = new System.Drawing.Point(613, 634);
+            this.RefreshConfiguration.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.RefreshConfiguration.MoveImage = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.MoveImage")));
             this.RefreshConfiguration.Name = "RefreshConfiguration";
             this.RefreshConfiguration.NormalImage = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.NormalImage")));
             this.RefreshConfiguration.Power = "ifRead";
-            this.RefreshConfiguration.Size = new System.Drawing.Size(68, 24);
+            this.RefreshConfiguration.Size = new System.Drawing.Size(91, 30);
             this.RefreshConfiguration.TabIndex = 169;
             this.RefreshConfiguration.Tag = "OQC!Inspection";
             this.RefreshConfiguration.Text = "刷新配置";
@@ -411,12 +431,13 @@
             this.Save.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Save.Image = ((System.Drawing.Image)(resources.GetObject("Save.Image")));
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(413, 583);
+            this.Save.Location = new System.Drawing.Point(551, 729);
+            this.Save.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = "ifWrite";
-            this.Save.Size = new System.Drawing.Size(70, 24);
+            this.Save.Size = new System.Drawing.Size(93, 30);
             this.Save.TabIndex = 168;
             this.Save.Tag = "OQC!Inspection";
             this.Save.Text = "保存";
@@ -433,10 +454,11 @@
             this.ci_id,
             this.ci_kind,
             this.oi_sampleqty});
-            this.CheckTypeDGV.Location = new System.Drawing.Point(43, 173);
+            this.CheckTypeDGV.Location = new System.Drawing.Point(57, 216);
+            this.CheckTypeDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.CheckTypeDGV.Name = "CheckTypeDGV";
             this.CheckTypeDGV.RowTemplate.Height = 23;
-            this.CheckTypeDGV.Size = new System.Drawing.Size(745, 318);
+            this.CheckTypeDGV.Size = new System.Drawing.Size(993, 398);
             this.CheckTypeDGV.TabIndex = 167;
             this.CheckTypeDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellContentClick);
             // 
@@ -489,11 +511,12 @@
             this.pr_kind.BackColor = System.Drawing.Color.White;
             this.pr_kind.Enabled = false;
             this.pr_kind.ID = null;
-            this.pr_kind.Location = new System.Drawing.Point(608, 98);
+            this.pr_kind.Location = new System.Drawing.Point(811, 122);
+            this.pr_kind.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pr_kind.Name = "pr_kind";
             this.pr_kind.Power = null;
             this.pr_kind.ReadOnly = true;
-            this.pr_kind.Size = new System.Drawing.Size(136, 21);
+            this.pr_kind.Size = new System.Drawing.Size(180, 25);
             this.pr_kind.Str = null;
             this.pr_kind.Str1 = null;
             this.pr_kind.Str2 = null;
@@ -506,10 +529,11 @@
             this.ob_prodcode.BackColor = System.Drawing.Color.White;
             this.ob_prodcode.Enabled = false;
             this.ob_prodcode.ID = null;
-            this.ob_prodcode.Location = new System.Drawing.Point(872, 54);
+            this.ob_prodcode.Location = new System.Drawing.Point(1163, 68);
+            this.ob_prodcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_prodcode.Name = "ob_prodcode";
             this.ob_prodcode.Power = null;
-            this.ob_prodcode.Size = new System.Drawing.Size(136, 21);
+            this.ob_prodcode.Size = new System.Drawing.Size(180, 25);
             this.ob_prodcode.Str = null;
             this.ob_prodcode.Str1 = null;
             this.ob_prodcode.Str2 = null;
@@ -522,10 +546,11 @@
             this.ob_source.BackColor = System.Drawing.Color.White;
             this.ob_source.Enabled = false;
             this.ob_source.ID = null;
-            this.ob_source.Location = new System.Drawing.Point(347, 97);
+            this.ob_source.Location = new System.Drawing.Point(463, 121);
+            this.ob_source.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_source.Name = "ob_source";
             this.ob_source.Power = null;
-            this.ob_source.Size = new System.Drawing.Size(136, 21);
+            this.ob_source.Size = new System.Drawing.Size(180, 25);
             this.ob_source.Str = null;
             this.ob_source.Str1 = null;
             this.ob_source.Str2 = null;
@@ -538,11 +563,12 @@
             this.ob_batchqty.BackColor = System.Drawing.Color.White;
             this.ob_batchqty.Enabled = false;
             this.ob_batchqty.ID = null;
-            this.ob_batchqty.Location = new System.Drawing.Point(101, 97);
+            this.ob_batchqty.Location = new System.Drawing.Point(135, 121);
+            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
             this.ob_batchqty.ReadOnly = true;
-            this.ob_batchqty.Size = new System.Drawing.Size(136, 21);
+            this.ob_batchqty.Size = new System.Drawing.Size(180, 25);
             this.ob_batchqty.Str = null;
             this.ob_batchqty.Str1 = null;
             this.ob_batchqty.Str2 = null;
@@ -554,25 +580,28 @@
             this.obd_outboxcode.AllPower = null;
             this.obd_outboxcode.BackColor = System.Drawing.Color.White;
             this.obd_outboxcode.ID = null;
-            this.obd_outboxcode.Location = new System.Drawing.Point(347, 49);
+            this.obd_outboxcode.Location = new System.Drawing.Point(463, 61);
+            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.obd_outboxcode.Name = "obd_outboxcode";
             this.obd_outboxcode.Power = null;
-            this.obd_outboxcode.Size = new System.Drawing.Size(136, 21);
+            this.obd_outboxcode.Size = new System.Drawing.Size(180, 25);
             this.obd_outboxcode.Str = null;
             this.obd_outboxcode.Str1 = null;
             this.obd_outboxcode.Str2 = null;
             this.obd_outboxcode.TabIndex = 158;
             this.obd_outboxcode.Tag = "NoAuto";
+            this.obd_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.obd_outboxcode_KeyDown);
             // 
             // ob_checkno
             // 
             this.ob_checkno.AllPower = null;
             this.ob_checkno.BackColor = System.Drawing.Color.White;
             this.ob_checkno.ID = null;
-            this.ob_checkno.Location = new System.Drawing.Point(101, 47);
+            this.ob_checkno.Location = new System.Drawing.Point(135, 59);
+            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Power = null;
-            this.ob_checkno.Size = new System.Drawing.Size(136, 21);
+            this.ob_checkno.Size = new System.Drawing.Size(180, 25);
             this.ob_checkno.Str = null;
             this.ob_checkno.Str1 = null;
             this.ob_checkno.Str2 = null;
@@ -585,10 +614,11 @@
             this.ms_sncode.AllPower = null;
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(608, 51);
+            this.ms_sncode.Location = new System.Drawing.Point(811, 64);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(136, 21);
+            this.ms_sncode.Size = new System.Drawing.Size(180, 25);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
@@ -598,17 +628,18 @@
             // 
             // ob_maxngacceptqty
             // 
-            this.ob_maxngacceptqty.Location = new System.Drawing.Point(215, 584);
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(287, 730);
+            this.ob_maxngacceptqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
-            this.ob_maxngacceptqty.Size = new System.Drawing.Size(169, 21);
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(224, 25);
             this.ob_maxngacceptqty.TabIndex = 192;
             this.ob_maxngacceptqty.Text = "0";
             // 
             // OQC_PlanMaintain
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1022, 616);
+            this.ClientSize = new System.Drawing.Size(1363, 770);
             this.Controls.Add(this.ob_maxngacceptqty);
             this.Controls.Add(this.ob_aqlcode);
             this.Controls.Add(this.pr_detail);
@@ -644,6 +675,7 @@
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.ms_sncode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "OQC_PlanMaintain";
             this.Tag = "OQC!PlanMaintain";
             this.Text = "抽样计划维护";

+ 0 - 15
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.resx

@@ -788,19 +788,4 @@
   <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="Choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ci_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ci_kind.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 1 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -524,7 +524,7 @@ namespace UAS_MES.PublicMethod
         {
             for (int i = 0; i < Form.Controls.Count; i++)
             {
-                if (Form.Controls[i] is EnterTextBox || Form.Controls[i] is TextBox || Form.Controls[i] is ValueLabel || Form.Controls[i] is SearchTextBox)
+                if (Form.Controls[i] is EnterTextBox || Form.Controls[i] is TextBox || Form.Controls[i] is ValueLabel || Form.Controls[i] is SearchTextBox || Form.Controls[i] is ValueNumLabel || Form.Controls[i] is MaCodeSearchTextBox)
                     Form.Controls[i].Text = "";
                 if (Form.Controls[i] is DataGridView)
                     CleanDGVData((DataGridView)Form.Controls[i]);