章政 6 gadi atpakaļ
vecāks
revīzija
d1cc400e01

+ 45 - 25
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -106,6 +106,8 @@
             this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
             this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.MidboxCapacity = new System.Windows.Forms.NumericUpDown();
+            this.label2 = new System.Windows.Forms.Label();
             this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.MidLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
@@ -134,8 +136,8 @@
             this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -149,6 +151,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).BeginInit();
             this.SingleLabel.SuspendLayout();
             this.MidLabel.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).BeginInit();
             this.OutBoxLabel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).BeginInit();
             this.SuspendLayout();
@@ -806,8 +809,8 @@
             this.pib_lotno,
             this.pib_datecode,
             this.pib_qty,
-            this.pib_barcode,
             this.pib_custbarcode,
+            this.pib_custmidboxcode,
             this.pib_custoutboxcode,
             this.pd_pocode,
             this.pd_custprodspec,
@@ -902,6 +905,8 @@
             // 
             // MidLabel
             // 
+            this.MidLabel.Controls.Add(this.MidboxCapacity);
+            this.MidLabel.Controls.Add(this.label2);
             this.MidLabel.Controls.Add(this.MidLabelNum);
             this.MidLabel.Controls.Add(this.label5);
             this.MidLabel.Controls.Add(this.MidLabelPrinter);
@@ -918,14 +923,33 @@
             this.MidLabel.TabStop = false;
             this.MidLabel.Text = "中盒标签";
             // 
+            // MidboxCapacity
+            // 
+            this.MidboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.MidboxCapacity.Location = new System.Drawing.Point(110, 121);
+            this.MidboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.MidboxCapacity.Name = "MidboxCapacity";
+            this.MidboxCapacity.Size = new System.Drawing.Size(38, 23);
+            this.MidboxCapacity.TabIndex = 92;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(76, 124);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(32, 17);
+            this.label2.TabIndex = 92;
+            this.label2.Text = "容量";
+            // 
             // MidLabelNum
             // 
             this.MidLabelNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MidLabelNum.ID = null;
-            this.MidLabelNum.Location = new System.Drawing.Point(51, 123);
+            this.MidLabelNum.Location = new System.Drawing.Point(37, 121);
             this.MidLabelNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelNum.Name = "MidLabelNum";
-            this.MidLabelNum.Size = new System.Drawing.Size(64, 23);
+            this.MidLabelNum.Size = new System.Drawing.Size(33, 23);
             this.MidLabelNum.Str = null;
             this.MidLabelNum.Str1 = null;
             this.MidLabelNum.Str2 = null;
@@ -1023,7 +1047,7 @@
             this.OutBoxNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxNum.Items.AddRange(new object[] {
             "新增"});
-            this.OutBoxNum.Location = new System.Drawing.Point(117, 127);
+            this.OutBoxNum.Location = new System.Drawing.Point(117, 123);
             this.OutBoxNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(48, 25);
@@ -1036,7 +1060,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(83, 130);
+            this.label10.Location = new System.Drawing.Point(83, 126);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1046,7 +1070,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(4, 129);
+            this.label6.Location = new System.Drawing.Point(4, 125);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1055,7 +1079,7 @@
             // OutBoxPrinter
             // 
             this.OutBoxPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxPrinter.Location = new System.Drawing.Point(8, 62);
+            this.OutBoxPrinter.Location = new System.Drawing.Point(8, 63);
             this.OutBoxPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
             this.OutBoxPrinter.Name = "OutBoxPrinter";
             this.OutBoxPrinter.Size = new System.Drawing.Size(158, 30);
@@ -1064,16 +1088,11 @@
             // OutboxCapacity
             // 
             this.OutboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutboxCapacity.Location = new System.Drawing.Point(39, 127);
+            this.OutboxCapacity.Location = new System.Drawing.Point(39, 122);
             this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutboxCapacity.Name = "OutboxCapacity";
             this.OutboxCapacity.Size = new System.Drawing.Size(38, 23);
             this.OutboxCapacity.TabIndex = 84;
-            this.OutboxCapacity.Value = new decimal(new int[] {
-            60,
-            0,
-            0,
-            0});
             this.OutboxCapacity.Leave += new System.EventHandler(this.MidBoxCapacity_Leave);
             // 
             // OutBoxLabelPrint
@@ -1092,7 +1111,7 @@
             // 
             this.OutBoxLabelAutoPrint.AutoSize = true;
             this.OutBoxLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(7, 98);
+            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(10, 96);
             this.OutBoxLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelAutoPrint.Name = "OutBoxLabelAutoPrint";
             this.OutBoxLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1209,22 +1228,20 @@
             this.pib_qty.ReadOnly = true;
             this.pib_qty.Width = 54;
             // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 78;
-            // 
             // pib_custbarcode
             // 
             this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "客户条码";
+            this.pib_custbarcode.HeaderText = "料盘条码";
             this.pib_custbarcode.Name = "pib_custbarcode";
             this.pib_custbarcode.ReadOnly = true;
             this.pib_custbarcode.Width = 78;
             // 
+            // pib_custmidboxcode
+            // 
+            this.pib_custmidboxcode.HeaderText = "中盒条码";
+            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
+            this.pib_custmidboxcode.Width = 78;
+            // 
             // pib_custoutboxcode
             // 
             this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
@@ -1326,6 +1343,7 @@
             this.SingleLabel.PerformLayout();
             this.MidLabel.ResumeLayout(false);
             this.MidLabel.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
             this.OutBoxLabel.ResumeLayout(false);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
@@ -1427,6 +1445,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pjd_zxbzs_user;
+        private System.Windows.Forms.NumericUpDown MidboxCapacity;
+        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
@@ -1439,8 +1459,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custbarcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_custmidboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custoutboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;

+ 26 - 31
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -111,17 +111,11 @@ namespace UAS_LabelMachine
         //当前的物料品牌
         string CurrentBrand = "";
 
-        string SinglePrefix = "";
-        string SingleSuffix = "";
-        int SingleMaxNum = 0;
-        int SingleNumLength = 0;
-        int SingleRadix = 0;
-
-        string OutPrefix = "";
-        string OutSuffix = "";
-        int OutMaxNum = 0;
-        int OutNumLength = 0;
-        int OutRadix = 0;
+        string Prefix = "";
+        string Suffix = "";
+        int MaxNum = 0;
+        int NumLength = 0;
+        int Radix = 0;
 
         string SingleSQL = "";
 
@@ -176,6 +170,7 @@ namespace UAS_LabelMachine
             Width = ScreenArea.Width;
             Height = ScreenArea.Height;
             OutboxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
+            MidboxCapacity.Value = Properties.Settings.Default.MidBoxCapacity;
             DCCheck.Text = Properties.Settings.Default.DCCheck.ToString();
             OutBoxPrinter.Text = Properties.Settings.Default.OPrinter;
             MidLabelPrinter.Text = Properties.Settings.Default.MPrinter;
@@ -396,34 +391,35 @@ namespace UAS_LabelMachine
                 return;
             }
             List<string> CustBarCode = new List<string>();
+            List<string> CustMidBarCode = new List<string>();
             List<string> CustOutBarCode = new List<string>();
             for (int i = 0; i < CodeCount; i++)
             {
-                if (SingleRadix > 0)
+                if (Radix > 0)
                 {
-                    string serialcode = BaseUtil.DToAny(SingleMaxNum, SingleRadix);
-                    for (int j = serialcode.ToString().Length; j < SingleNumLength; j++)
+                    string serialcode = BaseUtil.DToAny(MaxNum, Radix);
+                    for (int j = serialcode.ToString().Length; j < NumLength; j++)
                     {
                         serialcode = "0" + serialcode;
                     }
-                    CustBarCode.Add(SinglePrefix + serialcode + SingleSuffix);
-                    SingleMaxNum = SingleMaxNum + 1;
+                    CustBarCode.Add(Prefix + serialcode + Suffix);
+                    MaxNum = MaxNum + 1;
                 }
                 else
                 {
                     CustBarCode.Add("");
                 }
                 //添加外箱号
-                if (OutPrefix != "")
+                if (Prefix != "")
                 {
                     if (OutBoxNum.Text == "新增")
                     {
-                        string Outserialcode = BaseUtil.DToAny(OutMaxNum, OutRadix);
-                        for (int j = Outserialcode.ToString().Length; j < OutNumLength; j++)
+                        string Outserialcode = BaseUtil.DToAny(MaxNum, Radix);
+                        for (int j = Outserialcode.ToString().Length; j < NumLength; j++)
                         {
                             Outserialcode = "0" + Outserialcode;
                         }
-                        CustOutBarCode.Add(OutPrefix + Outserialcode + OutSuffix);
+                        CustOutBarCode.Add(Prefix + Outserialcode + Suffix);
                     }
                     else
                     {
@@ -437,7 +433,7 @@ namespace UAS_LabelMachine
             }
             if (OutBoxNum.Text == "新增")
             {
-                OutMaxNum = OutMaxNum + 1;
+                MaxNum = MaxNum + 1;
             }
             sql.Clear();
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
@@ -447,10 +443,10 @@ namespace UAS_LabelMachine
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE", "pib_custoutboxcode" }, PIBID, CustBarCode.ToArray(), CustOutBarCode.ToArray());
             //更新流水号
-            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (SingleMaxNum + CodeCount) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_type='Single' and rmn_prefix='" + SinglePrefix + "'");
+            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + CodeCount) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_type='Single' and rmn_prefix='" + Prefix + "'");
             if (OutBoxNum.Text == "新增")
             {
-                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (OutMaxNum) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_type='Out' and rmn_prefix='" + OutPrefix + "'");
+                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_type='Out' and rmn_prefix='" + Prefix + "'");
             }
             OutBoxNum.Text = pib_outboxcode2;
             LoadGridData(new object(), new EventArgs());
@@ -752,8 +748,7 @@ namespace UAS_LabelMachine
                     LoadPrcodeData();
                     LoadGridData(sender, e);
                     //获取条码规则
-                    GetBarCodeRule("Single", out SinglePrefix, out SingleSuffix, out SingleMaxNum, out SingleNumLength, out SingleRadix);
-                    GetBarCodeRule("Out", out OutPrefix, out OutSuffix, out OutMaxNum, out OutNumLength, out OutRadix);
+                    GetBarCodeRule(out Prefix, out Suffix, out MaxNum, out NumLength, out Radix);
                     //重新输入单号后清除缓存
                     MidBoxArgument.Clear();
                     SingleBoxArgument.Clear();
@@ -1308,7 +1303,7 @@ namespace UAS_LabelMachine
         {
             AllChecked = false;
             sql.Clear();
-            sql.Append("select pd_custprodcode,pd_custprodspec,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,");
+            sql.Append("select pd_custprodcode,pd_custprodspec,pib_custmidboxcode,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,");
             sql.Append("pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand,pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,");
             sql.Append("pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join ");
             sql.Append("prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode  ");
@@ -1614,7 +1609,7 @@ namespace UAS_LabelMachine
         /// <param name="CurrentMaxNum"></param>
         /// <param name="SerialNumLength"></param>
         /// <param name="Radix"></param>
-        private void GetBarCodeRule(string Type, out string Prefix, out string Suffix, out int CurrentMaxNum, out int SerialNumLength, out int Radix)
+        private void GetBarCodeRule(out string Prefix, out string Suffix, out int CurrentMaxNum, out int SerialNumLength, out int Radix)
         {
             //获取编码规则
             Prefix = "";
@@ -1622,10 +1617,10 @@ namespace UAS_LabelMachine
             CurrentMaxNum = 0;
             SerialNumLength = 0;
             Radix = 0;
-            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + pi_cardcode.Text + "' and nr_type='" + Type + "' order by nrd_detno", "select");
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + pi_cardcode.Text + "'  order by nrd_detno", "select");
             //如果没有则取公共规则
             if (Nr.Rows.Count == 0)
-                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_type='" + Type + "' and nr_isdefault <> 0 order by nrd_detno", "select");
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null  and nr_isdefault <> 0 order by nrd_detno", "select");
             //用于过滤参数的正则表达式
             Regex match = new Regex("{\\w+}");
             //用于存放每一项的明细的数据
@@ -1667,11 +1662,11 @@ namespace UAS_LabelMachine
                         break;
                     //流水需要通过MaxNumber去取
                     case "流水":
-                        string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'  and rmn_type='" + Type + "'").ToString();
+                        string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'").ToString();
                         //设置当前流水
                         if (maxnum == "")
                         {
-                            dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber,rmn_type) values(RuleMaxNum_seq.nextval,'" + pi_cardcode.Text + "','" + Prefix + "','1','" + Type + "')", "insert");
+                            dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + pi_cardcode.Text + "','" + Prefix + "','1')", "insert");
                             CurrentMaxNum = 1;
                         }
                         else

+ 3 - 0
UAS-出货标签管理(泽天)/UAS_出货标签管理.resx

@@ -162,6 +162,9 @@
   <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pib_custmidboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pib_custoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>