章政 8 жил өмнө
parent
commit
f294b58af7

+ 44 - 59
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -54,20 +54,19 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1116, 113);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(837, 90);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(201, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(152, 20);
             this.PrintLabel.TabIndex = 181;
             // 
             // 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(1013, 50);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(760, 40);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(72, 27);
+            this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 180;
             this.label2.Text = "打印机";
             // 
@@ -75,10 +74,9 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1013, 113);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(760, 90);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 27);
+            this.label1.Size = new System.Drawing.Size(42, 21);
             this.label1.TabIndex = 179;
             this.label1.Text = "标签";
             // 
@@ -86,10 +84,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(648, 52);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(486, 42);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 171;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -99,10 +96,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(64, 561);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(48, 449);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.Size = new System.Drawing.Size(58, 21);
             this.sncode_label.TabIndex = 170;
             this.sncode_label.Text = "序列号";
             // 
@@ -110,10 +106,9 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(648, 113);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(486, 90);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 167;
             this.label4.Text = "打印张数";
             // 
@@ -121,10 +116,9 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(356, 113);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(267, 90);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
             this.mcd_remainqty_label.TabIndex = 166;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -132,10 +126,9 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(64, 113);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(48, 90);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_okqty_label.TabIndex = 165;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -143,10 +136,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(356, 52);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(267, 42);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 164;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -154,29 +146,27 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(64, 52);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(48, 42);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 163;
             this.ms_makecode_label.Text = "归属工单";
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1116, 50);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5);
+            this.Printer.Location = new System.Drawing.Point(837, 40);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(203, 31);
+            this.Printer.Size = new System.Drawing.Size(152, 25);
             this.Printer.TabIndex = 178;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(483, 113);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(362, 90);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_remainqty.TabIndex = 177;
             this.mcd_remainqty.Text = "0";
             // 
@@ -184,10 +174,9 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(189, 113);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(142, 90);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_okqty.TabIndex = 176;
             this.mcd_okqty.Text = "0";
             // 
@@ -195,10 +184,9 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(483, 52);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.Location = new System.Drawing.Point(362, 42);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
             this.pr_code.TabIndex = 175;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -206,10 +194,9 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(777, 52);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(583, 42);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 174;
             // 
             // PrintNum
@@ -217,16 +204,16 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(775, 113);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Location = new System.Drawing.Point(581, 90);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(219, 25);
+            this.PrintNum.Size = new System.Drawing.Size(165, 21);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
             this.PrintNum.TabIndex = 172;
+            this.PrintNum.Text = "1";
             // 
             // sncode
             // 
@@ -235,11 +222,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(183, 562);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Location = new System.Drawing.Point(137, 450);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(260, 25);
+            this.sncode.Size = new System.Drawing.Size(196, 21);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -250,10 +236,9 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(69, 163);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(52, 130);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(940, 380);
+            this.OperateResult.Size = new System.Drawing.Size(706, 305);
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
@@ -261,16 +246,17 @@
             // 
             this.ma_code.AutoSize = true;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(191, 58);
+            this.ma_code.Location = new System.Drawing.Point(143, 46);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 27);
+            this.ma_code.Size = new System.Drawing.Size(0, 21);
             this.ma_code.TabIndex = 183;
             // 
             // Make_ColorBoxLabelPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1344, 651);
+            this.ClientSize = new System.Drawing.Size(1008, 521);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
@@ -291,7 +277,6 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_ColorBoxLabelPrint";
             this.Tag = "Make!ColorBoxLabelPrint";
             this.Text = "标签打印";

+ 53 - 58
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -61,76 +61,71 @@ namespace UAS_MES.Make
                     return;
                 }
                 string oMsID;
-
                 string oMakeCode;
                 // 获取工单归属工单下一工序是否正确
                 if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
-                {    
-                        //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                        if (ma_code.Text != macode || macode == "")
-                        {
-                            //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
-                            if (macode != "" && ma_code.Text != "")
-                            {
-                                OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
-                            }
-                        }
-                        sql.Clear();
-                        sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_okqty as mcd_remainqty,pr_detail,pr_code ");
-                        sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
-                        sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
-                        if (dt.Rows.Count > 0)
-                        {
-                            BaseUtil.SetFormValue(this.Controls, dt);
-                            //提示用户“<<工单号:取ma_makecode”
-                            OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Green);
-                            //提示用户“<< 序列号:XXXX”
-                            OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Green);
-                            sn_code = sncode.Text;
-                        }
-                        else
-                        {
-                            OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
-
-                        }
-                        string result = "";
-                        if (int.Parse(mcd_remainqty.Text) <= 0)
+                {
+                    //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
+                    if (ma_code.Text != macode || macode == "")
+                    {
+                        //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
+                        if (macode != "" && ma_code.Text != "")
                         {
-                            macode = ma_code.Text;
-                            BaseUtil.CleanForm(this);
-                            ErrorMessage = "工单" + macode + "打印完成>>>请输入SN";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            return;
+                            OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
                         }
-                        else
+                    }
+                    sql.Clear();
+                    sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_okqty as mcd_remainqty,pr_detail,pr_code ");
+                    sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
+                    sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
+                    if (dt.Rows.Count > 0)
+                    {
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        //提示用户“<< 序列号:XXXX”
+                        OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Green);
+                        sn_code = sncode.Text;
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                    }
+                    string result = "";
+                    if (int.Parse(mcd_remainqty.Text) <= 0)
+                    {
+                        macode = ma_code.Text;
+                        BaseUtil.CleanForm(this);
+                        ErrorMessage = "工单" + macode + "打印完成>>>请输入SN";
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        return;
+                    }
+                    else
+                    {
+                        if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
                         {
-                            if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
+                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text));
+                            if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserCode, "彩盒打印成功", out ErrorMessage))
                             {
-                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text));
-                                if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserCode, "彩盒打印成功", out ErrorMessage))
-                                {
-                                    OperateResult.AppendText(">>打印完成, 执行更新\n", Color.Green);
-                                    mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
-                                    mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
-                                    sncode.Text = "";
-                                    sncode.Focus();
-                                }
-                                else
-                                {
-                                    OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
-                                }
+                                OperateResult.AppendText(">>打印完成, 执行更新\n", Color.Green);
+                                mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
+                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
+                                sncode.Text = "";
+                                sncode.Focus();
                             }
                             else
                             {
-                                OperateResult.AppendText(">>该序列号对应的产品未维护(彩盒)标签模板或打印张数没有选择\n", Color.Red);
-                                return;
+                                OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
                             }
-                            OperateResult.AppendText(">>请输入SN\n", Color.Green);
-                        }         
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>该序列号对应的产品未维护(彩盒)标签模板或打印张数没有选择\n", Color.Red);
+                        }
+                    }
                 }
-                else {
-                    OperateResult.AppendText( ErrorMessage + "\n", Color.Red);
+                else
+                {
+                    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                 }
             }
         }