Browse Source

优化线体过滤排位表

yhluo 1 week ago
parent
commit
e255732ca6

+ 149 - 120
UAS_MES_YTDZ/FunctionCode/Make/Make_HandFeedRegistration.Designer.cs

@@ -51,16 +51,6 @@
             this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
-            this.productName = new System.Windows.Forms.Label();
-            this.productCode = new System.Windows.Forms.Label();
-            this.workOrder = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.serialNumber = new System.Windows.Forms.Label();
             this.rn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.isHandReel = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -74,6 +64,18 @@
             this.psl_baseqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ReelRemark = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ReelNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.productName = new System.Windows.Forms.Label();
+            this.productCode = new System.Windows.Forms.Label();
+            this.workOrder = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.serialNumber = new System.Windows.Forms.Label();
+            this.lineVal = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
             this.containerBox.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
             this.executeBox.SuspendLayout();
@@ -124,6 +126,8 @@
             // 
             // executeBox
             // 
+            this.executeBox.Controls.Add(this.lineVal);
+            this.executeBox.Controls.Add(this.label5);
             this.executeBox.Controls.Add(this.handCount);
             this.executeBox.Controls.Add(this.submit);
             this.executeBox.Controls.Add(this.query);
@@ -174,7 +178,7 @@
             // 
             this.machineVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.machineVal.FormattingEnabled = true;
-            this.machineVal.Location = new System.Drawing.Point(492, 20);
+            this.machineVal.Location = new System.Drawing.Point(114, 86);
             this.machineVal.Name = "machineVal";
             this.machineVal.Size = new System.Drawing.Size(327, 32);
             this.machineVal.TabIndex = 3;
@@ -184,7 +188,7 @@
             // 
             this.machineLab.AutoSize = true;
             this.machineLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.machineLab.Location = new System.Drawing.Point(397, 20);
+            this.machineLab.Location = new System.Drawing.Point(19, 86);
             this.machineLab.Name = "machineLab";
             this.machineLab.Size = new System.Drawing.Size(101, 28);
             this.machineLab.TabIndex = 2;
@@ -325,6 +329,119 @@
             this.dataGridViewTextBoxColumn12.Visible = false;
             this.dataGridViewTextBoxColumn12.Width = 80;
             // 
+            // rn
+            // 
+            this.rn.DataPropertyName = "rn";
+            this.rn.HeaderText = "序号";
+            this.rn.MinimumWidth = 8;
+            this.rn.Name = "rn";
+            this.rn.Width = 50;
+            // 
+            // isHandReel
+            // 
+            this.isHandReel.HeaderText = "是否手补料";
+            this.isHandReel.MinimumWidth = 8;
+            this.isHandReel.Name = "isHandReel";
+            this.isHandReel.Width = 50;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.DataPropertyName = "ms_sncode";
+            this.ms_sncode.HeaderText = "序列号";
+            this.ms_sncode.MinimumWidth = 8;
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.ReadOnly = true;
+            this.ms_sncode.Width = 160;
+            // 
+            // ps_linecode
+            // 
+            this.ps_linecode.DataPropertyName = "ps_linecode";
+            this.ps_linecode.HeaderText = "线体";
+            this.ps_linecode.MinimumWidth = 8;
+            this.ps_linecode.Name = "ps_linecode";
+            this.ps_linecode.ReadOnly = true;
+            this.ps_linecode.Width = 150;
+            // 
+            // ps_processcode
+            // 
+            this.ps_processcode.DataPropertyName = "ps_processcode";
+            this.ps_processcode.HeaderText = "机台名称";
+            this.ps_processcode.MinimumWidth = 8;
+            this.ps_processcode.Name = "ps_processcode";
+            this.ps_processcode.ReadOnly = true;
+            this.ps_processcode.Visible = false;
+            this.ps_processcode.Width = 190;
+            // 
+            // ps_table
+            // 
+            this.ps_table.DataPropertyName = "ps_table";
+            this.ps_table.HeaderText = "面别";
+            this.ps_table.MinimumWidth = 8;
+            this.ps_table.Name = "ps_table";
+            this.ps_table.ReadOnly = true;
+            this.ps_table.Width = 50;
+            // 
+            // psl_location
+            // 
+            this.psl_location.DataPropertyName = "psl_location";
+            this.psl_location.HeaderText = "站位编号";
+            this.psl_location.MinimumWidth = 8;
+            this.psl_location.Name = "psl_location";
+            this.psl_location.ReadOnly = true;
+            this.psl_location.Width = 120;
+            // 
+            // psl_devlocation
+            // 
+            this.psl_devlocation.DataPropertyName = "psl_devlocation";
+            this.psl_devlocation.HeaderText = "元件位置";
+            this.psl_devlocation.MinimumWidth = 8;
+            this.psl_devlocation.Name = "psl_devlocation";
+            this.psl_devlocation.ReadOnly = true;
+            this.psl_devlocation.Width = 220;
+            // 
+            // psl_prodcode
+            // 
+            this.psl_prodcode.DataPropertyName = "psl_prodcode";
+            this.psl_prodcode.HeaderText = "物料编号";
+            this.psl_prodcode.MinimumWidth = 8;
+            this.psl_prodcode.Name = "psl_prodcode";
+            this.psl_prodcode.ReadOnly = true;
+            this.psl_prodcode.Width = 140;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "物料名称";
+            this.pr_detail.MinimumWidth = 8;
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Width = 150;
+            // 
+            // psl_baseqty
+            // 
+            this.psl_baseqty.DataPropertyName = "psl_baseqty";
+            this.psl_baseqty.HeaderText = "单位用量";
+            this.psl_baseqty.MinimumWidth = 8;
+            this.psl_baseqty.Name = "psl_baseqty";
+            this.psl_baseqty.ReadOnly = true;
+            this.psl_baseqty.Width = 60;
+            // 
+            // ReelRemark
+            // 
+            this.ReelRemark.DataPropertyName = "ReelRemark";
+            this.ReelRemark.HeaderText = "元件信息备注";
+            this.ReelRemark.MinimumWidth = 8;
+            this.ReelRemark.Name = "ReelRemark";
+            this.ReelRemark.Width = 150;
+            // 
+            // ReelNum
+            // 
+            this.ReelNum.DataPropertyName = "ReelNum";
+            this.ReelNum.HeaderText = "补料数量";
+            this.ReelNum.MinimumWidth = 8;
+            this.ReelNum.Name = "ReelNum";
+            this.ReelNum.Visible = false;
+            this.ReelNum.Width = 80;
+            // 
             // SNDetails
             // 
             this.SNDetails.BorderColor = System.Drawing.Color.Black;
@@ -451,117 +568,27 @@
             this.serialNumber.TabIndex = 4;
             this.serialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
-            // rn
-            // 
-            this.rn.DataPropertyName = "rn";
-            this.rn.HeaderText = "序号";
-            this.rn.MinimumWidth = 8;
-            this.rn.Name = "rn";
-            this.rn.Width = 50;
-            // 
-            // isHandReel
-            // 
-            this.isHandReel.HeaderText = "是否手补料";
-            this.isHandReel.MinimumWidth = 8;
-            this.isHandReel.Name = "isHandReel";
-            this.isHandReel.Width = 50;
-            // 
-            // ms_sncode
-            // 
-            this.ms_sncode.DataPropertyName = "ms_sncode";
-            this.ms_sncode.HeaderText = "序列号";
-            this.ms_sncode.MinimumWidth = 8;
-            this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.ReadOnly = true;
-            this.ms_sncode.Width = 160;
-            // 
-            // ps_linecode
-            // 
-            this.ps_linecode.DataPropertyName = "ps_linecode";
-            this.ps_linecode.HeaderText = "线体";
-            this.ps_linecode.MinimumWidth = 8;
-            this.ps_linecode.Name = "ps_linecode";
-            this.ps_linecode.ReadOnly = true;
-            // 
-            // ps_processcode
-            // 
-            this.ps_processcode.DataPropertyName = "ps_processcode";
-            this.ps_processcode.HeaderText = "机台名称";
-            this.ps_processcode.MinimumWidth = 8;
-            this.ps_processcode.Name = "ps_processcode";
-            this.ps_processcode.ReadOnly = true;
-            this.ps_processcode.Visible = false;
-            this.ps_processcode.Width = 190;
-            // 
-            // ps_table
-            // 
-            this.ps_table.DataPropertyName = "ps_table";
-            this.ps_table.HeaderText = "面别";
-            this.ps_table.MinimumWidth = 8;
-            this.ps_table.Name = "ps_table";
-            this.ps_table.ReadOnly = true;
-            this.ps_table.Width = 50;
-            // 
-            // psl_location
-            // 
-            this.psl_location.DataPropertyName = "psl_location";
-            this.psl_location.HeaderText = "站位编号";
-            this.psl_location.MinimumWidth = 8;
-            this.psl_location.Name = "psl_location";
-            this.psl_location.ReadOnly = true;
-            this.psl_location.Width = 120;
-            // 
-            // psl_devlocation
-            // 
-            this.psl_devlocation.DataPropertyName = "psl_devlocation";
-            this.psl_devlocation.HeaderText = "元件位置";
-            this.psl_devlocation.MinimumWidth = 8;
-            this.psl_devlocation.Name = "psl_devlocation";
-            this.psl_devlocation.ReadOnly = true;
-            this.psl_devlocation.Width = 220;
-            // 
-            // psl_prodcode
-            // 
-            this.psl_prodcode.DataPropertyName = "psl_prodcode";
-            this.psl_prodcode.HeaderText = "物料编号";
-            this.psl_prodcode.MinimumWidth = 8;
-            this.psl_prodcode.Name = "psl_prodcode";
-            this.psl_prodcode.ReadOnly = true;
-            this.psl_prodcode.Width = 140;
-            // 
-            // pr_detail
-            // 
-            this.pr_detail.DataPropertyName = "pr_detail";
-            this.pr_detail.HeaderText = "物料名称";
-            this.pr_detail.MinimumWidth = 8;
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Width = 150;
-            // 
-            // psl_baseqty
-            // 
-            this.psl_baseqty.DataPropertyName = "psl_baseqty";
-            this.psl_baseqty.HeaderText = "单位用量";
-            this.psl_baseqty.MinimumWidth = 8;
-            this.psl_baseqty.Name = "psl_baseqty";
-            this.psl_baseqty.ReadOnly = true;
-            this.psl_baseqty.Width = 60;
+            // lineVal
             // 
-            // ReelRemark
+            this.lineVal.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.lineVal.FormattingEnabled = true;
+            this.lineVal.Items.AddRange(new object[] {
+            "A",
+            "B"});
+            this.lineVal.Location = new System.Drawing.Point(464, 19);
+            this.lineVal.Name = "lineVal";
+            this.lineVal.Size = new System.Drawing.Size(146, 32);
+            this.lineVal.TabIndex = 16;
             // 
-            this.ReelRemark.DataPropertyName = "ReelRemark";
-            this.ReelRemark.HeaderText = "元件信息备注";
-            this.ReelRemark.MinimumWidth = 8;
-            this.ReelRemark.Name = "ReelRemark";
-            this.ReelRemark.Width = 150;
+            // label5
             // 
-            // ReelNum
-            // 
-            this.ReelNum.DataPropertyName = "ReelNum";
-            this.ReelNum.HeaderText = "补料数量";
-            this.ReelNum.MinimumWidth = 8;
-            this.ReelNum.Name = "ReelNum";
-            this.ReelNum.Visible = false;
-            this.ReelNum.Width = 80;
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(411, 18);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(57, 30);
+            this.label5.TabIndex = 15;
+            this.label5.Text = "线体";
             // 
             // Make_HandFeedRegistration
             // 
@@ -635,5 +662,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ReelRemark;
         private System.Windows.Forms.DataGridViewTextBoxColumn ReelNum;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
+        private System.Windows.Forms.ComboBox lineVal;
+        private System.Windows.Forms.Label label5;
     }
 }

+ 16 - 27
UAS_MES_YTDZ/FunctionCode/Make/Make_HandFeedRegistration.cs

@@ -46,23 +46,17 @@ namespace UAS_MES_NEW.Make
             snVal.Text = snVal.Text.Replace(";", ";").Trim();
 
             SQL.Clear();
-            //SQL.Append($@"SELECT * FROM (SELECT ms_makecode,ms_prodcode,ps_linecode,ps_processcode,
-            //    ps_table,ROW_NUMBER() OVER(PARTITION BY ps_processcode ORDER BY ps_auditdate DESC) AS rn
-            //    FROM makeserial a,productsmt b WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode
-            //    AND instr(ps_linecode, a.ms_linecode) > 0) WHERE rn = 1 ORDER BY ps_processcode");
-            SQL.Append($@"SELECT ps_processcode FROM makeserial a,productsmt b 
-                WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode");
-            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+
+
+            dt = (DataTable)dh.ExecuteSql($@"SELECT ms_sncode, ps_linecode FROM makeserial a,productsmt b WHERE 
+                a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode", "select");
             if (dt.Rows.Count > 0)
             {
-                machineVal.Items.Clear();
-                foreach (DataRow dr in dt.Rows)
-                {
-                    machineVal.Items.Add(dr["ps_processcode"].ToString());
-                }
+                lineVal.Items.Clear();
+                lineVal.Items.AddRange(dt.AsEnumerable().Select(r => r.Field<string>("ps_linecode")).ToArray());
 
-                machineVal.SelectedIndex = 0;
-                machineVal.SelectAll();
+                lineVal.SelectedIndex = 0;
+                lineVal.SelectAll();
 
                 UpdateSN("L", snVal.Text);
                 query_Click(null, null);
@@ -70,11 +64,11 @@ namespace UAS_MES_NEW.Make
             else
             {
                 UpdateSN("C");
-                machineVal.Items.Clear();
-                machineVal.SelectedIndex = -1;
+                lineVal.Items.Clear();
+                lineVal.SelectedIndex = -1;
                 snVal.Focus();
                 snVal.SelectAll();
-                MessageBox.Show("该序列号没有对应机台", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                MessageBox.Show("该序列号未找到生产线体信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
 
@@ -88,25 +82,20 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            /*if (string.IsNullOrEmpty(machineVal.Text))
+            if (string.IsNullOrEmpty(lineVal.Text))
             {
-                MessageBox.Show("请选择机台名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                machineVal.SelectAll();
+                MessageBox.Show("请选择生产线体", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                lineVal.SelectAll();
                 return;
-            }*/
+            }
 
             SQL.Clear();
-            /*SQL.Append($@"SELECT rownum rn,ms_sncode,ps_linecode,
-                ps_processcode,ps_table,psl_location,psl_bomlocation,psl_prodcode,psl_baseqty, '' ReelRemark, '' ReelNum
-                FROM makeserial a,productsmt b,productsmtlocation c
-                WHERE a.ms_sncode = '{snVal.Text}' AND b.ps_processcode = '{machineVal.Text}'
-                AND a.ms_prodcode = b.ps_prodcode AND b.ps_id = c.psl_psid ORDER BY psl_detno");*/
 
 
             SQL.Append($@"SELECT rownum rn,ms_sncode,ps_linecode,
                 ps_processcode,ps_table,psl_location,psl_devlocation,psl_prodcode,psl_baseqty, '' ReelRemark, '' ReelNum,pr_detail
                 FROM makeserial a,productsmt b,productsmtlocation c,product d
-                WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode AND b.ps_id = c.psl_psid AND c.psl_prodcode = d.pr_code ORDER BY psl_detno");
+                WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode AND b.ps_linecode = '{lineVal.Text}' AND b.ps_id = c.psl_psid AND c.psl_prodcode = d.pr_code ORDER BY psl_detno");
             dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
             if (dt.Rows.Count > 0)
             {

+ 39 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_HandFeedRegistration.resx

@@ -156,4 +156,43 @@
   <metadata name="ReelNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="rn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="isHandReel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_processcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_table.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_location.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_devlocation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_baseqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ReelRemark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ReelNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>