diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index 5f76382..eb76811 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -601,14 +601,19 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; else '已合并' end as IsNew, case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, - case when sum(a.Quantity) =sum(IssueQuantity) then '已过账' - when sum(a.Quantity)!=sum(IssueQuantity) AND sum(IssueQuantity)>0 then '已配料' - else '未配料' end as Status, + g.Status as Status1, f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID from ICSOApply a left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint + left join (SELECT ApplyCode, + case when sum(Quantity) =sum(IssueQuantity) AND sum(IssueQuantity)>0 then '已过账' + + else '未过账' end as Status + from ICSOApply + where WorkPoint='{WorkPoint}' + group by ApplyCode) g on a.ApplyCode = g.ApplyCode left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLotInfoLog ) k on a.ApplyCode=k.TransCode and a.WorkPoint=k.WorkPoint and k.TransType='15' @@ -641,7 +646,20 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo } sqlString.Append(@"group by a.ApplyCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode, f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4,f.cFree5, - f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID ) t where row=1"); + f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,g.Status ) t where row=1"); + + if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) + { + if (queryParam["Status1"].ToString() == "1") + { + sqlString.Append($@" AND t.Status1='已过账' "); + } + else + { + sqlString.Append($@" AND t.Status1='未过账' "); + } + + } #endregion return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); @@ -931,13 +949,13 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo else '已合并' end as IsNew, case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, - case when sum(a.Quantity)=sum(a.OutQuantity) then '已过帐' - when sum(a.Quantity)!=sum(a.OutQuantity) and sum(a.OutQuantity)>0 then '已配料' - else '未配料' END AS Status, -f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, + g.Status as Status1, + f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID from ICSOtherOut a left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint + left join (SELECT OutCode,case when sum(Quantity) =sum(OutQuantity) AND sum(OutQuantity)>0 then '已过账' else '未过账' end as Status + from ICSOtherOut where WorkPoint='{WorkPoint}' group by OutCode) g on a.OutCode = g.OutCode left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint @@ -973,7 +991,19 @@ f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, } sqlString.Append(@" group by a.OutCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,f.BatchCode, f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6, - f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID) t where t.row=1"); + f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,g.Status) t where t.row=1"); + if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) + { + if (queryParam["Status1"].ToString() == "1") + { + sqlString.Append($@" AND t.Status1='已过账' "); + } + else + { + sqlString.Append($@" AND t.Status1='未过账' "); + } + + } return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); } @@ -1119,21 +1149,17 @@ f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, // sql += " WHERE 1=1 and e.ID is null "; sqlString.Append($@"select * from (select row_number() over(partition by a.TransferNO order by a.TransferNO) row, a.TransferNO as Code,a.ID,CONVERT(varchar(100),a.CreateDateTime,23) as MTIME,a.CreatePerson as MUSER, - case - when max(e.SourceID) is null then '未合并' - else '已合并' - end as IsNew, - case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, - case when sum(a.Quantity)=sum(a.TransferQuantity) then '已过帐' - when sum(a.Quantity)!=sum(a.TransferQuantity) and sum(a.TransferQuantity)>0 then '已配料' - else '未配料' END AS Status, + g.Status as Status1, f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10 from ICSTransfer a left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint + left join (SELECT TransferNO,case when sum(Quantity) =sum(TransferQuantity) AND sum(TransferQuantity)>0 then '已过账' else '未过账' end as Status + from ICSTransfer where WorkPoint='{WorkPoint}' group by TransferNO) g on a.TransferNO = g.TransferNO + left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint - LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.ToWarehouseCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint + LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.FromWarehouseCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLotInfoLog ) k on a.TransferNO=k.TransCode and a.WorkPoint=k.WorkPoint and k.TransType='15' where a.WorkPoint = '{WorkPoint}' and a.Status = '2'"); if (!string.IsNullOrWhiteSpace(queryJson)) @@ -1164,7 +1190,20 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo } sqlString.Append(@"group by a.TransferNO,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode, f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4, - f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,a.TransferQuantity) t where t.row=1"); + f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,a.TransferQuantity,g.Status) t where t.row=1"); + + if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) + { + if (queryParam["Status1"].ToString() == "1") + { + sqlString.Append($@" AND t.Status1='已过账' "); + } + else + { + sqlString.Append($@" AND t.Status1='未过账' "); + } + + } #endregion return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); 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 2bc18f8..7af3476 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml @@ -47,6 +47,9 @@ var ct10 = document.getElementById("date3"); var ct11 = document.getElementById("date4"); + var ct12 = document.getElementById("status3") + var ct13 = document.getElementById("status4") + var cols = new Array(); var collast = { label: "主键", name: "ID", hidden: true , key: true }; cols.push(collast); @@ -91,6 +94,8 @@ ct9.style.display = ""; ct10.style.display = ""; ct11.style.display = ""; + ct12.style.display = "none"; + ct13.style.display = "none"; } else { ct4.style.display = "none"; @@ -101,6 +106,8 @@ ct9.style.display = "none"; ct10.style.display = "none"; ct11.style.display = "none"; + ct12.style.display = ""; + ct13.style.display = ""; } @@ -215,6 +222,7 @@ CusCode: $("#txt_CusCode").val(), CusName: $("#txt_CusName").val(), Status: $("#selShow2").val(), + Status1: $("#selShow3").val(), Order: $("#txt_Order").val(), Container: $('input[name="container"]:checked').val(), CreateDate: $("#txt_CreateDate").val(), @@ -948,18 +956,24 @@