Browse Source

添加利普芯备注导出箱号

callm 5 years ago
parent
commit
8049540edd

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

@@ -67,6 +67,7 @@
             this.English = new System.Windows.Forms.RadioButton();
             this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.CH_YIELD = new System.Windows.Forms.CheckBox();
+            this.FirstPage_BOXCODE = new System.Windows.Forms.CheckBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.SuspendLayout();
@@ -530,11 +531,24 @@
             this.CH_YIELD.Text = "良率";
             this.CH_YIELD.UseVisualStyleBackColor = true;
             // 
+            // FirstPage_BOXCODE
+            // 
+            this.FirstPage_BOXCODE.AutoSize = true;
+            this.FirstPage_BOXCODE.Font = new System.Drawing.Font("宋体", 10F);
+            this.FirstPage_BOXCODE.Location = new System.Drawing.Point(734, 508);
+            this.FirstPage_BOXCODE.Margin = new System.Windows.Forms.Padding(4);
+            this.FirstPage_BOXCODE.Name = "FirstPage_BOXCODE";
+            this.FirstPage_BOXCODE.Size = new System.Drawing.Size(98, 31);
+            this.FirstPage_BOXCODE.TabIndex = 45;
+            this.FirstPage_BOXCODE.Text = "盒号";
+            this.FirstPage_BOXCODE.UseVisualStyleBackColor = true;
+            // 
             // ExportExcel
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1144, 704);
+            this.Controls.Add(this.FirstPage_BOXCODE);
             this.Controls.Add(this.CH_YIELD);
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox1);
@@ -623,5 +637,6 @@
         private System.Windows.Forms.RadioButton Chinese;
         private System.Windows.Forms.RadioButton English;
         private System.Windows.Forms.CheckBox CH_YIELD;
+        private System.Windows.Forms.CheckBox FirstPage_BOXCODE;
     }
 }

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

@@ -1311,6 +1311,13 @@ namespace UAS_LabelMachine
                             FirstDT.Columns.RemoveAt(i);
                         }
                     }
+                    if (box[j].Name == "FirstPage_BOXCODE" && !box[j].Checked)
+                    {
+                        if (FirstDT.Columns[i].ColumnName.ToLower().Contains("ch_pbcode"))
+                        {
+                            FirstDT.Columns.RemoveAt(i);
+                        }
+                    }
                 }
             }
             columnNum = FirstDT.Columns.Count;
@@ -1392,6 +1399,7 @@ namespace UAS_LabelMachine
                     row1.GetCell(j - 4).CellStyle = styleborder;
                     if (FirstDT.Columns[j].ColumnName == "num")
                     {
+                        row1.Cells[j - 4].SetCellValue(int.Parse(Data));
                         sumCount += int.Parse(Data);
                     }
                     if (FirstDT.Columns[j].ColumnName == "io_qty")
@@ -2454,6 +2462,13 @@ namespace UAS_LabelMachine
                             FirstDT.Columns.RemoveAt(i);
                         }
                     }
+                    if (box[j].Name == "FirstPage_BOXCODE" && !box[j].Checked)
+                    {
+                        if (FirstDT.Columns[i].ColumnName.ToLower().Contains("ch_pbcode"))
+                        {
+                            FirstDT.Columns.RemoveAt(i);
+                        }
+                    }
                 }
             }
             columnNum = FirstDT.Columns.Count;
@@ -2536,6 +2551,7 @@ namespace UAS_LabelMachine
                     row1.GetCell(j - 4).CellStyle = styleborder;
                     if (FirstDT.Columns[j].ColumnName == "num")
                     {
+                        row1.Cells[j - 4].SetCellValue(int.Parse(Data));
                         sumCount += int.Parse(Data);
                     }
                     if (FirstDT.Columns[j].ColumnName == "io_qty")
@@ -2603,6 +2619,8 @@ namespace UAS_LabelMachine
             string 片 = "";
             string companyname = "";
             int ShowBoxIndex = 0;
+            //用于小计的盒号
+            string LastBox = "";
             if (dh.getFieldDataByCondition("ProdInout", "pi_exporttype", "pi_inoutno='" + Inoutno + "'").ToString() == "Chinese")
             {
                 小计 = "小计";
@@ -2840,7 +2858,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 row1.Cells[j].CellStyle = styleborder;
@@ -2864,7 +2882,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 row1.Cells[j].CellStyle = styleborder;
@@ -3013,6 +3031,10 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
+                            if (DataTable.Columns[j].ColumnName.ToLower() == "ch_pbcode")
+                            {
+                                LastBox = Data;
+                            }
                         }
                         //固定行号分组的时候自动拼接新的DataTable
                         if (i == rowNum - 1)
@@ -3045,7 +3067,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == ShowCountIndex)
@@ -3071,7 +3093,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == ShowCountIndex)
@@ -3146,7 +3168,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3176,7 +3198,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3329,6 +3351,10 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
+                            if (DataTable.Columns[j].ColumnName.ToLower() == "ch_pbcode")
+                            {
+                                LastBox = Data;
+                            }
                         }
                         if (i == rowNum - 1)
                         {
@@ -3450,7 +3476,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3480,7 +3506,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3632,6 +3658,10 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
+                            if (DataTable.Columns[j].ColumnName.ToLower() == "ch_pbcode")
+                            {
+                                LastBox = Data;
+                            }
                         }
                         if (i == rowNum - 1)
                         {
@@ -3658,7 +3688,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3688,7 +3718,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(DataTable.Rows[i - 1]["ch_pbcode"].ToString());
+                                    row1.Cells[j].SetCellValue(LastBox);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else
@@ -3773,6 +3803,13 @@ namespace UAS_LabelMachine
                             FirstDT.Columns.RemoveAt(i);
                         }
                     }
+                    if (box[j].Name == "FirstPage_BOXCODE" && !box[j].Checked)
+                    {
+                        if (FirstDT.Columns[i].ColumnName.ToLower().Contains("ch_pbcode"))
+                        {
+                            FirstDT.Columns.RemoveAt(i);
+                        }
+                    }
                 }
             }
             columnNum = FirstDT.Columns.Count;
@@ -3854,6 +3891,7 @@ namespace UAS_LabelMachine
                     row1.GetCell(j - 4).CellStyle = styleborder;
                     if (FirstDT.Columns[j].ColumnName == "num")
                     {
+                        row1.Cells[j - 4].SetCellValue(int.Parse(Data));
                         sumCount += int.Parse(Data);
                     }
                     if (FirstDT.Columns[j].ColumnName == "io_qty")