From 4e9d70775d5f5758963c791c4e4180a7532c5636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Wed, 1 Sep 2021 15:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=AD=90=E4=BB=B6?= =?UTF-8?q?=E9=A2=86=E6=96=99=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Response/Pmc/PmcInventorymomRes.cs | 4 +- NX.ERP.U8/Mom/MomOrderDAL.cs | 112 ++++ .../Controllers/MOM/MomOrderController.cs | 7 + NX.ERP.Webapp/src/App.vue | 1 + NX.ERP.Webapp/src/api/pmc.js | 3 + NX.ERP.Webapp/src/route/index.js | 2 + NX.ERP.Webapp/src/views/inventory-pick.vue | 542 ++++++++++++++++++ NX.ERP.Webapp/vue.config.js | 3 +- 8 files changed, 672 insertions(+), 2 deletions(-) create mode 100644 NX.ERP.Webapp/src/views/inventory-pick.vue diff --git a/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs b/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs index 01539d6..4700405 100644 --- a/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs +++ b/NX.ERP.Model/Response/Pmc/PmcInventorymomRes.cs @@ -48,7 +48,9 @@ namespace NX.ERP.Model public double wll { get; set; } public double shwl { get; set; } - public double sdwl { get; set; } + public string cPosName { get; set; } + + /// /// diff --git a/NX.ERP.U8/Mom/MomOrderDAL.cs b/NX.ERP.U8/Mom/MomOrderDAL.cs index 6e65d28..3c583ef 100644 --- a/NX.ERP.U8/Mom/MomOrderDAL.cs +++ b/NX.ERP.U8/Mom/MomOrderDAL.cs @@ -312,5 +312,117 @@ namespace NX.ERP.U8.Mom return this.GetList("b.moid >= @id", new { Id }); } + public IEnumerable Pick(NX.ERP.Model.Request.MomOrderRequest info) + { + string sql = $@" +select *from ( + +SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Remark,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 and c.bself = 1 THEN '外购,委外,自制' + WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 and c.bself <>1 THEN '外购,委外' + WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself <> 1 THEN '外购' + WHEN c.bPurchase = 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '外购,自制' + WHEN c.bPurchase <> 1 AND c.bProxyForeign <> 1 and c.bself = 1 THEN '自制' + WHEN c.bPurchase <> 1 AND c.bProxyForeign = 1 and c.bself = 1 THEN '委外,自制' + WHEN c.bPurchase <> 1 AND c.bProxyForeign = 1 and c.bself <> 1 THEN '委外' + ELSE '其它' + END AS std, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll, motype.description, + CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status,ISNULL(ds.qty, 0) dqty,post.cPosName + FROM mom_order m WITH (NOLOCK) 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 + + LEFT JOIN + (SELECT cinvcode, SUM(iquantity) qty + FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') and cWhCode not in (4,5) + GROUP BY cInvCode) ds ON ma.InvCode = ds.cInvCode + LEFT JOIN ( + SELECT + cinvcode, + STUFF( + ( + SELECT + ',' + cPosName + FROM + ( + SELECT + b.cPosName, + a.cInvCode, + a.iQuantity + FROM + InvPositionSum a WITH ( NOLOCK ), + POSITION b WITH ( NOLOCK ) + WHERE + a.iQuantity <> 0 + AND a.cPosCode= b.cPosCode + ) a + WHERE + b.cinvcode = a.cinvcode + ORDER BY + a.iQuantity DESC FOR XML PATH ( '' ) + ), + 1, + 1, + '' + ) cPosName + FROM + InvPositionSum b WITH (NOLOCK) where b.cPosCode not in ('00701','00801','09001') and b.cWhCode not in (4,5) + GROUP BY + cinvcode + ) AS post ON ma.InvCode = post.cinvcode + INNER JOIN + Inventory p WITH (NOLOCK) ON md.InvCode = p.cInvCode INNER JOIN + Inventory c WITH (NOLOCK) ON ma.InvCode = c.cInvCode LEFT JOIN + + ComputationUnit kk WITH (nolock) on p.cComUnitCode=kk.cComunitCode + left join ComputationUnit LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode + ) mmm + "; + + + List where = new List(); + + ///处理- + if (info.moCodes != null && info.moCodes.Count > 0) + { + where.Add(" mmm.mocode in @moCodes"); + } + if (info.InvCodes != null) + { + where.Add(" mmm.InvCode in @invcode"); + } + if (info.InvCodes1 != null) + { + where.Add(" mmm.invcode1 in @invcode1"); + } + if (info.byFinish != null) + { + where.Add(" mmm.Status in @byFinish"); + } + if (!info.byiss) + { + where.Add(" isnull(mmm.qty1,0)- isnull(mmm.issqty,0)> 0"); + } + else { where.Add(" mmm.issqty > 0"); } + + + var aa = string.Join(" and ", where.ToArray()); + + if (!string.IsNullOrEmpty(aa)) + { + sql += "where " + aa; + } + + + + 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 }); + } + } } } diff --git a/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs b/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs index 19db3ae..fff79b4 100644 --- a/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs +++ b/NX.ERP.WebAPi/Controllers/MOM/MomOrderController.cs @@ -62,5 +62,12 @@ namespace NX.ERP.WebAPi.Controllers.MOM var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL(); return customerDAL.QueryDetails(momOrder); } + [Route("api/ProductOrder/Pick")] + [HttpPost] + public IEnumerable Pick(Model.Request.MomOrderRequest momOrder) + { + var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL(); + return customerDAL.Pick(momOrder); + } } } \ No newline at end of file diff --git a/NX.ERP.Webapp/src/App.vue b/NX.ERP.Webapp/src/App.vue index 1f991a6..75fe5ef 100644 --- a/NX.ERP.Webapp/src/App.vue +++ b/NX.ERP.Webapp/src/App.vue @@ -27,6 +27,7 @@ 到货单 异常单据查询 领料单查询 + 生产领料需求查询 diff --git a/NX.ERP.Webapp/src/api/pmc.js b/NX.ERP.Webapp/src/api/pmc.js index 39da1da..826121c 100644 --- a/NX.ERP.Webapp/src/api/pmc.js +++ b/NX.ERP.Webapp/src/api/pmc.js @@ -17,4 +17,7 @@ export const getInventorybu=(info)=>{ export const getInventorypo=(info)=>{ return axios.post('/api/Pmc/InventoryPocode',info) } +export const getPick=(info)=>{ + return axios.post('/api/ProductOrder/Pick',info) +} diff --git a/NX.ERP.Webapp/src/route/index.js b/NX.ERP.Webapp/src/route/index.js index 4971ddf..f9e616d 100644 --- a/NX.ERP.Webapp/src/route/index.js +++ b/NX.ERP.Webapp/src/route/index.js @@ -11,6 +11,7 @@ import Purchasesum from '@/views/Purchasesum.vue' import inventoryrrival from '@/bill/inventory-arrival.vue' import inventoryerror from '@/bill/inventory-error.vue' import inventoryMaterialAppVouch from '@/views/inventory-materialAppVouch.vue' +import inventorypick from '@/views/inventory-pick.vue' export default [ { @@ -31,4 +32,5 @@ export default [ { path: '/inventoryrrival', component: inventoryrrival }, { path: '/inventoryerror', component: inventoryerror }, { path: '/inventoryMaterialAppVouch', component: inventoryMaterialAppVouch }, + { path: '/inventorypick', component: inventorypick }, ] diff --git a/NX.ERP.Webapp/src/views/inventory-pick.vue b/NX.ERP.Webapp/src/views/inventory-pick.vue new file mode 100644 index 0000000..404275c --- /dev/null +++ b/NX.ERP.Webapp/src/views/inventory-pick.vue @@ -0,0 +1,542 @@ + + + + + + + \ No newline at end of file diff --git a/NX.ERP.Webapp/vue.config.js b/NX.ERP.Webapp/vue.config.js index a3cd3a4..ec9247c 100644 --- a/NX.ERP.Webapp/vue.config.js +++ b/NX.ERP.Webapp/vue.config.js @@ -58,7 +58,8 @@ module.exports = { disableHostCheck: true, proxy: { '/api': { - target: 'http://10.0.0.250:8081', // 接口域名 + // target: 'http://10.0.0.250:8081', // 接口域名 + target: 'http://localhost:61448', // 接口域名 changeOrigin: true, // 是否跨域 pathRewrite: {} },