Explorar o código

添加返工标签补打

callm %!s(int64=4) %!d(string=hai) anos
pai
achega
2fdabc320e

+ 404 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_ReWorkPrintLabel.Designer.cs

@@ -0,0 +1,404 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_ReWorkPrintLabel
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_RePrintLabel));
+            this.label = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label111 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.inputValue = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
+            this.ms_makecode = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.CartonBox = new System.Windows.Forms.RadioButton();
+            this.fuselagel = new System.Windows.Forms.RadioButton();
+            this.giftBox = new System.Windows.Forms.RadioButton();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.printBtn = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.printNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.inputText = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.pitao = new System.Windows.Forms.RadioButton();
+            this.groupBoxWithBorder1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // label
+            // 
+            this.label.AutoSize = true;
+            this.label.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label.Location = new System.Drawing.Point(50, 178);
+            this.label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label.Name = "label";
+            this.label.Size = new System.Drawing.Size(114, 41);
+            this.label.TabIndex = 4;
+            this.label.Text = "输入值";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(728, 178);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(146, 41);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "工单代码";
+            // 
+            // label111
+            // 
+            this.label111.AutoSize = true;
+            this.label111.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label111.Location = new System.Drawing.Point(50, 230);
+            this.label111.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label111.Name = "label111";
+            this.label111.Size = new System.Drawing.Size(146, 41);
+            this.label111.TabIndex = 6;
+            this.label111.Text = "产品编号";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label5.Location = new System.Drawing.Point(728, 230);
+            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.TabIndex = 7;
+            this.label5.Text = "名称";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(50, 290);
+            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(178, 41);
+            this.label6.TabIndex = 188;
+            this.label6.Text = "打印机列表";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(50, 352);
+            this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(146, 41);
+            this.label7.TabIndex = 187;
+            this.label7.Text = "标签模板";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label8.Location = new System.Drawing.Point(726, 296);
+            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(114, 41);
+            this.label8.TabIndex = 190;
+            this.label8.Text = "输入框";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label9.Location = new System.Drawing.Point(728, 358);
+            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(82, 41);
+            this.label9.TabIndex = 192;
+            this.label9.Text = "份数";
+            // 
+            // inputValue
+            // 
+            this.inputValue.AutoSize = true;
+            this.inputValue.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.inputValue.Location = new System.Drawing.Point(242, 178);
+            this.inputValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.inputValue.Name = "inputValue";
+            this.inputValue.Size = new System.Drawing.Size(0, 41);
+            this.inputValue.TabIndex = 199;
+            // 
+            // pr_code
+            // 
+            this.pr_code.AutoSize = true;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_code.Location = new System.Drawing.Point(242, 230);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 41);
+            this.pr_code.TabIndex = 200;
+            this.pr_code.TextChanged += new System.EventHandler(this.PrintLabel_TextChanged);
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ms_makecode.Location = new System.Drawing.Point(874, 178);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
+            this.ms_makecode.TabIndex = 201;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_detail.Location = new System.Drawing.Point(874, 230);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 202;
+            // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.pitao);
+            this.groupBoxWithBorder1.Controls.Add(this.CartonBox);
+            this.groupBoxWithBorder1.Controls.Add(this.fuselagel);
+            this.groupBoxWithBorder1.Controls.Add(this.giftBox);
+            this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(58, 18);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4, 6, 4, 6);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1512, 144);
+            this.groupBoxWithBorder1.TabIndex = 204;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "打印类型";
+            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            // 
+            // CartonBox
+            // 
+            this.CartonBox.AutoSize = true;
+            this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.CartonBox.Location = new System.Drawing.Point(449, 70);
+            this.CartonBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.CartonBox.Name = "CartonBox";
+            this.CartonBox.Size = new System.Drawing.Size(216, 45);
+            this.CartonBox.TabIndex = 2;
+            this.CartonBox.Text = "Carton打印";
+            this.CartonBox.UseVisualStyleBackColor = true;
+            this.CartonBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // fuselagel
+            // 
+            this.fuselagel.AutoSize = true;
+            this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.fuselagel.Location = new System.Drawing.Point(811, 70);
+            this.fuselagel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.fuselagel.Name = "fuselagel";
+            this.fuselagel.Size = new System.Drawing.Size(209, 45);
+            this.fuselagel.TabIndex = 3;
+            this.fuselagel.Text = "机身标打印";
+            this.fuselagel.UseVisualStyleBackColor = true;
+            this.fuselagel.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // giftBox
+            // 
+            this.giftBox.AutoSize = true;
+            this.giftBox.Checked = true;
+            this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.giftBox.Location = new System.Drawing.Point(110, 70);
+            this.giftBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.giftBox.Name = "giftBox";
+            this.giftBox.Size = new System.Drawing.Size(177, 45);
+            this.giftBox.TabIndex = 1;
+            this.giftBox.TabStop = true;
+            this.giftBox.Text = "彩标打印";
+            this.giftBox.UseVisualStyleBackColor = true;
+            this.giftBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(58, 422);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(1510, 326);
+            this.OperateResult.TabIndex = 195;
+            this.OperateResult.Text = "";
+            // 
+            // printBtn
+            // 
+            this.printBtn.AllPower = null;
+            this.printBtn.BackColor = System.Drawing.Color.Transparent;
+            this.printBtn.DownImage = ((System.Drawing.Image)(resources.GetObject("printBtn.DownImage")));
+            this.printBtn.Image = null;
+            this.printBtn.IsShowBorder = true;
+            this.printBtn.Location = new System.Drawing.Point(1230, 356);
+            this.printBtn.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.printBtn.MoveImage = ((System.Drawing.Image)(resources.GetObject("printBtn.MoveImage")));
+            this.printBtn.Name = "printBtn";
+            this.printBtn.NormalImage = ((System.Drawing.Image)(resources.GetObject("printBtn.NormalImage")));
+            this.printBtn.Power = null;
+            this.printBtn.Size = new System.Drawing.Size(100, 48);
+            this.printBtn.TabIndex = 194;
+            this.printBtn.Text = "打印";
+            this.printBtn.UseVisualStyleBackColor = false;
+            this.printBtn.Click += new System.EventHandler(this.print_Click);
+            // 
+            // printNum
+            // 
+            this.printNum.AllPower = null;
+            this.printNum.BackColor = System.Drawing.Color.White;
+            this.printNum.ID = null;
+            this.printNum.Location = new System.Drawing.Point(884, 364);
+            this.printNum.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.printNum.Name = "printNum";
+            this.printNum.Negative = false;
+            this.printNum.Power = null;
+            this.printNum.Size = new System.Drawing.Size(294, 35);
+            this.printNum.Str = null;
+            this.printNum.Str1 = null;
+            this.printNum.Str2 = null;
+            this.printNum.TabIndex = 193;
+            this.printNum.Text = "1";
+            // 
+            // inputText
+            // 
+            this.inputText.AllPower = null;
+            this.inputText.BackColor = System.Drawing.Color.White;
+            this.inputText.ID = null;
+            this.inputText.Location = new System.Drawing.Point(882, 298);
+            this.inputText.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.inputText.Name = "inputText";
+            this.inputText.Power = null;
+            this.inputText.Size = new System.Drawing.Size(294, 35);
+            this.inputText.Str = null;
+            this.inputText.Str1 = null;
+            this.inputText.Str2 = null;
+            this.inputText.TabIndex = 191;
+            this.inputText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputText_KeyDown);
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(250, 358);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(294, 32);
+            this.PrintLabel.TabIndex = 189;
+            // 
+            // Printer
+            // 
+            this.Printer.Location = new System.Drawing.Point(250, 290);
+            this.Printer.Margin = new System.Windows.Forms.Padding(8);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(296, 50);
+            this.Printer.TabIndex = 186;
+            // 
+            // pitao
+            // 
+            this.pitao.AutoSize = true;
+            this.pitao.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pitao.Location = new System.Drawing.Point(1129, 70);
+            this.pitao.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.pitao.Name = "pitao";
+            this.pitao.Size = new System.Drawing.Size(209, 45);
+            this.pitao.TabIndex = 4;
+            this.pitao.Text = "皮套标打印";
+            this.pitao.UseVisualStyleBackColor = true;
+            this.pitao.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // Make_RePrintLabel
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1636, 834);
+            this.Controls.Add(this.groupBoxWithBorder1);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.inputValue);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.printBtn);
+            this.Controls.Add(this.printNum);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.inputText);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.Printer);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label111);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.Name = "Make_RePrintLabel";
+            this.Tag = "Make!RePrintLabel";
+            this.Text = "Make_RePrintLabel";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_RePrintLabel_FormClosing);
+            this.Load += new System.EventHandler(this.Make_RePrintLabel_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_RePrintLabel_SizeChanged);
+            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.PerformLayout();
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.RadioButton giftBox;
+        private System.Windows.Forms.RadioButton CartonBox;
+        private System.Windows.Forms.RadioButton fuselagel;
+        private System.Windows.Forms.Label label;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label111;
+        private System.Windows.Forms.Label label5;
+        private UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip PrintLabel;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label7;
+        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
+        private System.Windows.Forms.Label label8;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox inputText;
+        private System.Windows.Forms.Label label9;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox printNum;
+        private CustomControl.ButtonUtil.NormalButton printBtn;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label inputValue;
+        private System.Windows.Forms.Label pr_code;
+        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label pr_detail;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private System.Windows.Forms.RadioButton pitao;
+    }
+}

+ 339 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_ReWorkPrintLabel.cs

@@ -0,0 +1,339 @@
+using LabelManager2;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicForm;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_ReWorkPrintLabel : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        ApplicationClass lbl;
+
+        Thread InitPrint;//实例化打印进程
+
+        DataTable dt;
+
+        DataTable listA;
+
+        string getlabel = "";
+
+        DataTable mapB;
+
+        String TSN = "";//记录第一次输入的SN
+
+        string ms_id = "";
+
+        DataTable formValue;//界面赋值
+
+        string type = "";
+
+        string errorMessage = "";
+        public Make_ReWorkPrintLabel()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_RePrintLabel_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            OperateResult.AppendText(">>请输入SN\n", Color.Black);
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            inputText.Focus();
+            dh = SystemInf.dh;
+        }
+
+        private void InPrint()
+        {
+            try
+            {
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl();
+            }
+            catch (Exception ex)
+            {
+                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+            }
+        }
+
+        private void Make_RePrintLabel_SizeChanged(object sender, EventArgs e)
+        {
+            //窗体大小变化的时候
+            asc.controlAutoSize(this);
+        }
+
+        private void Make_RePrintLabel_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            //窗口关闭的时候
+            BaseUtil.ClosePrint(lbl);
+        }
+
+        private void radioButton_CheckedChange(object sender, EventArgs e)
+        {
+            RadioButton btn = sender as RadioButton;
+            if ((btn.Name == "giftBox" || btn.Name == "fuselagel" || btn.Name == "pitao") && btn.Checked)
+            {
+                //如果是切换成彩盒或者机身标提示用户 输入SN
+                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                clearAll();
+            }
+            else if (btn.Name == "CartonBox" && btn.Checked)
+            {
+                OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
+                clearAll();
+            }
+        }
+
+        private void inputText_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下enter键
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (inputText.Text == "")
+                {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
+                //打印类型为彩盒或者机身标
+                if (giftBox.Checked || fuselagel.Checked || pitao.Checked)
+                {
+                    //select max(ms_id)ms_id from makeserial where ms_sncode=? 
+                    ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
+                    //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
+                    if (ms_id == "")
+                    {
+                        OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        return;
+                    }
+                    ////判断是否装箱通过
+                    //if (checkPacked())
+                    //{
+                    //    return;
+                    //}
+                    //界面赋值
+                    formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='" + ms_id + "'", "select");
+                    BaseUtil.SetFormValue(this.Controls, formValue);
+                    //无值,可补打
+                    inputValue.Text = inputText.Text;
+                    inputText.Text = "";
+                }
+                //打印类型为卡通箱
+                else if (CartonBox.Checked)
+                {
+                    //查询箱号是否存在
+                    dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
+                    if (dt.Rows.Count == 0)
+                    {
+                        //无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
+                        OperateResult.AppendText("<<箱号:" + inputText.Text + "不存在\n", Color.Red, inputText);
+                        OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
+                        return;
+                    }
+                    //界面赋值
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                    //有值,可以打
+                    //展示产品编号和标签模板到界面
+                    inputValue.Text = inputText.Text;
+                    inputText.Text = "";
+                }
+                print_Click(sender, new EventArgs());
+            }
+        }
+
+        private void PrintLabel_TextChanged(object sender, EventArgs e)
+        {
+            if (pr_code.Text == "")
+            {
+                return;
+            }
+            if (fuselagel.Checked)
+                type = "机身标";
+            else if (giftBox.Checked)
+                type = "彩盒标";
+            else if (pitao.Checked)
+                type = "皮套标";
+            else
+                type = "卡通箱标";
+
+            getlabel = "select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='" + type + "' and la_statuscode='AUDITED' order by la_isdefault";
+
+            listA = (DataTable)dh.ExecuteSql(getlabel, "select");
+            if (listA.Rows.Count == 0)
+            {
+                OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护" + type + "模板\n", Color.Red);
+            }
+            PrintLabel.DataSource = listA;
+            PrintLabel.DisplayMember = "la_url";
+            PrintLabel.ValueMember = "la_id";
+        }
+        private void print_Click(object sender, EventArgs e)
+        {
+            //输入值字段值不为空,打印不为空,有选中打印模板,才可以进行打印,打印前再次判断
+            if (inputValue.Text == "")
+            {
+                OperateResult.AppendText("<<无箱号或者序列号\n", Color.Red);
+                return;
+            }
+            if (PrintLabel.Text == "")
+            {
+                OperateResult.AppendText("<<无打印模板\n", Color.Red);
+                return;
+            }
+            //打印类型 彩盒或者标签,再次判断是否已装箱,未转号
+            if (giftBox.Checked || fuselagel.Checked || pitao.Checked)
+            {
+                string type = "";
+                if (fuselagel.Checked)
+                    type = "机身标";
+                else if (giftBox.Checked)
+                    type = "彩盒标";
+                else if (pitao.Checked)
+                    type = "皮套标";
+                else
+                    type = "卡通箱标";
+                mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
+                if (mapB.Rows.Count == 0)
+                {
+                    //无值提示用户序列号错误,不存在或者已经发生转号
+                    OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
+                    return;
+                }
+                //如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
+                if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                {
+                    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                    return;
+                }
+                //判定通过进行打印 
+                //doc = lbl.Documents.Open(PrintLabel.Text);
+                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, type, "-1", out errorMessage))
+                {
+                    //按照打印张数打印
+                    OperateResult.AppendText("<<打印成功\n", Color.Green);
+                }
+                else
+                {
+                    OperateResult.AppendText(errorMessage + "\n", Color.Red);
+                }
+                //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, type, "补打印成功", inputValue.Text, "");
+                //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
+                if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
+                {
+                    //dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                    //插入数据
+                    putInfo2MakeDown();
+                }
+            }
+            //打印类型为卡通箱标签
+            else if (CartonBox.Checked)
+            {
+                //select pa_downstatus from package where pa_outboxcode=? 输入值code
+                mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
+                //无值提示用户箱号错误,不存在。
+                if (mapB.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<箱号:" + inputValue.Text + "错误,不存在\n", Color.Red);
+                    return;
+                }
+                //doc = lbl.Documents.Open(PrintLabel.Text);
+                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
+                {
+                    //判断通过,打印
+                    OperateResult.AppendText("<<打印成功\n", Color.Green);
+                }
+                else
+                {
+                    OperateResult.AppendText(errorMessage + "\n", Color.Red);
+                }
+                //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
+                //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
+                //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
+                //{
+                //    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
+                //    //插入MakeDown表
+                //    putInfo2MakeDown();
+                //}
+            }
+        }
+
+        /// <summary>
+        /// 判断彩盒和机身标序列是否已经装箱
+        /// </summary>
+        /// <returns></returns>
+        private bool checkPacked()
+        {
+            //如果存在,则判断是否装箱
+            dt = (DataTable)dh.ExecuteSql("select ms_id,ms_prodcode,ms_makecode,pr_detail, ms_outboxcode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'", "select");
+            //判断ms_outboxcode 是否为空,如果有值,则返回提示用户“已经装箱
+            if (dt.Rows.Count == 0)
+            {
+                OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
+                return true;
+            }
+            if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
+            {
+                OperateResult.AppendText("<<SN:" + inputText.Text + "已经装箱" + dt.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red, inputText);
+                return true;
+            }
+            return false;
+        }
+        /// <summary>
+        /// 插入表MAKEDOWN
+        /// </summary>
+        private void putInfo2MakeDown()
+        {
+            //插入数据至表MAKEDOWN
+            string md_code = "";
+            LogicHandler.GetSerialNumByCaller("MakeDown", out md_code);
+            sql.Clear();
+            sql.Append("INSERT INTO MAKEDOWN (MD_ID,MD_LINECODE,MD_SCCODE,MD_STEPCODE,");
+            sql.Append((CartonBox.Checked ? "MD_OUTBOXCODE" : "MD_SNCODE") + ",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
+            sql.Append("MD_DOWNDATE,MD_DOWNMAN,MD_STATUS) values (MAKEDOWN_seq.nextval,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
+            sql.Append("'" + User.CurrentStepCode + "','" + inputValue.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','补打标签','" + md_code + "',sysdate,'" + User.UserCode + "','-1')");
+            //dh.ExecuteSql(sql.GetString(), "insert");
+        }
+
+        private void rePrintCheck_KeyDown(object sender, KeyEventArgs e)
+        {
+
+        }
+        /// <summary>
+        /// 清除信息
+        /// </summary>
+        private void clearAll()
+        {
+            //清除输入值、工单代码、产品编号,名称、打印模板、核对第一次输入的SN
+            inputValue.Text = "";
+            ms_makecode.Text = "";
+            pr_code.Text = "";
+            pr_detail.Text = "";
+            TSN = "";
+            if (listA != null)
+            {
+                listA.Clear();
+            }
+        }
+    }
+}

+ 159 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_ReWorkPrintLabel.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="printBtn.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="printBtn.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="printBtn.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>

+ 9 - 0
UAS_MES_ODLF/UAS_MES_ODLF.csproj

@@ -568,6 +568,12 @@
     <Compile Include="FunctionCode\Make\Make_PreFeedingCollection.Designer.cs">
       <DependentUpon>Make_PreFeedingCollection.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ReWorkPrintLabel.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ReWorkPrintLabel.Designer.cs">
+      <DependentUpon>Make_ReWorkPrintLabel.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_SmtTestCollection.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1300,6 +1306,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_PreFeedingCollection.resx">
       <DependentUpon>Make_PreFeedingCollection.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ReWorkPrintLabel.resx">
+      <DependentUpon>Make_ReWorkPrintLabel.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_SmtTestCollection.resx">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </EmbeddedResource>