Просмотр исходного кода

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

caosy 6 лет назад
Родитель
Сommit
2f83199b2e
23 измененных файлов с 1234 добавлено и 735 удалено
  1. 42 96
      UAS-出货标签管理(吉利通)/CustomerRule.Designer.cs
  2. 3 1
      UAS-出货标签管理(吉利通)/CustomerRule.cs
  3. 152 0
      UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.Designer.cs
  4. 19 0
      UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.cs
  5. 120 0
      UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.resx
  6. 0 2
      UAS-出货标签管理(吉利通)/Entity/SystemInf.cs
  7. 0 4
      UAS-出货标签管理(吉利通)/Login.cs
  8. 2 1
      UAS-出货标签管理(吉利通)/ParamSetting.cs
  9. 15 4
      UAS-出货标签管理(吉利通)/PowerSetting.Designer.cs
  10. 3 3
      UAS-出货标签管理(吉利通)/PowerSetting.cs
  11. 21 0
      UAS-出货标签管理(吉利通)/PowerSetting.resx
  12. 0 1
      UAS-出货标签管理(吉利通)/PublicMethod/AccessDBHelper.cs
  13. 15 1
      UAS-出货标签管理(吉利通)/PublicMethod/BaseUtil.cs
  14. 14 2
      UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs
  15. 16 2
      UAS-出货标签管理(吉利通)/PublicMethod/LogicHandler.cs
  16. 10 1
      UAS-出货标签管理(吉利通)/UAS-出货标签管理(吉利通).csproj
  17. 280 196
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs
  18. 348 373
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs
  19. 3 0
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx
  20. 78 24
      UAS-出货标签管理(吉利通)/生成条码.Designer.cs
  21. 80 20
      UAS-出货标签管理(吉利通)/生成条码.cs
  22. 9 0
      UAS-出货标签管理(吉利通)/生成条码.resx
  23. 4 4
      UAS-出货标签管理(吉利通)/采集策略_NEW.Designer.cs

+ 42 - 96
UAS-出货标签管理(吉利通)/CustomerRule.Designer.cs

@@ -33,7 +33,7 @@
             this.cu_print_midprod = new System.Windows.Forms.CheckBox();
             this.cu_print_midspec = new System.Windows.Forms.CheckBox();
             this.cu_print_midpo = new System.Windows.Forms.CheckBox();
-            this.cu_print_regexpression = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
+            this.cu_print_regexpression = new System.Windows.Forms.RichTextBox();
             this.CustomerTreeView = new System.Windows.Forms.TreeView();
             this.ButtonSaveScanGroup = new UAS_LabelMachine.CustomControl.NormalButton();
             this.Customer = new System.Windows.Forms.TextBox();
@@ -58,18 +58,15 @@
             this.cu_print_checkdatecode = new System.Windows.Forms.CheckBox();
             this.label6 = new System.Windows.Forms.Label();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.radioButton5 = new System.Windows.Forms.RadioButton();
-            this.radioButton4 = new System.Windows.Forms.RadioButton();
-            this.radioButton3 = new System.Windows.Forms.RadioButton();
-            this.radioButton2 = new System.Windows.Forms.RadioButton();
-            this.radioButton1 = new System.Windows.Forms.RadioButton();
             this.FormatExample = new System.Windows.Forms.Label();
             this.FormatExample1 = new System.Windows.Forms.Label();
+            this.cu_print_dateformat = new System.Windows.Forms.TextBox();
+            this.label7 = new System.Windows.Forms.Label();
+            this.cu_print_limiteddate = new System.Windows.Forms.NumericUpDown();
             ((System.ComponentModel.ISupportInitialize)(this.cu_print_papercount)).BeginInit();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
-            this.groupBox3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.cu_print_limiteddate)).BeginInit();
             this.SuspendLayout();
             // 
             // cu_print_midlotno
@@ -389,84 +386,6 @@
             this.groupBox2.TabIndex = 67;
             this.groupBox2.TabStop = false;
             // 
-            // groupBox3
-            // 
-            this.groupBox3.Controls.Add(this.radioButton5);
-            this.groupBox3.Controls.Add(this.radioButton4);
-            this.groupBox3.Controls.Add(this.radioButton3);
-            this.groupBox3.Controls.Add(this.radioButton2);
-            this.groupBox3.Controls.Add(this.radioButton1);
-            this.groupBox3.Location = new System.Drawing.Point(290, 540);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(660, 45);
-            this.groupBox3.TabIndex = 68;
-            this.groupBox3.TabStop = false;
-            // 
-            // radioButton5
-            // 
-            this.radioButton5.AutoSize = true;
-            this.radioButton5.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton5.Location = new System.Drawing.Point(576, 15);
-            this.radioButton5.Name = "radioButton5";
-            this.radioButton5.Size = new System.Drawing.Size(62, 21);
-            this.radioButton5.TabIndex = 63;
-            this.radioButton5.TabStop = true;
-            this.radioButton5.Text = "表达式";
-            this.radioButton5.UseVisualStyleBackColor = true;
-            this.radioButton5.Visible = false;
-            // 
-            // radioButton4
-            // 
-            this.radioButton4.AutoSize = true;
-            this.radioButton4.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton4.Location = new System.Drawing.Point(147, 15);
-            this.radioButton4.Name = "radioButton4";
-            this.radioButton4.Size = new System.Drawing.Size(80, 21);
-            this.radioButton4.TabIndex = 62;
-            this.radioButton4.TabStop = true;
-            this.radioButton4.Text = "M/d/yyyy";
-            this.radioButton4.UseVisualStyleBackColor = true;
-            this.radioButton4.CheckedChanged += new System.EventHandler(this.DateFormat_CheckedChanged);
-            // 
-            // radioButton3
-            // 
-            this.radioButton3.AutoSize = true;
-            this.radioButton3.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton3.Location = new System.Drawing.Point(426, 15);
-            this.radioButton3.Name = "radioButton3";
-            this.radioButton3.Size = new System.Drawing.Size(62, 21);
-            this.radioButton3.TabIndex = 61;
-            this.radioButton3.TabStop = true;
-            this.radioButton3.Text = "表达式";
-            this.radioButton3.UseVisualStyleBackColor = true;
-            this.radioButton3.Visible = false;
-            // 
-            // radioButton2
-            // 
-            this.radioButton2.AutoSize = true;
-            this.radioButton2.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton2.Location = new System.Drawing.Point(290, 15);
-            this.radioButton2.Name = "radioButton2";
-            this.radioButton2.Size = new System.Drawing.Size(100, 21);
-            this.radioButton2.TabIndex = 60;
-            this.radioButton2.TabStop = true;
-            this.radioButton2.Text = "yyyy/MM/dd";
-            this.radioButton2.UseVisualStyleBackColor = true;
-            this.radioButton2.CheckedChanged += new System.EventHandler(this.DateFormat_CheckedChanged);
-            // 
-            // radioButton1
-            // 
-            this.radioButton1.AutoSize = true;
-            this.radioButton1.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton1.Location = new System.Drawing.Point(11, 15);
-            this.radioButton1.Name = "radioButton1";
-            this.radioButton1.Size = new System.Drawing.Size(68, 21);
-            this.radioButton1.TabIndex = 59;
-            this.radioButton1.TabStop = true;
-            this.radioButton1.Text = "M/d/yy";
-            this.radioButton1.UseVisualStyleBackColor = true;
-            this.radioButton1.CheckedChanged += new System.EventHandler(this.DateFormat_CheckedChanged);
-            // 
             // FormatExample
             // 
             this.FormatExample.AutoSize = true;
@@ -486,14 +405,45 @@
             this.FormatExample1.Size = new System.Drawing.Size(0, 21);
             this.FormatExample1.TabIndex = 70;
             // 
+            // cu_print_dateformat
+            // 
+            this.cu_print_dateformat.Location = new System.Drawing.Point(301, 556);
+            this.cu_print_dateformat.Name = "cu_print_dateformat";
+            this.cu_print_dateformat.Size = new System.Drawing.Size(114, 21);
+            this.cu_print_dateformat.TabIndex = 71;
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(770, 220);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(74, 21);
+            this.label7.TabIndex = 72;
+            this.label7.Text = "有效日期";
+            // 
+            // cu_print_limiteddate
+            // 
+            this.cu_print_limiteddate.Location = new System.Drawing.Point(850, 220);
+            this.cu_print_limiteddate.Maximum = new decimal(new int[] {
+            10000,
+            0,
+            0,
+            0});
+            this.cu_print_limiteddate.Name = "cu_print_limiteddate";
+            this.cu_print_limiteddate.Size = new System.Drawing.Size(62, 21);
+            this.cu_print_limiteddate.TabIndex = 73;
+            // 
             // CustomerRule
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.Controls.Add(this.cu_print_limiteddate);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.cu_print_dateformat);
             this.Controls.Add(this.FormatExample1);
             this.Controls.Add(this.FormatExample);
-            this.Controls.Add(this.groupBox3);
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.label6);
             this.Controls.Add(this.cu_print_checkdatecode);
@@ -528,8 +478,7 @@
             this.groupBox1.PerformLayout();
             this.groupBox2.ResumeLayout(false);
             this.groupBox2.PerformLayout();
-            this.groupBox3.ResumeLayout(false);
-            this.groupBox3.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.cu_print_limiteddate)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -540,7 +489,7 @@
         private System.Windows.Forms.CheckBox cu_print_midprod;
         private System.Windows.Forms.CheckBox cu_print_midspec;
         private System.Windows.Forms.CheckBox cu_print_midpo;
-        private CustomControl.RichText.RichTextAutoBottom cu_print_regexpression;
+        private System.Windows.Forms.RichTextBox cu_print_regexpression;
         private System.Windows.Forms.TreeView CustomerTreeView;
         private CustomControl.NormalButton ButtonSaveScanGroup;
         private System.Windows.Forms.TextBox Customer;
@@ -565,13 +514,10 @@
         private System.Windows.Forms.CheckBox cu_print_checkdatecode;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.GroupBox groupBox2;
-        private System.Windows.Forms.GroupBox groupBox3;
-        private System.Windows.Forms.RadioButton radioButton5;
-        private System.Windows.Forms.RadioButton radioButton4;
-        private System.Windows.Forms.RadioButton radioButton3;
-        private System.Windows.Forms.RadioButton radioButton2;
-        private System.Windows.Forms.RadioButton radioButton1;
         private System.Windows.Forms.Label FormatExample;
         private System.Windows.Forms.Label FormatExample1;
+        private System.Windows.Forms.TextBox cu_print_dateformat;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.NumericUpDown cu_print_limiteddate;
     }
 }

+ 3 - 1
UAS-出货标签管理(吉利通)/CustomerRule.cs

@@ -50,7 +50,7 @@ namespace UAS_LabelMachine
             {
                 CUCODE = e.Node.Tag.ToString();
                 sql.Clear();
-                sql.Append("select cu_print_midlotno,cu_print_midspec,cu_print_checkdatecode,cu_print_recheck,cu_print_midpo,cu_print_midprod,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
+                sql.Append("select cu_print_midlotno,cu_print_midspec,cu_print_dateformat,nvl(cu_print_limiteddate,0)cu_print_limiteddate,cu_print_checkdatecode,cu_print_recheck,cu_print_midpo,cu_print_midprod,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
                 sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression from customer where cu_code='" + e.Node.Tag + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
@@ -100,6 +100,8 @@ namespace UAS_LabelMachine
             sql.Append("cu_print_custprodmatchmodel='" + (Equal.Checked ? "Equal" : "Expression") + "',");
             sql.Append("cu_print_recheck='" + (CustProdAndSpec.Checked ? "CP" : "BR") + "',");
             sql.Append("cu_print_checkdatecode='" + (cu_print_checkdatecode.Checked ? -1 : 0) + "',");
+            sql.Append("cu_print_dateformat='" + cu_print_dateformat.Text + "',");
+            sql.Append("cu_print_limiteddate=" + cu_print_limiteddate.Value + ",");
             sql.Append("cu_print_regexpression=:cu_print_regexpression where cu_code='" + CUCODE + "'");
             dh.ExecuteSql(sql.ToString(), "update", cu_print_regexpression.Text);
             MessageBox.Show("保存成功!", "提示");

+ 152 - 0
UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.Designer.cs

@@ -0,0 +1,152 @@
+namespace UAS_LabelMachine
+{
+    partial class DateCodeSetAndPrint
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SetValueAndPrint = new System.Windows.Forms.Button();
+            this.loadingCircle1 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
+            this.SetValue = new System.Windows.Forms.Button();
+            this.lotno_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.lotno = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.datecode = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.SuspendLayout();
+            // 
+            // SetValueAndPrint
+            // 
+            this.SetValueAndPrint.Location = new System.Drawing.Point(191, 168);
+            this.SetValueAndPrint.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.SetValueAndPrint.Name = "SetValueAndPrint";
+            this.SetValueAndPrint.Size = new System.Drawing.Size(77, 20);
+            this.SetValueAndPrint.TabIndex = 0;
+            this.SetValueAndPrint.Text = "设置并打印";
+            this.SetValueAndPrint.UseVisualStyleBackColor = true;
+            // 
+            // loadingCircle1
+            // 
+            this.loadingCircle1.Active = false;
+            this.loadingCircle1.Color = System.Drawing.Color.DarkGray;
+            this.loadingCircle1.InnerCircleRadius = 5;
+            this.loadingCircle1.Location = new System.Drawing.Point(205, 106);
+            this.loadingCircle1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.loadingCircle1.Name = "loadingCircle1";
+            this.loadingCircle1.NumberSpoke = 12;
+            this.loadingCircle1.OuterCircleRadius = 11;
+            this.loadingCircle1.RotationSpeed = 100;
+            this.loadingCircle1.Size = new System.Drawing.Size(0, 0);
+            this.loadingCircle1.SpokeThickness = 2;
+            this.loadingCircle1.StylePreset = UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle.StylePresets.MacOSX;
+            this.loadingCircle1.TabIndex = 2;
+            this.loadingCircle1.Text = "loadingCircle1";
+            // 
+            // SetValue
+            // 
+            this.SetValue.Location = new System.Drawing.Point(106, 168);
+            this.SetValue.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.SetValue.Name = "SetValue";
+            this.SetValue.Size = new System.Drawing.Size(71, 20);
+            this.SetValue.TabIndex = 3;
+            this.SetValue.Text = "设置值";
+            this.SetValue.UseVisualStyleBackColor = true;
+            // 
+            // lotno_label
+            // 
+            this.lotno_label.AutoSize = true;
+            this.lotno_label.Location = new System.Drawing.Point(68, 66);
+            this.lotno_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lotno_label.Name = "lotno_label";
+            this.lotno_label.Size = new System.Drawing.Size(35, 12);
+            this.lotno_label.TabIndex = 4;
+            this.lotno_label.Text = "LotNo";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(68, 110);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(53, 12);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "DateCode";
+            // 
+            // lotno
+            // 
+            this.lotno.ID = null;
+            this.lotno.Location = new System.Drawing.Point(134, 64);
+            this.lotno.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.lotno.Name = "lotno";
+            this.lotno.Size = new System.Drawing.Size(152, 21);
+            this.lotno.Str = null;
+            this.lotno.Str1 = null;
+            this.lotno.Str2 = null;
+            this.lotno.TabIndex = 6;
+            // 
+            // datecode
+            // 
+            this.datecode.ID = null;
+            this.datecode.Location = new System.Drawing.Point(134, 109);
+            this.datecode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.datecode.Name = "datecode";
+            this.datecode.Size = new System.Drawing.Size(152, 21);
+            this.datecode.Str = null;
+            this.datecode.Str1 = null;
+            this.datecode.Str2 = null;
+            this.datecode.TabIndex = 7;
+            // 
+            // DateCodeSetAndPrint
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(365, 212);
+            this.Controls.Add(this.datecode);
+            this.Controls.Add(this.lotno);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.lotno_label);
+            this.Controls.Add(this.SetValue);
+            this.Controls.Add(this.loadingCircle1);
+            this.Controls.Add(this.SetValueAndPrint);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Name = "DateCodeSetAndPrint";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "DateCodeSetAndPrint";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button SetValueAndPrint;
+        private CustomControl.SetLoading.LoadingCircle loadingCircle1;
+        private System.Windows.Forms.Button SetValue;
+        private System.Windows.Forms.Label lotno_label;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.EnterTextBox lotno;
+        private CustomControl.EnterTextBox datecode;
+    }
+}

+ 19 - 0
UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace UAS_LabelMachine
+{
+    public partial class DateCodeSetAndPrint : Form
+    {
+        public DateCodeSetAndPrint()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 120 - 0
UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 0 - 2
UAS-出货标签管理(吉利通)/Entity/SystemInf.cs

@@ -6,8 +6,6 @@
 
         public static AccessDBHelper adh;
 
-        public static AccessDBHelper front_adh;
-
         public static AccessDBHelper back_adh;
     }
 }

+ 0 - 4
UAS-出货标签管理(吉利通)/Login.cs

@@ -12,8 +12,6 @@ namespace UAS_LabelMachine
     public partial class Login : Form
     {
         DataHelper dh;
-        //前端操作
-        AccessDBHelper adh;
         //后端操作
         AccessDBHelper adh1;
         //数据上传操作
@@ -38,11 +36,9 @@ namespace UAS_LabelMachine
             dh = new DataHelper();
             //启动时压缩数据库
             BaseUtil.CompactAccessDB("LabelPrint.accdb");
-            adh = new AccessDBHelper("LabelPrint.accdb");
             adh1 = new AccessDBHelper("LabelPrint.accdb");
             adh2 = new AccessDBHelper("LabelPrint.accdb");
             SystemInf.dh = dh;
-            SystemInf.front_adh = adh;
             SystemInf.back_adh = adh1;
             SystemInf.adh = adh2;
             //获取账套信息

+ 2 - 1
UAS-出货标签管理(吉利通)/ParamSetting.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using UAS_LabelMachine.PublicMethod;
 using System.Windows.Forms;
 using UAS_LabelMachine.CustomControl;
+using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine
 {
@@ -31,7 +32,7 @@ namespace UAS_LabelMachine
 
         private void ParamSetting_Load(object sender, EventArgs e)
         {
-            dbhelper = new AccessDBHelper("LabelPrint.accdb");
+            dbhelper = SystemInf.adh;
             loaddata();
         }
 

+ 15 - 4
UAS-出货标签管理(吉利通)/PowerSetting.Designer.cs

@@ -41,6 +41,7 @@
             this.lpp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.em_na = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.lpp_manual = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.lpp_cleandetail = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.PowerSetDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -53,7 +54,8 @@
             this.lpp_emcode,
             this.lpp_id,
             this.em_na,
-            this.lpp_manual});
+            this.lpp_manual,
+            this.lpp_cleandetail});
             this.PowerSetDGV.Location = new System.Drawing.Point(0, 55);
             this.PowerSetDGV.Name = "PowerSetDGV";
             this.PowerSetDGV.RowTemplate.Height = 23;
@@ -88,7 +90,7 @@
             this.si_expression4_label.AutoSize = true;
             this.si_expression4_label.BackColor = System.Drawing.Color.Transparent;
             this.si_expression4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_expression4_label.Location = new System.Drawing.Point(286, 20);
+            this.si_expression4_label.Location = new System.Drawing.Point(276, 19);
             this.si_expression4_label.Name = "si_expression4_label";
             this.si_expression4_label.Size = new System.Drawing.Size(74, 21);
             this.si_expression4_label.TabIndex = 57;
@@ -97,7 +99,7 @@
             // em_code
             // 
             this.em_code.ID = null;
-            this.em_code.Location = new System.Drawing.Point(107, 20);
+            this.em_code.Location = new System.Drawing.Point(100, 20);
             this.em_code.Name = "em_code";
             this.em_code.Size = new System.Drawing.Size(157, 21);
             this.em_code.Str = null;
@@ -111,7 +113,7 @@
             this.label1.AutoSize = true;
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(9, 20);
+            this.label1.Location = new System.Drawing.Point(9, 19);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 59;
@@ -159,6 +161,14 @@
             this.lpp_manual.HeaderText = "允许手动采集";
             this.lpp_manual.Name = "lpp_manual";
             // 
+            // lpp_cleandetail
+            // 
+            this.lpp_cleandetail.DataPropertyName = "lpp_cleandetail";
+            this.lpp_cleandetail.HeaderText = "允许重置条码";
+            this.lpp_cleandetail.Name = "lpp_cleandetail";
+            this.lpp_cleandetail.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.lpp_cleandetail.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            // 
             // PowerSetting
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -194,5 +204,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn lpp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_na;
         private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_manual;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_cleandetail;
     }
 }

+ 3 - 3
UAS-出货标签管理(吉利通)/PowerSetting.cs

@@ -35,8 +35,8 @@ namespace UAS_LabelMachine
             {
                 sql.Clear();
                 sql.Append("MERGE INTO labelprintpower alias1 USING (select '" + dt.Rows[i]["em_code"].ToString() + "' em_code from  dual) alias2 ");
-                sql.Append("ON (alias1.lpp_emcode=alias2.em_code) WHEN MATCHED THEN  UPDATE  SET lpp_manual = '" + dt.Rows[i]["lpp_manual"].ToString() + "' ");
-                sql.Append("WHEN NOT MATCHED THEN INSERT (lpp_id,lpp_emcode,lpp_manual) VALUES (labelprintpower_seq.nextval,");
+                sql.Append("ON (alias1.lpp_emcode=alias2.em_code) WHEN MATCHED THEN  UPDATE  SET lpp_manual = '" + dt.Rows[i]["lpp_manual"].ToString() + "', ");
+                sql.Append("lpp_cleandetail = '" + dt.Rows[i]["lpp_cleandetail"].ToString() + "' WHEN NOT MATCHED THEN INSERT (lpp_id,lpp_emcode,lpp_manual) VALUES (labelprintpower_seq.nextval,");
                 sql.Append(" '" + dt.Rows[i]["em_code"].ToString() + "', '" + dt.Rows[i]["lpp_manual"].ToString() + "')");
                 SQLS.Add(sql.ToString());
             }
@@ -46,7 +46,7 @@ namespace UAS_LabelMachine
 
         private void LoadData()
         {
-            string sql = "select em_code,em_name,lpp_id,lpp_emcode,lpp_manual from employee left join labelprintpower on em_code = lpp_emcode " + condition;
+            string sql = "select em_code,em_name,lpp_id,lpp_emcode,lpp_manual,lpp_cleandetail from employee left join labelprintpower on em_code = lpp_emcode " + condition;
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             BaseUtil.FillDgvWithDataTable(PowerSetDGV, dt);
         }

+ 21 - 0
UAS-出货标签管理(吉利通)/PowerSetting.resx

@@ -132,6 +132,9 @@
   <metadata name="lpp_manual.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="lpp_cleandetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="SaveGrid.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
@@ -145,4 +148,22 @@
         48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
 </value>
   </data>
+  <metadata name="Choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lpp_emcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lpp_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="em_na.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lpp_manual.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="lpp_cleandetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 0 - 1
UAS-出货标签管理(吉利通)/PublicMethod/AccessDBHelper.cs

@@ -6,7 +6,6 @@ using System.IO;
 using System.Text;
 using System.Windows.Forms;
 
-
 namespace UAS_LabelMachine
 {
     class AccessDBHelper

+ 15 - 1
UAS-出货标签管理(吉利通)/PublicMethod/BaseUtil.cs

@@ -56,6 +56,20 @@ namespace UAS_LabelMachine
             }
         }
 
+        public static void GetDayFromDateCode(string DateCode, out int oYear, out int oMonth, out int oDay)
+        {
+            oYear = 0;
+            oMonth = 0;
+            oDay = 0;
+            if (DateCode.Length == 4)
+            {
+                oYear = int.Parse(DateCode.Substring(0, 2));
+                DateTime date=  new DateTime(DateTime.Now.Year, 1, 1).AddDays(7 * int.Parse(DateCode.Substring(2, 2)));
+                oMonth = date.Month;
+                oDay = date.Day;
+            }
+        }
+
         public static string SysDisc1
         {
             get
@@ -216,7 +230,7 @@ namespace UAS_LabelMachine
                         SetFormValue(collection[i].Controls, dt);
                     string controlName = collection[i].Name;
                     //默认给TextBox和Label赋值
-                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is NumericUpDown || collection[i] is CheckBox || collection[i] is RichTextAutoBottom)
+                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is NumericUpDown || collection[i] is CheckBox || collection[i] is RichTextAutoBottom || collection[i] is RichTextBox)
                     {
                         for (int j = 0; j < dt.Columns.Count; j++)
                         {

+ 14 - 2
UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs

@@ -24,7 +24,7 @@ namespace UAS_Labeling.PublicMethod
             //通过句柄去获取具体触发事件的控件
             Control c = Control.FromHandle(m.HWnd);
             //可进行数据操作的控件需要进行权限的判断,结合WM_LBUTTONDOWN对按钮进行判断
-            if (c != null && m.Msg == WM_LBUTTONDOWN && c is RadioButton)
+            if (c != null && m.Msg == WM_LBUTTONDOWN && (c is RadioButton || c is Button))
             {
                 LogManager.DoLog("点击【" + c.Text + "】");
                 return CheckPower(c);
@@ -45,13 +45,25 @@ namespace UAS_Labeling.PublicMethod
             if (User.UserAccountType != "admin")
             {
                 {
-                    string sql = " select * from labelprintpower where lpp_emcode = '" + User.UserCode + "' and lpp_manual=1";
+                    string sql = " select nvl(lpp_manual,0)lpp_manual,nvl(lpp_cleandetail,0)lpp_cleandetail from labelprintpower where lpp_emcode = '" + User.UserCode + "'";
                     DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
                     if (dt.Rows.Count > 0)
                     {
                         switch (c.Name)
                         {
                             case "ManualCollection":
+                                if (dt.Rows[0]["lpp_manual"].ToString() == "0")
+                                {
+                                    MessageBox.Show("您没有手动采集的权限,请与管理员联系", "提示");
+                                    return true;
+                                }
+                                break;
+                            case "ResetBarcode":
+                                if (dt.Rows[0]["lpp_cleandetail"].ToString() == "0")
+                                {
+                                    MessageBox.Show("您没有重置条码的权限,请与管理员联系", "提示");
+                                    return true;
+                                }
                                 break;
                             default:
                                 break;

+ 16 - 2
UAS-出货标签管理(吉利通)/PublicMethod/LogicHandler.cs

@@ -63,6 +63,20 @@ namespace UAS_LabelMachine.PublicMethod
             oBarCode = param[9];
         }
 
+        public static void GetTimeFromDatecode(string iDatecode, string iCustcode, out string oYear, out string oMonth, out string oDay, out string oDate)
+        {
+            oYear = "0";
+            oMonth = "0";
+            oDay = "0";
+            oDate = "19000101";
+            string[] param = new string[] { iDatecode, iCustcode, oYear, oMonth, oDay, oDate };
+            dh.CallProcedure("GETTIMEFROMDATECODE", ref param);
+            oYear = param[2];
+            oMonth = param[3];
+            oDay = param[4];
+            oDate = param[5];
+        }
+
         /// <summary>
         /// 获取十六进制字节数组
         /// </summary>
@@ -81,7 +95,7 @@ namespace UAS_LabelMachine.PublicMethod
         /// <param name="iInoutno"></param>
         public static bool CheckUploadData(string iInoutno, int iUploadNum)
         {
-            DataTable dt = (DataTable)adh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifmodify,pib_ifupload,pib_ifpick,pib_ifprint,pib_ifrecheck from prodiobarcode where pib_inoutno='" + iInoutno + "'   ", "select");
+            DataTable dt = (DataTable)adh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifmodify,pib_ifupload,pib_ifpick,pib_ifprint,pib_ifrecheck,pib_year,pib_month,pib_day from prodiobarcode where pib_inoutno='" + iInoutno + "'   ", "select");
             DataTable upload = BaseUtil.filterDataTable(dt, "pib_ifupload=0 and pib_ifrecheck=-1");
             DataTable unupload = BaseUtil.filterDataTable(dt, "pib_ifpick=0");
             //如果本地需要上传的数据已经达到了需要上传的条数或者已经采集完了最后一条数据
@@ -107,7 +121,7 @@ namespace UAS_LabelMachine.PublicMethod
         /// <param name="iInoutno"></param>
         public static bool CheckUploadData(string iInoutno)
         {
-            DataTable dt = (DataTable)adh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifmodify,-1 as pib_ifupload,pib_ifpick,pib_ifprint,pib_ifrecheck from prodiobarcode where pib_inoutno='" + iInoutno + "' and pib_ifupload=0 and pib_ifrecheck=-1  ", "select");
+            DataTable dt = (DataTable)adh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifmodify,-1 as pib_ifupload,pib_ifpick,pib_ifprint,pib_ifrecheck,pib_year,pib_month,pib_day from prodiobarcode where pib_inoutno='" + iInoutno + "' and pib_ifupload=0 and pib_ifrecheck=-1  ", "select");
             if (dt.Rows.Count > 0)
             {
                 dh.CallProcedure("sp_uploadbarcode", dt);

+ 10 - 1
UAS-出货标签管理(吉利通)/UAS-出货标签管理(吉利通).csproj

@@ -103,7 +103,7 @@
       <EmbedInteropTypes>False</EmbedInteropTypes>
     </Reference>
     <Reference Include="Microsoft.Office.Interop.Access.Dao, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
-      <EmbedInteropTypes>True</EmbedInteropTypes>
+      <EmbedInteropTypes>False</EmbedInteropTypes>
       <HintPath>..\packages\Microsoft.Office.Interop.Access.Dao.15.0.4420.1017\lib\net20\Microsoft.Office.Interop.Access.Dao.dll</HintPath>
       <Private>True</Private>
     </Reference>
@@ -214,6 +214,12 @@
     <Compile Include="CustomControl\SerialPortWithTag.Designer.cs">
       <DependentUpon>SerialPortWithTag.cs</DependentUpon>
     </Compile>
+    <Compile Include="DateCodeSetAndPrint.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DateCodeSetAndPrint.Designer.cs">
+      <DependentUpon>DateCodeSetAndPrint.cs</DependentUpon>
+    </Compile>
     <Compile Include="DbFind.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -336,6 +342,9 @@
     <EmbeddedResource Include="CustomControl\SearchTextBox.resx">
       <DependentUpon>SearchTextBox.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="DateCodeSetAndPrint.resx">
+      <DependentUpon>DateCodeSetAndPrint.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="DbFind.resx">
       <DependentUpon>DbFind.cs</DependentUpon>
     </EmbeddedResource>

Разница между файлами не показана из-за своего большого размера
+ 280 - 196
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs


Разница между файлами не показана из-за своего большого размера
+ 348 - 373
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs


+ 3 - 0
UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx

@@ -144,6 +144,9 @@
   <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pr_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 78 - 24
UAS-出货标签管理(吉利通)/生成条码.Designer.cs

@@ -56,6 +56,9 @@
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_totalqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_restqty1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_restqty2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_restqty3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mid_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mid_num = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -77,7 +80,7 @@
             // 
             this.pi_class_label.AutoSize = true;
             this.pi_class_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_class_label.Location = new System.Drawing.Point(266, 29);
+            this.pi_class_label.Location = new System.Drawing.Point(286, 29);
             this.pi_class_label.Name = "pi_class_label";
             this.pi_class_label.Size = new System.Drawing.Size(74, 21);
             this.pi_class_label.TabIndex = 150;
@@ -87,7 +90,7 @@
             // 
             this.pi_class.AutoSize = true;
             this.pi_class.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_class.Location = new System.Drawing.Point(355, 29);
+            this.pi_class.Location = new System.Drawing.Point(375, 29);
             this.pi_class.Name = "pi_class";
             this.pi_class.Size = new System.Drawing.Size(0, 21);
             this.pi_class.TabIndex = 152;
@@ -96,7 +99,7 @@
             // 
             this.pr_kind_label.AutoSize = true;
             this.pr_kind_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_kind_label.Location = new System.Drawing.Point(476, 29);
+            this.pr_kind_label.Location = new System.Drawing.Point(501, 29);
             this.pr_kind_label.Name = "pr_kind_label";
             this.pr_kind_label.Size = new System.Drawing.Size(74, 21);
             this.pr_kind_label.TabIndex = 156;
@@ -110,7 +113,7 @@
             "单件管控",
             "批管控",
             "全部"});
-            this.pr_kind.Location = new System.Drawing.Point(563, 30);
+            this.pr_kind.Location = new System.Drawing.Point(588, 30);
             this.pr_kind.Name = "pr_kind";
             this.pr_kind.Size = new System.Drawing.Size(121, 20);
             this.pr_kind.TabIndex = 157;
@@ -119,7 +122,7 @@
             // 
             this.MidCapacity_label.AutoSize = true;
             this.MidCapacity_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidCapacity_label.Location = new System.Drawing.Point(703, 29);
+            this.MidCapacity_label.Location = new System.Drawing.Point(754, 29);
             this.MidCapacity_label.Name = "MidCapacity_label";
             this.MidCapacity_label.Size = new System.Drawing.Size(74, 21);
             this.MidCapacity_label.TabIndex = 158;
@@ -128,7 +131,7 @@
             // SetMidCapacity
             // 
             this.SetMidCapacity.Image = ((System.Drawing.Image)(resources.GetObject("SetMidCapacity.Image")));
-            this.SetMidCapacity.Location = new System.Drawing.Point(911, 28);
+            this.SetMidCapacity.Location = new System.Drawing.Point(962, 28);
             this.SetMidCapacity.Name = "SetMidCapacity";
             this.SetMidCapacity.Size = new System.Drawing.Size(50, 23);
             this.SetMidCapacity.TabIndex = 160;
@@ -138,7 +141,7 @@
             // 
             // MidCapacity
             // 
-            this.MidCapacity.Location = new System.Drawing.Point(787, 29);
+            this.MidCapacity.Location = new System.Drawing.Point(838, 29);
             this.MidCapacity.Name = "MidCapacity";
             this.MidCapacity.Negative = false;
             this.MidCapacity.Size = new System.Drawing.Size(121, 21);
@@ -156,7 +159,7 @@
             // GenerateBarCode
             // 
             this.GenerateBarCode.Image = ((System.Drawing.Image)(resources.GetObject("GenerateBarCode.Image")));
-            this.GenerateBarCode.Location = new System.Drawing.Point(442, 78);
+            this.GenerateBarCode.Location = new System.Drawing.Point(517, 78);
             this.GenerateBarCode.Name = "GenerateBarCode";
             this.GenerateBarCode.Size = new System.Drawing.Size(64, 24);
             this.GenerateBarCode.TabIndex = 154;
@@ -167,7 +170,7 @@
             // Screen
             // 
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
-            this.Screen.Location = new System.Drawing.Point(354, 78);
+            this.Screen.Location = new System.Drawing.Point(429, 78);
             this.Screen.Name = "Screen";
             this.Screen.Size = new System.Drawing.Size(64, 24);
             this.Screen.TabIndex = 153;
@@ -197,6 +200,9 @@
             this.pr_unit,
             this.pd_totalqty,
             this.pd_qty,
+            this.pib_restqty1,
+            this.pib_restqty2,
+            this.pib_restqty3,
             this.pr_zxbzs,
             this.mid_qty,
             this.mid_num,
@@ -205,7 +211,7 @@
             this.ProdIoInfDGV.Location = new System.Drawing.Point(0, 125);
             this.ProdIoInfDGV.Name = "ProdIoInfDGV";
             this.ProdIoInfDGV.RowTemplate.Height = 23;
-            this.ProdIoInfDGV.Size = new System.Drawing.Size(1200, 427);
+            this.ProdIoInfDGV.Size = new System.Drawing.Size(1163, 407);
             this.ProdIoInfDGV.TabIndex = 151;
             this.ProdIoInfDGV.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.ProdIoInfDGV_CellEndEdit);
             this.ProdIoInfDGV.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.ProdIoInfDGV_CellPainting);
@@ -226,7 +232,7 @@
             // ResetSerialNum
             // 
             this.ResetSerialNum.Image = ((System.Drawing.Image)(resources.GetObject("ResetSerialNum.Image")));
-            this.ResetSerialNum.Location = new System.Drawing.Point(529, 78);
+            this.ResetSerialNum.Location = new System.Drawing.Point(604, 78);
             this.ResetSerialNum.Name = "ResetSerialNum";
             this.ResetSerialNum.Size = new System.Drawing.Size(64, 24);
             this.ResetSerialNum.TabIndex = 161;
@@ -236,25 +242,27 @@
             // 
             // Choose
             // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.Choose.HeaderText = "勾选";
             this.Choose.Name = "Choose";
-            this.Choose.Width = 60;
+            this.Choose.Width = 35;
             // 
             // pd_orderdetno
             // 
-            this.pd_orderdetno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.pd_orderdetno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_orderdetno.DataPropertyName = "pd_orderdetno";
-            this.pd_orderdetno.HeaderText = "订单序号";
+            this.pd_orderdetno.HeaderText = "pd_orderdetno";
             this.pd_orderdetno.Name = "pd_orderdetno";
-            this.pd_orderdetno.Width = 78;
+            this.pd_orderdetno.Visible = false;
+            this.pd_orderdetno.Width = 108;
             // 
             // pd_pdno
             // 
+            this.pd_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_pdno.DataPropertyName = "pd_pdno";
-            this.pd_pdno.HeaderText = "pd_pdno";
+            this.pd_pdno.HeaderText = "订单序号";
             this.pd_pdno.Name = "pd_pdno";
-            this.pd_pdno.Visible = false;
+            this.pd_pdno.Width = 78;
             // 
             // pr_id
             // 
@@ -272,91 +280,134 @@
             // 
             // pd_prodcode
             // 
+            this.pd_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_prodcode.DataPropertyName = "pd_prodcode";
             this.pd_prodcode.HeaderText = "物料编号";
             this.pd_prodcode.Name = "pd_prodcode";
             this.pd_prodcode.ReadOnly = true;
+            this.pd_prodcode.Width = 78;
             // 
             // pr_detail
             // 
+            this.pr_detail.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_detail.DataPropertyName = "pr_detail";
             this.pr_detail.HeaderText = "物料名称";
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.ReadOnly = true;
+            this.pr_detail.Width = 78;
             // 
             // pd_ordercode
             // 
+            this.pd_ordercode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_ordercode.DataPropertyName = "pd_ordercode";
             this.pd_ordercode.HeaderText = "订单编号";
             this.pd_ordercode.Name = "pd_ordercode";
+            this.pd_ordercode.Width = 78;
             // 
             // pr_spec
             // 
+            this.pr_spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_spec.DataPropertyName = "pr_spec";
             this.pr_spec.HeaderText = "规格描述";
             this.pr_spec.Name = "pr_spec";
             this.pr_spec.ReadOnly = true;
+            this.pr_spec.Width = 78;
             // 
             // pr_brand
             // 
+            this.pr_brand.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_brand.DataPropertyName = "pr_brand";
             this.pr_brand.HeaderText = "品牌";
             this.pr_brand.Name = "pr_brand";
             this.pr_brand.ReadOnly = true;
-            this.pr_brand.Width = 80;
+            this.pr_brand.Width = 54;
             // 
             // pr_unit
             // 
+            this.pr_unit.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_unit.DataPropertyName = "pr_unit";
             this.pr_unit.HeaderText = "单位";
             this.pr_unit.Name = "pr_unit";
             this.pr_unit.ReadOnly = true;
-            this.pr_unit.Width = 80;
+            this.pr_unit.Width = 54;
             // 
             // pd_totalqty
             // 
+            this.pd_totalqty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_totalqty.DataPropertyName = "pd_totalqty";
             this.pd_totalqty.HeaderText = "总数";
             this.pd_totalqty.Name = "pd_totalqty";
             this.pd_totalqty.ReadOnly = true;
-            this.pd_totalqty.Width = 80;
+            this.pd_totalqty.Width = 54;
             // 
             // pd_qty
             // 
+            this.pd_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_qty.DataPropertyName = "pd_qty";
             this.pd_qty.HeaderText = "本次数量";
             this.pd_qty.Name = "pd_qty";
+            this.pd_qty.Width = 78;
+            // 
+            // pib_restqty1
+            // 
+            this.pib_restqty1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty1.DataPropertyName = "pib_restqty1";
+            this.pib_restqty1.HeaderText = "尾数1";
+            this.pib_restqty1.Name = "pib_restqty1";
+            this.pib_restqty1.Width = 60;
+            // 
+            // pib_restqty2
+            // 
+            this.pib_restqty2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty2.DataPropertyName = "pib_restqty2";
+            this.pib_restqty2.HeaderText = "尾数2";
+            this.pib_restqty2.Name = "pib_restqty2";
+            this.pib_restqty2.Width = 60;
+            // 
+            // pib_restqty3
+            // 
+            this.pib_restqty3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty3.DataPropertyName = "pib_restqty3";
+            this.pib_restqty3.HeaderText = "尾数3";
+            this.pib_restqty3.Name = "pib_restqty3";
+            this.pib_restqty3.Width = 60;
             // 
             // pr_zxbzs
             // 
+            this.pr_zxbzs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
             this.pr_zxbzs.HeaderText = "单盘数量";
             this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Width = 78;
             // 
             // mid_qty
             // 
-            this.mid_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.mid_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_qty.HeaderText = "中盒容量(盘)";
             this.mid_qty.Name = "mid_qty";
-            this.mid_qty.Width = 140;
+            this.mid_qty.Width = 72;
             // 
             // mid_num
             // 
+            this.mid_num.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_num.HeaderText = "中盒盘数";
             this.mid_num.Name = "mid_num";
             this.mid_num.ReadOnly = true;
+            this.mid_num.Width = 61;
             // 
             // mid_remain
             // 
+            this.mid_remain.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_remain.HeaderText = "中盒尾数";
             this.mid_remain.Name = "mid_remain";
             this.mid_remain.ReadOnly = true;
+            this.mid_remain.Width = 61;
             // 
             // 生成条码
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1201, 554);
+            this.ClientSize = new System.Drawing.Size(1164, 530);
             this.Controls.Add(this.ResetSerialNum);
             this.Controls.Add(this.SetMidCapacity);
             this.Controls.Add(this.MidCapacity);
@@ -410,6 +461,9 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_totalqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_qty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty3;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn mid_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn mid_num;

+ 80 - 20
UAS-出货标签管理(吉利通)/生成条码.cs

@@ -90,11 +90,15 @@ namespace UAS_LabelMachine
         private void GenerateBarCode_Click(object sender, EventArgs e)
         {
             //获取编码规则
-            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + CustCode + "' order by nrd_detno", "select");
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + CustCode + "' order by nrd_detno", "select");
             //如果没有则取公共规则
             if (Nr.Rows.Count == 0)
-                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
             //用于过滤参数的正则表达式
+            if (Nr.Rows.Count > 0)
+            {
+                NrCode = Nr.Rows[0]["nr_code"].ToString();
+            }
             Regex match = new Regex("{\\w+}");
             //用于存放每一项的明细的数据
             string[] NrData = new string[Nr.Rows.Count];
@@ -147,7 +151,7 @@ namespace UAS_LabelMachine
                         break;
                     //流水需要通过MaxNumber去取
                     case "流水":
-                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + CustCode + "'").ToString();
+                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
                         Suffix = "";
                         PrefixFixed = Prefix;
                         //设置当前流水
@@ -216,6 +220,36 @@ namespace UAS_LabelMachine
                     ArrayList<string> midcode = new ArrayList<string>();
                     ArrayList<string> barcode = new ArrayList<string>();
                     ArrayList<string> custbarcode = new ArrayList<string>();
+                    int restqty1 = 0;
+                    int restqty2 = 0;
+                    int restqty3 = 0;
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty1.ToString());
+                    }
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty2.ToString());
+                    }
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty3.ToString());
+                    }
                     //循环中盒号的个数,取当前出入库单最大 的中盒号+1
                     for (int j = 0; j < mid_num; j++)
                     {
@@ -350,7 +384,7 @@ namespace UAS_LabelMachine
         {
             bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
             if (e.ColumnIndex > 0)
-                if (ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pr_zxbzs" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pd_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "mid_qty")
+                if (ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pr_zxbzs" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pd_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "mid_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty1" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty2" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty3")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
                     e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
@@ -373,6 +407,21 @@ namespace UAS_LabelMachine
             object pd_qty = ProdIoInfDGV.Rows[e.RowIndex].Cells["pd_qty"].Value;
             object mid_qty = ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_qty"].Value;
             object pd_totalqty = ProdIoInfDGV.Rows[e.RowIndex].Cells["pd_totalqty"].Value;
+            int restqty1 = 0;
+            int restqty2 = 0;
+            int restqty3 = 0;
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty1"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+            }
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty2"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+            }
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty3"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+            }
             if (pr_zxbzs != null && pd_qty != null && mid_qty != null)
             {
                 int 最小包装量 = int.Parse(pr_zxbzs.ToString());
@@ -392,22 +441,37 @@ namespace UAS_LabelMachine
                         return;
                     }
                     //计算中盘数量
-                    int mid_num = 本次数量 / (最小包装量 * 中盘容量);
+                    int mid_num = (本次数量 - restqty1 - restqty2 - restqty3) / (最小包装量 * 中盘容量);
                     //计算中盘尾数
-                    if (本次数量 % (最小包装量 * 中盘容量) == 0)
+                    if (((本次数量 - restqty1 - restqty2 - restqty3)) % (最小包装量 * 中盘容量) == 0)
                         ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_num"].Value = mid_num;
                     else
                         ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_num"].Value = mid_num + 1;
-                    ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_remain"].Value = 本次数量 - mid_num * 最小包装量 * 中盘容量;
+                    ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_remain"].Value = 本次数量 - restqty1 - restqty2 - restqty3 - mid_num * 最小包装量 * 中盘容量;
                 }
             }
         }
-
+   
         //设置全部中盒容量
         private void SetMidCapacity_Click(object sender, EventArgs e)
         {
             for (int i = 0; i < ProdIoInfDGV.Rows.Count; i++)
             {
+                int restqty1 = 0;
+                int restqty2 = 0;
+                int restqty3 = 0;
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+                }
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+                }
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+                }
                 ProdIoInfDGV.Rows[i].Cells["mid_qty"].Value = MidCapacity.Text;
                 if (ProdIoInfDGV.Rows[i].Cells["pr_zxbzs"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["pd_qty"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["mid_qty"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["pr_zxbzs"].Value.ToString() != "0")
                 {
@@ -422,13 +486,13 @@ namespace UAS_LabelMachine
                         int 本次数量 = int.Parse(pd_qty.ToString());
                         int 总数 = int.Parse(pd_totalqty.ToString());
                         //计算中盘数量
-                        int mid_num = 本次数量 / (最小包装量 * 中盘容量);
+                        int mid_num = (本次数量 - restqty1 - restqty2 - restqty3) / (最小包装量 * 中盘容量);
                         //计算中盘尾数
-                        if (本次数量 % (最小包装量 * 中盘容量) == 0)
+                        if (((本次数量 - restqty1 - restqty2 - restqty3)) % (最小包装量 * 中盘容量) == 0)
                             ProdIoInfDGV.Rows[i].Cells["mid_num"].Value = mid_num;
                         else
                             ProdIoInfDGV.Rows[i].Cells["mid_num"].Value = mid_num + 1;
-                        ProdIoInfDGV.Rows[i].Cells["mid_remain"].Value = 本次数量 - mid_num * 最小包装量 * 中盘容量;
+                        ProdIoInfDGV.Rows[i].Cells["mid_remain"].Value = (本次数量 - restqty1 - restqty2 - restqty3) - mid_num * 最小包装量 * 中盘容量;
                     }
                 }
             }
@@ -438,8 +502,6 @@ namespace UAS_LabelMachine
         {
             //获取客户编号
             CustCode = dh.getFieldDataByCondition("ProdInOut", "pi_cardcode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
-            //获取编码规则编号
-            NrCode = dh.getFieldDataByCondition("NoRule", "nr_code", "nr_custcode='" + CustCode + "'").ToString();
             //用于存放每一项的明细的数据
             dt = (DataTable)dh.ExecuteSql("select pi_class,pi_id from prodinout where pi_inoutno='" + pi_inoutno.Text + "'", "select");
             if (dt.Rows.Count > 0)
@@ -449,13 +511,11 @@ namespace UAS_LabelMachine
                 //查询出入库的类型
                 dt = (DataTable)dh.ExecuteSql("select ds_inorout from documentsetup where ds_name='" + pi_class.Text + "'", "select");
                 sql.Clear();
-                sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,pd_qty from (select ");
-                sql.Append("pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
-                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_ordercode=pd_ordercode ");
-                sql.Append("and pib_orderdetno=pd_orderdetno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty,");
-                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
-                sql.Append("from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T left join product on pr_code=pd_prodcode ");
-                sql.Append("where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
+                sql.Append("select 0 pib_restqty1,0 pib_restqty2,0 pib_restqty3,pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno, ");
+                sql.Append("pd_prodcode,pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
+                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_pdno=pd_pdno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty, ");
+                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T ");
+                sql.Append("left join product on pr_code=pd_prodcode where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
             }

+ 9 - 0
UAS-出货标签管理(吉利通)/生成条码.resx

@@ -193,6 +193,15 @@
   <metadata name="pd_qty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pib_restqty1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pib_restqty2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pib_restqty3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 4 - 4
UAS-出货标签管理(吉利通)/采集策略_NEW.Designer.cs

@@ -71,8 +71,8 @@
             this.Brand = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.ButtonSaveScanGroup = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.si_expression4 = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
-            this.si_expression3 = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
+            this.si_expression4 = new System.Windows.Forms.RichTextBox();
+            this.si_expression3 = new System.Windows.Forms.RichTextBox();
             this.sg_script = new System.Windows.Forms.RichTextBox();
             this.AddNew = new UAS_LabelMachine.CustomControl.NormalButton();
             ((System.ComponentModel.ISupportInitialize)(this.sg_step)).BeginInit();
@@ -617,10 +617,10 @@
         private System.Windows.Forms.RichTextBox sg_script;
         private System.Windows.Forms.Label label13;
         private System.Windows.Forms.Label ScanGroupName_label;
-        private CustomControl.RichText.RichTextAutoBottom si_expression3;
+        private System.Windows.Forms.RichTextBox si_expression3;
         private System.Windows.Forms.Label PNScript_label;
         private System.Windows.Forms.Label DateCodeScript_label;
-        private CustomControl.RichText.RichTextAutoBottom si_expression4;
+        private System.Windows.Forms.RichTextBox si_expression4;
         private System.Windows.Forms.TextBox sg_name;
         private System.Windows.Forms.NumericUpDown sg_step;
         private System.Windows.Forms.Label ScanStep_label;

Некоторые файлы не были показаны из-за большого количества измененных файлов