Bläddra i källkod

售后模块,经纬标签打印

callm 3 år sedan
förälder
incheckning
c6c09f8a05

+ 14 - 4
UAS_MES_YD/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -10,6 +10,7 @@ using LabelManager2;
 using System.IO;
 using System.Threading;
 using UAS_MES_NEW.PublicForm;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
@@ -89,13 +90,13 @@ namespace UAS_MES_NEW.Make
             //    BaseUtil.SetFormValue(this.Controls, dt);
             //}
         }
+        Engine engine;
 
         private void InPrint()
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine(true);
             }
             catch (Exception ex)
             {
@@ -179,15 +180,24 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
                             //按照打印张数打印
                             //doc = lbl.Documents.Open(PrintLabel.Text);
-                            if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
+                            if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
                             {
                                 //提示用户打印成功
-                                OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
+                                OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
                             }
                             else
                             {
                                 OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
                             }
+                            //if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
+                            //{
+                            //    //提示用户打印成功
+                            //    OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
+                            //}
+                            //else
+                            //{
+                            //    OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
+                            //}
                             //记录日志
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "机身标打印", "机身标打印成功", sncode.Text, "");
                             //更新打印的数据

+ 2 - 2
UAS_MES_YD/FunctionCode/Make/Make_RePrintLabel.cs

@@ -228,9 +228,9 @@ namespace UAS_MES_NEW.Make
                 //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
                 if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
                 {
-                    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                    //dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
                     //插入数据
-                    putInfo2MakeDown();
+                    //putInfo2MakeDown();
                 }
             }
             //打印类型为卡通箱标签

+ 1 - 0
UAS_MES_YD/FunctionCode/Make/Make_TestCollection.cs

@@ -86,6 +86,7 @@ namespace UAS_MES_NEW.Make
             StepCount.Start();
             if (BaseUtil.CheckBarTenderEnable())
             {
+                OperateResult.AppendText("已安装BarTender\n");
                 try
                 {
                     engine = new Engine();

+ 80 - 76
UAS_MES_YD/FunctionCode/Query/Query_OnlineTraceBack.Designer.cs

@@ -33,6 +33,10 @@
             this.ms_status_label = new System.Windows.Forms.Label();
             this.ms_stepcode_label = new System.Windows.Forms.Label();
             this.ms_nextstepcode_label = new System.Windows.Forms.Label();
+            this.Count_label = new System.Windows.Forms.Label();
+            this.Count = new System.Windows.Forms.Label();
+            this.ma_qty_label = new System.Windows.Forms.Label();
+            this.ma_qty = new System.Windows.Forms.Label();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.ms_nextstepcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_stepcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -45,10 +49,6 @@
             this.ms_stepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ms_nextstepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Count_label = new System.Windows.Forms.Label();
-            this.Count = new System.Windows.Forms.Label();
-            this.ma_qty_label = new System.Windows.Forms.Label();
-            this.ma_qty = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.SnInf)).BeginInit();
             this.SuspendLayout();
             // 
@@ -56,10 +56,10 @@
             // 
             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(4, 24);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(6, 38);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(114, 41);
             this.ms_makecode_label.TabIndex = 198;
             this.ms_makecode_label.Text = "工单号";
             // 
@@ -67,10 +67,10 @@
             // 
             this.ms_status_label.AutoSize = true;
             this.ms_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_status_label.Location = new System.Drawing.Point(275, 24);
-            this.ms_status_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_status_label.Location = new System.Drawing.Point(412, 38);
+            this.ms_status_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_status_label.Name = "ms_status_label";
-            this.ms_status_label.Size = new System.Drawing.Size(80, 27);
+            this.ms_status_label.Size = new System.Drawing.Size(126, 41);
             this.ms_status_label.TabIndex = 197;
             this.ms_status_label.Text = "SN状态";
             // 
@@ -78,10 +78,10 @@
             // 
             this.ms_stepcode_label.AutoSize = true;
             this.ms_stepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_stepcode_label.Location = new System.Drawing.Point(559, 24);
-            this.ms_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_stepcode_label.Location = new System.Drawing.Point(838, 38);
+            this.ms_stepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_stepcode_label.Name = "ms_stepcode_label";
-            this.ms_stepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_stepcode_label.Size = new System.Drawing.Size(146, 41);
             this.ms_stepcode_label.TabIndex = 207;
             this.ms_stepcode_label.Text = "当前工序";
             // 
@@ -89,13 +89,55 @@
             // 
             this.ms_nextstepcode_label.AutoSize = true;
             this.ms_nextstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_nextstepcode_label.Location = new System.Drawing.Point(854, 24);
-            this.ms_nextstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_nextstepcode_label.Location = new System.Drawing.Point(1281, 38);
+            this.ms_nextstepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_nextstepcode_label.Name = "ms_nextstepcode_label";
-            this.ms_nextstepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_nextstepcode_label.Size = new System.Drawing.Size(146, 41);
             this.ms_nextstepcode_label.TabIndex = 209;
             this.ms_nextstepcode_label.Text = "下一工序";
             // 
+            // Count_label
+            // 
+            this.Count_label.AutoSize = true;
+            this.Count_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Count_label.Location = new System.Drawing.Point(412, 1062);
+            this.Count_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.Count_label.Name = "Count_label";
+            this.Count_label.Size = new System.Drawing.Size(210, 41);
+            this.Count_label.TabIndex = 212;
+            this.Count_label.Text = "当前状态总计";
+            // 
+            // Count
+            // 
+            this.Count.AutoSize = true;
+            this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Count.Location = new System.Drawing.Point(622, 1062);
+            this.Count.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.Count.Name = "Count";
+            this.Count.Size = new System.Drawing.Size(0, 41);
+            this.Count.TabIndex = 213;
+            // 
+            // ma_qty_label
+            // 
+            this.ma_qty_label.AutoSize = true;
+            this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_qty_label.Location = new System.Drawing.Point(6, 1062);
+            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty_label.Name = "ma_qty_label";
+            this.ma_qty_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_qty_label.TabIndex = 214;
+            this.ma_qty_label.Text = "工单数量";
+            // 
+            // ma_qty
+            // 
+            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(156, 1062);
+            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);
+            this.ma_qty.TabIndex = 215;
+            // 
             // ma_code
             // 
             this.ma_code.AllPower = "IFALL";
@@ -104,17 +146,17 @@
             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(79, 24);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Location = new System.Drawing.Point(118, 38);
+            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(188, 29);
+            this.ma_code.Size = new System.Drawing.Size(282, 46);
             this.ma_code.TabIndex = 211;
             this.ma_code.TableName = null;
-            this.ma_code.Tag = "makecode";
+            this.ma_code.Tag = "msl_makecode";
             this.ma_code.TextBoxEnable = true;
             // 
             // ms_nextstepcode
@@ -122,10 +164,11 @@
             this.ms_nextstepcode.AllPower = null;
             this.ms_nextstepcode.BackColor = System.Drawing.Color.White;
             this.ms_nextstepcode.ID = null;
-            this.ms_nextstepcode.Location = new System.Drawing.Point(953, 24);
+            this.ms_nextstepcode.Location = new System.Drawing.Point(1430, 38);
+            this.ms_nextstepcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ms_nextstepcode.Name = "ms_nextstepcode";
             this.ms_nextstepcode.Power = null;
-            this.ms_nextstepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_nextstepcode.Size = new System.Drawing.Size(248, 35);
             this.ms_nextstepcode.Str = null;
             this.ms_nextstepcode.Str1 = null;
             this.ms_nextstepcode.Str2 = null;
@@ -137,10 +180,11 @@
             this.ms_stepcode.AllPower = null;
             this.ms_stepcode.BackColor = System.Drawing.Color.White;
             this.ms_stepcode.ID = null;
-            this.ms_stepcode.Location = new System.Drawing.Point(658, 24);
+            this.ms_stepcode.Location = new System.Drawing.Point(987, 38);
+            this.ms_stepcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ms_stepcode.Name = "ms_stepcode";
             this.ms_stepcode.Power = null;
-            this.ms_stepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_stepcode.Size = new System.Drawing.Size(248, 35);
             this.ms_stepcode.Str = null;
             this.ms_stepcode.Str1 = null;
             this.ms_stepcode.Str2 = null;
@@ -154,12 +198,13 @@
             this.Query.DownImage = ((System.Drawing.Image)(resources.GetObject("Query.DownImage")));
             this.Query.Image = null;
             this.Query.IsShowBorder = true;
-            this.Query.Location = new System.Drawing.Point(1156, 24);
+            this.Query.Location = new System.Drawing.Point(1734, 38);
+            this.Query.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.Query.MoveImage = ((System.Drawing.Image)(resources.GetObject("Query.MoveImage")));
             this.Query.Name = "Query";
             this.Query.NormalImage = ((System.Drawing.Image)(resources.GetObject("Query.NormalImage")));
             this.Query.Power = null;
-            this.Query.Size = new System.Drawing.Size(75, 28);
+            this.Query.Size = new System.Drawing.Size(112, 45);
             this.Query.TabIndex = 206;
             this.Query.Text = "查询";
             this.Query.UseVisualStyleBackColor = false;
@@ -169,9 +214,10 @@
             // 
             this.ms_status.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.ms_status.FormattingEnabled = true;
-            this.ms_status.Location = new System.Drawing.Point(362, 25);
+            this.ms_status.Location = new System.Drawing.Point(543, 40);
+            this.ms_status.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ms_status.Name = "ms_status";
-            this.ms_status.Size = new System.Drawing.Size(167, 23);
+            this.ms_status.Size = new System.Drawing.Size(248, 32);
             this.ms_status.TabIndex = 205;
             this.ms_status.Tag = "ms_status";
             this.ms_status.SelectedIndexChanged += new System.EventHandler(this.ms_status_SelectedIndexChanged);
@@ -190,11 +236,11 @@
             this.ms_nextstepcode1,
             this.Column5});
             this.SnInf.EnableContentClick = true;
-            this.SnInf.Location = new System.Drawing.Point(0, 70);
-            this.SnInf.Margin = new System.Windows.Forms.Padding(4);
+            this.SnInf.Location = new System.Drawing.Point(0, 112);
+            this.SnInf.Margin = new System.Windows.Forms.Padding(6);
             this.SnInf.Name = "SnInf";
             this.SnInf.RowTemplate.Height = 23;
-            this.SnInf.Size = new System.Drawing.Size(1261, 590);
+            this.SnInf.Size = new System.Drawing.Size(1892, 944);
             this.SnInf.TabIndex = 203;
             // 
             // ms_sncode
@@ -237,53 +283,11 @@
             this.Column5.Name = "Column5";
             this.Column5.ReadOnly = true;
             // 
-            // Count_label
-            // 
-            this.Count_label.AutoSize = true;
-            this.Count_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Count_label.Location = new System.Drawing.Point(275, 664);
-            this.Count_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Count_label.Name = "Count_label";
-            this.Count_label.Size = new System.Drawing.Size(132, 27);
-            this.Count_label.TabIndex = 212;
-            this.Count_label.Text = "当前状态总计";
-            // 
-            // Count
-            // 
-            this.Count.AutoSize = true;
-            this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Count.Location = new System.Drawing.Point(415, 664);
-            this.Count.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Count.Name = "Count";
-            this.Count.Size = new System.Drawing.Size(0, 27);
-            this.Count.TabIndex = 213;
-            // 
-            // ma_qty_label
-            // 
-            this.ma_qty_label.AutoSize = true;
-            this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(4, 664);
-            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(92, 27);
-            this.ma_qty_label.TabIndex = 214;
-            this.ma_qty_label.Text = "工单数量";
-            // 
-            // ma_qty
-            // 
-            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(104, 664);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 27);
-            this.ma_qty.TabIndex = 215;
-            // 
             // Query_OnlineTraceBack
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1261, 694);
+            this.ClientSize = new System.Drawing.Size(1892, 1110);
             this.Controls.Add(this.ma_qty);
             this.Controls.Add(this.ma_qty_label);
             this.Controls.Add(this.Count);
@@ -299,7 +303,7 @@
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.ms_status_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "Query_OnlineTraceBack";
             this.Tag = "Query!OnlineTraceBack";
             this.Text = " ";

+ 10 - 14
UAS_MES_YD/FunctionCode/Query/Query_OnlineTraceBack.cs

@@ -39,17 +39,17 @@ namespace UAS_MES_NEW.Query
             DataRow dr = ComBoxData.NewRow();
             dr[0] = "全部"; dr[1] = "ALL"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "未生产"; dr[1] = "null"; ComBoxData.Rows.Add(dr);
+            dr[0] = "未生产"; dr[1] = "未生产"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "已归属"; dr[1] = "0"; ComBoxData.Rows.Add(dr);
+            dr[0] = "已归属"; dr[1] = "已归属"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "在线"; dr[1] = "1"; ComBoxData.Rows.Add(dr);
+            dr[0] = "在线"; dr[1] = "在线"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "已完工"; dr[1] = "2"; ComBoxData.Rows.Add(dr);
+            dr[0] = "已完工"; dr[1] = "已完工"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "不良待维修"; dr[1] = "3"; ComBoxData.Rows.Add(dr);
+            dr[0] = "不良待维修"; dr[1] = "不良待维修"; ComBoxData.Rows.Add(dr);
             dr = ComBoxData.NewRow();
-            dr[0] = "已报废"; dr[1] = "4"; ComBoxData.Rows.Add(dr);
+            dr[0] = "已报废"; dr[1] = "已报废"; ComBoxData.Rows.Add(dr);
             ms_status.DataSource = ComBoxData;
             ms_status.DisplayMember = "status";
             ms_status.ValueMember = "statuscode";
@@ -82,14 +82,10 @@ namespace UAS_MES_NEW.Query
                 string condition = BaseUtil.GetScreenSqlCondition(ma_code, ms_stepcode, ms_nextstepcode);
                 string statuscode = ms_status.SelectedValue.ToString();
                 sql.Clear();
-                sql.Append("select distinct sncode ms_sncode,ms_linecode,ms_stepcode,ms_nextstepcode,ms_craftcode,makecode ms_makecode, ");
-                sql.Append("case when ms_status is null then '未生产' when ms_status=0 then '已归属' when ms_status=1 then '在线' when ms_status=2 ");
-                sql.Append(" then '已完工' when ms_status=3 then '不良待维修' when ms_status=4 then '已报废' ");
-                sql.Append("else 'null' end ms_status  from((select msd_sncode sncode,msd_makecode makecode,msd_type type ");
-                sql.Append("from makesnruledetail where msd_makecode='" + ma_code.Text + "') union (select msl_sncode sncode,msl_makecode ");
-                sql.Append("makecode,msl_type type from makesnlist where msl_makecode='" + ma_code.Text + "') union (");
-                sql.Append("select ms_sncode,ms_makecode,'' type from  makeserial where ms_makecode='" + ma_code.Text + "'))");
-                sql.Append("A left join makeserial on ms_sncode=sncode and ms_makecode=makecode ");
+                sql.Append("select  msl_sncode ms_sncode,ms_linecode,ms_stepcode,ms_nextstepcode,ms_craftcode, ms_makecode,");
+                sql.Append("case when ms_status is null then '未生产' when ms_status=0 then '已归属' when ms_status=1 then '在线' when ms_status=2  then '已完工' when ms_status=3  ");
+                sql.Append(" then '不良待维修' when ms_status=4 then '已报废' else 'null' end ms_status from makesnlist ");
+                sql.Append("left join makeserial on ms_firstsn=msl_sncode and ms_makecode=msl_makecode ");
                 sql.Append(condition);
                 if (statuscode == "null")
                 {

+ 136 - 20
UAS_MES_YD/FunctionCode/Query/Query_SOP.Designer.cs

@@ -28,42 +28,150 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_SOP));
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
-            this.Sn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.PrintList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.PrintBarcode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
             this.SuspendLayout();
             // 
-            // Sn
-            // 
-            this.Sn.AllPower = null;
-            this.Sn.ID = null;
-            this.Sn.Location = new System.Drawing.Point(213, 357);
-            this.Sn.Name = "Sn";
-            this.Sn.Power = null;
-            this.Sn.Size = new System.Drawing.Size(283, 35);
-            this.Sn.Str = null;
-            this.Sn.Str1 = null;
-            this.Sn.Str2 = null;
-            this.Sn.TabIndex = 0;
-            this.Sn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Sn_KeyDown);
-            // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(100, 355);
+            this.label1.Location = new System.Drawing.Point(285, 344);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(58, 37);
+            this.label1.Size = new System.Drawing.Size(101, 37);
             this.label1.TabIndex = 1;
-            this.label1.Text = "SN";
+            this.label1.Text = "工单号";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(313, 417);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(73, 37);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "箱号";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(229, 491);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(157, 37);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "打印机列表";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(257, 569);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(129, 37);
+            this.label5.TabIndex = 163;
+            this.label5.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(890, 254);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(504, 570);
+            this.OperateResult.TabIndex = 164;
+            this.OperateResult.Text = "";
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(416, 571);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(378, 39);
+            this.PrintLabel.TabIndex = 161;
+            // 
+            // PrintList
+            // 
+            this.PrintList.Location = new System.Drawing.Point(416, 491);
+            this.PrintList.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.PrintList.Name = "PrintList";
+            this.PrintList.Size = new System.Drawing.Size(378, 45);
+            this.PrintList.TabIndex = 5;
+            // 
+            // PrintBarcode
+            // 
+            this.PrintBarcode.AllPower = null;
+            this.PrintBarcode.BackColor = System.Drawing.Color.Transparent;
+            this.PrintBarcode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarcode.DownImage")));
+            this.PrintBarcode.Image = null;
+            this.PrintBarcode.IsShowBorder = true;
+            this.PrintBarcode.Location = new System.Drawing.Point(464, 652);
+            this.PrintBarcode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarcode.MoveImage")));
+            this.PrintBarcode.Name = "PrintBarcode";
+            this.PrintBarcode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarcode.NormalImage")));
+            this.PrintBarcode.Power = null;
+            this.PrintBarcode.Size = new System.Drawing.Size(150, 50);
+            this.PrintBarcode.TabIndex = 4;
+            this.PrintBarcode.Text = "打印";
+            this.PrintBarcode.UseVisualStyleBackColor = false;
+            this.PrintBarcode.Click += new System.EventHandler(this.Print_Click);
+            // 
+            // pa_outboxcode
+            // 
+            this.pa_outboxcode.AllPower = null;
+            this.pa_outboxcode.ID = null;
+            this.pa_outboxcode.Location = new System.Drawing.Point(416, 419);
+            this.pa_outboxcode.Name = "pa_outboxcode";
+            this.pa_outboxcode.Power = null;
+            this.pa_outboxcode.Size = new System.Drawing.Size(283, 35);
+            this.pa_outboxcode.Str = null;
+            this.pa_outboxcode.Str1 = null;
+            this.pa_outboxcode.Str2 = null;
+            this.pa_outboxcode.TabIndex = 3;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.ID = null;
+            this.ma_code.Location = new System.Drawing.Point(416, 346);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.Size = new System.Drawing.Size(283, 35);
+            this.ma_code.Str = null;
+            this.ma_code.Str1 = null;
+            this.ma_code.Str2 = null;
+            this.ma_code.TabIndex = 0;
+            this.ma_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Sn_KeyDown);
             // 
             // Query_SOP
             // 
             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.OperateResult);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.PrintList);
+            this.Controls.Add(this.PrintBarcode);
+            this.Controls.Add(this.pa_outboxcode);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
-            this.Controls.Add(this.Sn);
+            this.Controls.Add(this.ma_code);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Query_SOP";
@@ -77,7 +185,15 @@
 
         #endregion
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
-        private CustomControl.TextBoxWithIcon.SNCodeEnterTextBox Sn;
+        private CustomControl.TextBoxWithIcon.SNCodeEnterTextBox ma_code;
         private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.TextBoxWithIcon.SNCodeEnterTextBox pa_outboxcode;
+        private CustomControl.ButtonUtil.NormalButton PrintBarcode;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrintList;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.ComBoxWithFocus.ComboxWithTip PrintLabel;
+        private System.Windows.Forms.Label label5;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
     }
 }

+ 48 - 16
UAS_MES_YD/FunctionCode/Query/Query_SOP.cs

@@ -1,4 +1,5 @@
-using System;
+using Seagull.BarTender.Print;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -17,6 +18,8 @@ namespace UAS_MES_NEW.Query
 
         DataHelper dh = SystemInf.dh;
 
+        Engine engine;
+
         public Query_SOP()
         {
             InitializeComponent();
@@ -32,29 +35,58 @@ namespace UAS_MES_NEW.Query
         {
 
         }
-
+        DataTable _dt;
         private void Query_SpecialReport_Load(object sender, EventArgs e)
         {
-
+            try
+            {
+                engine = new Engine(true);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("未正确安装Bartender软件");
+            }
+            _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='BQDY' and la_templatetype='卡通箱标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            PrintLabel.DataSource = _dt;
+            PrintLabel.DisplayMember = "la_url";
+            PrintLabel.ValueMember = "la_id";
         }
 
         private void Sn_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyData == Keys.Enter)
             {
-                dh.ExecuteSql("update craftmaterial set cm_status=-1 where cm_barcode='" + Sn.Text + "'", "update");
-                MessageBox.Show("解绑成功");
-                //DataTable dt = (DataTable)dh.ExecuteSql("select ms_prodcode from makeserial where ms_sncode='" + Sn.Text + "'", "select");
-                //if (dt.Rows.Count > 0)
-                //{
-                //    string prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-                //    string FilePath = dh.getFieldDataByCondition("SOPDETAIL left join sop on so_id=sod_soid ", "sod_path", "so_prodcode='" + prodcode + "' and sod_stepcode='" + User.CurrentStepCode + "'").ToString();
-                //    System.Diagnostics.Process.Start(FilePath);
-                //}
-                //else
-                //{
-                //    MessageBox.Show("序列号" + Sn.Text + "不存在");
-                //}
+
+            }
+        }
+
+        private void Print_Click(object sender, EventArgs e)
+        {
+
+            DataTable dt = (DataTable)dh.ExecuteSql("select * from package_view where pa_makecode='" + ma_code.Text + "'", "select");
+            string ErrorMessage = "";
+            string outboxcode = "";
+            if (dt.Rows.Count == 0)
+            {
+                OperateResult.AppendText(">>工单" + ma_code.Text + "不存在装箱记录\n", Color.Black);
+                return;
+            }
+            if (pa_outboxcode.Text != "")
+            {
+                dt = (DataTable)dh.ExecuteSql("select * from package_view where pa_makecode='" + ma_code.Text + "' and pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在装箱记录\n", Color.Black);
+                    return;
+                }
+            }
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                outboxcode = dt.Rows[i]["pa_outboxcode"].ToString();
+                if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, outboxcode, 1, "", "", "卡通箱标", "0", out ErrorMessage))
+                {
+                    OperateResult.AppendText(">>开始打印箱号" + outboxcode + "\n", Color.Black);
+                }
             }
         }
     }

+ 39 - 0
UAS_MES_YD/FunctionCode/Query/Query_SOP.resx

@@ -120,4 +120,43 @@
   <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="PrintBarcode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="PrintBarcode.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="PrintBarcode.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
 </root>

+ 27 - 73
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.Designer.cs

@@ -37,7 +37,6 @@
             this.pr_spec = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
-            this.Cancel = new System.Windows.Forms.CheckBox();
             this.InDate = new System.Windows.Forms.DateTimePicker();
             this.label2 = new System.Windows.Forms.Label();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -49,12 +48,10 @@
             this.Clean = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.inqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.afr_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.afr_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.afr_cucode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.afr_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_custname = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Info)).BeginInit();
             this.SuspendLayout();
             // 
@@ -96,10 +93,9 @@
             this.Info.AllowUserToAddRows = false;
             this.Info.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.Info.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.afr_barcode,
-            this.afr_prodcode,
-            this.afr_cucode,
-            this.afr_inqty});
+            this.ms_sncode,
+            this.ms_prodcode1,
+            this.ms_custname});
             this.Info.Location = new System.Drawing.Point(39, 127);
             this.Info.Name = "Info";
             this.Info.RowTemplate.Height = 37;
@@ -148,16 +144,6 @@
             this.label5.TabIndex = 222;
             this.label5.Text = "客户名称";
             // 
-            // Cancel
-            // 
-            this.Cancel.AutoSize = true;
-            this.Cancel.Location = new System.Drawing.Point(916, 739);
-            this.Cancel.Name = "Cancel";
-            this.Cancel.Size = new System.Drawing.Size(138, 28);
-            this.Cancel.TabIndex = 223;
-            this.Cancel.Text = "取消录入";
-            this.Cancel.UseVisualStyleBackColor = true;
-            // 
             // InDate
             // 
             this.InDate.Location = new System.Drawing.Point(1058, 20);
@@ -299,66 +285,37 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // inqty
-            // 
-            this.inqty.AllPower = null;
-            this.inqty.BackColor = System.Drawing.Color.White;
-            this.inqty.ID = null;
-            this.inqty.Location = new System.Drawing.Point(751, 732);
-            this.inqty.Margin = new System.Windows.Forms.Padding(4);
-            this.inqty.Name = "inqty";
-            this.inqty.Power = null;
-            this.inqty.Size = new System.Drawing.Size(111, 35);
-            this.inqty.Str = null;
-            this.inqty.Str1 = null;
-            this.inqty.Str2 = null;
-            this.inqty.TabIndex = 226;
-            // 
-            // label3
-            // 
-            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(595, 726);
-            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(146, 41);
-            this.label3.TabIndex = 227;
-            this.label3.Text = "入库数量";
-            // 
-            // afr_barcode
+            // dataGridViewTextBoxColumn4
             // 
-            this.afr_barcode.DataPropertyName = "afr_barcode";
-            this.afr_barcode.HeaderText = "条码号";
-            this.afr_barcode.Name = "afr_barcode";
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "afr_inqty";
+            this.dataGridViewTextBoxColumn4.HeaderText = "入库数量";
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
             // 
-            // afr_prodcode
+            // ms_sncode
             // 
-            this.afr_prodcode.DataPropertyName = "afr_prodcode";
-            this.afr_prodcode.HeaderText = "物料编号";
-            this.afr_prodcode.Name = "afr_prodcode";
+            this.ms_sncode.DataPropertyName = "ms_sncode";
+            this.ms_sncode.HeaderText = "条码号";
+            this.ms_sncode.Name = "ms_sncode";
             // 
-            // afr_cucode
+            // ms_prodcode1
             // 
-            this.afr_cucode.DataPropertyName = "afr_cucode";
-            this.afr_cucode.HeaderText = "客户名称";
-            this.afr_cucode.Name = "afr_cucode";
+            this.ms_prodcode1.DataPropertyName = "ms_prodcode1";
+            this.ms_prodcode1.HeaderText = "物料编号";
+            this.ms_prodcode1.Name = "ms_prodcode1";
             // 
-            // afr_inqty
+            // ms_custname
             // 
-            this.afr_inqty.DataPropertyName = "afr_inqty";
-            this.afr_inqty.HeaderText = "入库数量";
-            this.afr_inqty.Name = "afr_inqty";
+            this.ms_custname.DataPropertyName = "ms_custname";
+            this.ms_custname.HeaderText = "客户名称";
+            this.ms_custname.Name = "ms_custname";
             // 
             // Special_AfterSaleIn
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1566, 802);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.inqty);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.InDate);
-            this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.pr_spec);
@@ -404,14 +361,11 @@
         private System.Windows.Forms.Label pr_spec;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.CheckBox Cancel;
         private System.Windows.Forms.DateTimePicker InDate;
         private System.Windows.Forms.Label label2;
-        private CustomControl.TextBoxWithIcon.EnterTextBox inqty;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn afr_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn afr_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn afr_cucode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn afr_inqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_sncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_prodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_custname;
     }
 }

+ 31 - 39
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.cs

@@ -41,56 +41,48 @@ namespace UAS_MES_NEW.Special
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            int in_qty = 0;
-            if (!int.TryParse(inqty.Text, out in_qty))
+            //正常录入资料的时候
+            if (barcode.Text == "")
             {
-                OperateResult.AppendText(">>入库数错误\n", Color.Red, barcode);
+                OperateResult.AppendText(">>输入信息不允许为空\n", Color.Red, barcode);
                 return;
             }
-            //正常录入资料的时候
-            if (!Cancel.Checked)
+            string oMSID = "";
+            string oMakecode = "";
+            string Err = "";
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_custname,ma_prodcode,pr_spec from makeserial_view left join make_view on ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode='" + barcode.Text + "'", "select");
+            if (dt.Rows.Count > 0)
             {
-                if (cu_code.Text == "" || pr_code.Text == "")
+                cu_code.Text = dt.Rows[0]["ma_custname"].ToString();
+                pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                pr_spec.Text = dt.Rows[0]["pr_spec"].ToString();
+            }
+            if (cu_code.Text == "" || pr_code.Text == "")
+            {
+                OperateResult.AppendText(">>客户编号和物料编号不能为空\n", Color.Red, barcode);
+                return;
+            }
+            if (LogicHandler.CheckStepSNAndMacode("MD22020001", "ZBRK", barcode.Text, User.UserCode, out oMakecode, out oMSID, out Err))
+            {
+                dh.ExecuteSql("update makeserial set ms_custname='" + cu_code.Text + "',ms_prodcode1='" + pr_code.Text + "' where ms_id=" + oMSID, "update");
+                LoadGridData();
+                if (dh.getFieldDataByCondition("makeserial", "ms_stepcode", "ms_id=" + oMSID).ToString() == User.CurrentStepCode)
                 {
-                    OperateResult.AppendText(">>客户编号和物料编号不能为空\n", Color.Red, barcode);
+                    OperateResult.AppendText(">>条码已经执行过" + User.CurrentStepName + "\n", Color.Red, barcode);
                     return;
                 }
-                if (barcode.Text == "")
+                if (LogicHandler.SetStepResult("MD22020001", "ZBRK", barcode.Text, "", "OK", User.UserCode, out Err))
                 {
-                    OperateResult.AppendText(">>输入信息不允许为空\n", Color.Red, barcode);
-                    return;
+                    OperateResult.AppendText(">>条码" + barcode.Text + "录入成功\n", Color.Green, barcode);
                 }
-                if (dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "'"))
+                else
                 {
-                    OperateResult.AppendText(">>条码" + barcode.Text + "已录入\n", Color.Red, barcode);
-                    return;
+                    OperateResult.AppendText(">>" + Err + "\n", Color.Red, barcode);
                 }
-                sql.Clear();
-                sql.Append("insert into aftersalerecord(afr_id,afr_barcode,afr_prodcode,afr_cucode,afr_indate,afr_inqty)");
-                sql.Append("values(aftersalerecord_seq.nextval,'" + barcode.Text + "','" + pr_code.Text + "','" + cu_code.Text + "',sysdate," + inqty.Text + ")");
-                dh.ExecuteSql(sql.GetString(), "insert");
-                dh.ExecuteSql("insert into aftersalerecordlog(afl_id,afl_barcode,afl_prodcode,afl_qty,afl_type) select aftersalerecordlog_seq.nextval,afr_barcode,afr_prodcode," + inqty.Text + ",'入库' from aftersalerecord where afr_barcode='" + barcode.Text + "'", "insert");
-                OperateResult.AppendText(">>条码" + barcode.Text + "录入成功\n", Color.Green, barcode);
-                LoadGridData();
             }
             else
             {
-                if (!dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "'"))
-                {
-                    OperateResult.AppendText(">>条码" + barcode.Text + "不存在\n", Color.Red, barcode);
-                    return;
-                }
-                if (dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and nvl(afr_outqty,0) =0"))
-                {
-                    OperateResult.AppendText(">>条码" + barcode.Text + "已出库\n", Color.Red, barcode);
-                    return;
-                }
-                sql.Clear();
-                sql.Append("delete from aftersalerecord where afr_barcode='" + barcode.Text + "'");
-                dh.ExecuteSql(sql.GetString(), "delete");
-                dh.ExecuteSql("insert into aftersalerecordlog(afl_id,afl_barcode,afl_prodcode,afl_qty,afl_type) select aftersalerecordlog_seq.nextval,afr_barcode,afr_prodcode," + inqty.Text + ",'取消入库' from aftersalerecord where afr_barcode='" + barcode.Text + "'", "insert");
-                OperateResult.AppendText(">>条码" + barcode.Text + "取消成功\n", Color.Green, barcode);
-                LoadGridData();
+                OperateResult.AppendText(">>" + Err + "\n", Color.Red, barcode);
             }
         }
 
@@ -102,14 +94,14 @@ namespace UAS_MES_NEW.Special
         private void LoadGridData()
         {
             sql.Clear();
-            sql.Append("select * from aftersalerecord where trunc(afr_indate)=trunc(to_date('" + InDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "','yyyy-mm-dd hh24:mi:ss')) ");
+            sql.Append("select * from makeserial where trunc(ms_indate)=trunc(to_date('" + InDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "','yyyy-mm-dd hh24:mi:ss')) ");
             if (cu_code.Text != "")
             {
-                sql.Append(" and afr_cucode='" + cu_code.Text + "'");
+                sql.Append(" and ms_custname='" + cu_code.Text + "'");
             }
             if (pr_code.Text != "")
             {
-                sql.Append(" and afr_prodcode='" + pr_code.Text + "'");
+                sql.Append(" and ms_prodcode1='" + pr_code.Text + "'");
             }
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(Info, dt);

+ 3 - 6
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.resx

@@ -117,16 +117,13 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="afr_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="afr_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ms_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="afr_cucode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="afr_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ms_custname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

+ 2 - 0
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleOut.Designer.cs

@@ -294,6 +294,7 @@
             this.label3.Size = new System.Drawing.Size(146, 41);
             this.label3.TabIndex = 229;
             this.label3.Text = "出库数量";
+            this.label3.Visible = false;
             // 
             // outqty
             // 
@@ -309,6 +310,7 @@
             this.outqty.Str1 = null;
             this.outqty.Str2 = null;
             this.outqty.TabIndex = 228;
+            this.outqty.Visible = false;
             // 
             // Special_AfterSaleOut
             // 

+ 7 - 15
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleOut.cs

@@ -36,12 +36,6 @@ namespace UAS_MES_NEW.Special
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            int out_qty = 0;
-            if (!int.TryParse(outqty.Text, out out_qty))
-            {
-                OperateResult.AppendText(">>出库数错误\n", Color.Red, barcode);
-                return;
-            }
             //正常录入资料的时候
             if (!Cancel.Checked)
             {
@@ -50,12 +44,12 @@ namespace UAS_MES_NEW.Special
                     OperateResult.AppendText(">>客户编号不能为空\n", Color.Red, barcode);
                     return;
                 }
-                if (!dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and  nvl(afr_outqty,0)+" + outqty.Text + "<=afr_inqty"))
+                if (!dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "'"))
                 {
-                    OperateResult.AppendText(">>条码" + barcode.Text + "不存在或出库数量不足\n", Color.Red, barcode);
+                    OperateResult.AppendText(">>条码" + barcode.Text + "不存在\n", Color.Red, barcode);
                     return;
                 }
-                if (dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and afr_outqty>=afr_inqty"))
+                if (!dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and afr_outdate is null"))
                 {
                     OperateResult.AppendText(">>条码" + barcode.Text + "已出库\n", Color.Red, barcode);
                     return;
@@ -66,9 +60,8 @@ namespace UAS_MES_NEW.Special
                     return;
                 }
                 sql.Clear();
-                sql.Append("update aftersalerecord set afr_outdate=sysdate,afr_outcucode='" + cu_code.Text + "',afr_outqty=nvl(afr_outqty,0)+" + outqty.Text + " where afr_barcode='" + barcode.Text + "'");
+                sql.Append("update aftersalerecord set afr_outdate=sysdate,afr_outcucode='" + cu_code.Text + "' where afr_barcode='" + barcode.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "update");
-                dh.ExecuteSql("insert into aftersalerecordlog(afl_id,afl_barcode,afl_prodcode,afl_qty,afl_type) select aftersalerecordlog_seq.nextval,afr_barcode,afr_prodcode," + outqty.Text + ",'出库' from aftersalerecord where afr_barcode='" + barcode.Text + "'", "insert");
                 OperateResult.AppendText(">>条码" + barcode.Text + "出库成功\n", Color.Green, barcode);
                 LoadGridData();
             }
@@ -79,14 +72,13 @@ namespace UAS_MES_NEW.Special
                     OperateResult.AppendText(">>条码" + barcode.Text + "不存在\n", Color.Red, barcode);
                     return;
                 }
-                if (dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and   nvl(afr_outqty,0)-" + outqty.Text + "<0"))
+                if (dh.CheckExist("aftersalerecord", "afr_barcode='" + barcode.Text + "' and afr_outdate is null"))
                 {
-                    OperateResult.AppendText(">>条码" + barcode.Text + "取消出库数量不足\n", Color.Red, barcode);
+                    OperateResult.AppendText(">>条码" + barcode.Text + "未出库\n", Color.Red, barcode);
                     return;
                 }
                 sql.Clear();
-                sql.Append("update aftersalerecord set afr_outdate=null,afr_outcucode=null,afr_outqty=nvl(afr_outqty,0)-" + outqty.Text + " where afr_barcode='" + barcode.Text + "'");
-                dh.ExecuteSql("insert into aftersalerecordlog(afl_id,afl_barcode,afl_prodcode,afl_qty,afl_type) select aftersalerecordlog_seq.nextval,afr_barcode,afr_prodcode," + outqty.Text + ",'取消出库' from aftersalerecord where afr_barcode='" + barcode.Text + "'", "insert");
+                sql.Append("update aftersalerecord set afr_outdate=null,afr_outcucode=null where afr_barcode='" + barcode.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "update");
                 OperateResult.AppendText(">>条码" + barcode.Text + "取消出库成功\n", Color.Green, barcode);
                 LoadGridData();

+ 0 - 12
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleOut.resx

@@ -129,18 +129,6 @@
   <metadata name="afr_cucode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="afr_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="afr_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="afr_cucode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 87 - 5
UAS_MES_YD/FunctionCode/Special/Special_CancelMaekBad.Designer.cs

@@ -43,16 +43,23 @@
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Delete = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Search = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.badreason = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.mb_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mb_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mb_badcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mb_badname = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbr_brname = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbr_dutycode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbr_solutionname = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mb_stepcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.st_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Info)).BeginInit();
             this.SuspendLayout();
             // 
@@ -84,12 +91,15 @@
             this.Info.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.Info.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
+            this.mb_sncode,
             this.mb_id,
             this.mb_badcode,
             this.mb_badname,
             this.mbr_brname,
             this.mbr_dutycode,
-            this.mbr_solutionname});
+            this.mbr_solutionname,
+            this.mb_stepcode,
+            this.st_name});
             this.Info.Location = new System.Drawing.Point(12, 119);
             this.Info.Name = "Info";
             this.Info.RowTemplate.Height = 37;
@@ -129,9 +139,9 @@
             // 
             // badname
             // 
-            this.badname.Location = new System.Drawing.Point(39, 68);
+            this.badname.Location = new System.Drawing.Point(179, 70);
             this.badname.Name = "badname";
-            this.badname.Size = new System.Drawing.Size(318, 35);
+            this.badname.Size = new System.Drawing.Size(199, 35);
             this.badname.TabIndex = 224;
             // 
             // dataGridViewCheckBoxColumn1
@@ -156,6 +166,7 @@
             this.dataGridViewTextBoxColumn2.DataPropertyName = "afr_prodcode";
             this.dataGridViewTextBoxColumn2.HeaderText = "物料编号";
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.Visible = false;
             this.dataGridViewTextBoxColumn2.Width = 5;
             // 
             // dataGridViewTextBoxColumn3
@@ -190,6 +201,14 @@
             this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
             this.dataGridViewTextBoxColumn6.Width = 5;
             // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "mbr_solutionname";
+            this.dataGridViewTextBoxColumn7.HeaderText = "解决方案";
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.Width = 5;
+            // 
             // Delete
             // 
             this.Delete.AllPower = null;
@@ -197,7 +216,7 @@
             this.Delete.DownImage = ((System.Drawing.Image)(resources.GetObject("Delete.DownImage")));
             this.Delete.Image = null;
             this.Delete.IsShowBorder = true;
-            this.Delete.Location = new System.Drawing.Point(554, 65);
+            this.Delete.Location = new System.Drawing.Point(990, 66);
             this.Delete.MoveImage = ((System.Drawing.Image)(resources.GetObject("Delete.MoveImage")));
             this.Delete.Name = "Delete";
             this.Delete.NormalImage = ((System.Drawing.Image)(resources.GetObject("Delete.NormalImage")));
@@ -215,7 +234,7 @@
             this.Search.DownImage = ((System.Drawing.Image)(resources.GetObject("Search.DownImage")));
             this.Search.Image = null;
             this.Search.IsShowBorder = true;
-            this.Search.Location = new System.Drawing.Point(389, 65);
+            this.Search.Location = new System.Drawing.Point(825, 66);
             this.Search.MoveImage = ((System.Drawing.Image)(resources.GetObject("Search.MoveImage")));
             this.Search.Name = "Search";
             this.Search.NormalImage = ((System.Drawing.Image)(resources.GetObject("Search.NormalImage")));
@@ -246,6 +265,35 @@
             this.ma_code.TextBoxEnable = false;
             this.ma_code.UserControlTextChanged += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
+            // badreason
+            // 
+            this.badreason.Location = new System.Drawing.Point(543, 69);
+            this.badreason.Name = "badreason";
+            this.badreason.Size = new System.Drawing.Size(199, 35);
+            this.badreason.TabIndex = 227;
+            // 
+            // 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(32, 65);
+            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 = 228;
+            this.label1.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(387, 65);
+            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 = 229;
+            this.label2.Text = "不良原因";
+            // 
             // Choose
             // 
             this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -253,6 +301,14 @@
             this.Choose.Name = "Choose";
             this.Choose.Width = 80;
             // 
+            // mb_sncode
+            // 
+            this.mb_sncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.mb_sncode.DataPropertyName = "mb_sncode";
+            this.mb_sncode.HeaderText = "SN号";
+            this.mb_sncode.Name = "mb_sncode";
+            this.mb_sncode.Width = 5;
+            // 
             // mb_id
             // 
             this.mb_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -302,11 +358,30 @@
             this.mbr_solutionname.Name = "mbr_solutionname";
             this.mbr_solutionname.Width = 5;
             // 
+            // mb_stepcode
+            // 
+            this.mb_stepcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.mb_stepcode.DataPropertyName = "mb_stepcode";
+            this.mb_stepcode.HeaderText = "工序编号";
+            this.mb_stepcode.Name = "mb_stepcode";
+            this.mb_stepcode.Width = 5;
+            // 
+            // st_name
+            // 
+            this.st_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
+            this.st_name.DataPropertyName = "st_name";
+            this.st_name.HeaderText = "工序名称";
+            this.st_name.Name = "st_name";
+            this.st_name.Width = 5;
+            // 
             // Special_CancelMaekBad
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1566, 802);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.badreason);
             this.Controls.Add(this.Delete);
             this.Controls.Add(this.Search);
             this.Controls.Add(this.badname);
@@ -348,12 +423,19 @@
         private System.Windows.Forms.TextBox badname;
         private CustomControl.ButtonUtil.NormalButton Search;
         private CustomControl.ButtonUtil.NormalButton Delete;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
+        private System.Windows.Forms.TextBox badreason;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mb_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mb_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn mb_badcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mb_badname;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbr_brname;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbr_dutycode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbr_solutionname;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mb_stepcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn st_name;
     }
 }

+ 15 - 2
UAS_MES_YD/FunctionCode/Special/Special_CancelMaekBad.cs

@@ -35,7 +35,7 @@ namespace UAS_MES_NEW.Special
 
         private void LoadGridData()
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select mb_id,mb_badcode,mb_badname,mbr_dutycode,mbr_brname,mbr_solutionname from makebad left join MAKEBADREASON on mbr_mbid=mb_id where mb_makecode='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select mb_id,mb_sncode,mb_badcode,mb_badname,mbr_dutycode,mbr_brname,mbr_solutionname,mb_stepcode,st_name from makebad left join MAKEBADREASON on mbr_mbid=mb_id left join step on mb_stepcode=st_code where mb_makecode='" + ma_code.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(Info, dt);
         }
 
@@ -51,7 +51,16 @@ namespace UAS_MES_NEW.Special
 
         private void Search_Click(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select mb_id,mb_badcode,mb_badname,mbr_dutycode,mbr_brname,mbr_solutionname from makebad left join MAKEBADREASON on mbr_mbid=mb_id where mb_makecode='" + ma_code.Text + "' and mb_badname like '%" + badname.Text + "%'", "select");
+            string sql = "select mb_id,mb_sncode,mb_badcode,mb_badname,mbr_dutycode,mbr_brname,mbr_solutionname,mb_stepcode,st_name from makebad left join MAKEBADREASON on mbr_mbid=mb_id left join step on mb_stepcode=st_code where mb_makecode='" + ma_code.Text + "' ";
+            if (badname.Text != "")
+            {
+                sql += " and mb_badname like '%" + badname.Text + "%'";
+            }
+            if (badreason.Text != "")
+            {
+                sql += " and mbr_brname like '%" + badreason.Text + "%'";
+            }
+            DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             BaseUtil.FillDgvWithDataTable(Info, dt);
         }
 
@@ -62,10 +71,14 @@ namespace UAS_MES_NEW.Special
                 if (Info.Rows[i].Cells["Choose"].FormattedValue != null && Info.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
                 {
                     string mb_id = Info.Rows[i].Cells["mb_id"].Value.ToString();
+                    string mb_sncode = Info.Rows[i].Cells["mb_sncode"].Value.ToString();
+                    string mb_stepcode = Info.Rows[i].Cells["mb_stepcode"].Value.ToString();
                     dh.ExecuteSql("delete from makebadreason where mbr_mbid='" + mb_id + "'", "delete");
                     dh.ExecuteSql("delete from makebad where mb_id='" + mb_id + "'", "delete");
+                    dh.ExecuteSql("update steppassed set sp_ifng=0,sp_result='良品' where sp_id= (select max(sp_id) from steppassed where sp_sncode='" + mb_sncode + "' and sp_stepcode='" + mb_stepcode + "' and sp_ifng=-1)", "update");
                 }
             }
+            LoadGridData();
         }
     }
 }

+ 9 - 0
UAS_MES_YD/FunctionCode/Special/Special_CancelMaekBad.resx

@@ -120,6 +120,9 @@
   <metadata name="Choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mb_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mb_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -138,6 +141,12 @@
   <metadata name="mbr_solutionname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mb_stepcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="st_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Delete.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 292 - 0
UAS_MES_YD/FunctionCode/Special/Special_MakeBad.Designer.cs

@@ -0,0 +1,292 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_MakeBad
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            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.SuspendLayout();
+            // 
+            // Pallet_label
+            // 
+            this.Pallet_label.AutoSize = true;
+            this.Pallet_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Pallet_label.Location = new System.Drawing.Point(13, 302);
+            this.Pallet_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(114, 41);
+            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;
+            // 
+            // mbr_dutyname
+            // 
+            this.mbr_dutyname.Condition = null;
+            this.mbr_dutyname.Field = null;
+            this.mbr_dutyname.Location = new System.Drawing.Point(1100, 399);
+            this.mbr_dutyname.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbr_dutyname.Name = "mbr_dutyname";
+            this.mbr_dutyname.Size = new System.Drawing.Size(242, 35);
+            this.mbr_dutyname.TabIndex = 151;
+            this.mbr_dutyname.TableName = null;
+            this.mbr_dutyname.Value = null;
+            this.mbr_dutyname.ValueField = null;
+            // 
+            // so_name
+            // 
+            this.so_name.Condition = null;
+            this.so_name.Field = null;
+            this.so_name.Location = new System.Drawing.Point(648, 477);
+            this.so_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.so_name.Name = "so_name";
+            this.so_name.Size = new System.Drawing.Size(242, 35);
+            this.so_name.TabIndex = 150;
+            this.so_name.TableName = null;
+            this.so_name.Value = null;
+            this.so_name.ValueField = null;
+            // 
+            // nr_name
+            // 
+            this.nr_name.Condition = null;
+            this.nr_name.Field = null;
+            this.nr_name.Location = new System.Drawing.Point(648, 397);
+            this.nr_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nr_name.Name = "nr_name";
+            this.nr_name.Size = new System.Drawing.Size(242, 35);
+            this.nr_name.TabIndex = 149;
+            this.nr_name.TableName = null;
+            this.nr_name.Value = null;
+            this.nr_name.ValueField = null;
+            // 
+            // nrg_name
+            // 
+            this.nrg_name.Condition = null;
+            this.nrg_name.Field = null;
+            this.nrg_name.Location = new System.Drawing.Point(211, 397);
+            this.nrg_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nrg_name.Name = "nrg_name";
+            this.nrg_name.Size = new System.Drawing.Size(242, 35);
+            this.nrg_name.TabIndex = 148;
+            this.nrg_name.TableName = null;
+            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";
+            this.SaveRepairInf.BackColor = System.Drawing.Color.Transparent;
+            this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
+            this.SaveRepairInf.Image = null;
+            this.SaveRepairInf.IsShowBorder = true;
+            this.SaveRepairInf.Location = new System.Drawing.Point(949, 470);
+            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(6);
+            this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
+            this.SaveRepairInf.Name = "SaveRepairInf";
+            this.SaveRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.NormalImage")));
+            this.SaveRepairInf.Power = null;
+            this.SaveRepairInf.Size = new System.Drawing.Size(172, 48);
+            this.SaveRepairInf.TabIndex = 145;
+            this.SaveRepairInf.Tag = "IfRead";
+            this.SaveRepairInf.Text = "保存维修信息";
+            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
+            // 
+            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 = "不良原因组";
+            // 
+            // 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.Controls.Add(this.mbr_dutyname);
+            this.Controls.Add(this.so_name);
+            this.Controls.Add(this.nr_name);
+            this.Controls.Add(this.nrg_name);
+            this.Controls.Add(this.bc_code);
+            this.Controls.Add(this.SaveRepairInf);
+            this.Controls.Add(this.mbr_solution_label);
+            this.Controls.Add(this.mbc_component_label);
+            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.Pallet_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Name = "Special_MakeBad";
+            this.Tag = "Special!BoxSplit";
+            this.Text = "拆箱处理";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Pallate;
+        private CustomControl.ComBoxWithFocus.ComBoxWithFocus mbc_component;
+        private CustomControl.TextBoxWithIcon.BlurSearch mbr_dutyname;
+        private CustomControl.TextBoxWithIcon.BlurSearch so_name;
+        private CustomControl.TextBoxWithIcon.BlurSearch nr_name;
+        private CustomControl.TextBoxWithIcon.BlurSearch nrg_name;
+        private System.Windows.Forms.Label bc_code;
+        private CustomControl.ButtonUtil.NormalButton SaveRepairInf;
+        private System.Windows.Forms.Label mbr_solution_label;
+        private System.Windows.Forms.Label mbc_component_label;
+        private System.Windows.Forms.Label mbr_dutycode_label;
+        private System.Windows.Forms.Label nr_name_label;
+        private System.Windows.Forms.Label mbr_brgcode_label;
+    }
+}

+ 35 - 0
UAS_MES_YD/FunctionCode/Special/Special_MakeBad.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_MakeBad : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        public Special_MakeBad()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+        }
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SaveRepairInf_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 159 - 0
UAS_MES_YD/FunctionCode/Special/Special_MakeBad.resx

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="SaveRepairInf.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="SaveRepairInf.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="SaveRepairInf.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 12 - 0
UAS_MES_YD/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -741,6 +741,18 @@ namespace UAS_MES_NEW.Warehouse
             dh.ExecuteSql(sql.GetString(), "insert");
             dh.UpdateByCondition("makeserial", "ms_outno='" + pi_inoutno.Text + "'", " ms_id='" + ms_id + "'");
 
+            dt = (DataTable)dh.ExecuteSql("select ms_prodcode1 from makeserial where ms_id=" + ms_id, "select");
+            string ms_prodcode = dt.Rows[0]["ms_prodcode1"].ToString();
+            //如果产品不存在,则插入到明细表中
+            if (!dh.CheckExist("prodiodetail", "pd_piid='" + pi_id.Text + "' and pd_prodcode='" + ms_prodcode + "'"))
+            {
+                string pd_pdno = dh.getFieldDataByCondition("prodiodetail", "nvl(max(pd_pdno),0)+1", "pd_piid=" + pi_id.Text).ToString();
+                dh.ExecuteSql("insert into prodiodetail(pd_id,pd_piid,pd_inoutno,pd_pdno,pd_prodcode,pd_outqty)values(prodiodetail_seq.nextval,'" + pi_id.Text + "','"+pi_inoutno.Text+"','" + pd_pdno + "','" + ms_prodcode + "',1)", "insert");
+            }
+            else
+            {
+                dh.ExecuteSql("update prodiodetail set pd_outqty=pd_outqty+1 where pd_piid='" + pi_id.Text + "' and pd_prodcode='" + ms_prodcode + "'", "update");
+            }
         }
 
         //插入prodiomac表

+ 9 - 0
UAS_MES_YD/UAS_MES_YD.csproj

@@ -974,6 +974,12 @@
     <Compile Include="FunctionCode\SMT\SMT_WaringSetting.Designer.cs">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_MakeBad.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_MakeBad.Designer.cs">
+      <DependentUpon>Special_MakeBad.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_CancelMaekBad.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1553,6 +1559,9 @@
     <EmbeddedResource Include="FunctionCode\SMT\SMT_WaringSetting.resx">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_MakeBad.resx">
+      <DependentUpon>Special_MakeBad.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_CancelMaekBad.resx">
       <DependentUpon>Special_CancelMaekBad.cs</DependentUpon>
     </EmbeddedResource>