Browse Source

查询界面提交

callm 2 years ago
parent
commit
1be04004bb

+ 184 - 32
UAS_MES_ZT/FunctionCode/Query/Query_DateRate.Designer.cs

@@ -35,16 +35,29 @@
             this.label3 = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.wc_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.li_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sp_stepname = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.OKQTY = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.SNQTY = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.合计 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.报废 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.OKRATE = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.SuspendLayout();
             // 
             // BeginDate
             // 
             this.BeginDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
             this.BeginDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-            this.BeginDate.Location = new System.Drawing.Point(325, 216);
+            this.BeginDate.Location = new System.Drawing.Point(546, 87);
             this.BeginDate.Name = "BeginDate";
             this.BeginDate.Size = new System.Drawing.Size(353, 35);
             this.BeginDate.TabIndex = 13;
@@ -54,7 +67,7 @@
             // 
             this.EndDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
             this.EndDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-            this.EndDate.Location = new System.Drawing.Point(684, 216);
+            this.EndDate.Location = new System.Drawing.Point(905, 87);
             this.EndDate.Name = "EndDate";
             this.EndDate.Size = new System.Drawing.Size(353, 35);
             this.EndDate.TabIndex = 14;
@@ -63,7 +76,7 @@
             // 
             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(139, 211);
+            this.label3.Location = new System.Drawing.Point(443, 86);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(82, 41);
@@ -74,7 +87,7 @@
             // 
             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(140, 91);
+            this.ms_makecode_label.Location = new System.Drawing.Point(443, 14);
             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(146, 41);
@@ -85,33 +98,33 @@
             // 
             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(140, 151);
+            this.label1.Location = new System.Drawing.Point(15, 14);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.Size = new System.Drawing.Size(82, 41);
             this.label1.TabIndex = 214;
-            this.label1.Text = "工单编号";
+            this.label1.Text = "车间";
             // 
-            // ma_code
+            // wc_code
             // 
-            this.ma_code.AllPower = "IFALL";
-            this.ma_code.Caller = null;
-            this.ma_code.Condition = null;
-            this.ma_code.DBTitle = "";
-            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(325, 151);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Power = "";
-            this.ma_code.ReturnData = null;
-            this.ma_code.SelectField = null;
-            this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(282, 46);
-            this.ma_code.TabIndex = 215;
-            this.ma_code.TableName = null;
-            this.ma_code.Tag = "makecode";
-            this.ma_code.TextBoxEnable = true;
+            this.wc_code.AllPower = "IFALL";
+            this.wc_code.Caller = null;
+            this.wc_code.Condition = null;
+            this.wc_code.DBTitle = "";
+            this.wc_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.wc_code.FormName = null;
+            this.wc_code.Location = new System.Drawing.Point(142, 14);
+            this.wc_code.Margin = new System.Windows.Forms.Padding(6);
+            this.wc_code.Name = "wc_code";
+            this.wc_code.Power = "";
+            this.wc_code.ReturnData = null;
+            this.wc_code.SelectField = null;
+            this.wc_code.SetValueField = null;
+            this.wc_code.Size = new System.Drawing.Size(282, 46);
+            this.wc_code.TabIndex = 215;
+            this.wc_code.TableName = null;
+            this.wc_code.Tag = "makecode";
+            this.wc_code.TextBoxEnable = true;
             // 
             // pr_code
             // 
@@ -121,7 +134,7 @@
             this.pr_code.DBTitle = "";
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(325, 91);
+            this.pr_code.Location = new System.Drawing.Point(600, 15);
             this.pr_code.Margin = new System.Windows.Forms.Padding(6);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = "";
@@ -141,7 +154,7 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(325, 515);
+            this.Export.Location = new System.Drawing.Point(1307, 76);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -149,16 +162,142 @@
             this.Export.Power = null;
             this.Export.Size = new System.Drawing.Size(150, 56);
             this.Export.TabIndex = 0;
-            this.Export.Text = "导出";
+            this.Export.Text = "查询";
             this.Export.UseVisualStyleBackColor = false;
             this.Export.Click += new System.EventHandler(this.Export_Click);
             // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = "IFALL";
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = "";
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(1062, 16);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = "";
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(277, 46);
+            this.ma_code.TabIndex = 217;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "makecode";
+            this.ma_code.TextBoxEnable = true;
+            // 
+            // label2
+            // 
+            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(936, 15);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(114, 41);
+            this.label2.TabIndex = 216;
+            this.label2.Text = "工单号";
+            // 
+            // li_code
+            // 
+            this.li_code.AllPower = "IFALL";
+            this.li_code.Caller = null;
+            this.li_code.Condition = null;
+            this.li_code.DBTitle = "";
+            this.li_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.li_code.FormName = null;
+            this.li_code.Location = new System.Drawing.Point(142, 81);
+            this.li_code.Margin = new System.Windows.Forms.Padding(6);
+            this.li_code.Name = "li_code";
+            this.li_code.Power = "";
+            this.li_code.ReturnData = null;
+            this.li_code.SelectField = null;
+            this.li_code.SetValueField = null;
+            this.li_code.Size = new System.Drawing.Size(282, 46);
+            this.li_code.TabIndex = 219;
+            this.li_code.TableName = null;
+            this.li_code.Tag = "makecode";
+            this.li_code.TextBoxEnable = true;
+            // 
+            // label4
+            // 
+            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(16, 80);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(82, 41);
+            this.label4.TabIndex = 218;
+            this.label4.Text = "线别";
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.AllowUserToAddRows = false;
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.detno,
+            this.sp_stepname,
+            this.OKQTY,
+            this.SNQTY,
+            this.合计,
+            this.报废,
+            this.OKRATE});
+            this.dataGridView1.Location = new System.Drawing.Point(22, 146);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.RowTemplate.Height = 37;
+            this.dataGridView1.Size = new System.Drawing.Size(1435, 917);
+            this.dataGridView1.TabIndex = 220;
+            // 
+            // detno
+            // 
+            this.detno.DataPropertyName = "detno";
+            this.detno.HeaderText = "detno";
+            this.detno.Name = "detno";
+            // 
+            // sp_stepname
+            // 
+            this.sp_stepname.DataPropertyName = "sp_stepname";
+            this.sp_stepname.HeaderText = "工序";
+            this.sp_stepname.Name = "sp_stepname";
+            // 
+            // OKQTY
+            // 
+            this.OKQTY.HeaderText = "通过";
+            this.OKQTY.Name = "OKQTY";
+            // 
+            // SNQTY
+            // 
+            this.SNQTY.HeaderText = "不良";
+            this.SNQTY.Name = "SNQTY";
+            // 
+            // 合计
+            // 
+            this.合计.HeaderText = "合计";
+            this.合计.Name = "合计";
+            // 
+            // 报废
+            // 
+            this.报废.DataPropertyName = "报废";
+            this.报废.HeaderText = "报废";
+            this.报废.Name = "报废";
+            // 
+            // OKRATE
+            // 
+            this.OKRATE.DataPropertyName = "OKRATE";
+            this.OKRATE.HeaderText = "直通率";
+            this.OKRATE.Name = "OKRATE";
+            // 
             // Query_DateRate
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.ClientSize = new System.Drawing.Size(1480, 1075);
+            this.Controls.Add(this.dataGridView1);
+            this.Controls.Add(this.li_code);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.wc_code);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.ms_makecode_label);
@@ -172,6 +311,7 @@
             this.Tag = "Query!DateRate";
             this.Text = "Query_DateRate";
             this.Load += new System.EventHandler(this.Query_SpecialReport_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -186,7 +326,19 @@
         private System.Windows.Forms.Label label3;
         private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
         private System.Windows.Forms.Label ms_makecode_label;
-        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private CustomControl.TextBoxWithIcon.SearchTextBox wc_code;
         private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.TextBoxWithIcon.SearchTextBox li_code;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn detno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_stepname;
+        private System.Windows.Forms.DataGridViewTextBoxColumn OKQTY;
+        private System.Windows.Forms.DataGridViewTextBoxColumn SNQTY;
+        private System.Windows.Forms.DataGridViewTextBoxColumn 合计;
+        private System.Windows.Forms.DataGridViewTextBoxColumn 报废;
+        private System.Windows.Forms.DataGridViewTextBoxColumn OKRATE;
     }
 }

+ 41 - 40
UAS_MES_ZT/FunctionCode/Query/Query_DateRate.cs

@@ -27,46 +27,6 @@ namespace UAS_MES_NEW.Query
             InitializeComponent();
         }
 
-        private void Export_Click(object sender, EventArgs e)
-        {
-            if (pr_code.Text == "")
-            {
-                MessageBox.Show("请输入产品代码");
-                return;
-            }
-            if (EndDate.Value < BeginDate.Value)
-            {
-                MessageBox.Show("结束日期不能小于起始日期");
-            }
-            ExcelExport("");
-        }
-
-        //选择导出Excel时是选择导出数据的还是模板
-        private void ExcelExport(string DataOrTemplet)
-        {
-            folderBrowserDialog1.Description = "选择导出的路径";
-            DialogResult result = folderBrowserDialog1.ShowDialog();
-            if (result == DialogResult.OK)
-            {
-                string v_sql = "";
-                string v_sql1 = "";
-                string condition= "sp_date between to_date('" + BeginDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') and sp_prodcode = '" + pr_code.Text + "' ";
-
-                LogicHandler.GetQuerySql(condition,out v_sql,out v_sql1);
-         
-                DataTable dt = (DataTable)dh.ExecuteSql(v_sql+v_sql1, "select");
-                string FolderPath = folderBrowserDialog1.SelectedPath;
-                ExcelHandler eh = new ExcelHandler();
-
-                string begindate = BeginDate.Value.ToString("yyyy-mm-dd");
-                string enddate = EndDate.Value.ToString("yyyy-mm-dd");
-                string path = eh.ExportExcel_BAIDU(dt, BeginDate.Value, (EndDate.Value - BeginDate.Value).Days + 1, FolderPath);
-                string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                if (close.ToString() == "Yes")
-                    System.Diagnostics.Process.Start(path);
-            }
-        }
-
         private void Query_SpecialReport_Load(object sender, EventArgs e)
         {
             //工单号放大镜配置
@@ -77,6 +37,20 @@ namespace UAS_MES_NEW.Query
             pr_code.Condition = "pr_statuscode='AUDITED'";
             pr_code.DbChange += pr_code_DbChange;
 
+            wc_code.TableName = " workcenter ";
+            wc_code.SelectField = "wc_code # 车间编号,wc_name # 车间名称";
+            wc_code.FormName = Name;
+            wc_code.SetValueField = new string[] { "wc_code" };
+            wc_code.Condition = "wc_statuscode='STARTED'";
+            wc_code.DbChange += pr_code_DbChange;
+
+            li_code.TableName = " line ";
+            li_code.SelectField = "li_code # 车间编号,li_name # 车间名称";
+            li_code.FormName = Name;
+            li_code.SetValueField = new string[] { "li_code" };
+            li_code.Condition = "li_statuscode='STARTED'";
+            li_code.DbChange += pr_code_DbChange;
+
             ma_code.TableName = " make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单编号,ma_prodcode # 产品编号,pr_spec # 型号";
             ma_code.FormName = Name;
@@ -85,6 +59,33 @@ namespace UAS_MES_NEW.Query
             ma_code.DbChange += pr_code_DbChange;
         }
 
+        private void Export_Click(object sender, EventArgs e)
+        {
+            if (wc_code.Text == "")
+            {
+                MessageBox.Show("请输入车间");
+                return;
+            }
+            if (EndDate.Value < BeginDate.Value)
+            {
+                MessageBox.Show("结束日期不能小于起始日期");
+            }
+
+            string condition = "sp_date between to_date('" + BeginDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss') ";
+            if (pr_code.Text != "")
+            {
+                condition += " and sp_prodcode = '" + pr_code.Text + "'";
+            }
+            if (ma_code.Text != "")
+            {
+                condition += " and sp_makecode = '" + ma_code.Text + "'";
+            }
+            if (li_code.Text != "")
+            {
+                condition += " and sp_linecode = '" + li_code.Text + "'";
+            }
+        }
+
         private void pr_code_DbChange(object sender, EventArgs e)
         {
             Dbfind = pr_code.ReturnData;

+ 21 - 0
UAS_MES_ZT/FunctionCode/Query/Query_DateRate.resx

@@ -159,4 +159,25 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
+  <metadata name="detno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sp_stepname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="OKQTY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="SNQTY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="合计.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="报废.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="OKRATE.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>