Browse Source

拆解处理界面表格数据显示修改

Hcsy 8 years ago
parent
commit
cc27d6b613

+ 109 - 108
UAS-MES/FunctionCode/Make/Make_Decompose.Designer.cs

@@ -67,6 +67,14 @@
             this.ms_wccode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftname = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.deccount = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.Decompose = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.cm_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_spid = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -92,14 +100,6 @@
             this.cm_maprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.deccount = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.Decompose = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
             // 
@@ -518,6 +518,104 @@
             this.ms_craftcode.TabIndex = 189;
             this.ms_craftcode.Visible = false;
             // 
+            // deccount
+            // 
+            this.deccount.AutoSize = true;
+            this.deccount.CutLength = null;
+            this.deccount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.deccount.Location = new System.Drawing.Point(825, 18);
+            this.deccount.MaximumSize = new System.Drawing.Size(150, 0);
+            this.deccount.Name = "deccount";
+            this.deccount.Size = new System.Drawing.Size(0, 21);
+            this.deccount.TabIndex = 187;
+            this.deccount.Tag = "1";
+            // 
+            // ms_makecode
+            // 
+            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(413, 18);
+            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);
+            this.ms_makecode.TabIndex = 186;
+            this.ms_makecode.Tag = "1";
+            // 
+            // ms_prodcode
+            // 
+            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(125, 66);
+            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);
+            this.ms_prodcode.TabIndex = 184;
+            this.ms_prodcode.Tag = "1";
+            // 
+            // ms_sncode
+            // 
+            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(125, 18);
+            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);
+            this.ms_sncode.TabIndex = 183;
+            this.ms_sncode.Tag = "1";
+            // 
+            // Decompose
+            // 
+            this.Decompose.AllPower = null;
+            this.Decompose.BackColor = System.Drawing.Color.Transparent;
+            this.Decompose.DownImage = ((System.Drawing.Image)(resources.GetObject("Decompose.DownImage")));
+            this.Decompose.Image = ((System.Drawing.Image)(resources.GetObject("Decompose.Image")));
+            this.Decompose.IsShowBorder = true;
+            this.Decompose.Location = new System.Drawing.Point(533, 533);
+            this.Decompose.MoveImage = ((System.Drawing.Image)(resources.GetObject("Decompose.MoveImage")));
+            this.Decompose.Name = "Decompose";
+            this.Decompose.NormalImage = ((System.Drawing.Image)(resources.GetObject("Decompose.NormalImage")));
+            this.Decompose.Power = null;
+            this.Decompose.Size = new System.Drawing.Size(76, 27);
+            this.Decompose.TabIndex = 175;
+            this.Decompose.Text = "确定拆解";
+            this.Decompose.UseVisualStyleBackColor = true;
+            this.Decompose.Click += new System.EventHandler(this.Decompose_Click);
+            // 
+            // sn_code
+            // 
+            this.sn_code.AllPower = null;
+            this.sn_code.BackColor = System.Drawing.Color.White;
+            this.sn_code.ID = null;
+            this.sn_code.Location = new System.Drawing.Point(147, 535);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = null;
+            this.sn_code.Size = new System.Drawing.Size(196, 21);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 174;
+            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(12, 355);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(889, 152);
+            this.OperateResult.TabIndex = 172;
+            this.OperateResult.Text = "";
+            // 
+            // dataGridViewCheckBoxColumn2
+            // 
+            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewCheckBoxColumn2.HeaderText = "拆解";
+            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
+            this.dataGridViewCheckBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.dataGridViewCheckBoxColumn2.Width = 40;
+            // 
             // Choose
             // 
             this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -636,6 +734,7 @@
             // 
             // pr_detail_
             // 
+            this.pr_detail_.DataPropertyName = "pr_detail";
             this.pr_detail_.HeaderText = "子件名称";
             this.pr_detail_.Name = "pr_detail_";
             // 
@@ -703,104 +802,6 @@
             this.cm_makecode.Name = "cm_makecode";
             this.cm_makecode.Visible = false;
             // 
-            // deccount
-            // 
-            this.deccount.AutoSize = true;
-            this.deccount.CutLength = null;
-            this.deccount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.deccount.Location = new System.Drawing.Point(825, 18);
-            this.deccount.MaximumSize = new System.Drawing.Size(150, 0);
-            this.deccount.Name = "deccount";
-            this.deccount.Size = new System.Drawing.Size(0, 21);
-            this.deccount.TabIndex = 187;
-            this.deccount.Tag = "1";
-            // 
-            // ms_makecode
-            // 
-            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(413, 18);
-            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);
-            this.ms_makecode.TabIndex = 186;
-            this.ms_makecode.Tag = "1";
-            // 
-            // ms_prodcode
-            // 
-            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(125, 66);
-            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);
-            this.ms_prodcode.TabIndex = 184;
-            this.ms_prodcode.Tag = "1";
-            // 
-            // ms_sncode
-            // 
-            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(125, 18);
-            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);
-            this.ms_sncode.TabIndex = 183;
-            this.ms_sncode.Tag = "1";
-            // 
-            // Decompose
-            // 
-            this.Decompose.AllPower = null;
-            this.Decompose.BackColor = System.Drawing.Color.Transparent;
-            this.Decompose.DownImage = ((System.Drawing.Image)(resources.GetObject("Decompose.DownImage")));
-            this.Decompose.Image = ((System.Drawing.Image)(resources.GetObject("Decompose.Image")));
-            this.Decompose.IsShowBorder = true;
-            this.Decompose.Location = new System.Drawing.Point(533, 533);
-            this.Decompose.MoveImage = ((System.Drawing.Image)(resources.GetObject("Decompose.MoveImage")));
-            this.Decompose.Name = "Decompose";
-            this.Decompose.NormalImage = ((System.Drawing.Image)(resources.GetObject("Decompose.NormalImage")));
-            this.Decompose.Power = null;
-            this.Decompose.Size = new System.Drawing.Size(76, 27);
-            this.Decompose.TabIndex = 175;
-            this.Decompose.Text = "确定拆解";
-            this.Decompose.UseVisualStyleBackColor = true;
-            this.Decompose.Click += new System.EventHandler(this.Decompose_Click);
-            // 
-            // sn_code
-            // 
-            this.sn_code.AllPower = null;
-            this.sn_code.BackColor = System.Drawing.Color.White;
-            this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(147, 535);
-            this.sn_code.Name = "sn_code";
-            this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(196, 21);
-            this.sn_code.Str = null;
-            this.sn_code.Str1 = null;
-            this.sn_code.Str2 = null;
-            this.sn_code.TabIndex = 174;
-            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
-            // 
-            // OperateResult
-            // 
-            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(12, 355);
-            this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(889, 152);
-            this.OperateResult.TabIndex = 172;
-            this.OperateResult.Text = "";
-            // 
-            // dataGridViewCheckBoxColumn2
-            // 
-            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn2.HeaderText = "拆解";
-            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
-            this.dataGridViewCheckBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.dataGridViewCheckBoxColumn2.Width = 40;
-            // 
             // Make_Decompose
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -884,6 +885,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn20;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn21;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn22;
+        private CustomControl.ValueLabel.ValueLabel pr_name;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn23;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_status;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_spid;
@@ -909,7 +912,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_maprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
-        private CustomControl.ValueLabel.ValueLabel pr_name;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn23;
     }
 }

+ 7 - 6
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -108,10 +108,10 @@ namespace UAS_MES.Make
             //cm_wccode
             sncode_1 = sncode;
             sql.Clear();
-            sql.Append("select cm_craftcode,cm_spid,cm_craftname,cm_firstsn,cm_makecode,cm_sncode,cm_stepcode,cm_stepname,cm_maprodcode,cm_fsoncode,cm_wccode,cm_maid,cm_soncode,pr_detail,cm_materialtype,");
-            sql.Append("max(cm_status) cm_status,max(cm_id) cm_id from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode  in (select sn from makesnrelation ");
-            sql.Append("where firstsn='" + sncode_1 + "')  or cm_sncode in ( select firstsn from makesnrelation where sn = '" + sncode_1 + "')");
-            sql.Append("or cm_sncode = '" + sncode_1 + "') group by cm_craftcode,cm_firstsn,cm_stepcode,cm_stepname,cm_spid,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_soncode,cm_wccode,pr_detail,cm_materialtype,cm_craftname,cm_fsoncode ORDER BY cm_status DESC");
+            sql.Append("select cm_craftcode,cm_spid,cm_craftname,cm_firstsn,cm_makecode,cm_stepcode,cm_stepname,cm_maprodcode,cm_fsoncode,cm_wccode,cm_maid,cm_soncode,pr_detail,cm_materialtype,");
+            sql.Append("max(cm_status) cm_status,max(cm_id) cm_id from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode  in (select firstsn from makesnrelation where sn ");
+            sql.Append(" ='" + sncode_1 + "'union all select sn from makesnrelation where firstsn = '" + sncode_1 + "')");
+            sql.Append("or cm_sncode = '" + sncode_1 + "') group by cm_craftcode,cm_firstsn,cm_stepcode,cm_stepname,cm_spid,cm_makecode,cm_maprodcode,cm_maid,cm_soncode,cm_wccode,pr_detail,cm_materialtype,cm_craftname,cm_fsoncode ORDER BY cm_status DESC");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -119,7 +119,8 @@ namespace UAS_MES.Make
                 for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                 {
                     LabelDataGridView.Rows[i].Cells["cm_barcode"].Value = dh.getFieldDataByCondition("CRAFTMATERIAL", "CM_BARCODE", "cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
-                    LabelDataGridView.Rows[i].Cells["pr_detail_"].Value = dh.getFieldDataByCondition("product", "pr_detail", "pr_code = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
+                    LabelDataGridView.Rows[i].Cells["cm_sncode"].Value = dh.getFieldDataByCondition("CRAFTMATERIAL", "cm_sncode", "cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                    // LabelDataGridView.Rows[i].Cells["pr_detail_"].Value = dh.getFieldDataByCondition("product", "pr_detail", "pr_code = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
                     LabelDataGridView.Rows[i].Cells["cm_status_1"].Value = (LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() == "-1") ? "已拆解" : "上线";
                 }
             }
@@ -186,7 +187,7 @@ namespace UAS_MES.Make
                     BaseUtil.CleanForm(this);
                     sn_code.Focus();
                     return;
-                }           
+                }
             }
             else
             {