Browse Source

添加查询界面

章政 8 years ago
parent
commit
4784335323

+ 67 - 38
UAS-MES/FunctionCode/Query/Query_ExeProgress.Designer.cs

@@ -50,6 +50,8 @@
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_code_label = new System.Windows.Forms.Label();
+            this.ma_code = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
@@ -62,10 +64,10 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(15, 16);
+            this.sn_code_label.Location = new System.Drawing.Point(13, 16);
             this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(86, 31);
+            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
             this.sn_code_label.TabIndex = 183;
             this.sn_code_label.Text = "序列号";
             // 
@@ -75,9 +77,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.SerialPanel.AutoScroll = true;
             this.SerialPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.SerialPanel.Location = new System.Drawing.Point(21, 160);
+            this.SerialPanel.Location = new System.Drawing.Point(19, 133);
+            this.SerialPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SerialPanel.Name = "SerialPanel";
-            this.SerialPanel.Size = new System.Drawing.Size(1423, 379);
+            this.SerialPanel.Size = new System.Drawing.Size(1265, 316);
             this.SerialPanel.TabIndex = 194;
             this.SerialPanel.Scroll += new System.Windows.Forms.ScrollEventHandler(this.SerialPanel_Scroll);
             this.SerialPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.SerialPanel_Paint);
@@ -98,10 +101,11 @@
             this.mp_inman,
             this.em_name});
             this.CraftInfDgv.EnableContentClick = true;
-            this.CraftInfDgv.Location = new System.Drawing.Point(0, 582);
+            this.CraftInfDgv.Location = new System.Drawing.Point(0, 485);
+            this.CraftInfDgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CraftInfDgv.Name = "CraftInfDgv";
             this.CraftInfDgv.RowTemplate.Height = 27;
-            this.CraftInfDgv.Size = new System.Drawing.Size(1462, 285);
+            this.CraftInfDgv.Size = new System.Drawing.Size(1300, 237);
             this.CraftInfDgv.TabIndex = 193;
             // 
             // mp_sncode
@@ -179,11 +183,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.label2);
             this.groupBoxWithBorder1.Controls.Add(this.label3);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(18, 60);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(16, 50);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1430, 60);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1271, 50);
             this.groupBoxWithBorder1.TabIndex = 192;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "颜色说明";
@@ -193,30 +197,30 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1272, 21);
+            this.label1.Location = new System.Drawing.Point(1132, 18);
             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 = 193;
             this.label1.Text = "尚未执行";
             // 
             // pictureBox4
             // 
             this.pictureBox4.BackColor = System.Drawing.Color.White;
-            this.pictureBox4.Location = new System.Drawing.Point(1164, 18);
-            this.pictureBox4.Margin = new System.Windows.Forms.Padding(4);
+            this.pictureBox4.Location = new System.Drawing.Point(1035, 15);
+            this.pictureBox4.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox4.Name = "pictureBox4";
-            this.pictureBox4.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox4.Size = new System.Drawing.Size(80, 25);
             this.pictureBox4.TabIndex = 192;
             this.pictureBox4.TabStop = false;
             // 
             // pictureBox2
             // 
             this.pictureBox2.BackColor = System.Drawing.Color.Green;
-            this.pictureBox2.Location = new System.Drawing.Point(148, 18);
-            this.pictureBox2.Margin = new System.Windows.Forms.Padding(4);
+            this.pictureBox2.Location = new System.Drawing.Point(132, 15);
+            this.pictureBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox2.Size = new System.Drawing.Size(80, 25);
             this.pictureBox2.TabIndex = 187;
             this.pictureBox2.TabStop = false;
             // 
@@ -224,30 +228,30 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(980, 21);
+            this.label4.Location = new System.Drawing.Point(872, 18);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(86, 31);
+            this.label4.Size = new System.Drawing.Size(72, 27);
             this.label4.TabIndex = 191;
             this.label4.Text = "已报废";
             // 
             // pictureBox1
             // 
             this.pictureBox1.BackColor = System.Drawing.Color.Red;
-            this.pictureBox1.Location = new System.Drawing.Point(507, 18);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
+            this.pictureBox1.Location = new System.Drawing.Point(451, 15);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox1.Size = new System.Drawing.Size(80, 25);
             this.pictureBox1.TabIndex = 186;
             this.pictureBox1.TabStop = false;
             // 
             // pictureBox3
             // 
             this.pictureBox3.BackColor = System.Drawing.Color.Black;
-            this.pictureBox3.Location = new System.Drawing.Point(872, 18);
-            this.pictureBox3.Margin = new System.Windows.Forms.Padding(4);
+            this.pictureBox3.Location = new System.Drawing.Point(775, 15);
+            this.pictureBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox3.Name = "pictureBox3";
-            this.pictureBox3.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox3.Size = new System.Drawing.Size(80, 25);
             this.pictureBox3.TabIndex = 190;
             this.pictureBox3.TabStop = false;
             // 
@@ -255,10 +259,10 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(256, 21);
+            this.label2.Location = new System.Drawing.Point(228, 18);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(182, 31);
+            this.label2.Size = new System.Drawing.Size(152, 27);
             this.label2.TabIndex = 188;
             this.label2.Text = "已执行且为良品";
             // 
@@ -266,10 +270,10 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(615, 21);
+            this.label3.Location = new System.Drawing.Point(548, 18);
             this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(206, 31);
+            this.label3.Size = new System.Drawing.Size(172, 27);
             this.label3.TabIndex = 189;
             this.label3.Text = "已执行且为不良品";
             // 
@@ -278,11 +282,11 @@
             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(138, 20);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.sn_code.Location = new System.Drawing.Point(123, 17);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(216, 28);
+            this.sn_code.Size = new System.Drawing.Size(192, 25);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
@@ -290,31 +294,54 @@
             this.sn_code.Tag = "NoAuto";
             this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
             // 
+            // ma_code_label
+            // 
+            this.ma_code_label.AutoSize = true;
+            this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code_label.Location = new System.Drawing.Point(343, 15);
+            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Name = "ma_code_label";
+            this.ma_code_label.Size = new System.Drawing.Size(72, 27);
+            this.ma_code_label.TabIndex = 195;
+            this.ma_code_label.Text = "工单号";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AutoSize = true;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.Location = new System.Drawing.Point(442, 16);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(0, 27);
+            this.ma_code.TabIndex = 196;
+            // 
             // Query_ExeProgress
             // 
-            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(1462, 867);
+            this.ClientSize = new System.Drawing.Size(1300, 722);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.ma_code_label);
             this.Controls.Add(this.SerialPanel);
             this.Controls.Add(this.CraftInfDgv);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.Name = "Query_ExeProgress";
             this.Tag = "Query!ExeProgress";
             this.Text = "工单执行进度";
             this.Load += new System.EventHandler(this.工单执行进度_Load);
             this.SizeChanged += new System.EventHandler(this.工单执行进度_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -342,5 +369,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn sc_linecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_inman;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_name;
+        private System.Windows.Forms.Label ma_code_label;
+        private System.Windows.Forms.Label ma_code;
     }
 }

+ 3 - 1
UAS-MES/FunctionCode/Query/Query_ExeProgress.cs

@@ -60,7 +60,7 @@ namespace UAS_MES.Query
         {
             if (e.KeyCode == Keys.Enter)
             {
-                ms_id = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode='" + sn_code.Text + "' or ms_beforesn='"+sn_code.Text+"' order by ms_id","select");
+                ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode from makeserial where ms_sncode='" + sn_code.Text + "' or ms_beforesn='"+sn_code.Text+"' order by ms_id","select");
                 if (ms_id.Rows.Count==0)
                 {
                     //无值则提示
@@ -68,6 +68,8 @@ namespace UAS_MES.Query
                     return;
                 }
                 StringBuilder ms_ids = new StringBuilder();//存所有的ms_id
+                //设置界面工单号
+                ma_code.Text = ms_id.Rows[ms_id.Rows.Count-1]["ms_makecode"].ToString();
                 int idCount = ms_id.Rows.Count;
                 for (int i=0;i<idCount;i++)
                 {

+ 27 - 0
UAS-MES/FunctionCode/Query/Query_ExeProgress.resx

@@ -144,4 +144,31 @@
   <metadata name="em_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mp_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mp_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ma_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mp_sourcecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mp_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ma_craftcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sc_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mp_inman.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="em_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 254 - 3
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.Designer.cs

@@ -28,21 +28,272 @@
         /// </summary>
         private void InitializeComponent()
         {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_OnlineTraceBack));
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ms_status_label = new System.Windows.Forms.Label();
+            this.SnInf = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.status = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_stepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_nextstepcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mp_inman = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_makecode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_status = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
+            this.Query = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ms_stepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_stepcode_label = new System.Windows.Forms.Label();
+            this.ms_nextstepcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_nextstepcode_label = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.SnInf)).BeginInit();
             this.SuspendLayout();
             // 
-            // 材料上线追溯
+            // ms_makecode_label
+            // 
+            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(4, 24);
+            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(72, 27);
+            this.ms_makecode_label.TabIndex = 198;
+            this.ms_makecode_label.Text = "工单号";
+            // 
+            // ms_status_label
+            // 
+            this.ms_status_label.AutoSize = true;
+            this.ms_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_status_label.Location = new System.Drawing.Point(275, 24);
+            this.ms_status_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_status_label.Name = "ms_status_label";
+            this.ms_status_label.Size = new System.Drawing.Size(80, 27);
+            this.ms_status_label.TabIndex = 197;
+            this.ms_status_label.Text = "SN状态";
+            // 
+            // SnInf
+            // 
+            this.SnInf.AllowUserToAddRows = false;
+            this.SnInf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.SnInf.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.SnInf.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.ms_sncode,
+            this.status,
+            this.ms_stepcode1,
+            this.ms_nextstepcode1,
+            this.Column5,
+            this.Column6,
+            this.Column7,
+            this.mp_inman});
+            this.SnInf.EnableContentClick = true;
+            this.SnInf.Location = new System.Drawing.Point(0, 70);
+            this.SnInf.Margin = new System.Windows.Forms.Padding(4);
+            this.SnInf.Name = "SnInf";
+            this.SnInf.RowTemplate.Height = 23;
+            this.SnInf.Size = new System.Drawing.Size(1261, 624);
+            this.SnInf.TabIndex = 203;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.DataPropertyName = "ms_sncode";
+            this.ms_sncode.HeaderText = "SN";
+            this.ms_sncode.Name = "ms_sncode";
+            // 
+            // status
+            // 
+            this.status.DataPropertyName = "ms_status";
+            this.status.HeaderText = "状态";
+            this.status.Name = "status";
+            this.status.ReadOnly = true;
+            // 
+            // ms_stepcode1
+            // 
+            this.ms_stepcode1.DataPropertyName = "ms_stepcode";
+            this.ms_stepcode1.HeaderText = "当前工序";
+            this.ms_stepcode1.Name = "ms_stepcode1";
+            this.ms_stepcode1.ReadOnly = true;
+            // 
+            // ms_nextstepcode1
+            // 
+            this.ms_nextstepcode1.DataPropertyName = "ms_nextstepcode";
+            this.ms_nextstepcode1.HeaderText = "下一工序";
+            this.ms_nextstepcode1.Name = "ms_nextstepcode1";
+            this.ms_nextstepcode1.ReadOnly = true;
+            // 
+            // Column5
+            // 
+            this.Column5.DataPropertyName = "ms_craftcode";
+            this.Column5.HeaderText = "当前途程";
+            this.Column5.Name = "Column5";
+            this.Column5.ReadOnly = true;
+            // 
+            // Column6
+            // 
+            this.Column6.DataPropertyName = "mp_indate";
+            this.Column6.HeaderText = "最近采集时间";
+            this.Column6.Name = "Column6";
+            this.Column6.ReadOnly = true;
+            this.Column6.Width = 150;
+            // 
+            // Column7
+            // 
+            this.Column7.DataPropertyName = "mp_sourcecode";
+            this.Column7.HeaderText = "最近采集资源";
+            this.Column7.Name = "Column7";
+            this.Column7.ReadOnly = true;
+            this.Column7.Width = 150;
+            // 
+            // mp_inman
+            // 
+            this.mp_inman.DataPropertyName = "mp_inman";
+            this.mp_inman.HeaderText = "最近采集人员";
+            this.mp_inman.Name = "mp_inman";
+            this.mp_inman.Width = 150;
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AllPower = null;
+            this.ms_makecode.BackColor = System.Drawing.Color.White;
+            this.ms_makecode.ID = null;
+            this.ms_makecode.Location = new System.Drawing.Point(83, 25);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Power = null;
+            this.ms_makecode.Size = new System.Drawing.Size(167, 25);
+            this.ms_makecode.Str = null;
+            this.ms_makecode.Str1 = null;
+            this.ms_makecode.Str2 = null;
+            this.ms_makecode.TabIndex = 204;
+            this.ms_makecode.Tag = "ms_makecode";
+            this.ms_makecode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ma_code_KeyDown);
+            // 
+            // ms_status
+            // 
+            this.ms_status.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.ms_status.FormattingEnabled = true;
+            this.ms_status.Location = new System.Drawing.Point(362, 25);
+            this.ms_status.Name = "ms_status";
+            this.ms_status.Size = new System.Drawing.Size(167, 23);
+            this.ms_status.TabIndex = 205;
+            this.ms_status.Tag = "ms_status";
+            // 
+            // Query
+            // 
+            this.Query.AllPower = null;
+            this.Query.BackColor = System.Drawing.Color.Transparent;
+            this.Query.DownImage = ((System.Drawing.Image)(resources.GetObject("Query.DownImage")));
+            this.Query.Image = null;
+            this.Query.IsShowBorder = true;
+            this.Query.Location = new System.Drawing.Point(1174, 20);
+            this.Query.MoveImage = ((System.Drawing.Image)(resources.GetObject("Query.MoveImage")));
+            this.Query.Name = "Query";
+            this.Query.NormalImage = ((System.Drawing.Image)(resources.GetObject("Query.NormalImage")));
+            this.Query.Power = null;
+            this.Query.Size = new System.Drawing.Size(75, 28);
+            this.Query.TabIndex = 206;
+            this.Query.Text = "查询";
+            this.Query.UseVisualStyleBackColor = false;
+            this.Query.Click += new System.EventHandler(this.Query_Click);
+            // 
+            // ms_stepcode
+            // 
+            this.ms_stepcode.AllPower = null;
+            this.ms_stepcode.BackColor = System.Drawing.Color.White;
+            this.ms_stepcode.ID = null;
+            this.ms_stepcode.Location = new System.Drawing.Point(658, 22);
+            this.ms_stepcode.Name = "ms_stepcode";
+            this.ms_stepcode.Power = null;
+            this.ms_stepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_stepcode.Str = null;
+            this.ms_stepcode.Str1 = null;
+            this.ms_stepcode.Str2 = null;
+            this.ms_stepcode.TabIndex = 208;
+            this.ms_stepcode.Tag = "ms_stepcode";
+            // 
+            // ms_stepcode_label
+            // 
+            this.ms_stepcode_label.AutoSize = true;
+            this.ms_stepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_stepcode_label.Location = new System.Drawing.Point(559, 21);
+            this.ms_stepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_stepcode_label.Name = "ms_stepcode_label";
+            this.ms_stepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_stepcode_label.TabIndex = 207;
+            this.ms_stepcode_label.Text = "当前工序";
+            // 
+            // ms_nextstepcode
+            // 
+            this.ms_nextstepcode.AllPower = null;
+            this.ms_nextstepcode.BackColor = System.Drawing.Color.White;
+            this.ms_nextstepcode.ID = null;
+            this.ms_nextstepcode.Location = new System.Drawing.Point(953, 20);
+            this.ms_nextstepcode.Name = "ms_nextstepcode";
+            this.ms_nextstepcode.Power = null;
+            this.ms_nextstepcode.Size = new System.Drawing.Size(167, 25);
+            this.ms_nextstepcode.Str = null;
+            this.ms_nextstepcode.Str1 = null;
+            this.ms_nextstepcode.Str2 = null;
+            this.ms_nextstepcode.TabIndex = 210;
+            this.ms_nextstepcode.Tag = "ms_nextstepcode";
+            // 
+            // ms_nextstepcode_label
+            // 
+            this.ms_nextstepcode_label.AutoSize = true;
+            this.ms_nextstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_nextstepcode_label.Location = new System.Drawing.Point(854, 20);
+            this.ms_nextstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_nextstepcode_label.Name = "ms_nextstepcode_label";
+            this.ms_nextstepcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_nextstepcode_label.TabIndex = 209;
+            this.ms_nextstepcode_label.Text = "下一工序";
+            // 
+            // Query_OnlineTraceBack
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1344, 692);
+            this.ClientSize = new System.Drawing.Size(1261, 694);
+            this.Controls.Add(this.ms_nextstepcode);
+            this.Controls.Add(this.ms_nextstepcode_label);
+            this.Controls.Add(this.ms_stepcode);
+            this.Controls.Add(this.ms_stepcode_label);
+            this.Controls.Add(this.Query);
+            this.Controls.Add(this.ms_status);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.SnInf);
+            this.Controls.Add(this.ms_makecode_label);
+            this.Controls.Add(this.ms_status_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "材料上线追溯";
+            this.Name = "Query_OnlineTraceBack";
             this.Tag = "Query!OnlineTraceBack";
             this.Text = " ";
+            this.Load += new System.EventHandler(this.Query_OnlineTraceBack_Load);
+            this.SizeChanged += new System.EventHandler(this.Query_OnlineTraceBack_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.SnInf)).EndInit();
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
+        private System.Windows.Forms.Label ms_makecode_label;
+        private System.Windows.Forms.Label ms_status_label;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum SnInf;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ms_makecode;
+        private CustomControl.ComBoxWithFocus.ComBoxWithFocus ms_status;
+        private CustomControl.ButtonUtil.NormalButton Query;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ms_stepcode;
+        private System.Windows.Forms.Label ms_stepcode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ms_nextstepcode;
+        private System.Windows.Forms.Label ms_nextstepcode_label;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_sncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn status;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_stepcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_nextstepcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mp_inman;
     }
 }

+ 77 - 0
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.cs

@@ -6,14 +6,91 @@ using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Query
 {
     public partial class Query_OnlineTraceBack : Form
     {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataTable ComBoxData = new DataTable();
+
         public Query_OnlineTraceBack()
         {
             InitializeComponent();
         }
+
+        private void Query_OnlineTraceBack_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            dh = new DataHelper();
+            DataColumn status = new DataColumn("status");
+            DataColumn statuscode = new DataColumn("statuscode");
+            ComBoxData.Columns.Add(status);
+            ComBoxData.Columns.Add(statuscode);
+            DataRow dr = ComBoxData.NewRow();
+            dr[0] = "未上线"; dr[1] = "0"; ComBoxData.Rows.Add(dr);
+            dr = ComBoxData.NewRow();
+            dr[0] = "在线"; dr[1] = "1"; ComBoxData.Rows.Add(dr);
+            dr = ComBoxData.NewRow();
+            dr[0] = "已完工"; dr[1] = "2"; ComBoxData.Rows.Add(dr);
+            dr = ComBoxData.NewRow();
+            dr[0] = "不良待维修"; dr[1] = "3"; ComBoxData.Rows.Add(dr);
+            dr = ComBoxData.NewRow();
+            dr[0] = "已报废"; dr[1] = "4"; ComBoxData.Rows.Add(dr);
+            ms_status.DataSource = ComBoxData;
+            ms_status.DisplayMember = "status";
+            ms_status.ValueMember = "statuscode";
+        }
+
+        private void ma_code_KeyDown(object sender, KeyEventArgs e)
+        {
+
+        }
+
+        private void Query_OnlineTraceBack_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Query_Click(object sender, EventArgs e)
+        {
+            if (dh.CheckExist("make", "ma_code='" + ms_makecode.Text + "'"))
+            {
+                string statuscode = ms_status.SelectedValue.ToString();
+                if (statuscode == "1" || statuscode == "2" || statuscode == "3" || statuscode == "4")
+                {
+                    string condition = BaseUtil.GetScreenSqlCondition(ms_makecode, ms_status, ms_stepcode, ms_nextstepcode);
+                    sql.Clear();
+                    sql.Append("select ms_sncode,ms_stepcode,ms_nextstepcode,case when ms_status=1 then '在线' when ms_status=2 then ");
+                    sql.Append("'已完工' when ms_status=3 then '不良待维修' when ms_status=4 then '已报废' end ms_status,ms_craftcode");
+                    sql.Append(",mp_indate,mp_inman,mp_sourcecode from makeserial left join makeprocess on mp_makecode=ms_makecode ");
+                    sql.Append("and mp_sncode=ms_sncode  and mp_stepcode=ms_stepcode " + condition + " order by ms_id ");
+                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    BaseUtil.FillDgvWithDataTable(SnInf, dt);
+                }
+                else
+                {
+                    sql.Clear();
+                    sql.Append("select DISTINCT msd_sncode ms_sncode ,msd_makecode ms_makecode,'未上线' ms_status from makesnruledetail ");
+                    sql.Append("left join makeserial on ms_makecode='" + ms_makecode.Text + "' and  msd_sncode not in (select ms_sncode from  ");
+                    sql.Append("makeserial where ms_makecode='" + ms_makecode.Text + "') where msd_type='before' and msd_makecode='" + ms_makecode.Text + "' and ms_sncode is not null");
+                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    BaseUtil.FillDgvWithDataTable(SnInf, dt);
+                }
+            }
+            else
+            {
+                MessageBox.Show("工单号" + ms_makecode.Text + "不存在");
+                BaseUtil.CleanDataGridView(SnInf);
+                ms_makecode.Clear();
+            }
+        }
     }
 }

+ 63 - 0
UAS-MES/FunctionCode/Query/Query_OnlineTraceBack.resx

@@ -117,4 +117,67 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_stepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_nextstepcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mp_inman.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Query.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Query.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Query.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
 </root>