diff --git a/WMS-BS/NFine.Web/Areas/WMS/Controllers/PrintController.cs b/WMS-BS/NFine.Web/Areas/WMS/Controllers/PrintController.cs index 49e9a4a..aecb5b1 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Controllers/PrintController.cs +++ b/WMS-BS/NFine.Web/Areas/WMS/Controllers/PrintController.cs @@ -104,27 +104,47 @@ namespace NFine.Web.Areas.WMS.Controllers where ID='{0}'"; sqlLableDataSource= string.Format(sqlLableDataSource, LableSourceID); DataRow dr = SqlHelper.GetDataRowBySql(sqlLableDataSource); - string[] PrintParas = Parameter.Split('|'); - foreach (var p in PrintParas) + //var PrintParas = Parameter.Replace(",","").Split('|').Distinct().ToArray(); + //foreach (var p in PrintParas) + //{ + // sqltxt = dr["SqlTxt"].ToString(); + // if (dr["Paras"].ToString() != "") + // { + // string[] ps = dr["Paras"].ToString().Split(','); + // for (int i = 0; i < ps.Length; i++) + // { + // if (!string.IsNullOrEmpty(ps[i])) + // { + // sqltxt = sqltxt.Replace(ps[i], p.ToString()); + // } + // } + // } + // if (sqltxt.Contains("[WorkPoint]")) + // { + // sqltxt = sqltxt.Replace("[WorkPoint]", WorkPoint); + // } + + //} + + var PrintParas = Parameter.Replace("|", ""); + sqltxt = dr["SqlTxt"].ToString(); + if(PrintParas!=null) { - sqltxt = dr["SqlTxt"].ToString(); - if (dr["Paras"].ToString() != "") + string[] ps = dr["Paras"].ToString().Split(','); + for (int i = 0; i < ps.Length; i++) { - string[] ps = dr["Paras"].ToString().Split(','); - for (int i = 0; i < ps.Length; i++) + if (!string.IsNullOrEmpty(ps[i])) { - if (!string.IsNullOrEmpty(ps[i])) - { - sqltxt = sqltxt.Replace(ps[i], p.ToString()); - } + sqltxt = sqltxt.Replace(ps[i], PrintParas); } } - if (sqltxt.Contains("[WorkPoint]")) - { - sqltxt = sqltxt.Replace("[WorkPoint]", WorkPoint); - } - } + if (sqltxt.Contains("[WorkPoint]")) + { + sqltxt = sqltxt.Replace("[WorkPoint]", WorkPoint); + } + + string strPrintFileName = Server.MapPath("/File/LablesFile/") + ""+ FileAddress + ""; PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName); pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息 diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml index 91d8f18..555a1da 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml @@ -447,12 +447,13 @@ function btnMaterial() { debugger; - var objArr = ''; + var arr = []; mark = '拣料'; flag = '1'; var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); for (var i = 0; i < objList.length; i++) { + var objArr = ''; var rowId = objList[i]; var rowData = $("#gridList").jqGrid('getRowData', rowId); if (rowData.IsNew == "已合并") { @@ -557,7 +558,7 @@ return; } if (mark == '合并拣料') { - var objArr = ''; + var arr = []; var obj_Item1 = $("#gridList2"); var rowIds_Item1 = obj_Item1.getDataIDs(); @@ -566,18 +567,31 @@ if (rowIds_Item1.length > 0) { debugger; for (var i = 0; i < rowIds_Item1.length; i++) { - var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[0]); + var objArr = ''; + var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]); objArr += "'" + RowData_Item1.MergeID + "',"; objArr = objArr.slice(0, objArr.length - 1); objArr = "" + objArr + "|"; arr.push(objArr); } + + //var arr = []; + //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); + //for (var i = 0; i < objList.length; i++) { + // var objArr = ''; + // var rowId = objList[i]; + // var rowData = $("#gridList").jqGrid('getRowData', rowId); + // objArr += "'" + rowData.Code + "',"; + // objArr = objArr.slice(0, objArr.length - 1); + // objArr = "" + objArr + "|"; + // arr.push(objArr); + //} Arguments = arr; mold = 'HBJL00001'; } } - if (mark == '拣料') { - var objArr = ''; + if (mark == '拣料') { + var arr = []; var obj_Item1 = $("#gridList2"); var rowIds_Item1 = obj_Item1.getDataIDs(); @@ -586,12 +600,25 @@ if (rowIds_Item1.length > 0) { debugger; for (var i = 0; i < rowIds_Item1.length; i++) { - var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[0]); + var objArr = ''; + var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]); objArr += "'" + RowData_Item1.Code + "',"; objArr = objArr.slice(0, objArr.length - 1); objArr = "" + objArr + "|"; arr.push(objArr); } + + //var arr = []; + //var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); + //for (var i = 0; i < objList.length; i++) { + // var objArr = ''; + // var rowId = objList[i]; + // var rowData = $("#gridList").jqGrid('getRowData', rowId); + // objArr += "'" + rowData.Code + "',"; + // objArr = objArr.slice(0, objArr.length - 1); + // objArr = "" + objArr + "|"; + // arr.push(objArr); + //} Arguments = arr; mold = 'JL00001'; }