diff --git a/NX.ERP.U8/Pmc/PurchaseQuery.cs b/NX.ERP.U8/Pmc/PurchaseQuery.cs index 3ccae41..f7cea12 100644 --- a/NX.ERP.U8/Pmc/PurchaseQuery.cs +++ b/NX.ERP.U8/Pmc/PurchaseQuery.cs @@ -444,34 +444,50 @@ namespace NX.ERP.U8.Purchase public IEnumerable Purchasesummom(NX.ERP.Model.Request.PurchasesumRequest info) { string sql = $@" - select *from ( - select a.*,isnull(f.cMaker,'其他') as cpersonname ,inv.cInvName,inv.cInvStd from ( - select a.InvCode as CINVCODE ,1 as RQTY , iqty,cur.iQuantity, (cur.iQuantity-iqty) as bull From ( - SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) iqty - FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN - mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join - mom_morder mor WITH (NOLOCK) ON ma.MoDId= mor.MoDId + DECLARE @RdRecord table( + CINVCODE nvarchar(200), + RQTY int, + iqty int, + iQuantity int, + bull int, + cpersonname nvarchar(200), + cInvName nvarchar(200), + cInvStd nvarchar(500) + ) + insert into @RdRecord + select *from ( + select a.*,isnull(f.cMaker,'其他') as cpersonname ,inv.cInvName,inv.cInvStd from ( + select a.InvCode as CINVCODE ,1 as RQTY , iqty,cur.iQuantity, (cur.iQuantity-iqty) as bull From ( + SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) iqty + FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN + mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join + mom_morder mor WITH (NOLOCK) ON ma.MoDId= mor.MoDId - WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0 and - mor.DueDate between @beginDate and @endDate - GROUP BY ma.InvCode - ) a left join - CurrentStock cur WITH (NOLOCK) ON cur.cInvCode = a.InvCode where (cur.iQuantity -iqty) <0 - ) a left join - (select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid) - as c where c.rownumber=1) f on a.CINVCODE=f.cInvCode - left join Inventory inv WITH (NOLOCK) on a.CINVCODE=inv.cInvCode )pumo + WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0 and + mor.DueDate between @beginDate and @endDate + GROUP BY ma.InvCode + ) a left join + CurrentStock cur WITH (NOLOCK) ON cur.cInvCode = a.InvCode where (cur.iQuantity -iqty) <0 + ) a left join + (select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid) + as c where c.rownumber=1) f on a.CINVCODE=f.cInvCode + left join Inventory inv WITH (NOLOCK) on a.CINVCODE=inv.cInvCode )pumo + + update @RdRecord set cpersonname ='其他' where cpersonname not in ( select cPsn_Name from hr_v_HR31_show where cDepCode ='52' and rEmployState ='在职') + + + select *From @RdRecord "; List where = new List(); if (!string.IsNullOrEmpty(info.cpersonname)) { - where.Add(" pumo.cpersonname = @cpersonname"); + where.Add(" cpersonname = @cpersonname"); } if (info.InvCodes != null) { - where.Add(" pumo.cInvCode = @InvCodes"); + where.Add(" cInvCode = @InvCodes"); } var aa = string.Join(" and ", where.ToArray()); diff --git a/NX.ERP.Webapp/src/views/Purchasesum.vue b/NX.ERP.Webapp/src/views/Purchasesum.vue index 0f08241..10ad775 100644 --- a/NX.ERP.Webapp/src/views/Purchasesum.vue +++ b/NX.ERP.Webapp/src/views/Purchasesum.vue @@ -4,13 +4,13 @@
- +
- +
@@ -267,7 +267,7 @@ export default { }, }, { - title: "两个月内计划工单缺品种数", + title: "第一期间内计划工单缺件品种数", align: "center", key: "mommouth02", render: (h, params) => { @@ -295,7 +295,7 @@ export default { }, }, { - title: "四个月内计划工单缺品种数", + title: "第二期间内计划工单缺件品种数", align: "center", key: "mommouth04", render: (h, params) => {