Jelajahi Sumber

泽天外箱可选择打印所有类型标签

章政 6 tahun lalu
induk
melakukan
f3af8d526c

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

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
@@ -37,7 +38,7 @@
             this.pib_id = new System.Windows.Forms.Label();
             this.pi_cardcode = new System.Windows.Forms.Label();
             this.Fresh = new System.Windows.Forms.LinkLabel();
-            this.RefreshDBConnect = new System.Windows.Forms.Timer();
+            this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -64,7 +65,7 @@
             this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.MidSource = new System.Windows.Forms.BindingSource();
+            this.MidSource = new System.Windows.Forms.BindingSource(this.components);
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             this.AttachInfo = new System.Windows.Forms.Button();
@@ -155,6 +156,7 @@
             this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.MidLabelCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.AllLabel = new System.Windows.Forms.CheckBox();
             this.AddNewOutBox = new System.Windows.Forms.Button();
             this.LogingOut = new System.Windows.Forms.LinkLabel();
             this.OutBoxNum = new System.Windows.Forms.ComboBox();
@@ -1439,6 +1441,7 @@
             // 
             // OutBoxLabel
             // 
+            this.OutBoxLabel.Controls.Add(this.AllLabel);
             this.OutBoxLabel.Controls.Add(this.AddNewOutBox);
             this.OutBoxLabel.Controls.Add(this.LogingOut);
             this.OutBoxLabel.Controls.Add(this.OutBoxNum);
@@ -1458,6 +1461,18 @@
             this.OutBoxLabel.TabStop = false;
             this.OutBoxLabel.Text = "外箱标签";
             // 
+            // AllLabel
+            // 
+            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(8, 93);
+            this.AllLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.AllLabel.Name = "AllLabel";
+            this.AllLabel.Size = new System.Drawing.Size(99, 21);
+            this.AllLabel.TabIndex = 93;
+            this.AllLabel.Text = "打印所有标签";
+            this.AllLabel.UseVisualStyleBackColor = true;
+            // 
             // AddNewOutBox
             // 
             this.AddNewOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -1487,7 +1502,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(52, 144);
+            this.OutBoxNum.Location = new System.Drawing.Point(52, 149);
             this.OutBoxNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(72, 25);
@@ -1500,7 +1515,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(7, 147);
+            this.label10.Location = new System.Drawing.Point(7, 155);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1510,7 +1525,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(7, 113);
+            this.label6.Location = new System.Drawing.Point(7, 121);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1528,7 +1543,7 @@
             // 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(52, 108);
+            this.OutboxCapacity.Location = new System.Drawing.Point(52, 120);
             this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutboxCapacity.Name = "OutboxCapacity";
             this.OutboxCapacity.Size = new System.Drawing.Size(72, 23);
@@ -1800,5 +1815,6 @@
         private System.Windows.Forms.Button Reset;
         private System.Windows.Forms.Button AddNewOutBox;
         private System.Windows.Forms.Button GetPDdata;
+        private System.Windows.Forms.CheckBox AllLabel;
     }
 }

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

@@ -938,7 +938,10 @@ namespace UAS_LabelMachine
                         {
                             if (LabelInf.Rows[h].Cells["pib_outboxcode2"].Value.ToString() == Outboxcode.ToArray()[i])
                             {
-                                OutBoxCodePrint(h);
+                                if (!AllLabel.Checked)
+                                    OutBoxCodePrint(h);
+                                else
+                                    OutBoxCodePrint(h, true);
                                 break;
                             }
                         }
@@ -968,7 +971,12 @@ namespace UAS_LabelMachine
                     }
                     //找到了指定的盒号
                     if (FindMidLabel)
-                        OutBoxCodePrint(OutBoxLabelRowIndex);
+                    {
+                        if (!AllLabel.Checked)
+                            OutBoxCodePrint(OutBoxLabelRowIndex);
+                        else
+                            OutBoxCodePrint(OutBoxLabelRowIndex, true);
+                    }
                     else
                         MessageBox.Show("该出入库单未找到该外箱号!", "提示");
                 }
@@ -1060,6 +1068,43 @@ namespace UAS_LabelMachine
             }
         }
 
+        /// <summary>
+        /// 执行打印外箱号
+        /// </summary>
+        private void OutBoxCodePrint(int rowindex, bool AllLabel)
+        {
+            if (EnablePrint)
+            {
+                for (int i = 0; i < OutBoxCombox.Items.Count; i++)
+                {
+                    OutBoxCombox.SelectedIndex = i;
+                    if (!OutBoxCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                        OutReport.Load(OutBoxCombox.SelectedValue.ToString());
+                    for (int j = 0; j < OutReport.Parameters.Count; j++)
+                    {
+                        OutReport.SetParameterValue(OutReport.Parameters[j].Name, "");
+                        for (int k = 0; k < Attach.Rows.Count; k++)
+                        {
+                            if (Attach.Rows[k][0].ToString() == OutReport.Parameters[j].Name)
+                            {
+                                OutReport.SetParameterValue(OutReport.Parameters[j].Name, Attach.Rows[k][1].ToString());
+                            }
+                        }
+                    }
+                    string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
+                    DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiooutinfo_view where 出货单号='" + pi_inoutno.Text + "' and 外箱号='" + pib_outboxcode2 + "'", "select");
+                    OutReport.RegisterData(dt, "prodiooutinfo_view");
+                    OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
+                    OutReport.PrintSettings.ShowDialog = false;
+                    OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
+                    OutReport.Print();
+                }
+                Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
+                Properties.Settings.Default.Save();
+                dh.UpdateByCondition("prodiobarcode", "pib_outifprint=-1", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "'");
+            }
+        }
+
         private void CleanDetail_Click(object sender, EventArgs e)
         {
             if (dh.getFieldDataByCondition("prodinout", "pi_statuscode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString() == "POSTED")
@@ -1874,7 +1919,7 @@ namespace UAS_LabelMachine
             dh.ExecuteSql("delete from CS$InoutPrcode where pd_inoutno='" + pi_inoutno.Text + "'", "delete");
             LoadPrcodeData();
             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 + "'");
-            MessageBox.Show("同步出货单明细数据成功","提示");
+            MessageBox.Show("同步出货单明细数据成功", "提示");
         }
     }
 }