Эх сурвалжийг харах

添加不良代码组搜索

章政 8 жил өмнө
parent
commit
02bec2782b

+ 73 - 42
UAS-MES/FunctionCode/Make/Make_NewBadCode.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewBadCode));
             this.ChoosedRejectList = new System.Windows.Forms.ListView();
             this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@@ -56,7 +57,10 @@
             this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
+            this.Filter = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
+            this.BadInfo = new System.Windows.Forms.BindingSource(this.components);
             this.groupBoxWithBorder1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.BadInfo)).BeginInit();
             this.SuspendLayout();
             // 
             // ChoosedRejectList
@@ -68,9 +72,10 @@
             this.bg_name,
             this.bc_code,
             this.bc_name});
-            this.ChoosedRejectList.Location = new System.Drawing.Point(314, 195);
+            this.ChoosedRejectList.Location = new System.Drawing.Point(419, 244);
+            this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.ChoosedRejectList.Name = "ChoosedRejectList";
-            this.ChoosedRejectList.Size = new System.Drawing.Size(226, 242);
+            this.ChoosedRejectList.Size = new System.Drawing.Size(300, 302);
             this.ChoosedRejectList.TabIndex = 54;
             this.ChoosedRejectList.UseCompatibleStateImageBehavior = false;
             this.ChoosedRejectList.View = System.Windows.Forms.View.Details;
@@ -110,9 +115,10 @@
             this.bg_name1,
             this.bc_code1,
             this.bc_name1});
-            this.WaitRejectList.Location = new System.Drawing.Point(14, 194);
+            this.WaitRejectList.Location = new System.Drawing.Point(19, 242);
+            this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.WaitRejectList.Name = "WaitRejectList";
-            this.WaitRejectList.Size = new System.Drawing.Size(226, 244);
+            this.WaitRejectList.Size = new System.Drawing.Size(300, 304);
             this.WaitRejectList.TabIndex = 51;
             this.WaitRejectList.UseCompatibleStateImageBehavior = false;
             this.WaitRejectList.View = System.Windows.Forms.View.Details;
@@ -147,9 +153,10 @@
             // 
             this.bg_name_label.AutoSize = true;
             this.bg_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bg_name_label.Location = new System.Drawing.Point(10, 133);
+            this.bg_name_label.Location = new System.Drawing.Point(13, 166);
+            this.bg_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bg_name_label.Name = "bg_name_label";
-            this.bg_name_label.Size = new System.Drawing.Size(90, 21);
+            this.bg_name_label.Size = new System.Drawing.Size(112, 27);
             this.bg_name_label.TabIndex = 92;
             this.bg_name_label.Text = "不良代码组";
             // 
@@ -157,9 +164,10 @@
             // 
             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(10, 170);
+            this.label1.Location = new System.Drawing.Point(14, 206);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 96;
             this.label1.Text = "待选不良";
             // 
@@ -167,9 +175,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(309, 170);
+            this.label2.Location = new System.Drawing.Point(414, 207);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 97;
             this.label2.Text = "已选不良";
             // 
@@ -179,9 +188,10 @@
             this.label3.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label3.Location = new System.Drawing.Point(6, 5);
+            this.label3.Location = new System.Drawing.Point(8, 6);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(106, 21);
+            this.label3.Size = new System.Drawing.Size(132, 27);
             this.label3.TabIndex = 99;
             this.label3.Text = "新增不良代码";
             // 
@@ -190,9 +200,9 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.headBar1.Margin = new System.Windows.Forms.Padding(5);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(548, 32);
+            this.headBar1.Size = new System.Drawing.Size(731, 40);
             this.headBar1.TabIndex = 98;
             this.headBar1.Title = null;
             this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
@@ -200,10 +210,10 @@
             // badgroup
             // 
             this.badgroup.FormattingEnabled = true;
-            this.badgroup.Location = new System.Drawing.Point(123, 134);
-            this.badgroup.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.badgroup.Location = new System.Drawing.Point(164, 168);
+            this.badgroup.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.badgroup.Name = "badgroup";
-            this.badgroup.Size = new System.Drawing.Size(153, 20);
+            this.badgroup.Size = new System.Drawing.Size(203, 23);
             this.badgroup.TabIndex = 95;
             this.badgroup.SelectedIndexChanged += new System.EventHandler(this.badgroup_SelectedIndexChanged);
             // 
@@ -216,11 +226,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode);
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode_label);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 35);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 44);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(548, 80);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(731, 100);
             this.groupBoxWithBorder1.TabIndex = 94;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "产品信息";
@@ -236,10 +246,11 @@
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ms_makecode.ForeColor = System.Drawing.Color.Black;
             this.ms_makecode.ID = null;
-            this.ms_makecode.Location = new System.Drawing.Point(313, 35);
+            this.ms_makecode.Location = new System.Drawing.Point(416, 41);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Power = null;
-            this.ms_makecode.Size = new System.Drawing.Size(141, 23);
+            this.ms_makecode.Size = new System.Drawing.Size(187, 27);
             this.ms_makecode.Str = null;
             this.ms_makecode.Str1 = null;
             this.ms_makecode.Str2 = null;
@@ -250,9 +261,10 @@
             // 
             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(240, 35);
+            this.ms_makecode_label.Location = new System.Drawing.Point(319, 41);
+            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(58, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_makecode_label.TabIndex = 97;
             this.ms_makecode_label.Text = "工单号";
             // 
@@ -266,10 +278,11 @@
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ms_sncode.ForeColor = System.Drawing.Color.Black;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(82, 35);
+            this.ms_sncode.Location = new System.Drawing.Point(108, 41);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(141, 23);
+            this.ms_sncode.Size = new System.Drawing.Size(187, 27);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
@@ -280,9 +293,10 @@
             // 
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(10, 35);
+            this.ms_sncode_label.Location = new System.Drawing.Point(12, 41);
+            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_sncode_label.TabIndex = 95;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -293,13 +307,13 @@
             this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
             this.Cancel.Image = null;
             this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(289, 449);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Cancel.Location = new System.Drawing.Point(385, 561);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
             this.Cancel.Name = "Cancel";
             this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
             this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(60, 28);
+            this.Cancel.Size = new System.Drawing.Size(80, 35);
             this.Cancel.TabIndex = 56;
             this.Cancel.Text = "取消";
             this.Cancel.UseVisualStyleBackColor = false;
@@ -312,13 +326,13 @@
             this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
             this.Save.Image = null;
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(200, 449);
-            this.Save.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Save.Location = new System.Drawing.Point(267, 561);
+            this.Save.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = null;
-            this.Save.Size = new System.Drawing.Size(60, 28);
+            this.Save.Size = new System.Drawing.Size(80, 35);
             this.Save.TabIndex = 55;
             this.Save.Text = "保存";
             this.Save.UseVisualStyleBackColor = false;
@@ -327,9 +341,10 @@
             // ChooseedReject
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(252, 278);
+            this.ChooseedReject.Location = new System.Drawing.Point(336, 348);
+            this.ChooseedReject.Margin = new System.Windows.Forms.Padding(4);
             this.ChooseedReject.Name = "ChooseedReject";
-            this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
+            this.ChooseedReject.Size = new System.Drawing.Size(67, 29);
             this.ChooseedReject.TabIndex = 53;
             this.ChooseedReject.UseVisualStyleBackColor = true;
             this.ChooseedReject.Click += new System.EventHandler(this.ChooseedReject_Click);
@@ -337,19 +352,32 @@
             // WaitReject
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(252, 336);
+            this.WaitReject.Location = new System.Drawing.Point(336, 420);
+            this.WaitReject.Margin = new System.Windows.Forms.Padding(4);
             this.WaitReject.Name = "WaitReject";
-            this.WaitReject.Size = new System.Drawing.Size(50, 23);
+            this.WaitReject.Size = new System.Drawing.Size(67, 29);
             this.WaitReject.TabIndex = 52;
             this.WaitReject.UseVisualStyleBackColor = true;
             this.WaitReject.Click += new System.EventHandler(this.WaitReject_Click);
             // 
+            // Filter
+            // 
+            this.Filter.BackColor = System.Drawing.Color.Transparent;
+            this.Filter.Font = new System.Drawing.Font("宋体", 10.8F);
+            this.Filter.Location = new System.Drawing.Point(164, 205);
+            this.Filter.Name = "Filter";
+            this.Filter.PlaceHolder = "不良名称搜索";
+            this.Filter.Size = new System.Drawing.Size(155, 28);
+            this.Filter.TabIndex = 100;
+            this.Filter.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder.OnTextChange(this.Filter_UserControlTextChanged);
+            // 
             // Make_NewBadCode
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.HighlightText;
-            this.ClientSize = new System.Drawing.Size(548, 486);
+            this.ClientSize = new System.Drawing.Size(731, 608);
+            this.Controls.Add(this.Filter);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.headBar1);
             this.Controls.Add(this.label2);
@@ -364,13 +392,14 @@
             this.Controls.Add(this.WaitReject);
             this.Controls.Add(this.WaitRejectList);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Make_NewBadCode";
             this.Tag = "ShowDialogWindow";
             this.Text = "新增不良代码";
             this.Load += new System.EventHandler(this.Make_NewBadCode_Load);
             this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.BadInfo)).EndInit();
             this.ResumeLayout(true);
             this.PerformLayout();
 
@@ -405,5 +434,7 @@
         private System.Windows.Forms.ColumnHeader bg_name1;
         private System.Windows.Forms.ColumnHeader bc_code1;
         private System.Windows.Forms.ColumnHeader bc_name;
+        private CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder Filter;
+        private System.Windows.Forms.BindingSource BadInfo;
     }
 }

+ 32 - 1
UAS-MES/FunctionCode/Make/Make_NewBadCode.cs

@@ -191,7 +191,7 @@ namespace UAS_MES.Make
                 }
             }
             sql.Clear();
-            sql.Append("insert when (not exists(select 1 from makebad where mb_sncode='" + sncode + "' and mb_makecode='"+macode+"' and  ");
+            sql.Append("insert when (not exists(select 1 from makebad where mb_sncode='" + sncode + "' and mb_makecode='" + macode + "' and  ");
             sql.Append("mb_status=0 and mb_badcode=:bc_code)) then into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,");
             sql.Append("mb_indate,mb_stepcode,mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_status)");
             sql.Append("select DISTINCT :id,ma_code,ms_code,ms_sncode,'" + User.UserCode + "',sysdate,'" + User.CurrentStepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
@@ -217,6 +217,7 @@ namespace UAS_MES.Make
             sql.Append("select bg_code,bg_name,bc_code,bc_name,bc_note from badgroupdetail left join badgroup on bgd_bgid=bg_id ");
             sql.Append("left join badcode on bgd_badcode=bc_code where bg_code='" + ((bg_id != "" && bg_id != "System.Data.DataRowView") ? bg_id.ToString() : "") + "' and bg_code is not null ");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            BadInfo.DataSource = dt;
             //往listview中添加数据
             WaitRejectList.Items.Clear();
             WaitRejectList.BeginUpdate();
@@ -237,5 +238,35 @@ namespace UAS_MES.Make
             ReleaseCapture();
             SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
         }
+
+        private void Filter_UserControlTextChanged(object sender, EventArgs e)
+        {
+            try
+            {
+                DataRow[] dr = (BadInfo.DataSource as DataTable).Select(" bc_name like '%" + Filter.Text + "%'");
+                DataTable dt = (BadInfo.DataSource as DataTable).Clone();
+                for (int i = 0; i < dr.Length; i++)
+                {
+                    dt.Rows.Add(dr[i].ItemArray);
+                }
+                WaitRejectList.Items.Clear();
+                WaitRejectList.BeginUpdate();
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    ListViewItem lvi = new ListViewItem();
+                    //第一列是勾选列,设置列头文本为空
+                    lvi.Text = "";
+
+                    for (int j = 0; j < dt.Columns.Count; j++)
+                        lvi.SubItems.Add(dt.Rows[i][j].ToString());
+                    WaitRejectList.Items.Add(lvi);
+                }
+                WaitRejectList.EndUpdate();
+            }
+            catch (Exception)
+            {
+
+            }
+        }
     }
 }

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_NewBadCode.resx

@@ -232,4 +232,7 @@
         fgAAAABJRU5ErkJggg==
 </value>
   </data>
+  <metadata name="BadInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>