shim hace 8 años
padre
commit
a7e083d7eb

+ 8 - 6
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs

@@ -78,10 +78,11 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_code.Location = new System.Drawing.Point(160, 74);
+            this.pr_code.Location = new System.Drawing.Point(145, 74);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 215;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // label2
             // 
@@ -97,7 +98,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(160, 128);
+            this.pr_detail.Location = new System.Drawing.Point(145, 128);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 217;
@@ -117,8 +118,8 @@
             // 
             this.pr_spec.AutoSize = true;
             this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_spec.Location = new System.Drawing.Point(160, 182);
-            this.pr_spec.MaximumSize = new System.Drawing.Size(600, 40);
+            this.pr_spec.Location = new System.Drawing.Point(145, 182);
+            this.pr_spec.MaximumSize = new System.Drawing.Size(550, 60);
             this.pr_spec.Name = "pr_spec";
             this.pr_spec.Size = new System.Drawing.Size(0, 31);
             this.pr_spec.TabIndex = 219;
@@ -414,7 +415,7 @@
             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(166, 18);
+            this.ma_code.Location = new System.Drawing.Point(151, 18);
             this.ma_code.Margin = new System.Windows.Forms.Padding(4);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = "";
@@ -425,8 +426,9 @@
             this.ma_code.TabIndex = 213;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "makecode";
-            this.ma_code.TextBoxEnable = false;
+            this.ma_code.TextBoxEnable = true;
             this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
+            this.ma_code.TextKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextKeyDown(this.ma_code_KeyDown);
             // 
             // Packing_ProdWeightSet
             // 

+ 37 - 11
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -255,17 +255,6 @@ namespace UAS_MES.Packing
 
         private void ma_code_UserControlTextChanged(object sender, EventArgs e)
         {
-            //查询重量设置采样个数
-            try
-            {
-                samplesCount = int.Parse(dh.GetConfig("prodWeightSetting", "MESSetting").ToString());
-            }
-            catch (Exception ess)
-            {
-                //如果没维护的话默认是10
-                samplesCount = 10;
-            }
-            OperateResult.AppendText("<<重量设置需采样个数为" + samplesCount + "\n", Color.Black);
             //清空称量记录
             showResult.Items.Clear();
             indates.Clear();
@@ -345,5 +334,42 @@ namespace UAS_MES.Packing
             recordSW = standardWeight.Text;
             recordEV = errorValue.Text;
         }
+
+        private void ma_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode==Keys.Enter)
+            {
+                //赋值
+                sql.Clear();
+                sql.Append("select ma_code,pr_code,pr_detail,pr_spec,ma_qty from make left join product on ma_prodcode=pr_code ");
+                sql.Append("where ma_code='" + ma_code.Text + "'");
+                Dbfind = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (Dbfind.Rows.Count==0)
+                {
+                    return;
+                }
+                BaseUtil.SetFormValue(this.Controls, Dbfind);
+            }
+        }
+
+        private void pr_code_TextChanged(object sender, EventArgs e)
+        {
+            //查询重量设置采样个数
+            try
+            {
+                samplesCount = int.Parse(dh.GetConfig("prodWeightSetting", "MESSetting").ToString());
+            }
+            catch (Exception ess)
+            {
+                //如果没维护的话默认是10
+                samplesCount = 10;
+            }
+            OperateResult.AppendText("<<重量设置需采样个数为" + samplesCount + "\n", Color.Black);
+            //清空称量记录
+            showResult.Items.Clear();
+            indates.Clear();
+            sncodes.Clear();
+            weights.Clear();
+        }
     }
 }