Browse Source

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

Hcsy 7 years ago
parent
commit
072d3797d0

+ 64 - 64
UAS-MES/CustomControl/HeadBar/PDFOperater.cs

@@ -6,84 +6,84 @@ using System.Data;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
-using O2S.Components.PDFView4NET;
+
 using UAS_MES.PublicMethod;
-using O2S.Components.PDFView4NET.Text;
+
 
 namespace UAS_MES.CustomControl
 {
     public partial class PDFOperater : UserControl
     {
-        private PDFPageView PageView1;
+        //private PDFPageView PageView1;
 
-        public PDFPageView PageView
-        {
-            get
-            {
-                return PageView1;
-            }
+        //public PDFPageView PageView
+        //{
+        //    get
+        //    {
+        //        return PageView1;
+        //    }
 
-            set
-            {
-                PageView1 = value;
-            }
-        }
+        //    set
+        //    {
+        //        PageView1 = value;
+        //    }
+        //}
 
-        public PDFOperater()
-        {
-            InitializeComponent();
-            for (int i = 1; i <= 20; i++)
-            {
-                ZoomComBox.Items.Add(i * 10);
-            }
-        }
+        //public PDFOperater()
+        //{
+        //    InitializeComponent();
+        //    for (int i = 1; i <= 20; i++)
+        //    {
+        //        ZoomComBox.Items.Add(i * 10);
+        //    }
+        //}
 
-        private void PDFOperater_Load(object sender, EventArgs e)
-        {
-            PageView1.Zoom = double.Parse(ZoomComBox.Text);
-        }
+        //private void PDFOperater_Load(object sender, EventArgs e)
+        //{
+        //    PageView1.Zoom = double.Parse(ZoomComBox.Text);
+        //}
 
-        private void ZoomComBox_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            PageView1.Zoom = double.Parse(ZoomComBox.Text);
-        }
+        //private void ZoomComBox_SelectedIndexChanged(object sender, EventArgs e)
+        //{
+        //    PageView1.Zoom = double.Parse(ZoomComBox.Text);
+        //}
 
-        private void ZoomComBox_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                PageView1.Zoom = double.Parse(ZoomComBox.Text);
-            }
-        }
+        //private void ZoomComBox_KeyDown(object sender, KeyEventArgs e)
+        //{
+        //    if (e.KeyCode == Keys.Enter)
+        //    {
+        //        PageView1.Zoom = double.Parse(ZoomComBox.Text);
+        //    }
+        //}
 
-        private void ScrollSpan_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                ScrollTimer.Interval = int.Parse(ScrollSpan.Text) * 1000;
-                ScrollTimer.Start();
-                BaseUtil.SetCacheData("ScrollSpan", ScrollSpan.Text);
-            }
-        }
+        //private void ScrollSpan_KeyDown(object sender, KeyEventArgs e)
+        //{
+        //    if (e.KeyCode == Keys.Enter)
+        //    {
+        //        ScrollTimer.Interval = int.Parse(ScrollSpan.Text) * 1000;
+        //        ScrollTimer.Start();
+        //        BaseUtil.SetCacheData("ScrollSpan", ScrollSpan.Text);
+        //    }
+        //}
 
-        private void ScrollTimer_Tick(object sender, EventArgs e)
-        {
-            if (PageView1.Document.PageCount - 1 == PageView1.PageNumber)
-            {
-                PageView1.GoToFirstPage();
-            }
-            else
-            {
-                PageView1.GoToNextPage();
-            }
-        }
+        //private void ScrollTimer_Tick(object sender, EventArgs e)
+        //{
+        //    if (PageView1.Document.PageCount - 1 == PageView1.PageNumber)
+        //    {
+        //        PageView1.GoToFirstPage();
+        //    }
+        //    else
+        //    {
+        //        PageView1.GoToNextPage();
+        //    }
+        //}
 
-        private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                PageView1.SearchText(KeyWord.Text, PDFHighlightSearchResultsMode.AllResults);
-            }
-        }
+        //private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
+        //{
+        //    if (e.KeyCode == Keys.Enter)
+        //    {
+        //        PageView1.SearchText(KeyWord.Text, PDFHighlightSearchResultsMode.AllResults);
+        //    }
+        //}
     }
 }

+ 48 - 45
UAS-MES/UAS-MES.csproj

@@ -38,11 +38,11 @@
     <ProductName>优软MES系统</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>优软MES系统</SuiteName>
-    <MinimumRequiredVersion>1.0.0.536</MinimumRequiredVersion>
+    <MinimumRequiredVersion>1.0.0.603</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>537</ApplicationRevision>
+    <ApplicationRevision>604</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -137,12 +137,6 @@
     <Reference Include="NPOI">
       <HintPath>Tool\NPOI.dll</HintPath>
     </Reference>
-    <Reference Include="O2S.Components.PDF4NET">
-      <HintPath>Tool\O2S.Components.PDF4NET.dll</HintPath>
-    </Reference>
-    <Reference Include="O2S.Components.PDFView4NET">
-      <HintPath>Tool\O2S.Components.PDFView4NET.dll</HintPath>
-    </Reference>
     <Reference Include="Oracle.ManagedDataAccess">
       <HintPath>Tool\Oracle.ManagedDataAccess.dll</HintPath>
     </Reference>
@@ -298,12 +292,6 @@
     <Compile Include="CustomControl\HeadBar\HeadBar.Designer.cs">
       <DependentUpon>HeadBar.cs</DependentUpon>
     </Compile>
-    <Compile Include="CustomControl\HeadBar\PDFOperater.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="CustomControl\HeadBar\PDFOperater.Designer.cs">
-      <DependentUpon>PDFOperater.cs</DependentUpon>
-    </Compile>
     <Compile Include="CustomControl\ListViewExpand\ListViewExpand.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -611,18 +599,36 @@
     <Compile Include="FunctionCode\Make\Make_SeqProgramTransform.Designer.cs">
       <DependentUpon>Make_SeqProgramTransform.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_SmtTestCollection.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_SmtTestCollection.Designer.cs">
+      <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_SpecialCartonPack.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="FunctionCode\Make\Make_SpecialCartonPack.Designer.cs">
       <DependentUpon>Make_SpecialCartonPack.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_SpiTestCollection.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_SpiTestCollection.Designer.cs">
+      <DependentUpon>Make_SpiTestCollection.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_UpdateCollectCode.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="FunctionCode\Make\Make_UpdateCollectCode.Designer.cs">
       <DependentUpon>Make_UpdateCollectCode.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_XrayTestCollection.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_XrayTestCollection.Designer.cs">
+      <DependentUpon>Make_XrayTestCollection.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\OQC\OQC_CheckNoSplit.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -653,29 +659,17 @@
     <Compile Include="FunctionCode\Query\Query_MakeInf.Designer.cs">
       <DependentUpon>Query_MakeInf.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Query\Query_OperationInstruction.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Query\Query_OperationInstruction.Designer.cs">
-      <DependentUpon>Query_OperationInstruction.cs</DependentUpon>
-    </Compile>
-    <Compile Include="FunctionCode\Query\Query_ShowPDF.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Query\Query_ShowPDF.Designer.cs">
-      <DependentUpon>Query_ShowPDF.cs</DependentUpon>
-    </Compile>
-    <Compile Include="FunctionCode\Query\Query_ShowPicture.cs">
+    <Compile Include="FunctionCode\Query\Query_SnMessage.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="FunctionCode\Query\Query_ShowPicture.Designer.cs">
-      <DependentUpon>Query_ShowPicture.cs</DependentUpon>
+    <Compile Include="FunctionCode\Query\Query_SnMessage.Designer.cs">
+      <DependentUpon>Query_SnMessage.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Query\Query_SpecialReport.cs">
+    <Compile Include="FunctionCode\Special\Special_CancelProdinout.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="FunctionCode\Query\Query_SpecialReport.Designer.cs">
-      <DependentUpon>Query_SpecialReport.cs</DependentUpon>
+    <Compile Include="FunctionCode\Special\Special_CancelProdinout.Designer.cs">
+      <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </Compile>
     <Compile Include="FunctionCode\Special\Special_MendLabel.cs">
       <SubType>Form</SubType>
@@ -701,6 +695,12 @@
     <Compile Include="FunctionCode\Warehouse\Warehouse_ProductMakeIn.Designer.cs">
       <DependentUpon>Warehouse_ProductMakeIn.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Warehouse\Warehouse_ProductMakeInTest.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Warehouse\Warehouse_ProductMakeInTest.Designer.cs">
+      <DependentUpon>Warehouse_ProductMakeInTest.cs</DependentUpon>
+    </Compile>
     <Compile Include="Login.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1085,9 +1085,6 @@
     <EmbeddedResource Include="CustomControl\HeadBar\HeadBar.zu.resx">
       <DependentUpon>HeadBar.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="CustomControl\HeadBar\PDFOperater.resx">
-      <DependentUpon>PDFOperater.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\Pagination\Pagination.resx">
       <DependentUpon>Pagination.cs</DependentUpon>
     </EmbeddedResource>
@@ -1214,12 +1211,21 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_SeqProgramTransform.resx">
       <DependentUpon>Make_SeqProgramTransform.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_SmtTestCollection.resx">
+      <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_SpecialCartonPack.resx">
       <DependentUpon>Make_SpecialCartonPack.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_SpiTestCollection.resx">
+      <DependentUpon>Make_SpiTestCollection.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_UpdateCollectCode.resx">
       <DependentUpon>Make_UpdateCollectCode.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_XrayTestCollection.resx">
+      <DependentUpon>Make_XrayTestCollection.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\OQC\OQC_CheckNoSplit.resx">
       <DependentUpon>OQC_CheckNoSplit.cs</DependentUpon>
     </EmbeddedResource>
@@ -1235,17 +1241,11 @@
     <EmbeddedResource Include="FunctionCode\Query\Query_MakeInf.resx">
       <DependentUpon>Query_MakeInf.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Query\Query_OperationInstruction.resx">
-      <DependentUpon>Query_OperationInstruction.cs</DependentUpon>
+    <EmbeddedResource Include="FunctionCode\Query\Query_SnMessage.resx">
+      <DependentUpon>Query_SnMessage.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Query\Query_ShowPDF.resx">
-      <DependentUpon>Query_ShowPDF.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Query\Query_ShowPicture.resx">
-      <DependentUpon>Query_ShowPicture.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Query\Query_SpecialReport.resx">
-      <DependentUpon>Query_SpecialReport.cs</DependentUpon>
+    <EmbeddedResource Include="FunctionCode\Special\Special_CancelProdinout.resx">
+      <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_MendLabel.resx">
       <DependentUpon>Special_MendLabel.cs</DependentUpon>
@@ -1256,6 +1256,9 @@
     <EmbeddedResource Include="FunctionCode\Warehouse\Warehouse_ProductMakeIn.resx">
       <DependentUpon>Warehouse_ProductMakeIn.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Warehouse\Warehouse_ProductMakeInTest.resx">
+      <DependentUpon>Warehouse_ProductMakeInTest.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Login.resx">
       <DependentUpon>Login.cs</DependentUpon>
     </EmbeddedResource>

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

@@ -29,6 +29,20 @@ namespace UAS_LabelMachine
             }
         }
 
+        public static string GetDataSQL(DataTable dt)
+        {
+            string sql = "";
+            sql += ("select * from ");
+            for (int j = 0; j < dt.Rows.Count; j++)
+            {
+                if (j != dt.Rows.Count - 1)
+                    sql += ("(" + dt.Rows[j]["lp_sql"].ToString() + "),");
+                else
+                    sql += ("(" + dt.Rows[j]["lp_sql"].ToString() + ")");
+            }
+            return sql;
+        }
+
         public static string DToAny(double DB, int Type)
         {
             string H = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

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

@@ -28,7 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
@@ -39,8 +38,6 @@
             this.后端复核 = new System.Windows.Forms.Label();
             this.CollectionUnit = new System.Windows.Forms.ComboBox();
             this.CollectionUnit_label = new System.Windows.Forms.Label();
-            this.GenerateBarCode = new System.Windows.Forms.Button();
-            this.SaveGrid = new System.Windows.Forms.Button();
             this.sg_separator_label = new System.Windows.Forms.Label();
             this.Si_ItemDGV = new System.Windows.Forms.DataGridView();
             this.si_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -51,14 +48,13 @@
             this.si_expression = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.si_item = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.si_expressionitem = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.CleanDetail = new System.Windows.Forms.Button();
             this.pib_id = new System.Windows.Forms.Label();
             this.pi_cardcode = new System.Windows.Forms.Label();
             this.pi_cardcode_label = new System.Windows.Forms.Label();
             this.Fresh = new System.Windows.Forms.LinkLabel();
             this.label3 = new System.Windows.Forms.Label();
             this.AllCollected = new System.Windows.Forms.Button();
-            this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
+            this.RefreshDBConnect = new System.Windows.Forms.Timer();
             this.GetGridOnly = new System.Windows.Forms.CheckBox();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -86,11 +82,10 @@
             this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.MidSource = new System.Windows.Forms.BindingSource(this.components);
+            this.MidSource = new System.Windows.Forms.BindingSource();
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             this.pi_date = new System.Windows.Forms.Label();
-            this.CleanBarCode = new System.Windows.Forms.Button();
             this.ListButtonMenu = new System.Windows.Forms.ListBox();
             this.ButtonSetting = new System.Windows.Forms.Button();
             this.FrontendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
@@ -104,7 +99,6 @@
             this.SingleBoxBegin = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label12 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
-            this.pr_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.CollectionProcess = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.Capacity = new System.Windows.Forms.Label();
             this.Process_midboxcode = new System.Windows.Forms.Label();
@@ -287,30 +281,6 @@
             this.CollectionUnit_label.TabIndex = 56;
             this.CollectionUnit_label.Text = "采集单位";
             // 
-            // GenerateBarCode
-            // 
-            this.GenerateBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GenerateBarCode.Location = new System.Drawing.Point(448, 178);
-            this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.GenerateBarCode.Name = "GenerateBarCode";
-            this.GenerateBarCode.Size = new System.Drawing.Size(68, 26);
-            this.GenerateBarCode.TabIndex = 41;
-            this.GenerateBarCode.Text = "生成条码";
-            this.GenerateBarCode.UseVisualStyleBackColor = true;
-            this.GenerateBarCode.Click += new System.EventHandler(this.GenerateBarCode_Click);
-            // 
-            // SaveGrid
-            // 
-            this.SaveGrid.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SaveGrid.Location = new System.Drawing.Point(448, 216);
-            this.SaveGrid.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.SaveGrid.Name = "SaveGrid";
-            this.SaveGrid.Size = new System.Drawing.Size(68, 26);
-            this.SaveGrid.TabIndex = 59;
-            this.SaveGrid.Text = "保存明细";
-            this.SaveGrid.UseVisualStyleBackColor = true;
-            this.SaveGrid.Click += new System.EventHandler(this.SaveGrid_Click);
-            // 
             // sg_separator_label
             // 
             this.sg_separator_label.AutoSize = true;
@@ -405,18 +375,6 @@
             this.si_expressionitem.Name = "si_expressionitem";
             this.si_expressionitem.Visible = false;
             // 
-            // CleanDetail
-            // 
-            this.CleanDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanDetail.Location = new System.Drawing.Point(374, 216);
-            this.CleanDetail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CleanDetail.Name = "CleanDetail";
-            this.CleanDetail.Size = new System.Drawing.Size(68, 26);
-            this.CleanDetail.TabIndex = 66;
-            this.CleanDetail.Text = "清除明细";
-            this.CleanDetail.UseVisualStyleBackColor = true;
-            this.CleanDetail.Click += new System.EventHandler(this.CleanDetail_Click);
-            // 
             // pib_id
             // 
             this.pib_id.AutoSize = true;
@@ -470,7 +428,7 @@
             // AllCollected
             // 
             this.AllCollected.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllCollected.Location = new System.Drawing.Point(522, 216);
+            this.AllCollected.Location = new System.Drawing.Point(282, 222);
             this.AllCollected.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AllCollected.Name = "AllCollected";
             this.AllCollected.Size = new System.Drawing.Size(68, 26);
@@ -722,18 +680,6 @@
             this.pi_date.TabIndex = 86;
             this.pi_date.Visible = false;
             // 
-            // CleanBarCode
-            // 
-            this.CleanBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanBarCode.Location = new System.Drawing.Point(522, 178);
-            this.CleanBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CleanBarCode.Name = "CleanBarCode";
-            this.CleanBarCode.Size = new System.Drawing.Size(68, 26);
-            this.CleanBarCode.TabIndex = 87;
-            this.CleanBarCode.Text = "清空条码";
-            this.CleanBarCode.UseVisualStyleBackColor = true;
-            this.CleanBarCode.Click += new System.EventHandler(this.CleanBarCode_Click);
-            // 
             // ListButtonMenu
             // 
             this.ListButtonMenu.Font = new System.Drawing.Font("微软雅黑", 11F);
@@ -886,28 +832,6 @@
             this.label7.TabIndex = 76;
             this.label7.Text = "单盘范围";
             // 
-            // pr_code
-            // 
-            this.pr_code.AllPower = null;
-            this.pr_code.Caller = null;
-            this.pr_code.Condition = null;
-            this.pr_code.DBTitle = null;
-            this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(290, 102);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.Power = null;
-            this.pr_code.ReturnData = null;
-            this.pr_code.SelectField = null;
-            this.pr_code.SetValueField = null;
-            this.pr_code.Size = new System.Drawing.Size(149, 22);
-            this.pr_code.TabIndex = 68;
-            this.pr_code.TableName = null;
-            this.pr_code.TextBoxEnable = false;
-            this.pr_code.Visible = false;
-            this.pr_code.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.pr_code_UserControlTextChanged);
-            this.pr_code.SearchIconClick += new UAS_LabelMachine.CustomControl.SearchTextBox.Icon_Click(this.pr_code_SearchIconClick);
-            // 
             // CollectionProcess
             // 
             this.CollectionProcess.Controls.Add(this.Capacity);
@@ -1098,7 +1022,6 @@
             this.sg_code.TabIndex = 32;
             this.sg_code.TableName = null;
             this.sg_code.TextBoxEnable = false;
-            this.sg_code.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.sg_code_UserControlTextChanged);
             // 
             // MessageLog
             // 
@@ -1721,7 +1644,6 @@
             this.Controls.Add(this.FrontCollect);
             this.Controls.Add(this.ButtonSetting);
             this.Controls.Add(this.ListButtonMenu);
-            this.Controls.Add(this.CleanBarCode);
             this.Controls.Add(this.pi_date);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.ChooseAll);
@@ -1731,14 +1653,10 @@
             this.Controls.Add(this.pi_cardcode_label);
             this.Controls.Add(this.pi_cardcode);
             this.Controls.Add(this.pib_id);
-            this.Controls.Add(this.pr_code);
-            this.Controls.Add(this.CleanDetail);
             this.Controls.Add(this.Si_ItemDGV);
             this.Controls.Add(this.CollectionProcess);
             this.Controls.Add(this.sg_separator);
             this.Controls.Add(this.sg_separator_label);
-            this.Controls.Add(this.SaveGrid);
-            this.Controls.Add(this.GenerateBarCode);
             this.Controls.Add(this.CollectionUnit_label);
             this.Controls.Add(this.CollectionUnit);
             this.Controls.Add(this.后端复核);
@@ -1844,8 +1762,6 @@
         private System.Windows.Forms.Label 后端复核;
         private System.Windows.Forms.ComboBox CollectionUnit;
         private System.Windows.Forms.Label CollectionUnit_label;
-        private System.Windows.Forms.Button GenerateBarCode;
-        private System.Windows.Forms.Button SaveGrid;
         private System.Windows.Forms.Label sg_separator_label;
         private CustomControl.EnterTextBox sg_separator;
         private System.Windows.Forms.Label Process;
@@ -1858,9 +1774,7 @@
         private System.Windows.Forms.Label TotalCount;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder CollectionProcess;
         private System.Windows.Forms.DataGridView Si_ItemDGV;
-        private System.Windows.Forms.Button CleanDetail;
         private CustomControl.SearchTextBox sg_code;
-        private CustomControl.SearchTextBox pr_code;
         private System.Windows.Forms.Label pib_id;
         private System.Windows.Forms.Label Process_midboxcode;
         private System.Windows.Forms.Label Process_outboxcode;
@@ -1903,7 +1817,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn si_item;
         private System.Windows.Forms.DataGridViewTextBoxColumn si_expressionitem;
         private System.Windows.Forms.Label pi_date;
-        private System.Windows.Forms.Button CleanBarCode;
         private System.Windows.Forms.ListBox ListButtonMenu;
         private System.Windows.Forms.Button ButtonSetting;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;

+ 23 - 512
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -62,10 +62,6 @@ namespace UAS_LabelMachine
         string Brand;
         string PI_ID;
         /// <summary>
-        /// 当前扫描的项目
-        /// </summary>
-        int CurrentItemIndex = 0;
-        /// <summary>
         /// 当前扫描的所在行
         /// </summary>
         int CurrentRowIndex = 0;
@@ -84,15 +80,10 @@ namespace UAS_LabelMachine
 
         bool logout = false;
 
-        //每个不同序号存在的
-        object[] ItemData;
-
         DataTable SingleLabelParam;
         DataTable MidLabelParam;
         DataTable OutLabelParam;
 
-        Dictionary<string, string> CollectData;
-
         /// <summary>
         /// 存放单盘的ID
         /// </summary>
@@ -125,13 +116,10 @@ namespace UAS_LabelMachine
         /// 是否获取过箱号
         /// </summary>
         bool GetPackingCode = false;
-        /*用于存放采集项目的Grid信息*/
-        Dictionary<string, Dictionary<string, string>> SiItem;
+
+        Dictionary<int, string> Si_Item = new Dictionary<int, string>();
         /*需要重绘的Cell*/
         Dictionary<DataGridViewCell, bool> PaintCell = new Dictionary<DataGridViewCell, bool>();
-        //使用二维数组进行排序
-        ArrayList<ArrayList<string>> ScanData;
-        ArrayList<string> GetData;
         /// <summary>
         /// 是否通过选择Combox来改变打开的文件
         /// </summary>
@@ -152,7 +140,7 @@ namespace UAS_LabelMachine
             {
                 base.WndProc(ref m);
             }
-        }
+        }   
 
         private void 贴标机条码打印_Load(object sender, EventArgs e)
         {
@@ -173,10 +161,6 @@ namespace UAS_LabelMachine
             sg_code.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
             sg_code.TableName = "scangroup";
             sg_code.DbChange += Sg_code_DbChange;
-            pr_code.FormName = Name;
-            pr_code.SetValueField = new string[] { "pr_code" };
-            pr_code.TableName = "prodiodetail left join product on pd_prodcode=pr_code";
-            pr_code.SelectField = "pd_pdno # 行号,pr_code # 物料编号";
 
             CollectionUnit.Text = "盘";
             Point pt = new Point();
@@ -275,15 +259,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void GenerateBarCode_Click(object sender, EventArgs e)
-        {
-            LogicHandler.CheckUoloadData(pi_inoutno.Text, UploadNum);
-            //生成条码 form = new 生成条码(pi_inoutno.Text);
-            //form.FormClosed += LoadGridData;
-            //BaseUtil.SetFormCenter(form);
-            //form.ShowDialog();
-        }
-
         private void LabelMaintain_Click(object sender, EventArgs e)
         {
             客户标签维护 form = new 客户标签维护();
@@ -310,73 +285,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        /// <summary>
-        /// 保存明细
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void SaveGrid_Click(object sender, EventArgs e)
-        {
-            DataTable savedt = (LabelInf.DataSource as DataTable);
-            if (savedt != null && savedt.GetChanges() != null)
-            {
-                MidSource.EndEdit();
-                dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
-                MessageBox.Show("保存成功!");
-            }
-        }
-
-        //放大镜选择后出发的事件
-        private void sg_code_UserControlTextChanged(object sender, EventArgs e)
-        {
-            //取已启用的的按照采集次序排序
-            dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
-            BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
-            if (dt.Rows.Count > 0)
-            {
-                sg_separator.Text = dt.Rows[0]["sg_separator"].ToString();
-            }
-            //按DetNo排列之后的采集项
-            ScanData = new ArrayList<ArrayList<string>>();
-            //每个采集项目的子项
-            GetData = new ArrayList<string>();
-            //将数据添加进一个List的二维数组中
-            for (int i = 0; i < Si_ItemDGV.RowCount; i++)
-            {
-                //如果不包含这个则添加进数组
-                if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
-                }
-                //如果和后一个的采集次序相同
-                if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
-                }
-                else
-                {
-                    ScanData.Add(GetData);
-                    //添加完一次数据需要一个新的List
-                    GetData = new ArrayList<string>();
-                }
-            }
-            RemindUser();
-            if (ScanData.ToArray().Length > 0)
-            {
-                object[] arr = (ScanData.ToArray()[0] as ArrayList<string>).ToArray();
-                if (arr.Contains("MPN"))
-                {
-                    AutoMatch.CheckState = CheckState.Checked;
-                    AutoMatch.Enabled = true;
-                }
-                else
-                {
-                    AutoMatch.CheckState = CheckState.Unchecked;
-                    AutoMatch.Enabled = false;
-                }
-            }
-        }
-
         //输入框Enter事件
         private void Input_KeyDown(object sender, KeyEventArgs e)
         {
@@ -396,133 +304,12 @@ namespace UAS_LabelMachine
             }
         }
 
-        /// <summary>
-        /// 设置自动匹配的数据的行号
-        /// </summary>
-        /// <returns></returns>
-        private void SetAutoMatchRow()
-        {
-            //采集策略的第一组数据
-            string[] arr = new string[ItemData.Length];
-            if (sg_separator.Text == "")
-            {
-                for (int i = 0; i < arr.Length; i++)
-                {
-                    arr[i] = BackCheck.Text;
-                }
-            }
-            else
-            {
-                arr = BackCheck.Text.Split(sg_separator.Text.ToCharArray()).ToArray();
-            }
-            bool FindAutoMatch = false;
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                for (int j = 0; j < arr.Length; j++)
-                {
-                    if (LabelInf.Rows[i].Cells["pr_vendprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "MPN") && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                    {
-                        CurrentRowIndex = i;
-                        FindAutoMatch = true;
-                        break;
-                    }
-                }
-                if (FindAutoMatch)
-                    break;
-            }
-        }
-
         /// <summary>
         /// 采集数据
         /// </summary>
         private void CollectInputData()
         {
             LogManager.DoLog("采集数据【" + BackCheck.Text + "】,使用采集策略编号【" + sg_code.Text + "】");
-            //按DetNo排列之后的采集项
-            ScanData = new ArrayList<ArrayList<string>>();
-            //每个采集项目的子项
-            GetData = new ArrayList<string>();
-            //用于保存采集策略的具体信息
-            SiItem = new Dictionary<string, Dictionary<string, string>>();
-            for (int i = 0; i < Si_ItemDGV.RowCount; i++)
-            {
-                //如果不包含这个则添加进数组
-                if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
-                    GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
-                //如果和后一个的采集次序相同
-                if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
-                    GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
-                else
-                {
-                    ScanData.Add(GetData);
-                    //添加完一次数据需要一个新的List
-                    GetData = new ArrayList<string>();
-                }
-                Dictionary<string, string> item = new Dictionary<string, string>();
-                for (int j = 0; j < Si_ItemDGV.ColumnCount; j++)
-                {
-                    item.Add(Si_ItemDGV.Columns[j].DataPropertyName, Si_ItemDGV.Rows[i].Cells[j].Value.ToString());
-                }
-                SiItem.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString().ToUpper(), item);
-            }
-            //采集项目的数组
-            ItemData = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
-            //分隔符不为空的时候  //采集的项和Grid的数目不等
-            //用户采集的数据的分割数组
-            CollectData = new Dictionary<string, string>();
-            if (sg_separator.Text == "")
-            {
-                for (int i = 0; i < ItemData.Length; i++)
-                    CollectData.Add(ItemData[i].ToString().ToUpper(), BackCheck.Text);
-            }
-            else
-            {
-                int DataCount = BackCheck.Text.Split(sg_separator.Text.ToCharArray()).Length;
-                if (DataCount > ItemData.Length)
-                {
-                    MessageBox.Show("采集数据大于采集项次");
-                    return;
-                }
-                else if (DataCount < ItemData.Length)
-                {
-                    MessageBox.Show("采集数据小于采集项次");
-                    return;
-                }
-                for (int i = 0; i < DataCount; i++)
-                    CollectData.Add(ItemData[i].ToString().ToUpper(), BackCheck.Text.Split(sg_separator.Text.ToCharArray())[i]);
-            }
-            //首先判断当前采集的个数,如果采集的个数为1则不对数据进行分隔符验证
-            if (ItemData.Length == 1)
-            {
-                CollectData.Clear();
-                CollectData.Add(ItemData[0].ToString().ToUpper(), BackCheck.Text);
-                //勾选了自动匹配调用该函数
-                if (AutoMatch.Checked)
-                    SetAutoMatchRow();
-                //将筛选之后的值赋给Cell 
-                SetDataToCell(ref CollectData, ItemData[0].ToString().ToUpper());
-            }
-            //如果本次采集的数据分割后和当前的采集项目个数不一样提示用户错误
-            else if (CollectData.ToArray().Length == ItemData.Length)
-            {
-                for (int i = 0; i < ItemData.Length; i++)
-                {
-                    //勾选了自动匹配调用该函数
-                    if (AutoMatch.Checked)
-                        SetAutoMatchRow();
-                    //将筛选之后的值赋给Cell
-                    SetDataToCell(ref CollectData, ItemData[i].ToString().ToUpper());
-                }
-            }
-            else
-            {
-                MessageBox.Show("所采集的数据个数和采集项目不符");
-                return;
-            }
-            //采集项目的索引+1
-            CurrentItemIndex = CurrentItemIndex + 1;
-            //如果已经采集完了最后一个
-            if (CurrentItemIndex == ScanData.ToArray().Length)
             {
                 //数据校验均已通过则勾选上已采集
                 if (CollectVeProdCodePass && CollectQTYPass)
@@ -622,8 +409,6 @@ namespace UAS_LabelMachine
                     if (!AutoMatch.Checked)
                         SetRowIndexToCollectRow();
                 }
-                //当前项目已采集完成,重置采集项目
-                CurrentItemIndex = 0;
                 //未勾选自动匹配,设置到下一个未采集的行
                 if (!AutoMatch.Checked)
                     SetRowIndexToCollectRow();
@@ -637,23 +422,6 @@ namespace UAS_LabelMachine
             {
                 string LastRowProd = LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_prodcode"].Value.ToString();
                 string CurrentRowProd = LabelInf.Rows[CurrentRowIndex].Cells["pib_prodcode"].Value.ToString();
-                //如果两行的物料资料不相等的话
-                if (LastRowProd != CurrentRowProd)
-                    SetOutBoxCapacity(CurrentRowProd);
-            }
-        }
-
-        /// <summary>
-        /// 根据物料资料的参数设置外箱容量
-        /// </summary>
-        /// <param name="pr_code"></param>
-        private void SetOutBoxCapacity(string pr_code)
-        {
-            DataTable temp = (DataTable)dh.ExecuteSql("select pr_qtyperplace,pr_zxbzs from product where pr_code='" + pr_code + "'", "select");
-            if (temp.Rows.Count > 0)
-            {
-                //try { OutboxCapacity.Value = (decimal)temp.Rows[0]["pr_qtyperplace"] / (decimal)temp.Rows[0]["pr_zxbzs"]; }
-                //catch (Exception) { }
             }
         }
 
@@ -666,7 +434,6 @@ namespace UAS_LabelMachine
                 if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
                 {
                     griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
-                    pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
                     CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
                     break;
                 }
@@ -711,143 +478,6 @@ namespace UAS_LabelMachine
         private void RemindUser()
         {
             SetRowIndexToCollectRow();
-            if (ScanData.ToArray().Length > 0)
-            {
-                object[] arr = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
-                string Inf = "";
-                for (int i = 0; i < arr.Length; i++)
-                {
-                    Inf += arr[i] + "  ";
-                }
-                MessageLog.AppendText(">>当前采集行" + (CurrentRowIndex + 1) + ",请采集" + Inf + "\n", Color.Green);
-            }
-        }
-
-        /// <summary>
-        /// 自定义函数 将匹配之后的值设置到Cell中,传递引用,每次赋值之后从List中移除已使用过的
-        /// </summary>
-        /// <param name="data"></param>
-        /// <param name="kind"></param>
-        private void SetDataToCell(ref Dictionary<string, string> setdata, string kind)
-        {
-            int length = setdata.Count;
-            for (int j = 0; j < length; j++)
-            {
-                string[] data = new string[setdata.Count];
-                for (int i = 0; i < length; i++)
-                {
-                    data[i] = setdata[kind];
-                }
-                for (int i = 0; i < data.Length; i++)
-                {
-                    DataGridViewCell cell = null;
-                    string Matchstr = "";
-                    switch (kind.ToString().ToUpper())
-                    {
-                        case "DATECODE":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"];
-                            Matchstr = MatchStr(data[j], "DATECODE");
-                            setdata.Remove("DATECODE");
-                            length--;
-                            break;
-                        case "LOTNO":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"];
-                            Matchstr = MatchStr(data[j], "LOTNO");
-                            setdata.Remove("LOTNO");
-                            length--;
-                            break;
-                        case "MPN":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_vendprodcode"];
-                            Matchstr = MatchStr(data[j], "MPN");
-                            //采集的供应商号不匹配的话
-                            if (cell.Value.ToString() != Matchstr)
-                            {
-                                CollectVeProdCodePass = false;
-                                //添加需要重绘的Cell
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, false);
-                                LabelInf.Refresh();
-                                MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
-                            }
-                            else
-                            {
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, true);
-                                LabelInf.Refresh();
-                                CollectVeProdCodePass = true;
-                            }
-                            setdata.Remove("MPN");
-                            length--;
-                            break;
-                        case "QTY":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_qty"];
-                            Matchstr = MatchStr(data[j], "QTY");
-                            //如果采集的数量不相等的话
-                            if (cell.Value.ToString() != Matchstr)
-                            {
-                                CollectQTYPass = false;
-                                //添加需要重绘的Cell
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, false);
-                                LabelInf.Refresh();
-                                MessageLog.AppendText(">>数量不匹配\n", Color.Red);
-                            }
-                            else
-                            {
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, true);
-                                LabelInf.Refresh();
-                                CollectQTYPass = true;
-                            }
-                            setdata.Remove("QTY");
-                            length--;
-                            break;
-                        case "品牌":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"];
-                            Matchstr = MatchStr(data[j], "品牌");
-                            //如果采集的数量不相等的话
-                            if (cell.Value.ToString() != Matchstr)
-                            {
-                                CollectQTYPass = false;
-                                //添加需要重绘的Cell
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, false);
-                                LabelInf.Refresh();
-                                MessageLog.AppendText(">>品牌不匹配\n", Color.Red);
-                            }
-                            else
-                            {
-                                if (PaintCell.ContainsKey(cell))
-                                    PaintCell.Remove(cell);
-                                PaintCell.Add(cell, true);
-                                LabelInf.Refresh();
-                                CollectQTYPass = true;
-                            }
-                            setdata.Remove("品牌");
-                            length--;
-                            break;
-                        default:
-                            break;
-                    }
-                    //如果数据为空或者数据不为空的时候但是和需要采集的数据不相等的情况下进行采集
-                    //MPN和QTY只做比较不需要赋值
-                    if (cell.Value.ToString() == "" || cell.Value.ToString() != Matchstr)
-                    {
-                        if (kind != "MPN" && kind != "QTY" && kind != "品牌")
-                        {
-                            DataTable dt = (DataTable)MidSource.DataSource;
-                            cell.Value = Matchstr;
-                        }
-                    }
-                }
-            }
-            //添加外箱号,如果外箱号的箱内容量不为0并且已经采集完成
-            SetOutBoxCode2(false);
         }
 
         //
@@ -909,85 +539,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        /// <summary>
-        /// 自定义函数 根据匹配规则
-        /// si_item的二维数组,str是需要赋值的字符串,item表示DateCode,LotNo等
-        /// </summary>
-        /// <param name="SiItem"></param>
-        /// <param name="str"></param>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        private string MatchStr(string str, string item)
-        {
-            string kind = SiItem[item]["si_kind"];
-            //起始字符不为空的时候
-            switch (kind)
-            {
-                case "起始位置":
-                    if (SiItem[item]["si_index"] != "")
-                    {
-                        try
-                        {
-                            //长度不为空的时候按照指定的长度去取数据
-                            if (SiItem[item]["si_length"] != "")
-                                str = str.Substring(int.Parse(SiItem[item]["si_index"]), int.Parse(SiItem[item]["si_length"]));
-                            //长度为空的时候取index之后的全部数据
-                            else
-                                str = str.Substring(int.Parse(SiItem[item]["si_index"]));
-                        }
-                        catch (Exception e) { LogManager.DoLog(e.StackTrace); }
-                    }
-                    break;
-                case "索引字符":
-                    try
-                    {
-                        if (SiItem[item]["si_indexstring"] != "")
-                        {
-                            //长度不为空的时候按照指定的长度去取数据
-                            if (SiItem[item]["si_length"] != "")
-                                str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1, int.Parse(SiItem[item]["si_length"]));
-                            //长度为空的时候取index之后的全部数据
-                            else
-                                str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1);
-                        }
-                    }
-                    catch (Exception e) { LogManager.DoLog(e.StackTrace); }
-                    break;
-                case "二次解析":
-                    if (SiItem[item]["si_indexstring"] != "")
-                    {
-                        //长度不为空的时候按照指定的长度去取数据
-                        if (SiItem[item]["si_length"] != "")
-                            str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1, int.Parse(SiItem[item]["si_length"]));
-                        //长度为空的时候取index之后的全部数据
-                        else
-                            str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1);
-                    }
-                    str = Analysis.AnalysisData(Brand, item, str);
-                    break;
-                case "全部":
-                    break;
-                default:
-                    break;
-            }
-            if (SiItem[item]["si_expression"] != "")
-            {
-                string log = "使用正则表达式" + SiItem[item]["si_expression"] + "匹配数据" + str;
-                reg = new Regex(SiItem[item]["si_expression"]);
-                try
-                {
-                    str = reg.Matches(str)[int.Parse(SiItem[item]["si_expressionitem"].ToString()) - 1].Value;
-                }
-                catch (Exception)
-                {
-
-                }
-                log += ",匹配后数据" + str;
-                LogManager.DoLog(log);
-            }
-            return str;
-        }
-
         //关闭窗口前提示用户确认
         private void 贴标机条码打印_FormClosing(object sender, FormClosingEventArgs e)
         {
@@ -1126,8 +677,6 @@ namespace UAS_LabelMachine
                     stw = new SetLoadingWindow(thread, "正在获取打印标签");
                     BaseUtil.SetFormCenter(stw);
                     stw.ShowDialog();
-                    //重置采集项次
-                    CurrentItemIndex = 0;
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
                 }
                 else
@@ -1546,30 +1095,6 @@ namespace UAS_LabelMachine
             OutBoxDoc.PrintDocument();
         }
 
-        private void CleanDetail_Click(object sender, EventArgs e)
-        {
-            ArrayList<string> DeleteID = new ArrayList<string>();
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
-                    DeleteID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
-            }
-            //勾选了删除的明细之后
-            if (DeleteID.ToArray().Length > 0)
-            {
-                string close = MessageBox.Show(this.ParentForm, "删除后不可恢复,是否确认删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                if (close.ToString() == "Yes")
-                {
-                    dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
-                    MessageBox.Show("删除成功");
-                    LoadGridData(sender, e);
-                    RefreshProcessData();
-                }
-            }
-            else
-                MessageBox.Show("尚未勾选需要删除的明细");
-        }
-
         private void OutBoxLabelPrint_Click(object sender, EventArgs e)
         {
             if (OutBoxCombox.Text != "")
@@ -1656,8 +1181,26 @@ namespace UAS_LabelMachine
             {
                 Brand = LabelInf.Rows[0].Cells["pib_brand"].FormattedValue.ToString();
                 if (Brand != "")
-                    sg_code.Text = dh.getFieldDataByCondition("scangroup", "sg_code", "sg_brand='" + Brand + "'").ToString();
-                SetOutBoxCapacity(LabelInf.Rows[0].Cells["pib_prodcode"].Value.ToString());
+                {
+                    dt = (DataTable)dh.ExecuteSql("select sg_script,sg_id from scangroup where sg_brand='" + Brand + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        string sgid = dt.Rows[0]["sg_id"].ToString();
+                        string sgscript = dt.Rows[0]["sg_script"].ToString();
+                        DataTable dt1 = (DataTable)dh.ExecuteSql("select si_name,si_item,si_expression from scanitem where si_sgid='" + sgid + "'", "select");
+                        for (int i = 0; i < dt1.Rows.Count; i++)
+                        {
+                            if (sgscript.IndexOf(dt1.Rows[i]["si_name"].ToString()) != 0)
+                            {
+                                Si_Item.Add(sgscript.IndexOf(dt1.Rows[i]["si_name"].ToString()), dt1.Rows[i]["si_item"].ToString());
+                            }
+                        }
+                        //根据索引进行排序
+                        Si_Item = (from entry in Si_Item
+                                   orderby entry.Key ascending
+                                   select entry).ToDictionary(pair => pair.Key, pair => pair.Value);
+                    }
+                }
             }
             //绑定数据之后往下找到未采集的数据显示在当前采集的栏目
             for (int i = 0; i < LabelInf.RowCount; i++)
@@ -1665,7 +1208,6 @@ namespace UAS_LabelMachine
                 if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
                 {
                     griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
-                    pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
                     pib_id.Text = LabelInf.Rows[i].Cells["pib_id1"].FormattedValue.ToString();
                     CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
                     break;
@@ -1732,11 +1274,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void pr_code_SearchIconClick(object sender, EventArgs e)
-        {
-            pr_code.Condition = "  pd_inoutno='" + pi_inoutno.Text + "'";
-        }
-
         private void CusLabelPrint()
         {
             //MaxOutBoxCode = MaxOutBoxCode + 1;
@@ -1756,20 +1293,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void pr_code_UserControlTextChanged(object sender, EventArgs e)
-        {
-            //用户在重新勾选后重置采集项目的索引
-            CurrentItemIndex = 0;
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (pr_code.Text == LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                {
-                    CurrentRowIndex = i;
-                    break;
-                }
-            }
-        }
-
         private void Refresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         {
             KeyEventArgs e2 = new KeyEventArgs(Keys.Enter);
@@ -1791,7 +1314,6 @@ namespace UAS_LabelMachine
                     if (LabelInf.Rows[i].Cells["pib_pdno"].Value.ToString() == griddetno.Text && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
                     {
                         FindDetno = true;
-                        CurrentItemIndex = 0;
                         CurrentRowIndex = i;
                         RemindUser();
                         break;
@@ -2063,16 +1585,6 @@ namespace UAS_LabelMachine
             dh.getRowCount("employee", "1=1");
         }
 
-        private void CleanBarCode_Click(object sender, EventArgs e)
-        {
-            string close = MessageBox.Show(this.ParentForm, "是否清除该出货单条码", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (close.ToString() == "Yes")
-            {
-                dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
-                LoadGridData(sender, e);
-            }
-        }
-
         private void ButtonSetting_Click(object sender, EventArgs e)
         {
             ListButtonMenu.BringToFront();
@@ -2086,7 +1598,6 @@ namespace UAS_LabelMachine
             {
                 case "采集策略设置":
                     采集策略_NEW form = new 采集策略_NEW();
-                    form.FormClosed += sg_code_UserControlTextChanged;
                     BaseUtil.SetFormCenter(form);
                     form.ShowDialog();
                     break;