Browse Source

修改导出内容,添加中英文版本对比

callm 5 years ago
parent
commit
51ea5be28d

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

@@ -62,8 +62,12 @@
             this.Rate = new System.Windows.Forms.RadioButton();
             this.Mount = new System.Windows.Forms.RadioButton();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.Chinese = new System.Windows.Forms.RadioButton();
+            this.English = new System.Windows.Forms.RadioButton();
             this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
             this.SuspendLayout();
             // 
             // Export
@@ -467,6 +471,42 @@
             this.groupBox1.TabStop = false;
             this.groupBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox1_Paint);
             // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.Chinese);
+            this.groupBox2.Controls.Add(this.English);
+            this.groupBox2.Location = new System.Drawing.Point(238, 23);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(495, 67);
+            this.groupBox2.TabIndex = 43;
+            this.groupBox2.TabStop = false;
+            // 
+            // Chinese
+            // 
+            this.Chinese.AutoSize = true;
+            this.Chinese.Checked = true;
+            this.Chinese.Font = new System.Drawing.Font("宋体", 10F);
+            this.Chinese.Location = new System.Drawing.Point(23, 26);
+            this.Chinese.Margin = new System.Windows.Forms.Padding(4);
+            this.Chinese.Name = "Chinese";
+            this.Chinese.Size = new System.Drawing.Size(97, 31);
+            this.Chinese.TabIndex = 40;
+            this.Chinese.TabStop = true;
+            this.Chinese.Text = "中文";
+            this.Chinese.UseVisualStyleBackColor = true;
+            // 
+            // English
+            // 
+            this.English.AutoSize = true;
+            this.English.Font = new System.Drawing.Font("宋体", 10F);
+            this.English.Location = new System.Drawing.Point(166, 28);
+            this.English.Margin = new System.Windows.Forms.Padding(4);
+            this.English.Name = "English";
+            this.English.Size = new System.Drawing.Size(97, 31);
+            this.English.TabIndex = 41;
+            this.English.Text = "英文";
+            this.English.UseVisualStyleBackColor = true;
+            // 
             // RowNum
             // 
             this.RowNum.Location = new System.Drawing.Point(960, 428);
@@ -482,6 +522,7 @@
             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.groupBox2);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.label8);
             this.Controls.Add(this.H_Param4);
@@ -520,6 +561,8 @@
             this.Load += new System.EventHandler(this.ExportExcel_Load);
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -562,5 +605,8 @@
         private System.Windows.Forms.RadioButton Rate;
         private System.Windows.Forms.RadioButton Mount;
         private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.RadioButton Chinese;
+        private System.Windows.Forms.RadioButton English;
     }
 }

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

@@ -83,18 +83,29 @@ namespace UAS_LabelMachine
                 {
                     SplitType = BoxCode.Name;
                 }
-                DataTable SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_datatype,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode='" + custcode + "' order by es_detno", "select");
+                string caption = "";
+                if (Chinese.Checked)
+                {
+                    caption = "es_caption";
+                    dh.ExecuteSql("update prodinout set pi_exporttype='Chinese' where pi_inoutno='"+inoutno+"'","update");
+                }
+                else
+                {
+                    caption = "es_engcaption es_caption";
+                    dh.ExecuteSql("update prodinout set pi_exporttype='English' where pi_inoutno='" + inoutno + "'", "update");
+                }
+                DataTable SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_datatype," + caption + ",es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode='" + custcode + "' order by es_detno", "select");
                 //没有置顶客户的取空的
                 if (SQL1_.Rows.Count == 0)
                 {
-                    SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_datatype,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode is null order by es_detno", "select");
+                    SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_datatype," + caption + ",es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode is null order by es_detno", "select");
                 }
                 string es_field1 = "";
                 for (int i = 0; i < SQL1_.Rows.Count; i++)
                 {
                     //不是参数的直接拼接
                     if (SQL1_.Rows[i]["es_datatype"].ToString() != "Param")
-                        es_field1 += SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString() + ",";
+                        es_field1 += SQL1_.Rows[i]["es_filed"].ToString() + ",";
                     //是参数的则先判断是否含有内容
                     else if (
                         (SQL1_.Rows[i]["es_filed"].ToString().Contains(M_Param1.Text) && M_Param1.Visible == true && M_Param1.Checked) ||
@@ -106,7 +117,7 @@ namespace UAS_LabelMachine
                         (SQL1_.Rows[i]["es_filed"].ToString().Contains(H_Param3.Text) && H_Param3.Visible == true && H_Param3.Checked) ||
                         (SQL1_.Rows[i]["es_filed"].ToString().Contains(H_Param4.Text) && H_Param4.Visible == true && H_Param4.Checked))
                     {
-                        es_field1 += SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString() + ",";
+                        es_field1 += SQL1_.Rows[i]["es_filed"].ToString() + ",";
                     }
                 }
                 //分页信息的DataTable
@@ -117,7 +128,7 @@ namespace UAS_LabelMachine
                 {
                     for (int j = 0; j < SQL1_.Rows.Count; j++)
                     {
-                        if (dt.Columns[i].ColumnName == (SQL1_.Rows[j]["es_prefix"].ToString() + "||" + SQL1_.Rows[j]["es_filed"].ToString() + "||" + SQL1_.Rows[j]["es_suffix"].ToString()).ToUpper())
+                        if (dt.Columns[i].ColumnName == SQL1_.Rows[j]["es_filed1"].ToString().ToUpper())
                         {
                             dt.Columns[i].ColumnName = SQL1_.Rows[j]["es_filed1"].ToString();
                             dt.Columns[i].Caption = SQL1_.Rows[j]["es_caption"].ToString();
@@ -125,15 +136,15 @@ namespace UAS_LabelMachine
                     }
                 }
                 //获取首页需要展示的字段
-                DataTable SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode='" + custcode + "' order by es_detno", "select");
+                DataTable SQL_ = (DataTable)dh.ExecuteSql("select es_filed," + caption + ",es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode='" + custcode + "' order by es_detno", "select");
                 if (SQL_.Rows.Count == 0)
                 {
-                    SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode is null order by es_detno", "select");
+                    SQL_ = (DataTable)dh.ExecuteSql("select es_filed," + caption + ",es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode is null order by es_detno", "select");
                 }
                 string es_field = "";
                 for (int i = 0; i < SQL_.Rows.Count; i++)
                 {
-                    es_field += SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString() + ",";
+                    es_field += SQL_.Rows[i]["es_filed"].ToString() + ",";
                 }
                 //首页信息的DataTable
                 sql.Clear();
@@ -141,7 +152,7 @@ namespace UAS_LabelMachine
                 DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 for (int i = 0; i < dt1.Columns.Count; i++)
                 {
-                    if (dt1.Columns[i].ColumnName == (SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString()).ToUpper())
+                    if (dt1.Columns[i].ColumnName == SQL_.Rows[i]["es_filed1"].ToString().ToUpper())
                     {
                         dt1.Columns[i].ColumnName = SQL_.Rows[i]["es_filed1"].ToString();
                         dt1.Columns[i].Caption = SQL_.Rows[i]["es_caption"].ToString();

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

@@ -290,6 +290,21 @@ namespace UAS_LabelMachine
         /// <returns></returns>
         public MemoryStream DataTableToExcel1(DataTable FirstDT, DataTable DataTable, string Type, string Inoutno, int PageSize, List<CheckBox> conditionbox)
         {
+            string 小计 = "";
+            string 总计 = "";
+            string 片 = "";
+            if (dh.getFieldDataByCondition("ProdInout", "pi_exporttype", "pi_inoutno='" + Inoutno + "'").ToString() == "Chinese")
+            {
+                小计 = "小计";
+                总计 = "总计";
+                片 = "片";
+            }
+            else
+            {
+                小计 = "total";
+                总计 = "total";
+                片 = "slice";
+            }
             //转换为序列
             CheckBox[] box = conditionbox.ToArray();
             //创建内存流
@@ -481,11 +496,11 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : i) + "");
+                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : i) + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -510,12 +525,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -531,12 +547,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                               + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                               + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -616,11 +634,11 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : (i % PageSize + 1)) + "");
+                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : (i % PageSize + 1)) + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -650,12 +668,12 @@ namespace UAS_LabelMachine
                             //    else if (j > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else if (columnNum > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else
                             //    {
@@ -697,12 +715,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum - 1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum - 1 + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -733,12 +751,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -754,12 +773,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                                                  + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                                                  + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -819,12 +840,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum + "");
+                                    row1.Cells[1].SetCellValue(PageNum + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -858,12 +879,12 @@ namespace UAS_LabelMachine
                             //    else if (j > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else if (columnNum > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else
                             //    {
@@ -907,12 +928,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum1 + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -942,12 +963,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -963,12 +985,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                                + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                                + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -1029,12 +1053,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum1 + 片);
                                 }
                                 else if (j == 2)
                                 {
@@ -1068,12 +1092,12 @@ namespace UAS_LabelMachine
                             //    else if (j > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else if (columnNum > 5 && j == columnNum - 5)
                             //    {
                             //        row1.CreateCell(j);
-                            //        row1.Cells[j].SetCellValue("");
+                            //        row1.Cells[j].SetCellValue(片);
                             //    }
                             //    else
                             //    {
@@ -1156,17 +1180,17 @@ namespace UAS_LabelMachine
                         if (j == 0)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(FirstDT.Rows[i]["pi_title"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_title"].Caption + ":" + FirstDT.Rows[i]["pi_title"].ToString());
                         }
                         else if (j > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_inoutno"].Caption + ":" + FirstDT.Rows[i]["pi_inoutno"].ToString());
                         }
                         else if (columnNum > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_inoutno"].Caption + ":" + FirstDT.Rows[i]["pi_inoutno"].ToString());
                         }
                         else
                         {
@@ -1182,17 +1206,17 @@ namespace UAS_LabelMachine
                         if (j == 0)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(FirstDT.Rows[i]["pr_orispeccode"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pr_orispeccode"].Caption + ":" + FirstDT.Rows[i]["pr_orispeccode"].ToString());
                         }
                         else if (j > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_date"].Caption + ":" + FirstDT.Rows[i]["pi_date"].ToString());
                         }
                         else if (columnNum > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_date"].Caption + ":" + FirstDT.Rows[i]["pi_date"].ToString());
                         }
                         else
                         {
@@ -1239,7 +1263,7 @@ namespace UAS_LabelMachine
                         {
                             row1.CreateCell(j);
                             row1.Cells[j].CellStyle = styleborder;
-                            row1.Cells[j].SetCellValue("总计");
+                            row1.Cells[j].SetCellValue(总计);
                         }
                         else if (j == columnNum - 6)
                         {
@@ -1282,6 +1306,21 @@ namespace UAS_LabelMachine
         /// <returns></returns>
         public MemoryStream DataTableToExcel2(DataTable FirstDT, DataTable DataTable, string Type, string Inoutno, int PageSize, List<CheckBox> conditionbox)
         {
+            string 小计 = "";
+            string 总计 = "";
+            string 片 = "";
+            if (dh.getFieldDataByCondition("ProdInout", "pi_exporttype", "pi_inoutno='" + Inoutno + "'").ToString() == "Chinese")
+            {
+                小计 = "小计";
+                总计 = "总计";
+                片 = "片";
+            }
+            else
+            {
+                小计 = "total";
+                总计 = "total";
+                片 = "slice";
+            }
             //转换为序列
             CheckBox[] box = conditionbox.ToArray();
             //创建内存流
@@ -1489,11 +1528,11 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : i) + "");
+                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : i) + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -1527,12 +1566,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -1548,12 +1588,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + "   " + DataTable.Rows[i]["pr_size"].ToString() + "   销售部门:市场部");
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                                  + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                                  + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -1637,11 +1679,11 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : (i % PageSize + 1)) + "");
+                                    row1.Cells[1].SetCellValue((i % PageSize == 0 ? PageSize : (i % PageSize + 1)) + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -1685,12 +1727,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum - 1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum - 1 + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -1728,12 +1770,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -1749,12 +1792,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + "   " + DataTable.Rows[i]["pr_size"].ToString() + "   销售部门:市场部");
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                                    + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                                    + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -1814,12 +1859,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum + "");
+                                    row1.Cells[1].SetCellValue(PageNum + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -1869,12 +1914,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum1 - 1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum1 - 1 + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -1912,12 +1957,13 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString() + "  " + DataTable.Rows[i]["ch_level"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + "  "
+                                           + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
                                     }
                                     else
                                     {
@@ -1933,12 +1979,14 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + "   " + DataTable.Rows[i]["pr_size"].ToString() + "   销售部门:市场部");
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "  "
+                                         + "(" + DataTable.Rows[i]["me_desc"].ToString() + ")  "
+                                         + DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 14 && j == columnNum - 14)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
                                     }
                                     else
                                     {
@@ -1999,12 +2047,12 @@ namespace UAS_LabelMachine
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
-                                    row1.Cells[j].SetCellValue("小计");
+                                    row1.Cells[j].SetCellValue(小计);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == 1)
                                 {
-                                    row1.Cells[1].SetCellValue(PageNum1 + "");
+                                    row1.Cells[1].SetCellValue(PageNum1 + 片);
                                     row1.Cells[1].CellStyle = ColumnTitleStyle;
                                 }
                                 else if (j == 2)
@@ -2094,17 +2142,17 @@ namespace UAS_LabelMachine
                         if (j == 0)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(FirstDT.Rows[i]["pi_title"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_title"].Caption + ":" + FirstDT.Rows[i]["pi_title"].ToString());
                         }
                         else if (j > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_inoutno"].Caption + ":" + FirstDT.Rows[i]["pi_inoutno"].ToString());
                         }
                         else if (columnNum > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_inoutno"].Caption + ":" + FirstDT.Rows[i]["pi_inoutno"].ToString());
                         }
                         else
                         {
@@ -2120,17 +2168,17 @@ namespace UAS_LabelMachine
                         if (j == 0)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(FirstDT.Rows[i]["pr_orispeccode"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pr_orispeccode"].Caption + ":" + FirstDT.Rows[i]["pr_orispeccode"].ToString());
                         }
                         else if (j > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_date"].Caption + ":" + FirstDT.Rows[i]["pi_date"].ToString());
                         }
                         else if (columnNum > 5 && j == columnNum - 5)
                         {
                             row1.CreateCell(j);
-                            row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
+                            row1.Cells[j].SetCellValue(FirstDT.Columns["pi_date"].Caption + ":" + FirstDT.Rows[i]["pi_date"].ToString());
                         }
                         else
                         {
@@ -2177,7 +2225,7 @@ namespace UAS_LabelMachine
                         {
                             row1.CreateCell(j);
                             row1.Cells[j].CellStyle = styleborder;
-                            row1.Cells[j].SetCellValue("总计");
+                            row1.Cells[j].SetCellValue(总计);
                         }
                         else if (j == columnNum - 6)
                         {