Просмотр исходного кода

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

Hcsy 9 лет назад
Родитель
Сommit
9e3e4b26e5
62 измененных файлов с 2799 добавлено и 948 удалено
  1. 0 2
      .gitignore
  2. 42 2
      UAS-MES/CustomControl/AccordionMenu/AccordionMenu.Designer.cs
  3. 1 1
      UAS-MES/CustomControl/AccordionMenu/AccordionMenu.cs
  4. 38 0
      UAS-MES/CustomControl/AccordionMenu/AccordionMenu.resx
  5. 10 9
      UAS-MES/CustomControl/RichText/RichTextAutoBottom.cs
  6. 1 0
      UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.cs
  7. 9 9
      UAS-MES/DataOperate/DataHelper.cs
  8. 5 2
      UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs
  9. 88 114
      UAS-MES/FunctionCode/Make/Make_BigBoxWeight.Designer.cs
  10. 12 10
      UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs
  11. 88 121
      UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs
  12. 50 32
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs
  13. 17 30
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs
  14. 5 7
      UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs
  15. 95 86
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  16. 51 30
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs
  17. 31 13
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  18. 2 4
      UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.cs
  19. 39 12
      UAS-MES/FunctionCode/Make/Make_Decompose.cs
  20. 13 19
      UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs
  21. 5 10
      UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs
  22. 9 18
      UAS-MES/FunctionCode/Make/Make_LabelCheck.cs
  23. 4 8
      UAS-MES/FunctionCode/Make/Make_MakeDown.cs
  24. 4 3
      UAS-MES/FunctionCode/Make/Make_NewBigBox.Designer.cs
  25. 1 0
      UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs
  26. 66 55
      UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs
  27. 29 32
      UAS-MES/FunctionCode/Make/Make_PackageCollection.cs
  28. 3 0
      UAS-MES/FunctionCode/Make/Make_PackageCollection.resx
  29. 66 55
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs
  30. 31 27
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs
  31. 1 13
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.resx
  32. 7 5
      UAS-MES/FunctionCode/Make/Make_PalletCollection.cs
  33. 4 8
      UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs
  34. 41 48
      UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs
  35. 4 4
      UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs
  36. 4 0
      UAS-MES/FunctionCode/Make/Make_Repair.cs
  37. 12 0
      UAS-MES/FunctionCode/Make/Make_Repair.resx
  38. 20 50
      UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs
  39. 11 28
      UAS-MES/FunctionCode/Make/Make_SeqTransform.cs
  40. 2 2
      UAS-MES/FunctionCode/Make/Make_TestCollection.cs
  41. 480 0
      UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.Designer.cs
  42. 181 0
      UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.cs
  43. 197 0
      UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.resx
  44. 2 2
      UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs
  45. 494 0
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.Designer.cs
  46. 247 0
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs
  47. 120 0
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.resx
  48. 4 4
      UAS-MES/FunctionCode/Query/Query_ExeProgress.cs
  49. 1 1
      UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs
  50. 2 0
      UAS-MES/Login.cs
  51. 52 35
      UAS-MES/Main.Designer.cs
  52. 5 0
      UAS-MES/Main.cs
  53. 43 2
      UAS-MES/PublicMethod/BaseUtil.cs
  54. 23 8
      UAS-MES/PublicMethod/LogicHandler.cs
  55. 11 3
      UAS-MES/PublicMethod/Print.cs
  56. 0 1
      UAS_KanBan/UAS_KanBan.csproj
  57. BIN
      UAS_MesDllService(4.0)/key.sn.snk
  58. 6 16
      UAS_MesInterface(4.0)/MesHelper.cs
  59. 3 3
      UAS_MesInterface(4.0)/Properties/AssemblyInfo.cs
  60. 0 0
      UAS_MesInterface(4.0)/tool/Oracle.ManagedDataAccess.dll
  61. 5 3
      UAS_MesInterface/MESHelper.cs
  62. 2 1
      UAS_MesInterface/UAS_MesDllService(3.5).csproj

+ 0 - 2
.gitignore

@@ -6,7 +6,6 @@
 *.user
 *.userosscache
 *.sln.docstates
-*.csproj
 
 # User-specific files (MonoDevelop/Xamarin Studio)
 *.userprefs
@@ -22,7 +21,6 @@ build/
 bld/
 [Bb]in/
 [Oo]bj/
-/UAS-MES/UAS-MES.csproj
 
 # Visual Studio 2015 cache/options directory
 .vs/

+ 42 - 2
UAS-MES/CustomControl/AccordionMenu/AccordionMenu.Designer.cs

@@ -49,6 +49,8 @@
             this.仓库作业 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.特殊作业 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.产线作业 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.包装作业_lsv = new System.Windows.Forms.ListView();
+            this.包装作业 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SuspendLayout();
             // 
             // SMT作业_lsv
@@ -156,7 +158,7 @@
             this.人员管理_lsv.Name = "人员管理_lsv";
             this.人员管理_lsv.Size = new System.Drawing.Size(160, 309);
             this.人员管理_lsv.TabIndex = 13;
-            this.人员管理_lsv.Tag = "OQC作业_lsv";
+            this.人员管理_lsv.Tag = "人员管理_lsv";
             this.人员管理_lsv.UseCompatibleStateImageBehavior = false;
             this.人员管理_lsv.View = System.Windows.Forms.View.SmallIcon;
             this.人员管理_lsv.Visible = false;
@@ -350,10 +352,46 @@
             this.产线作业.UseVisualStyleBackColor = true;
             this.产线作业.Visible = false;
             // 
+            // 包装作业_lsv
+            // 
+            this.包装作业_lsv.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.包装作业_lsv.Location = new System.Drawing.Point(1555, 108);
+            this.包装作业_lsv.Margin = new System.Windows.Forms.Padding(4);
+            this.包装作业_lsv.Name = "包装作业_lsv";
+            this.包装作业_lsv.Size = new System.Drawing.Size(160, 309);
+            this.包装作业_lsv.TabIndex = 17;
+            this.包装作业_lsv.Tag = "包装作业_lsv";
+            this.包装作业_lsv.UseCompatibleStateImageBehavior = false;
+            this.包装作业_lsv.View = System.Windows.Forms.View.SmallIcon;
+            this.包装作业_lsv.Visible = false;
+            // 
+            // 包装作业
+            // 
+            this.包装作业.AllPower = null;
+            this.包装作业.BackColor = System.Drawing.Color.Transparent;
+            this.包装作业.DownImage = ((System.Drawing.Image)(resources.GetObject("包装作业.DownImage")));
+            this.包装作业.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.包装作业.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.包装作业.Image = global::UAS_MES.Properties.Resources._2_0btn_36;
+            this.包装作业.IsShowBorder = true;
+            this.包装作业.Location = new System.Drawing.Point(1555, 30);
+            this.包装作业.Margin = new System.Windows.Forms.Padding(4);
+            this.包装作业.MoveImage = ((System.Drawing.Image)(resources.GetObject("包装作业.MoveImage")));
+            this.包装作业.Name = "包装作业";
+            this.包装作业.NormalImage = ((System.Drawing.Image)(resources.GetObject("包装作业.NormalImage")));
+            this.包装作业.Power = null;
+            this.包装作业.Size = new System.Drawing.Size(161, 50);
+            this.包装作业.TabIndex = 16;
+            this.包装作业.Text = "包装作业";
+            this.包装作业.UseVisualStyleBackColor = true;
+            this.包装作业.Visible = false;
+            // 
             // AccordionMenu
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.包装作业_lsv);
+            this.Controls.Add(this.包装作业);
             this.Controls.Add(this.库存管理);
             this.Controls.Add(this.SMT作业);
             this.Controls.Add(this.人员管理_lsv);
@@ -374,7 +412,7 @@
             this.Controls.Add(this.SMT作业_lsv);
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "AccordionMenu";
-            this.Size = new System.Drawing.Size(1560, 452);
+            this.Size = new System.Drawing.Size(1741, 452);
             this.Load += new System.EventHandler(this.AccordionMenu_Load);
             this.ResumeLayout(false);
 
@@ -400,5 +438,7 @@
         private ButtonUtil.NormalButton 查询分析;
         private ButtonUtil.NormalButton OQC作业;
         private ButtonUtil.NormalButton 人员管理;
+        private System.Windows.Forms.ListView 包装作业_lsv;
+        private ButtonUtil.NormalButton 包装作业;
     }
 }

+ 1 - 1
UAS-MES/CustomControl/AccordionMenu/AccordionMenu.cs

@@ -100,7 +100,7 @@ namespace UAS_MES.CustomControl.AccordionMenu
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 //在这个Caller范围内的是用户可见的导航
-                if (dt.Rows[i]["UGP_IFDELETE"].ToString() == "1" || dt.Rows[i]["UGP_IFALL"].ToString() == "1")
+                if (dt.Rows[i]["UGP_IFREAD"].ToString() == "1" || dt.Rows[i]["UGP_IFALL"].ToString() == "1")
                 {
                     Callers += "'" + dt.Rows[i]["ugp_caller"].ToString() + "',";
                 }

+ 38 - 0
UAS-MES/CustomControl/AccordionMenu/AccordionMenu.resx

@@ -740,6 +740,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="包装作业.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="包装作业.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="包装作业.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
 </root>

+ 10 - 9
UAS-MES/CustomControl/RichText/RichTextAutoBottom.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Drawing;
+using System.Media;
 using System.Threading;
 using System.Windows.Forms;
 using UAS_MES.PublicMethod;
@@ -38,8 +39,9 @@ namespace UAS_MES.CustomControl.RichText
                 FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
                 thread.Start();
                 thread = new Thread(PlaySound);
+
             }
-            else if(color == Color.Green && Entity.SystemInf.CheckAudioEnable)
+            else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
             {
                 //颜色是绿色,进行正确提示音
                 FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
@@ -66,7 +68,7 @@ namespace UAS_MES.CustomControl.RichText
                 thread.Start();
                 thread = new Thread(PlaySound);
             }
-            else if(color == Color.Green && Entity.SystemInf.CheckAudioEnable)
+            else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
             {
                 //颜色是绿色,进行正确提示音
                 FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
@@ -84,15 +86,14 @@ namespace UAS_MES.CustomControl.RichText
             }
             try
             {
-                SpeechLib.SpVoiceClass pp = new SpeechLib.SpVoiceClass();
-                SpeechLib.SpFileStreamClass spFs = new SpeechLib.SpFileStreamClass();
-                spFs.Open(FileName, SpeechLib.SpeechStreamFileMode.SSFMOpenForRead, true);
-                SpeechLib.ISpeechBaseStream Istream = spFs as SpeechLib.ISpeechBaseStream;
-                pp.SpeakStream(Istream, SpeechLib.SpeechVoiceSpeakFlags.SVSFIsFilename);
-                spFs.Close();
+                SoundPlayer player = new SoundPlayer();
+                player.SoundLocation = FileName;
+                player.Load();
+                player.Play();
             }
-            catch (Exception)
+            catch (Exception e)
             {
+                MessageBox.Show(e.Message);
                 Entity.SystemInf.CheckAudioEnable = false;
             }
         }

+ 1 - 0
UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.cs

@@ -312,6 +312,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             if (!TextBoxEnable1)
                 TextBox.BackColor = System.Drawing.Color.White;
             TextBox.Enabled = TextBoxEnable1;
+            Search_Icon.Power = this.Power;
         }
 
         private void SearchTextBox_SizeChanged(object sender, EventArgs e)

+ 9 - 9
UAS-MES/DataOperate/DataHelper.cs

@@ -61,7 +61,6 @@ namespace UAS_MES.DataOperate
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
-            Console.WriteLine(sql);
             try
             {
                 ad.Fill(dt);
@@ -256,7 +255,7 @@ namespace UAS_MES.DataOperate
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition;
-
+            
             command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
@@ -480,7 +479,7 @@ namespace UAS_MES.DataOperate
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Console.WriteLine(sql);
+            
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
@@ -514,7 +513,7 @@ namespace UAS_MES.DataOperate
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -527,7 +526,7 @@ namespace UAS_MES.DataOperate
                 for (int i = 0; i < addpar.Length; i++)
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-            Console.WriteLine(SQL);
+            
             switch (Type.ToUpper())
             {
                 case "SELECT":
@@ -681,10 +680,10 @@ namespace UAS_MES.DataOperate
         /// </summary>
         /// <param name="SeqName"></param>
         /// <returns></returns>
-        public string[] GetSEQ(string SeqName,string TableName, int Num)
+        public string[] GetSEQ(string SeqName, string TableName, int Num)
         {
             DataTable dt = new DataTable();
-            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from "+ TableName + " where rownum<" + (Num + 1) + ")", "select");
+            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from " + TableName + " where rownum<" + (Num + 1) + ")", "select");
             string[] SerialNum = new string[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {
@@ -802,7 +801,7 @@ namespace UAS_MES.DataOperate
             command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = names[1].Length;
-            Console.WriteLine(sql);
+            
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
             for (int i = 1; i <= names[0].Length; i++)
@@ -912,7 +911,7 @@ namespace UAS_MES.DataOperate
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
             command = new OracleCommand(sql, connection);
-            Console.WriteLine(sql);
+            
             Reconnect(command);
             try
             {
@@ -971,6 +970,7 @@ namespace UAS_MES.DataOperate
             {
                 foreach (string sql in SQL)
                 {
+                    
                     if (!String.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;

+ 5 - 2
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -119,6 +119,10 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>大箱号不存在\n", Color.Red);
                     return;
                 }
+                if (pa_standardqty.Text == pa_currentqty.Text)
+                {
+                    Packing_Click(new object(), new EventArgs());
+                }
                 sql.Clear();
                 sql.Append("select count(0) cn from packagedetail left join package on pa_id=pd_paid where ");
                 sql.Append("pa_outboxcode='" + bigoutboxcode.Text + "'");
@@ -156,7 +160,6 @@ namespace UAS_MES.Make
                                     Printlab.PerformClick();
                                 }
                                 OperateResult.AppendText(">>大箱" + bigoutboxcode.Text + "已采集满\n", Color.Green);
-                                Packing_Click(new object(), new EventArgs());
                             }
                         }
                         else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
@@ -222,7 +225,7 @@ namespace UAS_MES.Make
             if (PrintLabel.Items.Count != 0)
             {
                 OperateResult.AppendText(">>打印箱号" + bigoutboxcode.Text + "\n", Color.Black);
-                Print.CodeSoft(Tag.ToString(),lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
             }
             else
                 OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);

+ 88 - 114
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.Designer.cs

@@ -51,6 +51,7 @@
             this.重量 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.称重时间 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.已称 = new System.Windows.Forms.Label();
+            this.autoprint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
             this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.weightsum = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pa_packageqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -64,7 +65,6 @@
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.autoprint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
             this.panel4.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
@@ -73,10 +73,9 @@
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(29, 18);
-            this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label15.Location = new System.Drawing.Point(22, 14);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(107, 39);
+            this.label15.Size = new System.Drawing.Size(86, 31);
             this.label15.TabIndex = 57;
             this.label15.Text = "大箱号";
             // 
@@ -86,10 +85,10 @@
             this.panel4.Controls.Add(this.pr_colorboxunit);
             this.panel4.Controls.Add(this.label22);
             this.panel4.Controls.Add(this.weight);
-            this.panel4.Location = new System.Drawing.Point(37, 85);
-            this.panel4.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.panel4.Location = new System.Drawing.Point(28, 68);
+            this.panel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(571, 98);
+            this.panel4.Size = new System.Drawing.Size(429, 79);
             this.panel4.TabIndex = 64;
             // 
             // pr_colorboxunit
@@ -98,10 +97,9 @@
             this.pr_colorboxunit.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             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(512, 35);
-            this.pr_colorboxunit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_colorboxunit.Location = new System.Drawing.Point(384, 28);
             this.pr_colorboxunit.Name = "pr_colorboxunit";
-            this.pr_colorboxunit.Size = new System.Drawing.Size(38, 31);
+            this.pr_colorboxunit.Size = new System.Drawing.Size(31, 25);
             this.pr_colorboxunit.TabIndex = 42;
             this.pr_colorboxunit.Text = "克";
             // 
@@ -111,10 +109,9 @@
             this.label22.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             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(17, 35);
-            this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label22.Location = new System.Drawing.Point(13, 28);
             this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(62, 31);
+            this.label22.Size = new System.Drawing.Size(50, 25);
             this.label22.TabIndex = 20;
             this.label22.Text = "重量";
             // 
@@ -123,20 +120,18 @@
             this.weight.AutoSize = true;
             this.weight.Font = new System.Drawing.Font("微软雅黑", 25.8F, 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(127, 22);
-            this.weight.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.weight.Location = new System.Drawing.Point(95, 18);
             this.weight.Name = "weight";
-            this.weight.Size = new System.Drawing.Size(0, 57);
+            this.weight.Size = new System.Drawing.Size(0, 46);
             this.weight.TabIndex = 41;
             // 
             // pa_makecode_label
             // 
             this.pa_makecode_label.AutoSize = true;
             this.pa_makecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_makecode_label.Location = new System.Drawing.Point(45, 208);
-            this.pa_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_makecode_label.Location = new System.Drawing.Point(34, 166);
             this.pa_makecode_label.Name = "pa_makecode_label";
-            this.pa_makecode_label.Size = new System.Drawing.Size(90, 32);
+            this.pa_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.pa_makecode_label.TabIndex = 73;
             this.pa_makecode_label.Text = "工单号";
             // 
@@ -144,10 +139,9 @@
             // 
             this.PA_TOTALQTY_label.AutoSize = true;
             this.PA_TOTALQTY_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PA_TOTALQTY_label.Location = new System.Drawing.Point(45, 282);
-            this.PA_TOTALQTY_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PA_TOTALQTY_label.Location = new System.Drawing.Point(34, 226);
             this.PA_TOTALQTY_label.Name = "PA_TOTALQTY_label";
-            this.PA_TOTALQTY_label.Size = new System.Drawing.Size(115, 32);
+            this.PA_TOTALQTY_label.Size = new System.Drawing.Size(92, 27);
             this.PA_TOTALQTY_label.TabIndex = 74;
             this.PA_TOTALQTY_label.Text = "箱内总数";
             // 
@@ -155,10 +149,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(45, 358);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(34, 286);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(115, 32);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 75;
             this.label2.Text = "产品编号";
             // 
@@ -166,10 +159,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(45, 424);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(34, 339);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(115, 32);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 76;
             this.pr_detail_label.Text = "名称规格";
             // 
@@ -177,10 +169,9 @@
             // 
             this.pa_salecode_label.AutoSize = true;
             this.pa_salecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode_label.Location = new System.Drawing.Point(324, 208);
-            this.pa_salecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_salecode_label.Location = new System.Drawing.Point(243, 166);
             this.pa_salecode_label.Name = "pa_salecode_label";
-            this.pa_salecode_label.Size = new System.Drawing.Size(115, 32);
+            this.pa_salecode_label.Size = new System.Drawing.Size(92, 27);
             this.pa_salecode_label.TabIndex = 77;
             this.pa_salecode_label.Text = "订单编号";
             // 
@@ -188,10 +179,9 @@
             // 
             this.PA_PACKAGEQTY_label.AutoSize = true;
             this.PA_PACKAGEQTY_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PA_PACKAGEQTY_label.Location = new System.Drawing.Point(324, 282);
-            this.PA_PACKAGEQTY_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PA_PACKAGEQTY_label.Location = new System.Drawing.Point(243, 226);
             this.PA_PACKAGEQTY_label.Name = "PA_PACKAGEQTY_label";
-            this.PA_PACKAGEQTY_label.Size = new System.Drawing.Size(115, 32);
+            this.PA_PACKAGEQTY_label.Size = new System.Drawing.Size(92, 27);
             this.PA_PACKAGEQTY_label.TabIndex = 78;
             this.PA_PACKAGEQTY_label.Text = "箱内件数";
             // 
@@ -199,10 +189,9 @@
             // 
             this.PrintLabel_label.AutoSize = true;
             this.PrintLabel_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintLabel_label.Location = new System.Drawing.Point(879, 68);
-            this.PrintLabel_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PrintLabel_label.Location = new System.Drawing.Point(659, 54);
             this.PrintLabel_label.Name = "PrintLabel_label";
-            this.PrintLabel_label.Size = new System.Drawing.Size(88, 25);
+            this.PrintLabel_label.Size = new System.Drawing.Size(69, 20);
             this.PrintLabel_label.TabIndex = 169;
             this.PrintLabel_label.Text = "打印标签";
             // 
@@ -210,10 +199,9 @@
             // 
             this.Printer_label.AutoSize = true;
             this.Printer_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Printer_label.Location = new System.Drawing.Point(879, 25);
-            this.Printer_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Printer_label.Location = new System.Drawing.Point(659, 20);
             this.Printer_label.Name = "Printer_label";
-            this.Printer_label.Size = new System.Drawing.Size(107, 25);
+            this.Printer_label.Size = new System.Drawing.Size(84, 20);
             this.Printer_label.TabIndex = 168;
             this.Printer_label.Text = "打印机列表";
             // 
@@ -221,18 +209,17 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1019, 68);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(764, 54);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(159, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(120, 20);
             this.PrintLabel.TabIndex = 166;
             // 
             // PrintNum
             // 
-            this.PrintNum.Location = new System.Drawing.Point(1019, 108);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrintNum.Location = new System.Drawing.Point(764, 86);
             this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Size = new System.Drawing.Size(159, 25);
+            this.PrintNum.Size = new System.Drawing.Size(119, 21);
             this.PrintNum.TabIndex = 174;
             this.PrintNum.Value = new decimal(new int[] {
             1,
@@ -244,10 +231,9 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(879, 108);
-            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Location = new System.Drawing.Point(659, 86);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(92, 27);
+            this.label6.Size = new System.Drawing.Size(74, 21);
             this.label6.TabIndex = 173;
             this.label6.Text = "打印张数";
             // 
@@ -258,10 +244,9 @@
             this.箱号,
             this.重量,
             this.称重时间});
-            this.showResult.Location = new System.Drawing.Point(641, 211);
-            this.showResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.showResult.Location = new System.Drawing.Point(481, 169);
             this.showResult.Name = "showResult";
-            this.showResult.Size = new System.Drawing.Size(537, 466);
+            this.showResult.Size = new System.Drawing.Size(404, 374);
             this.showResult.TabIndex = 188;
             this.showResult.UseCompatibleStateImageBehavior = false;
             this.showResult.View = System.Windows.Forms.View.Details;
@@ -290,24 +275,32 @@
             // 
             this.已称.AutoSize = true;
             this.已称.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.已称.Location = new System.Drawing.Point(640, 159);
-            this.已称.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.已称.Location = new System.Drawing.Point(480, 127);
             this.已称.Name = "已称";
-            this.已称.Size = new System.Drawing.Size(72, 27);
+            this.已称.Size = new System.Drawing.Size(58, 21);
             this.已称.TabIndex = 184;
             this.已称.Text = "已打印";
             // 
+            // autoprint
+            // 
+            this.autoprint.Checked = false;
+            this.autoprint.Location = new System.Drawing.Point(663, 122);
+            this.autoprint.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.autoprint.Name = "autoprint";
+            this.autoprint.Size = new System.Drawing.Size(94, 27);
+            this.autoprint.TabIndex = 189;
+            // 
             // BaudRate
             // 
             this.BaudRate.AllPower = null;
             this.BaudRate.BackColor = System.Drawing.Color.White;
             this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(709, 99);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.BaudRate.Location = new System.Drawing.Point(532, 79);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.BaudRate.Name = "BaudRate";
             this.BaudRate.Negative = false;
             this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(159, 25);
+            this.BaudRate.Size = new System.Drawing.Size(120, 21);
             this.BaudRate.Str = null;
             this.BaudRate.Str1 = null;
             this.BaudRate.Str2 = null;
@@ -319,11 +312,10 @@
             this.weightsum.AutoSize = true;
             this.weightsum.CutLength = null;
             this.weightsum.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.weightsum.Location = new System.Drawing.Point(720, 154);
-            this.weightsum.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.weightsum.MaximumSize = new System.Drawing.Size(200, 0);
+            this.weightsum.Location = new System.Drawing.Point(540, 123);
+            this.weightsum.MaximumSize = new System.Drawing.Size(150, 0);
             this.weightsum.Name = "weightsum";
-            this.weightsum.Size = new System.Drawing.Size(0, 32);
+            this.weightsum.Size = new System.Drawing.Size(0, 27);
             this.weightsum.TabIndex = 185;
             this.weightsum.Tag = "1";
             // 
@@ -332,11 +324,10 @@
             this.pa_packageqty.AutoSize = true;
             this.pa_packageqty.CutLength = null;
             this.pa_packageqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_packageqty.Location = new System.Drawing.Point(457, 282);
-            this.pa_packageqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_packageqty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_packageqty.Location = new System.Drawing.Point(343, 226);
+            this.pa_packageqty.MaximumSize = new System.Drawing.Size(150, 0);
             this.pa_packageqty.Name = "pa_packageqty";
-            this.pa_packageqty.Size = new System.Drawing.Size(0, 32);
+            this.pa_packageqty.Size = new System.Drawing.Size(0, 27);
             this.pa_packageqty.TabIndex = 183;
             this.pa_packageqty.Tag = "1";
             // 
@@ -345,11 +336,10 @@
             this.pa_salecode.AutoSize = true;
             this.pa_salecode.CutLength = null;
             this.pa_salecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode.Location = new System.Drawing.Point(457, 208);
-            this.pa_salecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_salecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_salecode.Location = new System.Drawing.Point(343, 166);
+            this.pa_salecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.pa_salecode.Name = "pa_salecode";
-            this.pa_salecode.Size = new System.Drawing.Size(0, 32);
+            this.pa_salecode.Size = new System.Drawing.Size(0, 27);
             this.pa_salecode.TabIndex = 182;
             this.pa_salecode.Tag = "1";
             // 
@@ -358,11 +348,10 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(168, 425);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_detail.Location = new System.Drawing.Point(126, 340);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 32);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 181;
             this.pr_detail.Tag = "1";
             // 
@@ -371,11 +360,10 @@
             this.pa_prodcode.AutoSize = true;
             this.pa_prodcode.CutLength = null;
             this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_prodcode.Location = new System.Drawing.Point(168, 358);
-            this.pa_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_prodcode.Location = new System.Drawing.Point(126, 286);
+            this.pa_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
             this.pa_prodcode.Name = "pa_prodcode";
-            this.pa_prodcode.Size = new System.Drawing.Size(0, 32);
+            this.pa_prodcode.Size = new System.Drawing.Size(0, 27);
             this.pa_prodcode.TabIndex = 180;
             this.pa_prodcode.Tag = "1";
             this.pa_prodcode.TextChanged += new System.EventHandler(this.pa_prodcode_TextChanged);
@@ -385,11 +373,10 @@
             this.pa_totalqty.AutoSize = true;
             this.pa_totalqty.CutLength = null;
             this.pa_totalqty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty.Location = new System.Drawing.Point(168, 286);
-            this.pa_totalqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_totalqty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_totalqty.Location = new System.Drawing.Point(126, 226);
+            this.pa_totalqty.MaximumSize = new System.Drawing.Size(150, 0);
             this.pa_totalqty.Name = "pa_totalqty";
-            this.pa_totalqty.Size = new System.Drawing.Size(0, 32);
+            this.pa_totalqty.Size = new System.Drawing.Size(0, 27);
             this.pa_totalqty.TabIndex = 179;
             this.pa_totalqty.Tag = "1";
             // 
@@ -398,11 +385,10 @@
             this.pa_makecode.AutoSize = true;
             this.pa_makecode.CutLength = null;
             this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_makecode.Location = new System.Drawing.Point(165, 211);
-            this.pa_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_makecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_makecode.Location = new System.Drawing.Point(126, 166);
+            this.pa_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.pa_makecode.Name = "pa_makecode";
-            this.pa_makecode.Size = new System.Drawing.Size(0, 32);
+            this.pa_makecode.Size = new System.Drawing.Size(0, 27);
             this.pa_makecode.TabIndex = 178;
             this.pa_makecode.Tag = "1";
             // 
@@ -413,13 +399,12 @@
             this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
             this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
             this.StartWeight.IsShowBorder = true;
-            this.StartWeight.Location = new System.Drawing.Point(641, 18);
-            this.StartWeight.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.StartWeight.Location = new System.Drawing.Point(481, 14);
             this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
             this.StartWeight.Name = "StartWeight";
             this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
             this.StartWeight.Power = null;
-            this.StartWeight.Size = new System.Drawing.Size(100, 30);
+            this.StartWeight.Size = new System.Drawing.Size(75, 24);
             this.StartWeight.TabIndex = 177;
             this.StartWeight.Text = "开始称量";
             this.StartWeight.UseVisualStyleBackColor = true;
@@ -432,13 +417,12 @@
             this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
             this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
             this.StopWeight.IsShowBorder = true;
-            this.StopWeight.Location = new System.Drawing.Point(768, 18);
-            this.StopWeight.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.StopWeight.Location = new System.Drawing.Point(576, 14);
             this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
             this.StopWeight.Name = "StopWeight";
             this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
             this.StopWeight.Power = null;
-            this.StopWeight.Size = new System.Drawing.Size(100, 30);
+            this.StopWeight.Size = new System.Drawing.Size(75, 24);
             this.StopWeight.TabIndex = 176;
             this.StopWeight.Text = "停止称量";
             this.StopWeight.UseVisualStyleBackColor = true;
@@ -447,19 +431,18 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(37, 472);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(28, 378);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(573, 204);
+            this.OperateResult.Size = new System.Drawing.Size(431, 164);
             this.OperateResult.TabIndex = 171;
             this.OperateResult.Text = "";
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1019, 25);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Printer.Location = new System.Drawing.Point(764, 20);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(159, 25);
+            this.Printer.Size = new System.Drawing.Size(119, 20);
             this.Printer.TabIndex = 167;
             // 
             // pa_outboxcode
@@ -468,30 +451,22 @@
             this.pa_outboxcode.BackColor = System.Drawing.Color.White;
             this.pa_outboxcode.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pa_outboxcode.ID = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(176, 18);
-            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.pa_outboxcode.Location = new System.Drawing.Point(132, 14);
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Power = "ifwrite";
-            this.pa_outboxcode.Size = new System.Drawing.Size(432, 47);
+            this.pa_outboxcode.Size = new System.Drawing.Size(325, 39);
             this.pa_outboxcode.Str = null;
             this.pa_outboxcode.Str1 = null;
             this.pa_outboxcode.Str2 = null;
             this.pa_outboxcode.TabIndex = 58;
             this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_outboxcode_KeyDown);
             // 
-            // autoprint
-            // 
-            this.autoprint.Checked = false;
-            this.autoprint.Location = new System.Drawing.Point(884, 152);
-            this.autoprint.Name = "autoprint";
-            this.autoprint.Size = new System.Drawing.Size(125, 34);
-            this.autoprint.TabIndex = 189;
-            // 
             // Make_BigBoxWeight
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1213, 690);
+            this.ClientSize = new System.Drawing.Size(910, 552);
             this.Controls.Add(this.autoprint);
             this.Controls.Add(this.showResult);
             this.Controls.Add(this.BaudRate);
@@ -522,17 +497,16 @@
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.label15);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Make_BigBoxWeight";
             this.Tag = "Make!BigBoxWeigh";
             this.Text = "大箱称重";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_BigBoxWeight_FormClosing);
             this.Load += new System.EventHandler(this.Make_BigBoxWeight_Load);
             this.SizeChanged += new System.EventHandler(this.Make_BigBoxWeight_SizeChanged);
-            this.panel4.ResumeLayout(true);
+            this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 12 - 10
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -88,7 +88,8 @@ namespace UAS_MES.Make
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl(lbl);
             }
-            catch {
+            catch
+            {
                 OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
             }
         }
@@ -140,12 +141,12 @@ namespace UAS_MES.Make
                     OperateResult.AppendText("<<<更新成功\n", Color.Green);
                     //刷新grid的历史称重信息;
                     recordResult(pa_outboxcode.Text, weight.Text, System.DateTime.Now.ToString());
-                    LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,pa_makecode.Text,User.UserLineCode,User.UserSourceCode,"大箱称重","称重成功","","");
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱称重", "称重成功", "", "");
                     if (autoprint.Checked == true)
                     {
                         try
                         {
-                            Print.CodeSoft(Tag.ToString(),lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                            Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                             dh.ExecuteSql("update package set pa_printcount= pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                             printcount++;
                             weightsum.Text = printcount + "";
@@ -153,15 +154,15 @@ namespace UAS_MES.Make
                             pa_outboxcode.Text = "";
                             pa_outboxcode.Focus();
                         }
-                        catch(Exception eb)
+                        catch (Exception eb)
                         {
                             if (PrintLabel.SelectedValue == null)
                             {
-                                OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护大箱标签模板\n", Color.Red);
-                                pa_outboxcode.Text = "";
+                                OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护大箱标签模板\n", Color.Red, pa_outboxcode);
                                 pa_outboxcode.Focus();
-                            }else
-                            OperateResult.AppendText("<<<打印失败:"+eb.Message+"\n", Color.Red);
+                            }
+                            else
+                                OperateResult.AppendText("<<<打印失败:" + eb.Message + "\n", Color.Red);
                         }
                     }
                     else
@@ -169,8 +170,9 @@ namespace UAS_MES.Make
                         OperateResult.AppendText("<<<需打印请勾选自动打印\n", Color.Red);
                     }
                 }
-                else {
-                       OperateResult.AppendText("<<<大箱重量应大于0\n", Color.Red);
+                else
+                {
+                    OperateResult.AppendText("<<<大箱重量应大于0\n", Color.Red);
                 }
             }
         }

+ 88 - 121
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs

@@ -78,10 +78,9 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(41, 302);
-            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Location = new System.Drawing.Point(31, 242);
             this.ma_code_label.Name = "ma_code_label";
-            this.ma_code_label.Size = new System.Drawing.Size(115, 32);
+            this.ma_code_label.Size = new System.Drawing.Size(92, 27);
             this.ma_code_label.TabIndex = 97;
             this.ma_code_label.Text = "制造单号";
             // 
@@ -92,10 +91,9 @@
             this.panel6.Controls.Add(this.pr_code);
             this.panel6.Controls.Add(this.pr_cartongw_label);
             this.panel6.Controls.Add(this.pr_code_label);
-            this.panel6.Location = new System.Drawing.Point(563, 95);
-            this.panel6.Margin = new System.Windows.Forms.Padding(4);
+            this.panel6.Location = new System.Drawing.Point(422, 76);
             this.panel6.Name = "panel6";
-            this.panel6.Size = new System.Drawing.Size(537, 156);
+            this.panel6.Size = new System.Drawing.Size(403, 125);
             this.panel6.TabIndex = 90;
             // 
             // pr_cartongw
@@ -103,11 +101,10 @@
             this.pr_cartongw.AutoSize = true;
             this.pr_cartongw.CutLength = null;
             this.pr_cartongw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartongw.Location = new System.Drawing.Point(205, 91);
-            this.pr_cartongw.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_cartongw.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_cartongw.Location = new System.Drawing.Point(154, 73);
+            this.pr_cartongw.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_cartongw.Name = "pr_cartongw";
-            this.pr_cartongw.Size = new System.Drawing.Size(0, 32);
+            this.pr_cartongw.Size = new System.Drawing.Size(0, 27);
             this.pr_cartongw.TabIndex = 80;
             this.pr_cartongw.Tag = "1";
             // 
@@ -116,11 +113,10 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(205, 28);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Location = new System.Drawing.Point(154, 22);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 32);
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
             this.pr_code.TabIndex = 79;
             this.pr_code.Tag = "1";
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
@@ -129,10 +125,9 @@
             // 
             this.pr_cartongw_label.AutoSize = true;
             this.pr_cartongw_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartongw_label.Location = new System.Drawing.Point(37, 91);
-            this.pr_cartongw_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartongw_label.Location = new System.Drawing.Point(28, 73);
             this.pr_cartongw_label.Name = "pr_cartongw_label";
-            this.pr_cartongw_label.Size = new System.Drawing.Size(115, 32);
+            this.pr_cartongw_label.Size = new System.Drawing.Size(92, 27);
             this.pr_cartongw_label.TabIndex = 42;
             this.pr_cartongw_label.Text = "标准重量";
             // 
@@ -140,10 +135,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(36, 28);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(27, 22);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(115, 32);
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
             this.pr_code_label.TabIndex = 40;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -153,10 +147,9 @@
             this.panel4.Controls.Add(this.pr_cartonunit);
             this.panel4.Controls.Add(this.label22);
             this.panel4.Controls.Add(this.weight);
-            this.panel4.Location = new System.Drawing.Point(33, 95);
-            this.panel4.Margin = new System.Windows.Forms.Padding(4);
+            this.panel4.Location = new System.Drawing.Point(25, 76);
             this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(495, 156);
+            this.panel4.Size = new System.Drawing.Size(372, 125);
             this.panel4.TabIndex = 91;
             // 
             // pr_cartonunit
@@ -165,10 +158,9 @@
             this.pr_cartonunit.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pr_cartonunit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.pr_cartonunit.Location = new System.Drawing.Point(409, 64);
-            this.pr_cartonunit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartonunit.Location = new System.Drawing.Point(307, 51);
             this.pr_cartonunit.Name = "pr_cartonunit";
-            this.pr_cartonunit.Size = new System.Drawing.Size(38, 31);
+            this.pr_cartonunit.Size = new System.Drawing.Size(31, 25);
             this.pr_cartonunit.TabIndex = 42;
             this.pr_cartonunit.Text = "克";
             // 
@@ -178,10 +170,9 @@
             this.label22.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             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(20, 64);
-            this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label22.Location = new System.Drawing.Point(15, 51);
             this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(62, 31);
+            this.label22.Size = new System.Drawing.Size(50, 25);
             this.label22.TabIndex = 20;
             this.label22.Text = "重量";
             // 
@@ -193,20 +184,18 @@
             this.weight.AutoSize = true;
             this.weight.Font = new System.Drawing.Font("微软雅黑", 22.2F, 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(139, 54);
-            this.weight.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.weight.Location = new System.Drawing.Point(104, 43);
             this.weight.Name = "weight";
-            this.weight.Size = new System.Drawing.Size(0, 50);
+            this.weight.Size = new System.Drawing.Size(0, 39);
             this.weight.TabIndex = 41;
             // 
             // label15
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(35, 30);
-            this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label15.Location = new System.Drawing.Point(26, 24);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(77, 39);
+            this.label15.Size = new System.Drawing.Size(62, 31);
             this.label15.TabIndex = 85;
             this.label15.Text = "箱号";
             // 
@@ -214,10 +203,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(41, 502);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(31, 402);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(115, 32);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 82;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -225,10 +213,9 @@
             // 
             this.ma_qty_label.AutoSize = true;
             this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(41, 606);
-            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_qty_label.Location = new System.Drawing.Point(31, 485);
             this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(115, 32);
+            this.ma_qty_label.Size = new System.Drawing.Size(92, 27);
             this.ma_qty_label.TabIndex = 84;
             this.ma_qty_label.Text = "工单数量";
             // 
@@ -236,10 +223,9 @@
             // 
             this.ma_salecode_label.AutoSize = true;
             this.ma_salecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode_label.Location = new System.Drawing.Point(41, 401);
-            this.ma_salecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_salecode_label.Location = new System.Drawing.Point(31, 321);
             this.ma_salecode_label.Name = "ma_salecode_label";
-            this.ma_salecode_label.Size = new System.Drawing.Size(115, 32);
+            this.ma_salecode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_salecode_label.TabIndex = 83;
             this.ma_salecode_label.Text = "订单编号";
             // 
@@ -247,20 +233,18 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1248, 181);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintLabel.Location = new System.Drawing.Point(936, 145);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(160, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(121, 20);
             this.PrintLabel.TabIndex = 157;
             // 
             // Printer_label
             // 
             this.Printer_label.AutoSize = true;
             this.Printer_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Printer_label.Location = new System.Drawing.Point(1119, 139);
-            this.Printer_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Printer_label.Location = new System.Drawing.Point(839, 111);
             this.Printer_label.Name = "Printer_label";
-            this.Printer_label.Size = new System.Drawing.Size(107, 25);
+            this.Printer_label.Size = new System.Drawing.Size(84, 20);
             this.Printer_label.TabIndex = 159;
             this.Printer_label.Text = "打印机列表";
             // 
@@ -268,19 +252,17 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1119, 181);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(839, 145);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(88, 25);
+            this.label1.Size = new System.Drawing.Size(69, 20);
             this.label1.TabIndex = 161;
             this.label1.Text = "打印标签";
             // 
             // PrintNum
             // 
-            this.PrintNum.Location = new System.Drawing.Point(1249, 95);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Location = new System.Drawing.Point(937, 76);
             this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Size = new System.Drawing.Size(160, 25);
+            this.PrintNum.Size = new System.Drawing.Size(120, 21);
             this.PrintNum.TabIndex = 170;
             this.PrintNum.Value = new decimal(new int[] {
             1,
@@ -292,10 +274,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(1119, 96);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(839, 77);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(88, 25);
+            this.label2.Size = new System.Drawing.Size(69, 20);
             this.label2.TabIndex = 171;
             this.label2.Text = "打印张数";
             // 
@@ -303,11 +284,10 @@
             // 
             this.ComList.AutoSize = true;
             this.ComList.CutLength = null;
-            this.ComList.Location = new System.Drawing.Point(1249, 69);
-            this.ComList.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ComList.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ComList.Location = new System.Drawing.Point(937, 55);
+            this.ComList.MaximumSize = new System.Drawing.Size(150, 0);
             this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(63, 15);
+            this.ComList.Size = new System.Drawing.Size(47, 12);
             this.ComList.TabIndex = 173;
             this.ComList.Text = "ComList";
             this.ComList.Visible = false;
@@ -316,21 +296,20 @@
             // 
             this.BaudRate.AutoSize = true;
             this.BaudRate.CutLength = null;
-            this.BaudRate.Location = new System.Drawing.Point(1249, 49);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.BaudRate.MaximumSize = new System.Drawing.Size(200, 0);
+            this.BaudRate.Location = new System.Drawing.Point(937, 39);
+            this.BaudRate.MaximumSize = new System.Drawing.Size(150, 0);
             this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Size = new System.Drawing.Size(71, 15);
+            this.BaudRate.Size = new System.Drawing.Size(53, 12);
             this.BaudRate.TabIndex = 172;
             this.BaudRate.Text = "BaudRate";
             this.BaudRate.Visible = false;
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(1248, 139);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(5);
+            this.PrinterList.Location = new System.Drawing.Point(936, 111);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(160, 28);
+            this.PrinterList.Size = new System.Drawing.Size(120, 22);
             this.PrinterList.TabIndex = 158;
             // 
             // StartWeight
@@ -340,13 +319,12 @@
             this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
             this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
             this.StartWeight.IsShowBorder = true;
-            this.StartWeight.Location = new System.Drawing.Point(877, 31);
-            this.StartWeight.Margin = new System.Windows.Forms.Padding(4);
+            this.StartWeight.Location = new System.Drawing.Point(658, 25);
             this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
             this.StartWeight.Name = "StartWeight";
             this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
             this.StartWeight.Power = null;
-            this.StartWeight.Size = new System.Drawing.Size(100, 30);
+            this.StartWeight.Size = new System.Drawing.Size(75, 24);
             this.StartWeight.TabIndex = 156;
             this.StartWeight.Text = "开始称量";
             this.StartWeight.UseVisualStyleBackColor = true;
@@ -359,13 +337,12 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(1225, 222);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
+            this.Confirm.Location = new System.Drawing.Point(919, 178);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(100, 29);
+            this.Confirm.Size = new System.Drawing.Size(75, 23);
             this.Confirm.TabIndex = 152;
             this.Confirm.Text = "打印";
             this.Confirm.UseVisualStyleBackColor = true;
@@ -375,11 +352,10 @@
             // 
             this.pd_barcode.AutoSize = true;
             this.pd_barcode.CutLength = null;
-            this.pd_barcode.Location = new System.Drawing.Point(1249, 26);
-            this.pd_barcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pd_barcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pd_barcode.Location = new System.Drawing.Point(937, 21);
+            this.pd_barcode.MaximumSize = new System.Drawing.Size(150, 0);
             this.pd_barcode.Name = "pd_barcode";
-            this.pd_barcode.Size = new System.Drawing.Size(87, 15);
+            this.pd_barcode.Size = new System.Drawing.Size(65, 12);
             this.pd_barcode.TabIndex = 107;
             this.pd_barcode.Text = "pd_barcode";
             this.pd_barcode.Visible = false;
@@ -391,13 +367,12 @@
             this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
             this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
             this.StopWeight.IsShowBorder = true;
-            this.StopWeight.Location = new System.Drawing.Point(1004, 31);
-            this.StopWeight.Margin = new System.Windows.Forms.Padding(4);
+            this.StopWeight.Location = new System.Drawing.Point(753, 25);
             this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
             this.StopWeight.Name = "StopWeight";
             this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
             this.StopWeight.Power = null;
-            this.StopWeight.Size = new System.Drawing.Size(100, 30);
+            this.StopWeight.Size = new System.Drawing.Size(75, 24);
             this.StopWeight.TabIndex = 102;
             this.StopWeight.Text = "停止称量";
             this.StopWeight.UseVisualStyleBackColor = true;
@@ -408,11 +383,10 @@
             this.ma_code.AutoSize = true;
             this.ma_code.CutLength = null;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(188, 302);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ma_code.Location = new System.Drawing.Point(141, 242);
+            this.ma_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 32);
+            this.ma_code.Size = new System.Drawing.Size(0, 27);
             this.ma_code.TabIndex = 101;
             this.ma_code.Tag = "1";
             // 
@@ -421,11 +395,10 @@
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(188, 606);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ma_qty.Location = new System.Drawing.Point(141, 485);
+            this.ma_qty.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 32);
+            this.ma_qty.Size = new System.Drawing.Size(0, 27);
             this.ma_qty.TabIndex = 100;
             // 
             // pr_detail
@@ -433,11 +406,10 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(188, 503);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_detail.Location = new System.Drawing.Point(141, 402);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 32);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 99;
             // 
             // ma_salecode
@@ -445,11 +417,10 @@
             this.ma_salecode.AutoSize = true;
             this.ma_salecode.CutLength = null;
             this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode.Location = new System.Drawing.Point(188, 401);
-            this.ma_salecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_salecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ma_salecode.Location = new System.Drawing.Point(141, 321);
+            this.ma_salecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_salecode.Name = "ma_salecode";
-            this.ma_salecode.Size = new System.Drawing.Size(0, 32);
+            this.ma_salecode.Size = new System.Drawing.Size(0, 27);
             this.ma_salecode.TabIndex = 98;
             // 
             // Clean
@@ -459,13 +430,12 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1236, 661);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.Location = new System.Drawing.Point(927, 529);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(100, 30);
+            this.Clean.Size = new System.Drawing.Size(75, 24);
             this.Clean.TabIndex = 89;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -477,8 +447,7 @@
             this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
             this.normalButton1.Image = ((System.Drawing.Image)(resources.GetObject("normalButton1.Image")));
             this.normalButton1.IsShowBorder = true;
-            this.normalButton1.Location = new System.Drawing.Point(33, 69);
-            this.normalButton1.Margin = new System.Windows.Forms.Padding(4);
+            this.normalButton1.Location = new System.Drawing.Point(25, 55);
             this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
             this.normalButton1.Name = "normalButton1";
             this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
@@ -494,11 +463,10 @@
             this.outboxcode.BackColor = System.Drawing.Color.White;
             this.outboxcode.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.outboxcode.ID = null;
-            this.outboxcode.Location = new System.Drawing.Point(125, 26);
-            this.outboxcode.Margin = new System.Windows.Forms.Padding(4);
+            this.outboxcode.Location = new System.Drawing.Point(94, 21);
             this.outboxcode.Name = "outboxcode";
             this.outboxcode.Power = null;
-            this.outboxcode.Size = new System.Drawing.Size(721, 47);
+            this.outboxcode.Size = new System.Drawing.Size(542, 39);
             this.outboxcode.Str = null;
             this.outboxcode.Str1 = null;
             this.outboxcode.Str2 = null;
@@ -508,10 +476,9 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(1124, 267);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(843, 214);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(297, 376);
+            this.OperateResult.Size = new System.Drawing.Size(224, 302);
             this.OperateResult.TabIndex = 87;
             this.OperateResult.Text = "";
             // 
@@ -523,10 +490,10 @@
             this.columnHeader3,
             this.columnHeader4});
             this.WeighRecord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeighRecord.Location = new System.Drawing.Point(563, 267);
-            this.WeighRecord.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.WeighRecord.Location = new System.Drawing.Point(422, 214);
+            this.WeighRecord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.WeighRecord.Name = "WeighRecord";
-            this.WeighRecord.Size = new System.Drawing.Size(537, 376);
+            this.WeighRecord.Size = new System.Drawing.Size(404, 302);
             this.WeighRecord.TabIndex = 174;
             this.WeighRecord.UseCompatibleStateImageBehavior = false;
             this.WeighRecord.View = System.Windows.Forms.View.Details;
@@ -554,16 +521,17 @@
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(1124, 49);
+            this.AutoPrint.Location = new System.Drawing.Point(843, 39);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(118, 35);
+            this.AutoPrint.Size = new System.Drawing.Size(88, 28);
             this.AutoPrint.TabIndex = 175;
             // 
             // Make_CartonBoxWeigh
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1429, 700);
+            this.ClientSize = new System.Drawing.Size(1072, 560);
             this.Controls.Add(this.AutoPrint);
             this.Controls.Add(this.WeighRecord);
             this.Controls.Add(this.ComList);
@@ -594,19 +562,18 @@
             this.Controls.Add(this.ma_salecode_label);
             this.Controls.Add(this.OperateResult);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_CartonBoxWeigh";
             this.Tag = "Make!CartonBoxWeigh";
             this.Text = "卡通箱称重";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.卡通箱称重_FormClosing);
             this.Load += new System.EventHandler(this.卡通箱称重_Load);
             this.SizeChanged += new System.EventHandler(this.卡通箱称重_SizeChanged);
-            this.panel6.ResumeLayout(true);
+            this.panel6.ResumeLayout(false);
             this.panel6.PerformLayout();
-            this.panel4.ResumeLayout(true);
+            this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 50 - 32
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs

@@ -50,9 +50,10 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(448, 7);
+            this.pr_detail_label.Location = new System.Drawing.Point(612, 23);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 206;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -62,9 +63,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(25, 414);
+            this.sncode_label.Location = new System.Drawing.Point(33, 518);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.sncode_label.Size = new System.Drawing.Size(72, 27);
             this.sncode_label.TabIndex = 205;
             this.sncode_label.Text = "录入框";
             // 
@@ -72,9 +74,10 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(218, 56);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(305, 72);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
             this.mcd_remainqty_label.TabIndex = 202;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -82,9 +85,10 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(7, 56);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(36, 72);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
             this.mcd_okqty_label.TabIndex = 201;
             this.mcd_okqty_label.Text = "采集计数";
             // 
@@ -92,9 +96,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(218, 7);
+            this.pr_code_label.Location = new System.Drawing.Point(305, 23);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
             this.pr_code_label.TabIndex = 200;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -102,9 +107,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(7, 7);
+            this.ms_makecode_label.Location = new System.Drawing.Point(36, 23);
+            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(74, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
             this.ms_makecode_label.TabIndex = 199;
             this.ms_makecode_label.Text = "工单编号";
             // 
@@ -115,12 +121,13 @@
             this.DeleteButton.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.DownImage")));
             this.DeleteButton.Image = null;
             this.DeleteButton.IsShowBorder = true;
-            this.DeleteButton.Location = new System.Drawing.Point(399, 408);
+            this.DeleteButton.Location = new System.Drawing.Point(397, 518);
+            this.DeleteButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.DeleteButton.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.MoveImage")));
             this.DeleteButton.Name = "DeleteButton";
             this.DeleteButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.NormalImage")));
             this.DeleteButton.Power = null;
-            this.DeleteButton.Size = new System.Drawing.Size(75, 28);
+            this.DeleteButton.Size = new System.Drawing.Size(80, 30);
             this.DeleteButton.TabIndex = 213;
             this.DeleteButton.Text = "取消";
             this.DeleteButton.UseVisualStyleBackColor = false;
@@ -129,20 +136,22 @@
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
+            this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(92, 7);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_makecode.Location = new System.Drawing.Point(143, 23);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(267, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 212;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(302, 56);
+            this.mcd_remainqty.Location = new System.Drawing.Point(417, 72);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
+            this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
             this.mcd_remainqty.TabIndex = 210;
             this.mcd_remainqty.Text = "0";
             // 
@@ -150,28 +159,35 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(91, 56);
+            this.mcd_okqty.Location = new System.Drawing.Point(143, 72);
+            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
+            this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
             this.mcd_okqty.TabIndex = 209;
             this.mcd_okqty.Text = "0";
             // 
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(302, 10);
+            this.ma_prodcode.Location = new System.Drawing.Point(417, 27);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(267, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
             this.ma_prodcode.TabIndex = 208;
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
+            this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(533, 7);
+            this.pr_detail.Location = new System.Drawing.Point(725, 23);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(267, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 207;
             // 
             // sncode
@@ -181,10 +197,11 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(107, 415);
+            this.sncode.Location = new System.Drawing.Point(117, 520);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(196, 21);
+            this.sncode.Size = new System.Drawing.Size(260, 25);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -196,17 +213,18 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(10, 89);
+            this.OperateResult.Location = new System.Drawing.Point(16, 121);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(706, 305);
+            this.OperateResult.Size = new System.Drawing.Size(940, 380);
             this.OperateResult.TabIndex = 203;
             this.OperateResult.Text = "";
             // 
             // Make_CollectBTMAC
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(740, 448);
+            this.ClientSize = new System.Drawing.Size(987, 560);
             this.Controls.Add(this.DeleteButton);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.mcd_remainqty);
@@ -222,7 +240,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             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_CollectBTMAC";
             this.Tag = "Make!CollectBTMAC";
             this.Text = "BT/MAC采集";

+ 17 - 30
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -107,7 +107,7 @@ namespace UAS_MES.Make
                                 {
                                     BaseUtil.SetFormValue(this.Controls, dt);
                                     dh.UpdateByCondition("makeserial", "ms_currentstepcode = '" + User.CurrentStepCode + "'", "ms_id = '" + oMsID + "'");
-                                    OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                                    OperateResult.AppendText(">>请输入BT\n", Color.Black);
                                     sn_code = sncode.Text;
                                     sncode.Text = "";
                                     isBT = true;
@@ -115,20 +115,17 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    sncode.Text = "";
-                                    OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                                    OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red, sncode);
                                 }
                             }
                             else
                             {
-                                sncode.Text = "";
-                                OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                                OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
                             }
                         }
                         else
                         {
-                            sncode.Text = "";
-                            OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                            OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
                         }
                     }
                     else
@@ -157,8 +154,7 @@ namespace UAS_MES.Make
                             }
                             if (!isbt)
                             {
-                                OperateResult.AppendText(">>BT号不符合工单导入要求\n", Color.Red);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>BT号不符合工单导入要求\n", Color.Red, sncode);
                                 return;
                             }
                         }
@@ -173,8 +169,7 @@ namespace UAS_MES.Make
                             {
                                 if (!(dt.Rows[0]["sr_startcode"].ToString().CompareTo(sncode.Text) <= 0 && dt.Rows[0]["sr_endcode"].ToString().CompareTo(sncode.Text) >= 0))
                                 {
-                                    OperateResult.AppendText(">>BT号不符合销售单合同范围\n", Color.Red);
-                                    sncode.Text = "";
+                                    OperateResult.AppendText(">>BT号不符合销售单合同范围\n", Color.Red, sncode);
                                     return;
                                 }
                             }
@@ -183,19 +178,16 @@ namespace UAS_MES.Make
                         ms_bt = dh.getFieldDataByCondition("makeserial", "ms_bt", "ms_id = '" + oMsID + "'").ToString();
                         if (sncode.Text == ms_bt)
                         {
-                            sncode.Text = "";
-                            OperateResult.AppendText(">>BT错误,重复\n", Color.Red);
-                            OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                            OperateResult.AppendText(">>BT错误,重复\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>请输入BT\n", Color.Black);
                             return;
                         }
                         else
                         {
                             ms_bt = sncode.Text;
-                            ErrorMessage = "BT采集完成>>>请输入MAC";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            OperateResult.AppendText(">>BT采集完成\n>>请输入MAC\n", Color.Green, sncode);
                             isBT = false;
                             isMAC = true;
-                            sncode.Text = "";
                             sncode.Focus();
                             return;
                         }
@@ -227,8 +219,7 @@ namespace UAS_MES.Make
                         }
                         if (!ismac)
                         {
-                            OperateResult.AppendText(">>MAC号不符合工单导入要求\n", Color.Red);
-                            sncode.Text = "";
+                            OperateResult.AppendText(">>MAC号不符合工单导入要求\n", Color.Red, sncode);
                             return;
                         }
                     }
@@ -243,8 +234,7 @@ namespace UAS_MES.Make
                         {
                             if (!(dt.Rows[0]["sr_startcode"].ToString().CompareTo(sncode.Text) <= 0 && dt.Rows[0]["sr_endcode"].ToString().CompareTo(sncode.Text) >= 0))
                             {
-                                OperateResult.AppendText(">>MAC号不符合销售单合同范围\n", Color.Red);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>MAC号不符合销售单合同范围\n", Color.Red, sncode);
                                 return;
                             }
                         }
@@ -253,19 +243,17 @@ namespace UAS_MES.Make
                     ms_mac = dh.getFieldDataByCondition("makeserial", "ms_mac", "ms_id = '" + oMsID + "'").ToString();
                     if (sncode.Text == ms_mac)
                     {
-                        sncode.Text = "";
-                        OperateResult.AppendText(">>MAC错误,重复\n", Color.Red);
-                        OperateResult.AppendText(">>请输入MAC\n", Color.Green);
+                        OperateResult.AppendText(">>MAC错误,重复\n", Color.Red, sncode);
+                        OperateResult.AppendText(">>请输入MAC\n", Color.Black);
                         return;
                     }
                     else
                     {
-                        if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code,"BT/MAC采集", "BT/MAC采集完成",User.UserCode,out ErrorMessage))   
+                        if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code, "BT/MAC采集", "BT/MAC采集完成", User.UserCode, out ErrorMessage))
                         {
                             dh.UpdateByCondition("makeserial", "ms_mac = '" + sncode.Text + "' ," + "ms_bt = '" + ms_bt + "'", "ms_id = '" + oMsID + "'");
-                            ErrorMessage = "BT/MAC采集完成,执行更新";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ms_makecode.Text,User.UserLineCode,User.UserSourceCode,"BT/MAC采集","采集成功", sn_code,"");
+                            OperateResult.AppendText(">>BT/MAC采集完成,执行更新\n", Color.Green);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "BT/MAC采集", "采集成功", sn_code, "");
                             sql.Clear();
                             sql.Append("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                             sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
@@ -282,8 +270,7 @@ namespace UAS_MES.Make
                             OperateResult.AppendText(">>采集错误" + ErrorMessage + "\n", Color.Red);
                             return;
                         }
-                        ErrorMessage = ">>>请输入SN";
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
                     }
                 }
             }

+ 5 - 7
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -80,9 +80,9 @@ namespace UAS_MES.Make
                             }
                             else OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red, sncode);
                         }
-                        else  OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red, sncode);
+                        else OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
                     }
-                    else OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red, sncode);
+                    else OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
                 }
                 //采集netcode
                 else
@@ -114,7 +114,7 @@ namespace UAS_MES.Make
                     net_code = dh.getFieldDataByCondition("makeserial", "ms_netcode", "ms_id = '" + oMsID + "'").ToString();
                     if (int.Parse(mcd_remainqty.Text) <= 0)
                     {
-                        ErrorMessage = "工单" + ms_makecode.Text + "剩余采集数不足>>>请输入SN";
+                        ErrorMessage = "工单" + ms_makecode.Text + "剩余采集数不足\n>>>请输入SN";
                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
                         return;
                     }
@@ -130,8 +130,7 @@ namespace UAS_MES.Make
                         if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code, "网标采集", "网标采集完成", User.UserCode, out ErrorMessage))
                         {
                             dh.UpdateByCondition("makeserial", "ms_netcode = '" + sncode.Text + "'", "ms_id = '" + oMsID + "'");
-                            ErrorMessage = "网标采集完成,执行更新";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            OperateResult.AppendText(">>网标采集完成,执行更新\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "网标采集", "采集成功", sn_code, "");
                             sql.Clear();
                             sql.Append("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
@@ -148,8 +147,7 @@ namespace UAS_MES.Make
                         {
                             OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
                         }
-                        ErrorMessage = ">>>请输入SN";
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Black);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
                     }
                 }
             }

+ 95 - 86
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -72,7 +72,7 @@ namespace UAS_MES.Make
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
 
-            OperateResult.AppendText(">>请输入TSN\n", Color.Black);  
+            OperateResult.AppendText(">>请输入TSN\n", Color.Black);
         }
 
         private void Ma_code_DbChange(object sender, EventArgs e)
@@ -117,21 +117,22 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);
                         return;
                     }
+                    OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
                     sql.Clear();
-                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from");
-                    sql.Append(" makesnrelation where beforesn= '"+ sncode.Text + "'and ms_makecode=makecode)");
+                    //sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from");
+                    //sql.Append(" makesnrelation where beforesn= '"+ sncode.Text + "'and ms_makecode=makecode)");
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "' or ms_beforesn = '" + sncode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows[0][0].ToString() != "")
                     {
                         ms_id = dt.Rows[0][0].ToString();
-                        sncode.Text = "";
                         sncode.Focus();
-                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black, sncode);
                         return;
                     }
-                    else {
-                        sncode.Text = "";
-                        OperateResult.AppendText(">>TSN错误,不存在\n", Color.Red);
+                    else
+                    {
+                        OperateResult.AppendText(">>TSN错误,不存在\n", Color.Red, sncode);
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);
                         return;
                     }
@@ -141,9 +142,11 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
                     return;
                 }
-                if (CheckTSN.Checked == true && ms_id != null) {
+                OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
+                if (CheckTSN.Checked == true && ms_id != null)
+                {
                     sql.Clear();
-                    sql.Append("select * from makeserial where ms_id='"+ms_id+"'  and  ms_sncode= '"+sncode.Text+"' ");
+                    sql.Append("select * from makeserial where ms_id='" + ms_id + "'  and  ms_sncode= '" + sncode.Text + "' ");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                     {
@@ -151,8 +154,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        sncode.Text = "";
-                        OperateResult.AppendText(">>TSN和SN不一致\n", Color.Red);
+                        OperateResult.AppendText(">>TSN和SN不一致\n", Color.Red, sncode);
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);
                         ms_id = null;
                         return;
@@ -163,73 +165,82 @@ namespace UAS_MES.Make
                 string oMakeCode;
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                 {
+                    //判断界面工单是否为空时的序列号是否自动归属工单
+                    if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                    {
+                        if (ma_code.Text == "")
+                        {
+                            OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                            return;
+                        }
+                    }
                     // 获取工单归属工单下一工序是否正确
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? oMakeCode : ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                     {
-                            //获取工单的其他信息
-                            sql.Clear();
-                            sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
-                            sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
-                            sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
+                        //获取工单的其他信息
+                        sql.Clear();
+                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+                        sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
+                        sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + (oMakeCode == "null" ? ma_code.Text : oMakeCode) + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            //提示用户“<<工单号:取ma_makecode”
+                            OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Black);
+                            //提示用户“<< 序列号:XXXX”
+                            OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
+                            if (pr_change)
                             {
-                                BaseUtil.SetFormValue(this.Controls, dt);
-                                //提示用户“<<工单号:取ma_makecode”
-                                OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Black);
-                                //提示用户“<< 序列号:XXXX”
-                                OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
-                                if (pr_change)
+                                String dialog = MessageBox.Show("产品更改,确认标签模板选择正确", "提示", MessageBoxButtons.OKCancel).ToString();
+                                if (dialog != "OK")
                                 {
-                                    String dialog = MessageBox.Show("产品更改,确认标签模板选择正确", "提示", MessageBoxButtons.OKCancel).ToString();
-                                    if (dialog != "OK")
-                                    {
-                                        OperateResult.AppendText(">>产品编号改变,请重新选择标签模板\n", Color.Green);
-                                        return;
-                                    }
-                                    else
-                                    pr_change = false;
+                                    OperateResult.AppendText(">>产品编号改变,请重新选择标签模板\n", Color.Green);
+                                    return;
                                 }
+                                else
+                                    pr_change = false;
                             }
-                            else
-                            {
-                                sncode.Text = "";
-                                OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
-                            }
-                            string ErrorMessage = "";
-                            string result = "";
-                            if (int.Parse(mcd_remainqty.Text) <= 0)
-                            {
-                                macode = ma_code.Text;
-                                BaseUtil.CleanForm(this);
-                                ErrorMessage = "工单" + macode + "打印结束>>>请输入SN";
-                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                                sncode.Focus();
-                                return;
-                            }
-                            else
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red, sncode);
+                            sncode.Focus();
+                            return;
+                        }
+                        string ErrorMessage = "";
+                        string result = "";
+                        if (int.Parse(mcd_remainqty.Text) <= 0)
+                        {
+                            macode = ma_code.Text;
+                            BaseUtil.CleanForm(this);
+                            ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            sncode.Focus();
+                            return;
+                        }
+                        else
+                        {
+                            //所选标签不为空
+                            if (PrintLabel.SelectedValue != null)
                             {
-                                //所选标签不为空
-                                if (PrintLabel.SelectedValue != null)
+                                //如果打印张数为空,返回
+                                if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
                                 {
-                                    //如果打印张数为空,返回
-                                    if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
-                                    {
-                                        OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red);
-                                        //清空输入框的值,聚焦
-                                        sncode.Text = "";
-                                        sncode.Focus();
-                                        //提示用户“>>请输入SN”
-                                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                                        return;
-                                    }
+                                    OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red, sncode);
+                                    //清空输入框的值,聚焦
+                                    sncode.Focus();
+                                    //提示用户“>>请输入SN”
+                                    OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                    return;
+                                }
                                 //更新至下一步工序
-                                if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage2))
+                                if (LogicHandler.SetStepResult((oMakeCode == "null" ? ma_code.Text : oMakeCode), User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage2))
                                 {
                                     Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                                     //提示用户打印成功
                                     OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
-                                    LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ma_code.Text,User.UserLineCode,User.UserSourceCode,"彩盒打印","彩盒打印成功",sncode.Text,"");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, "");
                                     //刷新打印数量和剩余数量
                                     dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
                                     BaseUtil.SetFormValue(Controls, dt);
@@ -240,29 +251,29 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red);
-                                    sncode.Text = "";
+                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
                                     ms_id = null;
                                     sncode.Focus();
                                 }
                             }
                             else
                             {
-                                OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护机身标签\n", Color.Red);
+                                OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red);
                                 return;
                             }
                             if (CheckTSN.Checked == true)
-                                {
-                                    OperateResult.AppendText(">>请输入TSN\n", Color.Black);
-                                    ms_id = null;
-                                }else
-                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            {
+                                OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                                ms_id = null;
                             }
-                      
+                            else
+                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        }
+
                     }
-                    else {
-                        sncode.Text = "";
-                        OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red);
+                    else
+                    {
+                        OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
                         if (CheckTSN.Checked == true)
                         {
                             OperateResult.AppendText(">>请输入TSN\n", Color.Black);
@@ -274,8 +285,7 @@ namespace UAS_MES.Make
                 }
                 else
                 {
-                    sncode.Text = "";
-                    OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red);
+                    OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
                     if (CheckTSN.Checked == true)
                     {
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);
@@ -334,7 +344,7 @@ namespace UAS_MES.Make
                 }
                 else
                 {
-                    sncode.Text = "";            
+                    sncode.Text = "";
                 }
             }
         }
@@ -345,15 +355,14 @@ namespace UAS_MES.Make
             {
                 ms_id = null;
                 OperateResult.AppendText(">>切换至检查TSN\n", Color.Green);
-                OperateResult.AppendText(">>请输入TSN\n", Color.Black);
-                sncode.Text = "";
+                OperateResult.AppendText(">>请输入TSN\n", Color.Black, sncode);
                 sncode.Focus();
             }
-            else {
+            else
+            {
                 ms_id = null;
                 OperateResult.AppendText(">>切换至不检查TSN\n", Color.Green);
-                OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                sncode.Text = "";
+                OperateResult.AppendText(">>请输入SN\n", Color.Black, sncode);
                 sncode.Focus();
             }
         }

+ 51 - 30
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -51,9 +51,10 @@
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ma_craftcode = new System.Windows.Forms.Label();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.Lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
             // 
@@ -64,15 +65,15 @@
             this.ms_makecode_label.Location = new System.Drawing.Point(25, 20);
             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(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.ms_makecode_label.TabIndex = 125;
-            this.ms_makecode_label.Text = "归属工单";
+            this.ms_makecode_label.Text = "工单号";
             // 
             // pr_code_label
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(317, 20);
+            this.pr_code_label.Location = new System.Drawing.Point(330, 20);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -83,7 +84,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(317, 78);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(330, 78);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -94,7 +95,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(609, 78);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(622, 78);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -129,7 +130,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(609, 20);
+            this.pr_detail_label.Location = new System.Drawing.Point(622, 20);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -172,7 +173,7 @@
             // 
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_sncode.Location = new System.Drawing.Point(149, 78);
+            this.ms_sncode.Location = new System.Drawing.Point(108, 78);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Size = new System.Drawing.Size(0, 27);
             this.ms_sncode.TabIndex = 163;
@@ -182,7 +183,7 @@
             this.load.AutoSize = true;
             this.load.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.load.ForeColor = System.Drawing.Color.Blue;
-            this.load.Location = new System.Drawing.Point(29, 528);
+            this.load.Location = new System.Drawing.Point(29, 526);
             this.load.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.load.Name = "load";
             this.load.Size = new System.Drawing.Size(73, 31);
@@ -196,7 +197,7 @@
             this.unload.AutoSize = true;
             this.unload.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.unload.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            this.unload.Location = new System.Drawing.Point(168, 528);
+            this.unload.Location = new System.Drawing.Point(168, 526);
             this.unload.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.unload.Name = "unload";
             this.unload.Size = new System.Drawing.Size(73, 31);
@@ -209,7 +210,7 @@
             // 
             this.code_label.AutoSize = true;
             this.code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.code_label.Location = new System.Drawing.Point(339, 529);
+            this.code_label.Location = new System.Drawing.Point(307, 529);
             this.code_label.Name = "code_label";
             this.code_label.Size = new System.Drawing.Size(72, 27);
             this.code_label.TabIndex = 167;
@@ -246,7 +247,7 @@
             this.code.AllPower = null;
             this.code.BackColor = System.Drawing.Color.White;
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(433, 531);
+            this.code.Location = new System.Drawing.Point(401, 531);
             this.code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.code.Name = "code";
             this.code.Power = null;
@@ -269,7 +270,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(733, 78);
+            this.mcd_remainqty.Location = new System.Drawing.Point(746, 78);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -280,7 +281,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(441, 78);
+            this.mcd_okqty.Location = new System.Drawing.Point(454, 78);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -292,7 +293,7 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             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(441, 20);
+            this.pr_code.Location = new System.Drawing.Point(454, 20);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_code.Name = "pr_code";
@@ -305,25 +306,13 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(733, 20);
+            this.pr_detail.Location = new System.Drawing.Point(746, 20);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 154;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.CutLength = null;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(149, 20);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 152;
-            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -345,11 +334,43 @@
             this.ma_craftcode.TabIndex = 170;
             this.ma_craftcode.Visible = false;
             // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(113, 22);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(153, 25);
+            this.ma_code.TabIndex = 171;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = true;
+            // 
+            // Lock
+            // 
+            this.Lock.AutoSize = true;
+            this.Lock.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Lock.LeaveEvent = false;
+            this.Lock.Location = new System.Drawing.Point(270, 23);
+            this.Lock.Name = "Lock";
+            this.Lock.Size = new System.Drawing.Size(61, 24);
+            this.Lock.TabIndex = 172;
+            this.Lock.Text = "锁定";
+            this.Lock.UseVisualStyleBackColor = true;
+            // 
             // Make_ColorBoxLoadPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1292, 565);
+            this.Controls.Add(this.Lock);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_craftcode);
             this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.PrintNum);
@@ -366,7 +387,6 @@
             this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.pr_detail);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ms_sncode_label);
             this.Controls.Add(this.OperateResult);
@@ -398,7 +418,6 @@
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private System.Windows.Forms.Label ms_sncode_label;
         private System.Windows.Forms.Label pr_detail_label;
-        private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
@@ -415,5 +434,7 @@
         private System.Windows.Forms.NumericUpDown PrintNum;
         private CustomControl.ValueLabel.ValueLabel ma_bomversion;
         private System.Windows.Forms.Label ma_craftcode;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox Lock;
     }
 }

+ 31 - 13
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -22,7 +22,7 @@ namespace UAS_MES.Make
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //制造单号
-        string ma_code;
+        string macode;
         //当前工单的序列号
         //string sn_code;
         //当前提示的索引
@@ -55,6 +55,24 @@ namespace UAS_MES.Make
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+
+            //工单号放大镜配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本";
+            ma_code.FormName = Name;
+            ma_code.DBTitle = "工单查询";
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ms_makecode_DbChange;
+
+            Lock.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(Lock);
+        }
+
+        private void Ms_makecode_DbChange(object sender, EventArgs e)
+        {
+            dt = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, dt);
         }
 
         private void InPrint()
@@ -82,20 +100,20 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     string Msid;
-                    if (ms_makecode.Text == "")
+                    if (ma_code.Text == "")
                     {
-                        if (!LogicHandler.GetMakeInfo(code.Text, out ma_code, out ErrorMessage))
+                        if (!LogicHandler.GetMakeInfo(code.Text, out macode, out ErrorMessage))
                         {
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             return;
                         }
                     }
-                    if (ms_makecode.Text != ma_code || ListA.Rows.Count == 0)
+                    if (ma_code.Text != macode || ListA.Rows.Count == 0)
                     {
-                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
+                        if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
                         {
                             sql.Clear();
-                            sql.Append("select ms_makecode,ma_craftcode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
+                            sql.Append("select ma_code,ma_craftcode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
                             sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_id='" + Msid + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
@@ -129,15 +147,15 @@ namespace UAS_MES.Make
                             }
                             else if (unload.Checked == true)
                             {
-                                if (LogicHandler.CheckStepSNAndMacode(ma_code, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage))
+                                if (LogicHandler.CheckStepSNAndMacode(macode, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage))
                                 {
-                                    dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + ma_code + "'", "select");
+                                    dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + macode + "'", "select");
                                     if (dt.Rows.Count > 0)
                                     {
                                         string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
                                         string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
                                         string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
-                                        dh.ExecuteSql("delete from craftmaterial where cm_sncode='" + code.Text + "' and cm_makecode='" + ma_code + "'", "delete");
+                                        dh.ExecuteSql("delete from craftmaterial where cm_sncode='" + code.Text + "' and cm_makecode='" + macode + "'", "delete");
                                         LogicHandler.InsertMakeProcess(ms_macode, code.Text, User.UserSourceCode, "上料采集操作", "下料成功", User.UserCode);
                                         int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + code.Text + "'");
                                         if (count == 0)
@@ -162,7 +180,7 @@ namespace UAS_MES.Make
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
                         string sp_tracekind = ListA.Rows[RemainIndex]["sp_tracekind"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                        if (LogicHandler.CheckSNBeforeLoad(ma_code, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                        if (LogicHandler.CheckSNBeforeLoad(macode, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                         {
                             CollectData.Add(code.Text);
                             CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());
@@ -186,14 +204,14 @@ namespace UAS_MES.Make
                             sql.Append("mcd_stepname,ma_craftcode,ma_craftname,:barcode,1,sysdate,'" + User.UserCode + "',ma_linecode,ma_wccode,");
                             sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
                             sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
-                            sql.Append("where ma_code='" + ma_code + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
+                            sql.Append("where ma_code='" + macode + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的工单已经采集完成\n", Color.Green);
                             Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                             RemainIndex = 0;
                             CollectData.Clear();
                             CollectDataSonCode.Clear();
-                            if (LogicHandler.SetTestResult(ms_makecode.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
+                            if (LogicHandler.SetTestResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
                             {
                                 mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
                                 code.Clear();
@@ -231,7 +249,7 @@ namespace UAS_MES.Make
 
         private void LoadCollectNum()
         {
-            dt = (DataTable)dh.ExecuteSql("select ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
 

+ 2 - 4
UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -88,16 +88,14 @@ namespace UAS_MES.Make
                 //查询没有值,返回提示用户“产品:XXX,不存在或者为审核”,清空产品代码输入框中的值 
                 if (dt.Rows.Count == 0)
                 {
-                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red);
-                    pr_code.Text = "";
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red,pr_code);
                     return;
                 }
                 //查询产品是否有自定义的标签模板
                 listA = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_id,pl_labeltype,pl_labelcode,pl_labelurl,pl_isdefault,pl_detno,pl_labelsoft,pl_status,pl_statuscode,pl_labelname,pl_indate from  productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='自定义' order by pl_isdefault desc", "select");
                 if (listA.Rows.Count == 0)
                 {
-                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red);
-                    pr_code.Text = "";
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red, pr_code);
                     return;
                 }
                 if (listA.Rows[0]["pl_isdefault"].ToString() != "1") {

+ 39 - 12
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -22,6 +22,8 @@ namespace UAS_MES.Make
 
         DataTable dtbar;
 
+        DataTable dtst;
+
         LogStringBuilder sql = new LogStringBuilder();
 
         DataHelper dh;
@@ -88,8 +90,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(">>序列号" + ms_sncode.Text + "必须是非在线状态才能做拆解\n", Color.Red);
-                        sn_code.Text = "";
+                        OperateResult.AppendText(">>序列号" + ms_sncode.Text + "必须是非在线状态才能做拆解\n", Color.Red, sn_code);
                         BaseUtil.CleanForm(this);
                         sn_code.Focus();
                         return;
@@ -98,8 +99,7 @@ namespace UAS_MES.Make
                 else
                 {
                     ms_id = null;
-                    OperateResult.AppendText(">>序列号" + sncode_1 + "不存在\n", Color.Red);
-                    sn_code.Text = "";
+                    OperateResult.AppendText(">>序列号" + sncode_1 + "不存在\n", Color.Red, sn_code);
                     BaseUtil.CleanForm(this);
                     sn_code.Focus();
                     return;
@@ -178,13 +178,11 @@ namespace UAS_MES.Make
                 sql.Clear();
                 bccode = new string[dt.Rows.Count];
                 bgcode = new string[dt.Rows.Count];
-                id = new string[dt.Rows.Count];
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     sql.Append(dt.Rows[i]["mb_bgcode"].ToString() + " : " + dt.Rows[i]["mb_badcode"].ToString() + "  ");
                     bgcode[i] = dt.Rows[i]["mb_bgcode"].ToString();
                     bccode[i] = dt.Rows[i]["mb_badcode"].ToString();
-                    id[i] = dh.GetSEQ("MakeBad_seq");
                 }
                 for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                 {
@@ -222,20 +220,49 @@ namespace UAS_MES.Make
                             sql.Append("sp_repcode,pr_id,sp_type,case when (sp_type='物料' and sp_soncode=pr_code) then '已采集' else '未采集' end sp_ifpick ,sp_prefix,");
                             sql.Append("sp_length,sp_regex,sp_ifforsn from stepproduct left join product on pr_code=sp_soncode where sp_bomversion='" + ma_bomversion + "' and ");
                             sql.Append("sp_craftcode='" + ms_craftcode.Text + "'and sp_mothercode ='" + ms_prodcode.Text + "' and sp_soncode = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "' ");
-                            sql.Append("and((sp_type = '物料' and( sp_tracekind <> 2 or sp_tracekind is null))or sp_type <> '物料') order by SP_DETNO asc");
+                            sql.Append("and((sp_type = '物料')or sp_type <> '物料') order by SP_DETNO asc");
                             dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dtbar.Rows.Count > 0)
                             {
                                 String ErrorMessage;
+                                string sp_tracekind = dtbar.Rows[0]["sp_tracekind"].ToString();
                                 string sp_soncode = dtbar.Rows[0]["sp_soncode"].ToString();
                                 string sp_prefix = dtbar.Rows[0]["sp_prefix"].ToString();
                                 string length = dtbar.Rows[0]["sp_length"].ToString();
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
-                                if (!LogicHandler.CheckSNBeforeLoad("", LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                                if (sp_tracekind != "2")
+                                {
+                                    if (!LogicHandler.CheckSNBeforeLoad(ms_makecode.Text, LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                                    {
+                                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                                        LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));
+                                        continue;
+                                    }
+                                }
+                                else
                                 {
-                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                                    LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));
-                                    return;
+                                    if (!dh.CheckExist("makesourcestock", "mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'"))
+                                    {
+                                        OperateResult.AppendText(">>物料" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "岗位备料无条码" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "\n", Color.Red);
+                                        continue;
+                                    }
+                                    else
+                                    {
+                                        sql.Clear();
+                                        sql.Append("select MSS_REMAIN,MSS_BASEQTY from makesourcestock where mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
+                                        dtst = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                        int MSS_REMAIN = int.Parse(dtst.Rows[0]["MSS_REMAIN"].ToString());
+                                        int MSS_BASEQTY = int.Parse(dtst.Rows[0]["MSS_BASEQTY"].ToString());
+                                        if (MSS_REMAIN < MSS_BASEQTY)
+                                        {
+                                            OperateResult.AppendText(">>物料" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "条码" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "备料不足\n", Color.Red);
+                                            continue;
+                                        }
+                                        else
+                                        {
+                                            dh.UpdateByCondition("makesourcestock", "MSS_REMAIN = NVL(MSS_REMAIN, 0) - MSS_BASEQTY,MSS_USEQTY = NVL(MSS_USEQTY, 0) + MSS_BASEQTY,mss_madeqty=NVL(mss_madeqty,0)+ceil(MSS_USEQTY/MSS_BASEQTY)", " mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
+                                        }
+                                    }
                                 }
                             }
                             else
@@ -332,7 +359,7 @@ namespace UAS_MES.Make
             }
             else
             {
-                OperateResult.AppendText("没有选择拆解项\n", Color.Red);
+                OperateResult.AppendText("没有成功拆解项\n", Color.Red);
             }
         }
 

+ 13 - 19
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -106,7 +106,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     if (Loading.Checked)
@@ -137,29 +136,19 @@ namespace UAS_MES.Make
                                         if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
                                         {
                                             sql.Clear();
-                                            sql.Append("select sp_id from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
+                                            sql.Append("select sp_id,sp_soncode from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
                                             sql.Append("join stepproduct on sp_sbid=sb_id where ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' ");
                                             sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and nvl(sp_ifforsn,0)<>0");
                                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                             if (dt.Rows.Count > 0)
                                             {
                                                 string sp_id = dt.Rows[0]["sp_id"].ToString();
+                                                string sp_soncode = dt.Rows[0]["sp_soncode"].ToString();
                                                 if (!dh.CheckExist("Craftmaterial", "cm_makecode='" + ma_code.Text + "' and cm_sncode='" + code.Text + "'"))
                                                 {
-                                                    sql.Clear();
-                                                    sql.Append("insert into Craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,cm_soncode,cm_mscode,");
-                                                    sql.Append("cm_sncode,cm_stepcode,cm_stepname,cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate");
-                                                    sql.Append(",cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");
-                                                    sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,'" + code.Text + "'");
-                                                    sql.Append(",'" + code.Text + "',mcd_stepcode,mcd_stepname,ma_craftcode,ma_craftname,'" + code.Text + "'");
-                                                    sql.Append(",1,sysdate,'" + User.UserName + "',ma_linecode,ma_wccode,'" + User.UserSourceCode + "',");
-                                                    sql.Append("'" + sp_id + "',0,1,ms_firstsn from make left join makeserial on ms_makecode=ma_code left ");
-                                                    sql.Append("join makecraftdetail on mcd_macode=ma_code left join stepproduct on sp_stepcode=mcd_stepcode ");
-                                                    sql.Append("where ma_code = '" + ma_code.Text + "'and sp_id = " + sp_id + " and mcd_stepcode=");
-                                                    sql.Append("'" + User.CurrentStepCode + "' and ms_sncode='" + code.Text + "'");
-                                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                                    CollectDataSonCode.Add(sp_soncode);
+                                                    CollectData.Add(code.Text);
                                                     sn_code.Text = code.Text;
-                                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "上料采集成功", sn_code.Text, "");
                                                     OperateResult.AppendText(">>序列号" + code.Text + "上料成功\n", Color.Green);
                                                     RemainIndex = RemainIndex + 1;
                                                     GetCollectItem();
@@ -256,7 +245,7 @@ namespace UAS_MES.Make
                                 }
                                 else OperateResult.AppendText(">>序列号" + code.Text + "已被扣料,不允许下料\n", Color.Green, code);
                             }
-                            else OperateResult.AppendText(">>该序列号未上料,无需下料\n", Color.Red, code);
+                            else OperateResult.AppendText(">>序列号" + code + "未上料,无需下料\n", Color.Red, code);
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
                     }
@@ -270,7 +259,7 @@ namespace UAS_MES.Make
         {
             //将录入框的值给序列号
             sql.Clear();
-            sql.Append("select ma_prodcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+            sql.Append("select ma_prodcode,ma_craftcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
             sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
             sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -284,6 +273,11 @@ namespace UAS_MES.Make
                 nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
                 ms_status = dt.Rows[0]["ms_status"].ToString();
                 BaseUtil.SetFormValue(this.Controls, dt);
+                string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
+                if (ifforsn != "" && ifforsn != "0")
+                    iflastsn.Checked = true;
+                else
+                    iflastsn.Checked = false;
                 LockMakeCode.Checked = true;
                 string oMakeCode = "";
                 string oMsID = "";
@@ -315,14 +309,14 @@ namespace UAS_MES.Make
                             }
                             catch (Exception)
                             {
-                                OperateResult.AppendText(">>上料采集完成!\n", Color.Green);
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green);
                                 code.Text = "";
                                 sn_code.Text = "";
                             }
                         }
                         else
                         {
-                            OperateResult.AppendText(">>当前序列号没有需要采集的内容,请采集其他序列号\n", Color.Red);
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "没有需要采集的内容,请采集其他序列号\n", Color.Red);
                             code.Text = "";
                             sn_code.Text = "";
                         }

+ 5 - 10
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -85,8 +85,7 @@ namespace UAS_MES.Make
                     if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oErrorMessage))
                     {
                         OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
-                        OperateResult.AppendText(">>请输入序列号\n", Color.Black);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>请输入序列号\n", Color.Black,sncode);
                         return;
                     }
                     //调用公共方法CheckStepSNAndMacode判断工序是否正确
@@ -132,9 +131,8 @@ namespace UAS_MES.Make
                             //如果打印张数为空,返回
                             if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
                             {
-                                OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red);
+                                OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red,sncode);
                                 //清空输入框的值,聚焦
-                                sncode.Text = "";
                                 sncode.Focus();
                                 //提示用户“>>请输入SN”
                                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
@@ -172,20 +170,17 @@ namespace UAS_MES.Make
                         //标签为空
                         else
                         {
-                            OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护机身标签\n", Color.Red);
-                            sncode.Text = "";
+                            OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护机身标签\n", Color.Red,sncode);
                         }
                     }
                     else
                     {
-                        OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red,sncode);
                     }
                 }
                 else
                 {
-                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
-                    sncode.Text = "";
+                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red,sncode);
                 }
             }
         }

+ 9 - 18
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -77,8 +77,7 @@ namespace UAS_MES.Make
                     {
                         //SN错误,不存在
                         //请输入SN
-                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red, sncode);
                         OperateResult.AppendText(">>请输入SN\n", Color.Black);
                     }
                     //存在该SN号
@@ -95,8 +94,7 @@ namespace UAS_MES.Make
                             {
                                 // SN对应的IMEI不存在
                                 //>> 请输入SN
-                                OperateResult.AppendText("<<序列号" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
-                                sncode.Text = "";
+                                OperateResult.AppendText("<<序列号" + sncode.Text + "对应的IMEI不存在\n", Color.Red, sncode);
                                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
                             }
                             else
@@ -108,16 +106,14 @@ namespace UAS_MES.Make
                                 //>>SN对应的IMEI号为:xxxxxxxxx
                                 //>> 请输入彩盒上的IMEI
                                 OperateResult.AppendText("<<序列号"+sncode.Text+"对应的IMEI号为:" + imei1 + "\n", Color.Green);
-                                OperateResult.AppendText(">>请输入彩盒上的IMEI\n", Color.Black);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>请输入彩盒上的IMEI\n", Color.Black, sncode);
                                 //设定要输入imei1
                                 isImei1 = true;
                             }
                         }
                         else
                         {
-                            OperateResult.AppendText("<<SN:" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
-                            sncode.Text = "";
+                            OperateResult.AppendText("<<SN:" + sncode.Text + "对应的IMEI不存在\n", Color.Red, sncode);
                             OperateResult.AppendText(">>请输入SN\n", Color.Black);
                         }
                     }
@@ -151,32 +147,28 @@ namespace UAS_MES.Make
                                     LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ma_code.Text,User.UserLineCode,User.UserSourceCode,"标签核对","标签核对成功",SN,"");
                                     //IMEI核对成功
                                     //>> 请输入SN
-                                    OperateResult.AppendText("<<IMEI核对成功\n", Color.Green);
-                                    sncode.Text = "";
+                                    OperateResult.AppendText("<<IMEI核对成功\n", Color.Green, sncode);
                                     OperateResult.AppendText(">>请输入SN\n", Color.Black);
                                 }
                                 else
                                 {
                                     //setstepresult不通过
-                                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
                                     recordResult(SN, DateTime.Now.ToString(), "失败");
-                                    sncode.Text = "";
                                 }
                             }
                             else
                             {
                                 //判定序列号下一工序不通过
-                                OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                                OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
                                 recordResult(SN, DateTime.Now.ToString(), "失败");
-                                sncode.Text = "";
                             }
                         }
                         else
                         {
                             //判定工序属性不通过
-                            OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                            OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
                             recordResult(SN, DateTime.Now.ToString(), "失败");
-                            sncode.Text = "";
                         }
                     }
                     //说明比对不一致
@@ -186,8 +178,7 @@ namespace UAS_MES.Make
                         imei1 = "";
                         //IMEI核对失败
                         //>> 请输入SN
-                        OperateResult.AppendText(">>IMEI核对失败,不一致\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>IMEI核对失败,不一致\n", Color.Red, sncode);
                         OperateResult.AppendText(">>请输入SN\n", Color.Black);
                     }
                     //imei1校对结束,下次输入的是SN

+ 4 - 8
UAS-MES/FunctionCode/Make/Make_MakeDown.cs

@@ -106,16 +106,14 @@ namespace UAS_MES.Make
                             }
                             else
                             {
-                                OperateResult.AppendText(">>>序列号" + sn_code.Text + "已装箱:" + ms_outboxcode + ",不允许下地,如需下地请先解除装箱\n", Color.Red);
-                                sn_code.Text = "";
+                                OperateResult.AppendText(">>>序列号" + sn_code.Text + "已装箱:" + ms_outboxcode + ",不允许下地,如需下地请先解除装箱\n", Color.Red, sn_code);
                                 sn_code.Focus();
                                 return;
                             }
                         }
                         else
                         {
-                            OperateResult.AppendText(">>>序列号" + sn_code.Text + "目前已经是下地状态,无需重复下地\n", Color.Red);
-                            sn_code.Text = "";
+                            OperateResult.AppendText(">>>序列号" + sn_code.Text + "目前已经是下地状态,无需重复下地\n", Color.Red, sn_code);
                             sn_code.Focus();
                             return;
                         }
@@ -124,15 +122,13 @@ namespace UAS_MES.Make
                     else
                     {
                         ms_id = null;
-                        OperateResult.AppendText(">>>序列号" + sn_code.Text + "不存在\n", Color.Red);
-                        sn_code.Text = "";
+                        OperateResult.AppendText(">>>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
                         sn_code.Focus();
                     }
                 }
                 else
                 {
-                    OperateResult.AppendText(">>>序列号" + sn_code.Text + "未输入下地原因\n", Color.Red);
-                    sn_code.Text = "";
+                    OperateResult.AppendText(">>>序列号" + sn_code.Text + "未输入下地原因\n", Color.Red, sn_code);
                     sn_code.Focus();
                     return;
                 }

+ 4 - 3
UAS-MES/FunctionCode/Make/Make_NewBigBox.Designer.cs

@@ -28,7 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewPallet));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewBigBox));
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pa_packageqty_label = new System.Windows.Forms.Label();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
@@ -94,6 +94,7 @@
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
             this.pa_outboxcode.ProdCode = null;
+            this.pa_outboxcode.ShowClickIcon = true;
             this.pa_outboxcode.Size = new System.Drawing.Size(235, 26);
             this.pa_outboxcode.TabIndex = 10;
             this.pa_outboxcode.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode.OnTextChange(this.pa_outboxcode_UserControlTextChanged);
@@ -165,7 +166,7 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // Make_NewPallet
+            // Make_NewBigBox
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -181,7 +182,7 @@
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "Make_NewPallet";
+            this.Name = "Make_NewBigBox";
             this.Tag = "ShowDialogWindow";
             this.Text = "新增栈板";
             this.Load += new System.EventHandler(this.新增栈板_Load);

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs

@@ -81,6 +81,7 @@
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
             this.pa_outboxcode.ProdCode = null;
+            this.pa_outboxcode.ShowClickIcon = true;
             this.pa_outboxcode.Size = new System.Drawing.Size(235, 26);
             this.pa_outboxcode.TabIndex = 10;
             this.pa_outboxcode.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode.OnTextChange(this.pa_outboxcode_UserControlTextChanged);

+ 66 - 55
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -52,11 +52,6 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.PackageDetail = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
-            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
             this.pr_code = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
@@ -74,6 +69,12 @@
             this.pr_packrule = new System.Windows.Forms.Label();
             this.pa_status = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -365,6 +366,7 @@
             this.PackageDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_barcode,
             this.pa_outboxcode1,
+            this.pa_prodcode1,
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
@@ -376,51 +378,6 @@
             this.PackageDetail.Size = new System.Drawing.Size(1150, 300);
             this.PackageDetail.TabIndex = 134;
             // 
-            // pd_barcode
-            // 
-            this.pd_barcode.DataPropertyName = "pd_barcode";
-            this.pd_barcode.HeaderText = "序号";
-            this.pd_barcode.Name = "pd_barcode";
-            this.pd_barcode.ReadOnly = true;
-            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
-            this.pd_barcode.Width = 202;
-            // 
-            // pa_outboxcode1
-            // 
-            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
-            this.pa_outboxcode1.HeaderText = "箱号";
-            this.pa_outboxcode1.Name = "pa_outboxcode1";
-            this.pa_outboxcode1.ReadOnly = true;
-            this.pa_outboxcode1.Width = 201;
-            // 
-            // pd_innerqty
-            // 
-            this.pd_innerqty.DataPropertyName = "pd_innerqty";
-            this.pd_innerqty.HeaderText = "箱内数量";
-            this.pd_innerqty.Name = "pd_innerqty";
-            this.pd_innerqty.ReadOnly = true;
-            this.pd_innerqty.Visible = false;
-            this.pd_innerqty.Width = 80;
-            // 
-            // pa_indate
-            // 
-            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pa_indate.DataPropertyName = "pa_indate";
-            this.pa_indate.HeaderText = "装箱日期";
-            this.pa_indate.MinimumWidth = 300;
-            this.pa_indate.Name = "pa_indate";
-            this.pa_indate.ReadOnly = true;
-            this.pa_indate.Width = 300;
-            // 
-            // pd_id
-            // 
-            this.pd_id.DataPropertyName = "pd_id";
-            this.pd_id.HeaderText = "ID";
-            this.pd_id.Name = "pd_id";
-            this.pd_id.ReadOnly = true;
-            this.pd_id.Visible = false;
-            // 
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
@@ -651,6 +608,59 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
+            // pd_barcode
+            // 
+            this.pd_barcode.DataPropertyName = "pd_barcode";
+            this.pd_barcode.HeaderText = "序列号";
+            this.pd_barcode.Name = "pd_barcode";
+            this.pd_barcode.ReadOnly = true;
+            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
+            this.pd_barcode.Width = 202;
+            // 
+            // pa_outboxcode1
+            // 
+            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
+            this.pa_outboxcode1.HeaderText = "箱号";
+            this.pa_outboxcode1.Name = "pa_outboxcode1";
+            this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Visible = false;
+            this.pa_outboxcode1.Width = 201;
+            // 
+            // pa_prodcode1
+            // 
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            // 
+            // pd_innerqty
+            // 
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
+            // 
+            // pa_indate
+            // 
+            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pa_indate.DataPropertyName = "pa_indate";
+            this.pa_indate.HeaderText = "装箱日期";
+            this.pa_indate.MinimumWidth = 300;
+            this.pa_indate.Name = "pa_indate";
+            this.pa_indate.ReadOnly = true;
+            this.pa_indate.Width = 300;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
             // Make_PackageCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -717,11 +727,6 @@
         private System.Windows.Forms.Label label3;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
         private System.Windows.Forms.NumericUpDown PrintNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
         private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
         private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label pr_detail;
@@ -739,5 +744,11 @@
         private System.Windows.Forms.Label ob_batchqty_label;
         private System.Windows.Forms.Label ob_nowcheckqty;
         private System.Windows.Forms.Label ob_checkno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_prodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
     }
 }

+ 29 - 32
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -87,7 +87,7 @@ namespace UAS_MES.Make
                 sql.Clear();
                 sql.Append("select ms_makecode,pa_status,pr_packrule,pr_code,pr_detail,pr_outboxinnerqty,pa_standardqty,pa_packageqty,pa_currentqty,");
                 sql.Append("pa_outboxcode 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+"'");
+                sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                 Err = "序列号";
             }
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -106,7 +106,7 @@ namespace UAS_MES.Make
         private void LoadGridData()
         {
             //加载Grid数据
-            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
             //更新界面的采集数量
             pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
@@ -114,31 +114,35 @@ namespace UAS_MES.Make
 
         private void InsertDetail()
         {
-            if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
+            if (dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_id='" + oMsID + "'").ToString() == sn_code.Text)
             {
-                sql.Clear();
-                sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
-                sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dh.ExecuteSql(sql.GetString(), "insert");
-                dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
-                if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
+                if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
                 {
-                    LoadCheckQTY();
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
-                    //满箱更新状态为1
-                    if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
+                    sql.Clear();
+                    sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
+                    sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.ExecuteSql(sql.GetString(), "insert");
+                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
+                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
                     {
-                        dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                        if (AutoPrint.Checked)
-                            Print_Click(new object(), new EventArgs());
+                        LoadCheckQTY();
+                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
+                        //满箱更新状态为1
+                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
+                        {
+                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                            if (AutoPrint.Checked)
+                                Print_Click(new object(), new EventArgs());
+                        }
+                        LoadGridData();
+                        sn_code.Clear();
                     }
-                    LoadGridData();
-                    sn_code.Clear();
                 }
+                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
             }
-            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
+            else OperateResult.AppendText(">>序列号"+sn_code.Text+"不存在\n", Color.Red,sn_code);
         }
 
         private void Print_Click(object sender, EventArgs e)
@@ -148,7 +152,7 @@ namespace UAS_MES.Make
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
+                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
@@ -268,15 +272,8 @@ namespace UAS_MES.Make
                                     sql.Append("sysdate,'" + oMakeCode + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + oMakeCode + "'");
                                     dh.ExecuteSql(sql.GetString(), "insert");
                                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
-                                    InsertDetail();
-                                }
-                                else
-                                {
-                                    if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
-                                        InsertDetail();
-                                    else
-                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
                                 }
+                                InsertDetail();
                             }
                         }
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
@@ -306,9 +303,9 @@ namespace UAS_MES.Make
                             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
                     }
-                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                 }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
             }
         }
 

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

@@ -200,6 +200,9 @@
   <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>

+ 66 - 55
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -52,11 +52,6 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.PackageDetail = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
-            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
             this.pr_code = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
@@ -83,6 +78,12 @@
             this.label2 = new System.Windows.Forms.Label();
             this.Baurate = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -374,6 +375,7 @@
             this.PackageDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_barcode,
             this.pa_outboxcode1,
+            this.pa_prodcode1,
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
@@ -385,51 +387,6 @@
             this.PackageDetail.Size = new System.Drawing.Size(881, 300);
             this.PackageDetail.TabIndex = 134;
             // 
-            // pd_barcode
-            // 
-            this.pd_barcode.DataPropertyName = "pd_barcode";
-            this.pd_barcode.HeaderText = "序号";
-            this.pd_barcode.Name = "pd_barcode";
-            this.pd_barcode.ReadOnly = true;
-            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
-            this.pd_barcode.Width = 202;
-            // 
-            // pa_outboxcode1
-            // 
-            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
-            this.pa_outboxcode1.HeaderText = "箱号";
-            this.pa_outboxcode1.Name = "pa_outboxcode1";
-            this.pa_outboxcode1.ReadOnly = true;
-            this.pa_outboxcode1.Width = 201;
-            // 
-            // pd_innerqty
-            // 
-            this.pd_innerqty.DataPropertyName = "pd_innerqty";
-            this.pd_innerqty.HeaderText = "箱内数量";
-            this.pd_innerqty.Name = "pd_innerqty";
-            this.pd_innerqty.ReadOnly = true;
-            this.pd_innerqty.Visible = false;
-            this.pd_innerqty.Width = 80;
-            // 
-            // pa_indate
-            // 
-            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pa_indate.DataPropertyName = "pa_indate";
-            this.pa_indate.HeaderText = "装箱日期";
-            this.pa_indate.MinimumWidth = 300;
-            this.pa_indate.Name = "pa_indate";
-            this.pa_indate.ReadOnly = true;
-            this.pa_indate.Width = 300;
-            // 
-            // pd_id
-            // 
-            this.pd_id.DataPropertyName = "pd_id";
-            this.pd_id.HeaderText = "ID";
-            this.pd_id.Name = "pd_id";
-            this.pd_id.ReadOnly = true;
-            this.pd_id.Visible = false;
-            // 
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
@@ -765,6 +722,59 @@
             this.ComList.TabIndex = 177;
             this.ComList.Visible = false;
             // 
+            // pd_barcode
+            // 
+            this.pd_barcode.DataPropertyName = "pd_barcode";
+            this.pd_barcode.HeaderText = "序列号";
+            this.pd_barcode.Name = "pd_barcode";
+            this.pd_barcode.ReadOnly = true;
+            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
+            this.pd_barcode.Width = 202;
+            // 
+            // pa_outboxcode1
+            // 
+            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
+            this.pa_outboxcode1.HeaderText = "箱号";
+            this.pa_outboxcode1.Name = "pa_outboxcode1";
+            this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Visible = false;
+            this.pa_outboxcode1.Width = 201;
+            // 
+            // pa_prodcode1
+            // 
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            // 
+            // pd_innerqty
+            // 
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
+            // 
+            // pa_indate
+            // 
+            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pa_indate.DataPropertyName = "pa_indate";
+            this.pa_indate.HeaderText = "装箱日期";
+            this.pa_indate.MinimumWidth = 300;
+            this.pa_indate.Name = "pa_indate";
+            this.pa_indate.ReadOnly = true;
+            this.pa_indate.Width = 300;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
             // Make_PackageCollectionWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -836,11 +846,6 @@
         private System.Windows.Forms.Label label3;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
         private System.Windows.Forms.NumericUpDown PrintNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
         private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
         private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label pr_detail;
@@ -867,5 +872,11 @@
         private System.Windows.Forms.Label ComList;
         private System.Windows.Forms.Label pr_cartonunit;
         private System.Windows.Forms.Label pr_cartonunit1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_prodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
     }
 }

+ 31 - 27
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -151,7 +151,7 @@ namespace UAS_MES.Make
                 sql.Clear();
                 sql.Append("select ms_makecode,pr_cartonunit,pa_status,pr_packrule,pr_code,pr_detail,pr_outboxinnerqty,pa_standardqty,pa_packageqty,pa_currentqty,");
                 sql.Append("pa_outboxcode,pr_cartonminw,pr_cartonmaxw,pr_cartongw from makeserial left join product on ms_prodcode=pr_code left ");
-                sql.Append("join packagedetail on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='"+oMsID+"'");
+                sql.Append("join packagedetail on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                 Err = "序列号";
             }
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -181,7 +181,7 @@ namespace UAS_MES.Make
         private void LoadGridData()
         {
             //加载Grid数据
-            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
             //更新界面的采集数量
             pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
@@ -189,35 +189,39 @@ namespace UAS_MES.Make
 
         private void InsertDetail()
         {
-            if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
+            if (dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_id='" + oMsID + "'").ToString() == sn_code.Text)
             {
-                sql.Clear();
-                sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
-                sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dh.ExecuteSql(sql.GetString(), "insert");
-                dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
-                if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
+                if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
                 {
-                    LoadCheckQTY();
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                    //满箱更新状态为1
-                    if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
+                    sql.Clear();
+                    sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
+                    sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.ExecuteSql(sql.GetString(), "insert");
+                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
+                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
                     {
-                        //检查重量合格
-                        if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
+                        LoadCheckQTY();
+                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                        //满箱更新状态为1
+                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
                         {
-                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                            if (AutoPrint.Checked)
-                                Print_Click(new object(), new EventArgs());
+                            //检查重量合格
+                            if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
+                            {
+                                dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                if (AutoPrint.Checked)
+                                    Print_Click(new object(), new EventArgs());
+                            }
+                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
                         }
-                        else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
+                        LoadGridData();
+                        sn_code.Clear();
                     }
-                    LoadGridData();
-                    sn_code.Clear();
                 }
+                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
             }
-            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
+            else OperateResult.AppendText("序列号" + sn_code.Text + "不存在", Color.Red, sn_code);
         }
 
         private void Print_Click(object sender, EventArgs e)
@@ -227,7 +231,7 @@ namespace UAS_MES.Make
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
+                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
@@ -374,9 +378,9 @@ namespace UAS_MES.Make
                             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
                     }
-                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                 }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
             }
         }
 
@@ -442,7 +446,7 @@ namespace UAS_MES.Make
                 OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
                 LogicHandler.InsertMakeProcess(sn_code.Text, oMakeCode, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
                 //记录操作日志
-                LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
                 ob_checkno.Text = "";
             }
             else OperateResult.AppendText(">>必须封箱才能送检\n", Color.Red);

+ 1 - 13
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.resx

@@ -200,19 +200,7 @@
   <metadata name="pa_outboxcode1.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>
-  <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">
+  <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">

+ 7 - 5
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.Make
                     return;
                 }
                 sql.Clear();
-                sql.Append("select pa_makecode,pa_packageqty,pa_currentqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
+                sql.Append("select pa_makecode,pa_status,pa_packageqty,pa_currentqty,pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_salecode ");
                 sql.Append("from package where pa_outboxcode='" + palletcode.Text + "'  and pa_type =3");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 BaseUtil.SetFormValue(Controls, dt);
@@ -118,6 +118,10 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>栈板号不存在\n", Color.Red);
                     return;
                 }
+                if (pa_standardqty.Text == pa_currentqty.Text)
+                {
+                    Packing_Click(new object(), new EventArgs());
+                }
                 sql.Clear();
                 sql.Append("select count(0) cn from packagedetail left join package on pa_id=pd_paid  where ");
                 sql.Append("pa_outboxcode='" + palletcode.Text + "'");
@@ -142,8 +146,6 @@ namespace UAS_MES.Make
                             dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + palletcode.Text + "'", "update");
                         }
                         OperateResult.AppendText(">>箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
-                        LoadGridData();
-                        LoadCollectNum();
                     }
                     else OperateResult.AppendText(">>箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
                 }
@@ -229,11 +231,11 @@ namespace UAS_MES.Make
         {
             if (pa_prodcode.Text != "" && palletcode.Text != "")
             {
-                OperateResult.AppendText(">>" + palletcode.Text + "装箱成功\n", Color.Red);
+                OperateResult.AppendText(">>" + palletcode.Text + "装栈板成功\n", Color.Black);
                 palletcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                 sql.Clear();
                 sql.Append("insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_standardqty)values");
-                sql.Append("(package_seq.nextval,'" + palletcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',3,'" + pa_prodcode.Text + "',0,'','" + pa_standardqty.Text + "')");
+                sql.Append("(package_seq.nextval,'" + palletcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',3,'" + pa_prodcode.Text + "',0,'1','" + pa_standardqty.Text + "')");
                 dh.ExecuteSql(sql.GetString(), "insert");
                 palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
             }

+ 4 - 8
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -109,8 +109,7 @@ namespace UAS_MES.Make
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(),"select",palletcode.Text);
                 if (dt.Rows.Count == 0)
                 {
-                    OperateResult.AppendText("<<无该栈板号\n", Color.Red);
-                    palletcode.Text = "";
+                    OperateResult.AppendText("<<无该栈板号\n", Color.Red, palletcode);
                 }
                 else
                 {
@@ -119,8 +118,7 @@ namespace UAS_MES.Make
                     //刷新grid的历史称重信息;
                     if (int.Parse(weight.Text) == 0)
                     {
-                        OperateResult.AppendText("<<重量不能等于0\n", Color.Red);
-                        palletcode.Text = "";
+                        OperateResult.AppendText("<<重量不能等于0\n", Color.Red, palletcode);
                         return;
                     }
                     // 更新大箱重量
@@ -154,8 +152,7 @@ namespace UAS_MES.Make
                             {
                                 if (PrintLabel.SelectedValue.ToString() == "")
                                 {
-                                    OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护栈板标签模板\n", Color.Red);
-                                    palletcode.Text = "";
+                                    OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护栈板标签模板\n", Color.Red, palletcode);
                                     return;
                                 }
                                 Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, palletcode.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
@@ -163,8 +160,7 @@ namespace UAS_MES.Make
                             catch (Exception ex)
                             {
                                 OperateResult.AppendText("<<打印失败\n", Color.Red);
-                                OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
-                                palletcode.Text = "";
+                                OperateResult.AppendText(">>请输入栈板号\n", Color.Black, palletcode);
                                 return;
                             }
                             //打印成功,请输入栈板号

+ 41 - 48
UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

@@ -39,13 +39,13 @@ namespace UAS_MES.Make
 
         DataTable mapB;
 
-        String TSN="";//记录第一次输入的SN
+        String TSN = "";//记录第一次输入的SN
 
         DataTable infoc;
 
         string re_ms_id = "";
 
-        string ms_id="";
+        string ms_id = "";
 
         DataTable formValue;//界面赋值
 
@@ -66,6 +66,7 @@ namespace UAS_MES.Make
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
         }
+
         private void InPrint()
         {
             try
@@ -89,6 +90,7 @@ namespace UAS_MES.Make
         {
             //窗口关闭的时候
         }
+
         private void radioButton_CheckedChange(object sender, EventArgs e)
         {
             RadioButton btn = sender as RadioButton;
@@ -97,18 +99,21 @@ namespace UAS_MES.Make
                 //如果是切换成彩盒或者机身标提示用户 输入SN
                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
                 clearAll();
-            } else if (btn.Name == "CartonBox" || btn.Checked)
+            }
+            else if (btn.Name == "CartonBox" || btn.Checked)
             {
                 OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
                 clearAll();
             }
         }
+
         private void inputText_KeyDown(object sender, KeyEventArgs e)
         {
             //按下enter键
             if (e.KeyCode == Keys.Enter)
             {
-                if (inputText.Text == "") {
+                if (inputText.Text == "")
+                {
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     return;
                 }
@@ -118,35 +123,38 @@ namespace UAS_MES.Make
                     //select max(ms_id)ms_id from makeserial where ms_sncode=? 
                     ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
                     //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
-                    if (ms_id == "") {
+                    if (ms_id == "")
+                    {
                         OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
                         OperateResult.AppendText(">>请输入SN\n", Color.Black);
                         return;
                     }
                     //判断是否装箱通过
-                    if (checkPacked()) {
+                    if (checkPacked())
+                    {
                         return;
                     }
                     //界面赋值
-                    formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='"+ms_id+"'", "select");
-                    BaseUtil.SetFormValue(this.Controls,formValue);
+                    formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='" + ms_id + "'", "select");
+                    BaseUtil.SetFormValue(this.Controls, formValue);
                     //无值,可补打
                     inputValue.Text = inputText.Text;
                     inputText.Text = "";
                 }
                 //打印类型为卡通箱
-                else if(CartonBox.Checked)
+                else if (CartonBox.Checked)
                 {
                     //查询箱号是否存在
                     dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
-                    if (dt.Rows.Count==0) {
+                    if (dt.Rows.Count == 0)
+                    {
                         //无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
                         OperateResult.AppendText("<<箱号:" + inputText.Text + "不存在\n", Color.Red, inputText);
                         OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
                         return;
                     }
                     //界面赋值
-                    BaseUtil.SetFormValue(this.Controls,dt);
+                    BaseUtil.SetFormValue(this.Controls, dt);
                     //有值,可以打
                     //展示产品编号和标签模板到界面
                     inputValue.Text = inputText.Text;
@@ -157,28 +165,23 @@ namespace UAS_MES.Make
 
         private void PrintLabel_TextChanged(object sender, EventArgs e)
         {
-            if (pr_code.Text=="") {
+            if (pr_code.Text == "")
+            {
                 return;
             }
             if (fuselagel.Checked)
-            {
                 type = "机身标";
-                getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc";
-            }
             else if (giftBox.Checked)
-            {
                 type = "彩盒标";
-                getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='彩盒标' order by pl_isdefault desc";
-            }
             else
-            {
                 type = "卡通箱标";
-                getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='卡通箱标' order by pl_isdefault desc";
-            }
+
+            getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='" + type + "' order by pl_isdefault desc";
+
             listA = (DataTable)dh.ExecuteSql(getlabel, "select");
             if (listA.Rows.Count == 0)
             {
-                OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护"+type+"模板\n", Color.Red);
+                OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护" + type + "模板\n", Color.Red);
             }
             PrintLabel.DataSource = listA;
             PrintLabel.DisplayMember = "pl_name";
@@ -225,7 +228,7 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<打印成功\n", Color.Green);
                 Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
-                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
+                LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
                 //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
                 if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
                 {
@@ -249,12 +252,7 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<打印成功\n", Color.Green);
                 Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
-                //LogicHandler.DoCommandLog(User.UserCode, "", User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:"+ inputValue.Text, "补打印成功","", "");
-                sql.Clear();
-                sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
-                sql.Append("cl_result,cl_sncode,cl_code) values (commandlog_seq.nextval,:inman,sysdate,:linecode,:sourcecode,:makecode,");
-                sql.Append(":operate,:result,'','')");
-                dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode, ms_makecode.Text, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功");
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
                 //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
                 if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
                 {
@@ -264,11 +262,13 @@ namespace UAS_MES.Make
                 }
             }
         }
+
         /// <summary>
         /// 判断彩盒和机身标序列是否已经装箱
         /// </summary>
         /// <returns></returns>
-        private bool checkPacked() {
+        private bool checkPacked()
+        {
             //如果存在,则判断是否装箱
             dt = (DataTable)dh.ExecuteSql("select ms_id,ms_prodcode,ms_makecode,pr_detail, ms_outboxcode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'", "select");
             //判断ms_outboxcode 是否为空,如果有值,则返回提示用户“已经装箱
@@ -292,26 +292,25 @@ namespace UAS_MES.Make
             //插入数据至表MAKEDOWN
             string md_code = "";
             LogicHandler.GetSerialNumByCaller("MakeDown", out md_code);
-            //拼接sql插入语句
             sql.Clear();
             sql.Append("INSERT INTO MAKEDOWN (MD_ID,MD_LINECODE,MD_SCCODE,MD_STEPCODE,");
-            sql.Append(CartonBox.Checked?"MD_OUTBOXCODE":"MD_SNCODE"+",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
+            sql.Append((CartonBox.Checked ? "MD_OUTBOXCODE" : "MD_SNCODE") + ",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
             sql.Append("MD_DOWNDATE,MD_DOWNMAN,MD_STATUS) values (MAKEDOWN_seq.nextval,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
             sql.Append("'" + User.CurrentStepCode + "','" + inputValue.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','补打标签','" + md_code + "',sysdate,'" + User.UserCode + "','-1')");
-            //执行
             dh.ExecuteSql(sql.GetString(), "insert");
         }
 
         private void rePrintCheck_KeyDown(object sender, KeyEventArgs e)
         {
             //输入ENTER
-            if (e.KeyCode==Keys.Enter)
+            if (e.KeyCode == Keys.Enter)
             {
-                if (rePrintCheck.Text=="")
+                if (rePrintCheck.Text == "")
                 {
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     return;
                 }
+                OperateResult.AppendText(">>"+rePrintCheck.Text+"\n", Color.Black);
                 if (giftBox.Checked || fuselagel.Checked)
                 {
                     //TSN为空,说明是第一次
@@ -330,8 +329,7 @@ namespace UAS_MES.Make
                         //查询其他的数据
                         infoc = (DataTable)dh.ExecuteSql("select ms_downstatus,ms_prodcode,ms_makecode from makeserial where ms_id='" + re_ms_id + "'", "select");
                         //提示用户输入核对SN
-                        OperateResult.AppendText(">>请输入核对SN\n", Color.Green);
-                        rePrintCheck.Text = "";
+                        OperateResult.AppendText(">>请输入核对SN\n", Color.Green, rePrintCheck);
                     }
                     //说明输入的是核对的SN
                     else
@@ -349,7 +347,7 @@ namespace UAS_MES.Make
                                 dh.ExecuteSQLTran("update makeserial set ms_downstatus='0' where ms_id='" + re_ms_id + "'", sql.GetString());
                             }
                             //记录操作日志commandlog , 补打核对,核对成功
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "标签补打核对", "核对成功", TSN, "");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode,infoc.Rows[0]["ms_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "标签补打核对", "核对成功", TSN, "");
                         }
                         else
                         {
@@ -361,14 +359,14 @@ namespace UAS_MES.Make
                     }
                 }
                 //勾选的是卡通箱
-                else if(CartonBox.Checked)
+                else if (CartonBox.Checked)
                 {
                     //第一次输入
                     if (TSN == "")
                     {
-                        infoc = (DataTable)dh.ExecuteSql("select pa_prodcode,pa_makecode,pa_downstatus from package where pa_outboxcode='"+rePrintCheck.Text+"' and pa_type=1", "select");
+                        infoc = (DataTable)dh.ExecuteSql("select pa_prodcode,pa_makecode,pa_downstatus from package where pa_outboxcode='" + rePrintCheck.Text + "' and pa_type=1", "select");
                         //如果查询无值,提示用户卡通箱号不存在,请输入卡通箱号
-                        if (infoc.Rows.Count==0)
+                        if (infoc.Rows.Count == 0)
                         {
                             OperateResult.AppendText("<<卡通箱号:" + rePrintCheck.Text + "不存在\n", Color.Red, rePrintCheck);
                             OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
@@ -377,7 +375,7 @@ namespace UAS_MES.Make
                         //存在则保存,用于和第二次的比对
                         TSN = rePrintCheck.Text;
                         //提示用户输入卡通箱号
-                        OperateResult.AppendText(">>请输入核对卡通箱号\n", Color.Green,rePrintCheck);
+                        OperateResult.AppendText(">>请输入核对卡通箱号\n", Color.Green, rePrintCheck);
                     }
                     else
                     {
@@ -393,12 +391,7 @@ namespace UAS_MES.Make
                                 sql.Append("update makedown set md_status=0,Md_UPREASON='标签补打核对',Md_UPMAN='" + User.UserCode + "',Md_UPDATE=SYSDATE WHERE Md_OUTBOXCODE='" + TSN + "' AND Md_PRODCODE='" + infoc.Rows[0]["pa_prodcode"].ToString() + "' AND Md_STATUS=-1");
                             }
                             //记录操作日志commandlog , 补打核对,核对成功
-                            //LogicHandler.DoCommandLog(User.UserCode, "", User.UserLineCode, User.UserSourceCode, "标签补打核对,卡通箱号:" + TSN, "核对成功", "", "");
-                            sql.Clear();
-                            sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
-                            sql.Append("cl_result,cl_sncode,cl_code) values (commandlog_seq.nextval,:inman,sysdate,:linecode,:sourcecode,:makecode,");
-                            sql.Append(":operate,:result,'','')");
-                            dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode,infoc.Rows[0]["pa_makecode"].ToString(), "标签补打核对,卡通箱号:" + TSN, "核对成功");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, infoc.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "标签补打核对,卡通箱号:" + TSN, "核对成功", TSN, "");
                         }
                         else
                         {

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -853,7 +853,7 @@
             this.cd_stepcode.Location = new System.Drawing.Point(464, 104);
             this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4);
             this.cd_stepcode.Name = "cd_stepcode";
-            this.cd_stepcode.Power = null;
+            this.cd_stepcode.Power = "ifspecial";
             this.cd_stepcode.ReturnData = null;
             this.cd_stepcode.SelectField = null;
             this.cd_stepcode.SetValueField = null;
@@ -861,7 +861,7 @@
             this.cd_stepcode.TabIndex = 68;
             this.cd_stepcode.TableName = null;
             this.cd_stepcode.Tag = "ms_stepcode";
-            this.cd_stepcode.TextBoxEnable = true;
+            this.cd_stepcode.TextBoxEnable = false;
             // 
             // cr_code
             // 
@@ -875,7 +875,7 @@
             this.cr_code.Location = new System.Drawing.Point(121, 103);
             this.cr_code.Margin = new System.Windows.Forms.Padding(4);
             this.cr_code.Name = "cr_code";
-            this.cr_code.Power = null;
+            this.cr_code.Power = "ifspecial";
             this.cr_code.ReturnData = null;
             this.cr_code.SelectField = null;
             this.cr_code.SetValueField = null;
@@ -883,7 +883,7 @@
             this.cr_code.TabIndex = 67;
             this.cr_code.TableName = null;
             this.cr_code.Tag = "ms_craftcode";
-            this.cr_code.TextBoxEnable = true;
+            this.cr_code.TextBoxEnable = false;
             this.cr_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.cr_code_UserControlTextChanged);
             // 
             // NewBadCode

+ 4 - 0
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -649,6 +649,10 @@ namespace UAS_MES.Make
 
         private void ms_prodcode_TextChanged(object sender, EventArgs e)
         {
+            if (ms_prodcode.Text != "")
+                cr_code.Condition = "cr_prodcode='" + ms_prodcode.Text + "'";
+            else
+                cr_code.Condition = "";
             bd_soncode.Condition = "bd_mothercode='" + ms_prodcode.Text + "' and NVL(bd_usestatus,' ')<>'DISABLE'";
         }
     }

+ 12 - 0
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -129,6 +129,18 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 20 - 50
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -102,21 +102,10 @@ namespace UAS_MES.Make
                                         //记录数量
                                         ma_qty = int.Parse(dt.Rows[0]["ma_qty"].ToString());
                                         BaseUtil.SetFormValue(this.Controls, dt);
-                                        //判断用户是否锁定输入TSN长度,
-                                        if (!checkLengthOrPre(TSNLength_checkBox, TSNLength, "长度", "TSN"))
-                                        {
-                                            return;
-                                        }
-                                        //判断用户是否锁定输入TSN前缀,
-                                        if (!checkLengthOrPre(TSNPre_checkBox, TSNPre, "前缀", "TSN"))
-                                        {
-                                            return;
-                                        }
                                     }
                                     else
                                     {
-                                        OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red);
-                                        code.Text = "";
+                                        OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red,code);
                                         return;
                                     }
                                     //获取需要关联采集的信息,以及校验规则
@@ -124,8 +113,7 @@ namespace UAS_MES.Make
                                     //没有获取到就提示错误请维护产品对应的关联采集信息
                                     if (ListA.Rows.Count == 0)
                                     {
-                                        OperateResult.AppendText(">>请维护产品对应的关联采集信息\n", Color.Red);
-                                        code.Text = "";
+                                        OperateResult.AppendText(">>请维护产品对应的关联采集信息\n", Color.Red,code);
                                         OperateResult.AppendText("<<请输入TSN\n", Color.Black);
                                         return;
                                     }
@@ -140,14 +128,12 @@ namespace UAS_MES.Make
                                             TSN = code.Text;
                                             //显示序列号
                                             show_sncode.Text = TSN;
-                                            code.Text = "";
-                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green,code);
                                             ChangeResult.Enabled = false;
                                         }
                                         else
                                         {
-                                            OperateResult.AppendText(">>不存在该已转序列号:" + code.Text + "\n", Color.Red);
-                                            code.Text = "";
+                                            OperateResult.AppendText(">>不存在该已转序列号:" + code.Text + "\n", Color.Red,code);
                                             OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
                                         }
                                     }
@@ -164,29 +150,25 @@ namespace UAS_MES.Make
                                             TSN = code.Text;
                                             //显示之前的序列号
                                             show_sncode.Text = TSN;
-                                            code.Text = "";
-                                            OperateResult.AppendText("<<请输入SN\n", Color.Green);
+                                            OperateResult.AppendText("<<请输入SN\n", Color.Green,code);
                                             ChangeResult.Enabled = false;
                                         }
                                         else
                                         //不为空,进行过转换。不勾选修改结果,就不能再修改
                                         {
-                                            OperateResult.AppendText(">>序列号" + code.Text + "已经转换过\n", Color.Red);
-                                            code.Text = "";
+                                            OperateResult.AppendText(">>序列号" + code.Text + "已经转换过\n", Color.Red,code);
                                             OperateResult.AppendText("<<请重新输入TSN\n", Color.Black);
                                         }
                                     }
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
-                                    code.Text = "";
+                                    OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
                                 }
                             }
                             else
                             {
-                                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
-                                code.Text = "";
+                                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
                             }
                         }
                         else if (step == 1)
@@ -207,8 +189,7 @@ namespace UAS_MES.Make
                                 }
                                 //判断转换后序列号的范围是否合法
                                 if (!checkStartAndEnd()) {
-                                    OperateResult.AppendText(">>序列号" + code.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red);
-                                    code.Text = "";
+                                    OperateResult.AppendText(">>序列号" + code.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red,code);
                                     return;
                                 }
                                 //SN校验成功,合法,记录下SN
@@ -228,8 +209,7 @@ namespace UAS_MES.Make
                             else
                             {
                                 OperateResult.AppendText(">>序列号" + code.Text + "已存在\n", Color.Red);
-                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                                code.Text = "";
+                                OperateResult.AppendText(">>请输入SN\n", Color.Black,code);
                             }
                         }
                         else if (step < ListA.Rows.Count + 2)
@@ -244,8 +224,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
-                        code.Text = "";
+                        OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
                     }
                 }
                 else
@@ -277,8 +256,7 @@ namespace UAS_MES.Make
                     if (code.Text.Trim().Length != int.Parse(textbox.Text))
                     {
                         //序列号校验错误,长度错误
-                        OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,长度错误\n", Color.Red);
-                        code.Text = "";
+                        OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,长度错误\n", Color.Red,code);
                         OperateResult.AppendText("<<请重新输入" + TSNorSN + "\n", Color.Black);
                         return false;
                     }
@@ -289,8 +267,7 @@ namespace UAS_MES.Make
                     if (!code.Text.StartsWith(textbox.Text.Trim()))
                     {
                         //序列号校验错误,前缀错误
-                        OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,前缀错误\n", Color.Red);
-                        code.Text = "";
+                        OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,前缀错误\n", Color.Red,code);
                         OperateResult.AppendText("<<请重新输入" + TSNorSN + "\n", Color.Black);
                         return false;
                     }
@@ -310,8 +287,7 @@ namespace UAS_MES.Make
             if ((ListA.Rows[step - 2]["psr_length"].ToString() == "" ? true : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
             {
                 OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"] + "长度校验不通过,请重新输入\n", Color.Red);
-                OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black);
-                code.Text = "";
+                OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black,code);
                 return false;
             }
             //以|符号分割前缀
@@ -329,8 +305,7 @@ namespace UAS_MES.Make
             if (!isfit)
             {
                 OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"] + "前缀校验不通过,请重新输入\n", Color.Red);
-                OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black);
-                code.Text = "";
+                OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black,code);
                 return false;
             }
             switch (type)
@@ -341,8 +316,7 @@ namespace UAS_MES.Make
                     if (!ChangeResult.Checked&&checkExist("ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "'"))
                     {
                         OperateResult.AppendText(">>" + type + ":" + code.Text + "错误,不允许重复\n", Color.Red);
-                        OperateResult.AppendText(">>请输入" + type + "\n", Color.Black);
-                        code.Text = "";
+                        OperateResult.AppendText(">>请输入" + type + "\n", Color.Black,code);
                         return false;
                     }
                     else
@@ -351,8 +325,7 @@ namespace UAS_MES.Make
                         if (imei.ToString().Contains(code.Text))
                         {
                             OperateResult.AppendText(">>" + type + ":" + code.Text + "已录,请重新输入\n", Color.Red);
-                            OperateResult.AppendText(">>请输入" + type + "\n", Color.Black);
-                            code.Text = "";
+                            OperateResult.AppendText(">>请输入" + type + "\n", Color.Black,code);
                             return false;
                         }
                     }
@@ -366,8 +339,7 @@ namespace UAS_MES.Make
                     if (!ChangeResult.Checked&&checkExist("MS_" + type + "='" + code.Text + "'"))
                     {
                         OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不允许重复\n", Color.Red);
-                        OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black);
-                        code.Text = "";
+                        OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black,code);
                         return false;
                     }
                     //通过校验,将包含IMEI的值拼接
@@ -453,8 +425,7 @@ namespace UAS_MES.Make
                 else
                 {
                     OperateResult.AppendText(">>序列号" + SN + "已存在\n", Color.Red);
-                    OperateResult.AppendText(">>请重新输入TSN\n", Color.Black);
-                    code.Text = "";
+                    OperateResult.AppendText(">>请重新输入TSN\n", Color.Black,code);
                     //清空信息
                     clearInfo();
                 }
@@ -463,8 +434,7 @@ namespace UAS_MES.Make
             }
             else
             {
-                OperateResult.AppendText("<<请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green);
-                code.Text = "";
+                OperateResult.AppendText("<<请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green,code);
                 return true;
             }
         }

+ 11 - 28
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -86,8 +86,7 @@ namespace UAS_MES.Make
                             if (oMakeCode == "")
                             {
                                 OperateResult.AppendText(">>序列号:" + sncode.Text + " 未归属工单\n", Color.Red);
-                                OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Black);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Black,sncode);
                                 return;
                             }
                             //用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
@@ -110,12 +109,6 @@ namespace UAS_MES.Make
                                         //ms_makecode_lock.Checked = true;
                                     }
                                 }
-                                //判断用户是否锁定输入转换前序列号长度,
-                                if (!checkLengthOrPre(beforeTransSNLength_checkBox, beforeTransSNLength, "长度"))
-                                    return;
-                                //判断用户是否锁定输入转换前序列号前缀,
-                                if (!checkLengthOrPre(beforeTransSNPre_checkBox, beforeTransSNPre, "前缀"))
-                                    return;
                                 switch (ChangeResult.CheckState)
                                 {
                                     //勾选是修改已转换的序列,矫正修改错了的序列号
@@ -125,14 +118,12 @@ namespace UAS_MES.Make
                                             bsncode = sncode.Text;
                                             //显示序列号
                                             show_sncode.Text = bsncode;
-                                            sncode.Text = "";
-                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green,sncode);
                                             ChangeResult.Enabled = false;
                                         }
                                         else
                                         {
-                                            OperateResult.AppendText(">>不存在该已转序列号:" + sncode.Text + "\n", Color.Red);
-                                            sncode.Text = "";
+                                            OperateResult.AppendText(">>不存在该已转序列号:" + sncode.Text + "\n", Color.Red,sncode);
                                             OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
                                         }
                                         break;
@@ -146,15 +137,13 @@ namespace UAS_MES.Make
                                             bsncode = sncode.Text;
                                             //显示序列号
                                             show_sncode.Text = bsncode;
-                                            sncode.Text = "";
-                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green,sncode);
                                             ChangeResult.Enabled = false;
                                         }
                                         else
                                         //不为空,进行过转换。不勾选修改结果,就不能再修改
                                         {
-                                            OperateResult.AppendText(">>序列号" + sncode.Text + "错误,或者已经转换过\n", Color.Red);
-                                            sncode.Text = "";
+                                            OperateResult.AppendText(">>序列号" + sncode.Text + "错误,或者已经转换过\n", Color.Red,sncode);
                                             OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
                                         }
                                         break;
@@ -164,8 +153,7 @@ namespace UAS_MES.Make
                             }
                             else
                             {
-                                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,sncode);
                             }
                         }
                         //bsncode不为空,说明输入的是转换后的序列号
@@ -180,8 +168,7 @@ namespace UAS_MES.Make
                             //判断输入的转换后序列号是否符合起始终止
                             if (!checkStartAndEnd())
                             {
-                                OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red);
-                                sncode.Text = "";
+                                OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red,sncode);
                                 return;
                             }
                             //如果两次输入的序列号相同进行提示,不相同则进行下一步
@@ -245,8 +232,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,sncode);
                     }
                 }
                 else
@@ -271,8 +257,7 @@ namespace UAS_MES.Make
         private void ReCall_Click(object sender, EventArgs e)
         {
             bsncode = "";
-            show_sncode.Text = "";
-            OperateResult.AppendText(">>请输需要转换的序列号\n", Color.Green);
+            OperateResult.AppendText(">>请输需要转换的序列号\n", Color.Green,show_sncode);
             ChangeResult.Enabled = true;
         }
         /// <summary>
@@ -427,8 +412,7 @@ namespace UAS_MES.Make
                     if (sncode.Text.Trim().Length != int.Parse(textbox.Text))
                     {
                         //序列号校验错误,长度错误
-                        OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,长度错误\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,长度错误\n", Color.Red,sncode);
                         OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
                         return false;
                     }
@@ -439,8 +423,7 @@ namespace UAS_MES.Make
                     if (!sncode.Text.StartsWith(textbox.Text.Trim()))
                     {
                         //序列号校验错误,前缀错误
-                        OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,前缀错误\n", Color.Red);
-                        sncode.Text = "";
+                        OperateResult.AppendText(">>序列号" + sncode.Text + "校验错误,前缀错误\n", Color.Red,sncode);
                         OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
                         return false;
                     }

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -315,7 +315,7 @@ namespace UAS_MES.Make
                 //如果不是返修的
                 if (ifrework == "0")
                 {
-                    dt = (DataTable)dh.ExecuteSql("select mb_id,bc_name,mbr_mbid from makebad left join makebadreason on mbr_mbid=mb_id left join badcode on mb_badcode=bc_code where mb_sncode='" + ms_sncode.Text + "' and mb_status=0", "select");
+                    dt = (DataTable)dh.ExecuteSql("select mb_id,bc_name,mbr_mbid from makebad left join makebadreason on mbr_mbid=mb_id left join badcode on mb_badcode=bc_code where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and mb_status=0", "select");
                     for (int i = 0; i < dt.Rows.Count; i++)
                     {
                         if (dt.Rows[i]["mb_id"].ToString() != dt.Rows[i]["mbr_mbid"].ToString())
@@ -447,7 +447,7 @@ namespace UAS_MES.Make
                     string status = dt.Rows[0]["ms_status"].ToString();
                     if (status == "1" || status == "2")
                     {
-                        dh.UpdateByCondition("steppassed", "sp_result='不良品',sp_ifng=-1,sp_ymd=to_char(sysdate,'yyyymmdd'),sp_hm=to_char(sysdate,'hh24miss')", "sp_id=(select max(sp_id) from steppassed where sp_sncode='"+ms_sncode.Text+"')");
+                        dh.UpdateByCondition("steppassed", "sp_result='不良品',sp_ifng=-1,sp_ymd=to_char(sysdate,'yyyymmdd'),sp_hm=to_char(sysdate,'hh24miss')", "sp_id=(select max(sp_id) from steppassed where sp_sncode='" + ms_sncode.Text + "')");
                         dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty-1", "mcd_macode='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                         dh.UpdateByCondition("makeserial", "ms_nextstepcode=''", "ms_sncode='" + ms_sncode.Text + "'");
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集不良", "采集不良成功", ms_sncode.Text, ob_checkno.Text);

+ 480 - 0
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.Designer.cs

@@ -0,0 +1,480 @@
+namespace UAS_MES.OQC
+{
+    partial class OQC_CheckNoSplit
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_CheckNoSplit));
+            this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_checkno_label = new System.Windows.Forms.Label();
+            this.obd_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.obd_outboxcode_label = new System.Windows.Forms.Label();
+            this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_sncode_label = new System.Windows.Forms.Label();
+            this.ob_prodcode_label = new System.Windows.Forms.Label();
+            this.pr_spec_label = new System.Windows.Forms.Label();
+            this.ob_prodcode = new System.Windows.Forms.Label();
+            this.pr_spec = new System.Windows.Forms.Label();
+            this.GetBatch = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.OutBoxDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.obd_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.obd_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.obd_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.obd_builddate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.choosedsn_label = new System.Windows.Forms.Label();
+            this.choosedsn = new System.Windows.Forms.Label();
+            this.totalsn = new System.Windows.Forms.Label();
+            this.totalsn_label = new System.Windows.Forms.Label();
+            this.new_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.new_checkno_lable = new System.Windows.Forms.Label();
+            this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.SplitCheckNo = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            ((System.ComponentModel.ISupportInitialize)(this.OutBoxDGV)).BeginInit();
+            this.groupBoxWithBorder2.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // ob_checkno
+            // 
+            this.ob_checkno.AllPower = "";
+            this.ob_checkno.BackColor = System.Drawing.Color.White;
+            this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ob_checkno.ID = null;
+            this.ob_checkno.Location = new System.Drawing.Point(153, 38);
+            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4);
+            this.ob_checkno.Name = "ob_checkno";
+            this.ob_checkno.Power = "";
+            this.ob_checkno.Size = new System.Drawing.Size(547, 27);
+            this.ob_checkno.Str = null;
+            this.ob_checkno.Str1 = null;
+            this.ob_checkno.Str2 = null;
+            this.ob_checkno.TabIndex = 217;
+            this.ob_checkno.Tag = "NoAuto";
+            this.ob_checkno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyDown);
+            // 
+            // ob_checkno_label
+            // 
+            this.ob_checkno_label.AutoSize = true;
+            this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_checkno_label.Location = new System.Drawing.Point(47, 35);
+            this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_checkno_label.Name = "ob_checkno_label";
+            this.ob_checkno_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_checkno_label.TabIndex = 216;
+            this.ob_checkno_label.Text = "抽检批";
+            // 
+            // obd_outboxcode
+            // 
+            this.obd_outboxcode.AllPower = null;
+            this.obd_outboxcode.BackColor = System.Drawing.Color.White;
+            this.obd_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.obd_outboxcode.ID = null;
+            this.obd_outboxcode.Location = new System.Drawing.Point(153, 87);
+            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4);
+            this.obd_outboxcode.Name = "obd_outboxcode";
+            this.obd_outboxcode.Power = null;
+            this.obd_outboxcode.Size = new System.Drawing.Size(547, 27);
+            this.obd_outboxcode.Str = null;
+            this.obd_outboxcode.Str1 = null;
+            this.obd_outboxcode.Str2 = null;
+            this.obd_outboxcode.TabIndex = 221;
+            this.obd_outboxcode.Tag = "NoAuto";
+            this.obd_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyDown);
+            // 
+            // obd_outboxcode_label
+            // 
+            this.obd_outboxcode_label.AutoSize = true;
+            this.obd_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.obd_outboxcode_label.Location = new System.Drawing.Point(47, 84);
+            this.obd_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.obd_outboxcode_label.Name = "obd_outboxcode_label";
+            this.obd_outboxcode_label.Size = new System.Drawing.Size(52, 27);
+            this.obd_outboxcode_label.TabIndex = 220;
+            this.obd_outboxcode_label.Text = "箱号";
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.AllPower = "";
+            this.ms_sncode.BackColor = System.Drawing.Color.White;
+            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ms_sncode.ID = null;
+            this.ms_sncode.Location = new System.Drawing.Point(153, 129);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.Power = "";
+            this.ms_sncode.Size = new System.Drawing.Size(547, 27);
+            this.ms_sncode.Str = null;
+            this.ms_sncode.Str1 = null;
+            this.ms_sncode.Str2 = null;
+            this.ms_sncode.TabIndex = 219;
+            this.ms_sncode.Tag = "NoAuto";
+            this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyDown);
+            // 
+            // ms_sncode_label
+            // 
+            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(47, 127);
+            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(72, 27);
+            this.ms_sncode_label.TabIndex = 218;
+            this.ms_sncode_label.Text = "序列号";
+            // 
+            // ob_prodcode_label
+            // 
+            this.ob_prodcode_label.AutoSize = true;
+            this.ob_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_prodcode_label.Location = new System.Drawing.Point(47, 172);
+            this.ob_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_prodcode_label.Name = "ob_prodcode_label";
+            this.ob_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ob_prodcode_label.TabIndex = 222;
+            this.ob_prodcode_label.Text = "产品编号";
+            // 
+            // pr_spec_label
+            // 
+            this.pr_spec_label.AutoSize = true;
+            this.pr_spec_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_spec_label.Location = new System.Drawing.Point(392, 172);
+            this.pr_spec_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_spec_label.Name = "pr_spec_label";
+            this.pr_spec_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_spec_label.TabIndex = 224;
+            this.pr_spec_label.Text = "名称规格";
+            // 
+            // ob_prodcode
+            // 
+            this.ob_prodcode.AutoSize = true;
+            this.ob_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_prodcode.Location = new System.Drawing.Point(155, 172);
+            this.ob_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_prodcode.Name = "ob_prodcode";
+            this.ob_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ob_prodcode.TabIndex = 225;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.AutoSize = true;
+            this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_spec.Location = new System.Drawing.Point(492, 172);
+            this.pr_spec.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Size = new System.Drawing.Size(0, 27);
+            this.pr_spec.TabIndex = 226;
+            // 
+            // GetBatch
+            // 
+            this.GetBatch.AllPower = "";
+            this.GetBatch.BackColor = System.Drawing.Color.Transparent;
+            this.GetBatch.DownImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.DownImage")));
+            this.GetBatch.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.GetBatch.Image = null;
+            this.GetBatch.IsShowBorder = true;
+            this.GetBatch.Location = new System.Drawing.Point(748, 127);
+            this.GetBatch.Margin = new System.Windows.Forms.Padding(4);
+            this.GetBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.MoveImage")));
+            this.GetBatch.Name = "GetBatch";
+            this.GetBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.NormalImage")));
+            this.GetBatch.Power = "";
+            this.GetBatch.Size = new System.Drawing.Size(80, 30);
+            this.GetBatch.TabIndex = 227;
+            this.GetBatch.Text = "获取批";
+            this.GetBatch.UseVisualStyleBackColor = true;
+            this.GetBatch.Click += new System.EventHandler(this.GetBatch_Click);
+            // 
+            // OutBoxDGV
+            // 
+            this.OutBoxDGV.AllowUserToAddRows = false;
+            this.OutBoxDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.OutBoxDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.choose,
+            this.obd_outboxcode1,
+            this.obd_makecode,
+            this.obd_sncode,
+            this.obd_builddate});
+            this.OutBoxDGV.Location = new System.Drawing.Point(39, 281);
+            this.OutBoxDGV.Name = "OutBoxDGV";
+            this.OutBoxDGV.RowTemplate.Height = 27;
+            this.OutBoxDGV.Size = new System.Drawing.Size(776, 349);
+            this.OutBoxDGV.TabIndex = 228;
+            this.OutBoxDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OutBoxDGV_CellContentClick);
+            // 
+            // choose
+            // 
+            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose.HeaderText = "勾选";
+            this.choose.MinimumWidth = 80;
+            this.choose.Name = "choose";
+            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.choose.Width = 80;
+            // 
+            // obd_outboxcode1
+            // 
+            this.obd_outboxcode1.DataPropertyName = "obd_outboxcode";
+            this.obd_outboxcode1.HeaderText = "箱号";
+            this.obd_outboxcode1.Name = "obd_outboxcode1";
+            // 
+            // obd_makecode
+            // 
+            this.obd_makecode.DataPropertyName = "obd_makecode";
+            this.obd_makecode.HeaderText = "工单号";
+            this.obd_makecode.Name = "obd_makecode";
+            // 
+            // obd_sncode
+            // 
+            this.obd_sncode.DataPropertyName = "obd_sncode";
+            this.obd_sncode.HeaderText = "序列号";
+            this.obd_sncode.Name = "obd_sncode";
+            // 
+            // obd_builddate
+            // 
+            this.obd_builddate.DataPropertyName = "obd_builddate";
+            this.obd_builddate.HeaderText = "维护日期";
+            this.obd_builddate.MinimumWidth = 140;
+            this.obd_builddate.Name = "obd_builddate";
+            this.obd_builddate.Width = 140;
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(830, 281);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(313, 352);
+            this.OperateResult.TabIndex = 229;
+            this.OperateResult.Text = "";
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = "";
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(140, 652);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = "";
+            this.sncode.Size = new System.Drawing.Size(204, 25);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 231;
+            this.sncode.Tag = "NoAuto";
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_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(34, 650);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(72, 27);
+            this.label1.TabIndex = 230;
+            this.label1.Text = "序列号";
+            // 
+            // choosedsn_label
+            // 
+            this.choosedsn_label.AutoSize = true;
+            this.choosedsn_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.choosedsn_label.Location = new System.Drawing.Point(558, 652);
+            this.choosedsn_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.choosedsn_label.Name = "choosedsn_label";
+            this.choosedsn_label.Size = new System.Drawing.Size(52, 27);
+            this.choosedsn_label.TabIndex = 232;
+            this.choosedsn_label.Text = "已选";
+            // 
+            // choosedsn
+            // 
+            this.choosedsn.AutoSize = true;
+            this.choosedsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.choosedsn.Location = new System.Drawing.Point(621, 652);
+            this.choosedsn.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.choosedsn.Name = "choosedsn";
+            this.choosedsn.Size = new System.Drawing.Size(24, 27);
+            this.choosedsn.TabIndex = 233;
+            this.choosedsn.Text = "0";
+            // 
+            // totalsn
+            // 
+            this.totalsn.AutoSize = true;
+            this.totalsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.totalsn.Location = new System.Drawing.Point(747, 652);
+            this.totalsn.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.totalsn.Name = "totalsn";
+            this.totalsn.Size = new System.Drawing.Size(24, 27);
+            this.totalsn.TabIndex = 235;
+            this.totalsn.Text = "0";
+            // 
+            // totalsn_label
+            // 
+            this.totalsn_label.AutoSize = true;
+            this.totalsn_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.totalsn_label.Location = new System.Drawing.Point(687, 652);
+            this.totalsn_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.totalsn_label.Name = "totalsn_label";
+            this.totalsn_label.Size = new System.Drawing.Size(52, 27);
+            this.totalsn_label.TabIndex = 234;
+            this.totalsn_label.Text = "总数";
+            // 
+            // new_checkno
+            // 
+            this.new_checkno.AllPower = "";
+            this.new_checkno.BackColor = System.Drawing.Color.White;
+            this.new_checkno.ID = null;
+            this.new_checkno.Location = new System.Drawing.Point(192, 239);
+            this.new_checkno.Margin = new System.Windows.Forms.Padding(4);
+            this.new_checkno.Name = "new_checkno";
+            this.new_checkno.Power = "";
+            this.new_checkno.Size = new System.Drawing.Size(547, 25);
+            this.new_checkno.Str = null;
+            this.new_checkno.Str1 = null;
+            this.new_checkno.Str2 = null;
+            this.new_checkno.TabIndex = 237;
+            this.new_checkno.Tag = "NoAuto";
+            // 
+            // new_checkno_lable
+            // 
+            this.new_checkno_lable.AutoSize = true;
+            this.new_checkno_lable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.new_checkno_lable.Location = new System.Drawing.Point(86, 237);
+            this.new_checkno_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.new_checkno_lable.Name = "new_checkno_lable";
+            this.new_checkno_lable.Size = new System.Drawing.Size(92, 27);
+            this.new_checkno_lable.TabIndex = 236;
+            this.new_checkno_lable.Text = "新批次号";
+            // 
+            // groupBoxWithBorder2
+            // 
+            this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.obd_outboxcode);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_checkno_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_checkno);
+            this.groupBoxWithBorder2.Controls.Add(this.ms_sncode_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ms_sncode);
+            this.groupBoxWithBorder2.Controls.Add(this.obd_outboxcode_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_prodcode_label);
+            this.groupBoxWithBorder2.Controls.Add(this.pr_spec_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_prodcode);
+            this.groupBoxWithBorder2.Controls.Add(this.pr_spec);
+            this.groupBoxWithBorder2.Controls.Add(this.GetBatch);
+            this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(39, 8);
+            this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(1104, 210);
+            this.groupBoxWithBorder2.TabIndex = 238;
+            this.groupBoxWithBorder2.TabStop = false;
+            this.groupBoxWithBorder2.Text = "抽检信息";
+            this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
+            // 
+            // SplitCheckNo
+            // 
+            this.SplitCheckNo.AllPower = "";
+            this.SplitCheckNo.BackColor = System.Drawing.Color.Transparent;
+            this.SplitCheckNo.DownImage = ((System.Drawing.Image)(resources.GetObject("SplitCheckNo.DownImage")));
+            this.SplitCheckNo.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.SplitCheckNo.Image = null;
+            this.SplitCheckNo.IsShowBorder = true;
+            this.SplitCheckNo.Location = new System.Drawing.Point(369, 650);
+            this.SplitCheckNo.Margin = new System.Windows.Forms.Padding(4);
+            this.SplitCheckNo.MoveImage = ((System.Drawing.Image)(resources.GetObject("SplitCheckNo.MoveImage")));
+            this.SplitCheckNo.Name = "SplitCheckNo";
+            this.SplitCheckNo.NormalImage = ((System.Drawing.Image)(resources.GetObject("SplitCheckNo.NormalImage")));
+            this.SplitCheckNo.Power = "";
+            this.SplitCheckNo.Size = new System.Drawing.Size(80, 30);
+            this.SplitCheckNo.TabIndex = 228;
+            this.SplitCheckNo.Text = "拆批";
+            this.SplitCheckNo.UseVisualStyleBackColor = true;
+            this.SplitCheckNo.Click += new System.EventHandler(this.SplitCheckNo_Click);
+            // 
+            // OQC_CheckNoSplit
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1177, 696);
+            this.Controls.Add(this.SplitCheckNo);
+            this.Controls.Add(this.groupBoxWithBorder2);
+            this.Controls.Add(this.new_checkno);
+            this.Controls.Add(this.new_checkno_lable);
+            this.Controls.Add(this.totalsn);
+            this.Controls.Add(this.totalsn_label);
+            this.Controls.Add(this.choosedsn);
+            this.Controls.Add(this.choosedsn_label);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.OutBoxDGV);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "OQC_CheckNoSplit";
+            this.Tag = "OQC!CheckNoSplit";
+            this.Text = "OQC_CheckNoSplit";
+            this.Load += new System.EventHandler(this.OQC_CheckNoSplit_Load);
+            this.SizeChanged += new System.EventHandler(this.OQC_CheckNoSplit_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.OutBoxDGV)).EndInit();
+            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.PerformLayout();
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_checkno;
+        private System.Windows.Forms.Label ob_checkno_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox obd_outboxcode;
+        private System.Windows.Forms.Label obd_outboxcode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ms_sncode;
+        private System.Windows.Forms.Label ms_sncode_label;
+        private System.Windows.Forms.Label ob_prodcode_label;
+        private System.Windows.Forms.Label pr_spec_label;
+        private System.Windows.Forms.Label ob_prodcode;
+        private System.Windows.Forms.Label pr_spec;
+        private CustomControl.ButtonUtil.NormalButton GetBatch;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum OutBoxDGV;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label choosedsn_label;
+        private System.Windows.Forms.Label choosedsn;
+        private System.Windows.Forms.Label totalsn;
+        private System.Windows.Forms.Label totalsn_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox new_checkno;
+        private System.Windows.Forms.Label new_checkno_lable;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private CustomControl.ButtonUtil.NormalButton SplitCheckNo;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn obd_outboxcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn obd_makecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn obd_sncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn obd_builddate;
+    }
+}

+ 181 - 0
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.cs

@@ -0,0 +1,181 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.OQC
+{
+    public partial class OQC_CheckNoSplit : Form
+    {
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        DataHelper dh;
+        LogStringBuilder sql = new LogStringBuilder();
+        DataTable dt;
+        string ErrorMessage = "";
+
+        string CheckSn = "";
+
+        public OQC_CheckNoSplit()
+        {
+            InitializeComponent();
+        }
+
+        private void OQC_CheckNoSplit_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            dh = new DataHelper();
+        }
+
+        private void OQC_CheckNoSplit_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                GetBatch.PerformClick();
+            }
+        }
+
+        private void GetBatch_Click(object sender, EventArgs e)
+        {
+            string ErrorMessage = "";
+            DataTable[] dt = LogicHandler.GetOQCBatch(ms_sncode.Text, obd_outboxcode.Text, ob_checkno.Text, "OQCCHECKNOSPLIT", out ErrorMessage);
+            if (ErrorMessage == "")
+            {
+                BaseUtil.SetFormValue(this.Controls, dt[0]);
+                if (dt[1] != null)
+                {
+                    BaseUtil.FillDgvWithDataTable(OutBoxDGV, dt[1]);
+                }
+                int oldchecknocount = dh.getRowCount("oqcbatch", "ob_oldcheckno='" + ob_checkno.Text + "'");
+                new_checkno.Text = ob_checkno.Text + "-0" + (oldchecknocount + 1);
+                choosedsn.Text = "0";
+                totalsn.Text = OutBoxDGV.Rows.Count.ToString();
+            }
+            else OperateResult.AppendText(">>"+ErrorMessage+"\n", Color.Red);
+        }
+
+        private void SplitCheckNo_Click(object sender, EventArgs e)
+        {
+            if (choosedsn.Text != "0")
+            {
+                if (dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno='" + ob_checkno.Text + "'").ToString() == "UNCHECK")
+                {
+                    string[] sqls = new string[5];
+                    //插入新批次的主表
+                    string ob_id = dh.GetSEQ("oqcbatch_seq");
+                    sql.Clear();
+                    sql.Append("insert into oqcbatch(ob_id,ob_checkno,ob_indate,ob_checkman,ob_oldcheckno,ob_source,");
+                    sql.Append("ob_batchqty,ob_status,ob_prodcode, ob_sourcecode,ob_reworkcode,ob_orgcheckno,");
+                    sql.Append("OB_CRAFTCODE,OB_STEPCODE,OB_MAKECODE,oB_WCCODE,OB_FACTORY,OB_PROJECTCODE,OB_DESCRIPTION,");
+                    sql.Append("OB_AQLCODE,OB_REMARK) select '" + ob_id + "','" + new_checkno.Text + "',sysdate,'" + User.UserCode + "',");
+                    sql.Append("'" + ob_checkno.Text + "',ob_source,ob_batchqty,ob_status,ob_prodcode, ob_sourcecode,");
+                    sql.Append("ob_reworkcode,ob_orgcheckno,OB_CRAFTCODE, OB_STEPCODE,OB_MAKECODE,oB_WCCODE,OB_FACTORY,");
+                    sql.Append("OB_PROJECTCODE,OB_DESCRIPTION,OB_AQLCODE,OB_REMARK from oqcbatch where ob_checkno='" + ob_checkno.Text + "'");
+                    sqls[0] = sql.GetString();
+                    //插入新批次的从表
+                    sql.Clear();
+                    sql.Append("insert into oqcbatchdetail(OBD_ID,OBD_OBID,OBD_CHECKNO,OBD_SNCODE,obd_outboxcode,OBD_MAKECODE");
+                    sql.Append(",OBD_BUILDDATE,obd_prodcode) SELECT oqcbatchdetail_seq.nextval,'" + ob_id + "','" + new_checkno.Text + "',OBD_SNCODE,obd_outboxcode");
+                    sql.Append(",OBD_MAKECODE,sysdate,obd_prodcode from oqcbatchdetail where obd_checkno='" + ob_checkno.Text + "' and obd_sncode in(" + CheckSn + ")");
+                    sqls[1] = sql.GetString();
+                    sqls[2] = "update OQCBatch set ob_nowcheckqty=(select count(1) from oqcbatchdetail where obd_checkno='" + new_checkno.Text + "') where ob_checkno='" + new_checkno.Text + "'";
+                    sqls[3] = "delete from oqcbatchdetail where obd_checkno='" + ob_checkno.Text + "' and obd_sncode in (" + CheckSn + ")";
+                    sqls[4] = "update OQCBatch set ob_nowcheckqty=(select count(1) from oqcbatchdetail where obd_checkno='" + ob_checkno.Text + "') where ob_checkno='" + ob_checkno.Text + "'";
+                    dh.ExecuteSQLTran(sqls);
+                    GetBatch.PerformClick();
+                    OperateResult.AppendText(">>批次" + ob_checkno.Text + "拆解成功\n ", Color.Green);
+                }
+                else OperateResult.AppendText(">>批次状态必须是待检验\n", Color.Red);
+            }
+            else OperateResult.AppendText(">>请勾选需要拆解的序列号\n", Color.Red);
+        }
+
+        private void OutBoxDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex >= 0)
+            {
+                if (OutBoxDGV.Columns[e.ColumnIndex].Name == "choose")
+                {
+                    if (OutBoxDGV.Rows[e.RowIndex].Cells["obd_outboxcode1"].Value.ToString() != "")
+                    {
+                        string Checked = OutBoxDGV.Rows[e.RowIndex].Cells[0].EditedFormattedValue.ToString();
+                        for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
+                        {
+                            if (OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[e.RowIndex].Cells["obd_outboxcode1"].Value.ToString())
+                            {
+                                if (Checked == "True")
+                                    OutBoxDGV.Rows[i].Cells[0].Value = true;
+                                else
+                                    OutBoxDGV.Rows[i].Cells[0].Value = false;
+                            }
+                        }
+                    }
+                    int ChoosedNum = 0;
+                    CheckSn = "";
+                    for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
+                    {
+                        if (OutBoxDGV.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
+                        {
+                            ChoosedNum = ChoosedNum + 1;
+                            CheckSn += "'" + OutBoxDGV.Rows[i].Cells["obd_sncode"].Value.ToString() + "',";
+                        }
+                    }
+                    if (CheckSn != "")
+                        CheckSn = CheckSn.Substring(0, CheckSn.Length - 1);
+                    else
+                        CheckSn = "''";
+                    choosedsn.Text = ChoosedNum.ToString();
+                }
+            }
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                bool FindSN = false;
+                for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
+                {
+                    if (sncode.Text == OutBoxDGV.Rows[i].Cells["obd_sncode"].Value.ToString())
+                    {
+                        if (OutBoxDGV.Rows[i].Cells[0].EditedFormattedValue.ToString() != "True")
+                            OutBoxDGV.Rows[i].Cells[0].Value = true;
+                        else
+                            OutBoxDGV.Rows[i].Cells[0].Value = false;
+                        if (OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString() != "")
+                        {
+                            string Checked = OutBoxDGV.Rows[i].Cells[0].EditedFormattedValue.ToString();
+                            for (int j = 0; j < OutBoxDGV.Rows.Count; j++)
+                            {
+                                if (OutBoxDGV.Rows[j].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString())
+                                {
+                                    if (Checked == "True")
+                                        OutBoxDGV.Rows[j].Cells[0].Value = true;
+                                    else
+                                        OutBoxDGV.Rows[j].Cells[0].Value = false;
+                                }
+                            }
+                            FindSN = true;
+                            break;
+                        }
+                    }
+                }
+                if (!FindSN)
+                    OperateResult.AppendText(">>批次" + ob_checkno.Text + "不存在序列号" + sncode.Text + "\n", Color.Red);
+                sncode.Text = "";
+            }
+        }
+    }
+}

+ 197 - 0
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.resx

@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="GetBatch.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="GetBatch.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="GetBatch.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="SplitCheckNo.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="SplitCheckNo.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="SplitCheckNo.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 2 - 2
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -114,7 +114,7 @@ namespace UAS_MES.OQC
                 //判断当前的检验状态
                 if (ob_status.Text == "待检验" || ob_status.Text == "检验中")
                 {
-                    dt = (DataTable)dh.ExecuteSql("select obd_sncode,ob_source,ob_makecode from OQCBatchDetail left join OQCBatch  on ob_id=obd_obid where obd_sncode='" + sncode.Text + "' and ob_checkno='" + ob_checkno.Text + "'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select obd_sncode,ob_source,obd_makecode from OQCBatchDetail left join OQCBatch  on ob_id=obd_obid where obd_sncode='" + sncode.Text + "' and ob_checkno='" + ob_checkno.Text + "'", "select");
                     if (dt.Rows.Count > 0)
                     {
                         if (dt.Rows[0]["ob_source"].ToString() != "工序")
@@ -126,7 +126,7 @@ namespace UAS_MES.OQC
                             string ErrorMessage = "";
                             string oMakeCode = "";
                             string oMsID = "";
-                            if (LogicHandler.CheckStepSNAndMacode(dt.Rows[0]["ob_makecode"].ToString(), User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                            if (LogicHandler.CheckStepSNAndMacode(dt.Rows[0]["obd_makecode"].ToString(), User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                             {
                                 return true;
                             }

+ 494 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.Designer.cs

@@ -0,0 +1,494 @@
+namespace UAS_MES.Packing
+{
+    partial class Packing_CartonTransfer
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.sn_code_label = new System.Windows.Forms.Label();
+            this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pa_standardqty = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.pa_currentqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.newpack = new System.Windows.Forms.RadioButton();
+            this.movepack = new System.Windows.Forms.RadioButton();
+            this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pa_packtype = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_type = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_custcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_salecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_level = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.lastsccode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ms_msmakecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.laststepcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pa_qty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.label1 = new System.Windows.Forms.Label();
+            this.pa_currentqty_label = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.ms_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
+            this.pa_code_label = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.groupBoxWithBorder2.SuspendLayout();
+            this.groupBoxWithBorder1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // sn_code_label
+            // 
+            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(19, 480);
+            this.sn_code_label.Name = "sn_code_label";
+            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.TabIndex = 176;
+            this.sn_code_label.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(83, 480);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = null;
+            this.sn_code.Size = new System.Drawing.Size(196, 21);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 177;
+            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(9, 185);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(889, 272);
+            this.OperateResult.TabIndex = 175;
+            this.OperateResult.Text = "";
+            // 
+            // groupBoxWithBorder2
+            // 
+            this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.pa_standardqty);
+            this.groupBoxWithBorder2.Controls.Add(this.pa_currentqty);
+            this.groupBoxWithBorder2.Controls.Add(this.label4);
+            this.groupBoxWithBorder2.Controls.Add(this.label3);
+            this.groupBoxWithBorder2.Controls.Add(this.label2);
+            this.groupBoxWithBorder2.Controls.Add(this.pa_outboxcode);
+            this.groupBoxWithBorder2.Controls.Add(this.newpack);
+            this.groupBoxWithBorder2.Controls.Add(this.movepack);
+            this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(455, 10);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(446, 157);
+            this.groupBoxWithBorder2.TabIndex = 174;
+            this.groupBoxWithBorder2.TabStop = false;
+            this.groupBoxWithBorder2.Text = "转移箱";
+            this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
+            // 
+            // pa_standardqty
+            // 
+            this.pa_standardqty.AllPower = null;
+            this.pa_standardqty.BackColor = System.Drawing.Color.White;
+            this.pa_standardqty.ID = null;
+            this.pa_standardqty.Location = new System.Drawing.Point(121, 117);
+            this.pa_standardqty.Name = "pa_standardqty";
+            this.pa_standardqty.Negative = false;
+            this.pa_standardqty.Power = null;
+            this.pa_standardqty.Size = new System.Drawing.Size(196, 29);
+            this.pa_standardqty.Str = null;
+            this.pa_standardqty.Str1 = null;
+            this.pa_standardqty.Str2 = null;
+            this.pa_standardqty.TabIndex = 174;
+            // 
+            // pa_currentqty
+            // 
+            this.pa_currentqty.AutoSize = true;
+            this.pa_currentqty.CutLength = null;
+            this.pa_currentqty.Location = new System.Drawing.Point(351, 62);
+            this.pa_currentqty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_currentqty.Name = "pa_currentqty";
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
+            this.pa_currentqty.TabIndex = 173;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(277, 62);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.TabIndex = 6;
+            this.label4.Text = "箱内数量";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(36, 117);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "标准容量";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(36, 62);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.TabIndex = 4;
+            this.label2.Text = "目标箱号";
+            // 
+            // pa_outboxcode
+            // 
+            this.pa_outboxcode.AllPower = null;
+            this.pa_outboxcode.BackColor = System.Drawing.Color.White;
+            this.pa_outboxcode.ID = null;
+            this.pa_outboxcode.Location = new System.Drawing.Point(121, 59);
+            this.pa_outboxcode.Name = "pa_outboxcode";
+            this.pa_outboxcode.Power = null;
+            this.pa_outboxcode.Size = new System.Drawing.Size(150, 29);
+            this.pa_outboxcode.Str = null;
+            this.pa_outboxcode.Str1 = null;
+            this.pa_outboxcode.Str2 = null;
+            this.pa_outboxcode.TabIndex = 2;
+            this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_outboxcode_KeyDown);
+            // 
+            // newpack
+            // 
+            this.newpack.AutoSize = true;
+            this.newpack.Location = new System.Drawing.Point(140, 28);
+            this.newpack.Name = "newpack";
+            this.newpack.Size = new System.Drawing.Size(60, 25);
+            this.newpack.TabIndex = 1;
+            this.newpack.TabStop = true;
+            this.newpack.Text = "新箱";
+            this.newpack.UseVisualStyleBackColor = true;
+            this.newpack.Click += new System.EventHandler(this.movepack_Click);
+            // 
+            // movepack
+            // 
+            this.movepack.AutoSize = true;
+            this.movepack.Location = new System.Drawing.Point(40, 28);
+            this.movepack.Name = "movepack";
+            this.movepack.Size = new System.Drawing.Size(60, 25);
+            this.movepack.TabIndex = 0;
+            this.movepack.TabStop = true;
+            this.movepack.Text = "移箱";
+            this.movepack.UseVisualStyleBackColor = true;
+            this.movepack.Click += new System.EventHandler(this.movepack_Click);
+            // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.pa_packtype);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_type);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_custcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_salecode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_level);
+            this.groupBoxWithBorder1.Controls.Add(this.lastsccode);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_msmakecode);
+            this.groupBoxWithBorder1.Controls.Add(this.laststepcode);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_prodcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_qty);
+            this.groupBoxWithBorder1.Controls.Add(this.label1);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_outboxcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_code_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(9, 10);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(442, 157);
+            this.groupBoxWithBorder1.TabIndex = 173;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "原箱信息";
+            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            // 
+            // pa_packtype
+            // 
+            this.pa_packtype.AutoSize = true;
+            this.pa_packtype.CutLength = null;
+            this.pa_packtype.Location = new System.Drawing.Point(116, 13);
+            this.pa_packtype.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_packtype.Name = "pa_packtype";
+            this.pa_packtype.Size = new System.Drawing.Size(0, 21);
+            this.pa_packtype.TabIndex = 181;
+            this.pa_packtype.Visible = false;
+            // 
+            // pa_type
+            // 
+            this.pa_type.AutoSize = true;
+            this.pa_type.CutLength = null;
+            this.pa_type.Location = new System.Drawing.Point(404, 19);
+            this.pa_type.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_type.Name = "pa_type";
+            this.pa_type.Size = new System.Drawing.Size(0, 21);
+            this.pa_type.TabIndex = 180;
+            this.pa_type.Visible = false;
+            // 
+            // pa_custcode
+            // 
+            this.pa_custcode.AutoSize = true;
+            this.pa_custcode.CutLength = null;
+            this.pa_custcode.Location = new System.Drawing.Point(360, 21);
+            this.pa_custcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_custcode.Name = "pa_custcode";
+            this.pa_custcode.Size = new System.Drawing.Size(0, 21);
+            this.pa_custcode.TabIndex = 179;
+            this.pa_custcode.Visible = false;
+            // 
+            // pa_salecode
+            // 
+            this.pa_salecode.AutoSize = true;
+            this.pa_salecode.CutLength = null;
+            this.pa_salecode.Location = new System.Drawing.Point(285, 13);
+            this.pa_salecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_salecode.Name = "pa_salecode";
+            this.pa_salecode.Size = new System.Drawing.Size(0, 21);
+            this.pa_salecode.TabIndex = 178;
+            this.pa_salecode.Visible = false;
+            // 
+            // pa_level
+            // 
+            this.pa_level.AutoSize = true;
+            this.pa_level.CutLength = null;
+            this.pa_level.Location = new System.Drawing.Point(108, 13);
+            this.pa_level.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_level.Name = "pa_level";
+            this.pa_level.Size = new System.Drawing.Size(0, 21);
+            this.pa_level.TabIndex = 177;
+            this.pa_level.Visible = false;
+            // 
+            // lastsccode
+            // 
+            this.lastsccode.AutoSize = true;
+            this.lastsccode.CutLength = null;
+            this.lastsccode.Location = new System.Drawing.Point(326, 117);
+            this.lastsccode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.lastsccode.Name = "lastsccode";
+            this.lastsccode.Size = new System.Drawing.Size(0, 21);
+            this.lastsccode.TabIndex = 176;
+            // 
+            // ms_msmakecode
+            // 
+            this.ms_msmakecode.AutoSize = true;
+            this.ms_msmakecode.CutLength = null;
+            this.ms_msmakecode.Location = new System.Drawing.Point(326, 81);
+            this.ms_msmakecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ms_msmakecode.Name = "ms_msmakecode";
+            this.ms_msmakecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_msmakecode.TabIndex = 175;
+            // 
+            // laststepcode
+            // 
+            this.laststepcode.AutoSize = true;
+            this.laststepcode.CutLength = null;
+            this.laststepcode.Location = new System.Drawing.Point(108, 117);
+            this.laststepcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.laststepcode.Name = "laststepcode";
+            this.laststepcode.Size = new System.Drawing.Size(0, 21);
+            this.laststepcode.TabIndex = 174;
+            // 
+            // ms_prodcode
+            // 
+            this.ms_prodcode.AutoSize = true;
+            this.ms_prodcode.CutLength = null;
+            this.ms_prodcode.Location = new System.Drawing.Point(111, 81);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ms_prodcode.Name = "ms_prodcode";
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ms_prodcode.TabIndex = 173;
+            // 
+            // pa_qty
+            // 
+            this.pa_qty.AutoSize = true;
+            this.pa_qty.CutLength = null;
+            this.pa_qty.Location = new System.Drawing.Point(326, 42);
+            this.pa_qty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_qty.Name = "pa_qty";
+            this.pa_qty.Size = new System.Drawing.Size(0, 21);
+            this.pa_qty.TabIndex = 172;
+            // 
+            // 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(214, 41);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.TabIndex = 171;
+            this.label1.Text = "箱内数量";
+            // 
+            // pa_currentqty_label
+            // 
+            this.pa_currentqty_label.AutoSize = true;
+            this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_currentqty_label.Location = new System.Drawing.Point(214, 117);
+            this.pa_currentqty_label.Name = "pa_currentqty_label";
+            this.pa_currentqty_label.Size = new System.Drawing.Size(106, 21);
+            this.pa_currentqty_label.TabIndex = 95;
+            this.pa_currentqty_label.Text = "最后所在资源";
+            // 
+            // pr_detail_label
+            // 
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(214, 81);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(81, 21);
+            this.pr_detail_label.TabIndex = 80;
+            this.pr_detail_label.Text = "工单/合同";
+            // 
+            // ms_outboxcode
+            // 
+            this.ms_outboxcode.Caller = null;
+            this.ms_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ms_outboxcode.Location = new System.Drawing.Point(112, 41);
+            this.ms_outboxcode.MakeCode = null;
+            this.ms_outboxcode.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.ms_outboxcode.Name = "ms_outboxcode";
+            this.ms_outboxcode.Pr_id = null;
+            this.ms_outboxcode.ProdCode = null;
+            this.ms_outboxcode.ShowClickIcon = false;
+            this.ms_outboxcode.Size = new System.Drawing.Size(103, 22);
+            this.ms_outboxcode.TabIndex = 163;
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(5, 81);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.TabIndex = 81;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // pr_outboxinnerqty_label
+            // 
+            this.pr_outboxinnerqty_label.AutoSize = true;
+            this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(5, 117);
+            this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
+            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(106, 21);
+            this.pr_outboxinnerqty_label.TabIndex = 97;
+            this.pr_outboxinnerqty_label.Text = "最后所在工序";
+            // 
+            // pa_code_label
+            // 
+            this.pa_code_label.AutoSize = true;
+            this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_code_label.Location = new System.Drawing.Point(5, 42);
+            this.pa_code_label.Name = "pa_code_label";
+            this.pa_code_label.Size = new System.Drawing.Size(58, 21);
+            this.pa_code_label.TabIndex = 113;
+            this.pa_code_label.Text = "原箱号";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(608, 477);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 178;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Packing_CartonTransfer
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(910, 527);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.sn_code);
+            this.Controls.Add(this.sn_code_label);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.groupBoxWithBorder2);
+            this.Controls.Add(this.groupBoxWithBorder1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Name = "Packing_CartonTransfer";
+            this.Tag = "Packing!CartonTransfer";
+            this.Text = "卡通箱转移";
+            this.Load += new System.EventHandler(this.卡通箱转移_Load);
+            this.SizeChanged += new System.EventHandler(this.卡通箱转移_SizeChanged);
+            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.PerformLayout();
+            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private System.Windows.Forms.Label pa_currentqty_label;
+        private System.Windows.Forms.Label pr_detail_label;
+        private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode ms_outboxcode;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label pr_outboxinnerqty_label;
+        private System.Windows.Forms.Label pa_code_label;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.RadioButton movepack;
+        private System.Windows.Forms.RadioButton newpack;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pa_outboxcode;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label4;
+        private CustomControl.ValueLabel.ValueLabel pa_qty;
+        private CustomControl.ValueLabel.ValueLabel ms_prodcode;
+        private CustomControl.ValueLabel.ValueLabel laststepcode;
+        private CustomControl.ValueLabel.ValueLabel ms_msmakecode;
+        private CustomControl.ValueLabel.ValueLabel lastsccode;
+        private CustomControl.ValueLabel.ValueLabel pa_currentqty;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label sn_code_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sn_code;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox pa_standardqty;
+        private CustomControl.ValueLabel.ValueLabel pa_level;
+        private CustomControl.ValueLabel.ValueLabel pa_salecode;
+        private CustomControl.ValueLabel.ValueLabel pa_custcode;
+        private CustomControl.ValueLabel.ValueLabel pa_type;
+        private CustomControl.ValueLabel.ValueLabel pa_packtype;
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 247 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -0,0 +1,247 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Packing
+{
+    public partial class Packing_CartonTransfer : Form
+    {
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataTable dt;
+
+        DataTable dt1;
+
+        DataTable dtbar;
+
+        DataTable dtst;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        DataHelper dh;
+
+        public Packing_CartonTransfer()
+        {
+            InitializeComponent();
+        }
+
+        private void 卡通箱转移_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            dh = new DataHelper();
+            movepack.Focus();
+            OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+        }
+
+        private void 卡通箱转移_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void movepack_Click(object sender, EventArgs e)
+        {
+            if (((RadioButton)sender).Checked == true)
+            {
+                if (((RadioButton)sender).Name == "movepack")
+                {
+                    pa_standardqty.Enabled = false;
+                    pa_outboxcode.Focus();
+                }
+                else if (((RadioButton)sender).Name == "newpack")
+                {
+                    pa_standardqty.Enabled = true;
+                    pa_outboxcode.Focus();
+                }
+
+            }
+        }
+
+        private void pa_outboxcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (newpack.Checked)
+                {
+                    if (dh.CheckExist("package", "pa_outboxcode = '" + pa_outboxcode.Text + "'"))
+                    {
+                        OperateResult.AppendText(">>该箱号" + pa_outboxcode.Text + "已经存在,如需转移至已经存在的箱号,请选择移箱\n", Color.Red, pa_outboxcode);
+                        pa_outboxcode.Focus();
+                        return;
+                    }
+                }
+                else if (movepack.Checked)
+                {
+                    CheckBoxCode();       
+                }
+            }
+        }
+
+        private Boolean CheckBoxCode()
+        {
+            sql.Clear();
+            sql.Append("select pa_id,pa_outboxcode,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_prodcode,nvl(pa_downstatus,0) pa_downstatus from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                string pa_downstatus = dt.Rows[0]["pa_downstatus"].ToString();
+                string pa_currentqty = dt.Rows[0]["pa_currentqty"].ToString();
+                string pa_standardqty = dt.Rows[0]["pa_standardqty"].ToString();
+                if (pa_downstatus != "0")
+                {
+                    OperateResult.AppendText(">>该箱号" + pa_outboxcode.Text + "处于下地状态,不允许操作\n", Color.Red, pa_outboxcode);
+                    OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+                    pa_outboxcode.Focus();
+                    return false;
+
+                }
+                else if (pa_currentqty == pa_standardqty)
+                {
+                    OperateResult.AppendText(">>目标箱号" + pa_outboxcode.Text + "已装满\n", Color.Red, pa_outboxcode);
+                    OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+                    pa_outboxcode.Focus();
+                    return false;
+                }
+                BaseUtil.SetFormValue(this.Controls, dt);
+                return true;
+            }
+            else
+            {
+                OperateResult.AppendText(">>该箱号" + pa_outboxcode.Text + "不存在\n", Color.Red, pa_outboxcode);
+                OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+                pa_outboxcode.Focus();
+                return false;
+            }
+        }
+
+        private void sn_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+
+                string ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode = '" + sn_code.Text + "'").ToString();
+                if (ms_id != "")
+                {
+                    sql.Clear();
+                    sql.Append("select ms_id,ms_prodcode,ms_outboxcode,ms_makecode ms_msmakecode, ms_sccode,");
+                    sql.Append("nvl(ms_currentstepcode,ms_stepcode ) laststepcode, ms_sccode lastsccode,");
+                    sql.Append("ms_checkno from makeserial where ms_id='" + ms_id + "'");
+                    dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    string ms_outboxcode = dt1.Rows[0]["ms_outboxcode"].ToString();
+                    if (ms_outboxcode != "")
+                    {
+                        sql.Clear();
+                        sql.Append("select pa_id,pa_checkno,PA_CURRENTQTY pa_qty,PA_PACKTYPE,nvl(PA_DOWNSTATUS,0) PA_DOWNSTATUS,pa_prodcode  pa_macode,pa_salecode,pa_level,pa_custcode,pa_type,pa_packtype from package where pa_outboxcode='" + ms_outboxcode + "'");
+                        dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dtbar.Rows.Count > 0)
+                        {
+                            string pa_checkno = dtbar.Rows[0]["pa_checkno"].ToString();
+                            string PA_DOWNSTATUS = dtbar.Rows[0]["PA_DOWNSTATUS"].ToString();
+                            string ob_result = dh.getFieldDataByCondition("oqcbatch","ob_result","ob_checkno = '"+ pa_checkno + "'").ToString();
+                            if (PA_DOWNSTATUS == "0")
+                            {
+                                BaseUtil.SetFormValue(this.Controls, dtbar);
+                                BaseUtil.SetFormValue(this.Controls, dt1);
+                                if (newpack.Checked)
+                                {
+                                    if (ob_result == "")
+                                    {
+                                        if (pa_standardqty.Text != "")
+                                        {
+                                            if (pa_outboxcode.Text != "")
+                                            {
+                                                if (dh.CheckExist("package", "pa_outboxcode = '" + pa_outboxcode.Text + "'"))
+                                                {
+                                                    OperateResult.AppendText(">>该箱号" + pa_outboxcode.Text + "已经存在,如需转移至已经存在的箱号,请选择移箱\n", Color.Red, pa_outboxcode);
+                                                    pa_outboxcode.Focus();
+                                                    return;
+                                                }
+                                                else {
+                                                    string pa_id = dh.GetSEQ("package_seq");
+                                                    //新增箱
+                                                    sql.Clear();
+                                                    sql.Append("insert into package (PA_ID, PA_OUTBOXCODE,PA_PRODCODE, PA_PACKDATE,");
+                                                    sql.Append("PA_LEVEL,PA_PACKAGEQTY,PA_TOTALQTY,PA_MAKECODE,PA_STATUS,PA_INDATE,");
+                                                    sql.Append("PA_SALECODE,PA_CUSTCODE,PA_TYPE,PA_CURRENTQTY,PA_PACKTYPE,PA_STANDARDQTY)");
+                                                    sql.Append("values ('"+pa_id+"','" + pa_outboxcode.Text+"','"+ ms_prodcode.Text + "',sysdate,'"+pa_level.Text+"','0','0'");
+                                                    sql.Append(",'"+ ms_msmakecode.Text + "','0',sysdate,'"+pa_salecode.Text+"','"+pa_custcode.Text+"','"+pa_type.Text+"','0','"+ pa_packtype.Text + "','"+pa_standardqty.Text+"')");
+                                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                                    sql.Clear();
+                                                    sql.Append("insert into packagedetail (PD_ID,PD_PAID,PD_OUTBOXCODE,PD_BARCODE,PD_INNERQTY,PD_PRODCODE,PD_MAKECODE,PD_BUILDDATE,PD_YMD)");
+                                                    sql.Append("values (packagedetail_seq.nextval,'"+pa_id+"','"+ pa_outboxcode.Text + "','"+sn_code.Text+"','1','"+ ms_prodcode.Text + "','"+ ms_msmakecode.Text + "',sysdate,to_char(sysdate,'yymmdd'))");
+                                                    dh.ExecuteSql(sql.GetString(), "insert");
+
+                                                    //更新原箱数量
+                                                    dh.UpdateByCondition("package", "pa_currentqty=pa_currentqty-1", "pa_outboxcode = '" + ms_outboxcode + "'");
+                                                    //更新目标箱数量
+                                                    dh.UpdateByCondition("package", "pa_currentqty=1, pa_totalqty=1,pa_packageqty=1", "pa_outboxcode = '" + pa_outboxcode.Text + "'");
+                                                    dh.UpdateByCondition("makeserial", "ms_outboxcode = '" + pa_outboxcode.Text + "'","ms_id = '"+ ms_id + "'");
+                                                    LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ms_msmakecode.Text,User.UserLineCode,User.UserSourceCode,"卡通箱转移", "卡通箱转移,生成目标箱号"+pa_outboxcode.Text+"",sn_code.Text,"");
+                                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_msmakecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱转移", "序列号:"+sn_code.Text+",从原箱号:"+ms_outboxcode+"转移至目标箱号:"+pa_outboxcode.Text+"", sn_code.Text, "");
+                                                    OperateResult.AppendText(">>序列号:" + sn_code.Text + ",从原箱号:" + ms_outboxcode + "转移至目标箱号:" + pa_outboxcode.Text + "\n",Color.Green);
+                                                    movepack.Focus();
+                                                    pa_outboxcode_KeyDown(sender,e);
+                                                }
+                                            }
+                                            else {
+                                                OperateResult.AppendText(">>必须填写新增目标箱号\n", Color.Red);
+                                                return;
+                                            }
+                                        }
+                                        else {
+                                            OperateResult.AppendText(">>新增目标箱号必须填写标准容量\n", Color.Red);
+                                            return;
+                                        }
+                                    }
+                                    else {
+                                        OperateResult.AppendText(">>原箱" + ms_outboxcode + "处于送检状态,不允许转移\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                }
+                                else if (movepack.Checked)
+                                {
+                                    if (CheckBoxCode()) {
+
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>原箱" + ms_outboxcode + "已经下地\n", Color.Red, sn_code);
+                                return;
+                            }
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "未装箱\n", Color.Red, sn_code);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>序列号" + sn_code.Text + "未装箱\n", Color.Red, sn_code);
+                        return;
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                    return;
+                }
+            }
+
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            BaseUtil.CleanControls(this.Controls);
+        }
+    }
+}

+ 120 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 4 - 4
UAS-MES/FunctionCode/Query/Query_ExeProgress.cs

@@ -98,7 +98,7 @@ namespace UAS_MES.Query
                     currentStep= dt.Rows[0]["ms_stepcode"].ToString();
                     //查询执行过的步骤
                     sql.Clear();
-                    sql.Append("select CD_DETNO,CD_STEPCODE from craft left join craftdetail on cd_crid = cr_id  left join makeserial ");
+                    sql.Append("select CD_DETNO,CD_STEPCODE,ms_makecode 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='" + ms_id + "' order by cd_detno");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     Step = new Dictionary<int, string>();
@@ -163,7 +163,7 @@ namespace UAS_MES.Query
                     }
                     if (ifRework != "0") {
                         //完工添加绿色,未完工添加红色
-                        if (dh.CheckExist("Makeserial", "ms_sncode='" + sn_code.Text + "' and ms_reworkstatus='2'"))
+                        if (dh.CheckExist("Makeserial", "ms_id='" + ms_id + "' and ms_reworkstatus='2'"))
                             PaintColor.Add(Brushes.Green);
                         else
                             PaintColor.Add(Brushes.White);
@@ -171,7 +171,7 @@ namespace UAS_MES.Query
                     else
                     {
                         //完工添加绿色,未完工添加红色
-                        if (dh.CheckExist("Makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status='2'"))
+                        if (dh.CheckExist("Makeserial", "ms_id='" + ms_id + "' and ms_status='2'"))
                             PaintColor.Add(Brushes.Green);
                         else
                             PaintColor.Add(Brushes.White);
@@ -181,7 +181,7 @@ namespace UAS_MES.Query
                     sql.Clear();
                     sql.Append("select mp_makecode,ma_prodcode,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,");
                     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='" + sn_code.Text + "'");
+                    sql.Append("mp_sourcecode=sc_code where mp_sncode='" + sn_code.Text + "' and ma_code='"+dt.Rows[0]["ms_makecode"].ToString()+"'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     BaseUtil.FillDgvWithDataTable(CraftInfDgv, dt);
                 }

+ 1 - 1
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -20,7 +20,7 @@ namespace UAS_MES.SystemSetting
         DataHelper dh;
         DataTable dt;
         //设置Grid中Combox的静态数据,这个格式是必须的,#前面是展示值,#后面是实际值
-        string[] labeltype = { "机身标#机身标", "彩盒标#彩盒标", "卡通箱标#卡通箱标", "大箱标#大箱标", "栈板标#栈板标","自定义#自定义"};
+        string[] labeltype = { "机身标#机身标", "彩盒标#彩盒标", "卡通箱标#卡通箱标", "大箱标#大箱标", "栈板标#栈板标", "SN标签#SN标签", "自定义#自定义"};
         string[] defaultype = { "是#1", "否#0" };
         Dictionary<string, string> dic = new Dictionary<string, string>();
         //用于拼接条件查询

+ 2 - 0
UAS-MES/Login.cs

@@ -39,6 +39,7 @@ namespace UAS_MES
 
         private void Login_Load(object sender, EventArgs e)
         {
+            BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
             SystemInf.DefaultDB = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
@@ -214,6 +215,7 @@ namespace UAS_MES
 
         private void Login_FormClosing(object sender, FormClosingEventArgs e)
         {
+            BaseUtil.FormStepInOrOut(this, false);
             try
             {
                 dh.Dispose();

+ 52 - 35
UAS-MES/Main.Designer.cs

@@ -59,9 +59,10 @@
             this.ProductName.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.ProductName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ProductName.ForeColor = System.Drawing.SystemColors.ButtonFace;
-            this.ProductName.Location = new System.Drawing.Point(81, 3);
+            this.ProductName.Location = new System.Drawing.Point(108, 4);
+            this.ProductName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ProductName.Name = "ProductName";
-            this.ProductName.Size = new System.Drawing.Size(170, 21);
+            this.ProductName.Size = new System.Drawing.Size(212, 27);
             this.ProductName.TabIndex = 3;
             this.ProductName.Text = "优软科技制造执行系统";
             // 
@@ -72,10 +73,11 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.MainTabControl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MainTabControl.ItemSize = new System.Drawing.Size(96, 25);
-            this.MainTabControl.Location = new System.Drawing.Point(140, 32);
+            this.MainTabControl.Location = new System.Drawing.Point(187, 40);
+            this.MainTabControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.MainTabControl.Name = "MainTabControl";
             this.MainTabControl.SelectedIndex = 0;
-            this.MainTabControl.Size = new System.Drawing.Size(838, 560);
+            this.MainTabControl.Size = new System.Drawing.Size(1117, 700);
             this.MainTabControl.TabIndex = 7;
             this.MainTabControl.ControlRemoved += new System.Windows.Forms.ControlEventHandler(this.MainTabControl_ControlRemoved);
             // 
@@ -84,9 +86,10 @@
             this.name_label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.name_label.AutoSize = true;
             this.name_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.name_label.Location = new System.Drawing.Point(6, 8);
+            this.name_label.Location = new System.Drawing.Point(8, 10);
+            this.name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.name_label.Name = "name_label";
-            this.name_label.Size = new System.Drawing.Size(35, 17);
+            this.name_label.Size = new System.Drawing.Size(43, 20);
             this.name_label.TabIndex = 4;
             this.name_label.Text = "姓名:";
             // 
@@ -103,9 +106,10 @@
             this.BasicInf.Controls.Add(this.Inf_source_label);
             this.BasicInf.Controls.Add(this.name_label);
             this.BasicInf.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.BasicInf.Location = new System.Drawing.Point(0, 593);
+            this.BasicInf.Location = new System.Drawing.Point(0, 741);
+            this.BasicInf.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.BasicInf.Name = "BasicInf";
-            this.BasicInf.Size = new System.Drawing.Size(978, 31);
+            this.BasicInf.Size = new System.Drawing.Size(1304, 39);
             this.BasicInf.TabIndex = 6;
             // 
             // inf_currentstep
@@ -113,9 +117,10 @@
             this.inf_currentstep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.inf_currentstep.AutoSize = true;
             this.inf_currentstep.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.inf_currentstep.Location = new System.Drawing.Point(228, 8);
+            this.inf_currentstep.Location = new System.Drawing.Point(304, 10);
+            this.inf_currentstep.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.inf_currentstep.Name = "inf_currentstep";
-            this.inf_currentstep.Size = new System.Drawing.Size(0, 17);
+            this.inf_currentstep.Size = new System.Drawing.Size(0, 20);
             this.inf_currentstep.TabIndex = 15;
             // 
             // step_label
@@ -123,9 +128,10 @@
             this.step_label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.step_label.AutoSize = true;
             this.step_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.step_label.Location = new System.Drawing.Point(147, 8);
+            this.step_label.Location = new System.Drawing.Point(196, 10);
+            this.step_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.step_label.Name = "step_label";
-            this.step_label.Size = new System.Drawing.Size(59, 17);
+            this.step_label.Size = new System.Drawing.Size(73, 20);
             this.step_label.TabIndex = 14;
             this.step_label.Text = "岗位工序:";
             // 
@@ -134,9 +140,10 @@
             this.inf_name.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.inf_name.AutoSize = true;
             this.inf_name.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.inf_name.Location = new System.Drawing.Point(64, 8);
+            this.inf_name.Location = new System.Drawing.Point(85, 10);
+            this.inf_name.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.inf_name.Name = "inf_name";
-            this.inf_name.Size = new System.Drawing.Size(0, 17);
+            this.inf_name.Size = new System.Drawing.Size(0, 20);
             this.inf_name.TabIndex = 13;
             // 
             // Inf_linecode
@@ -144,9 +151,10 @@
             this.Inf_linecode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.Inf_linecode.AutoSize = true;
             this.Inf_linecode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Inf_linecode.Location = new System.Drawing.Point(406, 8);
+            this.Inf_linecode.Location = new System.Drawing.Point(541, 10);
+            this.Inf_linecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Inf_linecode.Name = "Inf_linecode";
-            this.Inf_linecode.Size = new System.Drawing.Size(0, 17);
+            this.Inf_linecode.Size = new System.Drawing.Size(0, 20);
             this.Inf_linecode.TabIndex = 11;
             // 
             // inf_source
@@ -154,9 +162,10 @@
             this.inf_source.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.inf_source.AutoSize = true;
             this.inf_source.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.inf_source.Location = new System.Drawing.Point(565, 8);
+            this.inf_source.Location = new System.Drawing.Point(753, 10);
+            this.inf_source.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.inf_source.Name = "inf_source";
-            this.inf_source.Size = new System.Drawing.Size(0, 17);
+            this.inf_source.Size = new System.Drawing.Size(0, 20);
             this.inf_source.TabIndex = 10;
             // 
             // inf_db
@@ -164,9 +173,10 @@
             this.inf_db.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.inf_db.AutoSize = true;
             this.inf_db.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.inf_db.Location = new System.Drawing.Point(772, 8);
+            this.inf_db.Location = new System.Drawing.Point(1029, 10);
+            this.inf_db.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.inf_db.Name = "inf_db";
-            this.inf_db.Size = new System.Drawing.Size(0, 17);
+            this.inf_db.Size = new System.Drawing.Size(0, 20);
             this.inf_db.TabIndex = 9;
             // 
             // Inf_linecode_label
@@ -174,9 +184,10 @@
             this.Inf_linecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.Inf_linecode_label.AutoSize = true;
             this.Inf_linecode_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Inf_linecode_label.Location = new System.Drawing.Point(346, 8);
+            this.Inf_linecode_label.Location = new System.Drawing.Point(461, 10);
+            this.Inf_linecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Inf_linecode_label.Name = "Inf_linecode_label";
-            this.Inf_linecode_label.Size = new System.Drawing.Size(35, 17);
+            this.Inf_linecode_label.Size = new System.Drawing.Size(43, 20);
             this.Inf_linecode_label.TabIndex = 8;
             this.Inf_linecode_label.Text = "线别:";
             // 
@@ -185,9 +196,10 @@
             this.db_label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.db_label.AutoSize = true;
             this.db_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.db_label.Location = new System.Drawing.Point(701, 8);
+            this.db_label.Location = new System.Drawing.Point(935, 10);
+            this.db_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.db_label.Name = "db_label";
-            this.db_label.Size = new System.Drawing.Size(47, 17);
+            this.db_label.Size = new System.Drawing.Size(58, 20);
             this.db_label.TabIndex = 7;
             this.db_label.Text = "数据库:";
             // 
@@ -196,9 +208,10 @@
             this.Inf_source_label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.Inf_source_label.AutoSize = true;
             this.Inf_source_label.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Inf_source_label.Location = new System.Drawing.Point(505, 8);
+            this.Inf_source_label.Location = new System.Drawing.Point(673, 10);
+            this.Inf_source_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Inf_source_label.Name = "Inf_source_label";
-            this.Inf_source_label.Size = new System.Drawing.Size(35, 17);
+            this.Inf_source_label.Size = new System.Drawing.Size(43, 20);
             this.Inf_source_label.TabIndex = 6;
             this.Inf_source_label.Text = "资源:";
             // 
@@ -208,18 +221,19 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel1.Controls.Add(this.Menu);
-            this.panel1.Location = new System.Drawing.Point(0, 32);
+            this.panel1.Location = new System.Drawing.Point(0, 40);
+            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(139, 562);
+            this.panel1.Size = new System.Drawing.Size(185, 702);
             this.panel1.TabIndex = 1;
             // 
             // Menu
             // 
             this.Menu.Dock = System.Windows.Forms.DockStyle.Fill;
             this.Menu.Location = new System.Drawing.Point(0, 0);
-            this.Menu.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Menu.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
             this.Menu.Name = "Menu";
-            this.Menu.Size = new System.Drawing.Size(137, 560);
+            this.Menu.Size = new System.Drawing.Size(183, 700);
             this.Menu.TabIndex = 3;
             // 
             // notifyIcon1
@@ -231,8 +245,9 @@
             // 
             this.pictureBox1.Image = global::UAS_MES.Properties.Resources.uas_blue;
             this.pictureBox1.Location = new System.Drawing.Point(0, 0);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(75, 33);
+            this.pictureBox1.Size = new System.Drawing.Size(100, 41);
             this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.pictureBox1.TabIndex = 4;
             this.pictureBox1.TabStop = false;
@@ -242,17 +257,17 @@
             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, 5, 5, 5);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(978, 32);
+            this.headBar1.Size = new System.Drawing.Size(1304, 40);
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
             // 
             // Main
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(978, 624);
+            this.ClientSize = new System.Drawing.Size(1304, 780);
             this.Controls.Add(this.BasicInf);
             this.Controls.Add(this.MainTabControl);
             this.Controls.Add(this.pictureBox1);
@@ -261,8 +276,10 @@
             this.Controls.Add(this.headBar1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Main";
             this.Text = "优软科技MES系统";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing);
             this.Load += new System.EventHandler(this.Main_Load);
             this.BasicInf.ResumeLayout(false);
             this.BasicInf.PerformLayout();

+ 5 - 0
UAS-MES/Main.cs

@@ -310,5 +310,10 @@ namespace UAS_MES
                 this.Close();
             }
         }
+
+        private void Main_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            BaseUtil.FormStepInOrOut(this, false);
+        }
     }
 }

+ 43 - 2
UAS-MES/PublicMethod/BaseUtil.cs

@@ -604,6 +604,19 @@ namespace UAS_MES.PublicMethod
             }
         }
 
+        public static void CleanControls(ControlCollection collection)
+        {
+            for (int i = 0; i < collection.Count; i++)
+            {
+                if (collection[i].Controls.Count > 0)
+                    CleanControls(collection[i].Controls);
+                if (collection[i] is EnterTextBox || collection[i] is TextBox || collection[i] is ValueLabel || collection[i] is SearchTextBox || collection[i] is ValueNumLabel || collection[i] is MaCodeSearchTextBox)
+                    collection[i].Text = "";
+                if (collection[i] is DataGridView)
+                    CleanDGVData((DataGridView)collection[i]);
+            }
+        }
+
         public static void CleanControlsText(params Control[] ctl)
         {
             foreach (Control item in ctl)
@@ -1181,6 +1194,34 @@ namespace UAS_MES.PublicMethod
             outFileStream.Close();
 
         }
-    }
-}
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="form"></param>
+        /// <param name="InOrOut">True表示打开窗体,False表示关闭窗体</param>
+        public static void FormStepInOrOut(Form form, bool InOrOut)
+        {
+            if (InOrOut)
+            {
+                for (int iNum = 0; iNum <= 10; iNum++)
+                {
+                    //变更窗体的不透明度
+                    form.Opacity = 0.1 * iNum;
+                    //暂停
+                    System.Threading.Thread.Sleep(20);
+                }
+            }
+            else
+            {
+                for (int iNum = 10; iNum >= 0; iNum--)
+                {
+                    //变更窗体的不透明度
+                    form.Opacity = 0.1 * iNum;
+                    //暂停
+                    System.Threading.Thread.Sleep(20);
+                }
+            }
+        }
+    }
+}

+ 23 - 8
UAS-MES/PublicMethod/LogicHandler.cs

@@ -388,12 +388,12 @@ namespace UAS_MES.PublicMethod
         {
             oErrorMessage = "";
             iUserCode = iUserCode.ToUpper();
-            string SQL = "select em_code,em_type,em_name from employee where upper(em_code)=:UserName ";
+            iSourceCode = iSourceCode.ToUpper();
+            string SQL = "select em_code,em_type from employee where upper(em_code)=:UserName ";
             DataTable dt;
             dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode);
             if (dt.Rows.Count > 0)
             {
-                string em_name = dt.Rows[0]["em_name"].ToString();
                 string em_type = dt.Rows[0]["em_type"].ToString();
                 if (iSourceCode == "")
                 {
@@ -402,7 +402,7 @@ namespace UAS_MES.PublicMethod
                 }
                 if (em_type == "admin")
                 {
-                    if (dh.CheckExist("Source", "upper(sc_code)='" + iSourceCode.ToUpper() + "' and sc_statuscode='AUDITED'"))
+                    if (dh.CheckExist("Source", "upper(sc_code)='" + iSourceCode + "' and sc_statuscode='AUDITED'"))
                     {
                         return true;
                     }
@@ -414,7 +414,7 @@ namespace UAS_MES.PublicMethod
                 }
                 else
                 {
-                    dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                    dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "upper(ur_resourcecode) ur_resourcecode" }, "upper(eg_emcode)= '" + iUserCode + "' and sc_statuscode='AUDITED'");
                     //如果存在该编号
                     if (dt.Rows.Count > 0)
                     {
@@ -599,7 +599,7 @@ namespace UAS_MES.PublicMethod
                 return GetBatch(iCheckNo, iOQCStep, out oErrorMessage);
             else if (iSnCode != "")
             {
-                SQL = "select ms_checkno from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "'";
+                SQL = "select ms_checkno from makeserial where ms_id=(select max(ms_id) from makeserial where  ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "')";
                 dt = (DataTable)dh.ExecuteSql(SQL, "select");
                 if (dt.Rows.Count == 0)
                 {
@@ -817,6 +817,21 @@ namespace UAS_MES.PublicMethod
                         oErrorMessage = "抽检批次" + iCheckNo + "不存在";
                     }
                     break;
+                case "OQCCHECKNOSPLIT":
+                    sql.Clear();
+                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_nowcheckqty,pr_spec||'|'||pr_detail pr_spec,ob_ngqty,ob_okqty,");
+                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode,ob_aqlcode,ob_maxngacceptqty from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode left join oqcitems on oi_checkno =ob_checkno and oi_projectcode =ob_projectcode where ob_checkno='" + iCheckNo + "' and ob_status='UNCHECK'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    //状态为UNCHECK或者CHECKING并且有抽样计划的才能操作
+                    if (Form.Rows.Count > 0)
+                    {
+                        sql.Clear();
+                        sql.Append("select obd_outboxcode,obd_builddate,obd_makecode,obd_sncode from oqcbatchdetail where obd_checkno='" + Form.Rows[0]["ob_checkno"].ToString() + "'");
+                        Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    }
+                    else oErrorMessage = "抽检批次" + iCheckNo + "不存在或者状态不处于待检验";
+                    break;
                 default:
                     break;
             }
@@ -1380,7 +1395,7 @@ namespace UAS_MES.PublicMethod
                         }
                         else
                         {
-                            dh.UpdateByCondition("makeserial", "ms_nextmacode='"+iMakeCode+"'", "ms_id=(select max(ms_id) from makeserial where ms_sncode='"+iSN+"')");
+                            dh.UpdateByCondition("makeserial", "ms_nextmacode='" + iMakeCode + "'", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSN + "')");
                             return true;
                         }
                     }
@@ -1406,9 +1421,9 @@ namespace UAS_MES.PublicMethod
                         {
                             return true;
                         }
-                        else ErrMessage = "长度不匹配";
+                        else ErrMessage = iSN + "长度不匹配";
                     }
-                    else ErrMessage = "前缀不匹配";
+                    else ErrMessage = iSN + "前缀不匹配";
                     break;
                 default:
                     break;

+ 11 - 3
UAS-MES/PublicMethod/Print.cs

@@ -4,6 +4,7 @@ using System.Data;
 using System.Text;
 using System.IO;
 using UAS_MES.Entity;
+using System.Windows;
 
 namespace UAS_MES.PublicMethod
 {
@@ -38,9 +39,16 @@ namespace UAS_MES.PublicMethod
                     if (doc.Variables.FormVariables.Item(i + 1).Name == dt.Rows[j]["lp_name"].ToString())
                     {
                         string sql = dt.Rows[j]["lp_sql"].ToString();
-                        sql = sql.Substring(0, sql.IndexOf("{")) + "'" + SnCode + "'";
-                        doc.Variables.FormVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
-                        sb.AppendLine("打印参数【" + doc.Variables.FormVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FormVariables.Item(i + 1).Value);
+                        try
+                        {
+                            sql = sql.Substring(0, sql.IndexOf("{")) + "'" + SnCode + "'";
+                            doc.Variables.FormVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
+                            sb.AppendLine("打印参数【" + doc.Variables.FormVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FormVariables.Item(i + 1).Value);
+                        }
+                        catch (System.Exception)
+                        {
+                            BaseUtil.ShowError("SQL" + sql + "维护不正确");
+                        }
                     }
                 }
             }

+ 0 - 1
UAS_KanBan/UAS_KanBan.csproj

@@ -150,7 +150,6 @@
       <DependentUpon>Settings.settings</DependentUpon>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
-    <None Include="UAS_KanBan_TemporaryKey.pfx" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />

BIN
UAS_MesDllService(4.0)/key.sn.snk


+ 6 - 16
UAS_MesDllService(4.0)/MESHelper.cs → UAS_MesInterface(4.0)/MesHelper.cs

@@ -1,7 +1,7 @@
-using System;
+using Oracle.ManagedDataAccess.Client;
+using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Data.OracleClient;
 using System.Runtime.InteropServices;
 using System.Text;
 
@@ -25,7 +25,6 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
-        string Test(string Test);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -39,7 +38,7 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
+        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串
@@ -782,7 +781,7 @@ namespace BenQGuru.eMES.DLLService
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -914,8 +913,8 @@ namespace BenQGuru.eMES.DLLService
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
             {
-                command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
-                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
+                command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
             }
             try
             {
@@ -959,14 +958,5 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
             }
         }
-
-        public string Test(string Test)
-        {
-            connection = new OracleConnection(ConnectionStrings);
-            connection.Open();
-            command = new OracleCommand("insert into AAAAA(Table_name) values('eqrekjhfbkjbd')",connection);
-            command.ExecuteNonQuery();
-            return connection.ServerVersion;
-        }
     }
 }

+ 3 - 3
UAS_MesDllService(4.0)/Properties/AssemblyInfo.cs → UAS_MesInterface(4.0)/Properties/AssemblyInfo.cs

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("UAS_MesDllService(4.0)")]
+[assembly: AssemblyTitle("UAS_MesInterface(4.0)")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("UAS_MesDllService(4.0)")]
+[assembly: AssemblyProduct("UAS_MesInterface(4.0)")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible(true)]
 
 // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("5c1f3f7f-67ed-4c54-9e35-9392c3518e88")]
+[assembly: Guid("a35f767d-0858-4061-af7c-c5c594034668")]
 
 // 程序集的版本信息由下列四个值组成: 
 //

+ 0 - 0
UAS_MesDllService(4.0)/tool/Oracle.ManagedDataAccess.dll → UAS_MesInterface(4.0)/tool/Oracle.ManagedDataAccess.dll


+ 5 - 3
UAS_MesInterface/MESHelper.cs

@@ -556,7 +556,7 @@ namespace BenQGuru.eMES.DLLService
             sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
             sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
             sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_rescode)");
-            ExecuteSql(sql.ToString(), "select", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
+            ExecuteSql(sql.ToString(), "insert", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
             return true;
         }
 
@@ -605,7 +605,7 @@ namespace BenQGuru.eMES.DLLService
             }
             oErrMessage = "";
             string omakecode = "";
-            string[] param = new string[] { "", iResCode, iSN, "", omakecode, "", oErrMessage };
+            string[] param = new string[] { "", iResCode, iSN, iOperator, omakecode, "", oErrMessage };
             string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
             CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
             oErrMessage = param[6];
@@ -848,7 +848,7 @@ namespace BenQGuru.eMES.DLLService
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ','&&c[j]!=')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -859,7 +859,9 @@ namespace BenQGuru.eMES.DLLService
                     }
                 }
                 for (int i = 0; i < addpar.Length; i++)
+                {
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), names[i]));
+                }
             }
             switch (Type.ToUpper())
             {

+ 2 - 1
UAS_MesInterface/UAS_MesDllService(3.5).csproj

@@ -38,7 +38,7 @@
     <SignAssembly>true</SignAssembly>
   </PropertyGroup>
   <PropertyGroup>
-    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
+    <AssemblyOriginatorKeyFile>Sec.pfx</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -57,6 +57,7 @@
   <ItemGroup>
     <None Include="bin\Debug\DllService.snk" />
     <None Include="key.snk" />
+    <None Include="Sec.pfx" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.