Browse Source

修改内容提交

callm 2 years ago
parent
commit
c537f00644

+ 35 - 4
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -44,6 +44,9 @@
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label4 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
             this.SuspendLayout();
             // 
             // ma_salecode_label
@@ -113,7 +116,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(211, 616);
+            this.label3.Location = new System.Drawing.Point(211, 648);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(82, 41);
@@ -125,7 +128,7 @@
             this.Rn.AllPower = null;
             this.Rn.BackColor = System.Drawing.Color.White;
             this.Rn.ID = null;
-            this.Rn.Location = new System.Drawing.Point(356, 622);
+            this.Rn.Location = new System.Drawing.Point(356, 654);
             this.Rn.Margin = new System.Windows.Forms.Padding(6);
             this.Rn.Name = "Rn";
             this.Rn.Power = null;
@@ -151,7 +154,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(211, 509);
+            this.label1.Location = new System.Drawing.Point(211, 489);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(82, 41);
@@ -163,7 +166,7 @@
             this.Num.AllPower = null;
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
-            this.Num.Location = new System.Drawing.Point(356, 515);
+            this.Num.Location = new System.Drawing.Point(356, 495);
             this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
@@ -251,11 +254,36 @@
             this.label4.TabIndex = 33;
             this.label4.Text = "工单号";
             // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(211, 583);
+            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(146, 41);
+            this.label6.TabIndex = 36;
+            this.label6.Text = "流水长度";
+            // 
+            // numericUpDown1
+            // 
+            this.numericUpDown1.Location = new System.Drawing.Point(356, 583);
+            this.numericUpDown1.Name = "numericUpDown1";
+            this.numericUpDown1.Size = new System.Drawing.Size(120, 35);
+            this.numericUpDown1.TabIndex = 37;
+            this.numericUpDown1.Value = new decimal(new int[] {
+            4,
+            0,
+            0,
+            0});
+            // 
             // SystemSetting_PrinterTest
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.numericUpDown1);
+            this.Controls.Add(this.label6);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.Export);
@@ -277,6 +305,7 @@
             this.Tag = "Setup!PrinterTest";
             this.Text = "打印机调试";
             this.Load += new System.EventHandler(this.SystemSetting_PrinterTest_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -298,5 +327,7 @@
         private CustomControl.ButtonUtil.NormalButton Export;
         private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
         private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.NumericUpDown numericUpDown1;
     }
 }

+ 15 - 5
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -60,6 +60,16 @@ namespace UAS_MES_NEW.SystemSetting
                 MessageBox.Show("工单号不存在");
                 return;
             }
+            /*DataTable dt = (DataTable)dh.ExecuteSql("select pr_machinetype from make left join  product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string pr_machinetype = dt.Rows[0]["pr_machinetype"].ToString();
+                if (pr_machinetype != Prefix.Text)
+                {
+                    MessageBox.Show("前缀和产品机型" + pr_machinetype + "不匹配");
+                    return;
+                }
+            }*/
             for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 4)
             {
                 int temp = i;
@@ -68,21 +78,21 @@ namespace UAS_MES_NEW.SystemSetting
                     switch (format.SubStrings[j].Name)
                     {
                         case "RN1":
-                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp).ToString()));
-                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'"+ma_code.Text+"','"+ format.SubStrings[j].Value + "','before')", "insert");
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
+                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
                             break;
                         case "RN2":
-                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 1).ToString()));
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
                             dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
 
                             break;
                         case "RN3":
-                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 2).ToString()));
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
                             dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
 
                             break;
                         case "RN4":
-                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 3).ToString()));
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 3).ToString()));
                             dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
 
                             break;

+ 2 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -121,6 +121,8 @@ namespace UAS_MES_NEW.Make
                     //调用公共方法CheckStepSNAndMacode判断工序是否正确
                     string status = "";
                     LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out status, out oErrorMessage);
+                    if (oMakeCode == ""||oMakeCode==null)
+                        oMakeCode = ma_code.Text;
                     if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
                     {
                         //IF (如果ma_code 为空)THEN

+ 1 - 1
UAS_MES_ODLF/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -49,7 +49,7 @@ namespace UAS_MES_NEW.Warehouse
             pi_inoutno.SelectField = "pi_id # ID,pi_title  # 客户名称,pi_inoutno # 出货单号,pi_type # 出货类型";
             pi_inoutno.SetValueField = new string[] { "pi_title", "pi_inoutno", "pi_id", "pi_type" };
             pi_inoutno.FormName = Name;
-            pi_inoutno.Condition = "pi_pdastatus<>'已出库' and pi_class='出货单'";
+            pi_inoutno.Condition = "pi_pdastatus<>'已出库' and pi_class in('出货单','其它出库单','拨出单')";
             pi_inoutno.DbChange += Pi_inoutno_DbChange;
             asc.controllInitializeSize(this);
             dh = SystemInf.dh;

+ 21 - 9
UAS_MES_YD/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -373,10 +373,10 @@ namespace UAS_MES_NEW.Packing
             }
             BaseUtil.FillDgvWithDataTable(PackageInf, dt);
         }
-
+        DataTable _dt;
         private void FillPrintLabel()
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='栈板标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='栈板标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "la_url";
             PrintLabel.ValueMember = "la_id";
@@ -423,16 +423,28 @@ namespace UAS_MES_NEW.Packing
                         outboxcode.Focus();
                         outboxcode.SelectAll();
                     }
-                    //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    for (int i = 0; i < _dt.Rows.Count; i++)
                     {
-                        OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
-                    }
-                    else
-                    {
-                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        if (Print.BarTender(Tag.ToString(), ref engine, _dt.Rows[i]["la_url"].ToString(), _dt.Rows[i]["la_id"].ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                        {
+                            //提示用户打印成功
+                            OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        }
                     }
 
+                    //if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    //{
+                    //    OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
+                    //}
+                    //else
+                    //{
+                    //    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                    //}
+
                 }
                 else OperateResult.AppendText(">>必须封栈板才能进行打印\n", Color.Red);
             }

+ 66 - 130
UAS_MES_YD/FunctionCode/Special/Special_CancelImei.Designer.cs

@@ -29,28 +29,25 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_CancelImei));
-            this.SN_label = new System.Windows.Forms.Label();
+            this.Pallet_label = new System.Windows.Forms.Label();
             this.bc_code = new System.Windows.Forms.Label();
-            this.st_rstepcode_label = new System.Windows.Forms.Label();
-            this.ma_craftcode_label = new System.Windows.Forms.Label();
-            this.cd_stepcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.cr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.nr_name_label = new System.Windows.Forms.Label();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.SN = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.cd_stepno = new System.Windows.Forms.Label();
+            this.IMEI = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Reason = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             // 
-            // SN_label
+            // Pallet_label
             // 
-            this.SN_label.AutoSize = true;
-            this.SN_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SN_label.Location = new System.Drawing.Point(115, 90);
-            this.SN_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.SN_label.Name = "SN_label";
-            this.SN_label.Size = new System.Drawing.Size(62, 41);
-            this.SN_label.TabIndex = 1;
-            this.SN_label.Text = "SN";
+            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(253, 266);
+            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(85, 41);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "IMEI";
             // 
             // bc_code
             // 
@@ -64,79 +61,22 @@
             this.bc_code.TabIndex = 146;
             this.bc_code.Visible = false;
             // 
-            // st_rstepcode_label
-            // 
-            this.st_rstepcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.st_rstepcode_label.AutoSize = true;
-            this.st_rstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.st_rstepcode_label.Location = new System.Drawing.Point(115, 257);
-            this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.st_rstepcode_label.Name = "st_rstepcode_label";
-            this.st_rstepcode_label.Size = new System.Drawing.Size(146, 41);
-            this.st_rstepcode_label.TabIndex = 152;
-            this.st_rstepcode_label.Text = "回流工序";
-            // 
-            // ma_craftcode_label
-            // 
-            this.ma_craftcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.ma_craftcode_label.AutoSize = true;
-            this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode_label.Location = new System.Drawing.Point(114, 177);
-            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ma_craftcode_label.Name = "ma_craftcode_label";
-            this.ma_craftcode_label.Size = new System.Drawing.Size(146, 41);
-            this.ma_craftcode_label.TabIndex = 153;
-            this.ma_craftcode_label.Text = "回流途程";
-            // 
-            // cd_stepcode
-            // 
-            this.cd_stepcode.AllPower = "ifall";
-            this.cd_stepcode.Caller = null;
-            this.cd_stepcode.Condition = null;
-            this.cd_stepcode.DBTitle = "回流工序";
-            this.cd_stepcode.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.cd_stepcode.FormName = null;
-            this.cd_stepcode.Location = new System.Drawing.Point(279, 257);
-            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(6);
-            this.cd_stepcode.Name = "cd_stepcode";
-            this.cd_stepcode.Power = "ifspecial";
-            this.cd_stepcode.ReturnData = null;
-            this.cd_stepcode.SelectField = null;
-            this.cd_stepcode.SetValueField = null;
-            this.cd_stepcode.Size = new System.Drawing.Size(318, 44);
-            this.cd_stepcode.TabIndex = 155;
-            this.cd_stepcode.TableName = null;
-            this.cd_stepcode.Tag = "";
-            this.cd_stepcode.TextBoxEnable = false;
-            // 
-            // cr_code
-            // 
-            this.cr_code.AllPower = "ifall";
-            this.cr_code.Caller = null;
-            this.cr_code.Condition = null;
-            this.cr_code.DBTitle = "回流途程";
-            this.cr_code.Enabled = false;
-            this.cr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.cr_code.FormName = null;
-            this.cr_code.Location = new System.Drawing.Point(279, 177);
-            this.cr_code.Margin = new System.Windows.Forms.Padding(6);
-            this.cr_code.Name = "cr_code";
-            this.cr_code.Power = "ifspecial";
-            this.cr_code.ReturnData = null;
-            this.cr_code.SelectField = null;
-            this.cr_code.SetValueField = null;
-            this.cr_code.Size = new System.Drawing.Size(318, 46);
-            this.cr_code.TabIndex = 154;
-            this.cr_code.TableName = null;
-            this.cr_code.Tag = "ma_craftcode";
-            this.cr_code.TextBoxEnable = false;
+            // 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(255, 347);
+            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(82, 41);
+            this.nr_name_label.TabIndex = 141;
+            this.nr_name_label.Text = "原因";
             // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(812, 50);
+            this.OperateResult.Location = new System.Drawing.Point(791, 109);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(8);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(460, 614);
@@ -150,7 +90,7 @@
             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(307, 449);
+            this.SaveRepairInf.Location = new System.Drawing.Point(443, 500);
             this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(6);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
@@ -159,57 +99,56 @@
             this.SaveRepairInf.Size = new System.Drawing.Size(172, 48);
             this.SaveRepairInf.TabIndex = 145;
             this.SaveRepairInf.Tag = "IfRead";
-            this.SaveRepairInf.Text = "确认回流";
+            this.SaveRepairInf.Text = "确认取消";
             this.SaveRepairInf.UseVisualStyleBackColor = true;
             this.SaveRepairInf.Click += new System.EventHandler(this.SaveRepairInf_Click);
             // 
-            // SN
-            // 
-            this.SN.AllPower = null;
-            this.SN.BackColor = System.Drawing.Color.White;
-            this.SN.ID = null;
-            this.SN.Location = new System.Drawing.Point(279, 96);
-            this.SN.Margin = new System.Windows.Forms.Padding(4);
-            this.SN.Name = "SN";
-            this.SN.Power = null;
-            this.SN.Size = new System.Drawing.Size(318, 35);
-            this.SN.Str = null;
-            this.SN.Str1 = null;
-            this.SN.Str2 = null;
-            this.SN.TabIndex = 2;
-            this.SN.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SN_KeyDown);
-            // 
-            // cd_stepno
-            // 
-            this.cd_stepno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.cd_stepno.AutoSize = true;
-            this.cd_stepno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cd_stepno.Location = new System.Drawing.Point(125, 343);
-            this.cd_stepno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.cd_stepno.Name = "cd_stepno";
-            this.cd_stepno.Size = new System.Drawing.Size(0, 41);
-            this.cd_stepno.TabIndex = 156;
+            // IMEI
+            // 
+            this.IMEI.AllPower = null;
+            this.IMEI.BackColor = System.Drawing.Color.White;
+            this.IMEI.ID = null;
+            this.IMEI.Location = new System.Drawing.Point(375, 272);
+            this.IMEI.Margin = new System.Windows.Forms.Padding(4);
+            this.IMEI.Name = "IMEI";
+            this.IMEI.Power = null;
+            this.IMEI.Size = new System.Drawing.Size(318, 35);
+            this.IMEI.Str = null;
+            this.IMEI.Str1 = null;
+            this.IMEI.Str2 = null;
+            this.IMEI.TabIndex = 2;
+            // 
+            // Reason
+            // 
+            this.Reason.AllPower = null;
+            this.Reason.BackColor = System.Drawing.Color.White;
+            this.Reason.ID = null;
+            this.Reason.Location = new System.Drawing.Point(375, 356);
+            this.Reason.Margin = new System.Windows.Forms.Padding(4);
+            this.Reason.Name = "Reason";
+            this.Reason.Power = null;
+            this.Reason.Size = new System.Drawing.Size(318, 35);
+            this.Reason.Str = null;
+            this.Reason.Str1 = null;
+            this.Reason.Str2 = null;
+            this.Reason.TabIndex = 151;
             // 
             // Special_CancelImei
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1384, 713);
-            this.Controls.Add(this.cd_stepno);
-            this.Controls.Add(this.cd_stepcode);
-            this.Controls.Add(this.st_rstepcode_label);
-            this.Controls.Add(this.ma_craftcode_label);
-            this.Controls.Add(this.cr_code);
+            this.ClientSize = new System.Drawing.Size(1384, 1054);
+            this.Controls.Add(this.Reason);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.bc_code);
             this.Controls.Add(this.SaveRepairInf);
-            this.Controls.Add(this.SN);
-            this.Controls.Add(this.SN_label);
+            this.Controls.Add(this.nr_name_label);
+            this.Controls.Add(this.IMEI);
+            this.Controls.Add(this.Pallet_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Special_CancelImei";
-            this.Tag = "Special!CancelOQC";
+            this.Tag = "Special!BoxSplit";
             this.Text = "拆箱处理";
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.ResumeLayout(false);
@@ -218,15 +157,12 @@
         }
 
         #endregion
-        private System.Windows.Forms.Label SN_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox SN;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox IMEI;
         private System.Windows.Forms.Label bc_code;
         private CustomControl.ButtonUtil.NormalButton SaveRepairInf;
+        private System.Windows.Forms.Label nr_name_label;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private CustomControl.TextBoxWithIcon.SearchTextBox cd_stepcode;
-        private System.Windows.Forms.Label st_rstepcode_label;
-        private System.Windows.Forms.Label ma_craftcode_label;
-        private CustomControl.TextBoxWithIcon.SearchTextBox cr_code;
-        private System.Windows.Forms.Label cd_stepno;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Reason;
     }
 }

+ 48 - 48
UAS_MES_YD/FunctionCode/Special/Special_CancelImei.cs

@@ -1,6 +1,5 @@
 using System;
 using System.Data;
-using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
@@ -14,9 +13,6 @@ namespace UAS_MES_NEW.Special
 
         LogStringBuilder sql = new LogStringBuilder();
 
-
-        DataTable Dbfind;
-
         public Special_CancelImei()
         {
             InitializeComponent();
@@ -25,58 +21,62 @@ namespace UAS_MES_NEW.Special
         private void Special_BoxSplit_Load(object sender, EventArgs e)
         {
             dh = SystemInf.dh;
-
-            cd_stepcode.FormName = Name;
-            cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
-            cd_stepcode.SetValueField = new string[] { "cd_stepcode", "cd_stepno" };
-            cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
-            cd_stepcode.DBTitle = "回流工序";
-            cd_stepcode.DbChange += Cd_stepcode_DbChange;
         }
 
-        private void Cd_stepcode_DbChange(object sender, EventArgs e)
+        private void Split_Click(object sender, EventArgs e)
         {
-            Dbfind = cd_stepcode.ReturnData;
-            BaseUtil.SetFormValue(this.Controls, Dbfind);
-        }
-        string ms_id = "";
-
-        private void SaveRepairInf_Click(object sender, EventArgs e)
-        {
-            if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
-            if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_firstsn,ms_sncode,ms_prodcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
-
-            if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在或未执行过" + cd_stepcode.Text + "工序\n"); return; }
-            string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
-            string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
-            string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-
-            StringBuilder sql = new StringBuilder();
-            sql.Append("update craftmaterial set cm_status=-1 where  cm_stepcode in (select cd_stepcode from craft left join ");
-            sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "'  and cd_detno >= " + cd_stepno.Text + ") ");
-            sql.Append("and cm_firstsn='" + ms_firstsn + "' and cm_makecode='" + ms_makecode + "'");
-            dh.ExecuteSql(sql.ToString(), "update");
 
-            dh.ExecuteSql("update makeserial set ms_nextstepcode='" + cd_stepcode.Text + "' where ms_id='" + ms_id + "'", "update");
-
-            OperateResult.AppendText(">>" + SN.Text + "回流成功\n");
-            ms_id = "";
         }
 
-        private void SN_KeyDown(object sender, KeyEventArgs e)
+        private void SaveRepairInf_Click(object sender, EventArgs e)
         {
-            if (e.KeyCode == Keys.Enter)
+            if (Reason.Text == "")
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select ms_id,ms_craftcode,ms_prodcode from makeserial where ms_sncode='" + SN.Text + "' order by ms_id desc", "select");
-
-                if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在\n"); return; }
-
-                ms_id = dt.Rows[0]["ms_id"].ToString();
-                cr_code.Text = dt.Rows[0]["ms_craftcode"].ToString();
-                string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-                cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode + "' order by cd_stepno";
-
+                MessageBox.Show("必须填写原因");
+                return;
+            }
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei1 ='" + IMEI.Text + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei1='" + IMEI.Text + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    string sn = dt.Rows[0]["ms_sncode"].ToString();
+                    string pr_detail = dt.Rows[0]["pr_detail"].ToString();
+                    dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei1='' where ms_imei1='" + IMEI.Text + "'", "update");
+                    dh.ExecuteSql("update sninfo set si_imei1='' where si_imei1='" + IMEI.Text + "'", "update");
+                    LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
+                    OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
+                }
+                else
+                {
+                    OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
+                }
+            }
+            else
+            {
+                dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei2 ='" + IMEI.Text + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei2='" + IMEI.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        string sn = dt.Rows[0]["ms_sncode"].ToString();
+                        string pr_detail = dt.Rows[0]["pr_detail"].ToString();
+                        dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei2='' where ms_imei2='" + IMEI.Text + "'", "update");
+                        dh.ExecuteSql("update sninfo set si_imei2='' where si_imei2='" + IMEI.Text + "'", "update");
+                        LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
+                        OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
+                }
             }
         }
     }

+ 232 - 0
UAS_MES_YD/FunctionCode/Special/Special_CancelOQC.Designer.cs

@@ -0,0 +1,232 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_CancelOQC
+    {
+        /// <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_CancelImei));
+            this.SN_label = new System.Windows.Forms.Label();
+            this.bc_code = new System.Windows.Forms.Label();
+            this.st_rstepcode_label = new System.Windows.Forms.Label();
+            this.ma_craftcode_label = new System.Windows.Forms.Label();
+            this.cd_stepcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.cr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.SN = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.cd_stepno = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // SN_label
+            // 
+            this.SN_label.AutoSize = true;
+            this.SN_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SN_label.Location = new System.Drawing.Point(115, 90);
+            this.SN_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.SN_label.Name = "SN_label";
+            this.SN_label.Size = new System.Drawing.Size(62, 41);
+            this.SN_label.TabIndex = 1;
+            this.SN_label.Text = "SN";
+            // 
+            // 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;
+            // 
+            // st_rstepcode_label
+            // 
+            this.st_rstepcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.st_rstepcode_label.AutoSize = true;
+            this.st_rstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.st_rstepcode_label.Location = new System.Drawing.Point(115, 257);
+            this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.st_rstepcode_label.Name = "st_rstepcode_label";
+            this.st_rstepcode_label.Size = new System.Drawing.Size(146, 41);
+            this.st_rstepcode_label.TabIndex = 152;
+            this.st_rstepcode_label.Text = "回流工序";
+            // 
+            // ma_craftcode_label
+            // 
+            this.ma_craftcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ma_craftcode_label.AutoSize = true;
+            this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_craftcode_label.Location = new System.Drawing.Point(114, 177);
+            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_craftcode_label.Name = "ma_craftcode_label";
+            this.ma_craftcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_craftcode_label.TabIndex = 153;
+            this.ma_craftcode_label.Text = "回流途程";
+            // 
+            // cd_stepcode
+            // 
+            this.cd_stepcode.AllPower = "ifall";
+            this.cd_stepcode.Caller = null;
+            this.cd_stepcode.Condition = null;
+            this.cd_stepcode.DBTitle = "回流工序";
+            this.cd_stepcode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.cd_stepcode.FormName = null;
+            this.cd_stepcode.Location = new System.Drawing.Point(279, 257);
+            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(6);
+            this.cd_stepcode.Name = "cd_stepcode";
+            this.cd_stepcode.Power = "ifspecial";
+            this.cd_stepcode.ReturnData = null;
+            this.cd_stepcode.SelectField = null;
+            this.cd_stepcode.SetValueField = null;
+            this.cd_stepcode.Size = new System.Drawing.Size(318, 44);
+            this.cd_stepcode.TabIndex = 155;
+            this.cd_stepcode.TableName = null;
+            this.cd_stepcode.Tag = "";
+            this.cd_stepcode.TextBoxEnable = false;
+            // 
+            // cr_code
+            // 
+            this.cr_code.AllPower = "ifall";
+            this.cr_code.Caller = null;
+            this.cr_code.Condition = null;
+            this.cr_code.DBTitle = "回流途程";
+            this.cr_code.Enabled = false;
+            this.cr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.cr_code.FormName = null;
+            this.cr_code.Location = new System.Drawing.Point(279, 177);
+            this.cr_code.Margin = new System.Windows.Forms.Padding(6);
+            this.cr_code.Name = "cr_code";
+            this.cr_code.Power = "ifspecial";
+            this.cr_code.ReturnData = null;
+            this.cr_code.SelectField = null;
+            this.cr_code.SetValueField = null;
+            this.cr_code.Size = new System.Drawing.Size(318, 46);
+            this.cr_code.TabIndex = 154;
+            this.cr_code.TableName = null;
+            this.cr_code.Tag = "ma_craftcode";
+            this.cr_code.TextBoxEnable = false;
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(812, 50);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(8);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(460, 614);
+            this.OperateResult.TabIndex = 150;
+            this.OperateResult.Text = "";
+            // 
+            // 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(307, 449);
+            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);
+            // 
+            // SN
+            // 
+            this.SN.AllPower = null;
+            this.SN.BackColor = System.Drawing.Color.White;
+            this.SN.ID = null;
+            this.SN.Location = new System.Drawing.Point(279, 96);
+            this.SN.Margin = new System.Windows.Forms.Padding(4);
+            this.SN.Name = "SN";
+            this.SN.Power = null;
+            this.SN.Size = new System.Drawing.Size(318, 35);
+            this.SN.Str = null;
+            this.SN.Str1 = null;
+            this.SN.Str2 = null;
+            this.SN.TabIndex = 2;
+            this.SN.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SN_KeyDown);
+            // 
+            // cd_stepno
+            // 
+            this.cd_stepno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.cd_stepno.AutoSize = true;
+            this.cd_stepno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cd_stepno.Location = new System.Drawing.Point(125, 343);
+            this.cd_stepno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.cd_stepno.Name = "cd_stepno";
+            this.cd_stepno.Size = new System.Drawing.Size(0, 41);
+            this.cd_stepno.TabIndex = 156;
+            // 
+            // Special_CancelImei
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1384, 713);
+            this.Controls.Add(this.cd_stepno);
+            this.Controls.Add(this.cd_stepcode);
+            this.Controls.Add(this.st_rstepcode_label);
+            this.Controls.Add(this.ma_craftcode_label);
+            this.Controls.Add(this.cr_code);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.bc_code);
+            this.Controls.Add(this.SaveRepairInf);
+            this.Controls.Add(this.SN);
+            this.Controls.Add(this.SN_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Special_CancelImei";
+            this.Tag = "Special!CancelOQC";
+            this.Text = "拆箱处理";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Label SN_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox SN;
+        private System.Windows.Forms.Label bc_code;
+        private CustomControl.ButtonUtil.NormalButton SaveRepairInf;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.TextBoxWithIcon.SearchTextBox cd_stepcode;
+        private System.Windows.Forms.Label st_rstepcode_label;
+        private System.Windows.Forms.Label ma_craftcode_label;
+        private CustomControl.TextBoxWithIcon.SearchTextBox cr_code;
+        private System.Windows.Forms.Label cd_stepno;
+    }
+}

+ 104 - 0
UAS_MES_YD/FunctionCode/Special/Special_CancelOQC.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Data;
+using System.Text;
+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_CancelOQC : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+
+        DataTable Dbfind;
+
+        public Special_CancelOQC()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+
+            cd_stepcode.FormName = Name;
+            cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
+            cd_stepcode.SetValueField = new string[] { "cd_stepcode", "cd_stepno" };
+            cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
+            cd_stepcode.DBTitle = "回流工序";
+            cd_stepcode.DbChange += Cd_stepcode_DbChange;
+        }
+
+        private void Cd_stepcode_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = cd_stepcode.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+        string ms_id = "";
+
+        private void SaveRepairInf_Click(object sender, EventArgs e)
+        {
+            if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
+            if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+
+            if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在或未执行过" + cd_stepcode.Text + "工序\n"); return; }
+
+            string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
+            string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
+            string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+            string ms_sncode = dt.Rows[0]["ms_sncode"].ToString();
+            string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+            string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
+
+            if (cr_code.Text != "" && cr_code.Text != ms_craftcode) { OperateResult.AppendText(">>序列号途程和所选途程不一致\n"); return; }
+
+            dt = (DataTable)dh.ExecuteSql("select cd_id from craft left join craftdetail on cr_id=cd_crid where cr_prodcode='" + ms_prodcode + "' and cr_code='" + ms_craftcode + "' and cd_stepcode='" + cd_stepcode.Text + "'", "select");
+            if (dt.Rows.Count == 0) { OperateResult.AppendText(">>工序不在所选途程中\n"); return; }
+
+            StringBuilder sql = new StringBuilder();
+            sql.Append("update craftmaterial set cm_status=-1 where  cm_stepcode in (select cd_stepcode from craft left join ");
+            sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "'  and cd_detno >= " + cd_stepno.Text + ") ");
+            sql.Append("and cm_firstsn='" + ms_firstsn + "' and cm_makecode='" + ms_makecode + "'");
+            dh.ExecuteSql(sql.ToString(), "update");
+
+            dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + ms_sncode + "'", "update");
+
+            dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=(select count(1) from oqcbatchdetail where obd_checkno='" + ms_checkno + "') where ob_checkno='" + ms_checkno + "'", "update");
+
+            dh.ExecuteSql("update makeserial set ms_nextstepcode='" + cd_stepcode.Text + "',ms_checkno='' where ms_id='" + ms_id + "'", "update");
+
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "OQC回流", "回流成功", ms_sncode, ms_checkno);
+            OperateResult.AppendText(">>" + SN.Text + "回流成功\n");
+            //cr_code.Text = "";
+            //cd_stepcode.Text = "";
+            SN.Text = "";
+            ms_id = "";
+        }
+
+        private void SN_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                DataTable dt = (DataTable)dh.ExecuteSql("select ms_id,ms_craftcode,ms_prodcode,ms_checkno from makeserial where ms_sncode='" + SN.Text + "' order by ms_id desc", "select");
+
+                if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在\n", System.Drawing.Color.Red, SN); return; }
+
+                ms_id = dt.Rows[0]["ms_id"].ToString();
+                string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+
+                if (ms_checkno == "") { OperateResult.AppendText(">>" + SN.Text + "不存在抽检批次中\n", System.Drawing.Color.Red, SN); return; }
+
+                cr_code.Text = dt.Rows[0]["ms_craftcode"].ToString();
+                string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode + "' order by cd_stepno";
+                SaveRepairInf_Click(sender, e);
+            }
+        }
+    }
+}

+ 159 - 0
UAS_MES_YD/FunctionCode/Special/Special_CancelOQC.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>

+ 9 - 0
UAS_MES_YD/UAS_MES_YD.csproj

@@ -998,6 +998,12 @@
     <Compile Include="FunctionCode\SMT\SMT_WaringSetting.Designer.cs">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_CancelOQC.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_CancelOQC.Designer.cs">
+      <DependentUpon>Special_CancelOQC.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_CancelImei.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1608,6 +1614,9 @@
     <EmbeddedResource Include="FunctionCode\SMT\SMT_WaringSetting.resx">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_CancelOQC.resx">
+      <DependentUpon>Special_CancelOQC.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_CancelImei.resx">
       <DependentUpon>Special_CancelImei.cs</DependentUpon>
     </EmbeddedResource>