From 3d7caae2056704b2d0965fa8f86a7dd591999efe Mon Sep 17 00:00:00 2001 From: yxj <1qaz@123> Date: 星期二, 28 十二月 2021 23:23:11 +0800 Subject: [PATCH] 条码生成模块,增加是否赠品列,选源单收料通知单时从源单带出写入条码表 --- WarM/条码打印/Gy_BarCodeBill.cs | 217 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 133 insertions(+), 84 deletions(-) diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" index 7987c2b..5bfb837 100644 --- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" +++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" @@ -39,45 +39,46 @@ public const Int16 HBarCodeTypeCol = 18; public const Int16 HBatchManagerCol = 19; public const Int16 HBatchNoCol = 20; - public const Int16 HQtyCol = 21; - public const Int16 HMinQtyCol = 22; - public const Int16 HBQtyCol = 23; - public const Int16 HDeptIDCol = 24; - public const Int16 HDeptNumberCol = 25; - public const Int16 HDeptNameCol = 26; - public const Int16 HSourceIDCol = 27; - public const Int16 HSourceNumberCol = 28; - public const Int16 HSourceNameCol = 29; - public const Int16 HDateCol = 30; - public const Int16 HEndDateCol = 31; - public const Int16 HSupIDCol = 32; - public const Int16 HSupNumberCol = 33; - public const Int16 HSupNameCol = 34; - public const Int16 HCusIDCol = 35; - public const Int16 HCusNumberCol = 36; - public const Int16 HCusNameCol = 37; - public const Int16 HCusTypeCol = 38; - public const Int16 HSourceInterIDCol = 39; - public const Int16 HSourceEntryIDCol = 40; - public const Int16 HSourceBillNoCol = 41; - public const Int16 HSourceBillTypeCol = 42; - public const Int16 HInstructIDCol = 43; - public const Int16 HInstructNoCol = 44; - public const Int16 HSeOrderBillIDCol = 45; - public const Int16 HSeOrderBillNoCol = 46; - public const Int16 HWhIDCol = 47; - public const Int16 HWhNumberCol = 48; - public const Int16 HWhNameCol = 49; - public const Int16 HSPIDCol = 50; - public const Int16 HSPNumberCol = 51; - public const Int16 HSPNameCol = 52; - public const Int16 HinitQtyCol = 53; - public const Int16 HRemarkCol = 54; - public const Int16 HPinfanBarCodeCol = 55; - public const Int16 HMTONoCol = 56; - public const Int16 HShowDateCol = 57; - public const Int16 HInnerBillNoCol = 58; - public const Int16 HMakerCol = 59; + public const Int16 HGiveAwayFlagCol = 21; + public const Int16 HQtyCol = 22; + public const Int16 HMinQtyCol = 23; + public const Int16 HBQtyCol = 24; + public const Int16 HDeptIDCol = 25; + public const Int16 HDeptNumberCol = 26; + public const Int16 HDeptNameCol = 27; + public const Int16 HSourceIDCol = 28; + public const Int16 HSourceNumberCol = 29; + public const Int16 HSourceNameCol = 30; + public const Int16 HDateCol = 31; + public const Int16 HEndDateCol = 32; + public const Int16 HSupIDCol = 33; + public const Int16 HSupNumberCol = 34; + public const Int16 HSupNameCol = 35; + public const Int16 HCusIDCol = 36; + public const Int16 HCusNumberCol = 37; + public const Int16 HCusNameCol = 38; + public const Int16 HCusTypeCol = 39; + public const Int16 HSourceInterIDCol = 40; + public const Int16 HSourceEntryIDCol = 41; + public const Int16 HSourceBillNoCol = 42; + public const Int16 HSourceBillTypeCol = 43; + public const Int16 HInstructIDCol = 44; + public const Int16 HInstructNoCol = 45; + public const Int16 HSeOrderBillIDCol = 46; + public const Int16 HSeOrderBillNoCol = 47; + public const Int16 HWhIDCol = 48; + public const Int16 HWhNumberCol = 49; + public const Int16 HWhNameCol = 50; + public const Int16 HSPIDCol = 51; + public const Int16 HSPNumberCol = 52; + public const Int16 HSPNameCol = 53; + public const Int16 HinitQtyCol = 54; + public const Int16 HRemarkCol = 55; + public const Int16 HPinfanBarCodeCol = 56; + public const Int16 HMTONoCol = 57; + public const Int16 HShowDateCol = 58; + public const Int16 HInnerBillNoCol = 59; + public const Int16 HMakerCol = 60; public Int16 HSelectCol = 0; public Int16 HSno2Col = 1; @@ -93,49 +94,50 @@ public Int16 HAuxPropNumber2Col = 11; public Int16 HAuxPropName2Col = 12; public Int16 HBatchNo2Col = 13; - public Int16 HUnitID2Col = 14; - public Int16 HUnitNumber2Col = 15; - public Int16 HUnitName2Col = 16; - public Int16 HQty2Col = 17; - public Int16 HWeiCol = 18; - public Int16 HPrintCol = 19; - public Int16 HDeptID2Col = 20; - public Int16 HDeptNumber2Col = 21; - public Int16 HDeptName2Col = 22; - public Int16 HSourceID2Col = 23; - public Int16 HSourceNumber2Col = 24; - public Int16 HSourceName2Col = 25; - public Int16 HDate2Col = 26; - public Int16 HEndDate2Col = 27; - public Int16 HBarcodeNoCol = 28; - public Int16 HBarcodeQtysCol = 29; - public Int16 HSupID2Col = 30; - public Int16 HSupNumber2Col = 31; - public Int16 HSupName2Col = 32; - public Int16 HCusID2Col = 33; - public Int16 HCusNumber2Col = 34; - public Int16 HCusName2Col = 35; - public Int16 HCusType2Col = 36; - public Int16 HSourceInterID2Col = 37; - public Int16 HSourceEntryID2Col = 38; - public Int16 HSourceBillNo2Col = 39; - public Int16 HSourceBillType2Col = 40; - public Int16 HInstructID2Col = 41; - public Int16 HInstructNo2Col = 42; - public Int16 HSeOrderBillID2Col = 43; - public Int16 HSeOrderBillNo2Col = 44; - public Int16 HWhID2Col = 45; - public Int16 HWhNumber2Col = 46; - public Int16 HWhName2Col = 47; - public Int16 HSPID2Col = 48; - public Int16 HSPNumber2Col = 49; - public Int16 HSPName2Col = 50; - public Int16 HRemark2Col = 51; - public Int16 HPinfanBarCode2Col = 52; - public Int16 HMTONo2Col = 53; - public Int16 HShowDate2Col = 54; - public Int16 HInnerBillNo2Col = 55; - public Int16 HMaker2Col = 56; + public Int16 HGiveAwayFlag2Col = 14; + public Int16 HUnitID2Col = 15; + public Int16 HUnitNumber2Col = 16; + public Int16 HUnitName2Col = 17; + public Int16 HQty2Col = 18; + public Int16 HWeiCol = 19; + public Int16 HPrintCol = 20; + public Int16 HDeptID2Col = 21; + public Int16 HDeptNumber2Col = 22; + public Int16 HDeptName2Col = 23; + public Int16 HSourceID2Col = 24; + public Int16 HSourceNumber2Col = 25; + public Int16 HSourceName2Col = 26; + public Int16 HDate2Col = 27; + public Int16 HEndDate2Col = 28; + public Int16 HBarcodeNoCol = 29; + public Int16 HBarcodeQtysCol = 30; + public Int16 HSupID2Col = 31; + public Int16 HSupNumber2Col = 32; + public Int16 HSupName2Col = 33; + public Int16 HCusID2Col = 34; + public Int16 HCusNumber2Col = 35; + public Int16 HCusName2Col = 36; + public Int16 HCusType2Col = 37; + public Int16 HSourceInterID2Col = 38; + public Int16 HSourceEntryID2Col = 39; + public Int16 HSourceBillNo2Col = 40; + public Int16 HSourceBillType2Col = 41; + public Int16 HInstructID2Col = 42; + public Int16 HInstructNo2Col = 43; + public Int16 HSeOrderBillID2Col = 44; + public Int16 HSeOrderBillNo2Col = 45; + public Int16 HWhID2Col = 46; + public Int16 HWhNumber2Col = 47; + public Int16 HWhName2Col = 48; + public Int16 HSPID2Col = 49; + public Int16 HSPNumber2Col = 50; + public Int16 HSPName2Col = 51; + public Int16 HRemark2Col = 52; + public Int16 HPinfanBarCode2Col = 53; + public Int16 HMTONo2Col = 54; + public Int16 HShowDate2Col = 55; + public Int16 HInnerBillNo2Col = 56; + public Int16 HMaker2Col = 57; // public string ModName = "85"; public string ModCaption = "鏉$爜鐢熸垚"; @@ -830,6 +832,13 @@ grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value = grdMain.Rows[j].Cells[HSeOrderBillNoCol].Value; grdSub.Rows[i].Cells[HInnerBillNo2Col].Value = grdMain.Rows[j].Cells[HInnerBillNoCol].Value; grdSub.Rows[i].Cells[HMaker2Col].Value = grdMain.Rows[j].Cells[HMakerCol].Value; + grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value = grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value; + //缃戞牸鎵撳嬀 + DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); + oCell.ThreeState = false; + oCell.Value = grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value; + oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; + grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell; k = k + 1; n = n + 1; oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); @@ -867,6 +876,7 @@ string HWorkLineName = ""; string HSeOrderBillNo = ""; string HInnerBillNo = ""; + bool HGiveAwayFlag = false; try { oCn.BeginTran(); @@ -903,12 +913,14 @@ HWorkLineName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceName2Col].Value); 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 " + ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + + ",HGiveAwayFlag " + ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + ") values (" + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() @@ -917,6 +929,7 @@ + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); @@ -975,7 +988,7 @@ // grdMain.RowCount = 0; grdSub.RowCount = 0; - grdMain.ColumnCount = 60; //鎬诲垪鏁� + grdMain.ColumnCount = 61; //鎬诲垪鏁� DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); grdMain.Columns[HSnoCol].HeaderText = "搴忓彿"; grdMain.Columns[HMainIDCol].HeaderText = "婧愬崟涓籌D"; @@ -998,6 +1011,7 @@ grdMain.Columns[HBarCodeTypeCol].HeaderText = "鏉$爜绫诲瀷"; grdMain.Columns[HBatchManagerCol].HeaderText = "鏄惁鍚敤鎵规"; grdMain.Columns[HBatchNoCol].HeaderText = "鎵瑰彿"; + grdMain.Columns[HGiveAwayFlagCol].HeaderText = "鏄惁璧犲搧"; grdMain.Columns[HQtyCol].HeaderText = "鏁伴噺"; grdMain.Columns[HMinQtyCol].HeaderText = "鏈�灏忓寘瑁呮暟"; grdMain.Columns[HBQtyCol].HeaderText = "绠辨暟"; @@ -1089,12 +1103,23 @@ "," + HRemarkCol.ToString(); //璁剧疆鍚堣鍒� string sTotalCol = HQtyCol.ToString(); + + //璁剧疆鐗规畩鍒� + for (int i = 0; i < grdMain.Rows.Count; i++) + { + //缃戞牸鎵撳嬀 + DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); + oCell.ThreeState = false; + oCell.Value = 0; + oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; + grdMain.Rows[i].Cells[HGiveAwayFlagCol] = oCell; + } // DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid); //---------------------------- - grdSub.ColumnCount = 57; //鎬诲垪鏁� + grdSub.ColumnCount = 58; //鎬诲垪鏁� DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name); grdSub.Columns[HSelectCol].HeaderText = "閫夋嫨"; grdSub.Columns[HTMCol].HeaderText = "鏉$爜缂栧彿"; @@ -1111,6 +1136,7 @@ grdSub.Columns[HPinfan2Col].HeaderText = "鍝佺暘"; grdSub.Columns[HPinfanBarCode2Col].HeaderText = "HPinfanBarCode"; grdSub.Columns[HBatchNo2Col].HeaderText = "鎵瑰彿"; + grdSub.Columns[HGiveAwayFlag2Col].HeaderText = "鏄惁璧犲搧"; grdSub.Columns[HUnitID2Col].HeaderText = "璁¢噺鍗曚綅ID"; grdSub.Columns[HUnitNumber2Col].HeaderText = "璁¢噺鍗曚綅浠g爜"; grdSub.Columns[HUnitName2Col].HeaderText = "璁¢噺鍗曚綅"; @@ -1194,6 +1220,17 @@ grdSub.Columns[HSourceID2Col].Visible = false; grdSub.Columns[HSourceNumber2Col].Visible = false; grdSub.Columns[HSourceName2Col].Visible = false; + + //璁剧疆鐗规畩鍒� + for (int i = 0; i < grdSub.Rows.Count; i++) + { + //缃戞牸鎵撳嬀 + DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); + oCell.ThreeState = false; + oCell.Value = 0; + oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; + grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell; + } DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name); DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub"); @@ -1905,6 +1942,18 @@ grdMain.Rows[i].Cells[HSupIDCol].Value = oTable.Rows[0]["hsupid"].ToString(); grdMain.Rows[i].Cells[HSupNumberCol].Value = oTable.Rows[0]["渚涘簲鍟嗕唬鐮�"].ToString(); grdMain.Rows[i].Cells[HSupNameCol].Value = oTable.Rows[0]["渚涘簲鍟�"].ToString(); + if (cmbSourceBillType.Text.Trim() == "鏀舵枡閫氱煡鍗�") + { + if (oTable.Rows[0]["鏄惁璧犲搧"].ToString() == "鏄�") + { + grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 1; + } + else + { + grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 0; + } + } + } if (cmbSourceBillType.Text.Trim() == "閫�璐ч�氱煡鍗�") { -- Gitblit v1.9.1