Parcourir la source

修改第一行打印不出来的BUG

章政 il y a 6 ans
Parent
commit
471d52a2fd

+ 18 - 19
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -91,7 +91,9 @@
             this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.MidSource = new System.Windows.Forms.BindingSource(this.components);
             this.ChooseAll = new System.Windows.Forms.Button();
+            this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.ExportData = new System.Windows.Forms.Button();
             this.label18 = new System.Windows.Forms.Label();
             this.MidBoxEnd = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.MidBoxBegin = new UAS_LabelMachine.CustomControl.EnterTextBox();
@@ -173,8 +175,6 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.ExportData = new System.Windows.Forms.Button();
-            this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -762,6 +762,19 @@
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = " 打印参数设置";
             // 
+            // ExportData
+            // 
+            this.ExportData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.ExportData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ExportData.Location = new System.Drawing.Point(74, 202);
+            this.ExportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ExportData.Name = "ExportData";
+            this.ExportData.Size = new System.Drawing.Size(68, 26);
+            this.ExportData.TabIndex = 91;
+            this.ExportData.Text = "导出数据";
+            this.ExportData.UseVisualStyleBackColor = true;
+            this.ExportData.Click += new System.EventHandler(this.ExportData_Click);
+            // 
             // label18
             // 
             this.label18.AutoSize = true;
@@ -1131,7 +1144,6 @@
             this.pib_id1.DataPropertyName = "pib_id";
             this.pib_id1.HeaderText = "pib_id";
             this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
             this.pib_id1.Width = 66;
             // 
             // pib_pdno
@@ -1301,7 +1313,7 @@
             // 
             this.ViVoPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.ViVoPlate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ViVoPlate.Location = new System.Drawing.Point(37, 162);
+            this.ViVoPlate.Location = new System.Drawing.Point(80, 166);
             this.ViVoPlate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ViVoPlate.Name = "ViVoPlate";
             this.ViVoPlate.Size = new System.Drawing.Size(68, 26);
@@ -1674,19 +1686,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // ExportData
-            // 
-            this.ExportData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.ExportData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ExportData.Location = new System.Drawing.Point(74, 202);
-            this.ExportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.ExportData.Name = "ExportData";
-            this.ExportData.Size = new System.Drawing.Size(68, 26);
-            this.ExportData.TabIndex = 91;
-            this.ExportData.Text = "导出数据";
-            this.ExportData.UseVisualStyleBackColor = true;
-            this.ExportData.Click += new System.EventHandler(this.ExportData_Click);
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1884,6 +1883,8 @@
         private System.Windows.Forms.Label label18;
         private CustomControl.EnterTextBox MidBoxEnd;
         private CustomControl.EnterTextBox MidBoxBegin;
+        private System.Windows.Forms.Button ExportData;
+        private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
@@ -1905,7 +1906,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.Button ExportData;
-        private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
     }
 }

+ 2 - 5
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1100,8 +1100,7 @@ namespace UAS_LabelMachine
                     CurrentItemIndex = 0;
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
                 }
-                else
-                    MessageBox.Show("当前出入库单号不存在!");
+                else MessageBox.Show("当前出入库单号不存在!");
             }
         }
 
@@ -1190,7 +1189,6 @@ namespace UAS_LabelMachine
                 //用于判断用户是否勾选了行
                 int CheckedRowCount = 0;
                 string[] arg = SingleBoxArgument.ToArray();
-
                 //一盒打印的份数
                 List<string> PrintNums = new List<string>();
                 //打印所有的选中行
@@ -1213,7 +1211,7 @@ namespace UAS_LabelMachine
                             }
                         }
                         //如果包含
-                        if (!PrintNums.Contains(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()) || i == LastCheckRowIndex)
+                        if ((i + 1 < LabelInf.Rows.Count && LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString()) || i == LastCheckRowIndex)
                         {
                             string pib_id = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
                             DataRow[] dr = SingleBoxCacheData.Select("pib_id=" + pib_id);
@@ -2517,7 +2515,6 @@ namespace UAS_LabelMachine
             if (result == DialogResult.OK)
             {
                 ExcelHandler eh = new ExcelHandler();
-
                 DataTable dt = ((DataTable)MidSource.DataSource).Copy();
                 for (int i = 0; i < dt.Columns.Count; i++)
                 {

+ 3 - 3
UAS-出货标签管理/UAS_出货标签管理.resx

@@ -144,6 +144,9 @@
   <metadata name="MidSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>179, 17</value>
   </metadata>
+  <metadata name="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>294, 17</value>
+  </metadata>
   <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -162,9 +165,6 @@
   <metadata name="pd_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>294, 17</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>