callm 4 gadi atpakaļ
vecāks
revīzija
090db49a38

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

@@ -263,14 +263,13 @@
             // CleanDetail
             // 
             this.CleanDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanDetail.Location = new System.Drawing.Point(292, 108);
+            this.CleanDetail.Location = new System.Drawing.Point(592, 96);
             this.CleanDetail.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CleanDetail.Name = "CleanDetail";
             this.CleanDetail.Size = new System.Drawing.Size(128, 52);
             this.CleanDetail.TabIndex = 66;
             this.CleanDetail.Text = "清除明细";
             this.CleanDetail.UseVisualStyleBackColor = true;
-            this.CleanDetail.Visible = false;
             this.CleanDetail.Click += new System.EventHandler(this.CleanDetail_Click);
             // 
             // pib_id
@@ -532,14 +531,13 @@
             // AttachInfo
             // 
             this.AttachInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AttachInfo.Location = new System.Drawing.Point(292, 102);
+            this.AttachInfo.Location = new System.Drawing.Point(754, 96);
             this.AttachInfo.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AttachInfo.Name = "AttachInfo";
             this.AttachInfo.Size = new System.Drawing.Size(128, 52);
             this.AttachInfo.TabIndex = 85;
             this.AttachInfo.Text = "附加信息设置";
             this.AttachInfo.UseVisualStyleBackColor = true;
-            this.AttachInfo.Visible = false;
             this.AttachInfo.Click += new System.EventHandler(this.AttachInfo_Click);
             // 
             // pi_date
@@ -579,14 +577,13 @@
             // PrintFooter
             // 
             this.PrintFooter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintFooter.Location = new System.Drawing.Point(292, 110);
+            this.PrintFooter.Location = new System.Drawing.Point(916, 96);
             this.PrintFooter.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.PrintFooter.Name = "PrintFooter";
             this.PrintFooter.Size = new System.Drawing.Size(128, 52);
             this.PrintFooter.TabIndex = 89;
             this.PrintFooter.Text = "打印唛头";
             this.PrintFooter.UseVisualStyleBackColor = true;
-            this.PrintFooter.Visible = false;
             this.PrintFooter.Click += new System.EventHandler(this.PrintFooter_Click);
             // 
             // SetPrintStatus_label
@@ -626,7 +623,7 @@
             // PrintStatus
             // 
             this.PrintStatus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintStatus.Location = new System.Drawing.Point(292, 108);
+            this.PrintStatus.Location = new System.Drawing.Point(292, 150);
             this.PrintStatus.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.PrintStatus.Name = "PrintStatus";
             this.PrintStatus.Size = new System.Drawing.Size(128, 52);
@@ -682,7 +679,7 @@
             // 
             this.CustomerLabel.Enabled = false;
             this.CustomerLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CustomerLabel.Location = new System.Drawing.Point(280, 106);
+            this.CustomerLabel.Location = new System.Drawing.Point(280, 154);
             this.CustomerLabel.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CustomerLabel.Name = "CustomerLabel";
             this.CustomerLabel.Size = new System.Drawing.Size(168, 52);
@@ -696,7 +693,7 @@
             // 
             this.Combindetail.AutoSize = true;
             this.Combindetail.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.Combindetail.Location = new System.Drawing.Point(592, 155);
+            this.Combindetail.Location = new System.Drawing.Point(592, 156);
             this.Combindetail.Margin = new System.Windows.Forms.Padding(4);
             this.Combindetail.Name = "Combindetail";
             this.Combindetail.Size = new System.Drawing.Size(156, 35);
@@ -741,18 +738,18 @@
             // ProcessCount
             // 
             this.ProcessCount.AutoSize = true;
-            this.ProcessCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ProcessCount.Location = new System.Drawing.Point(678, 400);
+            this.ProcessCount.Font = new System.Drawing.Font("微软雅黑", 14.5F);
+            this.ProcessCount.Location = new System.Drawing.Point(678, 385);
             this.ProcessCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ProcessCount.Name = "ProcessCount";
-            this.ProcessCount.Size = new System.Drawing.Size(0, 36);
+            this.ProcessCount.Size = new System.Drawing.Size(0, 51);
             this.ProcessCount.TabIndex = 108;
             // 
             // CombindetailTwo
             // 
             this.CombindetailTwo.AutoSize = true;
             this.CombindetailTwo.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.CombindetailTwo.Location = new System.Drawing.Point(592, 211);
+            this.CombindetailTwo.Location = new System.Drawing.Point(592, 212);
             this.CombindetailTwo.Margin = new System.Windows.Forms.Padding(4);
             this.CombindetailTwo.Name = "CombindetailTwo";
             this.CombindetailTwo.Size = new System.Drawing.Size(231, 35);
@@ -764,7 +761,7 @@
             // Reset
             // 
             this.Reset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Reset.Location = new System.Drawing.Point(280, 106);
+            this.Reset.Location = new System.Drawing.Point(280, 134);
             this.Reset.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.Reset.Name = "Reset";
             this.Reset.Size = new System.Drawing.Size(128, 52);
@@ -777,7 +774,7 @@
             // GetPDdata
             // 
             this.GetPDdata.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetPDdata.Location = new System.Drawing.Point(260, 108);
+            this.GetPDdata.Location = new System.Drawing.Point(280, 108);
             this.GetPDdata.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.GetPDdata.Name = "GetPDdata";
             this.GetPDdata.Size = new System.Drawing.Size(186, 52);
@@ -921,7 +918,7 @@
             // 
             this.MixPrCode.AutoSize = true;
             this.MixPrCode.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.MixPrCode.Location = new System.Drawing.Point(592, 267);
+            this.MixPrCode.Location = new System.Drawing.Point(592, 268);
             this.MixPrCode.Margin = new System.Windows.Forms.Padding(4);
             this.MixPrCode.Name = "MixPrCode";
             this.MixPrCode.Size = new System.Drawing.Size(142, 35);
@@ -931,7 +928,8 @@
             // 
             // richTextAutoBottom1
             // 
-            this.richTextAutoBottom1.Location = new System.Drawing.Point(12, 1461);
+            this.richTextAutoBottom1.Location = new System.Drawing.Point(12, 1460);
+            this.richTextAutoBottom1.Margin = new System.Windows.Forms.Padding(4);
             this.richTextAutoBottom1.Name = "richTextAutoBottom1";
             this.richTextAutoBottom1.Size = new System.Drawing.Size(2532, 156);
             this.richTextAutoBottom1.TabIndex = 119;
@@ -1212,8 +1210,6 @@
             this.groupBoxWithBorder1.Controls.Add(this.SingleBoxBegin);
             this.groupBoxWithBorder1.Controls.Add(this.label12);
             this.groupBoxWithBorder1.Controls.Add(this.label7);
-            this.groupBoxWithBorder1.Controls.Add(this.PackMidBox);
-            this.groupBoxWithBorder1.Controls.Add(this.PackOutBox);
             this.groupBoxWithBorder1.Location = new System.Drawing.Point(1150, 12);
             this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
@@ -1239,7 +1235,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(144, 260);
+            this.label18.Location = new System.Drawing.Point(128, 244);
             this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(24, 31);
@@ -1274,7 +1270,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(140, 132);
+            this.label16.Location = new System.Drawing.Point(125, 117);
             this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(24, 31);
@@ -1330,7 +1326,7 @@
             // PackMidBox
             // 
             this.PackMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PackMidBox.Location = new System.Drawing.Point(114, 36);
+            this.PackMidBox.Location = new System.Drawing.Point(1006, 84);
             this.PackMidBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.PackMidBox.Name = "PackMidBox";
             this.PackMidBox.Size = new System.Drawing.Size(128, 52);
@@ -1343,7 +1339,7 @@
             // PackOutBox
             // 
             this.PackOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PackOutBox.Location = new System.Drawing.Point(122, 96);
+            this.PackOutBox.Location = new System.Drawing.Point(1006, 144);
             this.PackOutBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.PackOutBox.Name = "PackOutBox";
             this.PackOutBox.Size = new System.Drawing.Size(128, 52);
@@ -1667,7 +1663,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(30, 300);
+            this.label14.Location = new System.Drawing.Point(28, 288);
             this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(155, 36);
@@ -1687,7 +1683,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(30, 244);
+            this.label13.Location = new System.Drawing.Point(28, 232);
             this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(155, 36);
@@ -1717,7 +1713,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(453, 357);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(-4, 352);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(136, 52);
@@ -1729,8 +1725,10 @@
             // SingleLabelAutoPrint
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
+            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(36, 204);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(12, 178);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1777,7 +1775,7 @@
             this.CurrentRowOnly.Checked = true;
             this.CurrentRowOnly.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CurrentRowOnly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CurrentRowOnly.Location = new System.Drawing.Point(180, 208);
+            this.CurrentRowOnly.Location = new System.Drawing.Point(166, 188);
             this.CurrentRowOnly.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CurrentRowOnly.Name = "CurrentRowOnly";
             this.CurrentRowOnly.Size = new System.Drawing.Size(166, 35);
@@ -1861,7 +1859,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(24, 204);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(12, 186);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1904,7 +1902,7 @@
             this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(4);
             this.OutBoxLabel.Name = "OutBoxLabel";
             this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(4);
-            this.OutBoxLabel.Size = new System.Drawing.Size(405, 422);
+            this.OutBoxLabel.Size = new System.Drawing.Size(404, 422);
             this.OutBoxLabel.TabIndex = 79;
             this.OutBoxLabel.TabStop = false;
             this.OutBoxLabel.Text = "外箱标签";
@@ -1983,7 +1981,7 @@
             // 
             this.AllLabel.AutoSize = true;
             this.AllLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllLabel.Location = new System.Drawing.Point(32, 204);
+            this.AllLabel.Location = new System.Drawing.Point(30, 192);
             this.AllLabel.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AllLabel.Name = "AllLabel";
             this.AllLabel.Size = new System.Drawing.Size(190, 35);
@@ -2105,7 +2103,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(2556, 1629);
+            this.ClientSize = new System.Drawing.Size(1924, 1062);
             this.Controls.Add(this.MixPrCode);
             this.Controls.Add(this.richTextAutoBottom1);
             this.Controls.Add(this.Connect);
@@ -2113,7 +2111,9 @@
             this.Controls.Add(this.pib_indate);
             this.Controls.Add(this.label11);
             this.Controls.Add(this.groupBoxWithBorder2);
+            this.Controls.Add(this.PackMidBox);
             this.Controls.Add(this.GetPDdata);
+            this.Controls.Add(this.PackOutBox);
             this.Controls.Add(this.Reset);
             this.Controls.Add(this.CombindetailTwo);
             this.Controls.Add(this.ProcessCount);

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

@@ -164,6 +164,10 @@ namespace UAS_LabelMachine
             {
                 dgv.SortMode = DataGridViewColumnSortMode.NotSortable;
             }
+            foreach (DataGridViewColumn dgv in GridPrcode.Columns)
+            {
+                dgv.SortMode = DataGridViewColumnSortMode.NotSortable;
+            }
             int ScreenWidth = Screen.GetWorkingArea(pt).Width;
             //设置获取当前屏幕大小自动全屏但是保留任务栏
             Rectangle ScreenArea = Screen.GetWorkingArea(this);
@@ -211,6 +215,8 @@ namespace UAS_LabelMachine
             GetInOutInfAndLabelFile();
         }
         int PassTenCount = 1;
+
+        int PassSixTenCount = 1;
         //输入框Enter事件
         private void Input_KeyDown(object sender, KeyEventArgs e)
         {
@@ -366,8 +372,13 @@ namespace UAS_LabelMachine
             string pib_barcode = Data.ContainsKey("SERIAL") ? Data["SERIAL"] : "";
             //获取ID
             PIBID = dh.GetSEQ("prodiobarcode_seq", CodeCount);
+
+            //加载完数据之后进行容量的判断
+
             string pib_outboxcode2 = "";
-            if (OutBoxNum.Text == "新增")
+
+            int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
+            if (BoxNum + CodeCount > OutboxCapacity.Value)
             {
                 string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
                 //如果没有则从开始插入
@@ -379,34 +390,74 @@ namespace UAS_LabelMachine
                 {
                     pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
                 }
+                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);
+                io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
+                PassSixTenCount = 1;
+                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;
             }
             else
             {
-                pib_outboxcode2 = OutBoxNum.Text;
+                if (OutBoxNum.Text == "新增")
+                {
+                    string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                    //如果没有则从开始插入
+                    if (maxoutbox == "")
+                    {
+                        pib_outboxcode2 = "1";
+                    }
+                    else
+                    {
+                        pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
+                    }
+                    OutBoxNum.Items.Clear();
+                    PassSixTenCount = 1;
+                    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);
+                    io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
+                    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;
+                }
+                else
+                {
+                    pib_outboxcode2 = OutBoxNum.Text;
+                }
             }
             if (OutBoxNum.Text == "全部")
             {
                 MessageBox.Show("请选择指定箱号或者新增");
                 return;
             }
-            //加载完数据之后进行容量的判断
-            int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
-            if (BoxNum + CodeCount > OutboxCapacity.Value)
-            {
-                string close = MessageBox.Show(this.ParentForm, "箱号【" + OutBoxNum.Text + "】后超数量为" + (BoxNum + CodeCount) + ",超出容量" + OutboxCapacity.Value + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                if (close != "Yes")
-                {
-                    Input.SelectAll();
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
-                    return;
-                }
-            }
             //计算当前采集数量
             string collectqty = dh.getFieldDataByCondition("prodiobarcode", "sum(pib_qty)", "pib_inoutno='" + pi_inoutno.Text + "' and pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString();
             double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
             if (Convert.ToDouble((CollectQty + CollectNum).ToString("0.000")) > Convert.ToDouble(double.Parse(CurrentPrCount).ToString("0.000")))
             {
-                richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount+"\n");
+                richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount + "\n");
                 receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                 Input.SelectAll();
                 return;
@@ -534,23 +585,23 @@ namespace UAS_LabelMachine
                 }
             }
             Input.Clear();
-            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;
-            }
+            //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()
@@ -706,6 +757,7 @@ namespace UAS_LabelMachine
                             break;
                     }
                     PassTenCount = 1;
+                    PassSixTenCount = 1;
                     if (pi_cardcode.Text != "ZGCC")
                     {
                         CustomerLabel.Enabled = false;
@@ -1291,6 +1343,8 @@ namespace UAS_LabelMachine
                 {
                     dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
                     dh.UpdateByCondition("CS$InoutPrcode", "collectednum=(select nvl(sum(pib_qty),0) from prodiobarcode where pib_inoutno=pd_inoutno and pib_pdno=pd_pdno)", "pd_inoutno='" + pi_inoutno.Text + "'");
+                    dh.UpdateByCondition("CS$InoutPrcode", "checknum=CollectedNum/pjd_zxbzs_user", "pd_inoutno='" + pi_inoutno.Text + "'");
+
                     LogManager.DoCommandLog(pi_inoutno.Text, User.UserCode, "删除明细", "删除明细成功");
                     MessageBox.Show("删除成功", "提示");
                     Input.Clear();
@@ -1346,11 +1400,20 @@ namespace UAS_LabelMachine
             string SQL = "";
             if (OutBoxNum.Text != "全部")
             {
-                LogicHandler.GetDataSQL(PI_ID, "and pib_outboxcode2='" + OutBoxNum.Text + "'", out SQL);
+                //LogicHandler.GetDataSQL(PI_ID, "and pib_outboxcode2='" + OutBoxNum.Text + "'", out SQL);
+                SQL = "select pib_boxweight,pib_totalweight,pd_custprodcode,pd_custprodspec,nvl(pib_midifprint,0)pib_midifprint,pib_custmidboxcode,pd_pocode,pjd_orispeccode," +
+                      "pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pib_brand,pr_vendprodcode,pib_lotno,pib_datecode," +
+                      "week_to_date(pib_datecode) datecode1,pib_qty,pr_spec,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint, 0)pib_ifprint,pd_remark,pd_remark2 from prodiobarcode left join " +
+                      "prodiodetail on pib_piid = pd_piid and pd_pdno = pib_pdno and pd_prodcode = pib_prodcode left join product on pr_code = pib_prodcode 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 + "' and pib_outboxcode2='" + OutBoxNum.Text + "' order by to_number(pib_outboxcode2),pib_id,pd_prodcode";
             }
             else
             {
-                LogicHandler.GetDataSQL(PI_ID, "", out SQL);
+                SQL = "select pib_boxweight,pib_totalweight,pd_custprodcode,pd_custprodspec,nvl(pib_midifprint,0)pib_midifprint,pib_custmidboxcode,pd_pocode,pjd_orispeccode," +
+                   "pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pib_brand,pr_vendprodcode,pib_lotno,pib_datecode," +
+                   "week_to_date(pib_datecode) datecode1,pib_qty,pr_spec,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint, 0)pib_ifprint,pd_remark,pd_remark2 from prodiobarcode left join " +
+                   "prodiodetail on pib_piid = pd_piid and pd_pdno = pib_pdno and pd_prodcode = pib_prodcode left join product on pr_code = pib_prodcode 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 + "'  order by to_number(pib_outboxcode2),pib_id,pd_prodcode";
             }
             LabelInfDataTable = (DataTable)dh.ExecuteSql(SQL, "select");
             BoxCount.Text = LabelInfDataTable.Compute("sum(pib_qty)", "1=1").ToString() + "KPCS";
@@ -2087,7 +2150,7 @@ namespace UAS_LabelMachine
 
         private void PackMidBox_Click(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_outboxcode2", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + OutBoxNum.Text + "' order by pib_outboxcode2", "select");
             DataTable dt1 = null;
             int GetNumCount = 0;
             for (int i = 0; i < dt.Rows.Count; i++)
@@ -2495,7 +2558,7 @@ namespace UAS_LabelMachine
                 if (getMsg.Contains("ReadId"))
                 {
                     string msgStr = getMsg.Trim('\0').Replace("ReadId1|,|", "");
-                    msgStr = Regex.Match(msgStr, @"[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+").Value;
+                    msgStr = Regex.Match(msgStr, @"[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[0-9A-Za-z]+\*[0-9A-Za-z]+\*[0-9A-Za-z]+\*[A-Za-z0-9]+").Value;
                     //设置索引和内容
                     // msgStr = msgStr.Split(ps_split.ToCharArray()[0])[dataindex];
                     Input.Text = msgStr;
@@ -2537,7 +2600,7 @@ namespace UAS_LabelMachine
                 if (getMsg.Contains("ReadId3"))
                 {
                     string msgStr = getMsg.Trim('\0').Replace("ReadId3|,|", "");
-                    string temp = Regex.Match(msgStr, @"[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+\*[A-Za-z0-9]+").Value;
+                    string temp = Regex.Match(msgStr, @"[-{0,5}/{0,5}.{0,5}0-9A-Za-z]+\*[0-9A-Za-z]+\*[0-9A-Za-z]+\*[0-9A-Za-z]+\*[A-Za-z0-9]+").Value;
                     string pr_code = "";
                     //如果不存在原厂标签的话
                     if (temp != "")
@@ -2545,6 +2608,21 @@ namespace UAS_LabelMachine
                         pr_code = temp.Split('*')[0];
                     }
                     //如果允许混料的话
+                    bool OutBoxSplit = false;
+                    if (PassSixTenCount > OutboxCapacity.Value)
+                    {
+                        string close = MessageBox.Show(this.ParentForm, "此箱号采集后超数量,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (close == "Yes")
+                        {
+                            OutBoxSplit = true;
+                            PassSixTenCount = 1;
+                            //sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|0"));
+                        }
+                        else
+                        {
+
+                        }
+                    }
                     if (MixPrCode.Checked)
                     {
                         bool SendLast = false;
@@ -2568,7 +2646,6 @@ namespace UAS_LabelMachine
                         }
                         if (PassTenCount == MidboxCapacity.Value)
                         {
-                            Console.WriteLine("ReadId3|,|OK|,|1");
                             sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|1"));
                             PassTenCount = 0;
                         }
@@ -2577,10 +2654,12 @@ namespace UAS_LabelMachine
                             if (SendLast)
                             {
                                 sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|1"));
+                                MessageBox.Show("采集完此行数据,是否继续?", "提示");
                             }
                             else
                             {
-                                sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|0"));
+                                if (!OutBoxSplit)
+                                    sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|0"));
                             }
                         }
                     }
@@ -2610,6 +2689,7 @@ namespace UAS_LabelMachine
                                     checknum = 0;
                                     SendLast = true;
                                     PassTenCount = 0;
+                                    MessageBox.Show("采集完此行数据,是否继续?", "提示");
                                 }
                                 break;
                             }
@@ -2617,22 +2697,24 @@ namespace UAS_LabelMachine
                         //达到了中盒容量之后
                         if (PassTenCount == MidboxCapacity.Value)
                         {
-                            Console.WriteLine("ReadId3|,|OK|,|1");
                             sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|1"));
                             PassTenCount = 0;
                         }
                         else
                         {
-                            //如果发送了最后一盒,则不发送继续堆叠的指令
-                            if (!SendLast)
+                            //如果发送了最后一盒,则不发送继续堆叠的指令 或者需要分盒的时候
+                            if ((!SendLast && !OutBoxSplit) || OutBoxSplit)
                             {
-                                Console.WriteLine("ReadId3|,|OK|,|0");
                                 sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|0"));
                             }
                         }
                     }
+                    //中盒当前进度
                     CurrentBoxNum.Value = PassTenCount;
                     PassTenCount = PassTenCount + 1;
+                    //外箱当前进度
+                    CurrentOutBoxNum.Value = PassSixTenCount;
+                    PassSixTenCount = PassSixTenCount + 1;
                 }
                 //设置索引和内容
                 //msgStr = msgStr.Split(ps_split.ToCharArray()[0])[dataindex];
@@ -2697,5 +2779,228 @@ namespace UAS_LabelMachine
                 PassTenCount = int.Parse(CurrentBoxNum.Value.ToString()) + 1;
             }
         }
+
+        private void CurrentOutBoxNum_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                PassSixTenCount = int.Parse(CurrentOutBoxNum.Value.ToString()) + 1;
+            }
+        }
+
+        private void richTextAutoBottom1_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void Weight_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void groupBoxWithBorder2_Enter(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DCCheck_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void GridPrcode_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+
+        }
+
+        private void label18_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidBoxEnd_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidBoxBegin_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label16_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SingleBoxEnd_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SingleBoxBegin_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label12_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label7_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void groupBoxWithBorder1_Enter(object sender, EventArgs e)
+        {
+
+        }
+
+        private void Input_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void LabelInf_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+
+        }
+
+        private void pi_inoutno_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label14_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void CurrentOutBoxNum_ValueChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label13_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SingleLabelPrinter_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SingleLabelAutoPrint_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void SingleLabel_Enter(object sender, EventArgs e)
+        {
+
+        }
+
+        private void CurrentRowOnly_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidboxCapacity_ValueChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label2_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidLabelNum_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label5_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidLabelPrinter_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidLabelAutoPrint_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void MidLabel_Enter(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DiffDetno_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DiffCPN_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void BoxCount_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DiffLotNo_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DiffDC_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void OnlyOneRow_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void AllLabel_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label10_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void label6_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void OutBoxPrinter_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void OutboxCapacity_ValueChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void OutBoxLabel_Enter(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 36 - 30
UAS-出货标签管理(泽天)/贴标角度设置.cs

@@ -23,7 +23,7 @@ namespace UAS_LabelMachine
             custcode = CustCode;
             InitializeComponent();
         }
-
+        bool IninLoad = true;
         private void 附件内容打印_Load(object sender, EventArgs e)
         {
             DataTable dt = (DataTable)dh.ExecuteSql("select *  from PRINTXY where px_custcode='" + custcode + "' ", "select");
@@ -32,6 +32,8 @@ namespace UAS_LabelMachine
                 X.Text = dt.Rows[0]["px_x"].ToString();
                 Y.Text = dt.Rows[0]["px_y"].ToString();
                 angle.Text = dt.Rows[0]["px_angle"].ToString();
+
+
                 switch (dt.Rows[0]["px_type"].ToString().ToUpper())
                 {
                     case "TOP":
@@ -53,6 +55,7 @@ namespace UAS_LabelMachine
                         break;
                 }
             }
+            IninLoad = false;
         }
 
         private void Confirm_Click(object sender, EventArgs e)
@@ -98,36 +101,39 @@ namespace UAS_LabelMachine
 
         private void Button_CheckedChanged(object sender, EventArgs e)
         {
-            RadioButton rad = (RadioButton)sender;
-            switch (rad.Name.ToUpper())
+            if (!IninLoad)
             {
-                case "TOP":
-                    angle.Text = "0";
-                    X.Text = "0";
-                    Y.Text = "0";
-                    break;
-                case "COVER":
-                    angle.Text = "0";
-                    X.Text = "0";
-                    Y.Text = "0";
-                    break;
-                case "LEFT":
-                    angle.Text = "270";
-                    X.Text = "0";
-                    Y.Text = "-88";
-                    break;
-                case "RIGHT":
-                    angle.Text = "90";
-                    X.Text = "0";
-                    Y.Text = "-88";
-                    break;
-                case "BOTTOM":
-                    angle.Text = "0";
-                    X.Text = "4";
-                    Y.Text = "-88";
-                    break;
-                default:
-                    break;
+                RadioButton rad = (RadioButton)sender;
+                switch (rad.Name.ToUpper())
+                {
+                    case "TOP":
+                        angle.Text = "0";
+                        X.Text = "0";
+                        Y.Text = "0";
+                        break;
+                    case "COVER":
+                        angle.Text = "0";
+                        X.Text = "0";
+                        Y.Text = "0";
+                        break;
+                    case "LEFT":
+                        angle.Text = "270";
+                        X.Text = "0";
+                        Y.Text = "-88";
+                        break;
+                    case "RIGHT":
+                        angle.Text = "90";
+                        X.Text = "0";
+                        Y.Text = "-88";
+                        break;
+                    case "BOTTOM":
+                        angle.Text = "0";
+                        X.Text = "4";
+                        Y.Text = "-88";
+                        break;
+                    default:
+                        break;
+                }
             }
         }
     }