Przeglądaj źródła

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 lat temu
rodzic
commit
eb313625fb

+ 11 - 9
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs

@@ -73,7 +73,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_code.Location = new System.Drawing.Point(158, 121);
+            this.pr_code.Location = new System.Drawing.Point(160, 121);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 215;
@@ -111,7 +111,8 @@
             // 
             this.pr_spec.AutoSize = true;
             this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_spec.Location = new System.Drawing.Point(115, 218);
+            this.pr_spec.Location = new System.Drawing.Point(160, 228);
+            this.pr_spec.MaximumSize = new System.Drawing.Size(600, 40);
             this.pr_spec.Name = "pr_spec";
             this.pr_spec.Size = new System.Drawing.Size(0, 31);
             this.pr_spec.TabIndex = 219;
@@ -120,7 +121,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(33, 218);
+            this.label5.Location = new System.Drawing.Point(33, 228);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
             this.label5.TabIndex = 218;
@@ -170,7 +171,7 @@
             // 
             this.columnHeader5.Text = "时间";
             this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader5.Width = 160;
+            this.columnHeader5.Width = 170;
             // 
             // panel4
             // 
@@ -241,7 +242,7 @@
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(127, 72);
+            this.sncode.Location = new System.Drawing.Point(166, 72);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
             this.sncode.Size = new System.Drawing.Size(187, 31);
@@ -316,7 +317,7 @@
             this.stopWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("stopWeigh.DownImage")));
             this.stopWeigh.Image = null;
             this.stopWeigh.IsShowBorder = true;
-            this.stopWeigh.Location = new System.Drawing.Point(816, 194);
+            this.stopWeigh.Location = new System.Drawing.Point(811, 194);
             this.stopWeigh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.stopWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("stopWeigh.MoveImage")));
             this.stopWeigh.Name = "stopWeigh";
@@ -335,7 +336,7 @@
             this.startWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("startWeigh.DownImage")));
             this.startWeigh.Image = null;
             this.startWeigh.IsShowBorder = true;
-            this.startWeigh.Location = new System.Drawing.Point(662, 194);
+            this.startWeigh.Location = new System.Drawing.Point(657, 194);
             this.startWeigh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.startWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("startWeigh.MoveImage")));
             this.startWeigh.Name = "startWeigh";
@@ -355,7 +356,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(127, 18);
+            this.ma_code.Location = new System.Drawing.Point(166, 18);
             this.ma_code.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = "";
@@ -366,7 +367,8 @@
             this.ma_code.TabIndex = 213;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "makecode";
-            this.ma_code.TextBoxEnable = true;
+            this.ma_code.TextBoxEnable = false;
+            this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
             // Packing_ProdWeightSet
             // 

+ 22 - 18
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -52,7 +52,7 @@ namespace UAS_MES.Packing
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称,pr_spec # 规格,ma_qty # 工单数量";
             ma_code.FormName = Name;
-            ma_code.SetValueField = new string[] { "ma_code,pr_code,pr_detail,pr_spec" };
+            ma_code.SetValueField = new string[] { "ma_code","pr_code","pr_detail","pr_spec" };
             ma_code.DbChange += Ma_code_DbChange;
 
             dh = new DataHelper();
@@ -63,19 +63,6 @@ namespace UAS_MES.Packing
         {
             Dbfind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, Dbfind);
-            //查询重量设置采样个数
-            try
-            {
-                samplesCount = int.Parse(dh.GetConfig("重量设置采样个数", "MESSetting").ToString());
-            }
-            catch (Exception ess)
-            {
-                //如果没维护的话默认是10
-                samplesCount = 10;
-            }
-            OperateResult.AppendText("<<重量设置需采样个数为"+samplesCount+"\n", Color.Black);
-            //清空称量记录
-            showResult.Items.Clear();
         }
         private void recordResult(int index,string palletcode, string weigh, string time)
         {
@@ -84,7 +71,7 @@ namespace UAS_MES.Packing
             //分条赋值
             lvi.SubItems.Add(index+"");
             lvi.SubItems.Add(palletcode);
-            lvi.SubItems.Add(weigh);
+            lvi.SubItems.Add(weigh+pr_cartonunit.Text);
             lvi.SubItems.Add(time);
             //添加结果的信息进去
             showResult.Items.Add(lvi);
@@ -171,8 +158,8 @@ namespace UAS_MES.Packing
                 return;
             }
             //更新彩盒重量最大值最小值
-            dh.ExecuteSql("update product set PR_COLORBOXMAXW ='"+maxValue+"', PR_COLORBOXMINW = '"+minValue+"' where pr_code='"+pr_code.Text+"'", "update");
-            OperateResult.AppendText("<<重量设置成功,最大值"+maxValue+"最小值"+minValue+"\n", Color.Green);
+            dh.ExecuteSql("update product set PR_COLORBOXMAXW ='"+maxValue+"', PR_COLORBOXMINW = '"+minValue+ "',PR_COLORBOXUNIT='"+pr_cartonunit.Text+"' where pr_code='" + pr_code.Text+"'", "update");
+            OperateResult.AppendText("<<重量设置成功,最大值"+maxValue+pr_cartonunit.Text+",最小值"+minValue+pr_cartonunit.Text+"\n", Color.Green);
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -196,7 +183,7 @@ namespace UAS_MES.Packing
                     return;
                 }
                 //验证彩盒是否与工单对应
-                if (!dh.CheckExist("makeserial","where ms_makecode='"+ma_code.Text+"' and ms_sncode = '"+sncode.Text+"'"))
+                if (!dh.CheckExist("makeserial","ms_makecode='"+ma_code.Text+"' and ms_sncode = '"+sncode.Text+"'"))
                 {
                     OperateResult.AppendText("<<序列号"+sncode.Text+"不在工单"+ma_code.Text+"中\n", Color.Red, sncode);
                     return;
@@ -215,5 +202,22 @@ namespace UAS_MES.Packing
         {
             asc.controlAutoSize(this);
         }
+
+        private void ma_code_UserControlTextChanged(object sender, EventArgs e)
+        {
+            //查询重量设置采样个数
+            try
+            {
+                samplesCount = int.Parse(dh.GetConfig("重量设置采样个数", "MESSetting").ToString());
+            }
+            catch (Exception ess)
+            {
+                //如果没维护的话默认是10
+                samplesCount = 10;
+            }
+            OperateResult.AppendText("<<重量设置需采样个数为" + samplesCount + "\n", Color.Black);
+            //清空称量记录
+            showResult.Items.Clear();
+        }
     }
 }