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

亿道物料和SN标签打印调整

callm 3 жил өмнө
parent
commit
7f7ef1b6a7

+ 1 - 1
UAS_MES_PW/FunctionCode/Make/Make_FeedingCollection.cs

@@ -349,7 +349,7 @@ namespace UAS_MES_NEW.Make
                         sql.Clear();
                         sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_spec,ma_qty from makeserial left join product ");
                         sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
-                        sql.Append("makecraftdetail_view on mcd_macode=ms_makecode where ms_id='" + oMsid + "'");
+                        sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         BaseUtil.SetFormValue(this.Controls, dt);
                         OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);

+ 66 - 24
UAS_MES_YD/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -38,6 +38,8 @@
             this.label4 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
+            this.SN = new System.Windows.Forms.RadioButton();
+            this.Material = new System.Windows.Forms.RadioButton();
             this.Mark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.MachineType = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -48,6 +50,8 @@
             this.Setting = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.PrintTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
             // ma_salecode_label
@@ -68,18 +72,18 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(211, 364);
+            this.label3.Location = new System.Drawing.Point(162, 415);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(82, 41);
+            this.label3.Size = new System.Drawing.Size(146, 41);
             this.label3.TabIndex = 31;
-            this.label3.Text = "流水";
+            this.label3.Text = "起始流水";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(1238, 454);
+            this.label2.Location = new System.Drawing.Point(1321, 107);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(82, 41);
@@ -91,16 +95,16 @@
             // 
             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(211, 275);
+            this.label1.Location = new System.Drawing.Point(162, 340);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.Size = new System.Drawing.Size(146, 41);
             this.label1.TabIndex = 28;
-            this.label1.Text = "数量";
+            this.label1.Text = "打印数量";
             // 
             // Date
             // 
-            this.Date.Location = new System.Drawing.Point(1383, 454);
+            this.Date.Location = new System.Drawing.Point(1470, 125);
             this.Date.Name = "Date";
             this.Date.Size = new System.Drawing.Size(278, 35);
             this.Date.TabIndex = 26;
@@ -110,19 +114,18 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(1238, 544);
+            this.label5.Location = new System.Drawing.Point(162, 259);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.Size = new System.Drawing.Size(178, 41);
             this.label5.TabIndex = 24;
-            this.label5.Text = "前缀";
-            this.label5.Visible = false;
+            this.label5.Text = "二维码内容";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(211, 190);
+            this.label4.Location = new System.Drawing.Point(162, 187);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(114, 41);
@@ -136,9 +139,9 @@
             this.label6.Location = new System.Drawing.Point(725, 196);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(82, 41);
+            this.label6.Size = new System.Drawing.Size(210, 41);
             this.label6.TabIndex = 35;
-            this.label6.Text = "机型";
+            this.label6.Text = "机型相关配置";
             // 
             // label7
             // 
@@ -147,16 +150,39 @@
             this.label7.Location = new System.Drawing.Point(725, 284);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(82, 41);
+            this.label7.Size = new System.Drawing.Size(146, 41);
             this.label7.TabIndex = 37;
-            this.label7.Text = "标记";
+            this.label7.Text = "工单代号";
+            // 
+            // SN
+            // 
+            this.SN.AutoSize = true;
+            this.SN.Checked = true;
+            this.SN.Location = new System.Drawing.Point(356, 60);
+            this.SN.Name = "SN";
+            this.SN.Size = new System.Drawing.Size(161, 28);
+            this.SN.TabIndex = 39;
+            this.SN.TabStop = true;
+            this.SN.Text = "内部序列号";
+            this.SN.UseVisualStyleBackColor = true;
+            this.SN.CheckedChanged += new System.EventHandler(this.SN_CheckedChanged);
+            // 
+            // Material
+            // 
+            this.Material.AutoSize = true;
+            this.Material.Location = new System.Drawing.Point(545, 60);
+            this.Material.Name = "Material";
+            this.Material.Size = new System.Drawing.Size(137, 28);
+            this.Material.TabIndex = 40;
+            this.Material.Text = "物料条码";
+            this.Material.UseVisualStyleBackColor = true;
             // 
             // Mark
             // 
             this.Mark.AllPower = null;
             this.Mark.BackColor = System.Drawing.Color.White;
             this.Mark.ID = null;
-            this.Mark.Location = new System.Drawing.Point(870, 290);
+            this.Mark.Location = new System.Drawing.Point(969, 281);
             this.Mark.Margin = new System.Windows.Forms.Padding(6);
             this.Mark.Name = "Mark";
             this.Mark.Power = null;
@@ -171,7 +197,7 @@
             this.MachineType.AllPower = null;
             this.MachineType.BackColor = System.Drawing.Color.White;
             this.MachineType.ID = null;
-            this.MachineType.Location = new System.Drawing.Point(870, 202);
+            this.MachineType.Location = new System.Drawing.Point(969, 196);
             this.MachineType.Margin = new System.Windows.Forms.Padding(6);
             this.MachineType.Name = "MachineType";
             this.MachineType.Power = null;
@@ -203,7 +229,7 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(356, 497);
+            this.Export.Location = new System.Drawing.Point(356, 656);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -220,7 +246,7 @@
             this.Rn.AllPower = null;
             this.Rn.BackColor = System.Drawing.Color.White;
             this.Rn.ID = null;
-            this.Rn.Location = new System.Drawing.Point(356, 370);
+            this.Rn.Location = new System.Drawing.Point(356, 424);
             this.Rn.Margin = new System.Windows.Forms.Padding(6);
             this.Rn.Name = "Rn";
             this.Rn.Power = null;
@@ -236,7 +262,7 @@
             this.Num.AllPower = null;
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
-            this.Num.Location = new System.Drawing.Point(356, 281);
+            this.Num.Location = new System.Drawing.Point(356, 349);
             this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
@@ -251,7 +277,7 @@
             this.Prefix.AllPower = null;
             this.Prefix.BackColor = System.Drawing.Color.White;
             this.Prefix.ID = null;
-            this.Prefix.Location = new System.Drawing.Point(1383, 550);
+            this.Prefix.Location = new System.Drawing.Point(356, 268);
             this.Prefix.Margin = new System.Windows.Forms.Padding(6);
             this.Prefix.Name = "Prefix";
             this.Prefix.Power = null;
@@ -260,7 +286,6 @@
             this.Prefix.Str1 = null;
             this.Prefix.Str2 = null;
             this.Prefix.TabIndex = 25;
-            this.Prefix.Visible = false;
             // 
             // Setting
             // 
@@ -311,11 +336,24 @@
             this.PrintTest.UseVisualStyleBackColor = true;
             this.PrintTest.Click += new System.EventHandler(this.PrintTest_Click);
             // 
+            // pictureBox1
+            // 
+            this.pictureBox1.Image = global::UAS_MES_NEW.Properties.Resources.SN;
+            this.pictureBox1.Location = new System.Drawing.Point(732, 349);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(1035, 554);
+            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pictureBox1.TabIndex = 41;
+            this.pictureBox1.TabStop = false;
+            // 
             // SystemSetting_PrinterTest
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.pictureBox1);
+            this.Controls.Add(this.Material);
+            this.Controls.Add(this.SN);
             this.Controls.Add(this.Mark);
             this.Controls.Add(this.label7);
             this.Controls.Add(this.MachineType);
@@ -341,6 +379,7 @@
             this.Tag = "Setup!PrinterTest";
             this.Text = "打印机调试";
             this.Load += new System.EventHandler(this.SystemSetting_PrinterTest_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -366,5 +405,8 @@
         private System.Windows.Forms.Label label6;
         private CustomControl.TextBoxWithIcon.EnterTextBox Mark;
         private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.RadioButton SN;
+        private System.Windows.Forms.RadioButton Material;
+        private System.Windows.Forms.PictureBox pictureBox1;
     }
 }

+ 89 - 24
UAS_MES_YD/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -14,6 +14,7 @@ namespace UAS_MES_NEW.SystemSetting
         Engine engine = new Engine();
 
         LabelFormatDocument format;
+        LabelFormatDocument format1;
 
         DataHelper dh = SystemInf.dh;
 
@@ -50,35 +51,66 @@ namespace UAS_MES_NEW.SystemSetting
 
         private void Export_Click(object sender, EventArgs e)
         {
-            //if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
-            //{
-            //    MessageBox.Show("工单号不存在");
-            //    return;
-            //}
-            format.SubStrings["Type"].Value = MachineType.Text;
-            format.SubStrings["Mark"].Value = Mark.Text;
-            for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
+            if (SN.Checked)
             {
-                int temp = i;
-                for (int j = 0; j < format.SubStrings.Count; j++)
+                if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
                 {
-                    switch (format.SubStrings[j].Name)
+                    MessageBox.Show("工单号不存在");
+                    return;
+                }
+                format.SubStrings["Type"].Value = MachineType.Text;
+                format.SubStrings["Mark"].Value = Mark.Text;
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
+                {
+                    int temp = i;
+                    for (int j = 0; j < format.SubStrings.Count; j++)
+                    {
+                        switch (format.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format.SubStrings[j].Value = (Prefix.Text + lpad(4, (temp).ToString()));
+                                dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
+                                break;
+                            case "SN2":
+                                format.SubStrings[j].Value = (Prefix.Text + lpad(4, (temp + 1).ToString()));
+                                dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    format.PrintSetup.PrinterName = PrinterList.Text;
+                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format.Print();
+                }
+            }
+            else
+            {
+                format1.SubStrings["Mark"].Value = MachineType.Text;
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 3)
+                {
+                    int temp = i;
+                    for (int j = 0; j < format1.SubStrings.Count; j++)
                     {
-                        case "SN":
-                            format.SubStrings[j].Value = (ma_code.Text +  lpad(4, (temp).ToString()));
-                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
-                            break;
-                        case "SN2":
-                            format.SubStrings[j].Value = (ma_code.Text +lpad(4, (temp + 1).ToString()));
-                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
-                            break;
-                        default:
-                            break;
+                        switch (format1.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format1.SubStrings[j].Value = (Prefix.Text);
+                                break;
+                            case "SN2":
+                                format1.SubStrings[j].Value = (Prefix.Text);
+                                break;
+                            case "SN3":
+                                format1.SubStrings[j].Value = (Prefix.Text);
+                                break;
+                            default:
+                                break;
+                        }
                     }
+                    format1.PrintSetup.PrinterName = PrinterList.Text;
+                    format1.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format1.Print();
                 }
-                format.PrintSetup.PrinterName = PrinterList.Text;
-                format.PrintSetup.IdenticalCopiesOfLabel = 1;
-                format.Print();
             }
         }
 
@@ -94,8 +126,41 @@ namespace UAS_MES_NEW.SystemSetting
 
         private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
         {
+            label5.Visible = false;
+            Prefix.Visible = false;
             engine.Start();
             format = engine.Documents.Open(Application.StartupPath + "/Label.btw");
+            format1 = engine.Documents.Open(Application.StartupPath + "/Material.btw");
+        }
+
+        private void SN_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SN.Checked)
+            {
+                label6.Text = "机型相关配置";
+                label5.Visible = false;
+                Prefix.Visible = false;
+                label7.Visible = true;
+                ma_code.Visible = true;
+                label4.Visible = true;
+                Mark.Visible = true;
+                Rn.Visible = true;
+                label3.Visible = true;
+                this.pictureBox1.Image = global::UAS_MES_NEW.Properties.Resources.SN;
+            }
+            else
+            {
+                this.pictureBox1.Image = global::UAS_MES_NEW.Properties.Resources.Material;
+                label6.Text = "标签部分(显示)";
+                label5.Visible = true;
+                Prefix.Visible = true;
+                Rn.Visible = false;
+                label3.Visible = false;
+                label7.Visible = false;
+                ma_code.Visible = false;
+                label4.Visible = false;
+                Mark.Visible = false;
+            }
         }
     }
 }

+ 20 - 0
UAS_MES_YD/Properties/Resources.Designer.cs

@@ -766,6 +766,16 @@ namespace UAS_MES_NEW.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Material {
+            get {
+                object obj = ResourceManager.GetObject("Material", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
         /// </summary>
@@ -886,6 +896,16 @@ namespace UAS_MES_NEW.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap SN {
+            get {
+                object obj = ResourceManager.GetObject("SN", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 6 - 0
UAS_MES_YD/Properties/Resources.resx

@@ -430,4 +430,10 @@
   <data name="_8378" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\Sound\8378.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
+  <data name="Material" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\15aedb5b-a345-48b6-8b81-784e410d7fd1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="SN" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\b473847f-a85b-400e-807a-4875c4c07ff1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

BIN
UAS_MES_YD/Resources/15aedb5b-a345-48b6-8b81-784e410d7fd1.png


BIN
UAS_MES_YD/Resources/20167c1d-d027-4366-95fb-6733ecc9dd80.png


BIN
UAS_MES_YD/Resources/b171f6bb-7e96-43f5-afa4-894151fa85b7.png


BIN
UAS_MES_YD/Resources/b473847f-a85b-400e-807a-4875c4c07ff1.png


BIN
UAS_MES_YD/Tool/20167c1d-d027-4366-95fb-6733ecc9dd80.png


+ 4 - 0
UAS_MES_YD/UAS_MES_YD.csproj

@@ -1662,14 +1662,18 @@
     <Content Include="adbtool\sqlite3.exe" />
     <Content Include="Resources\07.gif" />
     <Content Include="Resources\0802192135.png" />
+    <None Include="Resources\15aedb5b-a345-48b6-8b81-784e410d7fd1.png" />
     <Content Include="Resources\2-0btn_04.png" />
     <Content Include="Resources\2-0btn_07.png" />
     <Content Include="Resources\2-0btn_36.png" />
     <Content Include="Resources\20130711113247276.png" />
+    <None Include="Resources\20167c1d-d027-4366-95fb-6733ecc9dd80.png" />
     <Content Include="Resources\20170322091001575_easyicon_net_64.ico" />
     <Content Include="Resources\46.gif" />
     <Content Include="Resources\5600c803afc2d.png" />
     <Content Include="Resources\83.gif" />
+    <None Include="Resources\b171f6bb-7e96-43f5-afa4-894151fa85b7.png" />
+    <None Include="Resources\b473847f-a85b-400e-807a-4875c4c07ff1.png" />
     <Content Include="Resources\Barcode_48px_1072745_easyicon.net.png" />
     <Content Include="Resources\bindingNavigatorAddNewItem.Image.png" />
     <Content Include="Resources\bindingNavigatorDeleteItem.Image.png" />

+ 2 - 2
UAS_MES_YD/adbtool/NOTICE.txt

@@ -426,7 +426,7 @@ Notices for file(s):
 		  GNU LESSER GENERAL PUBLIC LICENSE
 		       Version 2.1, February 1999
 
- Copyright © 1991, 1999 Free Software Foundation, Inc.
+ Copyright ?1991, 1999 Free Software Foundation, Inc.
      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
@@ -896,7 +896,7 @@ convey the exclusion of warranty; and each file should have at least the
 "copyright" line and a pointer to where the full notice is found.
 
     <one line to give the library's name and a brief idea of what it does.>
-    Copyright © <year>  <name of author>
+    Copyright ?<year>  <name of author>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public