Эх сурвалжийг харах

添加打印Loading框,添加动态页码

callm 5 жил өмнө
parent
commit
42ad4cefc5

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

@@ -56,15 +56,15 @@
             this.M_Param2 = new System.Windows.Forms.CheckBox();
             this.M_Param3 = new System.Windows.Forms.CheckBox();
             this.H_Param3 = new System.Windows.Forms.CheckBox();
-            this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.M_Param4 = new System.Windows.Forms.CheckBox();
             this.H_Param4 = new System.Windows.Forms.CheckBox();
+            this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.SuspendLayout();
             // 
             // Export
             // 
             this.Export.Location = new System.Drawing.Point(584, 580);
-            this.Export.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Export.Margin = new System.Windows.Forms.Padding(4);
             this.Export.Name = "Export";
             this.Export.Size = new System.Drawing.Size(188, 48);
             this.Export.TabIndex = 0;
@@ -75,11 +75,9 @@
             // CH_BLUEFILM
             // 
             this.CH_BLUEFILM.AutoSize = true;
-            this.CH_BLUEFILM.Checked = true;
-            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(260, 116);
-            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(4);
             this.CH_BLUEFILM.Name = "CH_BLUEFILM";
             this.CH_BLUEFILM.Size = new System.Drawing.Size(125, 31);
             this.CH_BLUEFILM.TabIndex = 1;
@@ -89,11 +87,9 @@
             // CH_SPLITBATCH
             // 
             this.CH_SPLITBATCH.AutoSize = true;
-            this.CH_SPLITBATCH.Checked = true;
-            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(700, 116);
-            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(4);
             this.CH_SPLITBATCH.Name = "CH_SPLITBATCH";
             this.CH_SPLITBATCH.Size = new System.Drawing.Size(152, 31);
             this.CH_SPLITBATCH.TabIndex = 3;
@@ -103,11 +99,9 @@
             // CH_PBCODE
             // 
             this.CH_PBCODE.AutoSize = true;
-            this.CH_PBCODE.Checked = true;
-            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(260, 188);
-            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(4);
             this.CH_PBCODE.Name = "CH_PBCODE";
             this.CH_PBCODE.Size = new System.Drawing.Size(98, 31);
             this.CH_PBCODE.TabIndex = 8;
@@ -117,11 +111,9 @@
             // CH_REMARK
             // 
             this.CH_REMARK.AutoSize = true;
-            this.CH_REMARK.Checked = true;
-            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(488, 188);
-            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(4);
             this.CH_REMARK.Name = "CH_REMARK";
             this.CH_REMARK.Size = new System.Drawing.Size(152, 31);
             this.CH_REMARK.TabIndex = 9;
@@ -131,11 +123,9 @@
             // ch_code
             // 
             this.ch_code.AutoSize = true;
-            this.ch_code.Checked = true;
-            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(488, 116);
-            this.ch_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ch_code.Margin = new System.Windows.Forms.Padding(4);
             this.ch_code.Name = "ch_code";
             this.ch_code.Size = new System.Drawing.Size(125, 31);
             this.ch_code.TabIndex = 10;
@@ -145,11 +135,9 @@
             // CH_WATERID
             // 
             this.CH_WATERID.AutoSize = true;
-            this.CH_WATERID.Checked = true;
-            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(904, 116);
-            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(4);
             this.CH_WATERID.Name = "CH_WATERID";
             this.CH_WATERID.Size = new System.Drawing.Size(156, 31);
             this.CH_WATERID.TabIndex = 11;
@@ -205,7 +193,7 @@
             this.H_Param2.AutoSize = true;
             this.H_Param2.Font = new System.Drawing.Font("宋体", 10F);
             this.H_Param2.Location = new System.Drawing.Point(488, 346);
-            this.H_Param2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.H_Param2.Margin = new System.Windows.Forms.Padding(4);
             this.H_Param2.Name = "H_Param2";
             this.H_Param2.Size = new System.Drawing.Size(156, 31);
             this.H_Param2.TabIndex = 17;
@@ -218,7 +206,7 @@
             this.H_Param1.AutoSize = true;
             this.H_Param1.Font = new System.Drawing.Font("宋体", 10F);
             this.H_Param1.Location = new System.Drawing.Point(260, 346);
-            this.H_Param1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.H_Param1.Margin = new System.Windows.Forms.Padding(4);
             this.H_Param1.Name = "H_Param1";
             this.H_Param1.Size = new System.Drawing.Size(156, 31);
             this.H_Param1.TabIndex = 18;
@@ -231,7 +219,7 @@
             this.M_Param1.AutoSize = true;
             this.M_Param1.Font = new System.Drawing.Font("宋体", 10F);
             this.M_Param1.Location = new System.Drawing.Point(260, 266);
-            this.M_Param1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.M_Param1.Margin = new System.Windows.Forms.Padding(4);
             this.M_Param1.Name = "M_Param1";
             this.M_Param1.Size = new System.Drawing.Size(156, 31);
             this.M_Param1.TabIndex = 19;
@@ -266,7 +254,7 @@
             this.BatchCode.AutoSize = true;
             this.BatchCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BatchCode.Location = new System.Drawing.Point(260, 432);
-            this.BatchCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.BatchCode.Margin = new System.Windows.Forms.Padding(4);
             this.BatchCode.Name = "BatchCode";
             this.BatchCode.Size = new System.Drawing.Size(124, 31);
             this.BatchCode.TabIndex = 22;
@@ -278,7 +266,7 @@
             this.BoxCode.AutoSize = true;
             this.BoxCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BoxCode.Location = new System.Drawing.Point(444, 432);
-            this.BoxCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.BoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.BoxCode.Name = "BoxCode";
             this.BoxCode.Size = new System.Drawing.Size(97, 31);
             this.BoxCode.TabIndex = 23;
@@ -291,7 +279,7 @@
             this.FixRow.Checked = true;
             this.FixRow.Font = new System.Drawing.Font("宋体", 10F);
             this.FixRow.Location = new System.Drawing.Point(612, 432);
-            this.FixRow.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FixRow.Margin = new System.Windows.Forms.Padding(4);
             this.FixRow.Name = "FixRow";
             this.FixRow.Size = new System.Drawing.Size(151, 31);
             this.FixRow.TabIndex = 24;
@@ -315,7 +303,7 @@
             this.FirstPage_WID.AutoSize = true;
             this.FirstPage_WID.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_WID.Location = new System.Drawing.Point(260, 508);
-            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_WID.Name = "FirstPage_WID";
             this.FirstPage_WID.Size = new System.Drawing.Size(210, 31);
             this.FirstPage_WID.TabIndex = 29;
@@ -327,7 +315,7 @@
             this.FirstPage_YIELD.AutoSize = true;
             this.FirstPage_YIELD.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_YIELD.Location = new System.Drawing.Point(488, 508);
-            this.FirstPage_YIELD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_YIELD.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_YIELD.Name = "FirstPage_YIELD";
             this.FirstPage_YIELD.Size = new System.Drawing.Size(98, 31);
             this.FirstPage_YIELD.TabIndex = 31;
@@ -339,7 +327,7 @@
             this.FirstPage_REMARK.AutoSize = true;
             this.FirstPage_REMARK.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_REMARK.Location = new System.Drawing.Point(608, 508);
-            this.FirstPage_REMARK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_REMARK.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_REMARK.Name = "FirstPage_REMARK";
             this.FirstPage_REMARK.Size = new System.Drawing.Size(98, 31);
             this.FirstPage_REMARK.TabIndex = 32;
@@ -349,7 +337,7 @@
             // ExportSetting
             // 
             this.ExportSetting.Location = new System.Drawing.Point(402, 580);
-            this.ExportSetting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ExportSetting.Margin = new System.Windows.Forms.Padding(4);
             this.ExportSetting.Name = "ExportSetting";
             this.ExportSetting.Size = new System.Drawing.Size(160, 48);
             this.ExportSetting.TabIndex = 33;
@@ -396,16 +384,6 @@
             this.H_Param3.UseVisualStyleBackColor = true;
             this.H_Param3.Visible = false;
             // 
-            // RowNum
-            // 
-            this.RowNum.Location = new System.Drawing.Point(960, 428);
-            this.RowNum.Margin = new System.Windows.Forms.Padding(4);
-            this.RowNum.Name = "RowNum";
-            this.RowNum.Negative = false;
-            this.RowNum.Size = new System.Drawing.Size(100, 35);
-            this.RowNum.TabIndex = 30;
-            this.RowNum.Text = "10";
-            // 
             // M_Param4
             // 
             this.M_Param4.AutoSize = true;
@@ -432,6 +410,16 @@
             this.H_Param4.UseVisualStyleBackColor = true;
             this.H_Param4.Visible = false;
             // 
+            // RowNum
+            // 
+            this.RowNum.Location = new System.Drawing.Point(960, 428);
+            this.RowNum.Margin = new System.Windows.Forms.Padding(4);
+            this.RowNum.Name = "RowNum";
+            this.RowNum.Negative = false;
+            this.RowNum.Size = new System.Drawing.Size(100, 35);
+            this.RowNum.TabIndex = 30;
+            this.RowNum.Text = "10";
+            // 
             // ExportExcel
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -467,7 +455,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(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "ExportExcel";
             this.Text = "导出数据";
             this.Load += new System.EventHandler(this.ExportExcel_Load);

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

@@ -5,8 +5,10 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
+using UAS_LabelMachine.PublicForm;
 using UAS_LabelMachine.PublicMethod;
 
 namespace UAS_LabelMachine
@@ -18,6 +20,8 @@ namespace UAS_LabelMachine
         DataHelper dh = SystemInf.dh;
         string inoutno;
 
+        SetLoadingWindow stw;
+
         public ExportExcel(string pi_inoutno)
         {
             InitializeComponent();
@@ -29,8 +33,20 @@ namespace UAS_LabelMachine
         {
             ExportFileDialog.Description = "选择导出的路径";
             DialogResult result = ExportFileDialog.ShowDialog();
-            string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
             if (result == DialogResult.OK)
+            {
+                Thread thread = new Thread(ExportMethod);
+                stw = new SetLoadingWindow(thread, "正在导出数据");
+                BaseUtil.SetFormCenter(stw);
+                stw.ShowDialog();
+            }
+        }
+
+        private void ExportMethod()
+        {
+
+            string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
+
             {
                 StringBuilder sql = new StringBuilder();
                 List<CheckBox> conditionbox = new List<CheckBox>();

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

@@ -448,6 +448,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -621,6 +622,7 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center ="第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
@@ -662,6 +664,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -806,6 +809,7 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
@@ -847,6 +851,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -1002,6 +1007,7 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());