From d1727522c1389144ef6674a374b49468dfea8228 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com>
Date: Sat, 22 May 2021 20:22:13 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E5=8D=95=E8=A1=A8=E4=BF=AE=E8=AE=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Response/Pmc/PmcInventorymomRes.cs | 10 +++
NX.ERP.U8/Pmc/PmcQuery.cs | 81 +++++++++++++++----
NX.ERP.WebAPi/Web.config | 4 +-
NX.ERP.Webapp/src/views/add.vue | 46 ++++++++---
NX.ERP.Webapp/src/views/inventory-mom.vue | 75 +++++++++++------
NX.ERP.Webapp/src/views/inventory-po.vue | 1 +
6 files changed, 165 insertions(+), 52 deletions(-)
diff --git a/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs b/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs
index 31af211..2ebd3c9 100644
--- a/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs
+++ b/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs
@@ -37,6 +37,16 @@ namespace NX.ERP.Model
private double q;
private string st;
+ public double wwc { get; set; }
+ public string StartDate { get; set; }
+ public string DueDate { get; set; }
+ public string jandete { get; set; }
+ public double dtty { get; set; }
+ public double wll { get; set; }
+
+ public double shwl { get; set; }
+ public double sdwl { get; set; }
+
///
///
///
diff --git a/NX.ERP.U8/Pmc/PmcQuery.cs b/NX.ERP.U8/Pmc/PmcQuery.cs
index 76b3b5e..df559ec 100644
--- a/NX.ERP.U8/Pmc/PmcQuery.cs
+++ b/NX.ERP.U8/Pmc/PmcQuery.cs
@@ -128,15 +128,17 @@ namespace NX.ERP.U8.Pmc
string sql = $@"
select *from (
-SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
+SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVERT(varchar(100), mor.DueDate, 23) as DueDate ,DATEDIFF(day,GETDATE(),mor.DueDate) AS jandete , md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty,(md.Qty-md.QualifiedInQty) as wwc, ma.InvCode invcode1,
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
- 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) - ISNULL(MX.MQTY, 0) AS q, motype.description,
+ std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
+ ,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(ds.qty, 0) - ISNULL(prd.Rqty, 0)
+ - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0) AS q, motype.description,
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status
FROM mom_order m WITH (NOLOCK) INNER JOIN
- mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
+ mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
+ mom_morder mor WITH (NOLOCK) ON md.MoDId = mor.MoDId INNER JOIN
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
left JOIN
mom_motype motype WITH (NOLOCK) ON motype.MoTypeId = md.MoTypeId
@@ -155,6 +157,29 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
WHERE md.Status <> 4
GROUP BY ma.InvCode) mdsss ON ma.InvCode = mdsss.InvCode LEFT JOIN
+ (SELECT ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) sdwl
+ 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 = 2
+ GROUP BY ma.InvCode) sdwl ON ma.InvCode = sdwl.InvCode LEFT JOIN
+
+ (SELECT ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) shwl
+ 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 = 3
+ GROUP BY ma.InvCode) shwl ON ma.InvCode = shwl.InvCode LEFT JOIN
+
+
+ (SELECT mom.MoCode, ma.invcode,SUM(isnull(ma.qty, 0)) dtty
+ 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
+ GROUP BY ma.InvCode,mom.MoCode ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode LEFT JOIN
+
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
@@ -216,18 +241,20 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
sql = $@"
select *from (
-SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
+SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,CONVERT(varchar(100), mor.DueDate, 23) as DueDate ,DATEDIFF(day,GETDATE(),mor.DueDate) AS jandete , md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty,(md.Qty-md.QualifiedInQty) as wwc, ma.InvCode invcode1,
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
- 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) - ISNULL(MX.MQTY, 0) AS q, motype.description,
+ std,dtyl.dtty, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll,mdsss.mdqty,shwl.shwl,sdwl.sdwl
+ ,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(ds.qty, 0) - ISNULL(prd.Rqty, 0)
+ - ISNULL(omm.RQTY1, 0) - ISNULL(MX.MQTY, 0)- ISNULL(pu_App.RQTY3, 0) AS q, motype.description,
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status
FROM mom_order m WITH (NOLOCK) INNER JOIN
- mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
+ mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
+ mom_morder mor WITH (NOLOCK) ON md.MoDId = mor.MoDId INNER JOIN
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
left JOIN
- mom_motype motype WITH (NOLOCK) ON motype.MoTypeId = md.MoTypeId
+ mom_motype motype WITH (NOLOCK) ON motype.MoTypeId = md.MoTypeId
INNER JOIN
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
@@ -243,6 +270,30 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
WHERE md.Status <> 4 and mom.mocode in @moCodes
GROUP BY ma.InvCode) mdsss ON ma.InvCode = mdsss.InvCode LEFT JOIN
+
+ (SELECT ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) sdwl
+ 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 = 2
+ GROUP BY ma.InvCode) sdwl ON ma.InvCode = sdwl.InvCode LEFT JOIN
+
+ (SELECT ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) shwl
+ 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 = 3
+ GROUP BY ma.InvCode) shwl ON ma.InvCode = shwl.InvCode LEFT JOIN
+
+
+ (SELECT mom.MoCode, ma.invcode,SUM(isnull(ma.qty, 0)) dtty
+ 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
+ GROUP BY ma.InvCode,mom.MoCode ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode LEFT JOIN
+
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
@@ -335,7 +386,7 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
- using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
+ using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection )
{
return conn.Query(sql, new { moCodes = info.moCodes, invcode = info.InvCodes, invcode1=info.InvCodes1, info.byFinish });
}
@@ -550,8 +601,8 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
public IEnumerable
+
+
+
+
+
+
+
-
-
-
\ No newline at end of file
+ export default {
+ name: 'add',
+ data() {
+ return {
+ value1:'',
+ value2:''
+ }
+ },
+ methods:{
+ value1Change:function() {
+ var obj = this
+ this.$emit('value1', obj.value1)
+ },
+ value2Change:function() {
+ var obj = this
+ this.$emit('value2', obj.value2)
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/NX.ERP.Webapp/src/views/inventory-mom.vue b/NX.ERP.Webapp/src/views/inventory-mom.vue
index 42cf74f..8d73ebb 100644
--- a/NX.ERP.Webapp/src/views/inventory-mom.vue
+++ b/NX.ERP.Webapp/src/views/inventory-mom.vue
@@ -192,16 +192,10 @@ export default {
{
title: "未完成量",
align: "center",
-
+ key: "wwc",
fixed: "left",
width: 95,
- render: (h, params) => {
- return (
-
- {numberFormat(params.row.qty - params.row.qualified_in_qty)}
-
- );
- },
+
},
{
title: "状态",
@@ -245,27 +239,29 @@ export default {
width: 100,
},
{
- title: "单行需求",
+ title: "单台用量",
+ align: "center",
+ key: "dtty",
+ width: 110,
+ },
+ {
+ title: "应领量",
align: "center",
key: "qty1",
width: 110,
},
{
- title: "单行已领",
+ title: "已领",
align: "center",
key: "issqty",
width: 110,
},
{
- title: "单行未领",
+ title: "未领",
align: "center",
-
+ key: "wll",
width: 110,
- render: (h, params) => {
- return (
- {numberFormat(params.row.qty1 - params.row.issqty)}
- );
- },
+
},
{
title: "条件内未领",
@@ -274,6 +270,20 @@ export default {
width: 110,
key: "mdqty",
},
+ {
+ title: "锁定",
+ align: "center",
+
+ width: 110,
+ key: "sdwl",
+ },
+ {
+ title: "审核",
+ align: "center",
+
+ width: 110,
+ key: "shwl",
+ },
{
title: "总未领量",
align: "center",
@@ -293,12 +303,7 @@ export default {
width: 100,
},
- {
- title: "现存无废品",
- align: "center",
- key: "dqty",
- width: 110,
- },
+
{
title: "采购在途",
align: "center",
@@ -323,6 +328,30 @@ export default {
key: "momqty",
width: 90,
},
+ {
+ title: "净存",
+ align: "center",
+ key: "q",
+ width: 90,
+ },
+ {
+ title: "计划开工",
+ align: "center",
+ key: "start_date",
+ width: 100,
+ },
+ {
+ title: "计划开工",
+ align: "center",
+ key: "due_date",
+ width: 100,
+ },
+ {
+ title: "结案天数",
+ align: "center",
+ key: "jandete",
+ width: 90,
+ },
],
};
},
diff --git a/NX.ERP.Webapp/src/views/inventory-po.vue b/NX.ERP.Webapp/src/views/inventory-po.vue
index ab7dbfc..6fd8e88 100644
--- a/NX.ERP.Webapp/src/views/inventory-po.vue
+++ b/NX.ERP.Webapp/src/views/inventory-po.vue
@@ -167,6 +167,7 @@ export default {
key: "rqty",
width: 100,
},
+
{
title: "预计到货日期",
align: "center",