Browse Source

添加入库条码打印

callm 1 year ago
parent
commit
c7c9d3f0f4

+ 1 - 1
UAS_MES_LGDZ/CustomControl/HeadBar/HeadBar.cs

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 if (logout_confirm == "Yes")
                 if (logout_confirm == "Yes")
                 {
                 {
                     //注销的时候切换回默认数据库
                     //注销的时候切换回默认数据库
-                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();
                     SystemInf.Caller.Clear();

+ 3 - 3
UAS_MES_LGDZ/DataOperate/DataHelper.cs

@@ -10,11 +10,11 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     class DataHelper
     {
     {
         //系统默认的的连接字符串 
         //系统默认的的连接字符串 
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        //public static readonly string ERPAddesss = "http://172.16.30.253:8099/mes/";
+        //public static readonly string ERPAddesss = "http://10.11.28.21:8099/mes/";
 
 
-        public static readonly string ERPAddesss = "http://172.16.30.253:8099/mes/";
+        public static readonly string ERPAddesss = "http://10.11.28.21:8099/mes/";
 
 
         //用户选择的数据库的连接字符串
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         public static string DBConnectionString;

+ 12 - 10
UAS_MES_LGDZ/DataOperate/ExcelHandler.cs

@@ -77,14 +77,16 @@ namespace UAS_MES_NEW.DataOperate
             int DataRowCount = 8;
             int DataRowCount = 8;
             for (int i = 0; i < DataTable.Rows.Count; i++)
             for (int i = 0; i < DataTable.Rows.Count; i++)
             {
             {
-                if (DataTable.Rows[i]["STF_MACHINE"].ToString() != "" && i != DataTable.Rows.Count - 1)
+                if (DataTable.Rows[i]["STF_MACHINE"].ToString() != "" && DataTable.Rows[i]["STF_MACHINE"].ToString() != "***" && i != DataTable.Rows.Count - 1)
                 {
                 {
+                    Console.WriteLine(DataTable.Rows[i]["STF_MACHINE"].ToString());
+                    Console.WriteLine(DataTable.Rows[i + 1]["STF_MACHINE"].ToString());
                     ISheet sheet1 = book.CreateSheet(DataTable.Rows[i]["STF_MACHINE"].ToString() + "-" + DataTable.Rows[i + 1]["STF_MACHINE"].ToString().Substring(0, 1));
                     ISheet sheet1 = book.CreateSheet(DataTable.Rows[i]["STF_MACHINE"].ToString() + "-" + DataTable.Rows[i + 1]["STF_MACHINE"].ToString().Substring(0, 1));
                     SheetName = DataTable.Rows[i]["STF_MACHINE"].ToString() + "-" + DataTable.Rows[i + 1]["STF_MACHINE"].ToString().Substring(0, 1);
                     SheetName = DataTable.Rows[i]["STF_MACHINE"].ToString() + "-" + DataTable.Rows[i + 1]["STF_MACHINE"].ToString().Substring(0, 1);
                     IRow row1 = sheet1.CreateRow(0);
                     IRow row1 = sheet1.CreateRow(0);
                     row1.CreateCell(0); row1.Cells[0].SetCellValue("       SMT程式料表     ");
                     row1.CreateCell(0); row1.Cells[0].SetCellValue("       SMT程式料表     ");
-                  
-                 
+
+
                     //客户抬头
                     //客户抬头
                     IRow row2 = sheet1.CreateRow(1);
                     IRow row2 = sheet1.CreateRow(1);
                     CellRangeAddress cellRangeAddress = new CellRangeAddress(1, 1, 0, 1);
                     CellRangeAddress cellRangeAddress = new CellRangeAddress(1, 1, 0, 1);
@@ -101,7 +103,7 @@ namespace UAS_MES_NEW.DataOperate
                     row2.Cells[2].CellStyle = style; row2.Cells[3].CellStyle = style;
                     row2.Cells[2].CellStyle = style; row2.Cells[3].CellStyle = style;
                     row2.CreateCell(4); row2.CreateCell(5); row2.Cells[4].SetCellValue("文件编号://"); row2.Cells[4].CellStyle = style;
                     row2.CreateCell(4); row2.CreateCell(5); row2.Cells[4].SetCellValue("文件编号://"); row2.Cells[4].CellStyle = style;
                     row2.Cells[4].CellStyle = style; row2.Cells[5].CellStyle = style;
                     row2.Cells[4].CellStyle = style; row2.Cells[5].CellStyle = style;
-                    row2.CreateCell(6); row2.CreateCell(7); row2.Cells[6].SetCellValue("发行日期:"+DateTime.Now.ToString("yyyy-MM-dd")); row2.Cells[6].CellStyle = style;
+                    row2.CreateCell(6); row2.CreateCell(7); row2.Cells[6].SetCellValue("发行日期:" + DateTime.Now.ToString("yyyy-MM-dd")); row2.Cells[6].CellStyle = style;
                     row2.Cells[6].CellStyle = style; row2.Cells[7].CellStyle = style;
                     row2.Cells[6].CellStyle = style; row2.Cells[7].CellStyle = style;
 
 
                     //产品型号
                     //产品型号
@@ -120,7 +122,7 @@ namespace UAS_MES_NEW.DataOperate
                     row3.Cells[2].CellStyle = style; row3.Cells[3].CellStyle = style;
                     row3.Cells[2].CellStyle = style; row3.Cells[3].CellStyle = style;
                     row3.CreateCell(4); row3.CreateCell(5); row3.Cells[4].SetCellValue("BOM编号:EN-CY-BOM-143(A0)");
                     row3.CreateCell(4); row3.CreateCell(5); row3.Cells[4].SetCellValue("BOM编号:EN-CY-BOM-143(A0)");
                     row3.Cells[4].CellStyle = style; row3.Cells[5].CellStyle = style;
                     row3.Cells[4].CellStyle = style; row3.Cells[5].CellStyle = style;
-                    row3.CreateCell(6); row3.CreateCell(7); row3.Cells[6].SetCellValue("生效日期:"+DateTime.Now.ToString("yyyy-MM-dd"));
+                    row3.CreateCell(6); row3.CreateCell(7); row3.Cells[6].SetCellValue("生效日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
                     row3.Cells[6].CellStyle = style; row3.Cells[7].CellStyle = style;
                     row3.Cells[6].CellStyle = style; row3.Cells[7].CellStyle = style;
                     //程序名称
                     //程序名称
                     IRow row4 = sheet1.CreateRow(3);
                     IRow row4 = sheet1.CreateRow(3);
@@ -179,7 +181,7 @@ namespace UAS_MES_NEW.DataOperate
                     IRow row8 = sheet1.CreateRow(7);
                     IRow row8 = sheet1.CreateRow(7);
                     row8.CreateCell(0);
                     row8.CreateCell(0);
                     row8.Cells[0].SetCellValue("站位");
                     row8.Cells[0].SetCellValue("站位");
-                    row8.Cells[0].CellStyle = style; 
+                    row8.Cells[0].CellStyle = style;
 
 
                     row8.CreateCell(1);
                     row8.CreateCell(1);
                     row8.Cells[1].SetCellValue("Feeder类型");
                     row8.Cells[1].SetCellValue("Feeder类型");
@@ -189,7 +191,7 @@ namespace UAS_MES_NEW.DataOperate
                     row8.Cells[2].SetCellValue("位置");
                     row8.Cells[2].SetCellValue("位置");
                     row8.Cells[2].CellStyle = style;
                     row8.Cells[2].CellStyle = style;
 
 
-                    row8.CreateCell(3); 
+                    row8.CreateCell(3);
                     row8.Cells[3].SetCellValue("物料编码");
                     row8.Cells[3].SetCellValue("物料编码");
                     row8.Cells[3].CellStyle = style;
                     row8.Cells[3].CellStyle = style;
 
 
@@ -205,13 +207,13 @@ namespace UAS_MES_NEW.DataOperate
                     row8.Cells[6].SetCellValue("位号");
                     row8.Cells[6].SetCellValue("位号");
                     row8.Cells[6].CellStyle = style;
                     row8.Cells[6].CellStyle = style;
 
 
-                    row8.CreateCell(7); 
+                    row8.CreateCell(7);
                     row8.Cells[7].SetCellValue("备注");
                     row8.Cells[7].SetCellValue("备注");
                     row8.Cells[7].CellStyle = style;
                     row8.Cells[7].CellStyle = style;
 
 
                     i = i + 1;
                     i = i + 1;
                     DataRowCount = 8;
                     DataRowCount = 8;
-                    sheet1.SetColumnWidth(4,sheet1.GetColumnWidth(4)+3500);
+                    sheet1.SetColumnWidth(4, sheet1.GetColumnWidth(4) + 3500);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -263,7 +265,7 @@ namespace UAS_MES_NEW.DataOperate
                         row.Cells[4].CellStyle.ShrinkToFit = true;
                         row.Cells[4].CellStyle.ShrinkToFit = true;
                         DataRowCount = DataRowCount + 1;
                         DataRowCount = DataRowCount + 1;
                     }
                     }
-                 
+
                 }
                 }
             }
             }
             //将book的内容写入内存流中返回
             //将book的内容写入内存流中返回

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -167,7 +167,7 @@ namespace UAS_MES_NEW.Make
                                             string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                             string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             WebClient wc = new WebClient();
                                             WebClient wc = new WebClient();
-                                            wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                            wc.DownloadFile("http://10.11.28.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                         }
                                         }
                                     }
                                     }
                                 }
                                 }

+ 107 - 0
UAS_MES_LGDZ/FunctionCode/Query/BarCodePrint.Designer.cs

@@ -0,0 +1,107 @@
+namespace UAS_MES_NEW.Query
+{
+    partial class BarCodePrint
+    {
+        /// <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(BarCodePrint));
+            this.label1_lll_ = new System.Windows.Forms.Label();
+            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.bar_remain = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.SuspendLayout();
+            // 
+            // label1_lll_
+            // 
+            this.label1_lll_.AutoSize = true;
+            this.label1_lll_.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1_lll_.Location = new System.Drawing.Point(143, 56);
+            this.label1_lll_.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1_lll_.Name = "label1_lll_";
+            this.label1_lll_.Size = new System.Drawing.Size(82, 41);
+            this.label1_lll_.TabIndex = 221;
+            this.label1_lll_.Text = "数量";
+            // 
+            // PrintBarCode
+            // 
+            this.PrintBarCode.AllPower = null;
+            this.PrintBarCode.BackColor = System.Drawing.Color.Transparent;
+            this.PrintBarCode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.DownImage")));
+            this.PrintBarCode.Image = null;
+            this.PrintBarCode.IsShowBorder = true;
+            this.PrintBarCode.Location = new System.Drawing.Point(296, 147);
+            this.PrintBarCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.PrintBarCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.MoveImage")));
+            this.PrintBarCode.Name = "PrintBarCode";
+            this.PrintBarCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.NormalImage")));
+            this.PrintBarCode.Power = null;
+            this.PrintBarCode.Size = new System.Drawing.Size(112, 45);
+            this.PrintBarCode.TabIndex = 227;
+            this.PrintBarCode.Text = "打印";
+            this.PrintBarCode.UseVisualStyleBackColor = false;
+            this.PrintBarCode.Click += new System.EventHandler(this.PrintBarCode_Click);
+            // 
+            // bar_remain
+            // 
+            this.bar_remain.AllPower = null;
+            this.bar_remain.BackColor = System.Drawing.Color.White;
+            this.bar_remain.ID = null;
+            this.bar_remain.Location = new System.Drawing.Point(261, 62);
+            this.bar_remain.Margin = new System.Windows.Forms.Padding(4);
+            this.bar_remain.Name = "bar_remain";
+            this.bar_remain.Power = null;
+            this.bar_remain.Size = new System.Drawing.Size(212, 35);
+            this.bar_remain.Str = null;
+            this.bar_remain.Str1 = null;
+            this.bar_remain.Str2 = null;
+            this.bar_remain.TabIndex = 222;
+            // 
+            // BarCodePrint
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(731, 249);
+            this.Controls.Add(this.PrintBarCode);
+            this.Controls.Add(this.bar_remain);
+            this.Controls.Add(this.label1_lll_);
+            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.MaximizeBox = false;
+            this.Name = "BarCodePrint";
+            this.Tag = "ShowDialogWindow";
+            this.Text = "生产退料条码";
+            this.Load += new System.EventHandler(this.BarCodePrint_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.TextBoxWithIcon.SnCollectionBox bar_remain;
+        private System.Windows.Forms.Label label1_lll_;
+        private CustomControl.ButtonUtil.NormalButton PrintBarCode;
+    }
+}

+ 35 - 0
UAS_MES_LGDZ/FunctionCode/Query/BarCodePrint.cs

@@ -0,0 +1,35 @@
+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_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.Query
+{
+    public partial class BarCodePrint : Form
+    {
+        DataHelper dh = SystemInf.dh;
+
+        string bar = "";
+        public BarCodePrint(string barcode)
+        {
+            InitializeComponent();
+            bar = barcode;
+        }
+
+        private void BarCodePrint_Load(object sender, EventArgs e)
+        {
+            bar_remain.Text = dh.getFieldDataByCondition("barcode", "bar_remain", "bar_code='" + bar + "'").ToString();
+        }
+
+        private void PrintBarCode_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 159 - 0
UAS_MES_LGDZ/FunctionCode/Query/BarCodePrint.resx

@@ -0,0 +1,159 @@
+<?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="PrintBarCode.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="PrintBarCode.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="PrintBarCode.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>

+ 102 - 27
UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         /// </summary>
         private void InitializeComponent()
         private void InitializeComponent()
         {
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_BarcodeIn));
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_BarcodeIn));
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
@@ -53,9 +54,14 @@
             this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.DeleteBarcode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.DeleteBarcode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.barcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.barcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.GenProdiodetail = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ChooseAll = new System.Windows.Forms.Button();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.label3 = new System.Windows.Forms.Label();
+            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.label2 = new System.Windows.Forms.Label();
+            this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -84,11 +90,11 @@
             this.bi_prodcode,
             this.bi_prodcode,
             this.pr_spec,
             this.pr_spec,
             this.pr_detail});
             this.pr_detail});
-            this.DGV.Location = new System.Drawing.Point(26, 79);
+            this.DGV.Location = new System.Drawing.Point(26, 125);
             this.DGV.Name = "DGV";
             this.DGV.Name = "DGV";
             this.DGV.RowHeadersWidth = 82;
             this.DGV.RowHeadersWidth = 82;
             this.DGV.RowTemplate.Height = 37;
             this.DGV.RowTemplate.Height = 37;
-            this.DGV.Size = new System.Drawing.Size(1922, 971);
+            this.DGV.Size = new System.Drawing.Size(1922, 925);
             this.DGV.TabIndex = 218;
             this.DGV.TabIndex = 218;
             // 
             // 
             // bi_id
             // bi_id
@@ -173,7 +179,7 @@
             // 
             // 
             this.label1_lll_.AutoSize = true;
             this.label1_lll_.AutoSize = true;
             this.label1_lll_.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1_lll_.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1_lll_.Location = new System.Drawing.Point(586, 11);
+            this.label1_lll_.Location = new System.Drawing.Point(1047, 11);
             this.label1_lll_.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1_lll_.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1_lll_.Name = "label1_lll_";
             this.label1_lll_.Name = "label1_lll_";
             this.label1_lll_.Size = new System.Drawing.Size(114, 41);
             this.label1_lll_.Size = new System.Drawing.Size(114, 41);
@@ -267,7 +273,7 @@
             this.DeleteBarcode.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteBarcode.DownImage")));
             this.DeleteBarcode.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteBarcode.DownImage")));
             this.DeleteBarcode.Image = null;
             this.DeleteBarcode.Image = null;
             this.DeleteBarcode.IsShowBorder = true;
             this.DeleteBarcode.IsShowBorder = true;
-            this.DeleteBarcode.Location = new System.Drawing.Point(1198, 17);
+            this.DeleteBarcode.Location = new System.Drawing.Point(1663, 14);
             this.DeleteBarcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.DeleteBarcode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.DeleteBarcode.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteBarcode.MoveImage")));
             this.DeleteBarcode.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteBarcode.MoveImage")));
             this.DeleteBarcode.Name = "DeleteBarcode";
             this.DeleteBarcode.Name = "DeleteBarcode";
@@ -284,7 +290,7 @@
             this.barcode.AllPower = null;
             this.barcode.AllPower = null;
             this.barcode.BackColor = System.Drawing.Color.White;
             this.barcode.BackColor = System.Drawing.Color.White;
             this.barcode.ID = null;
             this.barcode.ID = null;
-            this.barcode.Location = new System.Drawing.Point(714, 15);
+            this.barcode.Location = new System.Drawing.Point(1175, 15);
             this.barcode.Margin = new System.Windows.Forms.Padding(4);
             this.barcode.Margin = new System.Windows.Forms.Padding(4);
             this.barcode.Name = "barcode";
             this.barcode.Name = "barcode";
             this.barcode.Power = null;
             this.barcode.Power = null;
@@ -295,24 +301,24 @@
             this.barcode.TabIndex = 220;
             this.barcode.TabIndex = 220;
             this.barcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MakeCode_KeyDown);
             this.barcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MakeCode_KeyDown);
             // 
             // 
-            // PrintBarCode
-            // 
-            this.PrintBarCode.AllPower = null;
-            this.PrintBarCode.BackColor = System.Drawing.Color.Transparent;
-            this.PrintBarCode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.DownImage")));
-            this.PrintBarCode.Image = null;
-            this.PrintBarCode.IsShowBorder = true;
-            this.PrintBarCode.Location = new System.Drawing.Point(1043, 17);
-            this.PrintBarCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.PrintBarCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.MoveImage")));
-            this.PrintBarCode.Name = "PrintBarCode";
-            this.PrintBarCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.NormalImage")));
-            this.PrintBarCode.Power = null;
-            this.PrintBarCode.Size = new System.Drawing.Size(122, 45);
-            this.PrintBarCode.TabIndex = 216;
-            this.PrintBarCode.Text = "生成明细";
-            this.PrintBarCode.UseVisualStyleBackColor = false;
-            this.PrintBarCode.Click += new System.EventHandler(this.Print_Click);
+            // GenProdiodetail
+            // 
+            this.GenProdiodetail.AllPower = null;
+            this.GenProdiodetail.BackColor = System.Drawing.Color.Transparent;
+            this.GenProdiodetail.DownImage = ((System.Drawing.Image)(resources.GetObject("GenProdiodetail.DownImage")));
+            this.GenProdiodetail.Image = null;
+            this.GenProdiodetail.IsShowBorder = true;
+            this.GenProdiodetail.Location = new System.Drawing.Point(1508, 14);
+            this.GenProdiodetail.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.GenProdiodetail.MoveImage = ((System.Drawing.Image)(resources.GetObject("GenProdiodetail.MoveImage")));
+            this.GenProdiodetail.Name = "GenProdiodetail";
+            this.GenProdiodetail.NormalImage = ((System.Drawing.Image)(resources.GetObject("GenProdiodetail.NormalImage")));
+            this.GenProdiodetail.Power = null;
+            this.GenProdiodetail.Size = new System.Drawing.Size(122, 45);
+            this.GenProdiodetail.TabIndex = 216;
+            this.GenProdiodetail.Text = "生成明细";
+            this.GenProdiodetail.UseVisualStyleBackColor = false;
+            this.GenProdiodetail.Click += new System.EventHandler(this.Print_Click);
             // 
             // 
             // pi_inoutno
             // pi_inoutno
             // 
             // 
@@ -338,7 +344,7 @@
             // 
             // 
             // ChooseAll
             // ChooseAll
             // 
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(26, 79);
+            this.ChooseAll.Location = new System.Drawing.Point(26, 125);
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.Size = new System.Drawing.Size(86, 45);
             this.ChooseAll.Size = new System.Drawing.Size(86, 45);
             this.ChooseAll.TabIndex = 222;
             this.ChooseAll.TabIndex = 222;
@@ -346,17 +352,81 @@
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             // 
             // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(625, 16);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(388, 32);
+            this.PrintLabel.TabIndex = 228;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(523, 15);
+            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.TabIndex = 227;
+            this.label3.Text = "标签";
+            // 
+            // PrintBarCode
+            // 
+            this.PrintBarCode.AllPower = null;
+            this.PrintBarCode.BackColor = System.Drawing.Color.Transparent;
+            this.PrintBarCode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.DownImage")));
+            this.PrintBarCode.Image = null;
+            this.PrintBarCode.IsShowBorder = true;
+            this.PrintBarCode.Location = new System.Drawing.Point(1803, 12);
+            this.PrintBarCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.PrintBarCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.MoveImage")));
+            this.PrintBarCode.Name = "PrintBarCode";
+            this.PrintBarCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.NormalImage")));
+            this.PrintBarCode.Power = null;
+            this.PrintBarCode.Size = new System.Drawing.Size(112, 45);
+            this.PrintBarCode.TabIndex = 226;
+            this.PrintBarCode.Text = "打印";
+            this.PrintBarCode.UseVisualStyleBackColor = false;
+            this.PrintBarCode.Click += new System.EventHandler(this.Print_Click_1);
+            // 
+            // 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(19, 75);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(114, 41);
+            this.label2.TabIndex = 230;
+            this.label2.Text = "打印机";
+            // 
+            // PrinterList
+            // 
+            this.PrinterList.Location = new System.Drawing.Point(186, 75);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(8);
+            this.PrinterList.Name = "PrinterList";
+            this.PrinterList.Size = new System.Drawing.Size(307, 50);
+            this.PrinterList.TabIndex = 229;
+            // 
             // Query_BarcodeIn
             // Query_BarcodeIn
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1960, 1075);
             this.ClientSize = new System.Drawing.Size(1960, 1075);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.PrinterList);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.PrintBarCode);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.DeleteBarcode);
             this.Controls.Add(this.DeleteBarcode);
             this.Controls.Add(this.barcode);
             this.Controls.Add(this.barcode);
             this.Controls.Add(this.label1_lll_);
             this.Controls.Add(this.label1_lll_);
             this.Controls.Add(this.DGV);
             this.Controls.Add(this.DGV);
-            this.Controls.Add(this.PrintBarCode);
+            this.Controls.Add(this.GenProdiodetail);
             this.Controls.Add(this.pi_inoutno);
             this.Controls.Add(this.pi_inoutno);
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
@@ -375,7 +445,7 @@
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
         private CustomControl.TextBoxWithIcon.SearchTextBox pi_inoutno;
         private CustomControl.TextBoxWithIcon.SearchTextBox pi_inoutno;
         private System.Windows.Forms.Label ms_makecode_label;
         private System.Windows.Forms.Label ms_makecode_label;
-        private CustomControl.ButtonUtil.NormalButton PrintBarCode;
+        private CustomControl.ButtonUtil.NormalButton GenProdiodetail;
         private System.Windows.Forms.DataGridView DGV;
         private System.Windows.Forms.DataGridView DGV;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
         private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
@@ -399,5 +469,10 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
         private System.Windows.Forms.Button ChooseAll;
         private System.Windows.Forms.Button ChooseAll;
+        private CustomControl.ComBoxWithFocus.ComboxWithTip PrintLabel;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.ButtonUtil.NormalButton PrintBarCode;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
     }
     }
 }
 }

+ 63 - 2
UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn.cs

@@ -24,11 +24,25 @@ namespace UAS_MES_NEW.Query
 
 
         Thread InitPrint;
         Thread InitPrint;
 
 
+        Engine engine;
+
         public Query_BarcodeIn()
         public Query_BarcodeIn()
         {
         {
             InitializeComponent();
             InitializeComponent();
         }
         }
 
 
+        private void InPrint()
+        {
+            try
+            {
+                engine = new Engine(true);
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("未正确安装BarTender软件");
+            }
+        }
+
         private void Query_LoadMake_Load(object sender, EventArgs e)
         private void Query_LoadMake_Load(object sender, EventArgs e)
         {
         {
             pi_inoutno.TableName = "prodinout";
             pi_inoutno.TableName = "prodinout";
@@ -38,7 +52,26 @@ namespace UAS_MES_NEW.Query
             pi_inoutno.Condition = "1=1";
             pi_inoutno.Condition = "1=1";
             pi_inoutno.DbChange += Ma_code_DbChange;
             pi_inoutno.DbChange += Ma_code_DbChange;
 
 
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+
             LoadGridData();
             LoadGridData();
+
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode='生产退料标签' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            if (_dt.Rows.Count == 0)
+            {
+                _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode is null and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            }
+            if (_dt.Rows.Count > 0)
+            {
+                string la_id = _dt.Rows[0]["la_id"].ToString();
+                _dt = (DataTable)dh.ExecuteSql("select fp_name la_url,'" + la_id + "' la_id from FILEPATH where fp_id in (select *  from table(select parsestring(LA_SOFTTYPE,';') from label where la_templatetype='自定义' and la_id='" + la_id + "') where COLUMN_VALUE is not null)", "select");
+                PrintLabel.DataSource = _dt;
+                PrintLabel.DisplayMember = "la_url";
+                PrintLabel.ValueMember = "la_id";
+            }
         }
         }
 
 
         private void Ma_code_DbChange(object sender, EventArgs e)
         private void Ma_code_DbChange(object sender, EventArgs e)
@@ -105,14 +138,20 @@ namespace UAS_MES_NEW.Query
                     MessageBox.Show("条码" + barcode.Text + "不存在");
                     MessageBox.Show("条码" + barcode.Text + "不存在");
                     return;
                     return;
                 }
                 }
+
+                BarCodePrint bar=new BarCodePrint(barcode.Text);
+                bar.StartPosition= FormStartPosition.CenterScreen;
+                bar.Controls["PrintBarCode"].Click += Print_Click_1;
+                bar.ShowDialog();
+
                 string pi_id = dh.getFieldDataByCondition("prodinout", "pi_id", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
                 string pi_id = dh.getFieldDataByCondition("prodinout", "pi_id", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
                 string bar_remain = dt.Rows[0]["bar_remain"].ToString();
                 string bar_remain = dt.Rows[0]["bar_remain"].ToString();
                 string bar_code = dt.Rows[0]["bar_code"].ToString();
                 string bar_code = dt.Rows[0]["bar_code"].ToString();
                 string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
                 string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
                 string bar_madedate = dt.Rows[0]["bar_madedate"].ToString();
                 string bar_madedate = dt.Rows[0]["bar_madedate"].ToString();
                 string bar_vendbarcode = dt.Rows[0]["bar_vendbarcode"].ToString();
                 string bar_vendbarcode = dt.Rows[0]["bar_vendbarcode"].ToString();
-                dh.ExecuteSql("insert into barcodeio(bi_id,bi_piid,bi_barcode,bi_inoutno,bi_prodcode,bi_indate,bi_inqty,bi_vendbarcode,bi_madedate)" +
-                    "values(barcodeio_seq.nextval,'" + pi_id + "','" + bar_code + "','" + pi_inoutno.Text + "','" + bar_prodcode + "',sysdate,'" + bar_remain + "','" + bar_vendbarcode + "',to_date('" + bar_madedate + "','yyyy-mm-dd'))", "insert");
+                dh.ExecuteSql("insert into barcodeio(bi_id,bi_piid,bi_barcode,bi_inoutno,bi_prodcode,bi_indate,bi_inqty,bi_vendbarcode,bi_madedate,bi_sourcecode)" +
+                    "values(barcodeio_seq.nextval,'" + pi_id + "','" + bar_code + "','" + pi_inoutno.Text + "','" + bar_prodcode + "',sysdate,'" + bar_remain + "','" + bar_vendbarcode + "',to_date('" + bar_madedate + "','yyyy-mm-dd'),'"+ bar_code + "')", "insert");
                 LoadGridData();
                 LoadGridData();
             }
             }
         }
         }
@@ -143,5 +182,27 @@ namespace UAS_MES_NEW.Query
                 DGV.Rows[i].Cells["choose"].Value = true;
                 DGV.Rows[i].Cells["choose"].Value = true;
             }
             }
         }
         }
+
+        private void Print_Click_1(object sender, EventArgs e)
+        {
+            if (!ifcheckrow())
+            {
+                MessageBox.Show("请勾选需要操作的行");
+                return;
+            }
+            for (int i = 0; i < DGV.Rows.Count; i++)
+            {
+                if (DGV.Rows[i].Cells["Choose"].Value != null && DGV.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
+                {
+                    string barcode = DGV.Rows[i].Cells["bi_barcode"].Value.ToString();
+                    string prodcode = DGV.Rows[i].Cells["bi_prodcode"].Value.ToString();
+                    string ErrorMessage = "";
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, barcode, int.Parse("1"), pi_inoutno.Text, prodcode, "自定义", "0", out ErrorMessage))
+                    {
+
+                    }
+                }
+            }
+        }
     }
     }
 }
 }

+ 65 - 0
UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn.resx

@@ -147,6 +147,33 @@
   <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="bi_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_madedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_vendbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bi_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="DeleteBarcode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="DeleteBarcode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
@@ -184,6 +211,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="GenProdiodetail.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="GenProdiodetail.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="GenProdiodetail.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>
 </value>
   </data>
   </data>
   <data name="PrintBarCode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="PrintBarCode.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 65 - 63
UAS_MES_LGDZ/FunctionCode/Query/Query_Barcodeio.Designer.cs

@@ -35,6 +35,10 @@
             this.DGV = new System.Windows.Forms.DataGridView();
             this.DGV = new System.Windows.Forms.DataGridView();
             this.label2 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -42,8 +46,6 @@
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
-            this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.lm_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.lm_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.bi_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -51,8 +53,6 @@
             this.bi_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
@@ -108,6 +108,67 @@
             this.label3.Size = new System.Drawing.Size(82, 41);
             this.label3.Size = new System.Drawing.Size(82, 41);
             this.label3.TabIndex = 223;
             this.label3.TabIndex = 223;
             this.label3.Text = "标签";
             this.label3.Text = "标签";
+            this.label3.Click += new System.EventHandler(this.label3_Click);
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(1249, 18);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(388, 32);
+            this.PrintLabel.TabIndex = 225;
+            this.PrintLabel.SelectedIndexChanged += new System.EventHandler(this.PrintLabel_SelectedIndexChanged);
+            // 
+            // PrinterList
+            // 
+            this.PrinterList.Location = new System.Drawing.Point(698, 21);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(8);
+            this.PrinterList.Name = "PrinterList";
+            this.PrinterList.Size = new System.Drawing.Size(388, 50);
+            this.PrinterList.TabIndex = 222;
+            // 
+            // PrintBarCode
+            // 
+            this.PrintBarCode.AllPower = null;
+            this.PrintBarCode.BackColor = System.Drawing.Color.Transparent;
+            this.PrintBarCode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.DownImage")));
+            this.PrintBarCode.Image = null;
+            this.PrintBarCode.IsShowBorder = true;
+            this.PrintBarCode.Location = new System.Drawing.Point(1678, 14);
+            this.PrintBarCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.PrintBarCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.MoveImage")));
+            this.PrintBarCode.Name = "PrintBarCode";
+            this.PrintBarCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.NormalImage")));
+            this.PrintBarCode.Power = null;
+            this.PrintBarCode.Size = new System.Drawing.Size(112, 45);
+            this.PrintBarCode.TabIndex = 216;
+            this.PrintBarCode.Text = "打印";
+            this.PrintBarCode.UseVisualStyleBackColor = false;
+            this.PrintBarCode.Click += new System.EventHandler(this.Print_Click);
+            // 
+            // pi_inoutno
+            // 
+            this.pi_inoutno.AllPower = "IFALL";
+            this.pi_inoutno.Caller = null;
+            this.pi_inoutno.Condition = null;
+            this.pi_inoutno.DBTitle = "";
+            this.pi_inoutno.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pi_inoutno.FormName = null;
+            this.pi_inoutno.Location = new System.Drawing.Point(186, 15);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(6);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.Power = "";
+            this.pi_inoutno.ReturnData = null;
+            this.pi_inoutno.SelectField = null;
+            this.pi_inoutno.SetValueField = null;
+            this.pi_inoutno.Size = new System.Drawing.Size(307, 46);
+            this.pi_inoutno.TabIndex = 213;
+            this.pi_inoutno.TableName = null;
+            this.pi_inoutno.Tag = "msl_makecode";
+            this.pi_inoutno.TextBoxEnable = true;
+            this.pi_inoutno.UserControlTextChanged += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.pi_inoutno_UserControlTextChanged);
             // 
             // 
             // dataGridViewTextBoxColumn1
             // dataGridViewTextBoxColumn1
             // 
             // 
@@ -171,24 +232,6 @@
             this.dataGridViewTextBoxColumn6.ReadOnly = true;
             this.dataGridViewTextBoxColumn6.ReadOnly = true;
             this.dataGridViewTextBoxColumn6.Width = 200;
             this.dataGridViewTextBoxColumn6.Width = 200;
             // 
             // 
-            // PrintLabel
-            // 
-            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1249, 18);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
-            this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(388, 32);
-            this.PrintLabel.TabIndex = 225;
-            // 
-            // PrinterList
-            // 
-            this.PrinterList.Location = new System.Drawing.Point(698, 21);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(8);
-            this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(388, 50);
-            this.PrinterList.TabIndex = 222;
-            // 
             // lm_id
             // lm_id
             // 
             // 
             this.lm_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.lm_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -251,47 +294,6 @@
             this.pr_detail.ReadOnly = true;
             this.pr_detail.ReadOnly = true;
             this.pr_detail.Width = 80;
             this.pr_detail.Width = 80;
             // 
             // 
-            // PrintBarCode
-            // 
-            this.PrintBarCode.AllPower = null;
-            this.PrintBarCode.BackColor = System.Drawing.Color.Transparent;
-            this.PrintBarCode.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.DownImage")));
-            this.PrintBarCode.Image = null;
-            this.PrintBarCode.IsShowBorder = true;
-            this.PrintBarCode.Location = new System.Drawing.Point(1678, 14);
-            this.PrintBarCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.PrintBarCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.MoveImage")));
-            this.PrintBarCode.Name = "PrintBarCode";
-            this.PrintBarCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintBarCode.NormalImage")));
-            this.PrintBarCode.Power = null;
-            this.PrintBarCode.Size = new System.Drawing.Size(112, 45);
-            this.PrintBarCode.TabIndex = 216;
-            this.PrintBarCode.Text = "打印";
-            this.PrintBarCode.UseVisualStyleBackColor = false;
-            this.PrintBarCode.Click += new System.EventHandler(this.Print_Click);
-            // 
-            // pi_inoutno
-            // 
-            this.pi_inoutno.AllPower = "IFALL";
-            this.pi_inoutno.Caller = null;
-            this.pi_inoutno.Condition = null;
-            this.pi_inoutno.DBTitle = "";
-            this.pi_inoutno.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.pi_inoutno.FormName = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(186, 15);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(6);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Power = "";
-            this.pi_inoutno.ReturnData = null;
-            this.pi_inoutno.SelectField = null;
-            this.pi_inoutno.SetValueField = null;
-            this.pi_inoutno.Size = new System.Drawing.Size(307, 46);
-            this.pi_inoutno.TabIndex = 213;
-            this.pi_inoutno.TableName = null;
-            this.pi_inoutno.Tag = "msl_makecode";
-            this.pi_inoutno.TextBoxEnable = true;
-            this.pi_inoutno.UserControlTextChanged += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.pi_inoutno_UserControlTextChanged);
-            // 
             // dataGridViewTextBoxColumn7
             // dataGridViewTextBoxColumn7
             // 
             // 
             this.dataGridViewTextBoxColumn7.DataPropertyName = "lm_mannum";
             this.dataGridViewTextBoxColumn7.DataPropertyName = "lm_mannum";

+ 10 - 0
UAS_MES_LGDZ/FunctionCode/Query/Query_Barcodeio.cs

@@ -134,5 +134,15 @@ namespace UAS_MES_NEW.Query
         {
         {
             LoadGridData();
             LoadGridData();
         }
         }
+
+        private void PrintLabel_SelectedIndexChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label3_Click(object sender, EventArgs e)
+        {
+
+        }
     }
     }
 }
 }

+ 9 - 4
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs

@@ -198,12 +198,17 @@ namespace UAS_MES_NEW.Query
                 }
                 }
                 dh.ExecuteSql("delete from SMTTRACEFILE where stf_code='" + stf_code + "'", "delete");
                 dh.ExecuteSql("delete from SMTTRACEFILE where stf_code='" + stf_code + "'", "delete");
                 dh.BatchInsert("insert into SMTTRACEFILE(STF_ID,stf_prodcode, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN)" +
                 dh.BatchInsert("insert into SMTTRACEFILE(STF_ID,stf_prodcode, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN)" +
-                    "values(SMTTRACEFILE_SEQ.nextval,'"+pr_code.Text+"',:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "')",
+                    "values(SMTTRACEFILE_SEQ.nextval,'" + pr_code.Text + "',:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "')",
                     new string[] { "STF_MODEL", "STF_FEEDER", "STF_FEEDERNO", "STF_LOCATION", "STF_MACHINE" }, STF_MODEL.ToArray(), STF_FEEDER.ToArray(), STF_FEEDERNO.ToArray(), STF_LOCATION.ToArray(), STF_MACHINE.ToArray());
                     new string[] { "STF_MODEL", "STF_FEEDER", "STF_FEEDERNO", "STF_LOCATION", "STF_MACHINE" }, STF_MODEL.ToArray(), STF_FEEDER.ToArray(), STF_FEEDERNO.ToArray(), STF_LOCATION.ToArray(), STF_MACHINE.ToArray());
-                dh.ExecuteSql("delete from SMTTRACEFILE where ( STF_MODEL is null and  STF_FEEDER is null and STF_FEEDERNO is null and STF_MACHINE is null ) or stf_model in ('料槽','数量','印刷板') or STF_MACHINE in('贴片生产线:','设置:') ", "delete");
+                dh.ExecuteSql("delete from SMTTRACEFILE where ( STF_MODEL is null and  STF_FEEDER is null and STF_FEEDERNO is null and STF_MACHINE is null ) or stf_model in ('料槽','数量','印刷板') or STF_MACHINE in('贴片生产线:','设置:','***') ", "delete");
                 dataGridView1.DataSource = dt;
                 dataGridView1.DataSource = dt;
-                DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode,bo_mothercode,bd_baseqty,bd_soncode,bd_location, STF_CODE, STF_INDATE, STF_INMAN from SMTTRACEFILE left join (\r\nselect bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail \r\nLEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code left join ProdReplace on pre_bdid =bd_id where bo_mothercode='" + pr_code.Text + "' ) on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION \r\nleft join product on pr_code=STF_LOCATION where stf_prodcode='"+pr_code.Text+"' order by stf_id", "select");
-                excel.ExportExcel_LIANGAN(dt1, "C:\\Users\\callm\\Desktop\\客户资料\\"+System.DateTime.Now.ToString("yyyyMMddhhmmss")+".xls");
+                DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode,bo_mothercode,bd_baseqty,bd_soncode,bd_location, STF_CODE, STF_INDATE, STF_INMAN from SMTTRACEFILE left join (\r\nselect bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail \r\nLEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code left join ProdReplace on pre_bdid =bd_id where bo_mothercode='" + pr_code.Text + "' ) on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION \r\nleft join product on pr_code=STF_LOCATION where stf_prodcode='" + pr_code.Text + "' order by stf_id", "select");
+                ExportFileDialog.Description = "选择导出的路径";
+                DialogResult result1 = ExportFileDialog.ShowDialog();
+                if (result1 == DialogResult.OK)
+                {
+                    excel.ExportExcel_LIANGAN(dt1, ExportFileDialog.SelectedPath + System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls");
+                }
             }
             }
         }
         }
 
 

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Special/Special_CancelOQC.cs

@@ -13,7 +13,7 @@ using UAS_MES_NEW.Entity;
 using UAS_MES_NEW.PublicMethod;
 using UAS_MES_NEW.PublicMethod;
 
 
 namespace UAS_MES_NEW.Special
 namespace UAS_MES_NEW.Special
-{
+{   
     public partial class Special_CancelOQC : Form
     public partial class Special_CancelOQC : Form
     {
     {
         DataHelper dh;
         DataHelper dh;

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Warehouse/Warehouse_In.Designer.cs

@@ -1,6 +1,6 @@
 namespace UAS_MES_NEW.Warehouse
 namespace UAS_MES_NEW.Warehouse
 {
 {
-    partial class Warehouse_In
+    partial class BarCodePrint
     {
     {
         /// <summary>
         /// <summary>
         /// Required designer variable.
         /// Required designer variable.

+ 2 - 2
UAS_MES_LGDZ/FunctionCode/Warehouse/Warehouse_In.cs

@@ -9,9 +9,9 @@ using System.Windows.Forms;
 
 
 namespace UAS_MES_NEW.Warehouse
 namespace UAS_MES_NEW.Warehouse
 {
 {
-    public partial class Warehouse_In : Form
+    public partial class BarCodePrint : Form
     {
     {
-        public Warehouse_In()
+        public BarCodePrint()
         {
         {
             InitializeComponent();
             InitializeComponent();
         }
         }

+ 2 - 2
UAS_MES_LGDZ/Login.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW
         {
         {
             BaseUtil.FormStepInOrOut(this, true);
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
             //设置默认数据库
-            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);
             LoadMasterInf = new Thread(LoadMaster);
@@ -94,7 +94,7 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 1 - 1
UAS_MES_LGDZ/Main.cs

@@ -357,7 +357,7 @@ namespace UAS_MES_NEW
             if (logout_confirm == "Yes")
             if (logout_confirm == "Yes")
             {
             {
                 //注销的时候切换回默认数据库
                 //注销的时候切换回默认数据库
-                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();
                 SystemInf.Caller.Clear();

+ 9 - 1
UAS_MES_LGDZ/PublicMethod/LogicHandler.cs

@@ -84,7 +84,15 @@ namespace UAS_MES_NEW.PublicMethod
             else
             else
                 return false;
                 return false;
         }
         }
-
+        public static bool SP_GETBARCODE(string pr_code, string ve_id, out string barcode)
+        {
+            barcode = "";
+            string[] param = new string[] { pr_code, ve_id, barcode };
+            string[] ParamName = new string[] { "v_prcode", "v_veid", "v_barcode" };
+            dh.CallProcedure("SP_GETBARCODE", ParamName, ref param);
+            barcode = param[2];
+            return true;
+        }
 
 
         [Description("分配MAC和BT信息")]
         [Description("分配MAC和BT信息")]
         public static bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)
         public static bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)

+ 2 - 2
UAS_MES_LGDZ/PublicMethod/Print.cs

@@ -285,7 +285,7 @@ namespace UAS_MES_NEW.PublicMethod
                                 string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                 string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 WebClient wc = new WebClient();
                                 WebClient wc = new WebClient();
-                                wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                wc.DownloadFile("http://10.11.28.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                             }
                             }
                         }
                         }
                     }
                     }
@@ -314,7 +314,7 @@ namespace UAS_MES_NEW.PublicMethod
                                     string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                     string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     WebClient wc = new WebClient();
                                     WebClient wc = new WebClient();
-                                    wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                    wc.DownloadFile("http://10.11.28.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                 }
                                 }

+ 9 - 0
UAS_MES_LGDZ/UAS_MES_LGDZ.csproj

@@ -1110,6 +1110,12 @@
     <Compile Include="FunctionCode\Query\Query_SpecialReport.Designer.cs">
     <Compile Include="FunctionCode\Query\Query_SpecialReport.Designer.cs">
       <DependentUpon>Query_SpecialReport.cs</DependentUpon>
       <DependentUpon>Query_SpecialReport.cs</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="FunctionCode\Query\BarCodePrint.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Query\BarCodePrint.Designer.cs">
+      <DependentUpon>BarCodePrint.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\SMT\SMT_ChangeLine.cs">
     <Compile Include="FunctionCode\SMT\SMT_ChangeLine.cs">
       <SubType>Form</SubType>
       <SubType>Form</SubType>
     </Compile>
     </Compile>
@@ -1860,6 +1866,9 @@
     <EmbeddedResource Include="FunctionCode\Query\Query_SpecialReport.resx">
     <EmbeddedResource Include="FunctionCode\Query\Query_SpecialReport.resx">
       <DependentUpon>Query_SpecialReport.cs</DependentUpon>
       <DependentUpon>Query_SpecialReport.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Query\BarCodePrint.resx">
+      <DependentUpon>BarCodePrint.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\SMT\SMT_ChangeLine.resx">
     <EmbeddedResource Include="FunctionCode\SMT\SMT_ChangeLine.resx">
       <DependentUpon>SMT_ChangeLine.cs</DependentUpon>
       <DependentUpon>SMT_ChangeLine.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>