Browse Source

正大信维修改提交

caosy 1 year ago
parent
commit
f593979846

+ 1 - 1
UAS_MES_ZDXW/App.config

@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.101.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
   </applicationSettings>

File diff suppressed because it is too large
+ 353 - 363
UAS_MES_ZDXW/FunctionCode/Make/Make_TestCollection.Designer.cs


File diff suppressed because it is too large
+ 238 - 189
UAS_MES_ZDXW/FunctionCode/Packing/Packing_PackageCollectionWeigh.Designer.cs


+ 25 - 6
UAS_MES_ZDXW/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -2,6 +2,7 @@
 using System;
 using System.Data;
 using System.Text;
+using System.Linq;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
@@ -126,11 +127,29 @@ namespace UAS_MES_NEW.Packing
                     SystemInf.OpenPort.Add(serialPort1.PortName);
                     try
                     {
-                        while (GetData)
+                                while (GetData)
                         {
                             try
                             {
-                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                Thread.Sleep(100);
+                                int len = serialPort1.BytesToRead;
+                                Byte[] readBuffer = new Byte[len];
+                                serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
+                                string weigh33 = Encoding.Default.GetString(readBuffer);
+                                if (weigh33 != "" && weigh33.Length > 10)
+                                {
+                                    int firstIndex = weigh33.IndexOf("="); // 查找第一个"="的索引  
+                                    int secondIndex = weigh33.IndexOf("=", firstIndex + 1); // 查找第二个"="的索引  
+                                    string result = weigh33.Substring(firstIndex + 1, secondIndex - firstIndex - 1);// 提取第一个"="和第二个"="之间的字符
+                                    result = new string(result.ToCharArray().Reverse().ToArray());
+                                    int index = 0;
+                                    while (index < result.Length && result[index] == '0')
+                                    {
+                                        index++;
+                                    }
+                                    result = result.Substring(index);
+                                    weight.Text = result;
+                                }
                             }
                             catch (Exception)
                             {
@@ -290,7 +309,7 @@ namespace UAS_MES_NEW.Packing
                         }
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         sql.Clear();
-                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
+                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pr_code,pa_checkno,pr_packrule,");
                         sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -314,12 +333,12 @@ namespace UAS_MES_NEW.Packing
                             }
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
-                        if (dt.Rows[0]["ms_outno"].ToString() != "")
+                        if (ms_outno != "")
                         {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + dt.Rows[0]["ms_outno"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + ms_outno + "采集,不允许操作\n", Color.Red, sn_code);
                             return;
                         }
-                        if (dt.Rows[0]["ms_iostatus"].ToString() != "0")
+                        if (ms_iostatus != "0")
                         {
                             OperateResult.AppendText(">>序列号" + sn_code.Text + "已入库不允许采集\n", Color.Red, sn_code);
                             return;

+ 18 - 0
UAS_MES_ZDXW/FunctionCode/Packing/Packing_PackageCollectionWeigh.resx

@@ -212,6 +212,24 @@
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="DeleteAll.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m

+ 363 - 141
UAS_MES_ZDXW/FunctionCode/Query/Query_ExeProgress.Designer.cs

@@ -30,17 +30,41 @@
         {
             this.sn_code_label = new System.Windows.Forms.Label();
             this.SerialPanel = new System.Windows.Forms.Panel();
+            this.ma_code_label = new System.Windows.Forms.Label();
+            this.ma_code = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.pallet = new System.Windows.Forms.TextBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.ms_outboxcode = new System.Windows.Forms.TextBox();
+            this.ms_checkno = new System.Windows.Forms.TextBox();
+            this.label7 = new System.Windows.Forms.Label();
+            this.barcode = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.pr_orispeccode = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.TextBox();
+            this.liaohao = new System.Windows.Forms.Label();
+            this.CraftmaterialData = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.CraftInfDgv = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
             this.mp_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mp_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ma_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mp_sourcecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mp_stepname = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mp_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ma_craftcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.sc_linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mp_inman = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.em_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.label1 = new System.Windows.Forms.Label();
             this.pictureBox4 = new System.Windows.Forms.PictureBox();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
@@ -49,13 +73,8 @@
             this.pictureBox3 = new System.Windows.Forms.PictureBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
-            this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.ma_code_label = new System.Windows.Forms.Label();
-            this.ma_code = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
-            this.ms_checkno = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.CraftmaterialData)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).BeginInit();
-            this.groupBoxWithBorder1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -66,9 +85,10 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(10, 13);
+            this.sn_code_label.Location = new System.Drawing.Point(18, 12);
+            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.Size = new System.Drawing.Size(86, 31);
             this.sn_code_label.TabIndex = 183;
             this.sn_code_label.Text = "序列号";
             // 
@@ -78,14 +98,231 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.SerialPanel.AutoScroll = true;
             this.SerialPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.SerialPanel.Location = new System.Drawing.Point(14, 106);
-            this.SerialPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.SerialPanel.Location = new System.Drawing.Point(18, 138);
             this.SerialPanel.Name = "SerialPanel";
-            this.SerialPanel.Size = new System.Drawing.Size(950, 254);
+            this.SerialPanel.Size = new System.Drawing.Size(1418, 186);
             this.SerialPanel.TabIndex = 194;
             this.SerialPanel.Scroll += new System.Windows.Forms.ScrollEventHandler(this.SerialPanel_Scroll);
             this.SerialPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.SerialPanel_Paint);
             // 
+            // ma_code_label
+            // 
+            this.ma_code_label.AutoSize = true;
+            this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code_label.Location = new System.Drawing.Point(363, 12);
+            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Name = "ma_code_label";
+            this.ma_code_label.Size = new System.Drawing.Size(86, 31);
+            this.ma_code_label.TabIndex = 195;
+            this.ma_code_label.Text = "工单号";
+            // 
+            // ma_code
+            // 
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.Location = new System.Drawing.Point(459, 8);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(249, 39);
+            this.ma_code.TabIndex = 196;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label5.Location = new System.Drawing.Point(1167, 12);
+            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(86, 31);
+            this.label5.TabIndex = 197;
+            this.label5.Text = "栈板号";
+            // 
+            // pallet
+            // 
+            this.pallet.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pallet.Location = new System.Drawing.Point(1248, 8);
+            this.pallet.Margin = new System.Windows.Forms.Padding(4);
+            this.pallet.Name = "pallet";
+            this.pallet.Size = new System.Drawing.Size(188, 39);
+            this.pallet.TabIndex = 198;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(716, 12);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(110, 31);
+            this.label6.TabIndex = 199;
+            this.label6.Text = "卡通箱号";
+            // 
+            // ms_outboxcode
+            // 
+            this.ms_outboxcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ms_outboxcode.Location = new System.Drawing.Point(822, 8);
+            this.ms_outboxcode.Margin = new System.Windows.Forms.Padding(4);
+            this.ms_outboxcode.Name = "ms_outboxcode";
+            this.ms_outboxcode.Size = new System.Drawing.Size(325, 39);
+            this.ms_outboxcode.TabIndex = 200;
+            // 
+            // ms_checkno
+            // 
+            this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ms_checkno.Location = new System.Drawing.Point(138, 54);
+            this.ms_checkno.Margin = new System.Windows.Forms.Padding(4);
+            this.ms_checkno.Name = "ms_checkno";
+            this.ms_checkno.Size = new System.Drawing.Size(216, 39);
+            this.ms_checkno.TabIndex = 203;
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label7.Location = new System.Drawing.Point(18, 58);
+            this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(110, 31);
+            this.label7.TabIndex = 202;
+            this.label7.Text = "抽检批号";
+            // 
+            // barcode
+            // 
+            this.barcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.barcode.Location = new System.Drawing.Point(1248, 56);
+            this.barcode.Margin = new System.Windows.Forms.Padding(4);
+            this.barcode.Name = "barcode";
+            this.barcode.Size = new System.Drawing.Size(188, 39);
+            this.barcode.TabIndex = 207;
+            this.barcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label9.Location = new System.Drawing.Point(1167, 60);
+            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(86, 31);
+            this.label9.TabIndex = 206;
+            this.label9.Text = "部件号";
+            // 
+            // pr_orispeccode
+            // 
+            this.pr_orispeccode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_orispeccode.Location = new System.Drawing.Point(822, 56);
+            this.pr_orispeccode.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.Size = new System.Drawing.Size(325, 39);
+            this.pr_orispeccode.TabIndex = 211;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label8.Location = new System.Drawing.Point(721, 60);
+            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(62, 31);
+            this.label8.TabIndex = 210;
+            this.label8.Text = "型号";
+            // 
+            // pr_code
+            // 
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(459, 55);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(249, 39);
+            this.pr_code.TabIndex = 209;
+            // 
+            // liaohao
+            // 
+            this.liaohao.AutoSize = true;
+            this.liaohao.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.liaohao.Location = new System.Drawing.Point(363, 63);
+            this.liaohao.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.liaohao.Name = "liaohao";
+            this.liaohao.Size = new System.Drawing.Size(62, 31);
+            this.liaohao.TabIndex = 208;
+            this.liaohao.Text = "料号";
+            // 
+            // CraftmaterialData
+            // 
+            this.CraftmaterialData.AllowUserToAddRows = false;
+            this.CraftmaterialData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.CraftmaterialData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.CraftmaterialData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.dataGridViewTextBoxColumn1,
+            this.dataGridViewTextBoxColumn2,
+            this.dataGridViewTextBoxColumn3,
+            this.dataGridViewTextBoxColumn4,
+            this.dataGridViewTextBoxColumn5,
+            this.dataGridViewTextBoxColumn6,
+            this.dataGridViewTextBoxColumn7,
+            this.dataGridViewTextBoxColumn8});
+            this.CraftmaterialData.EnableContentClick = true;
+            this.CraftmaterialData.Location = new System.Drawing.Point(18, 330);
+            this.CraftmaterialData.Name = "CraftmaterialData";
+            this.CraftmaterialData.RowTemplate.Height = 27;
+            this.CraftmaterialData.Size = new System.Drawing.Size(1422, 167);
+            this.CraftmaterialData.TabIndex = 201;
+            // 
+            // dataGridViewTextBoxColumn1
+            // 
+            this.dataGridViewTextBoxColumn1.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn1.HeaderText = "工单号";
+            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.DataPropertyName = "cm_soncode";
+            this.dataGridViewTextBoxColumn2.HeaderText = "子件编号";
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn3
+            // 
+            this.dataGridViewTextBoxColumn3.DataPropertyName = "pr_detail";
+            this.dataGridViewTextBoxColumn3.HeaderText = "子件名称";
+            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn4
+            // 
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "cm_barcode";
+            this.dataGridViewTextBoxColumn4.HeaderText = "子件批次号";
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn5
+            // 
+            this.dataGridViewTextBoxColumn5.DataPropertyName = "cm_stepcode";
+            this.dataGridViewTextBoxColumn5.HeaderText = "工序编号";
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.Width = 130;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_stepname";
+            this.dataGridViewTextBoxColumn6.HeaderText = "工序名称";
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "cm_status";
+            this.dataGridViewTextBoxColumn7.HeaderText = "上料状态";
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.DataPropertyName = "cm_indate";
+            this.dataGridViewTextBoxColumn8.HeaderText = "上料时间";
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.Width = 120;
+            // 
             // CraftInfDgv
             // 
             this.CraftInfDgv.AllowUserToAddRows = false;
@@ -96,17 +333,17 @@
             this.mp_makecode,
             this.ma_prodcode,
             this.mp_sourcecode,
+            this.mp_stepname,
             this.mp_indate,
             this.ma_craftcode,
             this.sc_linecode,
             this.mp_inman,
             this.em_name});
             this.CraftInfDgv.EnableContentClick = true;
-            this.CraftInfDgv.Location = new System.Drawing.Point(0, 388);
-            this.CraftInfDgv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CraftInfDgv.Location = new System.Drawing.Point(18, 503);
             this.CraftInfDgv.Name = "CraftInfDgv";
             this.CraftInfDgv.RowTemplate.Height = 27;
-            this.CraftInfDgv.Size = new System.Drawing.Size(975, 190);
+            this.CraftInfDgv.Size = new System.Drawing.Size(1436, 234);
             this.CraftInfDgv.TabIndex = 193;
             // 
             // mp_sncode
@@ -128,7 +365,7 @@
             this.ma_prodcode.DataPropertyName = "ma_prodcode";
             this.ma_prodcode.HeaderText = "产品代码";
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Width = 120;
+            this.ma_prodcode.Width = 80;
             // 
             // mp_sourcecode
             // 
@@ -137,6 +374,13 @@
             this.mp_sourcecode.Name = "mp_sourcecode";
             this.mp_sourcecode.Width = 120;
             // 
+            // mp_stepname
+            // 
+            this.mp_stepname.DataPropertyName = "mp_stepname";
+            this.mp_stepname.HeaderText = "工序名称";
+            this.mp_stepname.Name = "mp_stepname";
+            this.mp_stepname.Width = 130;
+            // 
             // mp_indate
             // 
             this.mp_indate.DataPropertyName = "mp_indate";
@@ -156,7 +400,7 @@
             this.sc_linecode.DataPropertyName = "sc_linecode";
             this.sc_linecode.HeaderText = "产线";
             this.sc_linecode.Name = "sc_linecode";
-            this.sc_linecode.Width = 120;
+            this.sc_linecode.Width = 80;
             // 
             // mp_inman
             // 
@@ -170,189 +414,148 @@
             this.em_name.HeaderText = "人员姓名";
             this.em_name.Name = "em_name";
             // 
-            // groupBoxWithBorder1
+            // sn_code
             // 
-            this.groupBoxWithBorder1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Maroon;
-            this.groupBoxWithBorder1.Controls.Add(this.label1);
-            this.groupBoxWithBorder1.Controls.Add(this.pictureBox4);
-            this.groupBoxWithBorder1.Controls.Add(this.pictureBox2);
-            this.groupBoxWithBorder1.Controls.Add(this.label4);
-            this.groupBoxWithBorder1.Controls.Add(this.pictureBox1);
-            this.groupBoxWithBorder1.Controls.Add(this.pictureBox3);
-            this.groupBoxWithBorder1.Controls.Add(this.label2);
-            this.groupBoxWithBorder1.Controls.Add(this.label3);
-            this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(12, 40);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(953, 40);
-            this.groupBoxWithBorder1.TabIndex = 192;
-            this.groupBoxWithBorder1.TabStop = false;
-            this.groupBoxWithBorder1.Text = "颜色说明";
-            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            this.sn_code.AllPower = null;
+            this.sn_code.BackColor = System.Drawing.Color.White;
+            this.sn_code.ID = null;
+            this.sn_code.Location = new System.Drawing.Point(135, 15);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = null;
+            this.sn_code.Size = new System.Drawing.Size(216, 28);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 184;
+            this.sn_code.Tag = "NoAuto";
+            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
             // 
             // label1
             // 
             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(850, 14);
+            this.label1.Location = new System.Drawing.Point(1172, 104);
+            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.TabIndex = 193;
+            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.TabIndex = 219;
             this.label1.Text = "尚未执行";
             // 
             // pictureBox4
             // 
             this.pictureBox4.BackColor = System.Drawing.Color.White;
-            this.pictureBox4.Location = new System.Drawing.Point(776, 12);
-            this.pictureBox4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pictureBox4.Location = new System.Drawing.Point(1061, 101);
+            this.pictureBox4.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox4.Name = "pictureBox4";
-            this.pictureBox4.Size = new System.Drawing.Size(60, 20);
-            this.pictureBox4.TabIndex = 192;
+            this.pictureBox4.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox4.TabIndex = 218;
             this.pictureBox4.TabStop = false;
             // 
             // pictureBox2
             // 
             this.pictureBox2.BackColor = System.Drawing.Color.Green;
-            this.pictureBox2.Location = new System.Drawing.Point(99, 12);
-            this.pictureBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pictureBox2.Location = new System.Drawing.Point(45, 101);
+            this.pictureBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(60, 20);
-            this.pictureBox2.TabIndex = 187;
+            this.pictureBox2.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox2.TabIndex = 213;
             this.pictureBox2.TabStop = false;
             // 
             // 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(655, 14);
+            this.label4.Location = new System.Drawing.Point(879, 104);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(58, 21);
-            this.label4.TabIndex = 191;
+            this.label4.Size = new System.Drawing.Size(86, 31);
+            this.label4.TabIndex = 217;
             this.label4.Text = "已报废";
             // 
             // pictureBox1
             // 
             this.pictureBox1.BackColor = System.Drawing.Color.Red;
-            this.pictureBox1.Location = new System.Drawing.Point(338, 12);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pictureBox1.Location = new System.Drawing.Point(404, 101);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(60, 20);
-            this.pictureBox1.TabIndex = 186;
+            this.pictureBox1.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox1.TabIndex = 212;
             this.pictureBox1.TabStop = false;
             // 
             // pictureBox3
             // 
             this.pictureBox3.BackColor = System.Drawing.Color.Black;
-            this.pictureBox3.Location = new System.Drawing.Point(581, 12);
-            this.pictureBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pictureBox3.Location = new System.Drawing.Point(769, 101);
+            this.pictureBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pictureBox3.Name = "pictureBox3";
-            this.pictureBox3.Size = new System.Drawing.Size(60, 20);
-            this.pictureBox3.TabIndex = 190;
+            this.pictureBox3.Size = new System.Drawing.Size(90, 30);
+            this.pictureBox3.TabIndex = 216;
             this.pictureBox3.TabStop = false;
             // 
             // 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(172, 14);
+            this.label2.Location = new System.Drawing.Point(155, 104);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(122, 21);
-            this.label2.TabIndex = 188;
+            this.label2.Size = new System.Drawing.Size(182, 31);
+            this.label2.TabIndex = 214;
             this.label2.Text = "已执行且为良品";
             // 
             // label3
             // 
             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(412, 14);
+            this.label3.Location = new System.Drawing.Point(515, 104);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(138, 21);
-            this.label3.TabIndex = 189;
+            this.label3.Size = new System.Drawing.Size(206, 31);
+            this.label3.TabIndex = 215;
             this.label3.Text = "已执行且为不良品";
             // 
-            // sn_code
-            // 
-            this.sn_code.AllPower = null;
-            this.sn_code.BackColor = System.Drawing.Color.White;
-            this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(92, 14);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.sn_code.Name = "sn_code";
-            this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(145, 21);
-            this.sn_code.Str = null;
-            this.sn_code.Str1 = null;
-            this.sn_code.Str2 = null;
-            this.sn_code.TabIndex = 184;
-            this.sn_code.Tag = "NoAuto";
-            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
-            // 
-            // ma_code_label
-            // 
-            this.ma_code_label.AutoSize = true;
-            this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(257, 12);
-            this.ma_code_label.Name = "ma_code_label";
-            this.ma_code_label.Size = new System.Drawing.Size(58, 21);
-            this.ma_code_label.TabIndex = 195;
-            this.ma_code_label.Text = "工单号";
-            // 
-            // ma_code
-            // 
-            this.ma_code.AutoSize = true;
-            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(332, 13);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 21);
-            this.ma_code.TabIndex = 196;
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(472, 13);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(74, 21);
-            this.label5.TabIndex = 197;
-            this.label5.Text = "抽检批号";
-            // 
-            // ms_checkno
-            // 
-            this.ms_checkno.AutoSize = true;
-            this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_checkno.Location = new System.Drawing.Point(562, 13);
-            this.ms_checkno.Name = "ms_checkno";
-            this.ms_checkno.Size = new System.Drawing.Size(0, 21);
-            this.ms_checkno.TabIndex = 198;
-            // 
             // Query_ExeProgress
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(975, 578);
+            this.ClientSize = new System.Drawing.Size(1458, 778);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.pictureBox4);
+            this.Controls.Add(this.pictureBox2);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.pictureBox1);
+            this.Controls.Add(this.pictureBox3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.CraftmaterialData);
+            this.Controls.Add(this.pr_orispeccode);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.liaohao);
+            this.Controls.Add(this.barcode);
+            this.Controls.Add(this.label9);
             this.Controls.Add(this.ms_checkno);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.ms_outboxcode);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.pallet);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_code_label);
             this.Controls.Add(this.SerialPanel);
             this.Controls.Add(this.CraftInfDgv);
-            this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.Name = "Query_ExeProgress";
             this.Tag = "Query!ExeProgress";
             this.Text = "工单执行进度";
             this.Load += new System.EventHandler(this.Query_ExeProgress_Load);
             this.SizeChanged += new System.EventHandler(this.Query_ExeProgress_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.CraftmaterialData)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
-            this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
@@ -365,29 +568,48 @@
         #endregion
         private System.Windows.Forms.Label sn_code_label;
         private CustomControl.TextBoxWithIcon.SnCollectionBox sn_code;
-        private System.Windows.Forms.PictureBox pictureBox1;
-        private System.Windows.Forms.PictureBox pictureBox2;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.PictureBox pictureBox3;
-        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum CraftInfDgv;
         private System.Windows.Forms.Panel SerialPanel;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.PictureBox pictureBox4;
+        private System.Windows.Forms.Label ma_code_label;
+        private System.Windows.Forms.TextBox ma_code;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.TextBox pallet;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.TextBox ms_outboxcode;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum CraftmaterialData;
+        private System.Windows.Forms.TextBox ms_checkno;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox barcode;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_makecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn ma_prodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_sourcecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mp_stepname;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_indate;
         private System.Windows.Forms.DataGridViewTextBoxColumn ma_craftcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn sc_linecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn mp_inman;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_name;
-        private System.Windows.Forms.Label ma_code_label;
-        private System.Windows.Forms.Label ma_code;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label ms_checkno;
+        private System.Windows.Forms.TextBox pr_orispeccode;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.TextBox pr_code;
+        private System.Windows.Forms.Label liaohao;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.PictureBox pictureBox4;
+        private System.Windows.Forms.PictureBox pictureBox2;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.PictureBox pictureBox1;
+        private System.Windows.Forms.PictureBox pictureBox3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
     }
 }

+ 50 - 29
UAS_MES_ZDXW/FunctionCode/Query/Query_ExeProgress.cs

@@ -26,7 +26,6 @@ namespace UAS_MES_NEW.Query
         string checkno = "";
         //拆分后的经过的步骤
         Dictionary<int, string> Step;
-        Dictionary<int, string> StepName;
         List<Brush> PaintColor = new List<Brush>();
         //屏幕高度
         int ScreenWidth;
@@ -57,7 +56,7 @@ namespace UAS_MES_NEW.Query
 
         private void Query_ExeProgress_SizeChanged(object sender, EventArgs e)
         {
-            //asc.controlAutoSize(this);
+            asc.controlAutoSize(this);
         }
 
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
@@ -68,12 +67,12 @@ namespace UAS_MES_NEW.Query
                 if (ms_id.Rows.Count > 0)
                 {
                     //说明有过转号
-                    ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_checkno from makeserial where ms_sncode='" + ms_id.Rows[0]["beforesn"].ToString() + "' or ms_sncode='" + ms_id.Rows[0]["sn"].ToString() + "' order by ms_id", "select");
+                    ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_checkno,ms_outboxcode,pr_code,pr_orispeccode from makeserial left join product on ms_prodcode = pr_code where ms_sncode='" + ms_id.Rows[0]["beforesn"].ToString() + "' or ms_sncode='" + ms_id.Rows[0]["sn"].ToString() + "' order by ms_id", "select");
                 }
                 else
                 {
                     //没有过转号
-                    ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_checkno from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id", "select");
+                    ms_id = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_checkno,ms_outboxcode,pr_code,pr_orispeccode from makeserial left join product on ms_prodcode = pr_code where ms_sncode='" + sn_code.Text + "' order by ms_id", "select");
                 }
                 if (ms_id.Rows.Count == 0)
                 {
@@ -84,14 +83,18 @@ namespace UAS_MES_NEW.Query
                 StringBuilder ms_ids = new StringBuilder();//存所有的ms_id
                 //设置界面工单号
                 ma_code.Text = ms_id.Rows[ms_id.Rows.Count - 1]["ms_makecode"].ToString();
+                pr_code.Text = ms_id.Rows[ms_id.Rows.Count - 1]["pr_code"].ToString();
+                pr_orispeccode.Text = ms_id.Rows[ms_id.Rows.Count - 1]["pr_orispeccode"].ToString();
                 ms_checkno.Text = ms_id.Rows[ms_id.Rows.Count - 1]["ms_checkno"].ToString();
+                pallet.Text = dh.getFieldDataByCondition("mes_package_view", "v_outboxcode", "v_barcode = '"+sn_code.Text+"' and v_type = 3").ToString();
+                ms_outboxcode.Text = ms_id.Rows[ms_id.Rows.Count - 1]["ms_outboxcode"].ToString();
                 int idCount = ms_id.Rows.Count;
                 for (int i = 0; i < idCount; i++)
                 {
                     ms_ids.Append("'" + ms_id.Rows[i]["ms_id"].ToString() + "',");
                 }
                 ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_sncode,ms_firstsn,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ")", "select");
-                dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,ms_checkno,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
+                dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,ms_checkno,ms_outboxcode,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
                 if (dt.Rows.Count > 0)
                 {
                     if (Step != null && Step.Count > 0)
@@ -162,28 +165,18 @@ namespace UAS_MES_NEW.Query
                     }
                     //查询执行过的步骤
                     sql.Clear();
-                    sql.Append("select CD_DETNO,CD_STEPCODE,cd_ifoqc,ms_makecode,ms_id,cd_stepname from craft left join craftdetail on cd_crid = cr_id  left join makeserial ");
+                    sql.Append("select CD_DETNO,CD_STEPCODE,CD_STEPNAME,cd_ifoqc,ms_makecode,ms_id from craft left join craftdetail on cd_crid = cr_id  left join makeserial ");
                     sql.Append("on ms_craftcode=cr_code and ms_prodcode=cr_prodcode where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id,cd_detno");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     Step = new Dictionary<int, string>();
-                    StepName = new Dictionary<int, string>();
                     for (int i = 0; i < dt.Rows.Count + 2; i++)
                     {
                         if (i == 0)
-                        {
                             Step.Add(i, "开始");
-                            StepName.Add(i, "开始");
-                        }
                         else if (i == dt.Rows.Count + 1)
-                        {
                             Step.Add(i, "结束");
-                            StepName.Add(i, "开始");
-                        }
                         else
-                        {
-                            Step.Add(i, dt.Rows[i - 1]["CD_STEPCODE"].ToString());
-                            StepName.Add(i, dt.Rows[i - 1]["cd_stepname"].ToString());
-                        }
+                            Step.Add(i, dt.Rows[i - 1]["CD_STEPNAME"].ToString());
                     }
                     //添加中间节点
                     bool passed = true;
@@ -228,16 +221,16 @@ namespace UAS_MES_NEW.Query
                                 }
                                 else
                                 {
-                                    //通过加绿色
-                                    if (PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString()))
-                                    {
-                                        PaintColor.Add(Brushes.Green);
-                                    }
-                                    //不通过加白色
-                                    else
-                                    {
-                                        PaintColor.Add(Brushes.White);
-                                    }
+                                        //通过加绿色
+                                        if (PastStep.Contains(dt.Rows[i]["CD_STEPCODE"].ToString())&&passed)
+                                        {
+                                            PaintColor.Add(Brushes.Green);
+                                        }
+                                        //不通过加白色
+                                        else
+                                        {
+                                            PaintColor.Add(Brushes.White);
+                                        }                                   
                                 }
                             }
                             ////序列号下一步不为空
@@ -313,11 +306,17 @@ namespace UAS_MES_NEW.Query
                         makecodes.Append("'" + ListA.Rows[i]["ms_makecode"].ToString() + "',");
                     }
                     sql.Clear();
-                    sql.Append("select mp_makecode,ma_prodcode,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,");
+                    sql.Append("select mp_makecode,ma_prodcode,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,mp_stepname,");
                     sql.Append("mp_indate,mp_inman,em_name from makeprocess left join make on mp_makecode=ma_code left join employee on mp_inman = em_code left join source on ");
                     sql.Append("mp_sourcecode=sc_code where mp_sncode in (" + mp_sncodes.ToString().Substring(0, mp_sncodes.ToString().Length - 1) + ") and ma_code in (" + makecodes.ToString().Substring(0, makecodes.ToString().Length - 1) + ") order by mp_indate");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     BaseUtil.FillDgvWithDataTable(CraftInfDgv, dt);
+                    sql.Clear();
+                    sql.Append("select cm_makecode,cm_soncode,pr_detail,cm_barcode,cm_stepcode,cm_stepname,cm_status,cm_indate ");
+                    sql.Append("from craftmaterial left join product on pr_code=cm_soncode  ");
+                    sql.Append("left join employee on cm_inman = em_code where cm_sncode IN (" + mp_sncodes.ToString().Substring(0, mp_sncodes.ToString().Length - 1) + " ) order by cm_id asc");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    BaseUtil.FillDgvWithDataTable(CraftmaterialData, dt);
                 }
                 else MessageBox.Show("序列号" + sn_code.Text + "不存在");
             }
@@ -357,7 +356,7 @@ namespace UAS_MES_NEW.Query
                         p.EndCap = LineCap.ArrowAnchor;
                         //方块内的信息
                         Label Param = new Label();
-                        Param.Text = j + " " + StepName[j];
+                        Param.Text = j + " " + Step[j];
                         Param.Name = j + Step[j] + "_label";
                         Param.AutoSize = true;
                         Param.Margin = new Padding(0, 0, 0, 0);
@@ -437,5 +436,27 @@ namespace UAS_MES_NEW.Query
             g.Clear(this.BackColor);
             SerialPanel.Refresh();
         }
+
+        private void barcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                dt = (DataTable)dh.ExecuteSql("select cm_sncode from craftmaterial where cm_barcode = '"+barcode.Text+ "' and cm_status =0 order by cm_id desc", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show("未找到此零部件对应成品SN号");
+                }
+                else if (dt.Rows.Count > 1)
+                {
+                    MessageBox.Show("此零部件为可重复件");
+                }
+                else
+                {
+                    sn_code.Text = dt.Rows[0]["cm_sncode"].ToString();
+                    sn_code_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                }
+                
+            }
+        }
     }
 }

+ 27 - 0
UAS_MES_ZDXW/FunctionCode/Query/Query_ExeProgress.resx

@@ -117,6 +117,30 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mp_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -129,6 +153,9 @@
   <metadata name="mp_sourcecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mp_stepname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mp_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 49 - 27
UAS_MES_ZDXW/FunctionCode/SystemSetting/SystemSetting_ScaleTest.Designer.cs

@@ -41,6 +41,7 @@
             this.StartTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ComList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.SerialPortCombox();
             this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.panel4.SuspendLayout();
             this.panel5.SuspendLayout();
             this.SuspendLayout();
@@ -50,9 +51,10 @@
             this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel4.Controls.Add(this.Weight);
             this.panel4.Controls.Add(this.panel5);
-            this.panel4.Location = new System.Drawing.Point(342, 86);
+            this.panel4.Location = new System.Drawing.Point(684, 172);
+            this.panel4.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(333, 129);
+            this.panel4.Size = new System.Drawing.Size(664, 256);
             this.panel4.TabIndex = 39;
             // 
             // Weight
@@ -63,9 +65,10 @@
             this.Weight.AutoSize = true;
             this.Weight.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Weight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Weight.Location = new System.Drawing.Point(134, 50);
+            this.Weight.Location = new System.Drawing.Point(268, 100);
+            this.Weight.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Weight.Name = "Weight";
-            this.Weight.Size = new System.Drawing.Size(0, 31);
+            this.Weight.Size = new System.Drawing.Size(0, 62);
             this.Weight.TabIndex = 41;
             // 
             // panel5
@@ -75,8 +78,9 @@
             this.panel5.Controls.Add(this.label22);
             this.panel5.Dock = System.Windows.Forms.DockStyle.Left;
             this.panel5.Location = new System.Drawing.Point(0, 0);
+            this.panel5.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.panel5.Name = "panel5";
-            this.panel5.Size = new System.Drawing.Size(78, 127);
+            this.panel5.Size = new System.Drawing.Size(156, 254);
             this.panel5.TabIndex = 40;
             // 
             // pr_colorboxunit
@@ -84,9 +88,10 @@
             this.pr_colorboxunit.AutoSize = true;
             this.pr_colorboxunit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pr_colorboxunit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.pr_colorboxunit.Location = new System.Drawing.Point(22, 66);
+            this.pr_colorboxunit.Location = new System.Drawing.Point(44, 132);
+            this.pr_colorboxunit.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_colorboxunit.Name = "pr_colorboxunit";
-            this.pr_colorboxunit.Size = new System.Drawing.Size(31, 25);
+            this.pr_colorboxunit.Size = new System.Drawing.Size(60, 50);
             this.pr_colorboxunit.TabIndex = 42;
             this.pr_colorboxunit.Text = "克";
             // 
@@ -95,9 +100,10 @@
             this.label22.AutoSize = true;
             this.label22.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label22.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label22.Location = new System.Drawing.Point(15, 32);
+            this.label22.Location = new System.Drawing.Point(30, 64);
+            this.label22.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(50, 25);
+            this.label22.Size = new System.Drawing.Size(98, 50);
             this.label22.TabIndex = 20;
             this.label22.Text = "重量";
             // 
@@ -108,9 +114,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.SerialPortComBox_label.AutoSize = true;
             this.SerialPortComBox_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SerialPortComBox_label.Location = new System.Drawing.Point(43, 85);
+            this.SerialPortComBox_label.Location = new System.Drawing.Point(86, 170);
+            this.SerialPortComBox_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.SerialPortComBox_label.Name = "SerialPortComBox_label";
-            this.SerialPortComBox_label.Size = new System.Drawing.Size(78, 21);
+            this.SerialPortComBox_label.Size = new System.Drawing.Size(153, 41);
             this.SerialPortComBox_label.TabIndex = 42;
             this.SerialPortComBox_label.Text = "Com端口";
             // 
@@ -121,9 +128,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.BaudRate_label.AutoSize = true;
             this.BaudRate_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BaudRate_label.Location = new System.Drawing.Point(62, 124);
+            this.BaudRate_label.Location = new System.Drawing.Point(124, 248);
+            this.BaudRate_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.BaudRate_label.Name = "BaudRate_label";
-            this.BaudRate_label.Size = new System.Drawing.Size(58, 21);
+            this.BaudRate_label.Size = new System.Drawing.Size(114, 41);
             this.BaudRate_label.TabIndex = 44;
             this.BaudRate_label.Text = "波特率";
             // 
@@ -135,13 +143,13 @@
             this.StopTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StopTest.Image = ((System.Drawing.Image)(resources.GetObject("StopTest.Image")));
             this.StopTest.IsShowBorder = true;
-            this.StopTest.Location = new System.Drawing.Point(203, 190);
-            this.StopTest.Margin = new System.Windows.Forms.Padding(2);
+            this.StopTest.Location = new System.Drawing.Point(406, 380);
+            this.StopTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StopTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopTest.MoveImage")));
             this.StopTest.Name = "StopTest";
             this.StopTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopTest.NormalImage")));
             this.StopTest.Power = null;
-            this.StopTest.Size = new System.Drawing.Size(67, 23);
+            this.StopTest.Size = new System.Drawing.Size(134, 46);
             this.StopTest.TabIndex = 45;
             this.StopTest.Text = "停止调试";
             this.StopTest.UseVisualStyleBackColor = true;
@@ -152,12 +160,12 @@
             this.BaudRate.AllPower = null;
             this.BaudRate.BackColor = System.Drawing.Color.White;
             this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(130, 126);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(2);
+            this.BaudRate.Location = new System.Drawing.Point(260, 252);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.BaudRate.Name = "BaudRate";
             this.BaudRate.Negative = false;
             this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(140, 21);
+            this.BaudRate.Size = new System.Drawing.Size(276, 35);
             this.BaudRate.Str = null;
             this.BaudRate.Str1 = null;
             this.BaudRate.Str2 = null;
@@ -171,13 +179,13 @@
             this.StartTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StartTest.Image = ((System.Drawing.Image)(resources.GetObject("StartTest.Image")));
             this.StartTest.IsShowBorder = true;
-            this.StartTest.Location = new System.Drawing.Point(120, 190);
-            this.StartTest.Margin = new System.Windows.Forms.Padding(2);
+            this.StartTest.Location = new System.Drawing.Point(240, 380);
+            this.StartTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StartTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartTest.MoveImage")));
             this.StartTest.Name = "StartTest";
             this.StartTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartTest.NormalImage")));
             this.StartTest.Power = null;
-            this.StartTest.Size = new System.Drawing.Size(67, 23);
+            this.StartTest.Size = new System.Drawing.Size(134, 46);
             this.StartTest.TabIndex = 41;
             this.StartTest.Text = "开始调试";
             this.StartTest.UseVisualStyleBackColor = true;
@@ -185,10 +193,10 @@
             // 
             // ComList
             // 
-            this.ComList.Location = new System.Drawing.Point(130, 86);
-            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ComList.Location = new System.Drawing.Point(260, 172);
+            this.ComList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(140, 20);
+            this.ComList.Size = new System.Drawing.Size(280, 40);
             this.ComList.TabIndex = 40;
             // 
             // normalButton1
@@ -199,6 +207,7 @@
             this.normalButton1.Image = ((System.Drawing.Image)(resources.GetObject("normalButton1.Image")));
             this.normalButton1.IsShowBorder = true;
             this.normalButton1.Location = new System.Drawing.Point(0, 0);
+            this.normalButton1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
             this.normalButton1.Name = "normalButton1";
             this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
@@ -208,11 +217,22 @@
             this.normalButton1.Text = "normalButton1";
             this.normalButton1.UseVisualStyleBackColor = true;
             // 
+            // Remark
+            // 
+            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Remark.Location = new System.Drawing.Point(170, 558);
+            this.Remark.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.Remark.Name = "Remark";
+            this.Remark.Size = new System.Drawing.Size(476, 156);
+            this.Remark.TabIndex = 195;
+            this.Remark.Text = "";
+            // 
             // SystemSetting_ScaleTest
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(916, 474);
+            this.ClientSize = new System.Drawing.Size(1832, 948);
+            this.Controls.Add(this.Remark);
             this.Controls.Add(this.StopTest);
             this.Controls.Add(this.BaudRate_label);
             this.Controls.Add(this.BaudRate);
@@ -222,6 +242,7 @@
             this.Controls.Add(this.panel4);
             this.Controls.Add(this.normalButton1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "SystemSetting_ScaleTest";
             this.Tag = "Setup!ScaleTest";
             this.Text = " ";
@@ -249,5 +270,6 @@
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
         private System.Windows.Forms.Label BaudRate_label;
         private CustomControl.ButtonUtil.NormalButton StopTest;
+        private CustomControl.RichText.RichTextAutoBottom Remark;
     }
 }

+ 22 - 2
UAS_MES_ZDXW/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -33,7 +33,7 @@ namespace UAS_MES_NEW.SystemSetting
 
         private void SystemSetting_ScaleTest_Load(object sender, EventArgs e)
         {
-            CheckForIllegalCrossThreadCalls = false;
+            SystemSetting_ScaleTest.CheckForIllegalCrossThreadCalls = false;
             ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
             BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
         }
@@ -64,6 +64,7 @@ namespace UAS_MES_NEW.SystemSetting
             catch (Exception mes) { MessageBox.Show(mes.Message); }
         }
 
+
         private void GetSerialData()
         {
             if (serialPort1.IsOpen)
@@ -77,7 +78,26 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             try
                             {
-                                Weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                Thread.Sleep(100);
+                                int len = serialPort1.BytesToRead;
+                                Byte[] readBuffer = new Byte[len];
+                                serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
+                                string weigh = Encoding.Default.GetString(readBuffer);
+                                if (weigh != ""&& weigh.Length>10)
+                                {
+                                    int firstIndex = weigh.IndexOf("="); // 查找第一个"="的索引  
+                                    int secondIndex = weigh.IndexOf("=", firstIndex + 1); // 查找第二个"="的索引  
+                                    string result = weigh.Substring(firstIndex + 1, secondIndex - firstIndex - 1);// 提取第一个"="和第二个"="之间的字符
+                                    result = new string(result.ToCharArray().Reverse().ToArray());
+                                    int index = 0;
+                                    while (index < result.Length && result[index] == '0')
+                                    {
+                                        index++;
+                                    }
+                                    result = result.Substring(index);
+                                    Remark.AppendText(result+"\n");
+                                    Weight.Text = result;
+                                }
                             }
                             catch (Exception)
                             {

+ 3 - 3
UAS_MES_ZDXW/Properties/Settings.Designer.cs

@@ -121,9 +121,9 @@ namespace UAS_MES_NEW.Properties {
         
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.7" +
-            ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=fal" +
+            "se;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1" +
+            "01.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 1 - 1
UAS_MES_ZDXW/Properties/Settings.settings

@@ -27,7 +27,7 @@
       <Value Profile="(Default)">ftp://10.8.0.82|vsftpd|vsftpd</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.101.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 1 - 1
UAS_MES_ZDXW/UAS_MES_ZDXW.csproj

@@ -1069,7 +1069,7 @@
     <Compile Include="FunctionCode\SystemSetting\SystemSetting_ScaleTest.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="FunctionCode\SystemSetting\SystemSetting_ScaleTest.designer.cs">
+    <Compile Include="FunctionCode\SystemSetting\SystemSetting_ScaleTest.Designer.cs">
       <DependentUpon>SystemSetting_ScaleTest.cs</DependentUpon>
     </Compile>
     <Compile Include="FunctionCode\SystemSetting\SystemSetting_SysNav.cs">

Some files were not shown because too many files changed in this diff