Browse Source

维修自动选中交点

callm 4 years ago
parent
commit
face350d1b

+ 1 - 0
UAS_MES_PW/FunctionCode/Make/Make_Decompose.cs

@@ -458,6 +458,7 @@ namespace UAS_MES_NEW.Make
             }
             if (decompose)
             {
+                sn_code.Focus();
                 count++;
                 deccount.Text = count + "";
                 LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));

+ 14 - 13
UAS_MES_PW/FunctionCode/Make/Make_Repair.Designer.cs

@@ -254,6 +254,7 @@
             this.BadCodeTree.Name = "BadCodeTree";
             this.BadCodeTree.Size = new System.Drawing.Size(284, 848);
             this.BadCodeTree.TabIndex = 118;
+            this.BadCodeTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.BadCodeTree_AfterSelect);
             this.BadCodeTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.BadCodeTree_NodeMouseClick);
             // 
             // bc_code
@@ -452,7 +453,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(1581, 115);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(1582, 116);
             this.ms_reworkcheckno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
             this.ms_reworkcheckno.Size = new System.Drawing.Size(146, 41);
@@ -466,7 +467,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(403, 51);
+            this.ms_makecode_label.Location = new System.Drawing.Point(404, 52);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(114, 41);
@@ -479,7 +480,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(27, 49);
+            this.ms_sncode_label.Location = new System.Drawing.Point(28, 50);
             this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
             this.ms_sncode_label.Size = new System.Drawing.Size(114, 41);
@@ -492,7 +493,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(1577, 51);
+            this.ms_checkno.Location = new System.Drawing.Point(1578, 52);
             this.ms_checkno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_checkno.Name = "ms_checkno";
             this.ms_checkno.Size = new System.Drawing.Size(146, 41);
@@ -528,7 +529,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(177, 51);
+            this.ms_sncode.Location = new System.Drawing.Point(178, 52);
             this.ms_sncode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_sncode.MaximumSize = new System.Drawing.Size(300, 0);
             this.ms_sncode.Name = "ms_sncode";
@@ -561,7 +562,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(1677, 441);
+            this.nr_code.Location = new System.Drawing.Point(1678, 442);
             this.nr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.nr_code.Name = "nr_code";
             this.nr_code.Size = new System.Drawing.Size(0, 41);
@@ -573,7 +574,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(527, 127);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(528, 128);
             this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
             this.st_rstepcode_label.Size = new System.Drawing.Size(146, 41);
@@ -586,7 +587,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(27, 127);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(28, 128);
             this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
             this.ma_craftcode_label.Size = new System.Drawing.Size(146, 41);
@@ -621,7 +622,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(1271, 51);
+            this.pr_detail_label.Location = new System.Drawing.Point(1272, 52);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
@@ -634,7 +635,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(813, 51);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(814, 52);
             this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
             this.ms_prodcode_label.Size = new System.Drawing.Size(146, 41);
@@ -648,7 +649,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(1463, 51);
+            this.pr_detail.Location = new System.Drawing.Point(1464, 52);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(300, 0);
             this.pr_detail.Name = "pr_detail";
@@ -662,7 +663,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(1005, 51);
+            this.ms_prodcode.Location = new System.Drawing.Point(1006, 52);
             this.ms_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
             this.ms_prodcode.Name = "ms_prodcode";
@@ -677,7 +678,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(563, 51);
+            this.ms_makecode.Location = new System.Drawing.Point(564, 52);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(300, 0);
             this.ms_makecode.Name = "ms_makecode";

+ 46 - 0
UAS_MES_PW/FunctionCode/Make/Make_Repair.cs

@@ -445,6 +445,8 @@ namespace UAS_MES_NEW.Make
                 if (!BadInf_1.ContainsKey(tnode_0.Tag.ToString()))
                     BadInf_1.Add(tnode_0.Tag.ToString(), dic);
                 BadCodeTree.Nodes.Add(tnode_0);
+                BadCodeTree.SelectedNode = BadCodeTree.Nodes[0];
+
                 //添加子节点
                 sql.Clear();
                 sql.Append("select mbr_id,mbr_brcode,mbr_brgcode,mbr_solutioncode,so_code,so_name,mbr_dutycode,mbr_dutyname,nd_name,nrg_name");
@@ -971,5 +973,49 @@ namespace UAS_MES_NEW.Make
             if (so_code.Text == "" || (so_code.Text != "" && so_code.Text != so_name.Value))
                 so_code.Text = so_name.Value;
         }
+
+        private void BadCodeTree_AfterSelect(object sender, TreeViewEventArgs e)
+        {
+            if (e.Node.Level == 0)
+            {
+                mb_id = e.Node.Tag.ToString();
+                BaseUtil.CleanControlsText(bc_name, bc_code, bg_name, bg_code, mb_badremark, nrg_name, nrg_code, nr_name, nr_code, so_name, so_code, mbr_dutyname, mbr_dutycode, mbc_component);
+                mbl_locdgv.DataSource = null;
+                mbp_partdgv.DataSource = null;
+                bc_name.Text = BadInf_1[mb_id]["bc_name"];
+                bc_code.Text = BadInf_1[mb_id]["mb_badcode"];
+                bg_name.Text = BadInf_1[mb_id]["bg_name"];
+                bg_code.Text = BadInf_1[mb_id]["mb_bgcode"];
+                mb_badremark.Text = BadInf_1[mb_id]["mb_badremark"];
+                mbr_id = "";
+                SaveRepairInf.Enabled = true;
+            }
+            if (e.Node.Level == 1)
+            {
+                //展示父节点信息
+                mb_id = e.Node.Parent.Tag.ToString();
+                bc_code.Text = BadInf_1[mb_id]["mb_badcode"];
+                bc_name.Text = BadInf_1[mb_id]["bc_name"];
+                bg_code.Text = BadInf_1[mb_id]["mb_bgcode"];
+                bg_name.Text = BadInf_1[mb_id]["bg_name"];
+                //展示子节点信息
+                mbr_id = e.Node.Tag.ToString();
+                nrg_code.Text = BadInf_2[mbr_id]["nrg_code"];
+                nrg_name.Text = BadInf_2[mbr_id]["nrg_name"];
+                nr_code.Text = BadInf_2[mbr_id]["nr_code"];
+                nr_name.Text = BadInf_2[mbr_id]["nr_name"];
+                so_code.Text = BadInf_2[mbr_id]["so_code"];
+                so_name.Text = BadInf_2[mbr_id]["so_name"];
+                mbr_dutycode.Text = BadInf_2[mbr_id]["mbr_dutycode"];
+                mbr_dutyname.Text = BadInf_2[mbr_id]["mbr_dutyname"];
+                mbc_component.Text = dh.getFieldDataByCondition("makebadrscom", "mbc_component", "mbc_mbrid=" + mbr_id).ToString();
+                //加载两个Grid的数据源
+                DataTable dt = (DataTable)dh.ExecuteSql("select mbp_id,mbp_part from makebadrspart where mbp_mbrid=" + mbr_id, "select");
+                BaseUtil.FillDgvWithDataTable(mbp_partdgv, dt);
+                dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
+                BaseUtil.FillDgvWithDataTable(mbl_locdgv, dt);
+                SaveRepairInf.Enabled = false;
+            }
+        }
     }
 }