Browse Source

边框BUG调整,利普芯特殊样式调整

callm 5 years ago
parent
commit
e8bd9a414b

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

@@ -538,14 +538,13 @@
             // 
             this.BoxSplit.AutoSize = true;
             this.BoxSplit.Font = new System.Drawing.Font("宋体", 10F);
-            this.BoxSplit.Location = new System.Drawing.Point(909, 615);
+            this.BoxSplit.Location = new System.Drawing.Point(964, 432);
             this.BoxSplit.Margin = new System.Windows.Forms.Padding(4);
             this.BoxSplit.Name = "BoxSplit";
             this.BoxSplit.Size = new System.Drawing.Size(151, 31);
             this.BoxSplit.TabIndex = 46;
             this.BoxSplit.Text = "盒号拆批";
             this.BoxSplit.UseVisualStyleBackColor = true;
-            this.BoxSplit.Visible = false;
             // 
             // RowNum
             // 

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

@@ -58,6 +58,11 @@ namespace UAS_LabelMachine
                     MessageBox.Show("勾选扩撒批分页,打印内容请勾选扩撒批号");
                     return;
                 }
+                if ((!CH_SPLITBATCH.Checked||!CH_PBCODE.Checked )&& BoxSplit.Checked)
+                {
+                    MessageBox.Show("勾选盒号拆批,打印内容请勾选扩撒批号和盒号");
+                    return;
+                }
                 conditionbox.Add(CH_BLUEFILM);
                 conditionbox.Add(CH_PBCODE);
                 conditionbox.Add(CH_REMARK);

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

@@ -1925,7 +1925,6 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
-                            row1.Cells[j - 4].CellStyle = styleborder;
                         }
                         //固定行号分组的时候自动拼接新的DataTable
                         if (i == rowNum - 1)
@@ -2190,7 +2189,6 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
-                            row1.Cells[j - 4].CellStyle = styleborder;
                         }
                         if (i == rowNum - 1)
                         {
@@ -2447,7 +2445,6 @@ namespace UAS_LabelMachine
                                 sheet.AutoSizeColumn(j - 4);
                                 sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
                             }
-                            row1.Cells[j - 4].CellStyle = styleborder;
                         }
                         if (i == rowNum - 1)
                         {
@@ -2957,31 +2954,6 @@ namespace UAS_LabelMachine
                             First_WID.Clear();
                             BoxCode = BoxCode + 1;
                             for (int j = 0; j < ShowColumnCount; j++)
-                            {
-                                row1.CreateCell(j);
-                                if (j == 0)
-                                {
-                                    row1.Cells[j].SetCellValue(批小计);
-                                }
-                                else if (j == ShowPieceIndex)
-                                {
-                                    row1.Cells[ShowPieceIndex].SetCellValue((i % PageSize == 0 ? PageSize : i) + 片);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowCountIndex)
-                                {
-                                    row1.Cells[j].SetCellValue(sumCount);
-                                }
-                                else if (j == ShowBoxIndex - 4)
-                                {
-                                    row1.Cells[j].SetCellValue(LastBox);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                row1.Cells[j].CellStyle = styleborder;
-                            }
-                            row1 = sheet.CreateRow(PaintIndex);
-                            PaintIndex = PaintIndex + 1;
-                            for (int j = 0; j < ShowColumnCount; j++)
                             {
                                 row1.CreateCell(j);
                                 if (j == 0)
@@ -3278,37 +3250,6 @@ namespace UAS_LabelMachine
                         {
                             BoxCode = BoxCode + 1;
                             for (int j = 0; j < ShowColumnCount; j++)
-                            {
-
-                                row1.CreateCell(j);
-                                if (j == 0)
-                                {
-                                    row1.Cells[j].SetCellValue(批小计);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowPieceIndex)
-                                {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum - 1 + 片);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowCountIndex)
-                                {
-                                    row1.Cells[j].SetCellValue(sumCount);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowBoxIndex - 4)
-                                {
-                                    row1.Cells[j].SetCellValue(LastBox);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else
-                                {
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                            }
-                            row1 = sheet.CreateRow(PaintIndex);
-                            PaintIndex = PaintIndex + 1;
-                            for (int j = 0; j < ShowColumnCount; j++)
                             {
                                 row1.CreateCell(j);
                                 if (j == 0)
@@ -3596,36 +3537,6 @@ namespace UAS_LabelMachine
                         {
                             BoxCode = BoxCode + 1;
                             for (int j = 0; j < ShowColumnCount; j++)
-                            {
-                                row1.CreateCell(j);
-                                if (j == 0)
-                                {
-                                    row1.Cells[j].SetCellValue(批小计);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowPieceIndex)
-                                {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum1 + 片);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowCountIndex)
-                                {
-                                    row1.Cells[j].SetCellValue(sumCount);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else if (j == ShowBoxIndex - 4)
-                                {
-                                    row1.Cells[j].SetCellValue(LastBox);
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                                else
-                                {
-                                    row1.Cells[j].CellStyle = styleborder;
-                                }
-                            }
-                            row1 = sheet.CreateRow(PaintIndex);
-                            PaintIndex = PaintIndex + 1;
-                            for (int j = 0; j < ShowColumnCount; j++)
                             {
                                 row1.CreateCell(j);
                                 if (j == 0)
@@ -3922,50 +3833,52 @@ namespace UAS_LabelMachine
                         PaintIndex = PaintIndex + 1;
                         row1.HeightInPoints = RowHeight;
                         //如果批号不相等的时候
-                        if (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["CH_PBCODE"].ToString())
+                        if (LastBatch == "" || (LastBatch != "" && LastBatch != DataTable.Rows[i]["ch_splitbatch"].ToString()))
                         {
-                            BoxCode = BoxCode + 1;
+                            LastBatch = DataTable.Rows[i]["ch_splitbatch"].ToString();
                             for (int j = 0; j < ShowColumnCount; j++)
                             {
-                                row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue(批小计);
-                                    row1.Cells[j].CellStyle = styleborder;
+                                    row1.CreateCell(j).SetCellValue(SerialNum - 1);
                                 }
-                                else if (j == ShowPieceIndex)
+                                else if (j == 1)
                                 {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
-                                    row1.Cells[j].CellStyle = styleborder;
+                                    row1.CreateCell(j).SetCellValue("批小计");
                                 }
-                                else if (j == ShowCountIndex)
+                                else if (j == 2)
                                 {
-                                    row1.Cells[j].SetCellValue(sumCount);
-                                    row1.Cells[j].CellStyle = styleborder;
+                                    row1.CreateCell(j).SetCellValue(MidCount);
                                 }
                                 else if (j == ShowBoxIndex - 4)
                                 {
-                                    row1.Cells[j].SetCellValue(LastBox);
-                                    row1.Cells[j].CellStyle = styleborder;
+                                    row1.CreateCell(j).SetCellValue(LastBox);
                                 }
                                 else
                                 {
-                                    row1.Cells[j].CellStyle = styleborder;
+                                    row1.CreateCell(j);
                                 }
+                                row1.Cells[j].CellStyle = styleborder;
                             }
+                            SerialNum = 1;
+                            MidCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             PaintIndex = PaintIndex + 1;
+                        }
+                        if (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["CH_PBCODE"].ToString())
+                        {
+                            BoxCode = BoxCode + 1;
                             for (int j = 0; j < ShowColumnCount; j++)
                             {
                                 row1.CreateCell(j);
-                                if (j == 0)
+                                if (j == 1)
                                 {
                                     row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
-                                else if (j == ShowPieceIndex)
+                                else if (j == 0)
                                 {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
+                                    row1.Cells[0].SetCellValue(PageNum2);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == ShowCountIndex)
@@ -3990,38 +3903,6 @@ namespace UAS_LabelMachine
                             PaintIndex = PaintIndex + 1;
                             PageNum2 = 0;
                         }
-                        if (LastBatch == "" || (LastBatch != "" && LastBatch != DataTable.Rows[i]["ch_splitbatch"].ToString()))
-                        {
-                            LastBatch = DataTable.Rows[i]["ch_splitbatch"].ToString();
-                            for (int j = 0; j < ShowColumnCount; j++)
-                            {
-                                if (j == 0)
-                                {
-                                    row1.CreateCell(j).SetCellValue(SerialNum - 1);
-                                }
-                                else if (j == 1)
-                                {
-                                    row1.CreateCell(j).SetCellValue("批小计");
-                                }
-                                else if (j == 2)
-                                {
-                                    row1.CreateCell(j).SetCellValue(MidCount);
-                                }
-                                else if (j == ShowBoxIndex - 4)
-                                {
-                                    row1.CreateCell(j).SetCellValue(LastBox);
-                                }
-                                else
-                                {
-                                    row1.CreateCell(j);
-                                }
-                                row1.Cells[j].CellStyle = styleborder;
-                            }
-                            SerialNum = 1;
-                            MidCount = 0;
-                            row1 = sheet.CreateRow(PaintIndex);
-                            PaintIndex = PaintIndex + 1;
-                        }
                         //每次到了页数开始分页
                         if (LastBoxCode1 == "" || (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["ch_pbcode"].ToString()) || ((i == rowNum - 1) && (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["ch_pbcode"].ToString())))
                         {
@@ -4164,7 +4045,6 @@ namespace UAS_LabelMachine
                             {
                                 LastBox = Data;
                             }
-                            row1.Cells[j - 4].CellStyle = styleborder;
                         }
                         if (i == rowNum - 1)
                         {