Browse Source

SMT快速维修界面功能调整

caosy 6 years ago
parent
commit
d0fd6ab654

+ 32 - 17
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_Repair));
             this.label14 = new System.Windows.Forms.Label();
             this.bc_name_label = new System.Windows.Forms.Label();
@@ -42,8 +43,8 @@
             this.GetSNCode_Label = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.BadCodeTree = new System.Windows.Forms.TreeView();
-            this.LocationSource = new System.Windows.Forms.BindingSource();
-            this.ComponentSource = new System.Windows.Forms.BindingSource();
+            this.LocationSource = new System.Windows.Forms.BindingSource(this.components);
+            this.ComponentSource = new System.Windows.Forms.BindingSource(this.components);
             this.bc_code = new System.Windows.Forms.Label();
             this.bg_code = new System.Windows.Forms.Label();
             this.nrg_code = new System.Windows.Forms.Label();
@@ -94,6 +95,7 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.NewBadCode = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.QuickRepair = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -426,7 +428,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_reworkcheckno.AutoSize = true;
             this.ms_reworkcheckno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_reworkcheckno.Location = new System.Drawing.Point(791, 58);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(790, 57);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
             this.ms_reworkcheckno.Size = new System.Drawing.Size(74, 21);
             this.ms_reworkcheckno.TabIndex = 129;
@@ -439,7 +441,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             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(202, 26);
+            this.ms_makecode_label.Location = new System.Drawing.Point(201, 25);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_makecode_label.TabIndex = 37;
@@ -451,7 +453,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(14, 25);
+            this.ms_sncode_label.Location = new System.Drawing.Point(13, 24);
             this.ms_sncode_label.Name = "ms_sncode_label";
             this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_sncode_label.TabIndex = 38;
@@ -463,7 +465,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_checkno.AutoSize = true;
             this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_checkno.Location = new System.Drawing.Point(789, 26);
+            this.ms_checkno.Location = new System.Drawing.Point(788, 25);
             this.ms_checkno.Name = "ms_checkno";
             this.ms_checkno.Size = new System.Drawing.Size(74, 21);
             this.ms_checkno.TabIndex = 128;
@@ -497,7 +499,7 @@
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.CutLength = null;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(89, 26);
+            this.ms_sncode.Location = new System.Drawing.Point(88, 25);
             this.ms_sncode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Size = new System.Drawing.Size(0, 21);
@@ -528,7 +530,7 @@
             this.nr_code.AutoSize = true;
             this.nr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_code.ForeColor = System.Drawing.Color.Black;
-            this.nr_code.Location = new System.Drawing.Point(839, 221);
+            this.nr_code.Location = new System.Drawing.Point(838, 220);
             this.nr_code.Name = "nr_code";
             this.nr_code.Size = new System.Drawing.Size(0, 21);
             this.nr_code.TabIndex = 125;
@@ -539,7 +541,7 @@
             | 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(264, 64);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(263, 63);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
             this.st_rstepcode_label.Size = new System.Drawing.Size(74, 21);
             this.st_rstepcode_label.TabIndex = 65;
@@ -551,7 +553,7 @@
             | 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(14, 64);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(13, 63);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
             this.ma_craftcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_craftcode_label.TabIndex = 66;
@@ -584,7 +586,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(636, 26);
+            this.pr_detail_label.Location = new System.Drawing.Point(635, 25);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 61;
@@ -596,7 +598,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_prodcode_label.AutoSize = true;
             this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode_label.Location = new System.Drawing.Point(407, 26);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(406, 25);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
             this.ms_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_prodcode_label.TabIndex = 62;
@@ -609,7 +611,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(732, 26);
+            this.pr_detail.Location = new System.Drawing.Point(731, 25);
             this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
@@ -622,7 +624,7 @@
             this.ms_prodcode.AutoSize = true;
             this.ms_prodcode.CutLength = null;
             this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode.Location = new System.Drawing.Point(503, 26);
+            this.ms_prodcode.Location = new System.Drawing.Point(502, 25);
             this.ms_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_prodcode.Name = "ms_prodcode";
             this.ms_prodcode.Size = new System.Drawing.Size(0, 21);
@@ -636,7 +638,7 @@
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(282, 26);
+            this.ms_makecode.Location = new System.Drawing.Point(281, 25);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 21);
@@ -964,11 +966,23 @@
             this.SaveBadLocation.UseVisualStyleBackColor = true;
             this.SaveBadLocation.Click += new System.EventHandler(this.SaveBadLocation_Click);
             // 
+            // QuickRepair
+            // 
+            this.QuickRepair.AutoSize = true;
+            this.QuickRepair.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.QuickRepair.Location = new System.Drawing.Point(487, 531);
+            this.QuickRepair.Name = "QuickRepair";
+            this.QuickRepair.Size = new System.Drawing.Size(95, 25);
+            this.QuickRepair.TabIndex = 140;
+            this.QuickRepair.Text = "SMT回流";
+            this.QuickRepair.UseVisualStyleBackColor = true;
+            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(900, 579);
+            this.Controls.Add(this.QuickRepair);
             this.Controls.Add(this.mbc_component);
             this.Controls.Add(this.mbr_dutycode);
             this.Controls.Add(this.so_code);
@@ -1018,12 +1032,12 @@
             this.SizeChanged += new System.EventHandler(this.Make_Repair_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.mbp_partdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.mbl_locdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.RefreshTreeView)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -1094,5 +1108,6 @@
         private System.Windows.Forms.Label so_code;
         private System.Windows.Forms.Label mbr_dutycode;
         private CustomControl.ComBoxWithFocus.ComBoxWithFocus mbc_component;
+        private System.Windows.Forms.CheckBox QuickRepair;
     }
 }

+ 6 - 3
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -319,6 +319,9 @@ namespace UAS_MES.Make
                     else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
                 else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+
+                if(QuickRepair.Checked)
+                RepairComplete_Click(sender, new EventArgs());
             }
         }
 
@@ -437,7 +440,7 @@ namespace UAS_MES.Make
                     TreeNode tnode_1 = new TreeNode();
                     //存放子节点的信息
                     Dictionary<string, string> dic1 = new Dictionary<string, string>();
-                    string mbr_id = dt1.Rows[j]["mbr_id"].ToString();
+                    mbr_id = dt1.Rows[j]["mbr_id"].ToString();
                     tnode_1.Tag = mbr_id;
                     dic1.Add("mbr_id", mbr_id);
                     dic1.Add("mbr_brcode", dt1.Rows[j]["mbr_id"].ToString());
@@ -572,8 +575,8 @@ namespace UAS_MES.Make
                     //取消最近拆解部件
                     SQLS.Add("update craftmaterial set cm_lastdeco=0 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode.Text + "' and nvl(cm_lastdeco,0)<>0");           
                     dh.ExecuteSQLTran(SQLS.ToArray());
-                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
+                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修", User.UserCode);
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修", ms_sncode.Text, ms_checkno.Text);
                     OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);
                     cd_stepcode.Enabled = true;
                     BaseUtil.CleanForm(this);

+ 12 - 0
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -206,6 +206,18 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 230 - 229
UAS-MES/FunctionCode/Make/Make_SmtTestCollection.Designer.cs

@@ -44,16 +44,10 @@
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.mc_restqty_label = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
-            this.ob_sendqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.label7 = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
-            this.SendCheck = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ob_batchqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ob_batchqty_label = new System.Windows.Forms.Label();
-            this.ob_nowcheckqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
-            this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_inqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
@@ -63,22 +57,7 @@
             this.ma_salecode = new System.Windows.Forms.Label();
             this.pr_sendchecktype = new System.Windows.Forms.Label();
             this.MakeBadView = new System.Windows.Forms.DataGridView();
-            this.choose1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.mb_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbr_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mb_badcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mb_badname = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mb_bgname = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mb_bgcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbc_component = new System.Windows.Forms.DataGridViewComboBoxColumn();
-            this.mbp_part = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbl_loc = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.WaitChooseDGV = new System.Windows.Forms.DataGridView();
-            this.ChooseAll = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.bc_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bc_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.badloc_label = new System.Windows.Forms.Label();
             this.mbp_part_label = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
@@ -99,9 +78,30 @@
             this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.psl_location = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bd_soncode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ChooseAll = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.bc_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bc_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.choose1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.mb_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mbr_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mb_badcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mb_badname = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mb_bgname = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mb_bgcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mbc_component = new System.Windows.Forms.DataGridViewComboBoxColumn();
+            this.mbp_part = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mbl_loc = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ob_sendqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.SendCheck = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ob_batchqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ob_nowcheckqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_inqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.LockMakeCode = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
@@ -284,19 +284,6 @@
             this.panel1.Size = new System.Drawing.Size(315, 127);
             this.panel1.TabIndex = 71;
             // 
-            // ob_sendqty
-            // 
-            this.ob_sendqty.AutoSize = true;
-            this.ob_sendqty.CutLength = null;
-            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
-            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_sendqty.Name = "ob_sendqty";
-            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_sendqty.TabIndex = 78;
-            this.ob_sendqty.Tag = "ob_batchqty";
-            // 
             // label7
             // 
             this.label7.AutoSize = true;
@@ -321,39 +308,6 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
-            // SendCheck
-            // 
-            this.SendCheck.AllPower = null;
-            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
-            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
-            this.SendCheck.Enabled = false;
-            this.SendCheck.Image = null;
-            this.SendCheck.IsShowBorder = true;
-            this.SendCheck.Location = new System.Drawing.Point(229, 90);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
-            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
-            this.SendCheck.Name = "SendCheck";
-            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
-            this.SendCheck.Power = null;
-            this.SendCheck.Size = new System.Drawing.Size(65, 26);
-            this.SendCheck.TabIndex = 72;
-            this.SendCheck.Text = "送检";
-            this.SendCheck.UseVisualStyleBackColor = false;
-            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
-            // 
-            // ob_batchqty
-            // 
-            this.ob_batchqty.AutoSize = true;
-            this.ob_batchqty.CutLength = null;
-            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
-            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_batchqty.TabIndex = 75;
-            this.ob_batchqty.Tag = "ob_batchqty";
-            // 
             // ob_batchqty_label
             // 
             this.ob_batchqty_label.AutoSize = true;
@@ -365,19 +319,6 @@
             this.ob_batchqty_label.TabIndex = 74;
             this.ob_batchqty_label.Text = "抽检批数";
             // 
-            // ob_nowcheckqty
-            // 
-            this.ob_nowcheckqty.AutoSize = true;
-            this.ob_nowcheckqty.CutLength = null;
-            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
-            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
-            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_nowcheckqty.TabIndex = 73;
-            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
-            // 
             // ob_nowcheckqty_label
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
@@ -389,30 +330,6 @@
             this.ob_nowcheckqty_label.TabIndex = 72;
             this.ob_nowcheckqty_label.Text = "当前批数";
             // 
-            // mcd_remainqty
-            // 
-            this.mcd_remainqty.AutoSize = true;
-            this.mcd_remainqty.CutLength = null;
-            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_remainqty.TabIndex = 57;
-            this.mcd_remainqty.Tag = "mcd_remainqty";
-            // 
-            // mcd_inqty
-            // 
-            this.mcd_inqty.AutoSize = true;
-            this.mcd_inqty.CutLength = null;
-            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_inqty.TabIndex = 54;
-            this.mcd_inqty.Tag = "mcd_inqty";
-            // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
@@ -501,92 +418,6 @@
             this.MakeBadView.Size = new System.Drawing.Size(412, 223);
             this.MakeBadView.TabIndex = 195;
             // 
-            // choose1
-            // 
-            this.choose1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.choose1.HeaderText = "勾选";
-            this.choose1.MinimumWidth = 60;
-            this.choose1.Name = "choose1";
-            this.choose1.Width = 60;
-            // 
-            // mb_id
-            // 
-            this.mb_id.DataPropertyName = "mb_id";
-            this.mb_id.HeaderText = "mb_id";
-            this.mb_id.Name = "mb_id";
-            this.mb_id.Visible = false;
-            // 
-            // mbr_id
-            // 
-            this.mbr_id.DataPropertyName = "mbr_id";
-            this.mbr_id.HeaderText = "mbr_id";
-            this.mbr_id.Name = "mbr_id";
-            this.mbr_id.Visible = false;
-            // 
-            // mb_badcode
-            // 
-            this.mb_badcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.mb_badcode.DataPropertyName = "mb_badcode";
-            this.mb_badcode.HeaderText = "不良代码";
-            this.mb_badcode.MinimumWidth = 80;
-            this.mb_badcode.Name = "mb_badcode";
-            this.mb_badcode.ReadOnly = true;
-            this.mb_badcode.Width = 80;
-            // 
-            // mb_badname
-            // 
-            this.mb_badname.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.mb_badname.DataPropertyName = "mb_badname";
-            this.mb_badname.HeaderText = "不良名称";
-            this.mb_badname.MinimumWidth = 80;
-            this.mb_badname.Name = "mb_badname";
-            this.mb_badname.ReadOnly = true;
-            this.mb_badname.Width = 80;
-            // 
-            // mb_bgname
-            // 
-            this.mb_bgname.DataPropertyName = "mb_bgname";
-            this.mb_bgname.HeaderText = "不良代码组描述";
-            this.mb_bgname.Name = "mb_bgname";
-            this.mb_bgname.Visible = false;
-            // 
-            // mb_bgcode
-            // 
-            this.mb_bgcode.DataPropertyName = "mb_bgcode";
-            this.mb_bgcode.HeaderText = "不良代码组编号";
-            this.mb_bgcode.Name = "mb_bgcode";
-            this.mb_bgcode.Visible = false;
-            // 
-            // mbc_component
-            // 
-            this.mbc_component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.mbc_component.DataPropertyName = "mbc_component";
-            this.mbc_component.HeaderText = "不良组件";
-            this.mbc_component.Items.AddRange(new object[] {
-            "",
-            "主板",
-            "液晶屏",
-            "电路板",
-            "其他"});
-            this.mbc_component.MinimumWidth = 80;
-            this.mbc_component.Name = "mbc_component";
-            this.mbc_component.Width = 80;
-            // 
-            // mbp_part
-            // 
-            this.mbp_part.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbp_part.DataPropertyName = "mbp_part";
-            this.mbp_part.HeaderText = "不良零件";
-            this.mbp_part.Name = "mbp_part";
-            // 
-            // mbl_loc
-            // 
-            this.mbl_loc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbl_loc.DataPropertyName = "mbl_loc";
-            this.mbl_loc.HeaderText = "不良位置";
-            this.mbl_loc.MinimumWidth = 45;
-            this.mbl_loc.Name = "mbl_loc";
-            // 
             // WaitChooseDGV
             // 
             this.WaitChooseDGV.AllowUserToAddRows = false;
@@ -606,45 +437,6 @@
             this.WaitChooseDGV.Size = new System.Drawing.Size(235, 223);
             this.WaitChooseDGV.TabIndex = 208;
             // 
-            // ChooseAll
-            // 
-            this.ChooseAll.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.ChooseAll.HeaderText = "勾选";
-            this.ChooseAll.MinimumWidth = 80;
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.ChooseAll.Width = 80;
-            // 
-            // bc_code
-            // 
-            this.bc_code.DataPropertyName = "bc_code";
-            this.bc_code.HeaderText = "不良代码";
-            this.bc_code.Name = "bc_code";
-            this.bc_code.ReadOnly = true;
-            this.bc_code.Width = 130;
-            // 
-            // bc_name
-            // 
-            this.bc_name.DataPropertyName = "bc_name";
-            this.bc_name.HeaderText = "不良名称";
-            this.bc_name.Name = "bc_name";
-            this.bc_name.ReadOnly = true;
-            this.bc_name.Width = 130;
-            // 
-            // bg_code
-            // 
-            this.bg_code.DataPropertyName = "bg_code";
-            this.bg_code.HeaderText = "不良组别编号";
-            this.bg_code.Name = "bg_code";
-            this.bg_code.Visible = false;
-            // 
-            // bg_name
-            // 
-            this.bg_name.DataPropertyName = "bg_name";
-            this.bg_name.HeaderText = "不良组别名称";
-            this.bg_name.Name = "bg_name";
-            this.bg_name.Visible = false;
-            // 
             // badloc_label
             // 
             this.badloc_label.AutoSize = true;
@@ -839,6 +631,131 @@
             this.bd_soncode.Tag = "psl_prodcode";
             this.bd_soncode.TextBoxEnable = true;
             // 
+            // ChooseAll
+            // 
+            this.ChooseAll.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.ChooseAll.HeaderText = "勾选";
+            this.ChooseAll.MinimumWidth = 80;
+            this.ChooseAll.Name = "ChooseAll";
+            this.ChooseAll.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.ChooseAll.Width = 80;
+            // 
+            // bc_code
+            // 
+            this.bc_code.DataPropertyName = "bc_code";
+            this.bc_code.HeaderText = "不良代码";
+            this.bc_code.Name = "bc_code";
+            this.bc_code.ReadOnly = true;
+            this.bc_code.Width = 130;
+            // 
+            // bc_name
+            // 
+            this.bc_name.DataPropertyName = "bc_name";
+            this.bc_name.HeaderText = "不良名称";
+            this.bc_name.Name = "bc_name";
+            this.bc_name.ReadOnly = true;
+            this.bc_name.Width = 130;
+            // 
+            // bg_code
+            // 
+            this.bg_code.DataPropertyName = "bg_code";
+            this.bg_code.HeaderText = "不良组别编号";
+            this.bg_code.Name = "bg_code";
+            this.bg_code.Visible = false;
+            // 
+            // bg_name
+            // 
+            this.bg_name.DataPropertyName = "bg_name";
+            this.bg_name.HeaderText = "不良组别名称";
+            this.bg_name.Name = "bg_name";
+            this.bg_name.Visible = false;
+            // 
+            // choose1
+            // 
+            this.choose1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose1.HeaderText = "勾选";
+            this.choose1.MinimumWidth = 60;
+            this.choose1.Name = "choose1";
+            this.choose1.Width = 60;
+            // 
+            // mb_id
+            // 
+            this.mb_id.DataPropertyName = "mb_id";
+            this.mb_id.HeaderText = "mb_id";
+            this.mb_id.Name = "mb_id";
+            this.mb_id.Visible = false;
+            // 
+            // mbr_id
+            // 
+            this.mbr_id.DataPropertyName = "mbr_id";
+            this.mbr_id.HeaderText = "mbr_id";
+            this.mbr_id.Name = "mbr_id";
+            this.mbr_id.Visible = false;
+            // 
+            // mb_badcode
+            // 
+            this.mb_badcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.mb_badcode.DataPropertyName = "mb_badcode";
+            this.mb_badcode.HeaderText = "不良代码";
+            this.mb_badcode.MinimumWidth = 80;
+            this.mb_badcode.Name = "mb_badcode";
+            this.mb_badcode.ReadOnly = true;
+            this.mb_badcode.Width = 80;
+            // 
+            // mb_badname
+            // 
+            this.mb_badname.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.mb_badname.DataPropertyName = "mb_badname";
+            this.mb_badname.HeaderText = "不良名称";
+            this.mb_badname.MinimumWidth = 80;
+            this.mb_badname.Name = "mb_badname";
+            this.mb_badname.ReadOnly = true;
+            this.mb_badname.Width = 80;
+            // 
+            // mb_bgname
+            // 
+            this.mb_bgname.DataPropertyName = "mb_bgname";
+            this.mb_bgname.HeaderText = "不良代码组描述";
+            this.mb_bgname.Name = "mb_bgname";
+            this.mb_bgname.Visible = false;
+            // 
+            // mb_bgcode
+            // 
+            this.mb_bgcode.DataPropertyName = "mb_bgcode";
+            this.mb_bgcode.HeaderText = "不良代码组编号";
+            this.mb_bgcode.Name = "mb_bgcode";
+            this.mb_bgcode.Visible = false;
+            // 
+            // mbc_component
+            // 
+            this.mbc_component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.mbc_component.DataPropertyName = "mbc_component";
+            this.mbc_component.HeaderText = "不良组件";
+            this.mbc_component.Items.AddRange(new object[] {
+            "",
+            "主板",
+            "液晶屏",
+            "电路板",
+            "其他"});
+            this.mbc_component.MinimumWidth = 80;
+            this.mbc_component.Name = "mbc_component";
+            this.mbc_component.Width = 80;
+            // 
+            // mbp_part
+            // 
+            this.mbp_part.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbp_part.DataPropertyName = "mbp_part";
+            this.mbp_part.HeaderText = "不良零件";
+            this.mbp_part.Name = "mbp_part";
+            // 
+            // mbl_loc
+            // 
+            this.mbl_loc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbl_loc.DataPropertyName = "mbl_loc";
+            this.mbl_loc.HeaderText = "不良位置";
+            this.mbl_loc.MinimumWidth = 45;
+            this.mbl_loc.Name = "mbl_loc";
+            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
@@ -861,6 +778,7 @@
             this.Filter.Size = new System.Drawing.Size(140, 24);
             this.Filter.TabIndex = 76;
             this.Filter.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder.OnTextChange(this.Filter_UserControlTextChanged);
+            this.Filter.UserControlKeydown += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder.OnKeydown(this.Filter_UserControlKeydown);
             // 
             // ma_softversion
             // 
@@ -873,6 +791,89 @@
             this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 73;
             // 
+            // ob_sendqty
+            // 
+            this.ob_sendqty.AutoSize = true;
+            this.ob_sendqty.CutLength = null;
+            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
+            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_sendqty.Name = "ob_sendqty";
+            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_sendqty.TabIndex = 78;
+            this.ob_sendqty.Tag = "ob_batchqty";
+            // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = null;
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Enabled = false;
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(229, 90);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
+            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
+            this.SendCheck.Name = "SendCheck";
+            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
+            this.SendCheck.Power = null;
+            this.SendCheck.Size = new System.Drawing.Size(65, 26);
+            this.SendCheck.TabIndex = 72;
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = false;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.CutLength = null;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
+            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_batchqty.TabIndex = 75;
+            this.ob_batchqty.Tag = "ob_batchqty";
+            // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.CutLength = null;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
+            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_nowcheckqty.TabIndex = 73;
+            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
+            // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            this.mcd_remainqty.CutLength = null;
+            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.TabIndex = 57;
+            this.mcd_remainqty.Tag = "mcd_remainqty";
+            // 
+            // mcd_inqty
+            // 
+            this.mcd_inqty.AutoSize = true;
+            this.mcd_inqty.CutLength = null;
+            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_inqty.Name = "mcd_inqty";
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.TabIndex = 54;
+            this.mcd_inqty.Tag = "mcd_inqty";
+            // 
             // Save
             // 
             this.Save.AllPower = null;

+ 93 - 48
UAS-MES/FunctionCode/Make/Make_SmtTestCollection.cs

@@ -207,6 +207,13 @@ namespace UAS_MES.Make
                 {
                     WaitChooseDGV.Rows[i].Cells["ChooseAll"].Value = false;
                 }
+                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                {
+                    if (MakeBadView.Rows[i].Cells["mb_id"].Value.ToString() == "")
+                    {
+                        MakeBadView.Rows[i].Cells["choose1"].Value = true;
+                    }
+                }
             }
             else OperateResult.AppendText(">>请勾选不良明细\n", Color.Red);
         }
@@ -460,12 +467,29 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                     return;
                 }
-                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+
+                dt = (DataTable)dh.ExecuteSql("SELECT * FROM BOMDetail LEFT JOIN Product ON bd_soncode=pr_code WHERE bd_mothercode = '"+ ma_prodcode.Text + "'", "select");
+
+                if (dt.Rows.Count > 0)
                 {
-                    if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
                     {
-                        OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
-                        return;
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
+                            return;
+                        }
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                    {
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置不可为空\n", Color.Red);
+                            return;
+                        }
                     }
                 }
                 List<string> bccode = new List<string>();
@@ -570,9 +594,7 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
 
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
-
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
                             sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
@@ -597,13 +619,17 @@ namespace UAS_MES.Make
                             //        dh.ExecuteSql(sql.GetString(), "insert");
                             //    }  
                             //}
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
                         }
                         else
                         {
@@ -636,8 +662,8 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
 
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
+                          
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
 
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
@@ -663,43 +689,49 @@ namespace UAS_MES.Make
                                     dh.ExecuteSql(sql.GetString(), "insert");
                                 }
                             }
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
+
 
                         }
                     }
                     dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_id","nvl(ms_ifrework,0) ms_ifrework", "ms_paststep" }, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + ma_code.Text + "' ");
                     string St_ifqccheck = dh.getFieldDataByCondition("source LEFT JOIN STEP on st_code=sc_stepcode", "nvl(St_ifqccheck,0)", "sc_code='" + User.UserSourceCode + "'").ToString();
-                    List<string> SQLS = new List<string>();
-                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ma_code.Text, User.UserSourceCode, "快速维修采集", "完成快速维修", User.UserCode);
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "快速维修采集", "完成快速维修", ms_sncode.Text, ob_checkno.Text);
-                    if (dt.Rows.Count > 0)
-                    {
-                        string ms_id = dt.Rows[0]["ms_id"].ToString();
-                        string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
-                        if (St_ifqccheck != "-1")
-                        {
-                            if (ms_ifrework == "0")
-                                SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + User.CurrentStepCode + "',ms_status=1,ms_stepcode='SMT_REPAIR' where ms_id='" + ms_id + "'");
-                            else
-                                SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + User.CurrentStepCode + "',ms_reworkstatus=1,ms_stepcode='SMT_REPAIR' where ms_id='" + ms_id + "'");
-                        }
-                        else {
-                            if (ms_ifrework == "0")
-                                SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + ms_nextstepcode + "',ms_status=1,ms_stepcode='SMT_REPAIR',ms_paststep = REPLACE(ms_paststep,','||'"+ ms_nextstepcode + "') where ms_id='" + ms_id + "'");
-                            else
-                                SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + ms_nextstepcode + "',ms_reworkstatus=1,ms_stepcode='SMT_REPAIR',ms_paststep = REPLACE(ms_paststep,','||'" + ms_nextstepcode + "')  where ms_id='" + ms_id + "'");
-                            if(status == "2")
-                                SQLS.Add("update makeserial set ms_status='2' where ms_id='" + ms_id + "'");
-                        }
-                    }
-                    SQLS.Add("update makebad set mb_status=-1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and MB_STEPCODE = '" + User.CurrentStepCode + "'");
-                    dh.ExecuteSQLTran(SQLS.ToArray());
+                    //List<string> SQLS = new List<string>();
+                    //LogicHandler.InsertMakeProcess(ms_sncode.Text, ma_code.Text, User.UserSourceCode, "快速维修采集", "完成快速维修", User.UserCode);
+                    //LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "快速维修采集", "完成快速维修", ms_sncode.Text, ob_checkno.Text);
+                    //if (dt.Rows.Count > 0)
+                    //{
+                    //    string ms_id = dt.Rows[0]["ms_id"].ToString();
+                    //    string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                    //    if (St_ifqccheck != "-1")
+                    //    {
+                    //        if (ms_ifrework == "0")
+                    //            SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + User.CurrentStepCode + "',ms_status=1,ms_stepcode='SMT_REPAIR' where ms_id='" + ms_id + "'");
+                    //        else
+                    //            SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + User.CurrentStepCode + "',ms_reworkstatus=1,ms_stepcode='SMT_REPAIR' where ms_id='" + ms_id + "'");
+                    //    }
+                    //    else {
+                    //        if (ms_ifrework == "0")
+                    //            SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + ms_nextstepcode + "',ms_status=1,ms_stepcode='SMT_REPAIR',ms_paststep = REPLACE(ms_paststep,','||'"+ ms_nextstepcode + "') where ms_id='" + ms_id + "'");
+                    //        else
+                    //            SQLS.Add("update makeserial set ms_checkno='', ms_nextstepcode ='" + ms_nextstepcode + "',ms_reworkstatus=1,ms_stepcode='SMT_REPAIR',ms_paststep = REPLACE(ms_paststep,','||'" + ms_nextstepcode + "')  where ms_id='" + ms_id + "'");
+                    //        if(status == "2")
+                    //            SQLS.Add("update makeserial set ms_status='2' where ms_id='" + ms_id + "'");
+                    //    }
+                    //}
+                    //SQLS.Add("update makebad set mb_status=-1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and MB_STEPCODE = '" + User.CurrentStepCode + "'");
+                    //dh.ExecuteSQLTran(SQLS.ToArray());
                   
                     //保存不良原因
                     LastSncode = ms_sncode.Text;
@@ -1041,5 +1073,18 @@ namespace UAS_MES.Make
         {
             psl_location.Text = "";
         }
+
+
+        private void Filter_UserControlKeydown(object sender, EventArgs e)
+        {
+            if (((KeyEventArgs)e).KeyCode == Keys.Enter)
+            {
+                for (int i = 0; i < WaitChooseDGV.Rows.Count; i++)
+                {
+                    WaitChooseDGV.Rows[i].Cells["ChooseAll"].Value = true;
+                }
+                ChooseedReject_Click(sender, e);
+            }
+        }
     }
 }

+ 56 - 22
UAS-MES/FunctionCode/Make/Make_SpiTestCollection.cs

@@ -208,6 +208,13 @@ namespace UAS_MES.Make
                 {
                     WaitChooseDGV.Rows[i].Cells["ChooseAll"].Value = false;
                 }
+                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                {
+                    if (MakeBadView.Rows[i].Cells["mb_id"].Value.ToString() == "")
+                    {
+                        MakeBadView.Rows[i].Cells["choose1"].Value = true;
+                    }
+                }
             }
             else OperateResult.AppendText(">>请勾选不良明细\n", Color.Red);
         }
@@ -461,12 +468,29 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                     return;
                 }
-                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+
+                dt = (DataTable)dh.ExecuteSql("SELECT * FROM BOMDetail LEFT JOIN Product ON bd_soncode=pr_code WHERE bd_mothercode = '" + ma_prodcode.Text + "'", "select");
+
+                if (dt.Rows.Count > 0)
                 {
-                    if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
                     {
-                        OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
-                        return;
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
+                            return;
+                        }
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                    {
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置不可为空\n", Color.Red);
+                            return;
+                        }
                     }
                 }
                 List<string> bccode = new List<string>();
@@ -571,8 +595,8 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
 
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
+                         
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
 
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
@@ -598,13 +622,18 @@ namespace UAS_MES.Make
                             //        dh.ExecuteSql(sql.GetString(), "insert");
                             //    }  
                             //}
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
                         }
                         else
                         {
@@ -637,8 +666,8 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
 
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
+  
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
 
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
@@ -664,13 +693,18 @@ namespace UAS_MES.Make
                                     dh.ExecuteSql(sql.GetString(), "insert");
                                 }
                             }
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
+
 
                         }
                     }

+ 53 - 23
UAS-MES/FunctionCode/Make/Make_XrayTestCollection.cs

@@ -208,6 +208,13 @@ namespace UAS_MES.Make
                 {
                     WaitChooseDGV.Rows[i].Cells["ChooseAll"].Value = false;
                 }
+                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                {
+                    if (MakeBadView.Rows[i].Cells["mb_id"].Value.ToString() == "")
+                    {
+                        MakeBadView.Rows[i].Cells["choose1"].Value = true;
+                    }
+                }
             }
             else OperateResult.AppendText(">>请勾选不良明细\n", Color.Red);
         }
@@ -461,12 +468,29 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                     return;
                 }
-                for (int i = 0; i < MakeBadView.Rows.Count; i++)
+
+                dt = (DataTable)dh.ExecuteSql("SELECT * FROM BOMDetail LEFT JOIN Product ON bd_soncode=pr_code WHERE bd_mothercode = '" + ma_prodcode.Text + "'", "select");
+
+                if (dt.Rows.Count > 0)
                 {
-                    if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
                     {
-                        OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
-                        return;
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "" || MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置与不良零件均不可为空\n", Color.Red);
+                            return;
+                        }
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < MakeBadView.Rows.Count; i++)
+                    {
+                        if (MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString() == "")
+                        {
+                            OperateResult.AppendText(">>不良位置不可为空\n", Color.Red);
+                            return;
+                        }
                     }
                 }
                 List<string> bccode = new List<string>();
@@ -571,8 +595,7 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
 
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
 
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
@@ -598,13 +621,17 @@ namespace UAS_MES.Make
                             //        dh.ExecuteSql(sql.GetString(), "insert");
                             //    }  
                             //}
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
                         }
                         else
                         {
@@ -636,9 +663,8 @@ namespace UAS_MES.Make
                                 sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',sysdate,'" + User.UserCode + "')");
                                 dh.ExecuteSql(sql.GetString(), "insert");
                             }
-
-                            string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().Split(',');
-                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().Split(',');
+             
+                            string[] mbl_loc = MakeBadView.Rows[i].Cells["mbl_loc"].Value.ToString().ToUpper().Split(',');
 
                             sql.Clear();
                             sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
@@ -664,13 +690,17 @@ namespace UAS_MES.Make
                                     dh.ExecuteSql(sql.GetString(), "insert");
                                 }
                             }
-                            sql.Clear();
-                            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-                            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-                            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
-                            sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
-                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            if (MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString() != "")
+                            {
+                                string[] mbp_part = MakeBadView.Rows[i].Cells["mbp_part"].Value.ToString().ToUpper().Split(',');
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:mbp_part,");
+                                sql.Append("'" + MakeBadView.Rows[i].Cells["mb_badcode"].Value.ToString() + "','" + bgd_brcode + "','" + ms_sncode.Text + "','" + ma_code.Text + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.BatchInsert(sql.GetString(), new string[] { "mbp_part" }, mbp_part);
+                            }
 
                         }
                     }

+ 7 - 7
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -218,7 +218,7 @@ namespace UAS_MES.Warehouse
                             ExeSQL.Add("update prodinout set pi_pdastatus='已出库' where pi_inoutno='" + pi_inoutno.Text + "'");
                             ExeSQL.Add("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName + "','确认出货','确认出货成功','ProdInOut!Sale|pi_id=" + pi_id.Text + "')");
                             dh.ExecuteSQLTran(ExeSQL.ToArray());
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "出货单" + pi_inoutno.Text + "确认出货", "出货单" + pi_inoutno.Text + "确认出货成功", pi_inoutno.Text, "");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "出货单" + pi_inoutno.Text + "确认出货", "出货单" + pi_inoutno.Text + "确认出货成功", pi_inoutno.Text, pi_inoutno.Text);
                             OperateResult.AppendText("出货单" + pi_inoutno.Text + "出库成功\n", Color.Black, pi_inoutno);
                             BaseUtil.CleanDGVData(InOutDetailDGV);
                             BaseUtil.CleanControls(panel1.Controls);
@@ -291,7 +291,7 @@ namespace UAS_MES.Warehouse
                                 v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
                             }
                             dh.BatchInsert("update makeserial set ms_outno='" + pi_inoutno.Text + "' where ms_sncode = :v_barcode and ms_makecode = :v_makecode and ms_outno is null", new string[] { "v_barcode", "v_makecode" }, v_barcode.ToArray(), v_makecode.ToArray());
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", input.Text, "");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", input.Text, pi_inoutno.Text);
                         }
                         else if (bigboxBtn.Checked)
                         {
@@ -387,7 +387,7 @@ namespace UAS_MES.Warehouse
                                 v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
                             }
                             dh.BatchInsert("update makeserial set ms_outno='" + pi_inoutno.Text + "' where ms_sncode = :v_barcode and ms_makecode = :v_makecode and ms_outno is null", new string[] { "v_barcode", "v_makecode" }, v_barcode.ToArray(), v_makecode.ToArray());
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", input.Text, "");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", input.Text, pi_inoutno.Text);
                         }
                         else if (serBtn.Checked)
                         {
@@ -517,7 +517,7 @@ namespace UAS_MES.Warehouse
                                 {
                                     updatesn(ms_id);
                                 }
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "出货备货", "序列号" + input.Text + "出货备货成功", input.Text, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "出货备货", "序列号" + input.Text + "出货备货成功", input.Text, pi_inoutno.Text);
                             }
                         }
                         else
@@ -600,7 +600,7 @@ namespace UAS_MES.Warehouse
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
                                 OperateResult.AppendText("栈板号" + input.Text + "取消备货成功\n", Color.Black, input);
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "取消出货备货", "栈板" + input.Text + "取消出货备货成功", input.Text, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "取消出货备货", "栈板" + input.Text + "取消出货备货成功", input.Text, pi_inoutno.Text);
                             }
                             else
                             {
@@ -658,7 +658,7 @@ namespace UAS_MES.Warehouse
                                 dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_prodcode = :pim_prodcode and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac", "pim_prodcode" }, pim_mac.ToArray(), pim_prodcode.ToArray());
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 OperateResult.AppendText("箱号" + input.Text + "取消备货成功\n", Color.Black, input);
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", input.Text, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", input.Text, pi_inoutno.Text);
                             }
                             else
                             {
@@ -706,7 +706,7 @@ namespace UAS_MES.Warehouse
                                 //}
                                 dh.ExecuteSql("delete from prodiomac where pim_id in (select pim_id from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac='" + input.Text + "' and pim_inorout='OUT' and pim_class='出货')", "delete");
                                 dh.UpdateByCondition("makeserial", " ms_outno = ''", "ms_id = '" + ms_id + "'");
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "取消出货备货", "序列号" + input.Text + "取消出货备货成功", input.Text, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "取消出货备货", "序列号" + input.Text + "取消出货备货成功", input.Text, pi_inoutno.Text);
                                 OperateResult.AppendText("序列号" + input.Text + "取消备货成功\n", Color.Black, input);
                             }
                             else