From fa4a13ab801ff28edcf3dc5daed1dc552365a56f Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 20 六月 2025 16:57:36 +0800
Subject: [PATCH] 新增凯贝超聚变客户条码生成模块

---
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei.cs                             |  197 +++++++++++++++------------------------
 DAL/DAL.csproj                                                    |    1 
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei.designer.cs                    |   25 -----
 DAL/源单/InterFace源单/Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei.cs |   23 ++++
 4 files changed, 101 insertions(+), 145 deletions(-)

diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 51bbccf..f9a4ab9 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -86,6 +86,7 @@
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_RepairClass_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_RepairCheckClass_Ctl.cs" />
     <Compile Include="浠撳簱绠$悊\ClsKf_ProductReceiveMaterialBill.cs" />
+    <Compile Include="婧愬崟\InterFace婧愬崟\Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei.cs" />
     <Compile Include="婧愬崟\InterFace婧愬崟\Cls_S_IF_MoveStockRequestBillList.cs" />
     <Compile Include="鐢熶骇绠$悊\ClsSc_ShiftsBeginInfoBill.cs" />
     <Compile Include="ClsPay_AbsentBill.cs" />
diff --git "a/DAL/\346\272\220\345\215\225/InterFace\346\272\220\345\215\225/Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei.cs" "b/DAL/\346\272\220\345\215\225/InterFace\346\272\220\345\215\225/Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei.cs"
new file mode 100644
index 0000000..8f88b7c
--- /dev/null
+++ "b/DAL/\346\272\220\345\215\225/InterFace\346\272\220\345\215\225/Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei.cs"
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using SQLHelper;
+using DBUtility;
+
+namespace DAL
+{
+    public class Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei : Cls_S_Xt_BaseBill
+    {
+
+        public Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei()
+        {
+            base.ViewName = "h_v_Sc_ICMOBillList_Source_CusBarCodeBill_KaiBei";
+            base.mvarReportTitle = "鐢熶骇璁㈠崟";
+            base.mvarItemKey = "3710";
+            base.sCondtion = "  ";
+            base.sOrderSql = "  order by 鍗曟嵁鍙� desc,hsubid ";
+            base.sKeyCol = "閮ㄩ棬";
+        }
+
+    }
+}
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
index c2dce87..f429a08 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
@@ -76,7 +76,6 @@
         public int selectRow = 0;
         public Int64 HInterID = 0;      //鍐呯爜
         public Int64 HOrgID = ClsPub.HOrgID;
-        public string HCusModel = "Z";     //鍘傚晢浠g爜
         public string sDate = "";          //鏃ユ湡
         public string sYear = "";          //骞达紙2浣嶏級
         public string sYear4 = "";         //骞达紙4浣嶏級
@@ -89,13 +88,9 @@
         //娓呯┖鐣岄潰
         public void Sub_ClearBill()
         {
-            cmbHBarCodeType.Items.Clear();
             cmbSourceBillType.Items.Clear();
-            //鏉$爜绫诲瀷
-            cmbHBarCodeType.Items.Add("鍐呯鐮�");
-            cmbHBarCodeType.Items.Add("澶栫鐮�");
             //婧愬崟绫诲瀷
-            cmbSourceBillType.Items.Add("鐢熶骇姹囨姤鍗�");
+            cmbSourceBillType.Items.Add("鐢熶骇璁㈠崟");
 
             DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
             //鑾峰彇褰撳墠缁勭粐
@@ -266,7 +261,7 @@
         //鍔犺浇瀹㈡埛淇℃伅
         private void Sub_AddHCusNameList()
         {
-            DataSet ds = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_Cus " + HOrgID.ToString(), "h_p_Gy_CusBarCodeBill_Cus");
+            DataSet ds = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_Cus_KaiBei " + HOrgID.ToString(), "h_p_Gy_CusBarCodeBill_Cus_KaiBei");
             if (ds == null || ds.Tables[0].Rows.Count == 0)
             {
                 cmbHCusName.DataSource = null;
@@ -457,54 +452,6 @@
             sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
             sDay = sDay.Substring(sDay.Length - 2, 2);
             //==================================
-            switch (sYear)
-            {
-                case "22":
-                    sYear = "N";
-                    break;
-                case "23":
-                    sYear = "P";
-                    break;
-                case "24":
-                    sYear = "Q";
-                    break;
-                case "25":
-                    sYear = "R";
-                    break;
-                case "26":
-                    sYear = "S";
-                    break;
-                case "27":
-                    sYear = "T";
-                    break;
-                case "28":
-                    sYear = "U";
-                    break;
-                case "29":
-                    sYear = "V";
-                    break;
-                case "30":
-                    sYear = "W";
-                    break;
-                case "31":
-                    sYear = "X";
-                    break;
-                case "32":
-                    sYear = "Y";
-                    break;
-                case "33":
-                    sYear = "Z";
-                    break;
-                default:
-                    sYear = "";
-                    break;
-            }
-            if (sYear == "")
-            {
-                MessageBox.Show("閿欒鐨勫勾浠斤紒");
-                return false;
-            }
-
             switch (sPeriod)
             {
                 case "01":
@@ -561,14 +508,13 @@
                 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);                 // 鏈�灏忓寘瑁呮暟
-                string HCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value);   // 瀹㈡埛鏂欏彿
+                string HCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value);   // 瀹㈡埛鐗╂枡缂栫爜
                 string HCode1 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value);                 // 鐗╂枡绫诲埆
                 string HCode2 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value);                 // 鎵规浣�
                 HCode2 = HCode2.ToUpper();
                 string HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value);                 // 鐗堟湰鍙�
-                string HBatchNoNumber = HCode1 + sYear + sPeriod + sDay + HCusModel;                                // 鎵规鐢熸垚鍓嶇紑
-                HBatchNoNumber = HBatchNoNumber.ToUpper();
-                string HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);                             // 鏉$爜绫诲瀷
+                string HBatchNoNumber = "";                                                                         // 鎵规鐢熸垚鍓嶇紑
+                string HBarCodeType = "瓒呰仛鍙樺唴鏍囩";                                                               // 鏉$爜绫诲瀷
                 string HInnerBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value);     // 瀹㈡埛璁㈠崟鍙�
 
                 if (HMaterID != 0)
@@ -586,10 +532,6 @@
                     }
                     else
                     {
-                        grdMain.Rows[j].Cells[HBaNoCol].Value = HCode2;
-                        grdMain.Rows[j].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HBatchNo"]);
-                        grdMain.Rows[j].Cells[HCode2Col].Value = DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HCode2"]);
-
                         if (DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HExpiryDateCol].Value) == "")
                         {
                             if (DBUtility.ClsPub.isBool(oDsCheck.Tables[0].Rows[0]["HISKFPERIOD"]))
@@ -648,17 +590,16 @@
             try
             {
                 string TM = "";             //鏉$爜
-                int LSHlen = 4;             //娴佹按鍙烽暱搴�
+                int LSHlen = 7;             //娴佹按鍙烽暱搴�
                 double HSumQty = 0;         //浜у搧鏁伴噺
                 double HMinQty = 0;         //鏈�灏忓寘瑁呮暟
                 int HBQty = 0;              //绠辨暟
-                int LSH = 0;                //鍐呯娴佹按鍙�
-                int LWSH = 0;               //澶栫娴佹按鍙�
+                int LSH = 0;                //娴佹按鍙�
                 string LSH2 = "";           //娴佹按鍙疯浆鎹㈡垚瀛楃
                 string HCode1 = "";         //鐗╂枡绫诲埆
                 string HCode2 = "";         //鎵规浣�
                 string HCode3 = "";         //鐗堟湰鍙�
-                string sTMNumber = "";      //澶栫鏉$爜鍓嶇紑
+                string sTMNumber = "";      //鏉$爜鍓嶇紑
                 DataSet Ds;
 
                 Int64 HEntryID = 0;
@@ -670,7 +611,7 @@
                 string HBatchNo = "";       //鎵规
                 double HQty = 0;            //鏁伴噺
                 Int64 HCusID = 0;           //瀹㈡埛ID
-                string HCusModelName = "";  //瀹㈡埛鏂欏彿
+                string HCusModelName = "";  //瀹㈡埛鐗╂枡缂栫爜
                 bool HGiveAwayFlag = false; //璧犲搧鏍囪
                 string HProduceDate;        //鐢熶骇鏃ユ湡锛堜繚璐ㄦ湡鐢級
                 string HExpiryDate;         //淇濊川鏈熻嚦锛堜繚璐ㄦ湡鐢級
@@ -684,7 +625,7 @@
                 string HMTONo = "";         //MTO鍙�
                 string HRemark = "";        //澶囨敞
                 string HInnerBillNo = "";   //瀹㈡埛璁㈠崟鍙�
-                string HSno = "";           //鎵规搴忓垪鍙�
+                string HSno = "";           //娴佹按鍙�
                 string HBoxNo = "";         //鎵规鐢熸垚鍓嶇紑
                 string sHBaNo = "";         //鐣岄潰涓婅緭鍏ョ殑鎵规浣�
                 int HSumBQty = 0;           //鍚屼竴鎵圭敓鎴愭潯鐮佹�荤鏁�
@@ -697,27 +638,14 @@
                     Application.DoEvents();
                     if (ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value) != 0)
                     {
-                        HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value);
-                        HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value);
+                        string HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNumberCol].Value);
+                        HMaterNumber = HMaterNumber.Substring(HMaterNumber.Length - 3, 3);  //鍙栫墿鏂欎唬鐮佸悗涓変綅
+                        string sHCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value);   //瀹㈡埛浠g爜锛堝彇閲戣澏瀹㈡埛鐗╂枡瀵瑰簲琛ㄥ鎴风墿鏂欑紪鐮侊級
 
-                        if (cmbHBarCodeType.Text == "鍐呯鐮�")
-                        {
-                            //鑾峰彇鏈�澶ф祦姘村彿
-                            LSH = 0;
-                            Ds = oCn.RunProcReturn("select top 1 HSno from Gy_BarCodeBill_Cus where HBatchNo='" + HBatchNo + "' order by HSno desc", "Gy_BarCodeBill_Cus");
-                            if (Ds != null && Ds.Tables[0].Rows.Count != 0)
-                            {
-                                LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
-                            }
-                        }
-                        //澶栫鐮�   渚涘簲鍟嗕唬鐮侊紙娴疆瀹氫箟鐨勪緵搴斿晢浠g爜锛�+8浣嶆棩鏈燂紙渚嬪20230905锛�+5浣嶆祦姘寸爜锛堢函鏁板瓧锛�
-                        else
-                        {
-                            //鏉$爜鍓嶇紑 = 渚涘簲鍟嗕唬鐮� + 骞� + 鏈� + 鏃�
-                            sTMNumber = HCusModel + sYear + sPeriod + sDay;
-                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                            LWSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
-                        }
+                        //鏉$爜鍓嶇紑 = 骞� + 鏈�
+                        sTMNumber = sYear + sPeriod;
+                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
 
                         HBQty = ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value);
                         HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);
@@ -725,6 +653,7 @@
                         HSumBQty = HSumBQty + ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value);
                         pb1.Maximum = HSumBQty;
 
+                        int nn = 0;     //鏈娴佹按鍙风疮璁′娇鐢ㄤ釜鏁�
                         for (int i = 0; i < HBQty; i++)
                         {
                             pb1.Value = n+1;    
@@ -737,32 +666,23 @@
                                 HMinQty = HSumQty;
                             }
                             //
-                            if (cmbHBarCodeType.Text == "鍐呯鐮�")
+                            LSH = LSH + 1;
+                            LSH2 = LSH.ToString();
+                            while (LSH2.Length < LSHlen)  //濡傛灉娴佹按鍙蜂綅鏁板皬浜� 娴佹按鍙烽暱搴� 鍓嶉潰琛�0
                             {
-                                LSH = LSH + 1;
-                                LSH2 = ConvertToBase(LSH, 36);
-                                while (LSH2.Length < LSHlen)  //濡傛灉娴佹按鍙蜂綅鏁板皬浜� LSHlen 鍓嶉潰琛�0
-                                {
-                                    LSH2 = "0" + LSH2;
-                                }
-                                //鏉$爜缂栧彿 = 鎵规 + 娴佹按鍙� + 鐗堟湰鍙�
-                                TM = HBatchNo + LSH2 + HCode3;
+                                LSH2 = "0" + LSH2;
                             }
-                            //澶栫鐮�
-                            else
+                            if (LSH2.Length != 7)
                             {
-                                LWSH = LWSH + 1;
-                                LSH2 = LWSH.ToString();
-                                while (LSH2.Length < 5)  //濡傛灉娴佹按鍙蜂綅鏁板皬浜� 5 鍓嶉潰琛�0
-                                {
-                                    LSH2 = "0" + LSH2;
-                                }
-                                TM = sTMNumber + LSH2;
+                                MessageBox.Show("鏉$爜娴佹按鍙蜂负[" + LSH2 + "]锛岄暱搴︿笉鍏佽瓒呰繃7浣嶏紒");
+                                return;
                             }
+                            //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   鏉$爜缂栧彿锛堝叡26浣嶏級 = 浠g爜锛�1浣嶅浐瀹氣�楽鈥欙級 + 鍘傚晢浠g爜锛�2浣嶅浐瀹氣�榊3鈥欙級 + 骞达紙2浣嶅勾鍚庝袱浣嶏級 + 鏈堬紙1浣�10=A,11=B,12=C锛� + 娴佹按鍙凤紙7浣嶏級 + 浠e彿锛�2浣嶅浐瀹氣��1P鈥欙級 + 瀹㈡埛浠g爜锛�8浣嶅彇閲戣澏瀹㈡埛鐗╂枡瀵瑰簲琛ㄥ鎴风墿鏂欑紪鐮侊級 + 鐗╂枡鐗堟湰锛�3浣嶅彇鐗╂枡缂栫爜鍚庝笁浣嶏級
+                            TM = "SY3" + sYear + sPeriod + LSH2 + "1P" + sHCusModelName + HMaterNumber;
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
-                            HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text);
+                            HBarCodeType = "瓒呰仛鍙樺唴鏍囩";
                             HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);
                             HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value);
                             HAuxPropID = ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value);
@@ -782,16 +702,11 @@
                             HRemark = ClsPub.isStrNull(grdMain.Rows[j].Cells[HRemarkCol].Value);
                             HMTONo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HMTONoCol].Value);
                             HInnerBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value);
-                            HCode1 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value).ToUpper();
-                            HCode2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value).ToUpper();
-                            HCode3 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value).ToUpper();
                             HSno = ClsPub.isStrNull(LSH);
-                            HBoxNo = HCode1 + sYear + sPeriod + sDay + HCusModel;
-                            HBoxNo = HBoxNo.ToUpper();
+                            HBoxNo = sTMNumber;
                             sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value);                        // 鐣岄潰涓婅緭鍏ョ殑鎵规浣�
 
-                            //瀹㈡埛鏂欏彿HCusModelName銆佺墿鏂欑被鍒獺Code1銆佹壒娆′綅HCode2銆佺増鏈彿HCode3銆佹壒娆″簭鍒楀彿HSno銆佹壒娆$敓鎴愬墠缂�HBoxNo銆佸巶鍟嗕唬鐮丠CusModel
-                            //鐣岄潰涓婅緭鍏ョ殑鎵规浣岺SupName銆�36杩涘埗鎵规搴忓垪鍙稨SupNumber銆佸鎴疯鍗曞彿HInnerBillNo
+                            //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   瀹㈡埛鐗╂枡缂栫爜HCusModelName銆佹祦姘村彿HSno銆佹祦姘村彿HSupNumber銆佹祦姘村彿鐢熸垚鍓嶇紑HBoxNo
                             oCn.RunProc("insert into Gy_BarCodeBill_Cus" +
                                     "(HInterID,HEntryID,HBillType,HBarCode,HBarCodeType" +
                                     ",HMaterID,HUnitID,HAuxPropID,HBatchNo,HQty" +
@@ -807,7 +722,7 @@
                                     ",HCode2,HCode3,HBackDataFlag,HSno,HBoxNo" +
                                     ") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'"
                                     + "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString()
-                                    + "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''"
+                                    + "," + HCusID.ToString() + ",'','" + HCusModelName + "','" + sDate + "',''"
                                     + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''"
                                     + "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
                                     + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
@@ -818,8 +733,11 @@
                                     + ",'','','" + LSH2 + "','" + sHBaNo + "','" + HCode1 + "'"
                                     + ",'" + HCode2 + "','" + HCode3 + "','','" + HSno + "','" + HBoxNo + "')");
                             n = n + 1;
+                            nn = nn + 1;
                             Application.DoEvents();
                         }
+                        //鍥炲~娴佹按鍙蜂俊鎭�
+                        oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "'," + nn.ToString() + " ");
                     }
                 }
                 oCn.Commit();
@@ -904,7 +822,7 @@
             grdMain.Columns[HMaterNumberCol].HeaderText = "鐗╂枡浠g爜";
             grdMain.Columns[HMaterNameCol].HeaderText = "鐗╂枡鍚嶇О";
             grdMain.Columns[HMaterModelCol].HeaderText = "瑙勬牸鍨嬪彿";
-            grdMain.Columns[HCusModelNameCol].HeaderText = "瀹㈡埛鏂欏彿";
+            grdMain.Columns[HCusModelNameCol].HeaderText = "瀹㈡埛鐗╂枡缂栫爜";
             grdMain.Columns[HUnitIDCol].HeaderText = "璁¢噺鍗曚綅ID";
             grdMain.Columns[HUnitNumberCol].HeaderText = "璁¢噺鍗曚綅浠g爜";
             grdMain.Columns[HUnitNameCol].HeaderText = "璁¢噺鍗曚綅鍚嶇О";
@@ -945,6 +863,7 @@
             grdMain.Columns[HAuxPropNumberCol].Visible = false;
             grdMain.Columns[HAuxPropNameCol].Visible = false;
             grdMain.Columns[HBatchManagerCol].Visible = false;
+            grdMain.Columns[HBatchNoCol].Visible = false;
             grdMain.Columns[HGiveAwayFlagCol].Visible = false;
             grdMain.Columns[HProduceDateCol].Visible = false;
             grdMain.Columns[HExpiryDateCol].Visible = false;
@@ -962,6 +881,10 @@
             grdMain.Columns[HEXPPERIODCol].Visible = false;
             grdMain.Columns[HLSHCol].Visible = false;
             grdMain.Columns[HBaNoCol].Visible = false;
+            grdMain.Columns[HCode1Col].Visible = false;
+            grdMain.Columns[HCode2Col].Visible = false;
+            grdMain.Columns[HCode3Col].Visible = false;
+            grdMain.Columns[HInnerBillNoCol].Visible = false;
 
             //璁剧疆鍙紪杈戝垪
             string sAllowCol =  HQtyCol.ToString()+
@@ -1278,7 +1201,16 @@
 
         private void cmdSourceBillNo_Click(object sender, EventArgs e)
         {
-            if (cmbSourceBillType.Text.Trim() == "鐢熶骇姹囨姤鍗�")
+            if (cmbSourceBillType.Text.Trim() == "鐢熶骇璁㈠崟")
+            {
+                string sWhere = " and HOrgID =" + HOrgID.ToString();
+                DAL.Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei oIF_ICMOBillList = new DAL.Cls_S_IF_ICMOBillList_CusBarCodeBill_KaiBei();
+                if (oIF_ICMOBillList.Refresh(sWhere))  //閫夋嫨鍘熷崟
+                {
+                    FillSelectData(oIF_ICMOBillList.oBillSelectColl);
+                }
+            }
+            else if (cmbSourceBillType.Text.Trim() == "鐢熶骇姹囨姤鍗�")
             {
                 string sWhere = " and HOrgID =" + HOrgID.ToString();
                 DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill oIF_ICMOReportBillList = new DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill();
@@ -1298,8 +1230,19 @@
             foreach (DBUtility.BillSelect oSelectRow in oList)
             {
                 i = i + 1;
+                //鐢熶骇璁㈠崟
+                if (oSelectRow.BillType == "3710")
+                {
+                    grdMain.Rows.Add();
+                    grdMain.Rows[i].Cells[HTagCol].Value = "*";
+                    //寰楀埌淇℃伅
+                    Ds = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_ICMOBillList " + oSelectRow.BillMainID.ToString() + "," + oSelectRow.BillSubID.ToString() + ",'1'", "h_p_Gy_CusBarCodeBill_ICMOBillList");
+                    //鍐欏叆淇℃伅
+                    Sub_WriteInForm1(Ds.Tables[0], i);
+                    GetCusMatNo(1);
+                }
                 //鐢熶骇姹囨姤鍗�
-                if (oSelectRow.BillType == "3711")
+                else if (oSelectRow.BillType == "3711")
                 {
                     grdMain.Rows.Add();
                     grdMain.Rows[i].Cells[HTagCol].Value = "*";
@@ -1388,7 +1331,21 @@
                     return;
                 }
                 //鏍规嵁婧愬崟绫诲瀷 鍜屾簮鍗曞彿 鑾峰彇淇℃伅
-                if (cmbSourceBillType.Text.Trim() == "鐢熶骇姹囨姤鍗�")
+                if (cmbSourceBillType.Text.Trim() == "鐢熶骇璁㈠崟")
+                {
+                    DAL.Cls_S_IF_ICMOBillList_CusBarCodeBill oIF_ICMOBillList = new DAL.Cls_S_IF_ICMOBillList_CusBarCodeBill();
+                    if (oIF_ICMOBillList.RefreshBySourceBillNo(" Where 鍗曟嵁鍙� like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + HOrgID.ToString()))  //閫夋嫨鍘熷崟
+                    {
+                        FillSelectData(oIF_ICMOBillList.oBillSelectColl);
+                        txtHSourceBillNo.Text = "";
+                    }
+                    else
+                    {
+                        MessageBox.Show("鏈煡璇㈠埌浠诲姟鏁版嵁锛岃纭鎵�閫夌粍缁囥�佹簮鍗曠被鍨嬩笌婧愬崟鍗曞彿鏄惁姝g‘锛�");
+                        return;
+                    }
+                }
+                else if (cmbSourceBillType.Text.Trim() == "鐢熶骇姹囨姤鍗�")
                 {
                     DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill oIF_ICMOReportBillList = new DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill();
                     if (oIF_ICMOReportBillList.RefreshBySourceBillNo(" Where 鍗曟嵁鍙� like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + HOrgID.ToString()))  //閫夋嫨鍘熷崟
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.designer.cs"
index 404980e..61c7306 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.designer.cs"
@@ -55,8 +55,6 @@
             this.label2 = new System.Windows.Forms.Label();
             this.cmbHOrgID = new System.Windows.Forms.ComboBox();
             this.label3 = new System.Windows.Forms.Label();
-            this.cmbHBarCodeType = new System.Windows.Forms.ComboBox();
-            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();
@@ -325,8 +323,6 @@
             this.gbUp.Controls.Add(this.label2);
             this.gbUp.Controls.Add(this.cmbHOrgID);
             this.gbUp.Controls.Add(this.label3);
-            this.gbUp.Controls.Add(this.cmbHBarCodeType);
-            this.gbUp.Controls.Add(this.label1);
             this.gbUp.Controls.Add(this.cmdHEmpID);
             this.gbUp.Controls.Add(this.cmdSourceBillNo);
             this.gbUp.Controls.Add(this.txtHSourceBillNo);
@@ -397,25 +393,6 @@
             this.label3.Size = new System.Drawing.Size(53, 12);
             this.label3.TabIndex = 84;
             this.label3.Text = "缁�    缁�";
-            // 
-            // cmbHBarCodeType
-            // 
-            this.cmbHBarCodeType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbHBarCodeType.FormattingEnabled = true;
-            this.cmbHBarCodeType.Location = new System.Drawing.Point(676, 46);
-            this.cmbHBarCodeType.Name = "cmbHBarCodeType";
-            this.cmbHBarCodeType.Size = new System.Drawing.Size(188, 20);
-            this.cmbHBarCodeType.TabIndex = 81;
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.ForeColor = System.Drawing.Color.Black;
-            this.label1.Location = new System.Drawing.Point(609, 50);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(53, 12);
-            this.label1.TabIndex = 80;
-            this.label1.Text = "鏉$爜绫诲瀷";
             // 
             // cmdHEmpID
             // 
@@ -923,8 +900,6 @@
         private System.Windows.Forms.Panel panel3;
         private System.Windows.Forms.DataGridView grdSum;
         private System.Windows.Forms.DataGridView grdPrint;
-        private System.Windows.Forms.ComboBox cmbHBarCodeType;
-        private System.Windows.Forms.Label label1;
         private System.Windows.Forms.ToolStripButton dy;
         private System.Windows.Forms.ComboBox cmbHOrgID;
         private System.Windows.Forms.Label label3;

--
Gitblit v1.9.1