Browse Source

供应商端客户端程序修改提交

caosy 4 years ago
parent
commit
6a56ba4377

+ 13 - 0
UAS_Web/Browser.Designer.cs

@@ -30,13 +30,24 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Browser));
             this.PrintFile = new System.Drawing.Printing.PrintDocument();
+            this.textBox1 = new System.Windows.Forms.TextBox();
             this.SuspendLayout();
             // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(24, 1);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(788, 21);
+            this.textBox1.TabIndex = 0;
+            this.textBox1.Visible = false;
+            this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
+            // 
             // Browser
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(950, 541);
+            this.Controls.Add(this.textBox1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Name = "Browser";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -44,12 +55,14 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Browser_FormClosing);
             this.Load += new System.EventHandler(this.Browser_Load);
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
 
         private System.Drawing.Printing.PrintDocument PrintFile;
+        private System.Windows.Forms.TextBox textBox1;
     }
 }
 

+ 20 - 10
UAS_Web/Browser.cs

@@ -25,10 +25,11 @@ namespace UAS_Web
             InitializeComponent();
             Text = "供应商条码打印";
  
-            string path = "http://183.238.39.179:8099/ERP/jsps/vendbarcode/login.jsp";
+            string path = "http://113.108.109.210:8099/ERP/vendbarcode/relogin.action";
             webBrowser = new ChromiumWebBrowser(path)
             {
                 Dock = DockStyle.Fill
+                
             };
             CheckForIllegalCrossThreadCalls = false;
             webBrowser.MenuHandler = new MenuHandler();
@@ -61,7 +62,7 @@ namespace UAS_Web
         
         private void visitor_SendCookie(CefSharp.Cookie obj)
         {
-            if (obj.Path.Contains("jsps/vendbarcode"))
+            if (obj.Path.Contains("vendbarcode"))
             {
                 if (obj.Name == "username")
                     BaseUtil.SetCacheData("username", HttpUtility.UrlDecode(obj.Value));
@@ -76,14 +77,14 @@ namespace UAS_Web
 
         private void WebBrowser_LoadError(object sender, LoadErrorEventArgs e)
         {
-            //指定放大镜
-            if (e.FailedUrl.Contains("vendbarcode/batchdelivery.jsp?whoami=Delivery!Deal#"))
-                return;
-            if (e.FailedUrl.Contains("common/excel"))
-                return;
-            if (e.FailedUrl.Contains("common/downloadbyId.action"))
-                return;
-            MessageBox.Show("当前网络无法访问" + e.ErrorText);
+            ////指定放大镜
+            //if (e.FailedUrl.Contains("vendbarcode/batchdelivery.jsp?whoami=Delivery!Deal#"))
+            //    return;
+            //if (e.FailedUrl.Contains("common/excel"))
+            //    return;
+            //if (e.FailedUrl.Contains("common/downloadbyId.action"))
+            //    return;
+            //MessageBox.Show("当前网络无法访问" + e.ErrorText);
         }
 
         private void Browser_FormClosing(object sender, FormClosingEventArgs e)
@@ -102,6 +103,15 @@ namespace UAS_Web
                     pro[i].Kill();
                 }
             }
+            textBox1.Text = webBrowser.Address;
+        }
+
+        private void textBox1_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                webBrowser.Load(textBox1.Text);
+            }
         }
     }
 }

+ 15 - 0
UAS_Web/PrinterList.Designer.cs

@@ -34,6 +34,7 @@
             this.PRXA = new System.Windows.Forms.RadioButton();
             this.PRPIC = new System.Windows.Forms.RadioButton();
             this.PRFR = new System.Windows.Forms.RadioButton();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
             this.SuspendLayout();
             // 
             // Printer
@@ -90,11 +91,24 @@
             this.PRFR.UseVisualStyleBackColor = true;
             this.PRFR.Visible = false;
             // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "1",
+            "2",
+            "3"});
+            this.comboBox1.Location = new System.Drawing.Point(29, 109);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(67, 20);
+            this.comboBox1.TabIndex = 5;
+            // 
             // PrinterList
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(321, 170);
+            this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.PRFR);
             this.Controls.Add(this.PRPIC);
             this.Controls.Add(this.PRXA);
@@ -120,5 +134,6 @@
         private System.Windows.Forms.RadioButton PRXA;
         private System.Windows.Forms.RadioButton PRPIC;
         private System.Windows.Forms.RadioButton PRFR;
+        private System.Windows.Forms.ComboBox comboBox1;
     }
 }

+ 1 - 0
UAS_Web/PrinterList.cs

@@ -21,6 +21,7 @@ namespace UAS_Web
         private void PrinterList_Load(object sender, EventArgs e)
         {
             PrintDocument print = new PrintDocument();
+            comboBox1.SelectedIndex = 0;
             string sDefault = print.PrinterSettings.PrinterName;//默认打印机名
             foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称
             {

+ 4 - 4
UAS_Web/Properties/Settings.Designer.cs

@@ -25,13 +25,13 @@ namespace UAS_Web.Properties {
         
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("")]
-        public string PrinterName {
+        [global::System.Configuration.DefaultSettingValueAttribute("1")]
+        public int Printnum {
             get {
-                return ((string)(this["PrinterName"]));
+                return ((int)(this["Printnum"]));
             }
             set {
-                this["PrinterName"] = value;
+                this["Printnum"] = value;
             }
         }
     }

+ 2 - 2
UAS_Web/Properties/Settings.settings

@@ -2,8 +2,8 @@
 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_Web.Properties" GeneratedClassName="Settings">
   <Profiles />
   <Settings>
-    <Setting Name="PrinterName" Type="System.String" Scope="User">
-      <Value Profile="(Default)" />
+    <Setting Name="Printnum" Type="System.Int32" Scope="User">
+      <Value Profile="(Default)">1</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 2 - 2
UAS_Web/app.config

@@ -7,8 +7,8 @@
     </configSections>
     <userSettings>
         <UAS_Web.Properties.Settings>
-            <setting name="PrinterName" serializeAs="String">
-                <value/>
+            <setting name="Printnum" serializeAs="String">
+                <value>1</value>
             </setting>
         </UAS_Web.Properties.Settings>
     </userSettings>

+ 13 - 3
UAS_Web/tool/RequestHandler.cs

@@ -14,6 +14,7 @@ using System.Net;
 using System.Text;
 using System.Web;
 using System.Diagnostics;
+using UAS_Web.Properties;
 
 namespace UAS_Web.tool
 {
@@ -303,8 +304,8 @@ namespace UAS_Web.tool
                     return;
                 }
             }
-            int la_width = int.Parse(parameter.First()["LA_WIDTH"].ToString());
-            int la_height = int.Parse(parameter.First()["LA_HEIGHT"].ToString());
+            int la_width = 1;
+            int la_height = 1;
 
             foreach (var item in barcode)
             {
@@ -377,7 +378,9 @@ namespace UAS_Web.tool
             {
                 foreach (var item in barcode)
                 {
-                    DataRow dr = dt.NewRow();
+                    for (int i = 0; i < Settings.Default.Printnum; i++)
+                    {
+                        DataRow dr = dt.NewRow();
                     //g.CompositingQuality = CompositingQuality.HighQuality;
                     //g.SmoothingMode = SmoothingMode.HighQuality;
                     //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
@@ -426,6 +429,8 @@ namespace UAS_Web.tool
                         }
                     }
                     dt.Rows.Add(dr);
+                    }
+
                 }
             }
             if (PRPIC.Checked)
@@ -765,6 +770,11 @@ namespace UAS_Web.tool
             PrinterName = print.Controls["Printer"].Text;
             RadioButton PRXA = (RadioButton)print.Controls["PRXA"];
             RadioButton PRPIC = (RadioButton)print.Controls["PRPIC"];
+
+            int a = int.Parse(print.Controls["comboBox1"].Text);
+            Settings.Default.Printnum = a;
+            Settings.Default.Save();
+
             //获取矩阵图的分辨率
             Graphics gr = print.PrintDoc.PrinterSettings.CreateMeasurementGraphics();
             print.browser.FocusedFrame.ExecuteJavaScriptAsync("(function(value,value1){dpi=value,printType=value1})('" + gr.DpiX + "','" + PrintType + "')");