mom 修改
This commit is contained in:
@@ -20,37 +20,37 @@ namespace NX.ERP.U8.Pmc
|
|||||||
public IEnumerable<NX.ERP.Model.PmcInventoryallRes> GetPmcInventoryallRes(NX.ERP.Model.Request.Inventoryall info)
|
public IEnumerable<NX.ERP.Model.PmcInventoryallRes> GetPmcInventoryallRes(NX.ERP.Model.Request.Inventoryall info)
|
||||||
{
|
{
|
||||||
string sql = $@"
|
string sql = $@"
|
||||||
SELECT c.cInvCode invcode1,
|
SELECT c.cInvCode invcode1,
|
||||||
c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName, CASE WHEN c.bPurchase = 1 AND
|
c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName, CASE WHEN c.bPurchase = 1 AND
|
||||||
c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
|
c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
|
||||||
std, isnull(mas.wqty,0) wqty, ISNULL(cs.qty, 0) cqty,ISNULL(misss.issqty, 0) issqty , ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
|
std, isnull(mas.wqty,0) wqty, ISNULL(cs.qty, 0) cqty,ISNULL(misss.issqty, 0) issqty , ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
|
||||||
ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, isnull(mas.wqty,0) - isnull(cs.qty, 0) - ISNULL(prd.Rqty, 0)
|
ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, isnull(mas.wqty,0) - isnull(cs.qty, 0) - ISNULL(prd.Rqty, 0)
|
||||||
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q
|
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q
|
||||||
|
|
||||||
FROM Inventory c LEFT JOIN
|
FROM Inventory c WITH (NOLOCK) LEFT JOIN
|
||||||
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
||||||
GROUP BY ma.InvCode) mas ON c.cInvCode = mas.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) mas ON c.cInvCode = mas.InvCode LEFT JOIN
|
||||||
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4
|
WHERE md.Status <> 4
|
||||||
GROUP BY ma.InvCode) misss ON c.cInvCode = misss.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) misss ON c.cInvCode = misss.InvCode LEFT JOIN
|
||||||
|
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM currentstock
|
FROM currentstock WITH (NOLOCK)
|
||||||
GROUP BY cInvCode) cs ON c.cInvCode = cs.cInvCode
|
GROUP BY cInvCode) cs ON c.cInvCode = cs.cInvCode
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM InvPositionSum where cPosCode not in ('00701','00801','09001')
|
FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001')
|
||||||
GROUP BY cInvCode) ds ON c.cInvCode = ds.cInvCode
|
GROUP BY cInvCode) ds ON c.cInvCode = ds.cInvCode
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
|
|
||||||
|
|
||||||
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
||||||
FROM mom_orderdetail MD
|
FROM mom_orderdetail MD WITH (NOLOCK)
|
||||||
GROUP BY MD.INVCODE) MX ON c.cInvCode = MX.InvCode LEFT JOIN
|
GROUP BY MD.INVCODE) MX ON c.cInvCode = MX.InvCode LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(rqty) AS rqty
|
(SELECT cinvcode, SUM(rqty) AS rqty
|
||||||
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
||||||
@@ -84,7 +84,7 @@ namespace NX.ERP.U8.Pmc
|
|||||||
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
||||||
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
||||||
GROUP BY cInvCode) pu_App ON c.cInvCode = pu_App.CINVCODE LEFT JOIN
|
GROUP BY cInvCode) pu_App ON c.cInvCode = pu_App.CINVCODE LEFT JOIN
|
||||||
(select InvCode,sum(qty) as momqty from mom_orderdetail where Status=3 group by InvCode) momq on c.cInvCode = momq.InvCode
|
(select InvCode,sum(qty) as momqty from mom_orderdetail WITH (nolock) where Status=3 group by InvCode) momq on c.cInvCode = momq.InvCode
|
||||||
|
|
||||||
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
||||||
";
|
";
|
||||||
@@ -126,39 +126,48 @@ namespace NX.ERP.U8.Pmc
|
|||||||
public IEnumerable<object> Inventorymom(List<string> moCodes)
|
public IEnumerable<object> Inventorymom(List<string> moCodes)
|
||||||
{
|
{
|
||||||
string sql = $@"
|
string sql = $@"
|
||||||
SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
|
SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
|
||||||
c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1, CASE WHEN c.bPurchase = 1 AND
|
c.cInvName cinvname1, c.cInvStd cinvstd1,LL.cComUnitName as cComUnitName1, CASE WHEN c.bPurchase = 1 AND
|
||||||
c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
|
c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS
|
||||||
std, ma.Qty qty1, ma.IssQty issqty, mas.wqty wqty, ISNULL(cs.qty, 0) cqty, ISNULL(misss.issqty, 0) issqtyxc,ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
|
std, ma.Qty qty1, ma.IssQty issqty,mdsss.mdqty, mas.wqty wqty, ISNULL(cs.qty, 0) cqty, ISNULL(misss.issqty, 0) issqtyxc,ISNULL(ds.qty, 0) dqty,isnull(prd.Rqty, 0) rqty,
|
||||||
ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, mas.wqty - isnull(cs.qty, 0) - ISNULL(prd.Rqty, 0)
|
ISNULL(OMM.RQTY1, 0) AS rqty1, ISNULL(pu_App.RQTY3, 0) AS rqty3,ISNULL(momq.momqty, 0) AS momqty, ISNULL(MX.MQTY, 0) MQTY, mas.wqty - isnull(cs.qty, 0) - ISNULL(prd.Rqty, 0)
|
||||||
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q,
|
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q,
|
||||||
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st
|
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st
|
||||||
FROM mom_order m INNER JOIN
|
FROM mom_order m WITH (NOLOCK) INNER JOIN
|
||||||
mom_orderdetail md ON m.MoId = md.MoId INNER JOIN
|
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
|
||||||
mom_moallocate ma ON md.MoDId = ma.MoDId
|
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
||||||
GROUP BY ma.InvCode) mas ON ma.InvCode = mas.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) mas ON ma.InvCode = mas.InvCode LEFT JOIN
|
||||||
|
|
||||||
|
(SELECT ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) mdqty
|
||||||
|
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||||
|
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join
|
||||||
|
mom_order mom WITH (NOLOCK) on md.MoId=mom.MoId
|
||||||
|
|
||||||
|
WHERE md.Status <> 4 and MoCode in @moCodes
|
||||||
|
GROUP BY ma.InvCode) mdsss ON ma.InvCode = mdsss.InvCode LEFT JOIN
|
||||||
|
|
||||||
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4
|
WHERE md.Status <> 4
|
||||||
GROUP BY ma.InvCode) misss ON ma.InvCode = misss.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) misss ON ma.InvCode = misss.InvCode LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM currentstock
|
FROM currentstock WITH (NOLOCK)
|
||||||
GROUP BY cInvCode) cs ON ma.InvCode = cs.cInvCode
|
GROUP BY cInvCode) cs ON ma.InvCode = cs.cInvCode
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM InvPositionSum where cPosCode not in ('00701','00801','09001')
|
FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001')
|
||||||
GROUP BY cInvCode) ds ON ma.InvCode = ds.cInvCode
|
GROUP BY cInvCode) ds ON ma.InvCode = ds.cInvCode
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
Inventory p ON md.InvCode = p.cInvCode INNER JOIN
|
Inventory p WITH (NOLOCK) ON md.InvCode = p.cInvCode INNER JOIN
|
||||||
Inventory c ON ma.InvCode = c.cInvCode LEFT JOIN
|
Inventory c WITH (NOLOCK) ON ma.InvCode = c.cInvCode LEFT JOIN
|
||||||
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
||||||
FROM mom_orderdetail MD
|
FROM mom_orderdetail MD WITH (NOLOCK)
|
||||||
GROUP BY MD.INVCODE) MX ON MA.InvCode = MX.InvCode LEFT JOIN
|
GROUP BY MD.INVCODE) MX ON MA.InvCode = MX.InvCode LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(rqty) AS rqty
|
(SELECT cinvcode, SUM(rqty) AS rqty
|
||||||
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
||||||
@@ -192,12 +201,12 @@ namespace NX.ERP.U8.Pmc
|
|||||||
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
||||||
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
||||||
GROUP BY cInvCode) pu_App ON MA.INVCODE = pu_App.CINVCODE LEFT JOIN
|
GROUP BY cInvCode) pu_App ON MA.INVCODE = pu_App.CINVCODE LEFT JOIN
|
||||||
(select InvCode,sum(qty) as momqty from mom_orderdetail where Status=3 group by InvCode) momq on MA.INVCODE = momq.InvCode
|
(select InvCode,sum(qty) as momqty from mom_orderdetail WITH (NOLOCK) where Status=3 group by InvCode) momq on MA.INVCODE = momq.InvCode
|
||||||
left join ComputationUnit kk WITH (nolock) on p.cComUnitCode=kk.cComunitCode
|
left join ComputationUnit kk WITH (nolock) on p.cComUnitCode=kk.cComunitCode
|
||||||
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
||||||
WHERE md.Status <> 4 AND ma.Qty - IsNull(ma.IssQty, 0) > 0
|
WHERE md.Status <> 4 AND ma.Qty - IsNull(ma.IssQty, 0) > 0
|
||||||
and m..mocode in @moCodes
|
and m.mocode in @moCodes
|
||||||
order by m.mocode
|
order by m.mocode,md.SortSeq, ma.InvCode
|
||||||
";
|
";
|
||||||
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
|
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
|
||||||
{
|
{
|
||||||
@@ -215,70 +224,70 @@ namespace NX.ERP.U8.Pmc
|
|||||||
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q,isnull(a0.iQuantity,0) as iQuantity00 ,isnull(a1.iQuantity,0) as iQuantity01,
|
- ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0) AS q,isnull(a0.iQuantity,0) as iQuantity00 ,isnull(a1.iQuantity,0) as iQuantity01,
|
||||||
isnull(a2.iQuantity,0) as iQuantity02,isnull(a3.iQuantity,0) as iQuantity03,isnull(a4.iQuantity,0) as iQuantity04,isnull(a5.iQuantity,0) as iQuantity05
|
isnull(a2.iQuantity,0) as iQuantity02,isnull(a3.iQuantity,0) as iQuantity03,isnull(a4.iQuantity,0) as iQuantity04,isnull(a5.iQuantity,0) as iQuantity05
|
||||||
from
|
from
|
||||||
(select a.cinvcode from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select a.cinvcode from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate()))+1,dateadd(month,-5,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate()))+1,dateadd(month,-5,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(getdate()),dateadd(month,1,getdate())),112)
|
and convert(varchar,dateadd(day,-day(getdate()),dateadd(month,1,getdate())),112)
|
||||||
group by a.cinvcode) a full join
|
group by a.cinvcode) a full join
|
||||||
|
|
||||||
(select left(convert(varchar,getdate(),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,getdate(),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(getdate())+1,getdate()),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(getdate())+1,getdate()),112)
|
||||||
and convert(varchar,dateadd(day,-day(getdate()),dateadd(month,1,getdate())),112)
|
and convert(varchar,dateadd(day,-day(getdate()),dateadd(month,1,getdate())),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a0 on a.cInvCode=a0.cInvCode
|
) a0 on a.cInvCode=a0.cInvCode
|
||||||
full join
|
full join
|
||||||
(select left(convert(varchar,dateadd(month,-1,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,dateadd(month,-1,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-1,getdate()))+1,dateadd(month,-1,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-1,getdate()))+1,dateadd(month,-1,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(dateadd(month,-1,getdate())),dateadd(month,1,dateadd(month,-1,getdate()))),112)
|
and convert(varchar,dateadd(day,-day(dateadd(month,-1,getdate())),dateadd(month,1,dateadd(month,-1,getdate()))),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a1 on a.cInvCode =a1.cInvCode
|
) a1 on a.cInvCode =a1.cInvCode
|
||||||
full join
|
full join
|
||||||
(select left(convert(varchar,dateadd(month,-3,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,dateadd(month,-3,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-3,getdate()))+1,dateadd(month,-3,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-3,getdate()))+1,dateadd(month,-3,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(dateadd(month,-3,getdate())),dateadd(month,1,dateadd(month,-3,getdate()))),112)
|
and convert(varchar,dateadd(day,-day(dateadd(month,-3,getdate())),dateadd(month,1,dateadd(month,-3,getdate()))),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a2 on a.cInvCode =a2.cInvCode
|
) a2 on a.cInvCode =a2.cInvCode
|
||||||
full join
|
full join
|
||||||
(select left(convert(varchar,dateadd(month,-2,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,dateadd(month,-2,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-2,getdate()))+1,dateadd(month,-2,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-2,getdate()))+1,dateadd(month,-2,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(dateadd(month,-2,getdate())),dateadd(month,1,dateadd(month,-2,getdate()))),112)
|
and convert(varchar,dateadd(day,-day(dateadd(month,-2,getdate())),dateadd(month,1,dateadd(month,-2,getdate()))),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a3 on a.cInvCode =a3.cInvCode
|
) a3 on a.cInvCode =a3.cInvCode
|
||||||
full join
|
full join
|
||||||
(select left(convert(varchar,dateadd(month,-4,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,dateadd(month,-4,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-4,getdate()))+1,dateadd(month,-4,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-4,getdate()))+1,dateadd(month,-4,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(dateadd(month,-4,getdate())),dateadd(month,1,dateadd(month,-4,getdate()))),112)
|
and convert(varchar,dateadd(day,-day(dateadd(month,-4,getdate())),dateadd(month,1,dateadd(month,-4,getdate()))),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a4 on a.cInvCode =a4.cInvCode
|
) a4 on a.cInvCode =a4.cInvCode
|
||||||
full join
|
full join
|
||||||
(select left(convert(varchar,dateadd(month,-5,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a left join rdrecord11 b on a.id=b.id
|
(select left(convert(varchar,dateadd(month,-5,getdate()),112),6) as month1 , a.cinvcode, sum(a.iQuantity) as iQuantity from rdrecords11 a WITH (nolock) left join rdrecord11 b WITH (nolock) on a.id=b.id
|
||||||
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate()))+1,dateadd(month,-5,getdate())),112)
|
where convert(varchar,b.dDate,112) between convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate()))+1,dateadd(month,-5,getdate())),112)
|
||||||
and convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate())),dateadd(month,1,dateadd(month,-5,getdate()))),112)
|
and convert(varchar,dateadd(day,-day(dateadd(month,-5,getdate())),dateadd(month,1,dateadd(month,-5,getdate()))),112)
|
||||||
group by a.cinvcode
|
group by a.cinvcode
|
||||||
) a5 on a.cInvCode =a5.cInvCode
|
) a5 on a.cInvCode =a5.cInvCode
|
||||||
left join Inventory c WITH (nolock) on a.cInvCode=c.cInvCode left join
|
left join Inventory c WITH (nolock) on a.cInvCode=c.cInvCode left join
|
||||||
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (nolock) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (nolock) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
|
||||||
GROUP BY ma.InvCode) mas ON c.cInvCode = mas.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) mas ON c.cInvCode = mas.InvCode LEFT JOIN
|
||||||
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
|
||||||
FROM mom_moallocate ma INNER JOIN
|
FROM mom_moallocate ma WITH (nolock) INNER JOIN
|
||||||
mom_orderdetail md ON ma.MoDId = md.MoDId
|
mom_orderdetail md WITH (nolock) ON ma.MoDId = md.MoDId
|
||||||
WHERE md.Status <> 4
|
WHERE md.Status <> 4
|
||||||
GROUP BY ma.InvCode) misss ON c.cInvCode = misss.InvCode LEFT JOIN
|
GROUP BY ma.InvCode) misss ON c.cInvCode = misss.InvCode LEFT JOIN
|
||||||
|
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM currentstock
|
FROM currentstock WITH (nolock)
|
||||||
GROUP BY cInvCode) cs ON c.cInvCode = cs.cInvCode
|
GROUP BY cInvCode) cs ON c.cInvCode = cs.cInvCode
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(iquantity) qty
|
(SELECT cinvcode, SUM(iquantity) qty
|
||||||
FROM InvPositionSum where cPosCode not in ('00701','00801','09001')
|
FROM InvPositionSum WITH (nolock) where cPosCode not in ('00701','00801','09001')
|
||||||
GROUP BY cInvCode) ds ON c.cInvCode = ds.cInvCode
|
GROUP BY cInvCode) ds ON c.cInvCode = ds.cInvCode
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
|
|
||||||
|
|
||||||
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
|
||||||
FROM mom_orderdetail MD
|
FROM mom_orderdetail MD WITH (nolock)
|
||||||
GROUP BY MD.INVCODE) MX ON c.cInvCode = MX.InvCode LEFT JOIN
|
GROUP BY MD.INVCODE) MX ON c.cInvCode = MX.InvCode LEFT JOIN
|
||||||
(SELECT cinvcode, SUM(rqty) AS rqty
|
(SELECT cinvcode, SUM(rqty) AS rqty
|
||||||
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
|
||||||
@@ -312,7 +321,7 @@ namespace NX.ERP.U8.Pmc
|
|||||||
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
|
||||||
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
|
||||||
GROUP BY cInvCode) pu_App ON c.cInvCode = pu_App.CINVCODE LEFT JOIN
|
GROUP BY cInvCode) pu_App ON c.cInvCode = pu_App.CINVCODE LEFT JOIN
|
||||||
(select InvCode,sum(qty) as momqty from mom_orderdetail where Status=3 group by InvCode) momq on c.cInvCode = momq.InvCode
|
(select InvCode,sum(qty) as momqty from mom_orderdetail WITH (nolock) where Status=3 group by InvCode) momq on c.cInvCode = momq.InvCode
|
||||||
|
|
||||||
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
|
||||||
|
|
||||||
|
|||||||
1
NX.ERP.Webapp/bulid.bat
Normal file
1
NX.ERP.Webapp/bulid.bat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
npm run build
|
||||||
@@ -1,16 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h4>物料在途在制查询表</h4>
|
<h4>跟单记录表</h4>
|
||||||
<div>
|
<div>
|
||||||
<Row :gutter="16">
|
<Row :gutter="16">
|
||||||
<Col span="8">
|
<Col span="8">
|
||||||
<label>订单编号</label>
|
<label>订单编号</label>
|
||||||
<Input autosize type="textarea" v-model="filter.inv_codes" />
|
<Input autosize type="textarea" v-model="filter.inv_codes" />
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span="8">
|
||||||
<Col span="4">
|
<Button
|
||||||
<Button @click="handleClick">查询</Button>
|
size="large"
|
||||||
<Button @click="handelExport">导出</Button>
|
type="primary"
|
||||||
|
icon="ios-search"
|
||||||
|
@click="handleClick"
|
||||||
|
>查询</Button
|
||||||
|
>
|
||||||
|
<Button size="large" type="success" @click="handelExport"
|
||||||
|
>导出</Button
|
||||||
|
>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,7 +49,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getInventorymom } from "@/api/pmc";
|
import { getInventorymom } from "@/api/pmc";
|
||||||
import { pageingData, export_col_to_excel,sortByKey } from "@/libs/tools";
|
import { pageingData, export_col_to_excel,sortByKey,numberFormat } from "@/libs/tools";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -159,23 +166,58 @@ export default {
|
|||||||
className: "demo-table-info-old",
|
className: "demo-table-info-old",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "总需求(未领量)",
|
title: "单行需求",
|
||||||
|
align: "center",
|
||||||
|
key: "qty1",
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "单行已领",
|
||||||
|
align: "center",
|
||||||
|
key: "issqty",
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "单行未领",
|
||||||
|
align: "center",
|
||||||
|
|
||||||
|
width: 110,
|
||||||
|
render: (h, params) => {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{numberFormat(
|
||||||
|
params.row.qty1 - params.row.issqty
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "条件内未领",
|
||||||
|
align: "center",
|
||||||
|
|
||||||
|
width: 110,
|
||||||
|
key: "mdqty",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "总未领量",
|
||||||
align: "center",
|
align: "center",
|
||||||
key: "wqty",
|
key: "wqty",
|
||||||
width: 120,
|
width: 120,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "总已领(现场)",
|
||||||
|
align: "center",
|
||||||
|
key: "issqtyxc",
|
||||||
|
width: 120,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "现存量",
|
title: "现存量",
|
||||||
align: "center",
|
align: "center",
|
||||||
key: "cqty",
|
key: "cqty",
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "已领(现场)",
|
|
||||||
align: "center",
|
|
||||||
key: "issqty",
|
|
||||||
width: 110,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "现存无废品",
|
title: "现存无废品",
|
||||||
align: "center",
|
align: "center",
|
||||||
@@ -237,6 +279,8 @@ export default {
|
|||||||
let resp = await getInventorymom(_filetr);
|
let resp = await getInventorymom(_filetr);
|
||||||
this.pageNo = 1;
|
this.pageNo = 1;
|
||||||
this.datas = resp.data.data;
|
this.datas = resp.data.data;
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
},
|
},
|
||||||
handlePagechange(page) {
|
handlePagechange(page) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<Table
|
<Table
|
||||||
style="margin-top: 20px"
|
style="margin-top: 20px"
|
||||||
width="20000"
|
|
||||||
size="small"
|
size="small"
|
||||||
border
|
border
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
@@ -75,7 +75,7 @@ export default {
|
|||||||
title: "存货编号",
|
title: "存货编号",
|
||||||
align: "center",
|
align: "center",
|
||||||
key: "cInvCode",
|
key: "cInvCode",
|
||||||
width: "90",
|
width: "110",
|
||||||
className: "demo-table-info-new",
|
className: "demo-table-info-new",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -106,6 +106,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: "总需求(未领量)",
|
title: "总需求(未领量)",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
width: "110",
|
||||||
key: "wqty",
|
key: "wqty",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user