diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index 3aa64d2..1978730 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -3111,11 +3111,11 @@ b.InvUnit, objCode = objCode.Substring(1, objCode.Length - 2); string sql = string.Empty; - sql += string.Format(@" delete dbo.ICSWareHouseLotInfoLog where TransCode in({0}) and TransType='15' and WorkPoint='{1}'", objCode.TrimEnd(','), WorkPoint); - sql += string.Format(@"update b set b.LockQuantity=b.LockQuantity-a.Quantity + sql += string.Format(@"update b set b.LockQuantity=convert(decimal(18,6),b.LockQuantity)-convert(decimal(18,6),a.Quantity ) from dbo.ICSWareHouseLotInfoLog a left join dbo.ICSWareHouseLotInfo b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint where a.TransCode in ({0}) and a.TransType='15' and a.WorkPoint='{1}'", objCode.TrimEnd(','), WorkPoint); + sql += string.Format(@" delete dbo.ICSWareHouseLotInfoLog where TransCode in({0}) and TransType='15' and WorkPoint='{1}'", objCode.TrimEnd(','), WorkPoint); try { if (SqlHelper.CmdExecuteNonQueryLi(sql) > 0) 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 a29feab..b37212e 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml @@ -10,6 +10,7 @@ var flag = '1'; var mark = ''; var Arguments = ''; + //var PickID = ''; $(function () { SetCols(); @@ -21,7 +22,7 @@ document.getElementById("gridPanel").innerHTML = ' 详细信息
';//重置grid SetCols(); gridList(); - + } @@ -45,7 +46,7 @@ var ct11 = document.getElementById("date4"); var cols = new Array(); - var collast = { label: "主键", name: "ID", hidden: true, key: true }; + var collast = { label: "主键", name: "ID", hidden: true , key: true }; cols.push(collast); var collast = { label: '单据号', name: 'Code', width: 120, align: 'left' }; cols.push(collast); @@ -55,8 +56,8 @@ //cols.push(collast); //var collast = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' }; //cols.push(collast); - var collast = { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' }; - cols.push(collast); + //var collast = { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' }; + //cols.push(collast); var collast = { label: '占料状态', name: 'IsOccupy', width: 80, align: 'left' }; cols.push(collast); var cols1 = new Array(); @@ -230,7 +231,30 @@ shrinkToFit: false,//宽度自适应 autowidth: true, gridComplete: function () { + + var strIds = $("#gridList").jqGrid("getDataIDs"); + + for (var i = 0; i < strIds.length; i++) { + var strValue = $("#gridList").jqGrid("getCell", strIds[i], "IsOccupy");//得到单元格数据 + if (strValue == "已占料") { + $("#" + strIds[i]).find("td").css("background-color", "yellow"); + } + } }, + //onLoadComplete: function(data) { + // // 设置行选中 + // var PickID = $("#PickID").val(); + // if (PickID != '') { + // var PickID = PickID.split(','); + // for (var i = 0; i < PickID.length; i++) { + // //$("#gridList").jqGrid('setSelection', PickID[i]); + // // $("#gridList").jqGrid('setSelection', PickID[i]); + // $('#gridList').jqGrid('setSelectionState', PickID[i], true); + // // $('#gridList').jqGrid('setSelectionState', '17140e8d-5c4d-4f29-9913-5efc256f6e7f', true); + + // } + // } + //}, rowNum: 10000, autoScroll: true, sortname: 'Code', @@ -238,6 +262,7 @@ viewrecords: true, multiselect: true, subGrid: true, // (1)开启子表格支持 + subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数 $("#gridList").jqGrid("setSelection", rowid, false); bindSubGrid(subgrid_id, rowid) @@ -568,12 +593,19 @@ function btnMaterial() { debugger; //var ISFlag = false; + $("#PickID").val(''); var sign = ''; var objCode = ''; + var PickIDs = ''; var arr = []; mark = '拣料'; flag = '1'; + var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); + if (objList.length<=0) { + $.modalAlert("请先选择单据!", "warning"); + return; + } for (var i = 0; i < objList.length; i++) { var objArr = ''; var rowId = objList[i]; @@ -582,8 +614,12 @@ $.modalAlertNew("WMS00091"); return; } - objCode += "'" + rowData.Code + "',"; - objArr += "'" + rowData.Code + "',"; + PickIDs += "'" + rowId + "',"; + if (rowData.Code!=undefined) { + objCode += "'" + rowData.Code + "',"; + objArr += "'" + rowData.Code + "',"; + } + objArr = objArr.slice(0, objArr.length - 1); objArr = "" + objArr + "|"; arr.push(objArr); @@ -598,6 +634,8 @@ } }); if (sign == '0') { + // PickID = PickIDs; + $("#PickID").val(PickIDs); gridList2(flag); } if (sign == '1') { @@ -605,10 +643,14 @@ return; } if (sign == '2') { + $("#PickID").val(PickIDs); + // $.modalAlert("所选单据已占料,可直接打印!", "warning"); + $.modalMsg("所选单据已占料,可直接打印!", "warning"); + gridList3(); } - + Seach(); } @@ -786,23 +828,42 @@ var objArr = ''; var rowId = objList[i]; var rowData = $("#gridList").jqGrid('getRowData', rowId); - if (rowData.IsOccupy == "已占料") { + //if (rowData.IsOccupy == "已占料") { + if (rowData.Code!=undefined) { objCode += "'" + rowData.Code + "',"; - ISFlag = ISFlag + 1; } + + // ISFlag = ISFlag + 1; + //} } - if (objList.length == ISFlag) { + $.ajax({ + url: "/WMS/PickMaterial/SeachPickLog" + "?" + Math.random() + "&objCode=" + objCode, + dataType: "json", + type: "post", + async: false, + success: function (data) { + sign = data.count; + } + }); + if (sign == '0') { + + $.modalAlert("所选单据无需取消占料!", "warning"); + return; + } + if (sign == '1') { + $.modalAlert("所选单据占料状态不一致!", "warning"); + return; + } + if (sign == '2') { $.submitForm({ url: "/WMS/PickMaterial/DelPickLog?" + Math.random(), param: { objCode: JSON.stringify(objCode) }, success: function () { - $.currentWindow().$("#gridList").trigger("reloadGrid"); + $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) - } else { - $.modalAlert("所选单据中存在未占料单据,请重新选择!", "warning"); - return; } + } @@ -886,6 +947,7 @@
+