From 7b3ba71bb709578d5afae7bdf6b3e5347035c4f1 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期日, 21 四月 2024 16:27:28 +0800
Subject: [PATCH] 条码自动生成_PLC模块

---
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs          |  690 +++++++++++++++------
 LMES/ClsShowMod.cs                                          |    2 
 WarM/WarM.csproj                                            |   10 
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.resx        |   15 
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs | 1189 +++++++++++++++++++------------------
 5 files changed, 1,105 insertions(+), 801 deletions(-)

diff --git a/LMES/ClsShowMod.cs b/LMES/ClsShowMod.cs
index d6cef3f..f1c1f30 100644
--- a/LMES/ClsShowMod.cs
+++ b/LMES/ClsShowMod.cs
@@ -4006,7 +4006,7 @@
                         break;
                     case "gy_barcodebill_automaticallybyplc":
                         //权限
-                        Gy_BarCodeBill_automaticallyByPLC oGy_BarCodeBill_automaticallyByPLC = new Gy_BarCodeBill_automaticallyByPLC();
+                        Gy_BarCodeBill_automaticallyByPLC_New oGy_BarCodeBill_automaticallyByPLC = new Gy_BarCodeBill_automaticallyByPLC_New();
                         oGy_BarCodeBill_automaticallyByPLC.MdiParent = oMain;
                         oGy_BarCodeBill_automaticallyByPLC.Show();
                         oMainForm.AddTabPage(oGy_BarCodeBill_automaticallyByPLC);
diff --git a/WarM/WarM.csproj b/WarM/WarM.csproj
index e7c4f64..7128fe9 100644
--- a/WarM/WarM.csproj
+++ b/WarM/WarM.csproj
@@ -693,11 +693,11 @@
     <Compile Include="鏉$爜鎵撳嵃\Frm_Split.Designer.cs">
       <DependentUpon>Frm_Split.cs</DependentUpon>
     </Compile>
-    <Compile Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC.cs">
+    <Compile Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC_New.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC.designer.cs">
-      <DependentUpon>Gy_BarCodeBill_automaticallyByPLC.cs</DependentUpon>
+    <Compile Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC_New.designer.cs">
+      <DependentUpon>Gy_BarCodeBill_automaticallyByPLC_New.cs</DependentUpon>
     </Compile>
     <Compile Include="鏉$爜鎵撳嵃\Kf_AGVRequestBill_FastList.cs">
       <SubType>Form</SubType>
@@ -1144,8 +1144,8 @@
     <EmbeddedResource Include="鏉$爜鎵撳嵃\Frm_Split.resx">
       <DependentUpon>Frm_Split.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC.resx">
-      <DependentUpon>Gy_BarCodeBill_automaticallyByPLC.cs</DependentUpon>
+    <EmbeddedResource Include="鏉$爜鎵撳嵃\Gy_BarCodeBill_automaticallyByPLC_New.resx">
+      <DependentUpon>Gy_BarCodeBill_automaticallyByPLC_New.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="鏉$爜鎵撳嵃\Kf_AGVRequestBill_FastList.resx">
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
similarity index 90%
rename from "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.cs"
rename to "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
index 136302a..f6fc087 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
@@ -8,84 +8,19 @@
 using gregn6Lib;
 using Pub_Class;
 using System.Threading;
+using System.Net.Sockets;
+using System.Net;
+using System.Drawing.Printing;
+using System.IO;
 
 namespace WarM
 {
-    public partial class Gy_BarCodeBill_automaticallyByPLC : Form
+    public partial class Gy_BarCodeBill_automaticallyByPLC_New : Form
     {
-        public Gy_BarCodeBill_automaticallyByPLC()
+        public Gy_BarCodeBill_automaticallyByPLC_New()
         {
             InitializeComponent();
         }
-        //琛ㄥご淇℃伅
-        int HSourceInterID_Bak = 0;
-        int HSourceEntryID_Bak = 0;
-        string HSourceBillNo_Bak = "";
-        string HSourceBIllType_Bak = "";
-
-        //婧愬崟淇℃伅
-        string HMainIDCol_Bak = "0";
-        string HSubIDCol_Bak = "0";
-        string HBillNoCol_Bak = "";
-        string HBillTypeCol_Bak = "";
-        string HMaterIDCol_Bak = "";
-        string HMaterNumberCol_Bak = "";
-        string HMaterNameCol_Bak = "";
-        string HMaterModelCol_Bak = "";
-        string HModelCol_Bak = "";
-        string HPinfanCol_Bak = "";
-        string HPinfanBarCodeCol_Bak = "";
-        string HAuxPropIDCol_Bak = "0";
-        string HAuxPropNumberCol_Bak = "";
-
-        string HAuxPropNameCol_Bak = "";
-        string HUnitIDCol_Bak = "";
-        string HUnitNumberCol_Bak = "";
-        string HUnitNameCol_Bak = "";
-        string HBarCodeTypeCol_Bak = "";
-        string HBatchManagerCol_Bak = "";
-        string HBatchNoCol_Bak = "";
-        string HGiveAwayFlagCol_Bak = "";
-        string HQtyCol_Bak = "";
-        string HMinQtyCol_Bak = "";
-        string HPackQtyCol_Bak = "";
-        string HBQtyCol_Bak = "";
-        string HSupIDCol_Bak = "";
-        string HSupNumberCol_Bak = "";
-        string HSupNameCol_Bak = "";
-        string HDeptIDCol_Bak = "";
-        string HDeptNumberCol_Bak = "";
-        string HDeptNameCol_Bak = "";
-        string HWhIDCol_Bak = "";
-        string HWhNumberCol_Bak = "";
-        string HWhNameCol_Bak = "";
-        string HSPIDCol_Bak = "";
-        string HSPNumberCol_Bak = "";
-        string HSPNameCol_Bak = "";
-        string HInstructNoCol_Bak = "";
-        string HSeOrderBillNoCol_Bak = "";
-        string HSeOrderSEQCol_Bak = "";
-        string HDateCol_Bak = "";
-        string HRemarkCol_Bak = "";
-        string HMTONoCol_Bak = "";
-        string HCusIDCol_Bak = "";
-        string HCusNumberCol_Bak = "";
-        string HCusNameCol_Bak = "";
-        string HCusTypeCol_Bak = "";
-        string HEndDateCol_Bak = "";
-        string HSourceIDCol_Bak = "";
-        string HSourceNumberCol_Bak = "";
-        string HSourceNameCol_Bak = "";
-        string HShowDateCol_Bak = "";
-        string HInnerBillNoCol_Bak = "";
-        string HMakerCol_Bak = "";
-        string HProduceDateCol_Bak = "";
-        string HExpiryDateCol_Bak = "";
-        string HISKFPERIODCol_Bak = "";
-        string HEXPUNITCol_Bak = "";
-        string HEXPPERIODCol_Bak = "";
-
-
         //瀹氫箟
         public const Int16 HTagCol = 0;
         public const Int16 HSnoCol = 1;
@@ -213,7 +148,7 @@
         public Int16 HPinfanBarCode2Col = 54;
         public Int16 HMTONo2Col = 55;
         public Int16 HShowDate2Col = 56;
-        public Int16 HInnerBillNo2Col = 57; 
+        public Int16 HInnerBillNo2Col = 57;
         public Int16 HMaker2Col = 58;
         public Int16 HEntryID2Col = 59;
         public Int16 HProduceDate2Col = 60;
@@ -222,9 +157,9 @@
         public Int16 HEXPUNIT2Col = 63;
         public Int16 HEXPPERIOD2Col = 64;
         //
-        public  string ModName = "86";
-        public  string ModCaption = "鏉$爜鑷姩鐢熸垚_PLC";
-        public const string ModRightName = "Gy_BarCodeBill_automaticallyByPLC";
+        public string ModName = "85";
+        public string ModCaption = "鏉$爜鐢熸垚";
+        public const string ModRightName = "Gy_BarCodeBill";
         public const string ModRightNameSourceQty = ModRightName + "_SourceQty"; //瓒呮簮鍗曟暟閲忔帶鍒�
         public bool BillChange;   //
 
@@ -232,7 +167,7 @@
         public DBUtility.ClsXt_BaseBill BaseBill;
         //public WarM.WMSWeb.WebService1 oWeb = new WarM.WMSWeb.WebService1();
         public Int64 KeyID;
-        public bool  grdStatus;
+        public bool grdStatus;
         //public DAL.ClsGy_BarCodeBill BillNew =new  DAL.ClsGy_BarCodeBill();
         //public DAL.ClsGy_BarCodeBill BillOld = new DAL.ClsGy_BarCodeBill();
         public DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
@@ -250,6 +185,11 @@
         public string PrintQtyCtl = "";         //鏉$爜鎵撳嵃娆℃暟鎺у埗
         public string UpdatePrintQtyCtl = "";   //鏉$爜鎵撳嵃娆℃暟鏇存柊
                                                 //-------------------------------------------------------------------------
+
+        //
+        //Socket閫氳
+        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+
         #region 鍥哄畾浠g爜
 
         //娓呯┖鐣岄潰
@@ -258,25 +198,17 @@
             ////琛ㄤ綋娓呯┖
             //grdMain.Rows.Clear();
             //grdSub.Rows.Clear();
-
-            //娓呯┖涓嬫媺鍒楄〃鏁版嵁
             cmbHBarCodeType.Items.Clear();
             cmbSourceBillType.Items.Clear();
-
-            //娓呯┖鎺т欢鏁版嵁
-            DBUtility.Xt_BaseBillFun.Sub_ClearBill(groupBox_BillInfo);
-
-            //娓呯┖鎺т欢鏁版嵁(寰呭垹闄�)
-            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
 
             //鏍规嵁绯荤粺鍙傛暟鑾峰彇瀵瑰簲鐨勬潯鐮佺被鍨嬶紙澶忓疂鐢靛櫒銆佸崥鏃�   浠ュ悗浣跨敤鏉$爜瑙勫垯琛級
             ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter();
             string sCapName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);
-            if(sCapName=="澶忓疂鐢靛櫒")
-            { 
+            if (sCapName == "澶忓疂鐢靛櫒")
+            {
                 cmbHBarCodeType.Items.Add("鍐呴攢鏈烘潯鐮�");
                 cmbHBarCodeType.Items.Add("澶栭攢鏈烘潯鐮�");
-                cmbHBarCodeType.Items.Add("鍗婃垚鍝佹潯鐮�"); 
+                cmbHBarCodeType.Items.Add("鍗婃垚鍝佹潯鐮�");
             }
             else if (sCapName == "鍗氭棩绉戞妧")
             {
@@ -298,7 +230,7 @@
                 //cmbHBarCodeType.Items.Add("鎵樼洏鏉$爜");
             }
 
-            ////鏍规嵁绯荤粺鍙傛暟鑾峰彇瀵瑰簲鐨勬簮鍗曠被鍨嬶紙澶忓疂鐢靛櫒銆佸崥鏃�   浠ュ悗浣跨敤鏉$爜瑙勫垯琛級
+            //婧愬崟绫诲瀷
             if (sCapName == "涓帶")
             {
                 cmbSourceBillType.Items.Add("鐢熶骇姹囨姤鍗�");
@@ -321,15 +253,46 @@
                 cmbSourceBillType.Items.Add("缁勮鎷嗗嵏鍗�");
             }
             //
-          
-            //鑾峰彇缁勭粐涓嬫媺鍒楄〃鏁版嵁
+            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
+            //缁勭粐涓嬫媺鍒楄〃
             DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo);
             if (Ds1.Tables[0].Rows.Count != 0)
             {
                 cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]);
             }
 
-            //璁剧疆鍒跺崟淇℃伅
+            //鎵撳嵃鏈轰笅鎷夊垪琛�
+            PrintDocument fPrintDocument = new PrintDocument();
+            string defaultPrinter = fPrintDocument.PrinterSettings.PrinterName;
+            comboBox_PrinterParams.Items.Clear();
+            for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++)
+            {
+                string tmp = PrinterSettings.InstalledPrinters[i];
+                if (tmp == defaultPrinter)
+                {
+                    tmp = tmp + "(榛樿)";
+                }
+                comboBox_PrinterParams.Items.Add(tmp);
+            }
+
+
+            //浜х嚎涓嬫媺鍒楄〃
+            DataSet DsSource = oCn.RunProcReturn("select * from Gy_Source where HUSEORGID =" + ClsPub.HOrgID, "Gy_Source");
+            if (DsSource != null)
+            {
+                comboBox_SourceNameParams.Items.Clear();
+                for (int i = 0; i < DsSource.Tables[0].Rows.Count; i++)
+                {
+                    comboBox_SourceNameParams.Items.Add(DsSource.Tables[0].Rows[i]["HName"]);
+                }
+            }
+
+
+            //璇诲彇閰嶇疆鏂囦欢璁剧疆閰嶇疆
+            readParams();
+            //璁剧疆宸ュ崟淇℃伅
+            textBox_SourceName.Text = comboBox_SourceNameParams.Text;
+
             txtHMaker.Text = ClsPub.CurUserName;
             txtHMakeDate.Text = "";
             txtHChecker.Text = "";
@@ -340,10 +303,11 @@
             txtHDeleteDate.Text = "";
             txtHUpDater.Text = "";
             txtHUpDateDate.Text = "";
-
-            //鍒濆鍖栬〃浣撲俊鎭�
             initGrid();
             grdList.DataSource = null;
+            grdBillBarCodeList.DataSource = null;
+
+            tabControl1.SelectedIndex = 3;
         }
 
         //淇濆瓨鍒楀
@@ -379,7 +343,9 @@
         {
             this.Sub_SaveBill();
             Display();
-            
+
+            Display4();
+
         }
 
         //閲嶇疆鎸夌航
@@ -393,7 +359,7 @@
                 }
             }
             grdMain.Columns[HBillNoCol].ReadOnly = false;
-            tabControl1.SelectedIndex = 0;
+            tabControl1.SelectedIndex = 3;
         }
 
         //鏂板鍗曟嵁
@@ -415,7 +381,7 @@
         {
             oSumGrid.LeaveCell();
         }
- 
+
         //缃戞牸鍗曞厓鏍煎彉鍖栦簨浠�
         private void grdMain_RowColChange(object sender, EventArgs e)
         {
@@ -429,8 +395,8 @@
             //    return;
             //if(oSumGrid.EditStatus)
             //{
-                if (!CheckGridRow(oSumGrid.OldCell.Row))
-                    return;
+            if (!CheckGridRow(oSumGrid.OldCell.Row))
+                return;
             //}
         }
 
@@ -595,43 +561,43 @@
             {
                 case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View:
                     //娴忚鐘舵��
-                    yl.Enabled = true; 
+                    yl.Enabled = true;
                     AddRow.Enabled = false;
                     DelRow.Enabled = false;
                     bc.Enabled = false;
-                    cz.Enabled = false; 
-                    tc.Enabled = true; 
+                    cz.Enabled = false;
+                    tc.Enabled = true;
                     //鏈鏍�
                     if (txtHChecker.Text.Trim() == "")
-                    {  
+                    {
                         //鏈鏍�
                         pic1.Visible = false;
                         pic1.Image = null;
                         //
                     }
                     else if (txtHCloseMan.Text.Trim() == "" && txtHChecker.Text.Trim() != "")//瀹℃牳鏈叧闂�
-                    { 
+                    {
                         //
                         pic1.Visible = true;
                         pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Checked.jpg");
                         //
                     }
                     else//宸插叧闂�
-                    { 
+                    {
                         //
                         pic1.Visible = true;
                         pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Closed.jpg");
                         //
                     }
                     if (txtHDeleteMan.Text.Trim() == "")
-                    { 
+                    {
                     }
                     else //宸蹭綔搴�
-                    { 
+                    {
                         AddRow.Enabled = false;
                         DelRow.Enabled = false;
                         bc.Enabled = false;
-                        cz.Enabled = false; 
+                        cz.Enabled = false;
                         //
                         pic1.Visible = true;
                         pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Deleted.jpg");
@@ -642,14 +608,14 @@
                     break;
                 case DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew:
                     //鏂板鐘舵��
-                    yl.Enabled = true; 
+                    yl.Enabled = true;
                     AddRow.Enabled = true;
                     DelRow.Enabled = true;
                     bc.Enabled = true;
-                    cz.Enabled = true; 
+                    cz.Enabled = true;
                     tc.Enabled = true;
                     Sub_LrtextStatus(true);
-                    grdStatus = true; 
+                    grdStatus = true;
                     //鏈鏍�
                     pic1.Visible = false;
                     pic1.Image = null;
@@ -657,14 +623,14 @@
                     break;
                 case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify:
                     //淇敼鐘舵��
-                    yl.Enabled = true; 
+                    yl.Enabled = true;
                     AddRow.Enabled = true;
                     DelRow.Enabled = true;
                     bc.Enabled = true;
-                    cz.Enabled = true; 
+                    cz.Enabled = true;
                     tc.Enabled = true;
                     Sub_LrtextStatus(true);
-                    grdStatus = true; 
+                    grdStatus = true;
                     //鏈鏍�
                     pic1.Visible = false;
                     pic1.Image = null;
@@ -697,18 +663,18 @@
                 return false;
             }
 
-            string sHRemark = ""; 
+            string sHRemark = "";
             for (int j = 0; j < grdMain.Rows.Count; j++)
             {
                 long HSno = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HSnoCol].Value);                  // 搴忓彿
-                string HBarCodeType= cmbHBarCodeType.Text;                                                  // 鏉$爜绫诲瀷
+                string HBarCodeType = cmbHBarCodeType.Text;                                                  // 鏉$爜绫诲瀷
                 string HSourceBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBillNoCol].Value); // 婧愬崟鍗曞彿
                 long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);          // 鐗╂枡鍐呯爜
                 string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value);     // 鎵瑰彿
                 long HAuxPropID = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value);      // 杈呭姪灞炴�D
                 double HSourceQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HinitQtyCol].Value);     // 婧愬崟鏁伴噺
                 double HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);               // 鏁伴噺
-                double HMinQty= DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);          // 鏈�灏忓寘瑁呮暟
+                double HMinQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);          // 鏈�灏忓寘瑁呮暟
 
                 if (HMaterID != 0)
                 {
@@ -719,12 +685,12 @@
                         MessageBox.Show("鏉$爜鐢熸垚瀹屾暣鎬у垽鏂敊璇紒");
                         return false;
                     }
-                    else if(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
+                    else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
                     {
-                        sHRemark= sHRemark+DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]);
+                        sHRemark = sHRemark + DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]);
                     }
-                    else if(DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HExpiryDateCol].Value) == "")
-                    { 
+                    else if (DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HExpiryDateCol].Value) == "")
+                    {
                         if (DBUtility.ClsPub.isBool(oDsCheck.Tables[0].Rows[0]["HISKFPERIOD"]))
                         {
                             DateTime HProduceDate;  //鐢熶骇鏃ユ湡
@@ -764,7 +730,7 @@
                     }
                 }
             }
-            if(sHRemark!="")
+            if (sHRemark != "")
             {
                 MessageBox.Show(sHRemark);
                 return false;
@@ -800,7 +766,7 @@
             {
                 return false;
             }
-            bc.Enabled = false;
+            //bc.Enabled = false;
             if (cmbHBarCodeType.Text == "浠櫒鎴愬搧鏉$爜瑙勫垯")
             {
                 SaveBarCode_bori(); //鐗╂枡缂栫爜+搴忓垪鍙�+鐢熶骇鏃ユ湡
@@ -868,11 +834,11 @@
                     {
                         sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HDateCol].Value);
                     }
-                    HYasuoji= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanCol].Value); //鍘嬬缉鏈轰唬鐮侊紙澶忓疂鐢靛櫒锛�
-                    HModelName= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusTypeCol].Value); //鏈哄瀷锛堝瀹濈數鍣級
+                    HYasuoji = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanCol].Value); //鍘嬬缉鏈轰唬鐮侊紙澶忓疂鐢靛櫒锛�
+                    HModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusTypeCol].Value); //鏈哄瀷锛堝瀹濈數鍣級
                     HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HSourceBillNoCol].Value); //鐢熶骇璁㈠崟鍙凤紙澶忓疂鐢靛櫒锛�
-                    HBarCodeBatchNo= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanBarCodeCol].Value); //鏉$爜鎵规鍙凤紙澶忓疂鐢靛櫒锛�
-                    HBarCodeDate= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HSupNumberCol].Value); //鏉$爜鏃ユ湡锛堝瀹濈數鍣級
+                    HBarCodeBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanBarCodeCol].Value); //鏉$爜鎵规鍙凤紙澶忓疂鐢靛櫒锛�
+                    HBarCodeDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HSupNumberCol].Value); //鏉$爜鏃ユ湡锛堝瀹濈數鍣級
                     //
                     sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                     sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
@@ -955,7 +921,7 @@
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
                         LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                     }
-                    else if(cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�" || cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�")
+                    else if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�" || cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�")
                     {
                         //鐗╂枡缂栫爜+鍗曟嵁鏃ユ湡锛圷YMMDD锛�+娴佹按4浣� 
                         sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
@@ -975,7 +941,7 @@
                     else if (cmbHBarCodeType.Text == "璇曞墏鎴愬搧鏉$爜瑙勫垯")
                     {
                         //鐗╂枡缂栫爜+鐢熶骇鎵瑰彿+娴佹按鍙�6浣�-
-                        sTMNumber = HMaterNumber + HBatchNo ;
+                        sTMNumber = HMaterNumber + HBatchNo;
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
                                                                                                                     //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                         LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
@@ -985,14 +951,14 @@
                     {
                         //鍒堕�犳湰閮�1浣嶏紙榛樿1锛�+鏈哄瀷浠g爜5浣嶏紙锛�+骞�2浣�+鏈�1浣嶏紙A銆丅銆丆浠f浛10鏈堜唤锛�
                         //+鏃�2浣�+鏉$爜鎵规鐮�2浣�+鍘嬬缉鏈轰唬鐮�1浣�+00+娴佹按鍙�4浣�+鏍¢獙鐮侊紙榛樿0锛�
-                        sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00" ;
+                        sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00";
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
                                                                                                                     //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                         LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                         LSHlen = 4;
                         if (sTMNumber.Length != 16 && sTMNumber.Length != 15)
                         {
-                            MessageBox.Show("鏉$爜闀垮害涓嶅15鎴�16浣嶏紝鏄惁鏁版嵁涓嶅叏锛佸埗閫犳湰閮�1浣�:[0] + 鏈哄瀷浠g爜5浣�:[" + HModelName + "] + 骞存湀鏃�4鎴�5浣�:["+ HBarCodeDate + "] + 鎵规鍙�2浣�:[" + HBarCodeBatchNo  + "]+ 鍘嬬缉鏈�1浣�:["+ HYasuoji + "]+00 ; ");
+                            MessageBox.Show("鏉$爜闀垮害涓嶅15鎴�16浣嶏紝鏄惁鏁版嵁涓嶅叏锛佸埗閫犳湰閮�1浣�:[0] + 鏈哄瀷浠g爜5浣�:[" + HModelName + "] + 骞存湀鏃�4鎴�5浣�:[" + HBarCodeDate + "] + 鎵规鍙�2浣�:[" + HBarCodeBatchNo + "]+ 鍘嬬缉鏈�1浣�:[" + HYasuoji + "]+00 ; ");
                             return;
                         }
                     }
@@ -1000,14 +966,14 @@
                     {
                         //鐗╂枡浠g爜11浣�+骞�2浣�+鏈�1浣嶏紙A銆丅銆丆浠f浛10鏈堜唤锛�+鏃�2浣�+鎵规2浣�+娴佹按鍙�4浣�
                         //sTMNumber = HMaterNumber.Replace(Convert.ToChar("."),Convert.ToChar("")) + HBarCodeDate + HBarCodeBatchNo;
-                        sTMNumber = HMaterNumber.Replace( "."  ,  "" ) + HBarCodeDate + HBarCodeBatchNo;
+                        sTMNumber = HMaterNumber.Replace(".", "") + HBarCodeDate + HBarCodeBatchNo;
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
                                                                                                                     //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                         LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                         LSHlen = 4;
                         if (sTMNumber.Length != 18 && sTMNumber.Length != 17)
                         {
-                            MessageBox.Show("鏉$爜闀垮害涓嶅17鎴�18浣嶏紝鏄惁鏁版嵁涓嶅叏锛佺墿鏂欎唬鐮�11浣�:["+ HMaterNumber.Replace(".", "") + "]+骞存湀鏃�4鎴�5浣�:["+ HBarCodeDate + "]+鎵规鍙�2浣�:[" + HBarCodeBatchNo  + "];");
+                            MessageBox.Show("鏉$爜闀垮害涓嶅17鎴�18浣嶏紝鏄惁鏁版嵁涓嶅叏锛佺墿鏂欎唬鐮�11浣�:[" + HMaterNumber.Replace(".", "") + "]+骞存湀鏃�4鎴�5浣�:[" + HBarCodeDate + "]+鎵规鍙�2浣�:[" + HBarCodeBatchNo + "];");
                             return;
                         }
                     }
@@ -1031,7 +997,7 @@
                     }
 
                     Int64 HBQty2 = 0;              //绠辨暟
-                    HBQty2 =ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value);
+                    HBQty2 = ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value);
                     HBQty = HBQty + ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value);
                     HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);
                     HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);
@@ -1095,7 +1061,7 @@
                             //鏉$爜缂栧彿 = 鏉$爜鍓嶇紑 + 娴佹按鍙�
                             TM = sTMNumber + LSH2;
                         }
-                        else if(cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�" || cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�" || cmbHBarCodeType.Text == "璇曞墏鎴愬搧鏉$爜瑙勫垯" 
+                        else if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�" || cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�" || cmbHBarCodeType.Text == "璇曞墏鎴愬搧鏉$爜瑙勫垯"
                             || cmbHBarCodeType.Text == "鍗婃垚鍝佹潯鐮�" || cmbHBarCodeType.Text == "澶栭攢鏈烘潯鐮�")
                         {
                             TM = sTMNumber + LSH2;
@@ -1302,6 +1268,13 @@
                         HISKFPERIOD = ClsPub.isBool(grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value);
                         HEXPUNIT = ClsPub.isStrNull(grdSub.Rows[i].Cells[HEXPUNIT2Col].Value);
                         HEXPPERIOD = ClsPub.isDoule(grdSub.Rows[i].Cells[HEXPPERIOD2Col].Value);
+
+                        if (radioButton_HIsUsingBatchNo.Checked)
+                        {
+                            HBatchNo2 = getBatchNo();
+                        }
+
+
                         oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1358,9 +1331,9 @@
 
                 //
                 oCn.Commit();
-                MessageBox.Show("鏉$爜鐢熸垚瀹屾瘯锛�");
+                //MessageBox.Show("鏉$爜鐢熸垚瀹屾瘯锛�");
                 //grdSub.RowCount = 0;
-                tabControl1.SelectedIndex = 1;
+                tabControl1.SelectedIndex = 3;
             }
             catch (Exception e)
             {
@@ -1370,31 +1343,54 @@
             }
         }
 
-        ////鏈堜唤杞寲
-        //private string Sub_PeriodChange(string sPeriod)
-        //{
-        //    if(sPeriod=="10")
-        //    {
-        //        return "A";
-        //    }
-        //    else if (sPeriod == "11")
-        //    {
-        //        return "B";
-        //    }
-        //    else if (sPeriod == "12")
-        //    {
-        //        return "C";
-        //    }
-        //    else
-        //    {
-        //        return sPeriod.Substring(1, 1);
-        //    }
-        //}
+        private string getBatchNo()
+        {
+            string HBatchNo = "";
 
+            if (radioButton_HIsUsingBatchNo.Checked)
+            {
+                //鏃ユ湡鑾峰彇鏂瑰紡
+                string sDate = dtpHDate.Value.ToShortDateString();                                                                                   //
+                string sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
+                string sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
+                sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
+                string sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
+                sDay = sDay.Substring(sDay.Length - 2, 2);
+
+                string HDate = "20" + sYear + "-" + sPeriod + "-" + sDay;
+
+                //鑾峰彇娴佹按鍙凤細鍥涗綅锛岃鐗╂枡褰撳ぉ鐢熸垚鐨勬潯鐮佹暟
+                string LIU = "";
+                int LEN = 4;
+                DataSet ds;
+                string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + HDate + "' order by 鎵瑰彿 desc";
+                ds = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
+                if (ds != null)
+                {
+                    long count = ClsPub.isLong(ds.Tables[0].Rows[0]["鎵瑰彿"].ToString().Replace(sYear + sPeriod + sDay, ""));
+
+                    LIU += count + 1;
+                    while (LIU.Length < LEN)  //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
+                    {
+                        LIU = "0" + LIU;
+                    }
+                }
+                else
+                {
+                    return "";
+                }
+
+                //鎷兼帴鎵瑰彿
+                HBatchNo = sYear + sPeriod + sDay + LIU;
+            }
+
+
+            return HBatchNo;
+        }
 
         //鐢熸垚鏉$爜 鍗氭棩 
         //鐗╂枡缂栫爜+搴忓垪鍙�+鐢熶骇鏃ユ湡
-        private void SaveBarCode_bori() 
+        private void SaveBarCode_bori()
         {
             grdSub.Rows.Clear();
             int LSHlen = 6;             //娴佹按鍙烽暱搴�
@@ -1460,7 +1456,7 @@
                     HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);
                     n = 0;
                     //浠庨噾铦跺簭鍒楀彿琛ㄨ幏鍙栧簭鍒楀彿
-                    DataSet DSet = oCn.RunProcReturn("exec h_p_CLD_GetBarCodeSno  "+ ClsPub.isStrNull(grdMain.Rows[j].Cells[HMainIDCol].Value) + "," + ClsPub.isStrNull(grdMain.Rows[j].Cells[HSubIDCol].Value) + "  ", "h_p_CLD_GetBarCodeSno", ref DBUtility.ClsPub.sExeReturnInfo);
+                    DataSet DSet = oCn.RunProcReturn("exec h_p_CLD_GetBarCodeSno  " + ClsPub.isStrNull(grdMain.Rows[j].Cells[HMainIDCol].Value) + "," + ClsPub.isStrNull(grdMain.Rows[j].Cells[HSubIDCol].Value) + "  ", "h_p_CLD_GetBarCodeSno", ref DBUtility.ClsPub.sExeReturnInfo);
                     //鐢熸垚棣栬鏍囬
                     if (DSet == null)
                     {
@@ -1491,16 +1487,16 @@
                         }
                         //
                         //LSH = LSH + 1;
-                        LSH2 =DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[n]["SHNO"]);
+                        LSH2 = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[n]["SHNO"]);
                         //while (LSH2.Length < LSHlen)  //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
                         //{
                         //    LSH2 = "0" + LSH2;
                         //}
                         //if (cmbHBarCodeType.Text == "鍞竴鏉$爜")
                         //{
-                            //鏉$爜缂栧彿 = 鏉$爜鍓嶇紑 + 娴佹按鍙�
-                            //T/*M*/ = HMaterNumber + LSH2 + sYear + sPeriod + sDay;
-                        TM =  LSH2 + sYear + sPeriod + sDay;
+                        //鏉$爜缂栧彿 = 鏉$爜鍓嶇紑 + 娴佹按鍙�
+                        //T/*M*/ = HMaterNumber + LSH2 + sYear + sPeriod + sDay;
+                        TM = LSH2 + sYear + sPeriod + sDay;
                         //}
 
                         if (i + 1 > grdSub.Rows.Count)
@@ -1654,6 +1650,7 @@
                         HSeOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value);
                         HInnerBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HInnerBillNo2Col].Value);
                         HGiveAwayFlag = ClsPub.isBool(grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value);
+
                         oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1708,7 +1705,7 @@
                 oCn.Commit();
                 MessageBox.Show("鏉$爜鐢熸垚瀹屾瘯锛�");
                 //grdSub.RowCount = 0;
-                tabControl1.SelectedIndex = 1;
+                tabControl1.SelectedIndex = 3;
             }
             catch (Exception e)
             {
@@ -1844,7 +1841,7 @@
             grdMain.Columns[HEXPPERIODCol].Visible = false;
 
             //璁剧疆鍙紪杈戝垪
-            string sAllowCol =  HQtyCol.ToString()+
+            string sAllowCol = HQtyCol.ToString() +
                                 "," + HMinQtyCol.ToString() +
                                 "," + HMaterNumberCol.ToString() +
                                 "," + HAuxPropNumberCol.ToString() +
@@ -1869,7 +1866,7 @@
             }
             //
 
-            DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid);
+            DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
             //----------------------------
 
             grdSub.ColumnCount = 65;                       //鎬诲垪鏁�
@@ -2005,6 +2002,7 @@
 
             ////
             DBUtility.Xt_BaseBillFun.initGridList(grdList, this.Name + "grdList");
+            DBUtility.Xt_BaseBillFun.initGridList(grdBillBarCodeList, this.Name + "grdBillBarCodeList");
             ////
         }
 
@@ -2026,7 +2024,7 @@
                 sMoney = Math.Ceiling(sMoney);
                 grdMain.Rows[sRow].Cells[HBQtyCol].Value = sMoney;
             }
-            else 
+            else
             {
 
             }
@@ -2083,7 +2081,7 @@
                 //{
                 //    grdMain.Rows[Row].Cells[HUnitIDCol].Value = "";
                 //    grdMain.Rows[Row].Cells[HUnitNameCol].Value = "";
-                    return false;
+                return false;
                 //}
             }
             else //鍏朵粬鍒�
@@ -2098,7 +2096,7 @@
         //鏄惁鏄┖琛�
         private bool IsNullRow(int Row)
         {
-            return DBUtility.Xt_BaseBillFun.IsNullRow(Row, HMaterIDCol,grdMain);
+            return DBUtility.Xt_BaseBillFun.IsNullRow(Row, HMaterIDCol, grdMain);
         }
         //'鍒ゆ柇缃戞牸琛岀殑褰曞叆鏄惁姝g‘
         private bool CheckGridRow(int Row)
@@ -2296,8 +2294,8 @@
                     {
                         switch (sCol)
                         {
-                            
-                           
+
+
                             default:
                                 break;
                         }
@@ -2307,7 +2305,7 @@
                     break;
             }
         }
-       
+
         //閫夊師鍗�
         private void cmdSourceBillNo_Click(object sender, EventArgs e)
         {
@@ -2471,21 +2469,24 @@
             {
 
             }
+
+            //閫夋嫨婧愬崟鍚庯紝鍔犺浇璇ユ簮鍗曡褰曠墿鏂欏湪褰撳墠鏃ユ湡鐨勬潯鐮佸垪琛�
+            Display4();
         }
         //
         private void FillSelectData(List<DBUtility.BillSelect> oList)
         {
+            if (oList.Count != 1)
+            {
+                MessageBox.Show("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                return;
+            }
+
+
             DataSet Ds;
             oSumGrid.Changelock = true;
             initGrid();
             int i = -1;
-
-            if (oList.Count != 0)
-            {
-                MessageBox.Show("璇烽�夋嫨涓�鏉¤褰曪紒");
-                return;
-            }
-
             foreach (DBUtility.BillSelect oSelectRow in oList)
             {
                 i = i + 1;
@@ -2654,22 +2655,37 @@
             //
             oSumGrid.Changelock = false;
             DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
+
+            if (grdMain.Rows.Count > 0)
+            {
+                //鏍规嵁婧愬崟璁剧疆琛ㄥご
+                textBox_HMaterNumber.Text = grdMain.Rows[0].Cells[HMaterNumberCol].Value.ToString();
+                textBox_HMaterName.Text = grdMain.Rows[0].Cells[HMaterNameCol].Value.ToString();
+                textBox_HMaterModel.Text = grdMain.Rows[0].Cells[HMaterModelCol].Value.ToString();
+                long HMaterID = ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value.ToString());
+                Ds = oCn.RunProcReturn("select * from Gy_Material where HItemID = " + HMaterID + " and HUSEORGID =" + HOrgID, "Gy_Material");
+                if (Ds != null && Ds.Tables[0].Rows.Count > 0)
+                {
+                    string HBatchManager = Ds.Tables[0].Rows[0]["HBatchManager"].ToString();
+                    if (HBatchManager == "False")
+                    {
+                        radioButton_HIsUsingBatchNo.Checked = false;
+                    }
+                    else
+                    {
+                        radioButton_HIsUsingBatchNo.Checked = true;
+                    }
+                }
+                //璁剧疆鎵瑰彿
+                if (radioButton_HIsUsingBatchNo.Checked)
+                {
+                    grdMain.Rows[0].Cells[HBatchNoCol].Value = getBatchNo();
+                }
+            }
         }
         //鏍规嵁TABLE鍐欏叆鐣岄潰(鐢熶骇浠诲姟鍗�) 
         private void Sub_WriteInForm(DataTable oTable, int i)
         {
-            HSourceInterID_Bak = int.Parse(oTable.Rows[0]["hmainid"].ToString());
-            HSourceEntryID_Bak = int.Parse(oTable.Rows[0]["hsubid"].ToString());
-            HSourceBillNo_Bak = oTable.Rows[0]["鍗曟嵁鍙�"].ToString();
-            HSourceBIllType_Bak = oTable.Rows[0]["HBillType"].ToString();
-
-            //璁剧疆琛ㄥご鎺т欢鏁版嵁
-            txtHSourceBillNo.Text = oTable.Rows[0]["鍗曟嵁鍙�"].ToString();
-            textBox_HMaterNumber.Tag = oTable.Rows[0]["HMaterID"].ToString();
-            textBox_HMaterNumber.Text = oTable.Rows[0]["鐗╂枡浠g爜"].ToString();
-            textBox_HMaterName.Text = oTable.Rows[0]["鐗╂枡鍚嶇О"].ToString();
-            textBox_HMaterModel.Text = oTable.Rows[0]["瑙勬牸鍨嬪彿"].ToString();
-
             ////鍔犺浇琛ㄥご
             //this.txtHDeptID.Tag = oTable.Rows[0]["HDeptID"].ToString();
             //this.txtHDeptID.Text = oTable.Rows[0]["閮ㄩ棬鍚嶇О"].ToString();
@@ -2712,12 +2728,12 @@
             //grdMain.Rows[i].Cells[HSourceNumberCol].Value = oTable.Rows[0]["鐢熶骇绾夸唬鐮�"].ToString();
             grdMain.Rows[i].Cells[HSourceNameCol].Value = oTable.Rows[0]["鐢熶骇绾�"].ToString();
             grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["璁″垝瀹屽伐鏃ユ湡"].ToString();//鍗氭棩 鐢熶骇璁㈠崟 澶辨晥鏃ユ湡
-            if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�" )
+            if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�")
             {
                 grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["鏈敓鎴愭潯鐮佹暟閲�"]);
             }
-            else if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�"  
-                || cmbHBarCodeType.Text == "浠櫒鎴愬搧鏉$爜瑙勫垯" 
+            else if (cmbHBarCodeType.Text == "浠櫒澶栬喘浠舵潯鐮佹櫘閫氳鍒�"
+                || cmbHBarCodeType.Text == "浠櫒鎴愬搧鏉$爜瑙勫垯"
                 || cmbHBarCodeType.Text == "璇曞墏鎴愬搧鏉$爜瑙勫垯")
             {
                 grdMain.Rows[i].Cells[HMinQtyCol].Value = "1";
@@ -2731,6 +2747,16 @@
             grdMain.Rows[i].Cells[HISKFPERIODCol].Value = oTable.Rows[0]["HISKFPERIOD"].ToString();
             grdMain.Rows[i].Cells[HEXPUNITCol].Value = oTable.Rows[0]["HEXPUNIT"].ToString();
             grdMain.Rows[i].Cells[HEXPPERIODCol].Value = oTable.Rows[0]["HEXPPERIOD"].ToString();
+
+
+            //鑷姩鐢熸垚-璁剧疆鏁伴噺銆佹渶灏忓寘瑁呮暟銆佺鏁颁负1
+            grdMain.Rows[i].Cells[HQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HMinQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HBQtyCol].Value = 1;
+
+
+
+
             //--
             //璁剧疆鍙紪杈戝垪
             string sAllowCol = HQtyCol.ToString() +
@@ -2744,7 +2770,7 @@
             string sTotalCol = HQtyCol.ToString();
             //
             DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
-            tabControl1.SelectedIndex = 0;
+            tabControl1.SelectedIndex = 3;
             bc.Enabled = true;
             //
             RowCount(i, 0);
@@ -2806,7 +2832,7 @@
                 }
             }
             grdMain.Rows[i].Cells[HMakerCol].Value = ClsPub.CurUserName;
-            if (cmbSourceBillType.Text.Trim() == "鏀舵枡閫氱煡鍗�"|| cmbSourceBillType.Text.Trim() == "閲囪喘璁㈠崟"
+            if (cmbSourceBillType.Text.Trim() == "鏀舵枡閫氱煡鍗�" || cmbSourceBillType.Text.Trim() == "閲囪喘璁㈠崟"
                 || cmbSourceBillType.Text.Trim() == "濮斿璁㈠崟" || cmbSourceBillType.Text.Trim() == "閲囪喘鍏ュ簱鍗�")
             {
                 grdMain.Rows[i].Cells[HInnerBillNoCol].Value = oTable.Rows[0]["鍐呴儴閲囪喘璁㈠崟鍙�"].ToString();
@@ -2843,6 +2869,13 @@
                 grdMain.Rows[i].Cells[HSPNumberCol].Value = oTable.Rows[0]["浠撲綅浠g爜"].ToString();
                 grdMain.Rows[i].Cells[HSPNameCol].Value = oTable.Rows[0]["浠撲綅"].ToString();
             }
+
+            //鑷姩鐢熸垚-璁剧疆鏁伴噺銆佹渶灏忓寘瑁呮暟銆佺鏁颁负1
+            grdMain.Rows[i].Cells[HQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HMinQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HBQtyCol].Value = 1;
+
+
             //--
             //璁剧疆鍙紪杈戝垪
             string sAllowCol = HQtyCol.ToString() +
@@ -2855,7 +2888,7 @@
             string sTotalCol = HQtyCol.ToString();
             //
             DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
-            tabControl1.SelectedIndex = 0;
+            tabControl1.SelectedIndex = 3;
             bc.Enabled = true;
             //
             RowCount(i, 0);
@@ -2908,6 +2941,13 @@
             {
                 grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["鏁伴噺"]);
             }
+
+            //鑷姩鐢熸垚-璁剧疆鏁伴噺銆佹渶灏忓寘瑁呮暟銆佺鏁颁负1
+            grdMain.Rows[i].Cells[HQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HMinQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HBQtyCol].Value = 1;
+
+
             //--
             //璁剧疆鍙紪杈戝垪
             string sAllowCol = HQtyCol.ToString() +
@@ -2918,7 +2958,7 @@
             string sTotalCol = HQtyCol.ToString();
             //
             DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
-            tabControl1.SelectedIndex = 0;
+            tabControl1.SelectedIndex = 3;
             bc.Enabled = true;
             //
             RowCount(i, 0);
@@ -2966,6 +3006,13 @@
             {
                 grdMain.Rows[i].Cells[HMinQtyCol].Value = DBUtility.ClsPub.isSingle(oDs.Tables[0].Rows[0]["HMinPack"]);
             }
+
+            //鑷姩鐢熸垚-璁剧疆鏁伴噺銆佹渶灏忓寘瑁呮暟銆佺鏁颁负1
+            grdMain.Rows[i].Cells[HQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HMinQtyCol].Value = 1;
+            grdMain.Rows[i].Cells[HBQtyCol].Value = 1;
+
+
             //--
             //璁剧疆鍙紪杈戝垪
             string sAllowCol = HQtyCol.ToString() +
@@ -2979,7 +3026,7 @@
             string sTotalCol = HQtyCol.ToString();
             //
             DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
-            tabControl1.SelectedIndex = 0;
+            tabControl1.SelectedIndex = 3;
             bc.Enabled = true;
             //
             RowCount(i, 0);
@@ -2989,7 +3036,7 @@
         private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
         {
             int i = grdMain.CurrentCell.ColumnIndex;
-            if (DBUtility.Xt_BaseBillFun.AllowEdit(grdStatus, oSumGrid,i))
+            if (DBUtility.Xt_BaseBillFun.AllowEdit(grdStatus, oSumGrid, i))
             {
                 e.Cancel = true;
             }
@@ -3491,6 +3538,7 @@
 
         private void Display()
         {
+            //璁剧疆妗f鍒楄〃閫夐」鍗¤〃鏍兼暟鎹�
             DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
@@ -3506,8 +3554,41 @@
             DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol);
             //鐢荤嚎
             //GraphLine();
+        }
 
-            // 
+        // //璁剧疆宸ュ崟鏉$爜閫夐」鍗¤〃鏍兼暟鎹�
+        private void Display4()
+        {
+            if (grdMain.Rows.Count > 0)
+            {
+                //鏃ユ湡鑾峰彇鏂瑰紡
+                string sDate = dtpHDate.Value.ToShortDateString();                                                                                     //
+                string sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
+                string sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
+                sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
+                string sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
+                sDay = sDay.Substring(sDay.Length - 2, 2);
+
+                sDate = "20" + sYear + "-" + sPeriod + "-" + sDay;
+
+                //璁剧疆宸ュ崟鏉$爜閫夐」鍗¤〃鏍兼暟鎹�
+                string sql = "select * from h_v_IF_BarCodeBillList Where 婧愬崟鍗曞彿 = '" + grdMain.Rows[0].Cells[HBillNoCol].Value + "' and HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + sDate + "' order by 鏉$爜缂栧彿";
+                DataSet DSet1 = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
+                //鐢熸垚棣栬鏍囬
+                if (DSet1 == null)
+                {
+                    return;
+                }
+                //
+                grdBillBarCodeList.DataSource = DSet1.Tables[0].DefaultView;
+                //鍐荤粨
+                int FrCol = 0;
+                string s = "鏄�";
+                DBUtility.Xt_BaseBillFun.DisplayGrid(grdBillBarCodeList, this.Name + "grdBillBarCodeList", s, FrCol);
+                //鐢荤嚎
+                //GraphLine();
+                // 
+            }
         }
 
         //鍏宠仈鎸夐挳
@@ -3799,10 +3880,10 @@
                 //鍒锋柊鏁版嵁
                 Display();
             }
-            catch(Exception e1)
+            catch (Exception e1)
             {
                 //oCn.RollBack();
-                MessageBox.Show("鐢熸垚绠辩爜澶辫触锛�" + e1.Message );
+                MessageBox.Show("鐢熸垚绠辩爜澶辫触锛�" + e1.Message);
             }
         }
 
@@ -3849,5 +3930,210 @@
                 }
             }
         }
+
+        private void cmdSourceBillNo_Click_1(object sender, EventArgs e)
+        {
+            cmdSourceBillNo_Click(sender, e);
+        }
+
+        private void button_startListen_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (grdMain.Rows.Count == 0 || grdMain.Rows[0].Cells[HMaterIDCol].Value == null || grdMain.Rows[0].Cells[HMaterIDCol].Value.ToString() == "" || grdMain.Rows[0].Cells[HMaterIDCol].Value.ToString() == "0")
+                {
+                    MessageBox.Show("璇烽�夋嫨婧愬崟锛�");
+                    return;
+                }
+
+                socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                IPAddress iPAddress = IPAddress.Parse(textBox_IPParams.Text);
+                IPEndPoint point = new IPEndPoint(iPAddress, Convert.ToInt32(textBox_PortParams.Text));
+                socket.Connect(point);
+
+                Thread thread = new Thread(ReceiveMess);
+                thread.Start();
+                MessageBox.Show("杩炴帴鎴愬姛锛�");
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        //socket閫氳锛氬鎴风鎺ユ敹淇℃伅
+        private void ReceiveMess()
+        {
+            try
+            {
+                while (true)
+                {
+                    byte[] buffer = new byte[1024 * 1024 * 5];
+                    int length = socket.Receive(buffer);
+                    if (length == 0)
+                    {
+                        break;
+                    }
+                    else
+                    {
+                        string RMess = Encoding.UTF8.GetString(buffer, 0, length);
+                        long produceQty = ClsPub.isLong(RMess);
+
+                        for (int i = 0; i < produceQty; i++)
+                        {
+                            //鐢熸垚鏉$爜
+                            this.Sub_SaveBill();
+
+                            //鑾峰彇闇�瑕佹墦鍗扮殑鏁版嵁
+                            Display();
+
+                            //璁剧疆鎵撳嵃妯℃澘锛屾墦鍗�
+                            grdList.Rows[0].Cells[0].Value = "*";
+                            Report = new GridppReport();
+                            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams + ".grf");  //here .
+                            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
+                            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
+                            Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
+                            Report.Print(true);
+                        }
+
+                        //閲嶆柊鍔犺浇璇ョ墿鏂欏綋澶╃敓鎴愮殑鏉$爜
+                        Display4();
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("鎺ュ彛寮傚父锛屽凡鍏抽棴杩炴帴锛�" + ex.Message);
+                socket.Close();
+            }
+        }
+
+        private void button_stopListen_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (socket.Connected)
+                {
+                    socket.Close();
+                }
+                else
+                {
+                    MessageBox.Show("褰撳墠灏氭湭杩炴帴");
+                }
+
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        private void button_resetParams_Click(object sender, EventArgs e)
+        {
+            //comboBox_SourceNameParams.Items.Clear();
+            //comboBox_PrinterParams.Items.Clear();
+
+            //DBUtility.Xt_BaseBillFun.Sub_ClearBill(groupBox_ParamsInfo);
+        }
+
+        //鍐欏叆閰嶇疆鍙傛暟
+        private void saveParams()
+        {
+            //鍒ゆ柇鏂囦欢鏄惁瀛樺湪   
+            if (!File.Exists(Application.StartupPath + "//Gy_BarCodeBill_automaticallyByPLC.txt"))
+            {
+                FileStream fs1 = new FileStream(Application.StartupPath + "//Gy_BarCodeBill_automaticallyByPLC.txt", FileMode.Create, FileAccess.Write);//鍒涘缓鍐欏叆鏂囦欢    
+                StreamWriter sw = new StreamWriter(fs1);
+                sw.WriteLine(textBox_IPParams.Text);//寮�濮嬪啓鍏ュ��   
+                sw.WriteLine(textBox_PortParams.Text);
+
+                sw.WriteLine(comboBox_SourceNameParams.Text);
+
+                sw.WriteLine(comboBox_PrinterParams.Text);
+                sw.WriteLine(textBox_PrintModelParams.Text);
+                sw.Close();
+                fs1.Close();
+            }
+            else
+            {
+                FileStream fs1 = new FileStream(Application.StartupPath + "//Gy_BarCodeBill_automaticallyByPLC.txt", FileMode.Create, FileAccess.Write);//鍒涘缓鍐欏叆鏂囦欢    
+                StreamWriter sw = new StreamWriter(fs1);
+                sw.WriteLine(textBox_IPParams.Text);//寮�濮嬪啓鍏ュ��   
+                sw.WriteLine(textBox_PortParams.Text);
+
+                sw.WriteLine(comboBox_SourceNameParams.Text);
+
+                sw.WriteLine(comboBox_PrinterParams.Text);
+                sw.WriteLine(textBox_PrintModelParams.Text);
+                sw.Close();
+                fs1.Close();
+            }
+        }
+
+        private void readParams()
+        {
+            if (File.Exists(Application.StartupPath + "//Gy_BarCodeBill_automaticallyByPLC.txt"))
+            {
+                //璇诲彇鏂囦欢鍊煎苟鏄剧ず鍒扮獥浣�    
+                FileStream fs = new FileStream(Application.StartupPath + "//Gy_BarCodeBill_automaticallyByPLC.txt", FileMode.Open, FileAccess.ReadWrite);
+                StreamReader sr = new StreamReader(fs);
+                string line = sr.ReadLine();
+                int curLine = 0;
+                while (line != null)
+                {
+                    if (++curLine == 1)
+                    {
+                        textBox_IPParams.Text = line;
+                    }
+                    else if (curLine == 2)
+                    {
+                        textBox_PortParams.Text = line;
+                    }
+                    else if (curLine == 3)
+                    {
+                        for (int i = 0; i < comboBox_SourceNameParams.Items.Count; i++)
+                        {
+                            if (comboBox_SourceNameParams.Items[i].ToString() == line)
+                            {
+                                comboBox_SourceNameParams.Text = line;
+                            }
+                        }
+
+                        if (comboBox_SourceNameParams.Text == "")
+                        {
+                            comboBox_SourceNameParams.Items.Add(line);
+                            comboBox_SourceNameParams.Text = line;
+                        }
+                    }
+                    else if (curLine == 4)
+                    {
+                        for (int i = 0; i < comboBox_PrinterParams.Items.Count; i++)
+                        {
+                            if (comboBox_PrinterParams.Items[i].ToString() == line)
+                            {
+                                comboBox_PrinterParams.Text = line;
+                            }
+                        }
+                    }
+                    else if (curLine == 5)
+                    {
+                        textBox_PrintModelParams.Text = line;
+                    }
+                    else
+                    {
+
+                    }
+                    line = sr.ReadLine();
+                }
+                sr.Close();
+                fs.Close();
+            }        
+        }
+
+        private void button_saveParams_Click(object sender, EventArgs e)
+        {
+            saveParams();
+        }
     }
 }
\ No newline at end of file
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
similarity index 90%
rename from "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.designer.cs"
rename to "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
index fe33e2d..46ae0e7 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
@@ -1,6 +1,6 @@
 锘縩amespace WarM
 {
-    partial class Gy_BarCodeBill_automaticallyByPLC
+    partial class Gy_BarCodeBill_automaticallyByPLC_New
     {
         /// <summary>
         /// 蹇呴渶鐨勮璁″櫒鍙橀噺銆�
@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Gy_BarCodeBill_automaticallyByPLC));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Gy_BarCodeBill_automaticallyByPLC_New));
             this.Tool = new System.Windows.Forms.ToolStrip();
             this.dy = new System.Windows.Forms.ToolStripButton();
             this.sdy = new System.Windows.Forms.ToolStripButton();
@@ -59,22 +59,54 @@
             this.BatchNo = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.tc = new System.Windows.Forms.ToolStripButton();
+            this.lblCaption = new System.Windows.Forms.Label();
             this.P1 = new System.Windows.Forms.Panel();
+            this.tabControl_MainInfo = new System.Windows.Forms.TabControl();
+            this.tabPage_BillInfo = new System.Windows.Forms.TabPage();
             this.gbUp = new System.Windows.Forms.GroupBox();
+            this.cmdSourceBillNo = new System.Windows.Forms.Button();
             this.cmbHWorksNumber = new System.Windows.Forms.ComboBox();
             this.label4 = new System.Windows.Forms.Label();
-            this.dtpHDate = new System.Windows.Forms.DateTimePicker();
-            this.label2 = new System.Windows.Forms.Label();
             this.cmbHOrgID = new System.Windows.Forms.ComboBox();
-            this.label3 = new System.Windows.Forms.Label();
+            this.radioButton_HIsUsingBatchNo = new System.Windows.Forms.RadioButton();
+            this.label_SourceName = new System.Windows.Forms.Label();
+            this.button_stopListen = new System.Windows.Forms.Button();
+            this.textBox_SourceName = new System.Windows.Forms.TextBox();
+            this.dtpHDate = new System.Windows.Forms.DateTimePicker();
+            this.label_HMaterNumber = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.textBox_HMaterNumber = new System.Windows.Forms.TextBox();
+            this.button_startListen = new System.Windows.Forms.Button();
+            this.label_HMaterName = new System.Windows.Forms.Label();
             this.cmbHBarCodeType = new System.Windows.Forms.ComboBox();
+            this.textBox_HMaterName = new System.Windows.Forms.TextBox();
+            this.label_HMaterModel = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.cmdHEmpID = new System.Windows.Forms.Button();
-            this.cmdSourceBillNo = new System.Windows.Forms.Button();
-            this.txtHSourceBillNo = new System.Windows.Forms.TextBox();
-            this.label14 = new System.Windows.Forms.Label();
-            this.cmbSourceBillType = new System.Windows.Forms.ComboBox();
+            this.textBox_HMaterModel = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label_HPlanQty = new System.Windows.Forms.Label();
+            this.textBox_HQty = new System.Windows.Forms.TextBox();
+            this.textBox_HPlanQty = new System.Windows.Forms.TextBox();
             this.label10 = new System.Windows.Forms.Label();
+            this.txtHSourceBillNo = new System.Windows.Forms.TextBox();
+            this.cmbSourceBillType = new System.Windows.Forms.ComboBox();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label_HQty = new System.Windows.Forms.Label();
+            this.tabPage_ParamsInfo = new System.Windows.Forms.TabPage();
+            this.groupBox_ParamsInfo = new System.Windows.Forms.GroupBox();
+            this.button_resetParams = new System.Windows.Forms.Button();
+            this.button_saveParams = new System.Windows.Forms.Button();
+            this.textBox_PrintModelParams = new System.Windows.Forms.TextBox();
+            this.label_PrintModelParams = new System.Windows.Forms.Label();
+            this.comboBox_PrinterParams = new System.Windows.Forms.ComboBox();
+            this.label_PrinterParams = new System.Windows.Forms.Label();
+            this.comboBox_SourceNameParams = new System.Windows.Forms.ComboBox();
+            this.label_SourceNameParams = new System.Windows.Forms.Label();
+            this.textBox_PortParams = new System.Windows.Forms.TextBox();
+            this.label_PortParams = new System.Windows.Forms.Label();
+            this.textBox_IPParams = new System.Windows.Forms.TextBox();
+            this.label_IPParams = new System.Windows.Forms.Label();
+            this.pic1 = new System.Windows.Forms.PictureBox();
             this.panel2 = new System.Windows.Forms.Panel();
             this.txtHDeleteDate = new System.Windows.Forms.Label();
             this.label25 = new System.Windows.Forms.Label();
@@ -101,66 +133,35 @@
             this.panel3 = new System.Windows.Forms.Panel();
             this.grdSum = new System.Windows.Forms.DataGridView();
             this.grdPrint = new System.Windows.Forms.DataGridView();
-            this.pic1 = new System.Windows.Forms.PictureBox();
-            this.lblCaption = new System.Windows.Forms.Label();
-            this.tabControl_MainInfo = new System.Windows.Forms.TabControl();
-            this.tabPage_BillInfo = new System.Windows.Forms.TabPage();
-            this.tabPage_ParamsInfo = new System.Windows.Forms.TabPage();
-            this.groupBox_ParamsInfo = new System.Windows.Forms.GroupBox();
-            this.groupBox_BillInfo = new System.Windows.Forms.GroupBox();
-            this.label_SourceName = new System.Windows.Forms.Label();
-            this.textBox_SourceName = new System.Windows.Forms.TextBox();
-            this.textBox_HMaterNumber = new System.Windows.Forms.TextBox();
-            this.label_HMaterNumber = new System.Windows.Forms.Label();
-            this.textBox_HMaterName = new System.Windows.Forms.TextBox();
-            this.label_HMaterName = new System.Windows.Forms.Label();
-            this.textBox_HMaterModel = new System.Windows.Forms.TextBox();
-            this.label_HMaterModel = new System.Windows.Forms.Label();
-            this.textBox_HPlanQty = new System.Windows.Forms.TextBox();
-            this.label_HPlanQty = new System.Windows.Forms.Label();
-            this.textBox_HQty = new System.Windows.Forms.TextBox();
-            this.label_HQty = new System.Windows.Forms.Label();
-            this.button_startListen = new System.Windows.Forms.Button();
-            this.button_stopListen = new System.Windows.Forms.Button();
-            this.textBox_IPParams = new System.Windows.Forms.TextBox();
-            this.label_IPParams = new System.Windows.Forms.Label();
-            this.textBox1 = new System.Windows.Forms.TextBox();
-            this.label_PortParams = new System.Windows.Forms.Label();
-            this.comboBox_SourceNameParams = new System.Windows.Forms.ComboBox();
-            this.label_SourceNameParams = new System.Windows.Forms.Label();
-            this.comboBox_PrinterParams = new System.Windows.Forms.ComboBox();
-            this.label_PrinterParams = new System.Windows.Forms.Label();
-            this.textBox2 = new System.Windows.Forms.TextBox();
-            this.label_PrintModelParams = new System.Windows.Forms.Label();
-            this.button_saveParams = new System.Windows.Forms.Button();
-            this.button_resetParams = new System.Windows.Forms.Button();
-            this.tabPage1 = new System.Windows.Forms.TabPage();
-            this.grdMain = new System.Windows.Forms.DataGridView();
-            this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage3 = new System.Windows.Forms.TabPage();
             this.grdList = new System.Windows.Forms.DataGridView();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.grdSub = new System.Windows.Forms.DataGridView();
-            this.radioButton_HIsUsingBatchNo = new System.Windows.Forms.RadioButton();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.grdMain = new System.Windows.Forms.DataGridView();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage4 = new System.Windows.Forms.TabPage();
+            this.grdBillBarCodeList = new System.Windows.Forms.DataGridView();
             this.Tool.SuspendLayout();
             this.P1.SuspendLayout();
+            this.tabControl_MainInfo.SuspendLayout();
+            this.tabPage_BillInfo.SuspendLayout();
             this.gbUp.SuspendLayout();
+            this.tabPage_ParamsInfo.SuspendLayout();
+            this.groupBox_ParamsInfo.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdSum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.grdPrint)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
-            this.tabControl_MainInfo.SuspendLayout();
-            this.tabPage_BillInfo.SuspendLayout();
-            this.tabPage_ParamsInfo.SuspendLayout();
-            this.groupBox_ParamsInfo.SuspendLayout();
-            this.groupBox_BillInfo.SuspendLayout();
-            this.tabPage1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
-            this.tabControl1.SuspendLayout();
             this.tabPage3.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdList)).BeginInit();
             this.tabPage2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdSub)).BeginInit();
+            this.tabPage1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
+            this.tabControl1.SuspendLayout();
+            this.tabPage4.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdBillBarCodeList)).BeginInit();
             this.SuspendLayout();
             // 
             // Tool
@@ -218,6 +219,7 @@
             this.dy.Text = "鎵撳嵃";
             this.dy.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.dy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.dy.Visible = false;
             this.dy.Click += new System.EventHandler(this.dy_Click);
             // 
             // sdy
@@ -232,6 +234,7 @@
             this.sdy.Text = "娴忚";
             this.sdy.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.sdy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.sdy.Visible = false;
             this.sdy.Click += new System.EventHandler(this.sdy_Click);
             // 
             // yl
@@ -246,6 +249,7 @@
             this.yl.Text = "棰勮";
             this.yl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.yl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.yl.Visible = false;
             this.yl.Click += new System.EventHandler(this.yl_Click);
             // 
             // toolStripSeparator2
@@ -280,6 +284,7 @@
             this.spRow.Text = "鎷嗚";
             this.spRow.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.spRow.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.spRow.Visible = false;
             this.spRow.Click += new System.EventHandler(this.spRow_Click);
             // 
             // bc
@@ -308,6 +313,7 @@
             this.DelRow.Text = "鍒犺";
             this.DelRow.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.DelRow.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.DelRow.Visible = false;
             this.DelRow.Click += new System.EventHandler(this.DelRow_Click);
             // 
             // toolStripSeparator4
@@ -320,6 +326,7 @@
             // 
             this.toolStripSeparator8.Name = "toolStripSeparator8";
             this.toolStripSeparator8.Size = new System.Drawing.Size(6, 75);
+            this.toolStripSeparator8.Visible = false;
             // 
             // wxm
             // 
@@ -333,6 +340,7 @@
             this.wxm.Text = "澶栫鐮�";
             this.wxm.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.wxm.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.wxm.Visible = false;
             this.wxm.Click += new System.EventHandler(this.wxm_Click);
             // 
             // toolStripSeparator9
@@ -352,6 +360,7 @@
             this.cz.Text = "閲嶇疆";
             this.cz.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.cz.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.cz.Visible = false;
             this.cz.Click += new System.EventHandler(this.cz_Click);
             // 
             // toolStripSeparator5
@@ -371,6 +380,7 @@
             this.kc.Text = "搴撳瓨";
             this.kc.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.kc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.kc.Visible = false;
             this.kc.Click += new System.EventHandler(this.kc_Click);
             // 
             // toolStripSeparator1
@@ -437,6 +447,7 @@
             this.tb.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.tb.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
             this.tb.ToolTipText = "鍚屾鍩虹璧勬枡";
+            this.tb.Visible = false;
             this.tb.Click += new System.EventHandler(this.tb_Click);
             // 
             // toolStripSeparator6
@@ -456,6 +467,7 @@
             this.gl.Text = "鍏宠仈";
             this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.gl.Visible = false;
             this.gl.Click += new System.EventHandler(this.gl_Click);
             // 
             // toolStripSeparator7
@@ -475,6 +487,7 @@
             this.BatchNo.Text = "鎵规";
             this.BatchNo.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.BatchNo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.BatchNo.Visible = false;
             this.BatchNo.Click += new System.EventHandler(this.BatchNo_Click);
             // 
             // toolStripSeparator3
@@ -496,184 +509,527 @@
             this.tc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
             this.tc.Click += new System.EventHandler(this.tc_Click);
             // 
+            // lblCaption
+            // 
+            this.lblCaption.AutoSize = true;
+            this.lblCaption.Font = new System.Drawing.Font("瀹嬩綋", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lblCaption.Location = new System.Drawing.Point(752, 18);
+            this.lblCaption.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblCaption.Name = "lblCaption";
+            this.lblCaption.Size = new System.Drawing.Size(133, 29);
+            this.lblCaption.TabIndex = 18;
+            this.lblCaption.Text = "鍗曟嵁缂栬緫";
+            this.lblCaption.Visible = false;
+            // 
             // P1
             // 
             this.P1.BackColor = System.Drawing.Color.Lavender;
             this.P1.Controls.Add(this.tabControl_MainInfo);
             this.P1.Controls.Add(this.pic1);
             this.P1.Controls.Add(this.lblCaption);
-            this.P1.Controls.Add(this.gbUp);
             this.P1.Dock = System.Windows.Forms.DockStyle.Top;
             this.P1.Location = new System.Drawing.Point(62, 75);
-            this.P1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.P1.Margin = new System.Windows.Forms.Padding(4);
             this.P1.Name = "P1";
-            this.P1.Size = new System.Drawing.Size(1406, 369);
+            this.P1.Size = new System.Drawing.Size(1406, 358);
             this.P1.TabIndex = 31;
+            // 
+            // tabControl_MainInfo
+            // 
+            this.tabControl_MainInfo.Controls.Add(this.tabPage_BillInfo);
+            this.tabControl_MainInfo.Controls.Add(this.tabPage_ParamsInfo);
+            this.tabControl_MainInfo.Location = new System.Drawing.Point(3, 4);
+            this.tabControl_MainInfo.Name = "tabControl_MainInfo";
+            this.tabControl_MainInfo.SelectedIndex = 0;
+            this.tabControl_MainInfo.Size = new System.Drawing.Size(1395, 346);
+            this.tabControl_MainInfo.TabIndex = 38;
+            // 
+            // tabPage_BillInfo
+            // 
+            this.tabPage_BillInfo.BackColor = System.Drawing.Color.Lavender;
+            this.tabPage_BillInfo.Controls.Add(this.gbUp);
+            this.tabPage_BillInfo.Location = new System.Drawing.Point(4, 28);
+            this.tabPage_BillInfo.Name = "tabPage_BillInfo";
+            this.tabPage_BillInfo.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage_BillInfo.Size = new System.Drawing.Size(1387, 314);
+            this.tabPage_BillInfo.TabIndex = 0;
+            this.tabPage_BillInfo.Text = "宸ュ崟淇℃伅";
             // 
             // gbUp
             // 
             this.gbUp.BackColor = System.Drawing.Color.Transparent;
+            this.gbUp.Controls.Add(this.cmdSourceBillNo);
             this.gbUp.Controls.Add(this.cmbHWorksNumber);
             this.gbUp.Controls.Add(this.label4);
-            this.gbUp.Controls.Add(this.cmdHEmpID);
-            this.gbUp.Location = new System.Drawing.Point(21, 58);
-            this.gbUp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.gbUp.Controls.Add(this.cmbHOrgID);
+            this.gbUp.Controls.Add(this.radioButton_HIsUsingBatchNo);
+            this.gbUp.Controls.Add(this.label_SourceName);
+            this.gbUp.Controls.Add(this.button_stopListen);
+            this.gbUp.Controls.Add(this.textBox_SourceName);
+            this.gbUp.Controls.Add(this.dtpHDate);
+            this.gbUp.Controls.Add(this.label_HMaterNumber);
+            this.gbUp.Controls.Add(this.label2);
+            this.gbUp.Controls.Add(this.textBox_HMaterNumber);
+            this.gbUp.Controls.Add(this.button_startListen);
+            this.gbUp.Controls.Add(this.label_HMaterName);
+            this.gbUp.Controls.Add(this.cmbHBarCodeType);
+            this.gbUp.Controls.Add(this.textBox_HMaterName);
+            this.gbUp.Controls.Add(this.label_HMaterModel);
+            this.gbUp.Controls.Add(this.label1);
+            this.gbUp.Controls.Add(this.textBox_HMaterModel);
+            this.gbUp.Controls.Add(this.label3);
+            this.gbUp.Controls.Add(this.label_HPlanQty);
+            this.gbUp.Controls.Add(this.textBox_HQty);
+            this.gbUp.Controls.Add(this.textBox_HPlanQty);
+            this.gbUp.Controls.Add(this.label10);
+            this.gbUp.Controls.Add(this.txtHSourceBillNo);
+            this.gbUp.Controls.Add(this.cmbSourceBillType);
+            this.gbUp.Controls.Add(this.label14);
+            this.gbUp.Controls.Add(this.label_HQty);
+            this.gbUp.Location = new System.Drawing.Point(4, 4);
+            this.gbUp.Margin = new System.Windows.Forms.Padding(4);
             this.gbUp.Name = "gbUp";
-            this.gbUp.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.gbUp.Size = new System.Drawing.Size(1338, 120);
+            this.gbUp.Padding = new System.Windows.Forms.Padding(4);
+            this.gbUp.Size = new System.Drawing.Size(1379, 310);
             this.gbUp.TabIndex = 33;
             this.gbUp.TabStop = false;
+            // 
+            // cmdSourceBillNo
+            // 
+            this.cmdSourceBillNo.Image = ((System.Drawing.Image)(resources.GetObject("cmdSourceBillNo.Image")));
+            this.cmdSourceBillNo.ImageAlign = System.Drawing.ContentAlignment.TopRight;
+            this.cmdSourceBillNo.Location = new System.Drawing.Point(1214, 11);
+            this.cmdSourceBillNo.Margin = new System.Windows.Forms.Padding(4);
+            this.cmdSourceBillNo.Name = "cmdSourceBillNo";
+            this.cmdSourceBillNo.Size = new System.Drawing.Size(33, 33);
+            this.cmdSourceBillNo.TabIndex = 99;
+            this.cmdSourceBillNo.UseVisualStyleBackColor = true;
+            this.cmdSourceBillNo.Click += new System.EventHandler(this.cmdSourceBillNo_Click_1);
             // 
             // cmbHWorksNumber
             // 
             this.cmbHWorksNumber.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cmbHWorksNumber.FormattingEnabled = true;
-            this.cmbHWorksNumber.Location = new System.Drawing.Point(591, 26);
-            this.cmbHWorksNumber.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cmbHWorksNumber.Location = new System.Drawing.Point(973, 250);
+            this.cmbHWorksNumber.Margin = new System.Windows.Forms.Padding(4);
             this.cmbHWorksNumber.Name = "cmbHWorksNumber";
             this.cmbHWorksNumber.Size = new System.Drawing.Size(280, 26);
             this.cmbHWorksNumber.TabIndex = 98;
+            this.cmbHWorksNumber.Visible = false;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.ForeColor = System.Drawing.Color.Black;
-            this.label4.Location = new System.Drawing.Point(490, 32);
+            this.label4.Location = new System.Drawing.Point(872, 256);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(80, 18);
             this.label4.TabIndex = 97;
             this.label4.Text = "宸ュ巶浠g爜";
+            this.label4.Visible = false;
+            // 
+            // cmbHOrgID
+            // 
+            this.cmbHOrgID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbHOrgID.FormattingEnabled = true;
+            this.cmbHOrgID.Location = new System.Drawing.Point(121, 21);
+            this.cmbHOrgID.Margin = new System.Windows.Forms.Padding(4);
+            this.cmbHOrgID.Name = "cmbHOrgID";
+            this.cmbHOrgID.Size = new System.Drawing.Size(280, 26);
+            this.cmbHOrgID.TabIndex = 85;
+            // 
+            // radioButton_HIsUsingBatchNo
+            // 
+            this.radioButton_HIsUsingBatchNo.AutoSize = true;
+            this.radioButton_HIsUsingBatchNo.Location = new System.Drawing.Point(874, 190);
+            this.radioButton_HIsUsingBatchNo.Name = "radioButton_HIsUsingBatchNo";
+            this.radioButton_HIsUsingBatchNo.Size = new System.Drawing.Size(141, 22);
+            this.radioButton_HIsUsingBatchNo.TabIndex = 98;
+            this.radioButton_HIsUsingBatchNo.TabStop = true;
+            this.radioButton_HIsUsingBatchNo.Text = "鏄惁鍚敤鎵规";
+            this.radioButton_HIsUsingBatchNo.UseVisualStyleBackColor = true;
+            // 
+            // label_SourceName
+            // 
+            this.label_SourceName.AutoSize = true;
+            this.label_SourceName.Location = new System.Drawing.Point(20, 84);
+            this.label_SourceName.Name = "label_SourceName";
+            this.label_SourceName.Size = new System.Drawing.Size(80, 18);
+            this.label_SourceName.TabIndex = 0;
+            this.label_SourceName.Text = "浜�    绾�";
+            // 
+            // button_stopListen
+            // 
+            this.button_stopListen.Location = new System.Drawing.Point(404, 250);
+            this.button_stopListen.Name = "button_stopListen";
+            this.button_stopListen.Size = new System.Drawing.Size(151, 35);
+            this.button_stopListen.TabIndex = 97;
+            this.button_stopListen.Text = "鍋滄鐩戝惉";
+            this.button_stopListen.UseVisualStyleBackColor = true;
+            this.button_stopListen.Click += new System.EventHandler(this.button_stopListen_Click);
+            // 
+            // textBox_SourceName
+            // 
+            this.textBox_SourceName.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_SourceName.Enabled = false;
+            this.textBox_SourceName.Location = new System.Drawing.Point(122, 81);
+            this.textBox_SourceName.Name = "textBox_SourceName";
+            this.textBox_SourceName.Size = new System.Drawing.Size(280, 28);
+            this.textBox_SourceName.TabIndex = 43;
             // 
             // dtpHDate
             // 
             this.dtpHDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
-            this.dtpHDate.Location = new System.Drawing.Point(975, 85);
+            this.dtpHDate.Location = new System.Drawing.Point(967, 74);
             this.dtpHDate.Name = "dtpHDate";
             this.dtpHDate.Size = new System.Drawing.Size(280, 28);
             this.dtpHDate.TabIndex = 96;
             // 
+            // label_HMaterNumber
+            // 
+            this.label_HMaterNumber.AutoSize = true;
+            this.label_HMaterNumber.Location = new System.Drawing.Point(19, 140);
+            this.label_HMaterNumber.Name = "label_HMaterNumber";
+            this.label_HMaterNumber.Size = new System.Drawing.Size(80, 18);
+            this.label_HMaterNumber.TabIndex = 86;
+            this.label_HMaterNumber.Text = "鐗╂枡浠g爜";
+            // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(875, 91);
+            this.label2.Location = new System.Drawing.Point(867, 80);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(80, 18);
             this.label2.TabIndex = 95;
             this.label2.Text = "鏃�    鏈�";
             // 
-            // cmbHOrgID
+            // textBox_HMaterNumber
             // 
-            this.cmbHOrgID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbHOrgID.Enabled = false;
-            this.cmbHOrgID.FormattingEnabled = true;
-            this.cmbHOrgID.Location = new System.Drawing.Point(126, 30);
-            this.cmbHOrgID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.cmbHOrgID.Name = "cmbHOrgID";
-            this.cmbHOrgID.Size = new System.Drawing.Size(280, 26);
-            this.cmbHOrgID.TabIndex = 85;
+            this.textBox_HMaterNumber.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_HMaterNumber.Enabled = false;
+            this.textBox_HMaterNumber.Location = new System.Drawing.Point(121, 137);
+            this.textBox_HMaterNumber.Name = "textBox_HMaterNumber";
+            this.textBox_HMaterNumber.Size = new System.Drawing.Size(280, 28);
+            this.textBox_HMaterNumber.TabIndex = 87;
             // 
-            // label3
+            // button_startListen
             // 
-            this.label3.AutoSize = true;
-            this.label3.ForeColor = System.Drawing.Color.Black;
-            this.label3.Location = new System.Drawing.Point(26, 36);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(80, 18);
-            this.label3.TabIndex = 84;
-            this.label3.Text = "缁�    缁�";
+            this.button_startListen.Location = new System.Drawing.Point(214, 250);
+            this.button_startListen.Name = "button_startListen";
+            this.button_startListen.Size = new System.Drawing.Size(133, 35);
+            this.button_startListen.TabIndex = 96;
+            this.button_startListen.Text = "寮�濮嬬洃鍚�";
+            this.button_startListen.UseVisualStyleBackColor = true;
+            this.button_startListen.Click += new System.EventHandler(this.button_startListen_Click);
+            // 
+            // label_HMaterName
+            // 
+            this.label_HMaterName.AutoSize = true;
+            this.label_HMaterName.Location = new System.Drawing.Point(445, 140);
+            this.label_HMaterName.Name = "label_HMaterName";
+            this.label_HMaterName.Size = new System.Drawing.Size(80, 18);
+            this.label_HMaterName.TabIndex = 88;
+            this.label_HMaterName.Text = "鐗╂枡鍚嶇О";
             // 
             // cmbHBarCodeType
             // 
             this.cmbHBarCodeType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cmbHBarCodeType.FormattingEnabled = true;
-            this.cmbHBarCodeType.Location = new System.Drawing.Point(554, 87);
-            this.cmbHBarCodeType.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cmbHBarCodeType.Location = new System.Drawing.Point(550, 80);
+            this.cmbHBarCodeType.Margin = new System.Windows.Forms.Padding(4);
             this.cmbHBarCodeType.Name = "cmbHBarCodeType";
             this.cmbHBarCodeType.Size = new System.Drawing.Size(280, 26);
             this.cmbHBarCodeType.TabIndex = 81;
+            // 
+            // textBox_HMaterName
+            // 
+            this.textBox_HMaterName.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_HMaterName.Enabled = false;
+            this.textBox_HMaterName.Location = new System.Drawing.Point(550, 135);
+            this.textBox_HMaterName.Name = "textBox_HMaterName";
+            this.textBox_HMaterName.Size = new System.Drawing.Size(280, 28);
+            this.textBox_HMaterName.TabIndex = 89;
+            // 
+            // label_HMaterModel
+            // 
+            this.label_HMaterModel.AutoSize = true;
+            this.label_HMaterModel.Location = new System.Drawing.Point(871, 140);
+            this.label_HMaterModel.Name = "label_HMaterModel";
+            this.label_HMaterModel.Size = new System.Drawing.Size(80, 18);
+            this.label_HMaterModel.TabIndex = 90;
+            this.label_HMaterModel.Text = "瑙勬牸鍨嬪彿";
             // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.ForeColor = System.Drawing.Color.Black;
-            this.label1.Location = new System.Drawing.Point(454, 93);
+            this.label1.Location = new System.Drawing.Point(450, 86);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(80, 18);
             this.label1.TabIndex = 80;
             this.label1.Text = "鏉$爜绫诲瀷";
             // 
-            // cmdHEmpID
+            // textBox_HMaterModel
             // 
-            this.cmdHEmpID.BackColor = System.Drawing.Color.Transparent;
-            this.cmdHEmpID.Image = ((System.Drawing.Image)(resources.GetObject("cmdHEmpID.Image")));
-            this.cmdHEmpID.ImageAlign = System.Drawing.ContentAlignment.TopRight;
-            this.cmdHEmpID.Location = new System.Drawing.Point(1338, -10);
-            this.cmdHEmpID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.cmdHEmpID.Name = "cmdHEmpID";
-            this.cmdHEmpID.Size = new System.Drawing.Size(33, 33);
-            this.cmdHEmpID.TabIndex = 79;
-            this.cmdHEmpID.UseVisualStyleBackColor = false;
-            this.cmdHEmpID.Visible = false;
+            this.textBox_HMaterModel.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_HMaterModel.Enabled = false;
+            this.textBox_HMaterModel.Location = new System.Drawing.Point(973, 137);
+            this.textBox_HMaterModel.Name = "textBox_HMaterModel";
+            this.textBox_HMaterModel.Size = new System.Drawing.Size(280, 28);
+            this.textBox_HMaterModel.TabIndex = 91;
             // 
-            // cmdSourceBillNo
+            // label3
             // 
-            this.cmdSourceBillNo.Image = ((System.Drawing.Image)(resources.GetObject("cmdSourceBillNo.Image")));
-            this.cmdSourceBillNo.ImageAlign = System.Drawing.ContentAlignment.TopRight;
-            this.cmdSourceBillNo.Location = new System.Drawing.Point(1225, 31);
-            this.cmdSourceBillNo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.cmdSourceBillNo.Name = "cmdSourceBillNo";
-            this.cmdSourceBillNo.Size = new System.Drawing.Size(33, 33);
-            this.cmdSourceBillNo.TabIndex = 42;
-            this.cmdSourceBillNo.UseVisualStyleBackColor = true;
-            this.cmdSourceBillNo.Click += new System.EventHandler(this.cmdSourceBillNo_Click);
+            this.label3.AutoSize = true;
+            this.label3.ForeColor = System.Drawing.Color.Black;
+            this.label3.Location = new System.Drawing.Point(21, 27);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(80, 18);
+            this.label3.TabIndex = 84;
+            this.label3.Text = "缁�    缁�";
+            // 
+            // label_HPlanQty
+            // 
+            this.label_HPlanQty.AutoSize = true;
+            this.label_HPlanQty.Location = new System.Drawing.Point(19, 192);
+            this.label_HPlanQty.Name = "label_HPlanQty";
+            this.label_HPlanQty.Size = new System.Drawing.Size(80, 18);
+            this.label_HPlanQty.TabIndex = 92;
+            this.label_HPlanQty.Text = "璁″垝鏁伴噺";
+            this.label_HPlanQty.Visible = false;
+            // 
+            // textBox_HQty
+            // 
+            this.textBox_HQty.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_HQty.Enabled = false;
+            this.textBox_HQty.Location = new System.Drawing.Point(550, 189);
+            this.textBox_HQty.Name = "textBox_HQty";
+            this.textBox_HQty.Size = new System.Drawing.Size(280, 28);
+            this.textBox_HQty.TabIndex = 95;
+            this.textBox_HQty.Visible = false;
+            this.textBox_HQty.WordWrap = false;
+            // 
+            // textBox_HPlanQty
+            // 
+            this.textBox_HPlanQty.BackColor = System.Drawing.SystemColors.ScrollBar;
+            this.textBox_HPlanQty.Enabled = false;
+            this.textBox_HPlanQty.Location = new System.Drawing.Point(121, 189);
+            this.textBox_HPlanQty.Name = "textBox_HPlanQty";
+            this.textBox_HPlanQty.Size = new System.Drawing.Size(280, 28);
+            this.textBox_HPlanQty.TabIndex = 93;
+            this.textBox_HPlanQty.Visible = false;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.ForeColor = System.Drawing.Color.Black;
+            this.label10.Location = new System.Drawing.Point(450, 25);
+            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(80, 18);
+            this.label10.TabIndex = 35;
+            this.label10.Text = "婧愬崟绫诲瀷";
             // 
             // txtHSourceBillNo
             // 
             this.txtHSourceBillNo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-            this.txtHSourceBillNo.Location = new System.Drawing.Point(976, 32);
-            this.txtHSourceBillNo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.txtHSourceBillNo.Location = new System.Drawing.Point(967, 15);
+            this.txtHSourceBillNo.Margin = new System.Windows.Forms.Padding(4);
             this.txtHSourceBillNo.Name = "txtHSourceBillNo";
             this.txtHSourceBillNo.Size = new System.Drawing.Size(247, 28);
             this.txtHSourceBillNo.TabIndex = 41;
             this.txtHSourceBillNo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtHSourceBillNo_KeyPress);
             // 
+            // cmbSourceBillType
+            // 
+            this.cmbSourceBillType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbSourceBillType.FormattingEnabled = true;
+            this.cmbSourceBillType.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+            this.cmbSourceBillType.Location = new System.Drawing.Point(550, 19);
+            this.cmbSourceBillType.Margin = new System.Windows.Forms.Padding(4);
+            this.cmbSourceBillType.Name = "cmbSourceBillType";
+            this.cmbSourceBillType.Size = new System.Drawing.Size(280, 26);
+            this.cmbSourceBillType.TabIndex = 36;
+            this.cmbSourceBillType.TextChanged += new System.EventHandler(this.cmbSourceBillType_TextChanged);
+            // 
             // label14
             // 
             this.label14.AutoSize = true;
             this.label14.ForeColor = System.Drawing.Color.Black;
-            this.label14.Location = new System.Drawing.Point(875, 38);
+            this.label14.Location = new System.Drawing.Point(866, 21);
             this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(80, 18);
             this.label14.TabIndex = 40;
             this.label14.Text = "閫� 鍗� 鍙�";
             // 
-            // cmbSourceBillType
+            // label_HQty
             // 
-            this.cmbSourceBillType.BackColor = System.Drawing.SystemColors.Window;
-            this.cmbSourceBillType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbSourceBillType.FormattingEnabled = true;
-            this.cmbSourceBillType.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-            this.cmbSourceBillType.Location = new System.Drawing.Point(554, 30);
-            this.cmbSourceBillType.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.cmbSourceBillType.Name = "cmbSourceBillType";
-            this.cmbSourceBillType.Size = new System.Drawing.Size(280, 26);
-            this.cmbSourceBillType.TabIndex = 36;
-            this.cmbSourceBillType.TextChanged += new System.EventHandler(this.cmbSourceBillType_TextChanged);
+            this.label_HQty.AutoSize = true;
+            this.label_HQty.Location = new System.Drawing.Point(445, 194);
+            this.label_HQty.Name = "label_HQty";
+            this.label_HQty.Size = new System.Drawing.Size(80, 18);
+            this.label_HQty.TabIndex = 94;
+            this.label_HQty.Text = "鐢熸垚鏁伴噺";
+            this.label_HQty.Visible = false;
             // 
-            // label10
+            // tabPage_ParamsInfo
             // 
-            this.label10.AutoSize = true;
-            this.label10.ForeColor = System.Drawing.Color.Black;
-            this.label10.Location = new System.Drawing.Point(454, 36);
-            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(80, 18);
-            this.label10.TabIndex = 35;
-            this.label10.Text = "婧愬崟绫诲瀷";
+            this.tabPage_ParamsInfo.BackColor = System.Drawing.Color.Lavender;
+            this.tabPage_ParamsInfo.Controls.Add(this.groupBox_ParamsInfo);
+            this.tabPage_ParamsInfo.Location = new System.Drawing.Point(4, 28);
+            this.tabPage_ParamsInfo.Name = "tabPage_ParamsInfo";
+            this.tabPage_ParamsInfo.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage_ParamsInfo.Size = new System.Drawing.Size(1387, 314);
+            this.tabPage_ParamsInfo.TabIndex = 1;
+            this.tabPage_ParamsInfo.Text = "閰嶇疆淇℃伅";
+            // 
+            // groupBox_ParamsInfo
+            // 
+            this.groupBox_ParamsInfo.Controls.Add(this.button_resetParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.button_saveParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.textBox_PrintModelParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.label_PrintModelParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.comboBox_PrinterParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.label_PrinterParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.comboBox_SourceNameParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.label_SourceNameParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.textBox_PortParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.label_PortParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.textBox_IPParams);
+            this.groupBox_ParamsInfo.Controls.Add(this.label_IPParams);
+            this.groupBox_ParamsInfo.Location = new System.Drawing.Point(6, 6);
+            this.groupBox_ParamsInfo.Name = "groupBox_ParamsInfo";
+            this.groupBox_ParamsInfo.Size = new System.Drawing.Size(1287, 320);
+            this.groupBox_ParamsInfo.TabIndex = 0;
+            this.groupBox_ParamsInfo.TabStop = false;
+            // 
+            // button_resetParams
+            // 
+            this.button_resetParams.Location = new System.Drawing.Point(590, 173);
+            this.button_resetParams.Name = "button_resetParams";
+            this.button_resetParams.Size = new System.Drawing.Size(89, 40);
+            this.button_resetParams.TabIndex = 105;
+            this.button_resetParams.Text = "閲�  缃�";
+            this.button_resetParams.UseVisualStyleBackColor = true;
+            this.button_resetParams.Click += new System.EventHandler(this.button_resetParams_Click);
+            // 
+            // button_saveParams
+            // 
+            this.button_saveParams.Location = new System.Drawing.Point(377, 173);
+            this.button_saveParams.Name = "button_saveParams";
+            this.button_saveParams.Size = new System.Drawing.Size(89, 40);
+            this.button_saveParams.TabIndex = 104;
+            this.button_saveParams.Text = "淇�  瀛�";
+            this.button_saveParams.UseVisualStyleBackColor = true;
+            this.button_saveParams.Click += new System.EventHandler(this.button_saveParams_Click);
+            // 
+            // textBox_PrintModelParams
+            // 
+            this.textBox_PrintModelParams.BackColor = System.Drawing.SystemColors.Window;
+            this.textBox_PrintModelParams.Location = new System.Drawing.Point(554, 78);
+            this.textBox_PrintModelParams.Name = "textBox_PrintModelParams";
+            this.textBox_PrintModelParams.Size = new System.Drawing.Size(280, 28);
+            this.textBox_PrintModelParams.TabIndex = 103;
+            // 
+            // label_PrintModelParams
+            // 
+            this.label_PrintModelParams.AutoSize = true;
+            this.label_PrintModelParams.Location = new System.Drawing.Point(452, 81);
+            this.label_PrintModelParams.Name = "label_PrintModelParams";
+            this.label_PrintModelParams.Size = new System.Drawing.Size(80, 18);
+            this.label_PrintModelParams.TabIndex = 102;
+            this.label_PrintModelParams.Text = "鎵撳嵃妯℃澘";
+            // 
+            // comboBox_PrinterParams
+            // 
+            this.comboBox_PrinterParams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_PrinterParams.FormattingEnabled = true;
+            this.comboBox_PrinterParams.Location = new System.Drawing.Point(113, 78);
+            this.comboBox_PrinterParams.Margin = new System.Windows.Forms.Padding(4);
+            this.comboBox_PrinterParams.Name = "comboBox_PrinterParams";
+            this.comboBox_PrinterParams.Size = new System.Drawing.Size(280, 26);
+            this.comboBox_PrinterParams.TabIndex = 101;
+            // 
+            // label_PrinterParams
+            // 
+            this.label_PrinterParams.AutoSize = true;
+            this.label_PrinterParams.ForeColor = System.Drawing.Color.Black;
+            this.label_PrinterParams.Location = new System.Drawing.Point(13, 84);
+            this.label_PrinterParams.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label_PrinterParams.Name = "label_PrinterParams";
+            this.label_PrinterParams.Size = new System.Drawing.Size(80, 18);
+            this.label_PrinterParams.TabIndex = 100;
+            this.label_PrinterParams.Text = "鎵� 鍗� 鏈�";
+            // 
+            // comboBox_SourceNameParams
+            // 
+            this.comboBox_SourceNameParams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_SourceNameParams.FormattingEnabled = true;
+            this.comboBox_SourceNameParams.Location = new System.Drawing.Point(973, 31);
+            this.comboBox_SourceNameParams.Margin = new System.Windows.Forms.Padding(4);
+            this.comboBox_SourceNameParams.Name = "comboBox_SourceNameParams";
+            this.comboBox_SourceNameParams.Size = new System.Drawing.Size(280, 26);
+            this.comboBox_SourceNameParams.TabIndex = 99;
+            // 
+            // label_SourceNameParams
+            // 
+            this.label_SourceNameParams.AutoSize = true;
+            this.label_SourceNameParams.ForeColor = System.Drawing.Color.Black;
+            this.label_SourceNameParams.Location = new System.Drawing.Point(873, 37);
+            this.label_SourceNameParams.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label_SourceNameParams.Name = "label_SourceNameParams";
+            this.label_SourceNameParams.Size = new System.Drawing.Size(80, 18);
+            this.label_SourceNameParams.TabIndex = 98;
+            this.label_SourceNameParams.Text = "浜�    绾�";
+            // 
+            // textBox_PortParams
+            // 
+            this.textBox_PortParams.BackColor = System.Drawing.SystemColors.Window;
+            this.textBox_PortParams.Location = new System.Drawing.Point(558, 31);
+            this.textBox_PortParams.Name = "textBox_PortParams";
+            this.textBox_PortParams.Size = new System.Drawing.Size(280, 28);
+            this.textBox_PortParams.TabIndex = 97;
+            // 
+            // label_PortParams
+            // 
+            this.label_PortParams.AutoSize = true;
+            this.label_PortParams.Location = new System.Drawing.Point(456, 34);
+            this.label_PortParams.Name = "label_PortParams";
+            this.label_PortParams.Size = new System.Drawing.Size(80, 18);
+            this.label_PortParams.TabIndex = 96;
+            this.label_PortParams.Text = "绔�    鍙�";
+            // 
+            // textBox_IPParams
+            // 
+            this.textBox_IPParams.BackColor = System.Drawing.SystemColors.Window;
+            this.textBox_IPParams.Location = new System.Drawing.Point(113, 28);
+            this.textBox_IPParams.Name = "textBox_IPParams";
+            this.textBox_IPParams.Size = new System.Drawing.Size(280, 28);
+            this.textBox_IPParams.TabIndex = 95;
+            // 
+            // label_IPParams
+            // 
+            this.label_IPParams.AutoSize = true;
+            this.label_IPParams.Location = new System.Drawing.Point(11, 31);
+            this.label_IPParams.Name = "label_IPParams";
+            this.label_IPParams.Size = new System.Drawing.Size(71, 18);
+            this.label_IPParams.TabIndex = 94;
+            this.label_IPParams.Text = "     IP";
+            // 
+            // pic1
+            // 
+            this.pic1.Location = new System.Drawing.Point(470, 4);
+            this.pic1.Margin = new System.Windows.Forms.Padding(4);
+            this.pic1.Name = "pic1";
+            this.pic1.Size = new System.Drawing.Size(117, 62);
+            this.pic1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pic1.TabIndex = 36;
+            this.pic1.TabStop = false;
+            this.pic1.Visible = false;
             // 
             // panel2
             // 
@@ -700,7 +1056,7 @@
             this.panel2.Controls.Add(this.label8);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.panel2.Location = new System.Drawing.Point(62, 758);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(1406, 140);
             this.panel2.TabIndex = 32;
@@ -934,7 +1290,7 @@
             // 
             this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
             this.panel1.Location = new System.Drawing.Point(0, 75);
-            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel1.Margin = new System.Windows.Forms.Padding(4);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(62, 823);
             this.panel1.TabIndex = 33;
@@ -943,7 +1299,7 @@
             // 
             this.panel3.Dock = System.Windows.Forms.DockStyle.Right;
             this.panel3.Location = new System.Drawing.Point(1468, 75);
-            this.panel3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel3.Margin = new System.Windows.Forms.Padding(4);
             this.panel3.Name = "panel3";
             this.panel3.Size = new System.Drawing.Size(58, 823);
             this.panel3.TabIndex = 34;
@@ -956,7 +1312,7 @@
             this.grdSum.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.grdSum.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.grdSum.Location = new System.Drawing.Point(62, 730);
-            this.grdSum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.grdSum.Margin = new System.Windows.Forms.Padding(4);
             this.grdSum.Name = "grdSum";
             this.grdSum.ReadOnly = true;
             this.grdSum.RowHeadersWidth = 51;
@@ -969,7 +1325,7 @@
             // 
             this.grdPrint.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.grdPrint.Location = new System.Drawing.Point(1214, 814);
-            this.grdPrint.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.grdPrint.Margin = new System.Windows.Forms.Padding(4);
             this.grdPrint.Name = "grdPrint";
             this.grdPrint.RowHeadersWidth = 51;
             this.grdPrint.RowTemplate.Height = 23;
@@ -977,408 +1333,13 @@
             this.grdPrint.TabIndex = 46;
             this.grdPrint.Visible = false;
             // 
-            // pic1
-            // 
-            this.pic1.Location = new System.Drawing.Point(470, 4);
-            this.pic1.Margin = new System.Windows.Forms.Padding(4);
-            this.pic1.Name = "pic1";
-            this.pic1.Size = new System.Drawing.Size(117, 62);
-            this.pic1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.pic1.TabIndex = 36;
-            this.pic1.TabStop = false;
-            this.pic1.Visible = false;
-            // 
-            // lblCaption
-            // 
-            this.lblCaption.AutoSize = true;
-            this.lblCaption.Font = new System.Drawing.Font("瀹嬩綋", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lblCaption.Location = new System.Drawing.Point(752, 18);
-            this.lblCaption.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lblCaption.Name = "lblCaption";
-            this.lblCaption.Size = new System.Drawing.Size(133, 29);
-            this.lblCaption.TabIndex = 18;
-            this.lblCaption.Text = "鍗曟嵁缂栬緫";
-            // 
-            // tabControl_MainInfo
-            // 
-            this.tabControl_MainInfo.Controls.Add(this.tabPage_BillInfo);
-            this.tabControl_MainInfo.Controls.Add(this.tabPage_ParamsInfo);
-            this.tabControl_MainInfo.Location = new System.Drawing.Point(8, 4);
-            this.tabControl_MainInfo.Name = "tabControl_MainInfo";
-            this.tabControl_MainInfo.SelectedIndex = 0;
-            this.tabControl_MainInfo.Size = new System.Drawing.Size(1307, 364);
-            this.tabControl_MainInfo.TabIndex = 37;
-            // 
-            // tabPage_BillInfo
-            // 
-            this.tabPage_BillInfo.BackColor = System.Drawing.Color.Lavender;
-            this.tabPage_BillInfo.Controls.Add(this.groupBox_BillInfo);
-            this.tabPage_BillInfo.Location = new System.Drawing.Point(4, 28);
-            this.tabPage_BillInfo.Name = "tabPage_BillInfo";
-            this.tabPage_BillInfo.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage_BillInfo.Size = new System.Drawing.Size(1299, 332);
-            this.tabPage_BillInfo.TabIndex = 0;
-            this.tabPage_BillInfo.Text = "宸ュ崟淇℃伅";
-            // 
-            // tabPage_ParamsInfo
-            // 
-            this.tabPage_ParamsInfo.BackColor = System.Drawing.Color.Lavender;
-            this.tabPage_ParamsInfo.Controls.Add(this.groupBox_ParamsInfo);
-            this.tabPage_ParamsInfo.Location = new System.Drawing.Point(4, 28);
-            this.tabPage_ParamsInfo.Name = "tabPage_ParamsInfo";
-            this.tabPage_ParamsInfo.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage_ParamsInfo.Size = new System.Drawing.Size(1299, 332);
-            this.tabPage_ParamsInfo.TabIndex = 1;
-            this.tabPage_ParamsInfo.Text = "閰嶇疆淇℃伅";
-            // 
-            // groupBox_ParamsInfo
-            // 
-            this.groupBox_ParamsInfo.Controls.Add(this.button_resetParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.button_saveParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.textBox2);
-            this.groupBox_ParamsInfo.Controls.Add(this.label_PrintModelParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.comboBox_PrinterParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.label_PrinterParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.comboBox_SourceNameParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.label_SourceNameParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.textBox1);
-            this.groupBox_ParamsInfo.Controls.Add(this.label_PortParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.textBox_IPParams);
-            this.groupBox_ParamsInfo.Controls.Add(this.label_IPParams);
-            this.groupBox_ParamsInfo.Location = new System.Drawing.Point(6, 6);
-            this.groupBox_ParamsInfo.Name = "groupBox_ParamsInfo";
-            this.groupBox_ParamsInfo.Size = new System.Drawing.Size(1287, 320);
-            this.groupBox_ParamsInfo.TabIndex = 0;
-            this.groupBox_ParamsInfo.TabStop = false;
-            // 
-            // groupBox_BillInfo
-            // 
-            this.groupBox_BillInfo.Controls.Add(this.radioButton_HIsUsingBatchNo);
-            this.groupBox_BillInfo.Controls.Add(this.button_stopListen);
-            this.groupBox_BillInfo.Controls.Add(this.button_startListen);
-            this.groupBox_BillInfo.Controls.Add(this.dtpHDate);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_HQty);
-            this.groupBox_BillInfo.Controls.Add(this.label2);
-            this.groupBox_BillInfo.Controls.Add(this.label_HQty);
-            this.groupBox_BillInfo.Controls.Add(this.cmbHBarCodeType);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_HPlanQty);
-            this.groupBox_BillInfo.Controls.Add(this.label1);
-            this.groupBox_BillInfo.Controls.Add(this.label_HPlanQty);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_HMaterModel);
-            this.groupBox_BillInfo.Controls.Add(this.label_HMaterModel);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_HMaterName);
-            this.groupBox_BillInfo.Controls.Add(this.label_HMaterName);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_HMaterNumber);
-            this.groupBox_BillInfo.Controls.Add(this.label_HMaterNumber);
-            this.groupBox_BillInfo.Controls.Add(this.textBox_SourceName);
-            this.groupBox_BillInfo.Controls.Add(this.label_SourceName);
-            this.groupBox_BillInfo.Controls.Add(this.label10);
-            this.groupBox_BillInfo.Controls.Add(this.cmbSourceBillType);
-            this.groupBox_BillInfo.Controls.Add(this.cmbHOrgID);
-            this.groupBox_BillInfo.Controls.Add(this.label3);
-            this.groupBox_BillInfo.Controls.Add(this.label14);
-            this.groupBox_BillInfo.Controls.Add(this.txtHSourceBillNo);
-            this.groupBox_BillInfo.Controls.Add(this.cmdSourceBillNo);
-            this.groupBox_BillInfo.Location = new System.Drawing.Point(6, 6);
-            this.groupBox_BillInfo.Name = "groupBox_BillInfo";
-            this.groupBox_BillInfo.Size = new System.Drawing.Size(1287, 320);
-            this.groupBox_BillInfo.TabIndex = 0;
-            this.groupBox_BillInfo.TabStop = false;
-            // 
-            // label_SourceName
-            // 
-            this.label_SourceName.AutoSize = true;
-            this.label_SourceName.Location = new System.Drawing.Point(24, 91);
-            this.label_SourceName.Name = "label_SourceName";
-            this.label_SourceName.Size = new System.Drawing.Size(80, 18);
-            this.label_SourceName.TabIndex = 0;
-            this.label_SourceName.Text = "浜�    绾�";
-            // 
-            // textBox_SourceName
-            // 
-            this.textBox_SourceName.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_SourceName.Enabled = false;
-            this.textBox_SourceName.Location = new System.Drawing.Point(126, 88);
-            this.textBox_SourceName.Name = "textBox_SourceName";
-            this.textBox_SourceName.Size = new System.Drawing.Size(280, 28);
-            this.textBox_SourceName.TabIndex = 43;
-            // 
-            // textBox_HMaterNumber
-            // 
-            this.textBox_HMaterNumber.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_HMaterNumber.Enabled = false;
-            this.textBox_HMaterNumber.Location = new System.Drawing.Point(125, 144);
-            this.textBox_HMaterNumber.Name = "textBox_HMaterNumber";
-            this.textBox_HMaterNumber.Size = new System.Drawing.Size(280, 28);
-            this.textBox_HMaterNumber.TabIndex = 87;
-            // 
-            // label_HMaterNumber
-            // 
-            this.label_HMaterNumber.AutoSize = true;
-            this.label_HMaterNumber.Location = new System.Drawing.Point(23, 147);
-            this.label_HMaterNumber.Name = "label_HMaterNumber";
-            this.label_HMaterNumber.Size = new System.Drawing.Size(80, 18);
-            this.label_HMaterNumber.TabIndex = 86;
-            this.label_HMaterNumber.Text = "鐗╂枡浠g爜";
-            // 
-            // textBox_HMaterName
-            // 
-            this.textBox_HMaterName.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_HMaterName.Enabled = false;
-            this.textBox_HMaterName.Location = new System.Drawing.Point(554, 142);
-            this.textBox_HMaterName.Name = "textBox_HMaterName";
-            this.textBox_HMaterName.Size = new System.Drawing.Size(280, 28);
-            this.textBox_HMaterName.TabIndex = 89;
-            // 
-            // label_HMaterName
-            // 
-            this.label_HMaterName.AutoSize = true;
-            this.label_HMaterName.Location = new System.Drawing.Point(449, 147);
-            this.label_HMaterName.Name = "label_HMaterName";
-            this.label_HMaterName.Size = new System.Drawing.Size(80, 18);
-            this.label_HMaterName.TabIndex = 88;
-            this.label_HMaterName.Text = "鐗╂枡鍚嶇О";
-            // 
-            // textBox_HMaterModel
-            // 
-            this.textBox_HMaterModel.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_HMaterModel.Enabled = false;
-            this.textBox_HMaterModel.Location = new System.Drawing.Point(977, 144);
-            this.textBox_HMaterModel.Name = "textBox_HMaterModel";
-            this.textBox_HMaterModel.Size = new System.Drawing.Size(280, 28);
-            this.textBox_HMaterModel.TabIndex = 91;
-            // 
-            // label_HMaterModel
-            // 
-            this.label_HMaterModel.AutoSize = true;
-            this.label_HMaterModel.Location = new System.Drawing.Point(875, 147);
-            this.label_HMaterModel.Name = "label_HMaterModel";
-            this.label_HMaterModel.Size = new System.Drawing.Size(80, 18);
-            this.label_HMaterModel.TabIndex = 90;
-            this.label_HMaterModel.Text = "瑙勬牸鍨嬪彿";
-            // 
-            // textBox_HPlanQty
-            // 
-            this.textBox_HPlanQty.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_HPlanQty.Enabled = false;
-            this.textBox_HPlanQty.Location = new System.Drawing.Point(125, 196);
-            this.textBox_HPlanQty.Name = "textBox_HPlanQty";
-            this.textBox_HPlanQty.Size = new System.Drawing.Size(280, 28);
-            this.textBox_HPlanQty.TabIndex = 93;
-            // 
-            // label_HPlanQty
-            // 
-            this.label_HPlanQty.AutoSize = true;
-            this.label_HPlanQty.Location = new System.Drawing.Point(23, 199);
-            this.label_HPlanQty.Name = "label_HPlanQty";
-            this.label_HPlanQty.Size = new System.Drawing.Size(80, 18);
-            this.label_HPlanQty.TabIndex = 92;
-            this.label_HPlanQty.Text = "璁″垝鏁伴噺";
-            // 
-            // textBox_HQty
-            // 
-            this.textBox_HQty.BackColor = System.Drawing.SystemColors.ScrollBar;
-            this.textBox_HQty.Enabled = false;
-            this.textBox_HQty.Location = new System.Drawing.Point(554, 196);
-            this.textBox_HQty.Name = "textBox_HQty";
-            this.textBox_HQty.Size = new System.Drawing.Size(280, 28);
-            this.textBox_HQty.TabIndex = 95;
-            // 
-            // label_HQty
-            // 
-            this.label_HQty.AutoSize = true;
-            this.label_HQty.Location = new System.Drawing.Point(449, 201);
-            this.label_HQty.Name = "label_HQty";
-            this.label_HQty.Size = new System.Drawing.Size(80, 18);
-            this.label_HQty.TabIndex = 94;
-            this.label_HQty.Text = "鐢熸垚鏁伴噺";
-            // 
-            // button_startListen
-            // 
-            this.button_startListen.Location = new System.Drawing.Point(218, 257);
-            this.button_startListen.Name = "button_startListen";
-            this.button_startListen.Size = new System.Drawing.Size(133, 35);
-            this.button_startListen.TabIndex = 96;
-            this.button_startListen.Text = "寮�濮嬬洃鍚�";
-            this.button_startListen.UseVisualStyleBackColor = true;
-            // 
-            // button_stopListen
-            // 
-            this.button_stopListen.Location = new System.Drawing.Point(408, 257);
-            this.button_stopListen.Name = "button_stopListen";
-            this.button_stopListen.Size = new System.Drawing.Size(151, 35);
-            this.button_stopListen.TabIndex = 97;
-            this.button_stopListen.Text = "鍋滄鐩戝惉";
-            this.button_stopListen.UseVisualStyleBackColor = true;
-            // 
-            // textBox_IPParams
-            // 
-            this.textBox_IPParams.BackColor = System.Drawing.SystemColors.Window;
-            this.textBox_IPParams.Location = new System.Drawing.Point(113, 28);
-            this.textBox_IPParams.Name = "textBox_IPParams";
-            this.textBox_IPParams.Size = new System.Drawing.Size(280, 28);
-            this.textBox_IPParams.TabIndex = 95;
-            // 
-            // label_IPParams
-            // 
-            this.label_IPParams.AutoSize = true;
-            this.label_IPParams.Location = new System.Drawing.Point(11, 31);
-            this.label_IPParams.Name = "label_IPParams";
-            this.label_IPParams.Size = new System.Drawing.Size(71, 18);
-            this.label_IPParams.TabIndex = 94;
-            this.label_IPParams.Text = "     IP";
-            // 
-            // textBox1
-            // 
-            this.textBox1.BackColor = System.Drawing.SystemColors.Window;
-            this.textBox1.Location = new System.Drawing.Point(558, 31);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(280, 28);
-            this.textBox1.TabIndex = 97;
-            // 
-            // label_PortParams
-            // 
-            this.label_PortParams.AutoSize = true;
-            this.label_PortParams.Location = new System.Drawing.Point(456, 34);
-            this.label_PortParams.Name = "label_PortParams";
-            this.label_PortParams.Size = new System.Drawing.Size(80, 18);
-            this.label_PortParams.TabIndex = 96;
-            this.label_PortParams.Text = "绔�    鍙�";
-            // 
-            // comboBox_SourceNameParams
-            // 
-            this.comboBox_SourceNameParams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_SourceNameParams.FormattingEnabled = true;
-            this.comboBox_SourceNameParams.Location = new System.Drawing.Point(973, 31);
-            this.comboBox_SourceNameParams.Margin = new System.Windows.Forms.Padding(4);
-            this.comboBox_SourceNameParams.Name = "comboBox_SourceNameParams";
-            this.comboBox_SourceNameParams.Size = new System.Drawing.Size(280, 26);
-            this.comboBox_SourceNameParams.TabIndex = 99;
-            // 
-            // label_SourceNameParams
-            // 
-            this.label_SourceNameParams.AutoSize = true;
-            this.label_SourceNameParams.ForeColor = System.Drawing.Color.Black;
-            this.label_SourceNameParams.Location = new System.Drawing.Point(873, 37);
-            this.label_SourceNameParams.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_SourceNameParams.Name = "label_SourceNameParams";
-            this.label_SourceNameParams.Size = new System.Drawing.Size(80, 18);
-            this.label_SourceNameParams.TabIndex = 98;
-            this.label_SourceNameParams.Text = "浜�    绾�";
-            // 
-            // comboBox_PrinterParams
-            // 
-            this.comboBox_PrinterParams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_PrinterParams.FormattingEnabled = true;
-            this.comboBox_PrinterParams.Location = new System.Drawing.Point(113, 78);
-            this.comboBox_PrinterParams.Margin = new System.Windows.Forms.Padding(4);
-            this.comboBox_PrinterParams.Name = "comboBox_PrinterParams";
-            this.comboBox_PrinterParams.Size = new System.Drawing.Size(280, 26);
-            this.comboBox_PrinterParams.TabIndex = 101;
-            // 
-            // label_PrinterParams
-            // 
-            this.label_PrinterParams.AutoSize = true;
-            this.label_PrinterParams.ForeColor = System.Drawing.Color.Black;
-            this.label_PrinterParams.Location = new System.Drawing.Point(13, 84);
-            this.label_PrinterParams.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_PrinterParams.Name = "label_PrinterParams";
-            this.label_PrinterParams.Size = new System.Drawing.Size(80, 18);
-            this.label_PrinterParams.TabIndex = 100;
-            this.label_PrinterParams.Text = "鎵� 鍗� 鏈�";
-            // 
-            // textBox2
-            // 
-            this.textBox2.BackColor = System.Drawing.SystemColors.Window;
-            this.textBox2.Location = new System.Drawing.Point(554, 78);
-            this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(280, 28);
-            this.textBox2.TabIndex = 103;
-            // 
-            // label_PrintModelParams
-            // 
-            this.label_PrintModelParams.AutoSize = true;
-            this.label_PrintModelParams.Location = new System.Drawing.Point(452, 81);
-            this.label_PrintModelParams.Name = "label_PrintModelParams";
-            this.label_PrintModelParams.Size = new System.Drawing.Size(80, 18);
-            this.label_PrintModelParams.TabIndex = 102;
-            this.label_PrintModelParams.Text = "鎵撳嵃妯℃澘";
-            // 
-            // button_saveParams
-            // 
-            this.button_saveParams.Location = new System.Drawing.Point(377, 173);
-            this.button_saveParams.Name = "button_saveParams";
-            this.button_saveParams.Size = new System.Drawing.Size(89, 40);
-            this.button_saveParams.TabIndex = 104;
-            this.button_saveParams.Text = "淇�  瀛�";
-            this.button_saveParams.UseVisualStyleBackColor = true;
-            // 
-            // button_resetParams
-            // 
-            this.button_resetParams.Location = new System.Drawing.Point(590, 173);
-            this.button_resetParams.Name = "button_resetParams";
-            this.button_resetParams.Size = new System.Drawing.Size(89, 40);
-            this.button_resetParams.TabIndex = 105;
-            this.button_resetParams.Text = "閲�  缃�";
-            this.button_resetParams.UseVisualStyleBackColor = true;
-            // 
-            // tabPage1
-            // 
-            this.tabPage1.Controls.Add(this.grdMain);
-            this.tabPage1.Location = new System.Drawing.Point(4, 28);
-            this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
-            this.tabPage1.Name = "tabPage1";
-            this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
-            this.tabPage1.Size = new System.Drawing.Size(1398, 254);
-            this.tabPage1.TabIndex = 0;
-            this.tabPage1.Text = "鐗╂枡淇℃伅";
-            this.tabPage1.UseVisualStyleBackColor = true;
-            // 
-            // grdMain
-            // 
-            this.grdMain.AllowUserToAddRows = false;
-            this.grdMain.AllowUserToDeleteRows = false;
-            this.grdMain.BackgroundColor = System.Drawing.Color.WhiteSmoke;
-            this.grdMain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.grdMain.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-            this.grdMain.Location = new System.Drawing.Point(4, 4);
-            this.grdMain.Margin = new System.Windows.Forms.Padding(4);
-            this.grdMain.Name = "grdMain";
-            this.grdMain.ReadOnly = true;
-            this.grdMain.RowHeadersWidth = 30;
-            this.grdMain.RowTemplate.Height = 23;
-            this.grdMain.Size = new System.Drawing.Size(1390, 246);
-            this.grdMain.TabIndex = 44;
-            this.grdMain.RowHeadersWidthChanged += new System.EventHandler(this.grdMain_RowHeadersWidthChanged);
-            this.grdMain.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.grdMain_CellBeginEdit);
-            this.grdMain.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdMain_CellEndEdit);
-            this.grdMain.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdMain_CellLeave);
-            this.grdMain.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.grdMain_ColumnWidthChanged);
-            this.grdMain.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.grdMain_EditingControlShowing);
-            this.grdMain.Scroll += new System.Windows.Forms.ScrollEventHandler(this.grdMain_Scroll);
-            // 
-            // tabControl1
-            // 
-            this.tabControl1.Controls.Add(this.tabPage1);
-            this.tabControl1.Controls.Add(this.tabPage2);
-            this.tabControl1.Controls.Add(this.tabPage3);
-            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tabControl1.Location = new System.Drawing.Point(62, 444);
-            this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
-            this.tabControl1.Name = "tabControl1";
-            this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(1406, 286);
-            this.tabControl1.TabIndex = 47;
-            // 
             // tabPage3
             // 
             this.tabPage3.Controls.Add(this.grdList);
             this.tabPage3.Location = new System.Drawing.Point(4, 28);
             this.tabPage3.Margin = new System.Windows.Forms.Padding(4);
             this.tabPage3.Name = "tabPage3";
-            this.tabPage3.Size = new System.Drawing.Size(1398, 254);
+            this.tabPage3.Size = new System.Drawing.Size(1398, 265);
             this.tabPage3.TabIndex = 2;
             this.tabPage3.Text = "妗f鍒楄〃";
             this.tabPage3.UseVisualStyleBackColor = true;
@@ -1398,7 +1359,7 @@
             this.grdList.ReadOnly = true;
             this.grdList.RowHeadersWidth = 30;
             this.grdList.RowTemplate.Height = 23;
-            this.grdList.Size = new System.Drawing.Size(1398, 254);
+            this.grdList.Size = new System.Drawing.Size(1398, 265);
             this.grdList.TabIndex = 46;
             // 
             // tabPage2
@@ -1408,7 +1369,7 @@
             this.tabPage2.Margin = new System.Windows.Forms.Padding(4);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(4);
-            this.tabPage2.Size = new System.Drawing.Size(1398, 254);
+            this.tabPage2.Size = new System.Drawing.Size(1398, 265);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "鏉$爜淇℃伅";
             this.tabPage2.UseVisualStyleBackColor = true;
@@ -1428,24 +1389,96 @@
             this.grdSub.ReadOnly = true;
             this.grdSub.RowHeadersWidth = 30;
             this.grdSub.RowTemplate.Height = 23;
-            this.grdSub.Size = new System.Drawing.Size(1390, 246);
+            this.grdSub.Size = new System.Drawing.Size(1390, 257);
             this.grdSub.TabIndex = 45;
             this.grdSub.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.grdSub_CellBeginEdit);
             this.grdSub.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellContentClick);
             this.grdSub.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellEndEdit);
             // 
-            // radioButton_HIsUsingBatchNo
+            // tabPage1
             // 
-            this.radioButton_HIsUsingBatchNo.AutoSize = true;
-            this.radioButton_HIsUsingBatchNo.Location = new System.Drawing.Point(878, 197);
-            this.radioButton_HIsUsingBatchNo.Name = "radioButton_HIsUsingBatchNo";
-            this.radioButton_HIsUsingBatchNo.Size = new System.Drawing.Size(141, 22);
-            this.radioButton_HIsUsingBatchNo.TabIndex = 98;
-            this.radioButton_HIsUsingBatchNo.TabStop = true;
-            this.radioButton_HIsUsingBatchNo.Text = "鏄惁鍚敤鎵规";
-            this.radioButton_HIsUsingBatchNo.UseVisualStyleBackColor = true;
+            this.tabPage1.Controls.Add(this.grdMain);
+            this.tabPage1.Location = new System.Drawing.Point(4, 5);
+            this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
+            this.tabPage1.Size = new System.Drawing.Size(1398, 288);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = "鐗╂枡淇℃伅";
+            this.tabPage1.UseVisualStyleBackColor = true;
             // 
-            // Gy_BarCodeBill_automaticallyByPLC
+            // grdMain
+            // 
+            this.grdMain.AllowUserToAddRows = false;
+            this.grdMain.AllowUserToDeleteRows = false;
+            this.grdMain.BackgroundColor = System.Drawing.Color.WhiteSmoke;
+            this.grdMain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdMain.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+            this.grdMain.Location = new System.Drawing.Point(4, 4);
+            this.grdMain.Margin = new System.Windows.Forms.Padding(4);
+            this.grdMain.Name = "grdMain";
+            this.grdMain.ReadOnly = true;
+            this.grdMain.RowHeadersWidth = 30;
+            this.grdMain.RowTemplate.Height = 23;
+            this.grdMain.Size = new System.Drawing.Size(1390, 280);
+            this.grdMain.TabIndex = 44;
+            this.grdMain.RowHeadersWidthChanged += new System.EventHandler(this.grdMain_RowHeadersWidthChanged);
+            this.grdMain.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.grdMain_CellBeginEdit);
+            this.grdMain.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdMain_CellEndEdit);
+            this.grdMain.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdMain_CellLeave);
+            this.grdMain.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.grdMain_ColumnWidthChanged);
+            this.grdMain.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.grdMain_EditingControlShowing);
+            this.grdMain.Scroll += new System.Windows.Forms.ScrollEventHandler(this.grdMain_Scroll);
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Controls.Add(this.tabPage3);
+            this.tabControl1.Controls.Add(this.tabPage4);
+            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tabControl1.ItemSize = new System.Drawing.Size(0, 1);
+            this.tabControl1.Location = new System.Drawing.Point(62, 433);
+            this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(1406, 297);
+            this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
+            this.tabControl1.TabIndex = 47;
+            this.tabControl1.TabStop = false;
+            // 
+            // tabPage4
+            // 
+            this.tabPage4.Controls.Add(this.grdBillBarCodeList);
+            this.tabPage4.Location = new System.Drawing.Point(4, 28);
+            this.tabPage4.Name = "tabPage4";
+            this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage4.Size = new System.Drawing.Size(1398, 265);
+            this.tabPage4.TabIndex = 3;
+            this.tabPage4.Text = "宸ュ崟鏉$爜";
+            this.tabPage4.UseVisualStyleBackColor = true;
+            // 
+            // grdBillBarCodeList
+            // 
+            this.grdBillBarCodeList.AllowUserToAddRows = false;
+            this.grdBillBarCodeList.AllowUserToDeleteRows = false;
+            this.grdBillBarCodeList.BackgroundColor = System.Drawing.Color.WhiteSmoke;
+            this.grdBillBarCodeList.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.grdBillBarCodeList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdBillBarCodeList.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdBillBarCodeList.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+            this.grdBillBarCodeList.Location = new System.Drawing.Point(3, 3);
+            this.grdBillBarCodeList.Margin = new System.Windows.Forms.Padding(4);
+            this.grdBillBarCodeList.Name = "grdBillBarCodeList";
+            this.grdBillBarCodeList.ReadOnly = true;
+            this.grdBillBarCodeList.RowHeadersWidth = 30;
+            this.grdBillBarCodeList.RowTemplate.Height = 23;
+            this.grdBillBarCodeList.Size = new System.Drawing.Size(1392, 259);
+            this.grdBillBarCodeList.TabIndex = 47;
+            // 
+            // Gy_BarCodeBill_automaticallyByPLC_New
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -1461,8 +1494,8 @@
             this.Controls.Add(this.grdPrint);
             this.ForeColor = System.Drawing.Color.Black;
             this.KeyPreview = true;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Name = "Gy_BarCodeBill_automaticallyByPLC";
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Gy_BarCodeBill_automaticallyByPLC_New";
             this.Text = "鍗曟嵁缂栬緫";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Gy_BarCodeBill_FormClosing);
@@ -1473,27 +1506,27 @@
             this.Tool.PerformLayout();
             this.P1.ResumeLayout(false);
             this.P1.PerformLayout();
+            this.tabControl_MainInfo.ResumeLayout(false);
+            this.tabPage_BillInfo.ResumeLayout(false);
             this.gbUp.ResumeLayout(false);
             this.gbUp.PerformLayout();
+            this.tabPage_ParamsInfo.ResumeLayout(false);
+            this.groupBox_ParamsInfo.ResumeLayout(false);
+            this.groupBox_ParamsInfo.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pic1)).EndInit();
             this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdSum)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.grdPrint)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).EndInit();
-            this.tabControl_MainInfo.ResumeLayout(false);
-            this.tabPage_BillInfo.ResumeLayout(false);
-            this.tabPage_ParamsInfo.ResumeLayout(false);
-            this.groupBox_ParamsInfo.ResumeLayout(false);
-            this.groupBox_ParamsInfo.PerformLayout();
-            this.groupBox_BillInfo.ResumeLayout(false);
-            this.groupBox_BillInfo.PerformLayout();
-            this.tabPage1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).EndInit();
-            this.tabControl1.ResumeLayout(false);
             this.tabPage3.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.grdList)).EndInit();
             this.tabPage2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.grdSub)).EndInit();
+            this.tabPage1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).EndInit();
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage4.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdBillBarCodeList)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -1507,6 +1540,7 @@
         private System.Windows.Forms.ToolStripButton bc;
         private System.Windows.Forms.ToolStripButton cz;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+        private System.Windows.Forms.Label lblCaption;
         private System.Windows.Forms.Panel P1;
         private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Label txtHMaker;
@@ -1535,7 +1569,6 @@
         private System.Windows.Forms.GroupBox gbUp;
         private System.Windows.Forms.Label label10;
         private System.Windows.Forms.ComboBox cmbSourceBillType;
-        private System.Windows.Forms.Button cmdSourceBillNo;
         private System.Windows.Forms.TextBox txtHSourceBillNo;
         private System.Windows.Forms.Label label14;
         private System.Windows.Forms.ToolStripButton tc;
@@ -1544,7 +1577,7 @@
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
         private System.Windows.Forms.ToolStripButton bclk;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
-        private System.Windows.Forms.Button cmdHEmpID;
+        private System.Windows.Forms.PictureBox pic1;
         private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Panel panel3;
         private System.Windows.Forms.DataGridView grdSum;
@@ -1571,11 +1604,18 @@
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
         private System.Windows.Forms.ToolStripButton wxm;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
-        private System.Windows.Forms.PictureBox pic1;
-        private System.Windows.Forms.Label lblCaption;
+        private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.DataGridView grdSub;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.DataGridView grdList;
+        private System.Windows.Forms.DataGridView grdMain;
+        private System.Windows.Forms.TabPage tabPage4;
+        private System.Windows.Forms.DataGridView grdBillBarCodeList;
         private System.Windows.Forms.TabControl tabControl_MainInfo;
         private System.Windows.Forms.TabPage tabPage_BillInfo;
-        private System.Windows.Forms.GroupBox groupBox_BillInfo;
+        private System.Windows.Forms.RadioButton radioButton_HIsUsingBatchNo;
         private System.Windows.Forms.Button button_stopListen;
         private System.Windows.Forms.Button button_startListen;
         private System.Windows.Forms.TextBox textBox_HQty;
@@ -1592,25 +1632,18 @@
         private System.Windows.Forms.Label label_SourceName;
         private System.Windows.Forms.TabPage tabPage_ParamsInfo;
         private System.Windows.Forms.GroupBox groupBox_ParamsInfo;
-        private System.Windows.Forms.TextBox textBox_IPParams;
-        private System.Windows.Forms.Label label_IPParams;
         private System.Windows.Forms.Button button_resetParams;
         private System.Windows.Forms.Button button_saveParams;
-        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.TextBox textBox_PrintModelParams;
         private System.Windows.Forms.Label label_PrintModelParams;
         private System.Windows.Forms.ComboBox comboBox_PrinterParams;
         private System.Windows.Forms.Label label_PrinterParams;
         private System.Windows.Forms.ComboBox comboBox_SourceNameParams;
         private System.Windows.Forms.Label label_SourceNameParams;
-        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox textBox_PortParams;
         private System.Windows.Forms.Label label_PortParams;
-        private System.Windows.Forms.TabPage tabPage1;
-        private System.Windows.Forms.DataGridView grdMain;
-        private System.Windows.Forms.TabControl tabControl1;
-        private System.Windows.Forms.TabPage tabPage2;
-        private System.Windows.Forms.DataGridView grdSub;
-        private System.Windows.Forms.TabPage tabPage3;
-        private System.Windows.Forms.DataGridView grdList;
-        private System.Windows.Forms.RadioButton radioButton_HIsUsingBatchNo;
+        private System.Windows.Forms.TextBox textBox_IPParams;
+        private System.Windows.Forms.Label label_IPParams;
+        private System.Windows.Forms.Button cmdSourceBillNo;
     }
 }
\ No newline at end of file
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.resx" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.resx"
similarity index 97%
rename from "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.resx"
rename to "WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.resx"
index da6c16a..150c414 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC.resx"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.resx"
@@ -569,21 +569,6 @@
         FIYcEAA7
 </value>
   </data>
-  <data name="cmdHEmpID.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhEAAQAIZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5ToPV/5TW/cyZAAyf/7Dp
-        /yOn/2jD/q3h/le8/sz3/5zg/7bt/73l/7Xs/2fH/4DT///bnZXb/97//2rK/wWb/8np/6zf/1S//77x
-        /73w/8Xv/1+//wmc/1jA/5Db/5LV/6rn/6Xb/zCt/33O/9X3/4LO/7jj/4PT/x+m/7nk/3XP/3PJ/3bQ
-        /6Tb/5Td/zCv/3fM/029/4za/6Pf/ZHc/6Pk/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEBAAAh+QQB
-        AABBACwAAAAAEAAQAAAIqACDCBwoMIDBAAQTBjEYIcKECQYVLmQQ44KJFhBmQECYMAAOEAJYnPjgwAHH
-        gQEYqAhBA4YOBDwQIDg5cYcLGyg8LOixYAFNABJkZBBRI8cDEg98ACAIlIOGGylWGOhgwMBSphUq/ACC
-        wQAFClcFEiAAQICAEhZGvDAbloCCDQUAlDUrQO5AtwkKHBgQRK7duwryHmjAV2IQAoIJGxY4QK/ixYwH
-        FIYcEAA7
-</value>
-  </data>
   <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>93, 17</value>
   </metadata>

--
Gitblit v1.9.1