Browse Source

参数定义百分比和数量设置

callm 5 years ago
parent
commit
45c7950386

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

@@ -195,7 +195,7 @@ namespace UAS_LabelMachine
 
             //分页信息的DataTable
             string datasql = "";
-            LogicHandler.GetDataSQL(inoutno, es_field1.Substring(0, es_field1.Length - 1), out datasql);
+            LogicHandler.GetDataSQL(inoutno, es_field1.Substring(0, es_field1.Length - 1),"QTY", out datasql);
             DataTable dt = (DataTable)dh.ExecuteSql(datasql, "select");
             for (int i = 0; i < dt.Columns.Count; i++)
             {

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

@@ -58,12 +58,17 @@
             this.H_Param3 = new System.Windows.Forms.CheckBox();
             this.M_Param4 = new System.Windows.Forms.CheckBox();
             this.H_Param4 = new System.Windows.Forms.CheckBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.Rate = new System.Windows.Forms.RadioButton();
+            this.Mount = new System.Windows.Forms.RadioButton();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
+            this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
             // Export
             // 
-            this.Export.Location = new System.Drawing.Point(584, 580);
+            this.Export.Location = new System.Drawing.Point(584, 640);
             this.Export.Margin = new System.Windows.Forms.Padding(4);
             this.Export.Name = "Export";
             this.Export.Size = new System.Drawing.Size(188, 48);
@@ -340,7 +345,7 @@
             // 
             // ExportSetting
             // 
-            this.ExportSetting.Location = new System.Drawing.Point(402, 580);
+            this.ExportSetting.Location = new System.Drawing.Point(402, 640);
             this.ExportSetting.Margin = new System.Windows.Forms.Padding(4);
             this.ExportSetting.Name = "ExportSetting";
             this.ExportSetting.Size = new System.Drawing.Size(160, 48);
@@ -414,6 +419,54 @@
             this.H_Param4.UseVisualStyleBackColor = true;
             this.H_Param4.Visible = false;
             // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("宋体", 10F);
+            this.label8.Location = new System.Drawing.Point(22, 581);
+            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(134, 27);
+            this.label8.TabIndex = 39;
+            this.label8.Text = "分档方式:";
+            // 
+            // Rate
+            // 
+            this.Rate.AutoSize = true;
+            this.Rate.Font = new System.Drawing.Font("宋体", 10F);
+            this.Rate.Location = new System.Drawing.Point(23, 26);
+            this.Rate.Margin = new System.Windows.Forms.Padding(4);
+            this.Rate.Name = "Rate";
+            this.Rate.Size = new System.Drawing.Size(124, 31);
+            this.Rate.TabIndex = 40;
+            this.Rate.Text = "百分比";
+            this.Rate.UseVisualStyleBackColor = true;
+            // 
+            // Mount
+            // 
+            this.Mount.AutoSize = true;
+            this.Mount.Checked = true;
+            this.Mount.Font = new System.Drawing.Font("宋体", 10F);
+            this.Mount.Location = new System.Drawing.Point(166, 28);
+            this.Mount.Margin = new System.Windows.Forms.Padding(4);
+            this.Mount.Name = "Mount";
+            this.Mount.Size = new System.Drawing.Size(97, 31);
+            this.Mount.TabIndex = 41;
+            this.Mount.TabStop = true;
+            this.Mount.Text = "数量";
+            this.Mount.UseVisualStyleBackColor = true;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.Rate);
+            this.groupBox1.Controls.Add(this.Mount);
+            this.groupBox1.Location = new System.Drawing.Point(238, 553);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(495, 67);
+            this.groupBox1.TabIndex = 42;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox1_Paint);
+            // 
             // RowNum
             // 
             this.RowNum.Location = new System.Drawing.Point(960, 428);
@@ -428,7 +481,9 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1144, 672);
+            this.ClientSize = new System.Drawing.Size(1144, 704);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.label8);
             this.Controls.Add(this.H_Param4);
             this.Controls.Add(this.M_Param4);
             this.Controls.Add(this.H_Param3);
@@ -463,6 +518,8 @@
             this.Name = "ExportExcel";
             this.Text = "导出数据";
             this.Load += new System.EventHandler(this.ExportExcel_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -501,5 +558,9 @@
         private System.Windows.Forms.CheckBox H_Param3;
         private System.Windows.Forms.CheckBox M_Param4;
         private System.Windows.Forms.CheckBox H_Param4;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.RadioButton Rate;
+        private System.Windows.Forms.RadioButton Mount;
+        private System.Windows.Forms.GroupBox groupBox1;
     }
 }

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

@@ -44,9 +44,7 @@ namespace UAS_LabelMachine
 
         private void ExportMethod()
         {
-
             string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
-
             {
                 StringBuilder sql = new StringBuilder();
                 List<CheckBox> conditionbox = new List<CheckBox>();
@@ -113,7 +111,7 @@ namespace UAS_LabelMachine
                 }
                 //分页信息的DataTable
                 string datasql = "";
-                LogicHandler.GetDataSQL(inoutno, es_field1.Substring(0, es_field1.Length - 1), out datasql);
+                LogicHandler.GetDataSQL(inoutno, es_field1.Substring(0, es_field1.Length - 1), Mount.Checked ? "QTY" : "Rate", out datasql);
                 DataTable dt = (DataTable)dh.ExecuteSql(datasql, "select");
                 for (int i = 0; i < dt.Columns.Count; i++)
                 {
@@ -205,5 +203,10 @@ namespace UAS_LabelMachine
             ex.WindowState = FormWindowState.Maximized;
             ex.ShowDialog();
         }
+
+        private void groupBox1_Paint(object sender, PaintEventArgs e)
+        {
+            e.Graphics.Clear(this.BackColor);
+        }
     }
 }

+ 7 - 4
UAS-出货标签管理(贸易版)/PreViewWindow.Designer.cs

@@ -35,21 +35,24 @@
             // LabelPreView
             // 
             this.LabelPreView.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.LabelPreView.Location = new System.Drawing.Point(12, 12);
+            this.LabelPreView.Location = new System.Drawing.Point(24, 24);
+            this.LabelPreView.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.LabelPreView.Name = "LabelPreView";
-            this.LabelPreView.Size = new System.Drawing.Size(446, 394);
+            this.LabelPreView.Size = new System.Drawing.Size(892, 788);
             this.LabelPreView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.LabelPreView.TabIndex = 0;
             this.LabelPreView.TabStop = false;
             // 
             // PreViewWindow
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(470, 418);
+            this.ClientSize = new System.Drawing.Size(940, 836);
             this.Controls.Add(this.LabelPreView);
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "PreViewWindow";
             this.Text = "预览标签";
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.PreViewWindow_FormClosed);
             this.Load += new System.EventHandler(this.PreViewWindow_Load);
             ((System.ComponentModel.ISupportInitialize)(this.LabelPreView)).EndInit();
             this.ResumeLayout(false);

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

@@ -24,5 +24,10 @@ namespace UAS_LabelMachine
         {
             LabelPreView.Image = Image.FromFile(@"C:\打印标签\"+FileName+".jpg");
         }
+
+        private void PreViewWindow_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            LabelPreView.Image = null;
+        }
     }
 }

+ 3 - 3
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -482,11 +482,11 @@ namespace UAS_LabelMachine.PublicMethod
             return str;
         }
 
-        public static void GetDataSQL(string iInoutno,string iText,out string oSQL) {
+        public static void GetDataSQL(string iInoutno,string iText,string iNumOrRate,out string oSQL) {
             oSQL = "";
-            string[] param = new string[] { iInoutno, iText, oSQL };
+            string[] param = new string[] { iInoutno, iText, iNumOrRate, oSQL };
             dh.CallProcedure("SP_GETDATASQL", ref param);
-            oSQL = param[2];
+            oSQL = param[3];
         }
     }
 }

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

@@ -2783,6 +2783,10 @@ namespace UAS_LabelMachine
         {
             MidFormat = engine.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
             Resolution re = new Resolution(ImageResolution.Printer);
+            if (File.Exists(@"C:\打印标签\" + MidLabelCombox.Text + ".jpg"))
+            {
+                File.Delete(@"C:\打印标签\" + MidLabelCombox.Text + ".jpg");
+            }
             MidFormat.ExportImageToFile(@"C:\打印标签\" + MidLabelCombox.Text + ".jpg", ImageType.JPEG, Seagull.BarTender.Print.ColorDepth.Mono, re, OverwriteOptions.DoNotOverwrite);
             PreViewWindow pre = new PreViewWindow(MidLabelCombox.Text);
             pre.StartPosition = FormStartPosition.CenterScreen;