Browse Source

修改扩散批次和盒号的分组导出

章政 5 years ago
parent
commit
f7ca842b4e

+ 16 - 16
UAS-出货标签管理(贸易版)/ExportExcel.Designer.cs

@@ -58,7 +58,7 @@
             // Export
             // 
             this.Export.Location = new System.Drawing.Point(240, 288);
-            this.Export.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Export.Margin = new System.Windows.Forms.Padding(2);
             this.Export.Name = "Export";
             this.Export.Size = new System.Drawing.Size(94, 24);
             this.Export.TabIndex = 0;
@@ -73,7 +73,7 @@
             this.CH_BLUEFILM.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_BLUEFILM.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_BLUEFILM.Location = new System.Drawing.Point(130, 58);
-            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(2);
             this.CH_BLUEFILM.Name = "CH_BLUEFILM";
             this.CH_BLUEFILM.Size = new System.Drawing.Size(68, 18);
             this.CH_BLUEFILM.TabIndex = 1;
@@ -87,7 +87,7 @@
             this.CH_SPLITBATCH.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_SPLITBATCH.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_SPLITBATCH.Location = new System.Drawing.Point(350, 58);
-            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(2);
             this.CH_SPLITBATCH.Name = "CH_SPLITBATCH";
             this.CH_SPLITBATCH.Size = new System.Drawing.Size(82, 18);
             this.CH_SPLITBATCH.TabIndex = 3;
@@ -101,7 +101,7 @@
             this.CH_PBCODE.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_PBCODE.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_PBCODE.Location = new System.Drawing.Point(130, 94);
-            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(2);
             this.CH_PBCODE.Name = "CH_PBCODE";
             this.CH_PBCODE.Size = new System.Drawing.Size(54, 18);
             this.CH_PBCODE.TabIndex = 8;
@@ -115,7 +115,7 @@
             this.CH_REMARK.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_REMARK.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_REMARK.Location = new System.Drawing.Point(244, 94);
-            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(2);
             this.CH_REMARK.Name = "CH_REMARK";
             this.CH_REMARK.Size = new System.Drawing.Size(82, 18);
             this.CH_REMARK.TabIndex = 9;
@@ -129,7 +129,7 @@
             this.ch_code.CheckState = System.Windows.Forms.CheckState.Checked;
             this.ch_code.Font = new System.Drawing.Font("宋体", 10F);
             this.ch_code.Location = new System.Drawing.Point(244, 58);
-            this.ch_code.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ch_code.Margin = new System.Windows.Forms.Padding(2);
             this.ch_code.Name = "ch_code";
             this.ch_code.Size = new System.Drawing.Size(68, 18);
             this.ch_code.TabIndex = 10;
@@ -143,7 +143,7 @@
             this.CH_WATERID.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_WATERID.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_WATERID.Location = new System.Drawing.Point(452, 58);
-            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(2);
             this.CH_WATERID.Name = "CH_WATERID";
             this.CH_WATERID.Size = new System.Drawing.Size(82, 18);
             this.CH_WATERID.TabIndex = 11;
@@ -201,7 +201,7 @@
             this.BVCEO.CheckState = System.Windows.Forms.CheckState.Checked;
             this.BVCEO.Font = new System.Drawing.Font("宋体", 10F);
             this.BVCEO.Location = new System.Drawing.Point(244, 174);
-            this.BVCEO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.BVCEO.Margin = new System.Windows.Forms.Padding(2);
             this.BVCEO.Name = "BVCEO";
             this.BVCEO.Size = new System.Drawing.Size(61, 18);
             this.BVCEO.TabIndex = 17;
@@ -215,7 +215,7 @@
             this.TS.CheckState = System.Windows.Forms.CheckState.Checked;
             this.TS.Font = new System.Drawing.Font("宋体", 10F);
             this.TS.Location = new System.Drawing.Point(130, 174);
-            this.TS.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.TS.Margin = new System.Windows.Forms.Padding(2);
             this.TS.Name = "TS";
             this.TS.Size = new System.Drawing.Size(40, 18);
             this.TS.TabIndex = 18;
@@ -229,7 +229,7 @@
             this.percent.CheckState = System.Windows.Forms.CheckState.Checked;
             this.percent.Font = new System.Drawing.Font("宋体", 10F);
             this.percent.Location = new System.Drawing.Point(130, 128);
-            this.percent.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.percent.Margin = new System.Windows.Forms.Padding(2);
             this.percent.Name = "percent";
             this.percent.Size = new System.Drawing.Size(47, 18);
             this.percent.TabIndex = 19;
@@ -263,7 +263,7 @@
             this.BatchCode.AutoSize = true;
             this.BatchCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BatchCode.Location = new System.Drawing.Point(130, 216);
-            this.BatchCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.BatchCode.Margin = new System.Windows.Forms.Padding(2);
             this.BatchCode.Name = "BatchCode";
             this.BatchCode.Size = new System.Drawing.Size(67, 18);
             this.BatchCode.TabIndex = 22;
@@ -275,7 +275,7 @@
             this.BoxCode.AutoSize = true;
             this.BoxCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BoxCode.Location = new System.Drawing.Point(222, 216);
-            this.BoxCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.BoxCode.Margin = new System.Windows.Forms.Padding(2);
             this.BoxCode.Name = "BoxCode";
             this.BoxCode.Size = new System.Drawing.Size(53, 18);
             this.BoxCode.TabIndex = 23;
@@ -288,7 +288,7 @@
             this.FixRow.Checked = true;
             this.FixRow.Font = new System.Drawing.Font("宋体", 10F);
             this.FixRow.Location = new System.Drawing.Point(306, 216);
-            this.FixRow.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.FixRow.Margin = new System.Windows.Forms.Padding(2);
             this.FixRow.Name = "FixRow";
             this.FixRow.Size = new System.Drawing.Size(81, 18);
             this.FixRow.TabIndex = 24;
@@ -314,7 +314,7 @@
             this.FirstPage_WID.CheckState = System.Windows.Forms.CheckState.Checked;
             this.FirstPage_WID.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_WID.Location = new System.Drawing.Point(130, 254);
-            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(2);
             this.FirstPage_WID.Name = "FirstPage_WID";
             this.FirstPage_WID.Size = new System.Drawing.Size(110, 18);
             this.FirstPage_WID.TabIndex = 29;
@@ -353,7 +353,7 @@
             this.RowNum.Negative = false;
             this.RowNum.Size = new System.Drawing.Size(52, 21);
             this.RowNum.TabIndex = 30;
-            this.RowNum.Text = "2";
+            this.RowNum.Text = "10";
             // 
             // ExportExcel
             // 
@@ -384,7 +384,7 @@
             this.Controls.Add(this.CH_SPLITBATCH);
             this.Controls.Add(this.CH_BLUEFILM);
             this.Controls.Add(this.Export);
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "ExportExcel";
             this.Text = "导出数据";
             this.Load += new System.EventHandler(this.ExportExcel_Load);

+ 15 - 11
UAS-出货标签管理(贸易版)/PublicMethod/ExcelHandler.cs

@@ -512,7 +512,7 @@ namespace UAS_LabelMachine
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
                                     }
-                                    else if (columnNum<=5&&j == columnNum - 4)
+                                    else if (columnNum <= 5 && j == columnNum - 4)
                                     {
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
@@ -715,12 +715,12 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["型号"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_spec"].ToString());
                                     }
                                     else if (j == columnNum - 4)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["销售日期"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -761,12 +761,12 @@ namespace UAS_LabelMachine
                             row1.CreateCell(j - 4);
                             row1.Cells[j - 4].SetCellValue(Data);
                             row1.GetCell(j - 4).CellStyle = styleborder;
-                            if (DataTable.Columns[j].ColumnName == "数量")
+                            if (DataTable.Columns[j].ColumnName == "io_qty")
                             {
                                 sumCount += int.Parse(DataTable.Rows[i][j].ToString());
                                 totalCount += int.Parse(DataTable.Rows[i][j].ToString());
                             }
-                            if (DataTable.Columns[j].ColumnName == "序号")
+                            if (DataTable.Columns[j].ColumnName == "rownum")
                             {
                                 row1.Cells[j - 4].SetCellValue(i + 1);
                             }
@@ -848,9 +848,8 @@ namespace UAS_LabelMachine
                         PaintIndex = PaintIndex + 1;
                         row1.HeightInPoints = 20;
                         //如果批号不相等的时候
-                        if (LastBoxCode != "" && LastBoxCode != DataTable.Rows[i]["盒号"].ToString())
+                        if (LastBoxCode != "" && LastBoxCode != DataTable.Rows[i]["CH_PBCODE"].ToString())
                         {
-
                             for (int j = 0; j < columnNum - 4; j++)
                             {
                                 if (j == 0)
@@ -874,9 +873,9 @@ namespace UAS_LabelMachine
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
-                        if (LastBoxCode == "" || (LastBoxCode != "" && LastBoxCode != DataTable.Rows[i]["盒号"].ToString()) || i == rowNum - 1)
+                        if (LastBoxCode == "" || (LastBoxCode != "" && LastBoxCode != DataTable.Rows[i]["ch_pbcode"].ToString()) || i == rowNum - 1)
                         {
-                            LastBoxCode = DataTable.Rows[i]["盒号"].ToString();
+                            LastBoxCode = DataTable.Rows[i]["CH_PBCODE"].ToString();
                             //第一行添加客户信息
                             if (i != rowNum - 1)
                             {
@@ -1010,12 +1009,17 @@ namespace UAS_LabelMachine
                                     row1.CreateCell(j);
                                     row1.Cells[j].SetCellValue(totalCount);
                                 }
-                                else if (j == columnNum - 7)
+                                else if (j == columnNum - 6)
                                 {
                                     row1.CreateCell(j);
                                     row1.Cells[j].SetCellValue(rowNum);
                                 }
-                                else if (j == columnNum - 4)
+                                else if (j > 5 && j == columnNum - 5)
+                                {
+                                    row1.CreateCell(j);
+                                    row1.Cells[j].SetCellValue("片");
+                                }
+                                else if (columnNum > 5 && j == columnNum - 5)
                                 {
                                     row1.CreateCell(j);
                                     row1.Cells[j].SetCellValue("片");