From 55e565721ef588d7ae9f421b6d1fce63b51aa55f Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 01 八月 2024 15:56:43 +0800
Subject: [PATCH] 物料流水号新增

---
 WorkM/流转卡管理/Sc_ProcessExchangeBill.cs |  122 ++++++++++++++++++++++------------------
 1 files changed, 67 insertions(+), 55 deletions(-)

diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill.cs"
index fa63144..77962cb 100644
--- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill.cs"
+++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill.cs"
@@ -105,6 +105,7 @@
         public const Int16 HMouldNoCol = 79;
         public const Int16 HProcWorkNumCol = 80;
         public const Int16 HICMOEntryIDCol = 81;
+        public const Int16 HSNCtrlCol = 82;
 
 
 
@@ -751,7 +752,8 @@
             this.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
             this.Sub_OperStatus();//璁剧疆TOOLBAR
             this.Sub_ClearBill();//娓呯┖鐣岄潰
-            this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙�
+            //this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙�
+            this.txtHBillNo.Text = ClsPub.CreateBillCode_Prod(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙�    20240620杩斿洖鍊兼敼鍙栧瓨鍌ㄨ繃绋�
             this.txtHBillNo.Enabled = true;
             this.txtHBillNo.Focus();
             //鐏板害婧愬崟绫诲瀷
@@ -1214,6 +1216,7 @@
                     grdMain.Rows[i].Cells[HTechnologyParameterCol].Value = oSub.HTechnologyParameter.ToString();
                     grdMain.Rows[i].Cells[HOverRateCol].Value = oSub.HOverRate.ToString();
                     grdMain.Rows[i].Cells[HMaxQtyCol].Value = oSub.HMaxQty.ToString();
+                    grdMain.Rows[i].Cells[HSNCtrlCol].Value = DBUtility.ClsPub.isBool(oSub.HSNCtrl);
 
                     //
                     grdMain.Rows[i].Cells[HICMOBillNoCol].Value = oSub.HICMOBillNo;
@@ -1565,6 +1568,7 @@
                         oSub.HProcCheckNote = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcCheckNoteCol].Value);
                         oSub.HMouldNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMouldNoCol].Value);
                         oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcWorkNumCol].Value);
+                        oSub.HSNCtrl = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HSNCtrlCol].Value);
                         BillNew.DetailColl.Add(oSub);
                     }
                 }
@@ -1617,7 +1621,7 @@
         {
 
             //
-            grdMain.ColumnCount = 82;                       //鎬诲垪鏁�
+            grdMain.ColumnCount = 83;                       //鎬诲垪鏁�
             DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
             //
             grdMain.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True;
@@ -1736,6 +1740,7 @@
             grdMain.Columns[HEditCol].HeaderText = "涓嶅彲缂栬緫";
             grdMain.Columns[HOverRateCol].HeaderText = "瓒呴姣斾緥";
             grdMain.Columns[HMaxQtyCol].HeaderText = " 鏈�楂樹笂闄�";
+            grdMain.Columns[HSNCtrlCol].HeaderText = "SN鐮佽繃绔�";
 
 
             //鏍煎紡鍖� 
@@ -1878,6 +1883,12 @@
                 oCell2.Value = 0;
                 oCell2.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                 grdMain.Rows[i].Cells[HEditCol] = oCell2;
+                //SN鐮佽繃绔�
+                DataGridViewCheckBoxCell oCell3 = new DataGridViewCheckBoxCell();
+                oCell3.ThreeState = false;
+                oCell3.Value = 0;
+                oCell3.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
+                grdMain.Rows[i].Cells[HSNCtrlCol] = oCell3;
             }
             //鏍煎紡鍖栫綉鏍�
             DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
@@ -3358,62 +3369,62 @@
             string sNo = "";
             int row = oTable.Rows.Count - 1;
 
-            //鑾峰彇绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�
-            Ds = oCn.RunProcReturn("select HValue from Xt_SystemParameter with(nolock) where HKey='WMS_CampanyName'", "Xt_SystemParameter", ref DBUtility.ClsPub.sExeReturnInfo);
-            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
-            {
-                MessageBox.Show("鑾峰彇绯荤粺鍙傛暟澶辫触锛佸師鍥�:" + DBUtility.ClsPub.sExeReturnInfo, "鎻愮ず");
-                return;
-            }
-            else
-            {
-                CampanyName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HValue"]);
-            }
-            if (CampanyName == "鍑礉濂堢壒") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�
-            {
+            ////鑾峰彇绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�
+            //Ds = oCn.RunProcReturn("select HValue from Xt_SystemParameter with(nolock) where HKey='WMS_CampanyName'", "Xt_SystemParameter", ref DBUtility.ClsPub.sExeReturnInfo);
+            //if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+            //{
+            //    MessageBox.Show("鑾峰彇绯荤粺鍙傛暟澶辫触锛佸師鍥�:" + DBUtility.ClsPub.sExeReturnInfo, "鎻愮ず");
+            //    return;
+            //}
+            //else
+            //{
+            //    CampanyName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HValue"]);
+            //}
+            //if (CampanyName == "鍑礉濂堢壒") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�
+            //{
 
-            }
-            else
-            {
-                //鑾峰彇褰撳墠鏀圭敓浜ц鍗� 鏈�澶ф祦杞崱鍙凤紝骞剁疮璁″鍔�1銆�
-                //鏅鸿鍗曞彿- 骞存湀鏃�20200701+001
-                string sOldNo = "";
-                //Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where hicmointerid=" + oTable.Rows[row]["hmainid"].ToString() + "  order by LEN(HBillno) desc, HbillNo desc ", "Sc_ProcessExchangeBillmain");
+            //}
+            //else
+            //{
+            //    //鑾峰彇褰撳墠鏀圭敓浜ц鍗� 鏈�澶ф祦杞崱鍙凤紝骞剁疮璁″鍔�1銆�
+            //    //鏅鸿鍗曞彿- 骞存湀鏃�20200701+001
+            //    string sOldNo = "";
+            //    //Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where hicmointerid=" + oTable.Rows[row]["hmainid"].ToString() + "  order by LEN(HBillno) desc, HbillNo desc ", "Sc_ProcessExchangeBillmain");
 
-                Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where HDate='" + dtpHDate.Value.ToShortDateString() + "' and HBillSubType<>'Split' order by  HbillNo desc ", "Sc_ProcessExchangeBillmain");
-                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
-                {
-                    sNo = "001";
-                }
-                else
-                {
-                    sOldNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
-                    sOldNo = sOldNo.Substring(sOldNo.Length - 3, 3);
-                    //if (sOldNo.Substring(0, 1) == "0" || sOldNo.Substring(0, 1) == "-")
-                    //{
-                    //    sOldNo = sOldNo.Substring(sOldNo.Length - 2, 2);
-                    //    if (sOldNo.Substring(0, 1) == "0")
-                    //    {
-                    //        sOldNo = sOldNo.Substring(sOldNo.Length - 1, 1);
-                    //    }
-                    //}
-                    sNo = "0000" + DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isLong(sOldNo) + 1);
-                }
+            //    Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where HDate='" + dtpHDate.Value.ToShortDateString() + "' and HBillSubType<>'Split' order by  HbillNo desc ", "Sc_ProcessExchangeBillmain");
+            //    if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+            //    {
+            //        sNo = "001";
+            //    }
+            //    else
+            //    {
+            //        sOldNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
+            //        sOldNo = sOldNo.Substring(sOldNo.Length - 3, 3);
+            //        //if (sOldNo.Substring(0, 1) == "0" || sOldNo.Substring(0, 1) == "-")
+            //        //{
+            //        //    sOldNo = sOldNo.Substring(sOldNo.Length - 2, 2);
+            //        //    if (sOldNo.Substring(0, 1) == "0")
+            //        //    {
+            //        //        sOldNo = sOldNo.Substring(sOldNo.Length - 1, 1);
+            //        //    }
+            //        //}
+            //        sNo = "0000" + DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isLong(sOldNo) + 1);
+            //    }
 
-                sNo = sNo.Substring(sNo.Length - 3, 3);
-                //initGrid();
-                //initGrid_Sub();
-                //string sBillNo = oTable.Rows[row]["鐢熶骇璁㈠崟鍙�"].ToString();
-                string sYear = dtpHDate.Value.Year.ToString();
-                string sMonth = "00" + dtpHDate.Value.Month.ToString();
-                string sDay = "00" + dtpHDate.Value.Day.ToString();
-                string sBillNo = sYear + sMonth.Substring(sMonth.Length - 2, 2) + sDay.Substring(sDay.Length - 2, 2);
-                //sBillNo = sBillNo.Replace("WORKX", "");
-                //sBillNo = sBillNo.Replace("WORK", "");
-                //sBillNo = sBillNo.Replace("_", "-");
-                sBillNo = sBillNo + "-" + sNo;
-                txtHBillNo.Text = sBillNo;
-            }
+            //    sNo = sNo.Substring(sNo.Length - 3, 3);
+            //    //initGrid();
+            //    //initGrid_Sub();
+            //    //string sBillNo = oTable.Rows[row]["鐢熶骇璁㈠崟鍙�"].ToString();
+            //    string sYear = dtpHDate.Value.Year.ToString();
+            //    string sMonth = "00" + dtpHDate.Value.Month.ToString();
+            //    string sDay = "00" + dtpHDate.Value.Day.ToString();
+            //    string sBillNo = sYear + sMonth.Substring(sMonth.Length - 2, 2) + sDay.Substring(sDay.Length - 2, 2);
+            //    //sBillNo = sBillNo.Replace("WORKX", "");
+            //    //sBillNo = sBillNo.Replace("WORK", "");
+            //    //sBillNo = sBillNo.Replace("_", "-");
+            //    sBillNo = sBillNo + "-" + sNo;
+            //    txtHBillNo.Text = sBillNo;
+            //}
 
 
 
@@ -3544,6 +3555,7 @@
                 grdMain.Rows[i].Cells[HMaxQtyCol].Value = oTable.Rows[i]["鏈�楂樹笂闄�"].ToString();
                 grdMain.Rows[i].Cells[HMouldNoCol].Value = oTable.Rows[i]["妯″叿缂栧彿"].ToString();
                 grdMain.Rows[i].Cells[HProcWorkNumCol].Value = oTable.Rows[i]["绋嬪簭鍙�"].ToString();
+                grdMain.Rows[i].Cells[HSNCtrlCol].Value = oTable.Rows[i]["SN鐮佽繃绔�"].ToString();
             }
 
             Sub_CountProcExchQty();

--
Gitblit v1.9.1