Browse Source

条码打印界面提交

callm 3 years ago
parent
commit
4f40015de4

+ 48 - 40
UAS_MES_KTK/FunctionCode/Packing/Packing_PackageCollection.Designer.cs

@@ -83,7 +83,6 @@
             this.pa_salecode_label = new System.Windows.Forms.Label();
             this.ma_code_label = new System.Windows.Forms.Label();
             this.ms_salecode = new System.Windows.Forms.Label();
-            this.ms_makecode = new System.Windows.Forms.Label();
             this.OutBoxLength_label = new System.Windows.Forms.Label();
             this.OutBoxLength = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pr_outboxinnerqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -108,6 +107,7 @@
             this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.groupBoxWithBorder2.SuspendLayout();
             this.groupBoxWithBorder1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -501,7 +501,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(527, 29);
+            this.label1.Location = new System.Drawing.Point(528, 30);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(146, 41);
@@ -524,7 +524,7 @@
             this.checkweightlabel.AutoSize = true;
             this.checkweightlabel.CutLength = null;
             this.checkweightlabel.ForeColor = System.Drawing.Color.Red;
-            this.checkweightlabel.Location = new System.Drawing.Point(53, 45);
+            this.checkweightlabel.Location = new System.Drawing.Point(54, 46);
             this.checkweightlabel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.checkweightlabel.MaximumSize = new System.Drawing.Size(400, 0);
             this.checkweightlabel.Name = "checkweightlabel";
@@ -535,7 +535,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(689, 173);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(690, 174);
             this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 41);
@@ -545,7 +545,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.Location = new System.Drawing.Point(689, 97);
+            this.ob_batchqty.Location = new System.Drawing.Point(690, 98);
             this.ob_batchqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 41);
@@ -555,7 +555,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(527, 173);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(528, 174);
             this.ob_nowcheckqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(146, 41);
@@ -566,7 +566,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(527, 101);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(528, 102);
             this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(146, 41);
@@ -577,7 +577,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno.Location = new System.Drawing.Point(689, 29);
+            this.ob_checkno.Location = new System.Drawing.Point(690, 30);
             this.ob_checkno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 41);
@@ -642,7 +642,7 @@
             // 
             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(13, 175);
+            this.label3.Location = new System.Drawing.Point(14, 176);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(146, 41);
@@ -692,7 +692,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(13, 95);
+            this.PrintList_label.Location = new System.Drawing.Point(14, 96);
             this.PrintList_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(178, 41);
@@ -703,7 +703,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum_label.Location = new System.Drawing.Point(413, 257);
+            this.PrintNum_label.Location = new System.Drawing.Point(414, 258);
             this.PrintNum_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(82, 41);
@@ -713,13 +713,13 @@
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.ma_code);
             this.groupBoxWithBorder1.Controls.Add(this.locksalecode);
             this.groupBoxWithBorder1.Controls.Add(this.PreFix_label);
             this.groupBoxWithBorder1.Controls.Add(this.PreFix);
             this.groupBoxWithBorder1.Controls.Add(this.pa_salecode_label);
             this.groupBoxWithBorder1.Controls.Add(this.ma_code_label);
             this.groupBoxWithBorder1.Controls.Add(this.ms_salecode);
-            this.groupBoxWithBorder1.Controls.Add(this.ms_makecode);
             this.groupBoxWithBorder1.Controls.Add(this.OutBoxLength_label);
             this.groupBoxWithBorder1.Controls.Add(this.OutBoxLength);
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
@@ -750,7 +750,7 @@
             this.locksalecode.AutoSize = true;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(581, 31);
+            this.locksalecode.Location = new System.Drawing.Point(582, 32);
             this.locksalecode.Margin = new System.Windows.Forms.Padding(6);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(186, 28);
@@ -762,7 +762,7 @@
             // 
             this.PreFix_label.AutoSize = true;
             this.PreFix_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PreFix_label.Location = new System.Drawing.Point(355, 27);
+            this.PreFix_label.Location = new System.Drawing.Point(356, 28);
             this.PreFix_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PreFix_label.Name = "PreFix_label";
             this.PreFix_label.Size = new System.Drawing.Size(71, 36);
@@ -790,7 +790,7 @@
             // 
             this.pa_salecode_label.AutoSize = true;
             this.pa_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode_label.Location = new System.Drawing.Point(417, 271);
+            this.pa_salecode_label.Location = new System.Drawing.Point(418, 272);
             this.pa_salecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_salecode_label.Name = "pa_salecode_label";
             this.pa_salecode_label.Size = new System.Drawing.Size(146, 41);
@@ -801,7 +801,7 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(9, 271);
+            this.ma_code_label.Location = new System.Drawing.Point(10, 272);
             this.ma_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_code_label.Name = "ma_code_label";
             this.ma_code_label.Size = new System.Drawing.Size(114, 41);
@@ -812,29 +812,17 @@
             // 
             this.ms_salecode.AutoSize = true;
             this.ms_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_salecode.Location = new System.Drawing.Point(579, 271);
+            this.ms_salecode.Location = new System.Drawing.Point(580, 272);
             this.ms_salecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_salecode.Name = "ms_salecode";
             this.ms_salecode.Size = new System.Drawing.Size(0, 41);
             this.ms_salecode.TabIndex = 188;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(181, 271);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(300, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(225, 41);
-            this.ms_makecode.TabIndex = 187;
-            this.ms_makecode.Text = "MD22080068";
-            // 
             // OutBoxLength_label
             // 
             this.OutBoxLength_label.AutoSize = true;
             this.OutBoxLength_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLength_label.Location = new System.Drawing.Point(159, 27);
+            this.OutBoxLength_label.Location = new System.Drawing.Point(160, 28);
             this.OutBoxLength_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.OutBoxLength_label.Name = "OutBoxLength_label";
             this.OutBoxLength_label.Size = new System.Drawing.Size(71, 36);
@@ -900,7 +888,7 @@
             this.AutoGenBoxCode.AutoSize = true;
             this.AutoGenBoxCode.Checked = true;
             this.AutoGenBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.AutoGenBoxCode.Location = new System.Drawing.Point(493, 87);
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(494, 88);
             this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(178, 45);
@@ -913,7 +901,7 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(421, 151);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(422, 152);
             this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(146, 41);
@@ -924,7 +912,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(417, 207);
+            this.pr_detail_label.Location = new System.Drawing.Point(418, 208);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
@@ -953,7 +941,7 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty.Location = new System.Drawing.Point(577, 147);
+            this.pa_currentqty.Location = new System.Drawing.Point(578, 148);
             this.pa_currentqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 41);
@@ -963,7 +951,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(9, 207);
+            this.pr_code_label.Location = new System.Drawing.Point(10, 208);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(146, 41);
@@ -974,7 +962,7 @@
             // 
             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(579, 207);
+            this.pr_detail.Location = new System.Drawing.Point(580, 208);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 41);
@@ -984,7 +972,7 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(9, 145);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(10, 146);
             this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(146, 41);
@@ -995,7 +983,7 @@
             // 
             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(181, 207);
+            this.pr_code.Location = new System.Drawing.Point(182, 208);
             this.pr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(300, 0);
             this.pr_code.Name = "pr_code";
@@ -1007,7 +995,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(9, 85);
+            this.pa_code_label.Location = new System.Drawing.Point(10, 86);
             this.pa_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(82, 41);
@@ -1137,6 +1125,26 @@
             this.pd_id.ReadOnly = true;
             this.pd_id.Visible = false;
             // 
+            // 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(131, 272);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            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(253, 42);
+            this.ma_code.TabIndex = 197;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "ma_code";
+            this.ma_code.TextBoxEnable = true;
+            // 
             // Packing_PackageCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -1246,7 +1254,6 @@
         private System.Windows.Forms.Label pa_salecode_label;
         private System.Windows.Forms.Label ma_code_label;
         private System.Windows.Forms.Label ms_salecode;
-        private System.Windows.Forms.Label ms_makecode;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
         private System.Windows.Forms.Label mcd_remainqty_label;
         private System.Windows.Forms.Label mcd_remainqty;
@@ -1275,5 +1282,6 @@
         private System.Windows.Forms.CheckBox AllowRepeat;
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.SnCollectionBox Remark_PreFix;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
     }
 }

+ 22 - 2
UAS_MES_KTK/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -32,6 +32,8 @@ namespace UAS_MES_NEW.Packing
         string LastSncode;
         string PR_CHECKCARTONW = "0";
 
+        DataTable DBFind;
+
         ModeBusTCPServer md;
 
         public Packing_PackageCollection()
@@ -70,12 +72,24 @@ namespace UAS_MES_NEW.Packing
             Port.Text = BaseUtil.GetCacheData("IPPort").ToString();
             //设置DbFind的必须的数据
             PrintNum.Text = "1";
+
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_spec # 产品名称,ma_bomversion # Bom版本,ma_softversion # 软件版本,ma_ecncode # ECN号";
+            ma_code.FormName = Name;
+            ma_code.DBTitle = "工单查询";
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec", "ma_craftcode", "ma_bomversion", "ma_softversion", "ma_ecncode" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += Ma_code_DBChange;
+
             asc.controllInitializeSize(this);
             thread = new Thread(NewPrint);
             SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             md = new ModeBusTCPServer();
             stw.ShowDialog();
+
+
+
             try
             {
                 OutBoxLength.Text = BaseUtil.GetCacheData("OutBoxLength").ToString();
@@ -92,6 +106,12 @@ namespace UAS_MES_NEW.Packing
             StepCount.Start();
         }
 
+        private void Ma_code_DBChange(object sender, EventArgs e)
+        {
+            DBFind = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, DBFind);
+        }
+
         private void PackCollection_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);
@@ -209,7 +229,7 @@ namespace UAS_MES_NEW.Packing
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
-                    if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
                         if (oMsID == "" || oMsID == "null" || oMsID == "0")
                         {
@@ -931,7 +951,7 @@ namespace UAS_MES_NEW.Packing
 
         private void LoadCollectedNum()
         {
-            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
 

+ 122 - 34
UAS_MES_KTK/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -31,12 +31,18 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SystemSetting_PrinterTest));
             this.ma_salecode_label = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.Date = new System.Windows.Forms.DateTimePicker();
             this.label4 = new System.Windows.Forms.Label();
             this.SN = new System.Windows.Forms.RadioButton();
             this.Material = new System.Windows.Forms.RadioButton();
+            this.ma_prodcode_label = new System.Windows.Forms.Label();
+            this.ma_prodcode = new System.Windows.Forms.Label();
+            this.ma_qty = new System.Windows.Forms.Label();
+            this.ma_qty_label = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.reportqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Rn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -64,49 +70,29 @@
             // 
             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(174, 333);
+            this.label3.Location = new System.Drawing.Point(174, 588);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(146, 41);
             this.label3.TabIndex = 31;
             this.label3.Text = "起始流水";
             // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(238, 409);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(82, 41);
-            this.label2.TabIndex = 29;
-            this.label2.Text = "日期";
-            this.label2.Visible = false;
-            // 
             // label1
             // 
             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(174, 258);
+            this.label1.Location = new System.Drawing.Point(110, 517);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.Size = new System.Drawing.Size(210, 41);
             this.label1.TabIndex = 28;
-            this.label1.Text = "打印数量";
-            // 
-            // Date
-            // 
-            this.Date.Location = new System.Drawing.Point(356, 415);
-            this.Date.Name = "Date";
-            this.Date.Size = new System.Drawing.Size(278, 35);
-            this.Date.TabIndex = 26;
-            this.Date.Visible = false;
+            this.label1.Text = "打印条码张数";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(206, 187);
+            this.label4.Location = new System.Drawing.Point(206, 190);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(114, 41);
@@ -138,6 +124,95 @@
             this.Material.UseVisualStyleBackColor = true;
             this.Material.Visible = false;
             // 
+            // ma_prodcode_label
+            // 
+            this.ma_prodcode_label.AutoSize = true;
+            this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_prodcode_label.Location = new System.Drawing.Point(174, 252);
+            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_prodcode_label.Name = "ma_prodcode_label";
+            this.ma_prodcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_prodcode_label.TabIndex = 41;
+            this.ma_prodcode_label.Text = "产品编号";
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_prodcode.Location = new System.Drawing.Point(359, 252);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ma_prodcode.TabIndex = 42;
+            // 
+            // ma_qty
+            // 
+            this.ma_qty.AutoSize = true;
+            this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_qty.Location = new System.Drawing.Point(359, 313);
+            this.ma_qty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty.Name = "ma_qty";
+            this.ma_qty.Size = new System.Drawing.Size(0, 41);
+            this.ma_qty.TabIndex = 44;
+            // 
+            // ma_qty_label
+            // 
+            this.ma_qty_label.AutoSize = true;
+            this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_qty_label.Location = new System.Drawing.Point(174, 313);
+            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty_label.Name = "ma_qty_label";
+            this.ma_qty_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_qty_label.TabIndex = 43;
+            this.ma_qty_label.Text = "工单数量";
+            // 
+            // pr_detail
+            // 
+            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(359, 386);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 46;
+            // 
+            // pr_detail_label
+            // 
+            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(174, 386);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_detail_label.TabIndex = 45;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(174, 449);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 48;
+            this.label2.Text = "报工数量";
+            // 
+            // reportqty
+            // 
+            this.reportqty.AllPower = null;
+            this.reportqty.BackColor = System.Drawing.Color.White;
+            this.reportqty.ID = null;
+            this.reportqty.Location = new System.Drawing.Point(356, 455);
+            this.reportqty.Margin = new System.Windows.Forms.Padding(6);
+            this.reportqty.Name = "reportqty";
+            this.reportqty.Power = null;
+            this.reportqty.Size = new System.Drawing.Size(278, 35);
+            this.reportqty.Str = null;
+            this.reportqty.Str1 = null;
+            this.reportqty.Str2 = null;
+            this.reportqty.TabIndex = 47;
+            // 
             // ma_code
             // 
             this.ma_code.AllPower = null;
@@ -152,6 +227,7 @@
             this.ma_code.Str1 = null;
             this.ma_code.Str2 = null;
             this.ma_code.TabIndex = 34;
+            this.ma_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ma_code_KeyDown);
             // 
             // Export
             // 
@@ -160,7 +236,7 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(356, 548);
+            this.Export.Location = new System.Drawing.Point(356, 664);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -177,7 +253,7 @@
             this.Rn.AllPower = null;
             this.Rn.BackColor = System.Drawing.Color.White;
             this.Rn.ID = null;
-            this.Rn.Location = new System.Drawing.Point(356, 342);
+            this.Rn.Location = new System.Drawing.Point(356, 594);
             this.Rn.Margin = new System.Windows.Forms.Padding(6);
             this.Rn.Name = "Rn";
             this.Rn.Power = null;
@@ -193,7 +269,7 @@
             this.Num.AllPower = null;
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
-            this.Num.Location = new System.Drawing.Point(356, 267);
+            this.Num.Location = new System.Drawing.Point(356, 526);
             this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
@@ -257,6 +333,14 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.reportqty);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.pr_detail_label);
+            this.Controls.Add(this.ma_qty);
+            this.Controls.Add(this.ma_qty_label);
+            this.Controls.Add(this.ma_prodcode);
+            this.Controls.Add(this.ma_prodcode_label);
             this.Controls.Add(this.Material);
             this.Controls.Add(this.SN);
             this.Controls.Add(this.ma_code);
@@ -264,10 +348,8 @@
             this.Controls.Add(this.Export);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.Rn);
-            this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Num);
-            this.Controls.Add(this.Date);
             this.Controls.Add(this.Setting);
             this.Controls.Add(this.PrinterList);
             this.Controls.Add(this.PrintTest);
@@ -290,14 +372,20 @@
         private CustomControl.ButtonUtil.NormalButton Setting;
         private System.Windows.Forms.Label label3;
         private CustomControl.TextBoxWithIcon.EnterTextBox Rn;
-        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label1;
         private CustomControl.TextBoxWithIcon.EnterTextBox Num;
-        private System.Windows.Forms.DateTimePicker Date;
         private CustomControl.ButtonUtil.NormalButton Export;
         private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.RadioButton SN;
         private System.Windows.Forms.RadioButton Material;
+        private System.Windows.Forms.Label ma_prodcode_label;
+        private System.Windows.Forms.Label ma_prodcode;
+        private System.Windows.Forms.Label ma_qty;
+        private System.Windows.Forms.Label ma_qty_label;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.TextBoxWithIcon.EnterTextBox reportqty;
     }
 }

+ 29 - 3
UAS_MES_KTK/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -1,5 +1,6 @@
 using Seagull.BarTender.Print;
 using System;
+using System.Data;
 using System.Drawing;
 using System.Drawing.Printing;
 using System.Windows.Forms;
@@ -59,7 +60,17 @@ namespace UAS_MES_NEW.SystemSetting
                     MessageBox.Show("工单号不存在");
                     return;
                 }
-                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
+                ma_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                int QTY = 0;
+                int report = 0;
+                if (int.TryParse(ma_qty.Text, out QTY))
+                {
+                    if (int.TryParse(reportqty.Text, out report))
+                    {
+                        Num.Text = (QTY % report == 0 ? QTY / report : QTY / report + 1).ToString();
+                    }
+                }
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 1)
                 {
                     int temp = i;
                     for (int j = 0; j < format.SubStrings.Count; j++)
@@ -74,7 +85,7 @@ namespace UAS_MES_NEW.SystemSetting
                                 //};
                                 break;
                             case "SN2":
-                                format.SubStrings[j].Value = (ma_code.Text.Replace("XX-", "") + lpad(4, (temp + 1).ToString()));
+                                //format.SubStrings[j].Value = (ma_code.Text.Replace("XX-", "") + lpad(4, (temp + 1).ToString()));
                                 //if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "'"))
                                 //{
                                 //    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
@@ -88,7 +99,6 @@ namespace UAS_MES_NEW.SystemSetting
                     format.PrintSetup.PrinterName = PrinterList.Text;
                     format.PrintSetup.IdenticalCopiesOfLabel = 1;
                     format.Print();
-
                 }
             }
         }
@@ -127,5 +137,21 @@ namespace UAS_MES_NEW.SystemSetting
                 label4.Visible = false;
             }
         }
+
+        private void ma_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                DataTable dt = (DataTable)dh.ExecuteSql("select ma_prodcode,pr_detail,ma_qty from make left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                }
+                else
+                {
+                    MessageBox.Show("工单" + ma_code.Text + "不存在");
+                }
+            }
+        }
     }
 }