소스 검색

彩盒标打印增加工单归属放大镜

Hcsy 8 년 전
부모
커밋
01b89c3f4c
2개의 변경된 파일95개의 추가작업 그리고 30개의 파일을 삭제
  1. 53 29
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs
  2. 42 1
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

+ 53 - 29
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -39,6 +39,8 @@
             this.mcd_okqty_label = new System.Windows.Forms.Label();
             this.pr_code_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.LockMakeCode = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
@@ -47,15 +49,14 @@
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.ma_code = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // PrintLabel
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(786, 89);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(802, 195);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(134, 20);
             this.PrintLabel.TabIndex = 181;
@@ -64,7 +65,7 @@
             // 
             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(709, 38);
+            this.label2.Location = new System.Drawing.Point(725, 144);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 180;
@@ -74,7 +75,7 @@
             // 
             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(709, 89);
+            this.label1.Location = new System.Drawing.Point(725, 195);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(42, 21);
             this.label1.TabIndex = 179;
@@ -84,7 +85,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(448, 40);
+            this.pr_detail_label.Location = new System.Drawing.Point(646, 32);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 171;
@@ -106,7 +107,7 @@
             // 
             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(448, 89);
+            this.label4.Location = new System.Drawing.Point(646, 78);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 167;
@@ -116,7 +117,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(229, 89);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(375, 74);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
             this.mcd_remainqty_label.TabIndex = 166;
@@ -126,7 +127,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(10, 89);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(12, 74);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_okqty_label.TabIndex = 165;
@@ -136,7 +137,7 @@
             // 
             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(229, 40);
+            this.pr_code_label.Location = new System.Drawing.Point(375, 31);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 164;
@@ -146,16 +147,47 @@
             // 
             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(10, 40);
+            this.ms_makecode_label.Location = new System.Drawing.Point(10, 31);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 163;
             this.ms_makecode_label.Text = "归属工单";
             // 
+            // LockMakeCode
+            // 
+            this.LockMakeCode.AutoSize = true;
+            this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LockMakeCode.LeaveEvent = false;
+            this.LockMakeCode.Location = new System.Drawing.Point(244, 31);
+            this.LockMakeCode.Name = "LockMakeCode";
+            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
+            this.LockMakeCode.TabIndex = 185;
+            this.LockMakeCode.Text = "锁定";
+            this.LockMakeCode.UseVisualStyleBackColor = true;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(90, 31);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(149, 25);
+            this.ma_code.TabIndex = 184;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = true;
+            this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
+            // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(786, 38);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Printer.Location = new System.Drawing.Point(802, 144);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(134, 25);
             this.Printer.TabIndex = 178;
@@ -164,7 +196,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(317, 89);
+            this.mcd_remainqty.Location = new System.Drawing.Point(463, 74);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_remainqty.TabIndex = 177;
@@ -174,7 +206,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(103, 89);
+            this.mcd_okqty.Location = new System.Drawing.Point(86, 74);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_okqty.TabIndex = 176;
@@ -185,7 +217,7 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(317, 40);
+            this.pr_code.Location = new System.Drawing.Point(463, 32);
             this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 21);
@@ -197,7 +229,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(536, 42);
+            this.pr_detail.Location = new System.Drawing.Point(734, 31);
             this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
@@ -208,7 +240,7 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(536, 89);
+            this.PrintNum.Location = new System.Drawing.Point(734, 78);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
@@ -246,21 +278,12 @@
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
-            // ma_code
-            // 
-            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(103, 42);
-            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, 21);
-            this.ma_code.TabIndex = 183;
-            // 
             // Make_ColorBoxLabelPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(938, 480);
+            this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
@@ -313,6 +336,7 @@
         private System.Windows.Forms.Label mcd_okqty_label;
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label ms_makecode_label;
-        private System.Windows.Forms.Label ma_code;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
     }
 }

+ 42 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -39,6 +39,8 @@ namespace UAS_MES.Make
         Thread InitPrint;
         ApplicationClass lbl;
 
+        DataTable Dbfind;
+
         public Make_ColorBoxLabelPrint()
         {
             InitializeComponent();
@@ -53,6 +55,24 @@ namespace UAS_MES.Make
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+
+            //设置锁定工单
+            LockMakeCode.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(LockMakeCode);
+
+            //工单号放大镜配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ma_code_DbChange;
+        }
+
+        private void Ma_code_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
         }
 
         private void InPrint()
@@ -95,7 +115,6 @@ namespace UAS_MES.Make
                         {
                             sncode.Text = "";
                             OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
-
                         }
                         string ErrorMessage = "";
                         string result = "";
@@ -197,5 +216,27 @@ namespace UAS_MES.Make
         {
             asc.controlAutoSize(this);
         }
+
+        private void ma_code_UserControlTextChanged(object sender, EventArgs e)
+        {
+            if (ma_code.Text.Length > 4)
+            {
+                //获取工单的其他信息
+                sql.Clear();
+                sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+                sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
+                sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                }
+                else
+                {
+                    sncode.Text = "";
+                    OperateResult.AppendText(">>无工单号" + ma_code.Text + "对应工单信息\n", Color.Red);
+                }
+            }
+        }
     }
 }