Pārlūkot izejas kodu

箱号倒序和解决卡顿问题

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

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

@@ -683,7 +683,7 @@
             this.pi_title.AutoSize = true;
             this.pi_title.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pi_title.Location = new System.Drawing.Point(83, 41);
-            this.pi_title.MaximumSize = new System.Drawing.Size(120, 0);
+            this.pi_title.MaximumSize = new System.Drawing.Size(155, 0);
             this.pi_title.Name = "pi_title";
             this.pi_title.Size = new System.Drawing.Size(0, 20);
             this.pi_title.TabIndex = 105;
@@ -859,7 +859,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(63, 122);
+            this.label18.Location = new System.Drawing.Point(61, 120);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -893,7 +893,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(62, 59);
+            this.label16.Location = new System.Drawing.Point(60, 57);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -927,7 +927,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(5, 96);
+            this.label12.Location = new System.Drawing.Point(3, 94);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -937,7 +937,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(5, 34);
+            this.label7.Location = new System.Drawing.Point(3, 32);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1207,7 +1207,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(97, 177);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(85, 178);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1222,7 +1222,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(7, 96);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(10, 97);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1280,7 +1280,7 @@
             // 
             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(8, 120);
+            this.label2.Location = new System.Drawing.Point(6, 118);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -1303,7 +1303,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(8, 153);
+            this.label5.Location = new System.Drawing.Point(6, 151);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1321,7 +1321,7 @@
             // MidLabelPrint
             // 
             this.MidLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelPrint.Location = new System.Drawing.Point(96, 178);
+            this.MidLabelPrint.Location = new System.Drawing.Point(83, 178);
             this.MidLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelPrint.Name = "MidLabelPrint";
             this.MidLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1336,7 +1336,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 96);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 94);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1379,7 +1379,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(93, -6);
+            this.LogingOut.Location = new System.Drawing.Point(106, 7);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1405,7 +1405,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(12, 146);
+            this.label10.Location = new System.Drawing.Point(10, 144);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1415,7 +1415,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(12, 112);
+            this.label6.Location = new System.Drawing.Point(10, 110);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1521,18 +1521,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -245,8 +245,6 @@ namespace UAS_LabelMachine
             if (!CheckDateCode(Data["DATECODE"]))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "【DateCode】超出校验日期");
-                Input.SelectAll();
-                return;
             }
             if (Data["PRCODE"] != CurrentPrCode)
             {
@@ -310,6 +308,11 @@ namespace UAS_LabelMachine
             {
                 pib_outboxcode2 = OutBoxNum.Text;
             }
+            if (OutBoxNum.Text == "全部")
+            {
+                MessageBox.Show("请选择指定箱号或者新增");
+                return;
+            }
             //计算当前采集数量
             string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
             double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
@@ -387,7 +390,23 @@ namespace UAS_LabelMachine
                 }
             }
             Input.Clear();
-            OutBoxNum_Click(new object(), new EventArgs());
+            if (OutBoxNum.Text == "新增")
+            {
+                OutBoxNum.Items.Clear();
+                DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
+                ItemObject io = new ItemObject("新增", "新增");
+                OutBoxNum.Items.Add(io);
+                io = new ItemObject("全部", "全部");
+                OutBoxNum.Items.Add(io);
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
+                    io = new ItemObject(piboutboxcode2, piboutboxcode2);
+                    OutBoxNum.Items.Add(io);
+                }
+                if (OutBoxNum.Items.Count > 2)
+                    OutBoxNum.SelectedIndex = 2;
+            }
         }
 
         private void AutoPrintSingleLabel()
@@ -531,8 +550,8 @@ namespace UAS_LabelMachine
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
                     OutBoxNum_Click(new object(), new EventArgs());
-                    LoadPrcodeData();
                     LoadGridData(sender, e);
+                    LoadPrcodeData();
                     //获取条码规则
                     GetBarCodeRule(out Prefix, out Suffix, out MaxNum, out NumLength, out Radix);
                     SingleID.Clear();
@@ -853,7 +872,7 @@ namespace UAS_LabelMachine
         {
             List<string> Outboxcode = new List<string>();
             //如果未勾选箱号则对勾选的数据的箱号进行整合
-            if (OutBoxNum.Text == "" || OutBoxNum.Text == "新增")
+            if (OutBoxNum.Text == "" || OutBoxNum.Text == "全部")
             {
                 for (int i = 0; i < LabelInf.RowCount; i++)
                 {
@@ -1053,7 +1072,7 @@ namespace UAS_LabelMachine
             sql.Append("left join sale on sa_code=pib_ordercode left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pib_piid='" + PI_ID + "' ");
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            if (OutBoxNum.Text != "新增")
+            if (OutBoxNum.Text != "全部")
             {
                 BaseUtil.FillDgvWithDataTable(LabelInf, BaseUtil.filterDataTable(LabelInfDataTable, "  pib_outboxcode2='" + OutBoxNum.Text + "'"));
             }
@@ -1339,9 +1358,11 @@ namespace UAS_LabelMachine
         {
             string OutBox = OutBoxNum.Text;
             OutBoxNum.Items.Clear();
-            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2)", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
             ItemObject io = new ItemObject("新增", "新增");
             OutBoxNum.Items.Add(io);
+            io = new ItemObject("全部", "全部");
+            OutBoxNum.Items.Add(io);
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 string pib_outboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
@@ -1349,7 +1370,12 @@ namespace UAS_LabelMachine
                 OutBoxNum.Items.Add(io);
             }
             if (OutBoxNum.Text == "新增" || OutBoxNum.Text == "")
-                OutBoxNum.SelectedIndex = OutBoxNum.Items.Count - 1;
+            {
+                if (dt.Rows.Count > 0)
+                    OutBoxNum.SelectedIndex = 2;
+                else
+                    OutBoxNum.SelectedIndex = 0;
+            }
             if (OutBox != "新增" && OutBox != "")
                 OutBoxNum.Text = OutBox;
         }
@@ -1593,11 +1619,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void OutBoxNum_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            LoadGridData(sender, e);
-        }
-
         private void Pack_Click(object sender, EventArgs e)
         {
             if (LabelInf.Rows.Count > 0)
@@ -1721,5 +1742,10 @@ namespace UAS_LabelMachine
                 SelectRowIndex = e.RowIndex;
             }
         }
+
+        private void OutBoxNum_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            LoadGridData(sender, e);
+        }
     }
 }