Ver Fonte

添加维护时不良代码匹配自动勾选,添加不良位置

章政 há 8 anos atrás
pai
commit
b0e5de0d17

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_NewBadCode.cs

@@ -211,7 +211,7 @@ namespace UAS_MES.Make
         {
             string bg_id = badgroup.SelectedValue.ToString();
             sql.Clear();
-            sql.Append("select bg_code,bg_name,bc_code,bc_name,bc_note from badgroupdetail left join badgroup on bgd_bgcode=bg_code ");
+            sql.Append("select bg_code,bg_name,bc_code,bc_name,bc_note from badgroupdetail left join badgroup on bgd_bgid=bg_id ");
             sql.Append("left join badcode on bgd_badcode=bc_code where bg_code='" + ((bg_id != "" && bg_id != "System.Data.DataRowView") ? bg_id.ToString() : "") + "' and bg_code is not null ");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             //往listview中添加数据

+ 16 - 0
UAS-MES/FunctionCode/Make/Make_NewMatainInf.cs

@@ -104,6 +104,14 @@ namespace UAS_MES.Make
             if (dt.Rows.Count == 0)
                 dt = (DataTable)dh.ExecuteSql("select so_code,so_name from solution order by so_id", "select");
             AddDataToListView(mbr_solutioncode_lsv, dt);
+            for (int i = 0; i < nrg_name_lsv.Items.Count; i++)
+            {
+                if (nrg_name_lsv.Items[i].SubItems[0].Text == bgcode)
+                {
+                    ListView_ItemSelectionChanged(nrg_name_lsv, new ListViewItemSelectionChangedEventArgs(nrg_name_lsv.Items[i], i, true));
+                    nrg_name_lsv.Items[i].Selected = true;
+                }
+            }
         }
 
         /// <summary>
@@ -256,6 +264,14 @@ namespace UAS_MES.Make
             sql.Append("nrg_code in('" + (nrg_code == "" ? "''" : nrg_code) + "')");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             AddDataToListView(nr_name_lsv, dt);
+            for (int i = 0; i < nr_name_lsv.Items.Count; i++)
+            {
+                if (nr_name_lsv.Items[i].SubItems[0].Text == bccode)
+                {
+                    ListView_ItemSelectionChanged(nr_name_lsv, new ListViewItemSelectionChangedEventArgs(nr_name_lsv.Items[i], i, true));
+                    nr_name_lsv.Items[i].Selected = true;
+                }
+            }
         }
 
         private void headBar1_MouseDown(object sender, MouseEventArgs e)

+ 163 - 163
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -59,7 +59,7 @@
             this.nr_code = new System.Windows.Forms.Label();
             this.mb_badremark = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
             this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.bd_soncode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.mbp_partdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
             this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.DeleteCom = new System.Windows.Forms.DataGridViewImageColumn();
@@ -109,9 +109,9 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1350, 43);
+            this.panel2.Size = new System.Drawing.Size(1200, 36);
             this.panel2.TabIndex = 32;
             // 
             // label1
@@ -119,10 +119,10 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(18, 6);
+            this.label1.Location = new System.Drawing.Point(16, 5);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 0;
             this.label1.Text = "工单信息";
             // 
@@ -132,10 +132,10 @@
             | 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(11, 122);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(10, 102);
             this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
-            this.ma_craftcode_label.Size = new System.Drawing.Size(110, 31);
+            this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_craftcode_label.TabIndex = 66;
             this.ma_craftcode_label.Text = "回流途程";
             // 
@@ -145,10 +145,10 @@
             | 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(387, 124);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(344, 103);
             this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
-            this.st_rstepcode_label.Size = new System.Drawing.Size(110, 31);
+            this.st_rstepcode_label.Size = new System.Drawing.Size(92, 27);
             this.st_rstepcode_label.TabIndex = 65;
             this.st_rstepcode_label.Text = "回流工序";
             // 
@@ -158,10 +158,10 @@
             | 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(601, 66);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(534, 55);
             this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
-            this.ms_prodcode_label.Size = new System.Drawing.Size(110, 31);
+            this.ms_prodcode_label.Size = new System.Drawing.Size(92, 27);
             this.ms_prodcode_label.TabIndex = 62;
             this.ms_prodcode_label.Text = "产品编号";
             // 
@@ -169,10 +169,10 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(981, 230);
+            this.label14.Location = new System.Drawing.Point(872, 192);
             this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(110, 31);
+            this.label14.Size = new System.Drawing.Size(92, 27);
             this.label14.TabIndex = 46;
             this.label14.Text = "不良备注";
             // 
@@ -181,10 +181,10 @@
             this.bc_name_label.AutoSize = true;
             this.bc_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_name_label.ForeColor = System.Drawing.Color.Black;
-            this.bc_name_label.Location = new System.Drawing.Point(609, 228);
+            this.bc_name_label.Location = new System.Drawing.Point(541, 190);
             this.bc_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bc_name_label.Name = "bc_name_label";
-            this.bc_name_label.Size = new System.Drawing.Size(110, 31);
+            this.bc_name_label.Size = new System.Drawing.Size(92, 27);
             this.bc_name_label.TabIndex = 44;
             this.bc_name_label.Text = "不良代码";
             // 
@@ -192,10 +192,10 @@
             // 
             this.bg_name_label.AutoSize = true;
             this.bg_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bg_name_label.Location = new System.Drawing.Point(244, 228);
+            this.bg_name_label.Location = new System.Drawing.Point(217, 190);
             this.bg_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bg_name_label.Name = "bg_name_label";
-            this.bg_name_label.Size = new System.Drawing.Size(134, 31);
+            this.bg_name_label.Size = new System.Drawing.Size(112, 27);
             this.bg_name_label.TabIndex = 40;
             this.bg_name_label.Text = "不良代码组";
             // 
@@ -205,10 +205,10 @@
             | 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(11, 64);
+            this.ms_sncode_label.Location = new System.Drawing.Point(10, 53);
             this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(86, 31);
+            this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_sncode_label.TabIndex = 38;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -218,10 +218,10 @@
             | 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(294, 66);
+            this.ms_makecode_label.Location = new System.Drawing.Point(261, 55);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(86, 31);
+            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_makecode_label.TabIndex = 37;
             this.ms_makecode_label.Text = "工单号";
             // 
@@ -230,10 +230,10 @@
             this.mbr_brgcode_label.AutoSize = true;
             this.mbr_brgcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_brgcode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_brgcode_label.Location = new System.Drawing.Point(244, 295);
+            this.mbr_brgcode_label.Location = new System.Drawing.Point(217, 246);
             this.mbr_brgcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbr_brgcode_label.Name = "mbr_brgcode_label";
-            this.mbr_brgcode_label.Size = new System.Drawing.Size(134, 31);
+            this.mbr_brgcode_label.Size = new System.Drawing.Size(112, 27);
             this.mbr_brgcode_label.TabIndex = 93;
             this.mbr_brgcode_label.Text = "不良原因组";
             // 
@@ -242,10 +242,10 @@
             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(609, 292);
+            this.nr_name_label.Location = new System.Drawing.Point(541, 246);
             this.nr_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.nr_name_label.Name = "nr_name_label";
-            this.nr_name_label.Size = new System.Drawing.Size(110, 31);
+            this.nr_name_label.Size = new System.Drawing.Size(92, 27);
             this.nr_name_label.TabIndex = 95;
             this.nr_name_label.Text = "不良原因";
             // 
@@ -254,10 +254,10 @@
             this.mbr_dutycode_label.AutoSize = true;
             this.mbr_dutycode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_dutycode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_dutycode_label.Location = new System.Drawing.Point(981, 290);
+            this.mbr_dutycode_label.Location = new System.Drawing.Point(872, 246);
             this.mbr_dutycode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbr_dutycode_label.Name = "mbr_dutycode_label";
-            this.mbr_dutycode_label.Size = new System.Drawing.Size(86, 31);
+            this.mbr_dutycode_label.Size = new System.Drawing.Size(72, 27);
             this.mbr_dutycode_label.TabIndex = 97;
             this.mbr_dutycode_label.Text = "责任别";
             // 
@@ -266,10 +266,10 @@
             this.mbc_component_label.AutoSize = true;
             this.mbc_component_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbc_component_label.ForeColor = System.Drawing.Color.Black;
-            this.mbc_component_label.Location = new System.Drawing.Point(244, 358);
+            this.mbc_component_label.Location = new System.Drawing.Point(217, 298);
             this.mbc_component_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbc_component_label.Name = "mbc_component_label";
-            this.mbc_component_label.Size = new System.Drawing.Size(110, 31);
+            this.mbc_component_label.Size = new System.Drawing.Size(92, 27);
             this.mbc_component_label.TabIndex = 99;
             this.mbc_component_label.Text = "不良组件";
             // 
@@ -278,10 +278,10 @@
             this.mbr_solution_label.AutoSize = true;
             this.mbr_solution_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_solution_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_solution_label.Location = new System.Drawing.Point(609, 356);
+            this.mbr_solution_label.Location = new System.Drawing.Point(541, 297);
             this.mbr_solution_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbr_solution_label.Name = "mbr_solution_label";
-            this.mbr_solution_label.Size = new System.Drawing.Size(110, 31);
+            this.mbr_solution_label.Size = new System.Drawing.Size(92, 27);
             this.mbr_solution_label.TabIndex = 101;
             this.mbr_solution_label.Text = "解决方案";
             // 
@@ -290,10 +290,10 @@
             this.mbl_loc_label.AutoSize = true;
             this.mbl_loc_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbl_loc_label.ForeColor = System.Drawing.Color.Black;
-            this.mbl_loc_label.Location = new System.Drawing.Point(244, 445);
+            this.mbl_loc_label.Location = new System.Drawing.Point(217, 371);
             this.mbl_loc_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbl_loc_label.Name = "mbl_loc_label";
-            this.mbl_loc_label.Size = new System.Drawing.Size(110, 31);
+            this.mbl_loc_label.Size = new System.Drawing.Size(92, 27);
             this.mbl_loc_label.TabIndex = 103;
             this.mbl_loc_label.Text = "不良位置";
             // 
@@ -302,20 +302,20 @@
             this.mbp_part_label.AutoSize = true;
             this.mbp_part_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbp_part_label.ForeColor = System.Drawing.Color.Black;
-            this.mbp_part_label.Location = new System.Drawing.Point(681, 445);
+            this.mbp_part_label.Location = new System.Drawing.Point(605, 371);
             this.mbp_part_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mbp_part_label.Name = "mbp_part_label";
-            this.mbp_part_label.Size = new System.Drawing.Size(110, 31);
+            this.mbp_part_label.Size = new System.Drawing.Size(92, 27);
             this.mbp_part_label.TabIndex = 105;
             this.mbp_part_label.Text = "不良零件";
             // 
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.panel1.Location = new System.Drawing.Point(237, 410);
+            this.panel1.Location = new System.Drawing.Point(211, 342);
             this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1108, 1);
+            this.panel1.Size = new System.Drawing.Size(985, 1);
             this.panel1.TabIndex = 108;
             // 
             // GetSNCode_Label
@@ -324,10 +324,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetSNCode_Label.Location = new System.Drawing.Point(244, 814);
+            this.GetSNCode_Label.Location = new System.Drawing.Point(217, 678);
             this.GetSNCode_Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.GetSNCode_Label.Name = "GetSNCode_Label";
-            this.GetSNCode_Label.Size = new System.Drawing.Size(86, 31);
+            this.GetSNCode_Label.Size = new System.Drawing.Size(72, 27);
             this.GetSNCode_Label.TabIndex = 113;
             this.GetSNCode_Label.Text = "序列号";
             // 
@@ -336,29 +336,29 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(11, 191);
+            this.label2.Location = new System.Drawing.Point(10, 159);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 117;
             this.label2.Text = "不良信息";
             // 
             // panel3
             // 
             this.panel3.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.panel3.Location = new System.Drawing.Point(1, 175);
+            this.panel3.Location = new System.Drawing.Point(1, 146);
             this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.panel3.Name = "panel3";
-            this.panel3.Size = new System.Drawing.Size(1344, 1);
+            this.panel3.Size = new System.Drawing.Size(1195, 1);
             this.panel3.TabIndex = 109;
             // 
             // BadCodeTree
             // 
             this.BadCodeTree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BadCodeTree.Location = new System.Drawing.Point(17, 230);
+            this.BadCodeTree.Location = new System.Drawing.Point(15, 192);
             this.BadCodeTree.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.BadCodeTree.Name = "BadCodeTree";
-            this.BadCodeTree.Size = new System.Drawing.Size(213, 638);
+            this.BadCodeTree.Size = new System.Drawing.Size(190, 532);
             this.BadCodeTree.TabIndex = 118;
             this.BadCodeTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.BadCodeTree_NodeMouseClick);
             // 
@@ -367,10 +367,10 @@
             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(1323, 113);
+            this.bc_code.Location = new System.Drawing.Point(1176, 94);
             this.bc_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bc_code.Name = "bc_code";
-            this.bc_code.Size = new System.Drawing.Size(0, 31);
+            this.bc_code.Size = new System.Drawing.Size(0, 27);
             this.bc_code.TabIndex = 122;
             this.bc_code.Visible = false;
             // 
@@ -379,10 +379,10 @@
             this.bg_code.AutoSize = true;
             this.bg_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bg_code.ForeColor = System.Drawing.Color.Black;
-            this.bg_code.Location = new System.Drawing.Point(1323, 64);
+            this.bg_code.Location = new System.Drawing.Point(1176, 53);
             this.bg_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bg_code.Name = "bg_code";
-            this.bg_code.Size = new System.Drawing.Size(0, 31);
+            this.bg_code.Size = new System.Drawing.Size(0, 27);
             this.bg_code.TabIndex = 123;
             this.bg_code.Visible = false;
             // 
@@ -391,19 +391,19 @@
             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(1290, 113);
+            this.nr_code.Location = new System.Drawing.Point(1147, 94);
             this.nr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.nr_code.Name = "nr_code";
-            this.nr_code.Size = new System.Drawing.Size(0, 31);
+            this.nr_code.Size = new System.Drawing.Size(0, 27);
             this.nr_code.TabIndex = 125;
             this.nr_code.Visible = false;
             // 
             // mb_badremark
             // 
-            this.mb_badremark.Location = new System.Drawing.Point(1099, 229);
-            this.mb_badremark.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.mb_badremark.Location = new System.Drawing.Point(977, 191);
+            this.mb_badremark.Margin = new System.Windows.Forms.Padding(5);
             this.mb_badremark.Name = "mb_badremark";
-            this.mb_badremark.Size = new System.Drawing.Size(209, 31);
+            this.mb_badremark.Size = new System.Drawing.Size(186, 26);
             this.mb_badremark.TabIndex = 127;
             // 
             // ms_sncode
@@ -413,32 +413,32 @@
             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(134, 66);
+            this.ms_sncode.Location = new System.Drawing.Point(119, 55);
             this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_sncode.MaximumSize = new System.Drawing.Size(225, 0);
+            this.ms_sncode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.Size = new System.Drawing.Size(0, 31);
+            this.ms_sncode.Size = new System.Drawing.Size(0, 27);
             this.ms_sncode.TabIndex = 126;
             // 
-            // prodcode
-            // 
-            this.prodcode.AllPower = null;
-            this.prodcode.Caller = null;
-            this.prodcode.Condition = null;
-            this.prodcode.DBTitle = null;
-            this.prodcode.FormName = null;
-            this.prodcode.Location = new System.Drawing.Point(792, 446);
-            this.prodcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.prodcode.Name = "prodcode";
-            this.prodcode.Power = null;
-            this.prodcode.ReturnData = null;
-            this.prodcode.SelectField = null;
-            this.prodcode.SetValueField = null;
-            this.prodcode.Size = new System.Drawing.Size(206, 31);
-            this.prodcode.TabIndex = 124;
-            this.prodcode.TableName = null;
-            this.prodcode.TextBoxEnable = true;
-            this.prodcode.TextKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextKeyDown(this.prodcode_TextKeyDown);
+            // bd_soncode
+            // 
+            this.bd_soncode.AllPower = null;
+            this.bd_soncode.Caller = null;
+            this.bd_soncode.Condition = null;
+            this.bd_soncode.DBTitle = null;
+            this.bd_soncode.FormName = null;
+            this.bd_soncode.Location = new System.Drawing.Point(704, 372);
+            this.bd_soncode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.bd_soncode.Name = "bd_soncode";
+            this.bd_soncode.Power = null;
+            this.bd_soncode.ReturnData = null;
+            this.bd_soncode.SelectField = null;
+            this.bd_soncode.SetValueField = null;
+            this.bd_soncode.Size = new System.Drawing.Size(183, 26);
+            this.bd_soncode.TabIndex = 124;
+            this.bd_soncode.TableName = null;
+            this.bd_soncode.Tag = "bd_soncode";
+            this.bd_soncode.TextBoxEnable = true;
             // 
             // mbp_partdgv
             // 
@@ -448,11 +448,11 @@
             this.mbp_part1,
             this.DeleteCom,
             this.mbp_id});
-            this.mbp_partdgv.Location = new System.Drawing.Point(687, 502);
+            this.mbp_partdgv.Location = new System.Drawing.Point(611, 418);
             this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.mbp_partdgv.Name = "mbp_partdgv";
             this.mbp_partdgv.RowTemplate.Height = 27;
-            this.mbp_partdgv.Size = new System.Drawing.Size(393, 228);
+            this.mbp_partdgv.Size = new System.Drawing.Size(349, 190);
             this.mbp_partdgv.TabIndex = 121;
             this.mbp_partdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbp_partdgv_CellContentClick);
             // 
@@ -489,11 +489,11 @@
             this.mbl_loc1,
             this.DeletePos,
             this.mbl_id});
-            this.mbl_locdgv.Location = new System.Drawing.Point(250, 502);
+            this.mbl_locdgv.Location = new System.Drawing.Point(222, 418);
             this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.mbl_locdgv.Name = "mbl_locdgv";
             this.mbl_locdgv.RowTemplate.Height = 27;
-            this.mbl_locdgv.Size = new System.Drawing.Size(393, 228);
+            this.mbl_locdgv.Size = new System.Drawing.Size(349, 190);
             this.mbl_locdgv.TabIndex = 120;
             this.mbl_locdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbl_locdgv_CellContentClick);
             // 
@@ -525,11 +525,11 @@
             this.RefreshTreeView.AllPower = null;
             this.RefreshTreeView.Cursor = System.Windows.Forms.Cursors.Hand;
             this.RefreshTreeView.Image = global::UAS_MES.Properties.Resources.refresh;
-            this.RefreshTreeView.Location = new System.Drawing.Point(127, 192);
+            this.RefreshTreeView.Location = new System.Drawing.Point(113, 160);
             this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.RefreshTreeView.Name = "RefreshTreeView";
             this.RefreshTreeView.Power = null;
-            this.RefreshTreeView.Size = new System.Drawing.Size(30, 30);
+            this.RefreshTreeView.Size = new System.Drawing.Size(27, 25);
             this.RefreshTreeView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.RefreshTreeView.TabIndex = 119;
             this.RefreshTreeView.TabStop = false;
@@ -542,11 +542,11 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
-            this.GetSNCode.Location = new System.Drawing.Point(366, 815);
-            this.GetSNCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.GetSNCode.Location = new System.Drawing.Point(325, 679);
+            this.GetSNCode.Margin = new System.Windows.Forms.Padding(4);
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Power = null;
-            this.GetSNCode.Size = new System.Drawing.Size(280, 28);
+            this.GetSNCode.Size = new System.Drawing.Size(249, 25);
             this.GetSNCode.Str = null;
             this.GetSNCode.Str1 = null;
             this.GetSNCode.Str2 = null;
@@ -561,13 +561,13 @@
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.Image = null;
             this.NewRepairInf.IsShowBorder = true;
-            this.NewRepairInf.Location = new System.Drawing.Point(413, 754);
-            this.NewRepairInf.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.NewRepairInf.Location = new System.Drawing.Point(367, 628);
+            this.NewRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
             this.NewRepairInf.Power = null;
-            this.NewRepairInf.Size = new System.Drawing.Size(129, 36);
+            this.NewRepairInf.Size = new System.Drawing.Size(115, 30);
             this.NewRepairInf.TabIndex = 112;
             this.NewRepairInf.Tag = "IfWrite";
             this.NewRepairInf.Text = "新增维修信息";
@@ -581,13 +581,13 @@
             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(583, 754);
-            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.SaveRepairInf.Location = new System.Drawing.Point(518, 628);
+            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(4);
             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(129, 36);
+            this.SaveRepairInf.Size = new System.Drawing.Size(115, 30);
             this.SaveRepairInf.TabIndex = 111;
             this.SaveRepairInf.Tag = "IfWrite";
             this.SaveRepairInf.Text = "保存维修信息";
@@ -601,13 +601,13 @@
             this.DeleteRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.DownImage")));
             this.DeleteRepairInf.Image = null;
             this.DeleteRepairInf.IsShowBorder = true;
-            this.DeleteRepairInf.Location = new System.Drawing.Point(754, 754);
-            this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.DeleteRepairInf.Location = new System.Drawing.Point(670, 628);
+            this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.Name = "DeleteRepairInf";
             this.DeleteRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.NormalImage")));
             this.DeleteRepairInf.Power = null;
-            this.DeleteRepairInf.Size = new System.Drawing.Size(86, 36);
+            this.DeleteRepairInf.Size = new System.Drawing.Size(76, 30);
             this.DeleteRepairInf.TabIndex = 110;
             this.DeleteRepairInf.Tag = "IfWrite";
             this.DeleteRepairInf.Text = "删除";
@@ -621,17 +621,16 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbl_loc.BackColor = System.Drawing.Color.White;
             this.mbl_loc.ID = null;
-            this.mbl_loc.Location = new System.Drawing.Point(393, 448);
-            this.mbl_loc.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.mbl_loc.Location = new System.Drawing.Point(349, 373);
+            this.mbl_loc.Margin = new System.Windows.Forms.Padding(4);
             this.mbl_loc.Name = "mbl_loc";
             this.mbl_loc.Power = null;
-            this.mbl_loc.Size = new System.Drawing.Size(181, 28);
+            this.mbl_loc.Size = new System.Drawing.Size(161, 25);
             this.mbl_loc.Str = null;
             this.mbl_loc.Str1 = null;
             this.mbl_loc.Str2 = null;
             this.mbl_loc.TabIndex = 104;
             this.mbl_loc.Tag = "Read";
-            this.mbl_loc.TextChanged += new System.EventHandler(this.mbl_loc_TextChanged);
             this.mbl_loc.KeyDown += new System.Windows.Forms.KeyEventHandler(this.mbl_loc_KeyDown);
             // 
             // mbr_solutioncode
@@ -642,11 +641,11 @@
             this.mbr_solutioncode.BackColor = System.Drawing.Color.White;
             this.mbr_solutioncode.Enabled = false;
             this.mbr_solutioncode.ID = null;
-            this.mbr_solutioncode.Location = new System.Drawing.Point(754, 358);
-            this.mbr_solutioncode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.mbr_solutioncode.Location = new System.Drawing.Point(670, 298);
+            this.mbr_solutioncode.Margin = new System.Windows.Forms.Padding(4);
             this.mbr_solutioncode.Name = "mbr_solutioncode";
             this.mbr_solutioncode.Power = null;
-            this.mbr_solutioncode.Size = new System.Drawing.Size(180, 28);
+            this.mbr_solutioncode.Size = new System.Drawing.Size(160, 25);
             this.mbr_solutioncode.Str = null;
             this.mbr_solutioncode.Str1 = null;
             this.mbr_solutioncode.Str2 = null;
@@ -661,11 +660,11 @@
             this.mbc_component.BackColor = System.Drawing.Color.White;
             this.mbc_component.Enabled = false;
             this.mbc_component.ID = null;
-            this.mbc_component.Location = new System.Drawing.Point(394, 359);
-            this.mbc_component.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.mbc_component.Location = new System.Drawing.Point(350, 299);
+            this.mbc_component.Margin = new System.Windows.Forms.Padding(4);
             this.mbc_component.Name = "mbc_component";
             this.mbc_component.Power = null;
-            this.mbc_component.Size = new System.Drawing.Size(180, 28);
+            this.mbc_component.Size = new System.Drawing.Size(160, 25);
             this.mbc_component.Str = null;
             this.mbc_component.Str1 = null;
             this.mbc_component.Str2 = null;
@@ -680,11 +679,11 @@
             this.mbr_dutycode.BackColor = System.Drawing.Color.White;
             this.mbr_dutycode.Enabled = false;
             this.mbr_dutycode.ID = null;
-            this.mbr_dutycode.Location = new System.Drawing.Point(1099, 298);
-            this.mbr_dutycode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.mbr_dutycode.Location = new System.Drawing.Point(977, 248);
+            this.mbr_dutycode.Margin = new System.Windows.Forms.Padding(4);
             this.mbr_dutycode.Name = "mbr_dutycode";
             this.mbr_dutycode.Power = null;
-            this.mbr_dutycode.Size = new System.Drawing.Size(180, 28);
+            this.mbr_dutycode.Size = new System.Drawing.Size(160, 25);
             this.mbr_dutycode.Str = null;
             this.mbr_dutycode.Str1 = null;
             this.mbr_dutycode.Str2 = null;
@@ -699,11 +698,11 @@
             this.nr_name.BackColor = System.Drawing.Color.White;
             this.nr_name.Enabled = false;
             this.nr_name.ID = null;
-            this.nr_name.Location = new System.Drawing.Point(754, 293);
-            this.nr_name.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.nr_name.Location = new System.Drawing.Point(670, 248);
+            this.nr_name.Margin = new System.Windows.Forms.Padding(4);
             this.nr_name.Name = "nr_name";
             this.nr_name.Power = null;
-            this.nr_name.Size = new System.Drawing.Size(180, 28);
+            this.nr_name.Size = new System.Drawing.Size(160, 25);
             this.nr_name.Str = null;
             this.nr_name.Str1 = null;
             this.nr_name.Str2 = null;
@@ -719,11 +718,11 @@
             this.nrg_name.BackColor = System.Drawing.Color.White;
             this.nrg_name.Enabled = false;
             this.nrg_name.ID = null;
-            this.nrg_name.Location = new System.Drawing.Point(394, 298);
-            this.nrg_name.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.nrg_name.Location = new System.Drawing.Point(350, 248);
+            this.nrg_name.Margin = new System.Windows.Forms.Padding(4);
             this.nrg_name.Name = "nrg_name";
             this.nrg_name.Power = null;
-            this.nrg_name.Size = new System.Drawing.Size(180, 28);
+            this.nrg_name.Size = new System.Drawing.Size(160, 25);
             this.nrg_name.Str = null;
             this.nrg_name.Str1 = null;
             this.nrg_name.Str2 = null;
@@ -738,11 +737,11 @@
             this.bc_name.BackColor = System.Drawing.Color.White;
             this.bc_name.Enabled = false;
             this.bc_name.ID = null;
-            this.bc_name.Location = new System.Drawing.Point(754, 229);
-            this.bc_name.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.bc_name.Location = new System.Drawing.Point(670, 191);
+            this.bc_name.Margin = new System.Windows.Forms.Padding(4);
             this.bc_name.Name = "bc_name";
             this.bc_name.Power = null;
-            this.bc_name.Size = new System.Drawing.Size(180, 28);
+            this.bc_name.Size = new System.Drawing.Size(160, 25);
             this.bc_name.Str = null;
             this.bc_name.Str1 = null;
             this.bc_name.Str2 = null;
@@ -758,11 +757,11 @@
             this.bg_name.Enabled = false;
             this.bg_name.ForeColor = System.Drawing.Color.Red;
             this.bg_name.ID = null;
-            this.bg_name.Location = new System.Drawing.Point(394, 230);
-            this.bg_name.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.bg_name.Location = new System.Drawing.Point(350, 192);
+            this.bg_name.Margin = new System.Windows.Forms.Padding(4);
             this.bg_name.Name = "bg_name";
             this.bg_name.Power = null;
-            this.bg_name.Size = new System.Drawing.Size(180, 28);
+            this.bg_name.Size = new System.Drawing.Size(160, 25);
             this.bg_name.Str = null;
             this.bg_name.Str1 = null;
             this.bg_name.Str2 = null;
@@ -772,10 +771,10 @@
             // OperatResult
             // 
             this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperatResult.Location = new System.Drawing.Point(1099, 445);
-            this.OperatResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.OperatResult.Location = new System.Drawing.Point(977, 371);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperatResult.Name = "OperatResult";
-            this.OperatResult.Size = new System.Drawing.Size(234, 373);
+            this.OperatResult.Size = new System.Drawing.Size(208, 311);
             this.OperatResult.TabIndex = 87;
             this.OperatResult.Text = "";
             // 
@@ -786,11 +785,11 @@
             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(414, 66);
+            this.ms_makecode.Location = new System.Drawing.Point(368, 55);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(225, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 31);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 85;
             // 
             // ms_prodcode
@@ -800,12 +799,13 @@
             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(745, 66);
+            this.ms_prodcode.Location = new System.Drawing.Point(662, 55);
             this.ms_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_prodcode.MaximumSize = new System.Drawing.Size(225, 0);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_prodcode.Name = "ms_prodcode";
-            this.ms_prodcode.Size = new System.Drawing.Size(0, 31);
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 27);
             this.ms_prodcode.TabIndex = 83;
+            this.ms_prodcode.TextChanged += new System.EventHandler(this.ms_prodcode_TextChanged);
             // 
             // pr_detail
             // 
@@ -814,11 +814,11 @@
             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(1089, 66);
+            this.pr_detail.Location = new System.Drawing.Point(968, 55);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(225, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 31);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 82;
             // 
             // Clean
@@ -828,13 +828,13 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1172, 828);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Clean.Location = new System.Drawing.Point(1042, 690);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(90, 36);
+            this.Clean.Size = new System.Drawing.Size(80, 30);
             this.Clean.TabIndex = 81;
             this.Clean.Tag = "IfWrite";
             this.Clean.Text = "清除";
@@ -850,14 +850,14 @@
             this.cd_stepcode.Condition = null;
             this.cd_stepcode.DBTitle = "回流工序";
             this.cd_stepcode.FormName = null;
-            this.cd_stepcode.Location = new System.Drawing.Point(522, 125);
-            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.cd_stepcode.Location = new System.Drawing.Point(464, 104);
+            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4);
             this.cd_stepcode.Name = "cd_stepcode";
             this.cd_stepcode.Power = null;
             this.cd_stepcode.ReturnData = null;
             this.cd_stepcode.SelectField = null;
             this.cd_stepcode.SetValueField = null;
-            this.cd_stepcode.Size = new System.Drawing.Size(225, 31);
+            this.cd_stepcode.Size = new System.Drawing.Size(200, 26);
             this.cd_stepcode.TabIndex = 68;
             this.cd_stepcode.TableName = null;
             this.cd_stepcode.Tag = "ms_stepcode";
@@ -872,14 +872,14 @@
             this.cr_code.Condition = null;
             this.cr_code.DBTitle = "回流途程";
             this.cr_code.FormName = null;
-            this.cr_code.Location = new System.Drawing.Point(136, 124);
-            this.cr_code.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.cr_code.Location = new System.Drawing.Point(121, 103);
+            this.cr_code.Margin = new System.Windows.Forms.Padding(4);
             this.cr_code.Name = "cr_code";
             this.cr_code.Power = null;
             this.cr_code.ReturnData = null;
             this.cr_code.SelectField = null;
             this.cr_code.SetValueField = null;
-            this.cr_code.Size = new System.Drawing.Size(225, 31);
+            this.cr_code.Size = new System.Drawing.Size(200, 26);
             this.cr_code.TabIndex = 67;
             this.cr_code.TableName = null;
             this.cr_code.Tag = "ms_craftcode";
@@ -893,13 +893,13 @@
             this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
             this.NewBadCode.Image = null;
             this.NewBadCode.IsShowBorder = true;
-            this.NewBadCode.Location = new System.Drawing.Point(245, 754);
-            this.NewBadCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.NewBadCode.Location = new System.Drawing.Point(218, 628);
+            this.NewBadCode.Margin = new System.Windows.Forms.Padding(4);
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.Name = "NewBadCode";
             this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
             this.NewBadCode.Power = null;
-            this.NewBadCode.Size = new System.Drawing.Size(129, 36);
+            this.NewBadCode.Size = new System.Drawing.Size(115, 30);
             this.NewBadCode.TabIndex = 60;
             this.NewBadCode.Tag = "IfWrite";
             this.NewBadCode.Text = "新增不良代码";
@@ -914,13 +914,13 @@
             this.SaveBadLocation.Enabled = false;
             this.SaveBadLocation.Image = null;
             this.SaveBadLocation.IsShowBorder = true;
-            this.SaveBadLocation.Location = new System.Drawing.Point(577, 445);
-            this.SaveBadLocation.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.SaveBadLocation.Location = new System.Drawing.Point(513, 371);
+            this.SaveBadLocation.Margin = new System.Windows.Forms.Padding(4);
             this.SaveBadLocation.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.MoveImage")));
             this.SaveBadLocation.Name = "SaveBadLocation";
             this.SaveBadLocation.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.NormalImage")));
             this.SaveBadLocation.Power = null;
-            this.SaveBadLocation.Size = new System.Drawing.Size(69, 36);
+            this.SaveBadLocation.Size = new System.Drawing.Size(61, 30);
             this.SaveBadLocation.TabIndex = 59;
             this.SaveBadLocation.Tag = "IfWrite";
             this.SaveBadLocation.Text = "保存";
@@ -934,13 +934,13 @@
             this.Scrap.DownImage = ((System.Drawing.Image)(resources.GetObject("Scrap.DownImage")));
             this.Scrap.Image = null;
             this.Scrap.IsShowBorder = true;
-            this.Scrap.Location = new System.Drawing.Point(934, 119);
-            this.Scrap.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Scrap.Location = new System.Drawing.Point(830, 99);
+            this.Scrap.Margin = new System.Windows.Forms.Padding(4);
             this.Scrap.MoveImage = ((System.Drawing.Image)(resources.GetObject("Scrap.MoveImage")));
             this.Scrap.Name = "Scrap";
             this.Scrap.NormalImage = ((System.Drawing.Image)(resources.GetObject("Scrap.NormalImage")));
             this.Scrap.Power = null;
-            this.Scrap.Size = new System.Drawing.Size(102, 36);
+            this.Scrap.Size = new System.Drawing.Size(91, 30);
             this.Scrap.TabIndex = 56;
             this.Scrap.Tag = "IfWrite";
             this.Scrap.Text = "报废";
@@ -954,13 +954,13 @@
             this.RepairComplete.DownImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.DownImage")));
             this.RepairComplete.Image = null;
             this.RepairComplete.IsShowBorder = true;
-            this.RepairComplete.Location = new System.Drawing.Point(791, 119);
-            this.RepairComplete.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.RepairComplete.Location = new System.Drawing.Point(703, 99);
+            this.RepairComplete.Margin = new System.Windows.Forms.Padding(4);
             this.RepairComplete.MoveImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.MoveImage")));
             this.RepairComplete.Name = "RepairComplete";
             this.RepairComplete.NormalImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.NormalImage")));
             this.RepairComplete.Power = null;
-            this.RepairComplete.Size = new System.Drawing.Size(102, 36);
+            this.RepairComplete.Size = new System.Drawing.Size(91, 30);
             this.RepairComplete.TabIndex = 55;
             this.RepairComplete.Tag = "IfWrite";
             this.RepairComplete.Text = "完成维修";
@@ -973,10 +973,10 @@
             | 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(945, 66);
+            this.pr_detail_label.Location = new System.Drawing.Point(840, 55);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 61;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -986,10 +986,10 @@
             | 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(1176, 64);
+            this.ms_checkno.Location = new System.Drawing.Point(1045, 53);
             this.ms_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_checkno.Name = "ms_checkno";
-            this.ms_checkno.Size = new System.Drawing.Size(110, 31);
+            this.ms_checkno.Size = new System.Drawing.Size(92, 27);
             this.ms_checkno.TabIndex = 128;
             this.ms_checkno.Text = "送检批号";
             this.ms_checkno.Visible = false;
@@ -1000,25 +1000,25 @@
             | 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(1178, 113);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(1047, 94);
             this.ms_reworkcheckno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
-            this.ms_reworkcheckno.Size = new System.Drawing.Size(110, 31);
+            this.ms_reworkcheckno.Size = new System.Drawing.Size(92, 27);
             this.ms_reworkcheckno.TabIndex = 129;
             this.ms_reworkcheckno.Text = "返修批号";
             this.ms_reworkcheckno.Visible = false;
             // 
             // Make_Repair
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1350, 882);
+            this.ClientSize = new System.Drawing.Size(1200, 735);
             this.Controls.Add(this.ms_reworkcheckno);
             this.Controls.Add(this.ms_checkno);
             this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.nr_code);
-            this.Controls.Add(this.prodcode);
+            this.Controls.Add(this.bd_soncode);
             this.Controls.Add(this.bg_code);
             this.Controls.Add(this.bc_code);
             this.Controls.Add(this.mbp_partdgv);
@@ -1070,7 +1070,7 @@
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.panel2);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_Repair";
             this.Tag = "Make!Repair";
             this.Text = "维修作业";
@@ -1142,7 +1142,7 @@
         private System.Windows.Forms.BindingSource ComponentSource;
         private System.Windows.Forms.Label bc_code;
         private System.Windows.Forms.Label bg_code;
-        private CustomControl.TextBoxWithIcon.SearchTextBox prodcode;
+        private CustomControl.TextBoxWithIcon.SearchTextBox bd_soncode;
         private System.Windows.Forms.Label nr_code;
         private CustomControl.ValueLabel.ValueLabel ms_sncode;
         private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;

+ 41 - 20
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -44,10 +44,6 @@ namespace UAS_MES.Make
 
         string reworkstatus = "";
 
-        string dbtable1 = "(select distinct nvl(dsl_prodcode,msl_prodcode)prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode and msl_makecode=rsd_macode where rsd_macode=':macode'  and rsd_sncode=':sncode') left join product on pr_code=prodcode";
-
-        string dbtable2 = "(select distinct nvl(dsl_prodcode,msl_prodcode)prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode and msl_makecode=rsd_macode where rsd_macode=':macode'  and rsd_sncode=':sncode' and ((dsl_location=':msl_location' and dsl_validtime<sysdate and sysdate<dsl_invalidtime) ) or (msl_location=':msl_location' and msl_validtime<sysdate and sysdate<msl_invalidtime)) left join product on pr_code=prodcode";
-
         DataTable Dbfind;
 
         public Make_Repair()
@@ -57,7 +53,6 @@ namespace UAS_MES.Make
 
         private void 维修作业_Load(object sender, EventArgs e)
         {
-            dh = new DataHelper();
             //为DBFind配置Call和Form的名称
             cr_code.FormName = Name;
             cr_code.TableName = "craft";
@@ -73,16 +68,43 @@ namespace UAS_MES.Make
             cd_stepcode.DBTitle = "回流工序";
             cd_stepcode.DbChange += Cd_stepcode_DbChange;
 
-            prodcode.FormName = Name;
-            prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
-            prodcode.SetValueField = new string[] { "prodcode" };
-            prodcode.SelectField = "prodcode # 不良零件编号,pr_detail # 零件名称";
-            prodcode.DBTitle = "不良零件";
+            bd_soncode.FormName = Name;
+            bd_soncode.TableName = "bom left join bomdetail on bd_bomid=bo_id";
+            bd_soncode.SetValueField = new string[] { "bd_soncode" };
+            bd_soncode.SelectField = "bd_soncode # 子件编号";
+            bd_soncode.DBTitle = "不良零件";
+            bd_soncode.DbChange += Prodcode_DbChange;
 
             asc.controllInitializeSize(this);
+            dh = new DataHelper();
             GetSNCode.Focus();
         }
 
+        private void Prodcode_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = bd_soncode.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+            if (bd_soncode.Text != "")
+            {
+                if (mbr_id != "")
+                {
+                    string id = dh.GetSEQ("makebadrspart_seq");
+                    sql.Clear();
+                    sql.Append("insert when (not exists(select 1 from makebadrspart where mbp_sncode='"+GetSNCode.Text+"' and mbp_part='"+bd_soncode.Text+"')) ");
+                    sql.Append("then 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 '"+ id + "'," + mbr_id + ",'" + bd_soncode.Text + "',");
+                    sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                    sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                    dh.ExecuteSql(sql.GetString(), "insert");
+                    DataTable dt = (DataTable)dh.ExecuteSql("select mbp_id,mbp_part from makebadrspart where mbp_mbrid=" + mbr_id, "select");
+                    BaseUtil.FillDgvWithDataTable(mbp_partdgv, dt);
+                }
+                else OperatResult.AppendText(">>请先选择不良原因\n", Color.Red);
+            }
+            else OperatResult.AppendText(">>不良零件不能为空\n", Color.Red);
+        }
+
         private void Cd_stepcode_DbChange(object sender, EventArgs e)
         {
             Dbfind = cd_stepcode.ReturnData;
@@ -462,7 +484,7 @@ namespace UAS_MES.Make
                     sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman,mbp_sccode)");
                     sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:prodcode,");
                     sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
-                    sql.Append("sysdate,'" + User.UserCode + "','"+User.UserSourceCode+"' from dual");
+                    sql.Append("sysdate,'" + User.UserCode + "','" + User.UserSourceCode + "' from dual");
                     dh.BatchInsert(sql.GetString(), new string[] { "prodcode" }, prodcode.ToArray());
                     LogicHandler.DoCommandLog(User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "不良零件保存", "不良零件保存成功", ms_sncode.Text, ms_checkno.Text);
                 }
@@ -531,7 +553,7 @@ namespace UAS_MES.Make
                         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);
-                        sql.Append(",'" + mbl_loc.Text + "','" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                        sql.Append(",'" + mbl_loc.Text.ToUpper() + "','" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
                         sql.Append("sysdate,'" + User.UserCode + "' from dual");
                         dh.ExecuteSql(sql.GetString(), "insert");
                         dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
@@ -544,12 +566,6 @@ namespace UAS_MES.Make
             else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
 
-        private void mbl_loc_TextChanged(object sender, EventArgs e)
-        {
-            if (mbl_loc.Text != "")
-                prodcode.TableName = dbtable2.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text).Replace(":msl_location", mbl_loc.Text);
-        }
-
         private void nr_name_TextChanged(object sender, EventArgs e)
         {
             if (nr_name.Text == "")
@@ -569,14 +585,14 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (prodcode.Text != "")
+                if (bd_soncode.Text != "")
                 {
                     if (mbr_id != "")
                     {
                         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 + ",'" + prodcode.Text + "',");
+                        sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + bd_soncode.Text + "',");
                         sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
                         sql.Append("sysdate,'" + User.UserCode + "' from dual");
                         dh.ExecuteSql(sql.GetString(), "insert");
@@ -623,5 +639,10 @@ namespace UAS_MES.Make
         {
             dh.Dispose();
         }
+
+        private void ms_prodcode_TextChanged(object sender, EventArgs e)
+        {
+            bd_soncode.Condition = "bd_mothercode='" + ms_prodcode.Text + "'";
+        }
     }
 }