فهرست منبع

价签醒码界面修改,多联标签打印,维修采集

callm 1 سال پیش
والد
کامیت
a8e3809510

+ 2 - 2
UAS_MES_LGDZ/FunctionCode/Make/Make_TestCollection_JIAQIAN.cs

@@ -386,7 +386,7 @@ namespace UAS_MES_NEW.Make
                     else
                     {
                         //良品信息采集
-                        if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
+                        if (LogicHandler.SetStepResult1(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
                         {
                             if (IfTest.Checked)
                             {
@@ -408,7 +408,7 @@ namespace UAS_MES_NEW.Make
                 {
                     if (reworkstatus != "3")
                     {
-                        if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
+                        if (LogicHandler.SetStepResult1(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
                         {
                             //提示正确返回时传递的信息
                             if (ErrorMessage.Contains("AFTERSUCCESS"))

+ 62 - 18
UAS_MES_LGDZ/FunctionCode/Query/Query_SN.Designer.cs

@@ -51,14 +51,18 @@
             this.PrintFuseLabel = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.RePrintSn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.SingleRowCount = new System.Windows.Forms.NumericUpDown();
+            this.PrintNums = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.SingleRowCount)).BeginInit();
             this.SuspendLayout();
             // 
             // label5
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(120, 172);
+            this.label5.Location = new System.Drawing.Point(79, 172);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(146, 41);
@@ -69,7 +73,7 @@
             // 
             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(120, 39);
+            this.label1.Location = new System.Drawing.Point(79, 39);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(146, 41);
@@ -80,7 +84,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(152, 298);
+            this.label2.Location = new System.Drawing.Point(111, 298);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(114, 41);
@@ -91,7 +95,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(184, 369);
+            this.label3.Location = new System.Drawing.Point(143, 369);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(82, 41);
@@ -100,7 +104,7 @@
             // 
             // PrintNum
             // 
-            this.PrintNum.Location = new System.Drawing.Point(305, 460);
+            this.PrintNum.Location = new System.Drawing.Point(264, 460);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Size = new System.Drawing.Size(120, 35);
             this.PrintNum.TabIndex = 222;
@@ -109,7 +113,7 @@
             // 
             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(120, 454);
+            this.label4.Location = new System.Drawing.Point(79, 454);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(146, 41);
@@ -120,7 +124,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(120, 237);
+            this.label6.Location = new System.Drawing.Point(79, 237);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(146, 41);
@@ -131,7 +135,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(298, 237);
+            this.pr_detail.Location = new System.Drawing.Point(257, 237);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 41);
@@ -141,7 +145,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(120, 105);
+            this.label7.Location = new System.Drawing.Point(79, 105);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(146, 41);
@@ -152,7 +156,7 @@
             // 
             this.lade.AutoSize = true;
             this.lade.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lade.Location = new System.Drawing.Point(441, 105);
+            this.lade.Location = new System.Drawing.Point(400, 105);
             this.lade.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.lade.Name = "lade";
             this.lade.Size = new System.Drawing.Size(146, 41);
@@ -163,7 +167,7 @@
             // 
             this.ma_qty.AutoSize = true;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(298, 105);
+            this.ma_qty.Location = new System.Drawing.Point(257, 105);
             this.ma_qty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_qty.Name = "ma_qty";
             this.ma_qty.Size = new System.Drawing.Size(0, 41);
@@ -173,7 +177,7 @@
             // 
             this.ma_printcount.AutoSize = true;
             this.ma_printcount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_printcount.Location = new System.Drawing.Point(599, 105);
+            this.ma_printcount.Location = new System.Drawing.Point(558, 105);
             this.ma_printcount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_printcount.Name = "ma_printcount";
             this.ma_printcount.Size = new System.Drawing.Size(0, 41);
@@ -184,7 +188,7 @@
             this.pr_code.AllPower = null;
             this.pr_code.BackColor = System.Drawing.Color.White;
             this.pr_code.ID = null;
-            this.pr_code.Location = new System.Drawing.Point(305, 181);
+            this.pr_code.Location = new System.Drawing.Point(264, 181);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
             this.pr_code.Size = new System.Drawing.Size(388, 35);
@@ -208,7 +212,7 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(305, 375);
+            this.PrintLabel.Location = new System.Drawing.Point(264, 375);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(388, 32);
@@ -216,7 +220,7 @@
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(305, 304);
+            this.PrinterList.Location = new System.Drawing.Point(264, 304);
             this.PrinterList.Margin = new System.Windows.Forms.Padding(8);
             this.PrinterList.Name = "PrinterList";
             this.PrinterList.Size = new System.Drawing.Size(388, 50);
@@ -230,7 +234,7 @@
             this.ma_code.DBTitle = "";
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(305, 39);
+            this.ma_code.Location = new System.Drawing.Point(264, 39);
             this.ma_code.Margin = new System.Windows.Forms.Padding(6);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = "";
@@ -269,7 +273,7 @@
             this.RePrintSn.AllPower = null;
             this.RePrintSn.BackColor = System.Drawing.Color.White;
             this.RePrintSn.ID = null;
-            this.RePrintSn.Location = new System.Drawing.Point(305, 559);
+            this.RePrintSn.Location = new System.Drawing.Point(264, 611);
             this.RePrintSn.Name = "RePrintSn";
             this.RePrintSn.Power = null;
             this.RePrintSn.Size = new System.Drawing.Size(388, 35);
@@ -282,18 +286,54 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label8.Location = new System.Drawing.Point(76, 553);
+            this.label8.Location = new System.Drawing.Point(35, 605);
             this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(190, 41);
             this.label8.TabIndex = 232;
             this.label8.Text = "补打SN号码";
             // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(88, 538);
+            this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(146, 41);
+            this.label9.TabIndex = 235;
+            this.label9.Text = "单排数量";
+            // 
+            // SingleRowCount
+            // 
+            this.SingleRowCount.Location = new System.Drawing.Point(264, 544);
+            this.SingleRowCount.Name = "SingleRowCount";
+            this.SingleRowCount.Size = new System.Drawing.Size(120, 35);
+            this.SingleRowCount.TabIndex = 234;
+            this.SingleRowCount.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // PrintNums
+            // 
+            this.PrintNums.AutoSize = true;
+            this.PrintNums.Location = new System.Drawing.Point(432, 549);
+            this.PrintNums.Name = "PrintNums";
+            this.PrintNums.Size = new System.Drawing.Size(186, 28);
+            this.PrintNums.TabIndex = 236;
+            this.PrintNums.Text = "打印多联标签";
+            this.PrintNums.UseVisualStyleBackColor = true;
+            // 
             // Query_SN
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.Controls.Add(this.PrintNums);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.SingleRowCount);
             this.Controls.Add(this.RePrintSn);
             this.Controls.Add(this.label8);
             this.Controls.Add(this.ma_printcount);
@@ -321,6 +361,7 @@
             this.Text = "Query_SpecialReport";
             this.Load += new System.EventHandler(this.Query_SpecialReport_Load);
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.SingleRowCount)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -348,5 +389,8 @@
         private System.Windows.Forms.Label ma_printcount;
         private CustomControl.TextBoxWithIcon.EnterTextBox RePrintSn;
         private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.NumericUpDown SingleRowCount;
+        private System.Windows.Forms.CheckBox PrintNums;
     }
 }

+ 79 - 32
UAS_MES_LGDZ/FunctionCode/Query/Query_SN.cs

@@ -81,60 +81,107 @@ namespace UAS_MES_NEW.Query
         {
             DataTable dt = new DataTable();
             string ErrorMessage = "";
-            if (RePrintSn.Text == "")
+            if (!PrintNums.Checked)
             {
-                dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_makecode='" + ma_code.Text + "' and nvl(mil_printstatus,0)=0 order by mil_sncode", "select");
-                if (dt.Rows.Count < PrintNum.Value)
+                if (RePrintSn.Text == "")
                 {
-                    OperateResult.AppendText("未打印数量不足,剩余" + dt.Rows.Count + "未打印\n");
-                    return;
+                    dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist where msl_makecode='" + ma_code.Text + "' and nvl(msl_printstatus,0)=0   order by msl_sncode", "select");
+                    if (dt.Rows.Count < PrintNum.Value)
+                    {
+                        OperateResult.AppendText("未打印数量不足,剩余" + dt.Rows.Count + "未打印\n");
+                        return;
+                    }
+                    for (int i = 0; i < PrintNum.Value; i++)
+                    {
+                        string mil_sncode = dt.Rows[i]["msl_sncode"].ToString();
+                        if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, mil_sncode, int.Parse("1"), ma_code.Text, pr_code.Text, "机身标", "0", out ErrorMessage))
+                        {
+                            //提示用户打印成功
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green);
+                        }
+                        else
+                        {
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        }
+                    }
+                    dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                        ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                        ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                        pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                    }
                 }
-                for (int i = 0; i < PrintNum.Value; i++)
+                else
                 {
-                    string mil_sncode = dt.Rows[i]["mil_sncode"].ToString();
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, mil_sncode, int.Parse("1"), ma_code.Text, pr_code.Text, "机身标", "0", out ErrorMessage))
+                    dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist where msl_makecode='" + ma_code.Text + "' and msl_sncode='" + RePrintSn.Text + "' order by msl_sncode", "select");
+                    if (dt.Rows.Count > 0)
                     {
-                        //提示用户打印成功
-                        dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
-                        OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green);
+                        string mil_sncode = dt.Rows[0]["msl_sncode"].ToString();
+                        if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, mil_sncode, int.Parse("1"), ma_code.Text, pr_code.Text, "机身标", "0", out ErrorMessage))
+                        {
+                            //提示用户打印成功
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green);
+                        }
+                        else
+                        {
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        }
                     }
                     else
                     {
-                        dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        OperateResult.AppendText("序列号:" + RePrintSn.Text + "不在工单" + ma_code.Text + "\n", Color.Red, RePrintSn);
                     }
                 }
-                dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,mil_makecode from makeimeilist where mil_printstatus=-1 group by mil_makecode) on mil_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
-                if (dt.Rows.Count > 0)
-                {
-                    pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
-                    ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
-                    ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
-                    pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
-                }
-
             }
             else
             {
-                dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_makecode='" + ma_code.Text + "' and mil_sncode='" + RePrintSn.Text + "' order by mil_sncode", "select");
-                if (dt.Rows.Count > 0)
+                dh.ExecuteSql("update make set ma_printqty='" + SingleRowCount.Value + "' where ma_code='" + ma_code.Text + "'", "update");
+                dt = (DataTable)dh.ExecuteSql("select msl_sncode from (select msl_sncode from makesnlist where msl_makecode='" + ma_code.Text + "' and nvl(msl_printstatus,0)=0   order by msl_sncode) where   rownum<='" + PrintNum.Value * SingleRowCount.Value + "'", "select");
+                decimal rowcount = 0;
+                for (int i = 0; i < dt.Rows.Count; i = i + 1)
                 {
-                    string mil_sncode = dt.Rows[0]["mil_sncode"].ToString();
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, mil_sncode, int.Parse("1"), ma_code.Text, pr_code.Text, "机身标", "-1", out ErrorMessage))
+                    string mil_sncode = dt.Rows[i]["msl_sncode"].ToString();
+                    if (rowcount % SingleRowCount.Value == 0)
                     {
-                        //提示用户打印成功
-                        dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
-                        OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green, RePrintSn);
+                        if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, mil_sncode, int.Parse("1"), ma_code.Text, pr_code.Text, "机身标", "0", out ErrorMessage))
+                        {
+                            //提示用户打印成功
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green);
+                        }
+                        else
+                        {
+                            dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
+                            dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        }
                     }
                     else
                     {
                         dh.ExecuteSql("update makeimeilist set mil_printstatus=-1 where mil_sncode='" + mil_sncode + "'", "update");
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, RePrintSn);
+                        dh.ExecuteSql("update makesnlist set msl_printstatus=-1 where msl_sncode='" + mil_sncode + "'", "update");
+                        OperateResult.AppendText(">>序列号:" + mil_sncode + "打印结束\n", Color.Green);
                     }
+                    rowcount = rowcount + 1;
                 }
-                else
+                dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                if (dt.Rows.Count > 0)
                 {
-                    OperateResult.AppendText("序列号:" + RePrintSn.Text + "不在工单" + ma_code.Text + "\n", Color.Red, RePrintSn);
+                    pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                    ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                    ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                    pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
                 }
             }
         }

+ 202 - 126
UAS_MES_LGDZ/FunctionCode/Special/Special_MakeBad.Designer.cs

@@ -30,19 +30,24 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_MakeBad));
             this.Pallet_label = new System.Windows.Forms.Label();
-            this.Pallate = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.mbc_component = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
-            this.mbr_dutyname = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
-            this.so_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
-            this.nr_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
-            this.nrg_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
             this.bc_code = new System.Windows.Forms.Label();
-            this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.mbr_solution_label = new System.Windows.Forms.Label();
             this.mbc_component_label = new System.Windows.Forms.Label();
             this.mbr_dutycode_label = new System.Windows.Forms.Label();
             this.nr_name_label = new System.Windows.Forms.Label();
             this.mbr_brgcode_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.mb_badlocation = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.li_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.mbr_dutyname = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
+            this.so_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
+            this.nr_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
+            this.nrg_name = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.BlurSearch();
+            this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             // 
             // Pallet_label
@@ -56,48 +61,166 @@
             this.Pallet_label.TabIndex = 1;
             this.Pallet_label.Text = "条码号";
             // 
-            // Pallate
-            // 
-            this.Pallate.AllPower = null;
-            this.Pallate.BackColor = System.Drawing.Color.White;
-            this.Pallate.ID = null;
-            this.Pallate.Location = new System.Drawing.Point(211, 308);
-            this.Pallate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Pallate.Name = "Pallate";
-            this.Pallate.Power = null;
-            this.Pallate.Size = new System.Drawing.Size(242, 35);
-            this.Pallate.Str = null;
-            this.Pallate.Str1 = null;
-            this.Pallate.Str2 = null;
-            this.Pallate.TabIndex = 2;
-            // 
-            // mbc_component
-            // 
-            this.mbc_component.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.mbc_component.FormattingEnabled = true;
-            this.mbc_component.Items.AddRange(new object[] {
-            "",
-            "主板",
-            "液晶屏",
-            "喇叭",
-            "摄像头",
-            "MIC板",
-            "底壳",
-            "电池",
-            "面壳",
-            "天线/喇叭支架",
-            "A壳组件",
-            "B壳组件",
-            "C壳组件",
-            "D壳组件",
-            "通讯小板",
-            "接口小板",
-            "其他"});
-            this.mbc_component.Location = new System.Drawing.Point(211, 477);
-            this.mbc_component.Margin = new System.Windows.Forms.Padding(6);
-            this.mbc_component.Name = "mbc_component";
-            this.mbc_component.Size = new System.Drawing.Size(238, 32);
-            this.mbc_component.TabIndex = 155;
+            // bc_code
+            // 
+            this.bc_code.AutoSize = true;
+            this.bc_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bc_code.ForeColor = System.Drawing.Color.Black;
+            this.bc_code.Location = new System.Drawing.Point(1391, 507);
+            this.bc_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.bc_code.Name = "bc_code";
+            this.bc_code.Size = new System.Drawing.Size(0, 41);
+            this.bc_code.TabIndex = 146;
+            this.bc_code.Visible = false;
+            // 
+            // mbr_solution_label
+            // 
+            this.mbr_solution_label.AutoSize = true;
+            this.mbr_solution_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbr_solution_label.ForeColor = System.Drawing.Color.Black;
+            this.mbr_solution_label.Location = new System.Drawing.Point(472, 475);
+            this.mbr_solution_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_solution_label.Name = "mbr_solution_label";
+            this.mbr_solution_label.Size = new System.Drawing.Size(146, 41);
+            this.mbr_solution_label.TabIndex = 144;
+            this.mbr_solution_label.Text = "解决方案";
+            // 
+            // mbc_component_label
+            // 
+            this.mbc_component_label.AutoSize = true;
+            this.mbc_component_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbc_component_label.ForeColor = System.Drawing.Color.Black;
+            this.mbc_component_label.Location = new System.Drawing.Point(13, 477);
+            this.mbc_component_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbc_component_label.Name = "mbc_component_label";
+            this.mbc_component_label.Size = new System.Drawing.Size(82, 41);
+            this.mbc_component_label.TabIndex = 143;
+            this.mbc_component_label.Text = "位号";
+            // 
+            // mbr_dutycode_label
+            // 
+            this.mbr_dutycode_label.AutoSize = true;
+            this.mbr_dutycode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbr_dutycode_label.ForeColor = System.Drawing.Color.Black;
+            this.mbr_dutycode_label.Location = new System.Drawing.Point(942, 395);
+            this.mbr_dutycode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_dutycode_label.Name = "mbr_dutycode_label";
+            this.mbr_dutycode_label.Size = new System.Drawing.Size(114, 41);
+            this.mbr_dutycode_label.TabIndex = 142;
+            this.mbr_dutycode_label.Text = "责任别";
+            // 
+            // nr_name_label
+            // 
+            this.nr_name_label.AutoSize = true;
+            this.nr_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.nr_name_label.ForeColor = System.Drawing.Color.Black;
+            this.nr_name_label.Location = new System.Drawing.Point(472, 393);
+            this.nr_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.nr_name_label.Name = "nr_name_label";
+            this.nr_name_label.Size = new System.Drawing.Size(146, 41);
+            this.nr_name_label.TabIndex = 141;
+            this.nr_name_label.Text = "不良原因";
+            // 
+            // mbr_brgcode_label
+            // 
+            this.mbr_brgcode_label.AutoSize = true;
+            this.mbr_brgcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbr_brgcode_label.ForeColor = System.Drawing.Color.Black;
+            this.mbr_brgcode_label.Location = new System.Drawing.Point(13, 393);
+            this.mbr_brgcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_brgcode_label.Name = "mbr_brgcode_label";
+            this.mbr_brgcode_label.Size = new System.Drawing.Size(178, 41);
+            this.mbr_brgcode_label.TabIndex = 140;
+            this.mbr_brgcode_label.Text = "不良原因组";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(15, 216);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 235;
+            this.label2.Text = "工单编号";
+            // 
+            // label1
+            // 
+            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(472, 216);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.TabIndex = 237;
+            this.label1.Text = "线别编号";
+            // 
+            // 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(1352, 146);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(410, 610);
+            this.OperateResult.TabIndex = 240;
+            this.OperateResult.Text = "";
+            // 
+            // mb_badlocation
+            // 
+            this.mb_badlocation.AllPower = null;
+            this.mb_badlocation.BackColor = System.Drawing.Color.White;
+            this.mb_badlocation.ID = null;
+            this.mb_badlocation.Location = new System.Drawing.Point(211, 483);
+            this.mb_badlocation.Margin = new System.Windows.Forms.Padding(4);
+            this.mb_badlocation.Name = "mb_badlocation";
+            this.mb_badlocation.Power = null;
+            this.mb_badlocation.Size = new System.Drawing.Size(242, 35);
+            this.mb_badlocation.Str = null;
+            this.mb_badlocation.Str1 = null;
+            this.mb_badlocation.Str2 = null;
+            this.mb_badlocation.TabIndex = 239;
+            // 
+            // li_code
+            // 
+            this.li_code.AllPower = "IFALL";
+            this.li_code.Caller = null;
+            this.li_code.Condition = null;
+            this.li_code.DBTitle = "";
+            this.li_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.li_code.FormName = null;
+            this.li_code.Location = new System.Drawing.Point(648, 216);
+            this.li_code.Margin = new System.Windows.Forms.Padding(6);
+            this.li_code.Name = "li_code";
+            this.li_code.Power = "";
+            this.li_code.ReturnData = null;
+            this.li_code.SelectField = null;
+            this.li_code.SetValueField = null;
+            this.li_code.Size = new System.Drawing.Size(244, 46);
+            this.li_code.TabIndex = 238;
+            this.li_code.TableName = null;
+            this.li_code.Tag = "makecode";
+            this.li_code.TextBoxEnable = true;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = "IFALL";
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = "";
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(209, 216);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = "";
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(244, 46);
+            this.ma_code.TabIndex = 236;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "makecode";
+            this.ma_code.TextBoxEnable = true;
             // 
             // mbr_dutyname
             // 
@@ -151,18 +274,6 @@
             this.nrg_name.Value = null;
             this.nrg_name.ValueField = null;
             // 
-            // bc_code
-            // 
-            this.bc_code.AutoSize = true;
-            this.bc_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bc_code.ForeColor = System.Drawing.Color.Black;
-            this.bc_code.Location = new System.Drawing.Point(1391, 507);
-            this.bc_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.bc_code.Name = "bc_code";
-            this.bc_code.Size = new System.Drawing.Size(0, 41);
-            this.bc_code.TabIndex = 146;
-            this.bc_code.Visible = false;
-            // 
             // SaveRepairInf
             // 
             this.SaveRepairInf.AllPower = "ifall";
@@ -183,72 +294,32 @@
             this.SaveRepairInf.UseVisualStyleBackColor = true;
             this.SaveRepairInf.Click += new System.EventHandler(this.SaveRepairInf_Click);
             // 
-            // mbr_solution_label
-            // 
-            this.mbr_solution_label.AutoSize = true;
-            this.mbr_solution_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbr_solution_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_solution_label.Location = new System.Drawing.Point(472, 475);
-            this.mbr_solution_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mbr_solution_label.Name = "mbr_solution_label";
-            this.mbr_solution_label.Size = new System.Drawing.Size(146, 41);
-            this.mbr_solution_label.TabIndex = 144;
-            this.mbr_solution_label.Text = "解决方案";
-            // 
-            // mbc_component_label
+            // sn_code
             // 
-            this.mbc_component_label.AutoSize = true;
-            this.mbc_component_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbc_component_label.ForeColor = System.Drawing.Color.Black;
-            this.mbc_component_label.Location = new System.Drawing.Point(13, 477);
-            this.mbc_component_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mbc_component_label.Name = "mbc_component_label";
-            this.mbc_component_label.Size = new System.Drawing.Size(146, 41);
-            this.mbc_component_label.TabIndex = 143;
-            this.mbc_component_label.Text = "不良组件";
-            // 
-            // mbr_dutycode_label
-            // 
-            this.mbr_dutycode_label.AutoSize = true;
-            this.mbr_dutycode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbr_dutycode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_dutycode_label.Location = new System.Drawing.Point(942, 395);
-            this.mbr_dutycode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mbr_dutycode_label.Name = "mbr_dutycode_label";
-            this.mbr_dutycode_label.Size = new System.Drawing.Size(114, 41);
-            this.mbr_dutycode_label.TabIndex = 142;
-            this.mbr_dutycode_label.Text = "责任别";
-            // 
-            // nr_name_label
-            // 
-            this.nr_name_label.AutoSize = true;
-            this.nr_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.nr_name_label.ForeColor = System.Drawing.Color.Black;
-            this.nr_name_label.Location = new System.Drawing.Point(472, 393);
-            this.nr_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.nr_name_label.Name = "nr_name_label";
-            this.nr_name_label.Size = new System.Drawing.Size(146, 41);
-            this.nr_name_label.TabIndex = 141;
-            this.nr_name_label.Text = "不良原因";
-            // 
-            // mbr_brgcode_label
-            // 
-            this.mbr_brgcode_label.AutoSize = true;
-            this.mbr_brgcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbr_brgcode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_brgcode_label.Location = new System.Drawing.Point(13, 393);
-            this.mbr_brgcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.mbr_brgcode_label.Name = "mbr_brgcode_label";
-            this.mbr_brgcode_label.Size = new System.Drawing.Size(178, 41);
-            this.mbr_brgcode_label.TabIndex = 140;
-            this.mbr_brgcode_label.Text = "不良原因组";
+            this.sn_code.AllPower = null;
+            this.sn_code.BackColor = System.Drawing.Color.White;
+            this.sn_code.ID = null;
+            this.sn_code.Location = new System.Drawing.Point(211, 308);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = null;
+            this.sn_code.Size = new System.Drawing.Size(242, 35);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 2;
             // 
             // Special_MakeBad
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1384, 1054);
-            this.Controls.Add(this.mbc_component);
+            this.ClientSize = new System.Drawing.Size(1797, 1054);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.mb_badlocation);
+            this.Controls.Add(this.li_code);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.mbr_dutyname);
             this.Controls.Add(this.so_name);
             this.Controls.Add(this.nr_name);
@@ -260,12 +331,12 @@
             this.Controls.Add(this.mbr_dutycode_label);
             this.Controls.Add(this.nr_name_label);
             this.Controls.Add(this.mbr_brgcode_label);
-            this.Controls.Add(this.Pallate);
+            this.Controls.Add(this.sn_code);
             this.Controls.Add(this.Pallet_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Special_MakeBad";
-            this.Tag = "Special!BoxSplit";
+            this.Tag = "Special!MakeBad";
             this.Text = "拆箱处理";
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.ResumeLayout(false);
@@ -275,8 +346,7 @@
 
         #endregion
         private System.Windows.Forms.Label Pallet_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox Pallate;
-        private CustomControl.ComBoxWithFocus.ComBoxWithFocus mbc_component;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sn_code;
         private CustomControl.TextBoxWithIcon.BlurSearch mbr_dutyname;
         private CustomControl.TextBoxWithIcon.BlurSearch so_name;
         private CustomControl.TextBoxWithIcon.BlurSearch nr_name;
@@ -288,5 +358,11 @@
         private System.Windows.Forms.Label mbr_dutycode_label;
         private System.Windows.Forms.Label nr_name_label;
         private System.Windows.Forms.Label mbr_brgcode_label;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.TextBoxWithIcon.SearchTextBox li_code;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox mb_badlocation;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
     }
 }

+ 48 - 1
UAS_MES_LGDZ/FunctionCode/Special/Special_MakeBad.cs

@@ -3,6 +3,7 @@ using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
 using UAS_MES_NEW.PublicMethod;
+using static DevExpress.Utils.Drawing.Helpers.NativeMethods;
 
 namespace UAS_MES_NEW.Special
 {
@@ -20,6 +21,41 @@ namespace UAS_MES_NEW.Special
         private void Special_BoxSplit_Load(object sender, EventArgs e)
         {
             dh = SystemInf.dh;
+
+            ma_code.TableName = "make left join product on pr_code=ma_prodcode";
+            ma_code.DBTitle = "工单号查询";
+            ma_code.SelectField = "ma_code # 工单号,ma_qty  # 工单数量,pr_detail # 产品名称,pr_code # 产品编号";
+            ma_code.SetValueField = new string[] { "ma_code", "pr_detail", "pr_code" };
+            ma_code.FormName = Name;
+
+            li_code.TableName = "line";
+            li_code.Condition = "li_code like '%贴片%'";
+            li_code.DBTitle = "线别查询";
+            li_code.SelectField = "li_code # 线别编号";
+            li_code.SetValueField = new string[] { "li_code" };
+            li_code.FormName = Name;
+
+            nrg_name.TableName = "(select nrg_name,nrg_code from QUA_NGREASONGROUP left join DATAINPUTRECORD ON NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
+            nrg_name.Field = "nrg_name";
+            nrg_name.ValueField = "nrg_code";
+            nrg_name.Condition = " 1=1 ORDER BY ROWNUM asc";
+
+            nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and  DIR_SOURCECODE = '" + User.UserSourceCode + "' ";
+            nr_name.Field = "nr_name";
+            nr_name.ValueField = "nr_code";
+
+            mbr_dutyname.TableName = "(select nd_name,nd_code from  ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT  AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC) ";
+            mbr_dutyname.Field = "nd_name";
+            mbr_dutyname.ValueField = "nd_code";
+            mbr_dutyname.Condition = " 1=1 ORDER BY ROWNUM asc";
+
+            so_name.TableName = "(select so_name,so_code from solution left join DATAINPUTRECORD ON so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
+            so_name.Field = "so_name";
+            so_name.ValueField = "so_code";
+            so_name.Condition = " 1=1 ORDER BY ROWNUM asc";
+
+            so_name.SendToBack();
+            mb_badlocation.SendToBack();
         }
 
         private void Split_Click(object sender, EventArgs e)
@@ -29,7 +65,18 @@ namespace UAS_MES_NEW.Special
 
         private void SaveRepairInf_Click(object sender, EventArgs e)
         {
-
+            if (sn_code.Text == "")
+            {
+                OperateResult.AppendText("序列号不允许为空\n", System.Drawing.Color.Red, sn_code);
+                return;
+            }
+            dh.ExecuteSql("insert into makebadreason(MBR_ID, MBR_SNCODE, MBR_MAKECODE, MBR_SOLUTIONNAME, MBR_DUTYNAME,mbr_linecode)" +
+                "values(makebadreason_seq.nextval,'" + sn_code.Text + "','" + ma_code.Text + "','" + so_name.Text + "','" + mbr_dutyname.Text + "','" + li_code.Text + "')", "insert");
+            OperateResult.AppendText("序列号" + sn_code.Text + "记录维修信息成功\n", System.Drawing.Color.Green, sn_code);
+            nrg_name.Text = "";
+            nr_name.Text = "";
+            mbr_dutyname.Text = "";
+            so_name.Text = "";
         }
     }
 }

+ 17 - 0
UAS_MES_LGDZ/PublicMethod/LogicHandler.cs

@@ -775,6 +775,23 @@ namespace UAS_MES_NEW.PublicMethod
             return result;
         }
 
+
+        public static bool SetStepResult1(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
+        {
+            bool result = CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
+            if (result)
+            {
+                
+            }
+            else
+            {
+                SetCheck set = new SetCheck("NG", Color.Red);
+                BaseUtil.SetFormCenter(set);
+                set.ShowDialog();
+            }
+            return result;
+        }
+
         public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
         {
             oErrorMessage = "";