From 58f5877073384044fa2f48ea273481aa398a6eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Thu, 10 Jun 2021 14:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E6=8D=AE=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Model/NX.ERP.Model.csproj | 1 + NX.ERP.Model/Request/VouchererrorRequest.cs | 17 ++ NX.ERP.U8/Pmc/FinanceQuery.cs | 48 +++ NX.ERP.U8/Pmc/WarehouseQuery.cs | 17 +- .../Controllers/Pmc/FinanceController.cs | 8 + NX.ERP.WebAPi/Web.config | 4 +- NX.ERP.Webapp/src/App.vue | 1 + NX.ERP.Webapp/src/api/Finance.js | 5 + NX.ERP.Webapp/src/bill/inventory-error.vue | 283 ++++++++++++++++++ NX.ERP.Webapp/src/route/index.js | 2 + 10 files changed, 375 insertions(+), 11 deletions(-) create mode 100644 NX.ERP.Model/Request/VouchererrorRequest.cs create mode 100644 NX.ERP.Webapp/src/bill/inventory-error.vue diff --git a/NX.ERP.Model/NX.ERP.Model.csproj b/NX.ERP.Model/NX.ERP.Model.csproj index c3c4118..ef9738e 100644 --- a/NX.ERP.Model/NX.ERP.Model.csproj +++ b/NX.ERP.Model/NX.ERP.Model.csproj @@ -78,6 +78,7 @@ + diff --git a/NX.ERP.Model/Request/VouchererrorRequest.cs b/NX.ERP.Model/Request/VouchererrorRequest.cs new file mode 100644 index 0000000..b738177 --- /dev/null +++ b/NX.ERP.Model/Request/VouchererrorRequest.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Request +{ + public class VouchererrorRequest + { + public IEnumerable Ccode { get; set; } + + + public IEnumerable error { get; set; } + + + } +} diff --git a/NX.ERP.U8/Pmc/FinanceQuery.cs b/NX.ERP.U8/Pmc/FinanceQuery.cs index 2f9a36a..f099f5a 100644 --- a/NX.ERP.U8/Pmc/FinanceQuery.cs +++ b/NX.ERP.U8/Pmc/FinanceQuery.cs @@ -83,6 +83,54 @@ namespace NX.ERP.U8.Finance } } + public IEnumerable Voucherror(NX.ERP.Model.Request.VouchererrorRequest info) + { + string sql = $@" + select *from ( + select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'超领' as error from mom_moallocate a WITH (NOLOCK) + left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId + left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId + left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode + left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode + where a.Qty < a.IssQty + + union all + select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'缺领' as error from mom_moallocate a WITH (NOLOCK) + left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId + left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId + left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode + left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode + where a.IssQty < a.Qty*(b.QualifiedInQty/b.qty) + ) mm + "; + + + List where = new List(); + + if (info.Ccode != null) + { + where.Add(" mm.MoCode in @Ccode"); + } + if (info.error != null) + { + where.Add(" mm.error in @error"); + } + + + + 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 { info.Ccode, info.error }); + } + } + } } diff --git a/NX.ERP.U8/Pmc/WarehouseQuery.cs b/NX.ERP.U8/Pmc/WarehouseQuery.cs index 66d0fee..b70a559 100644 --- a/NX.ERP.U8/Pmc/WarehouseQuery.cs +++ b/NX.ERP.U8/Pmc/WarehouseQuery.cs @@ -37,25 +37,24 @@ SELECT cinvcode, ),1 ,1, '') cPosName FROM InvPositionSum b GROUP BY cinvcode - - -select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,a.dDate as ArrivalDate,A.cVenCode AS SupplierCode, +select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode, CONVERT(varchar(100), a.dDate, 23) as ArrivalDate,A.cVenCode AS SupplierCode, B.Autoid as id,b.ID as ArrivalID, - b.cInvCode AS MaterialCode, + b.cInvCode AS MaterialCode,cinvname ,cinvstd, b.cBatch AS BatchNo, b.fvalidinquan as RealQuantity, b.ccomunitcode AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,b.isum as sum, B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid,b.iNum,b.ccomunitcode,b.cunitid,b.cinva_unit,b.cinvm_unit,b.inspecexchrate, Pos.cPosName - FROM pu_ArrBody b , pu_ArrHead a - , (select cinvcode as cinvcode1,iId from inventory) inventory - , PO_Podetails C WITH (NOLOCK) , - tempdb..tablearrive20210603 Pos -- on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'') - Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'') + FROM pu_ArrBody b left join tempdb..tablearrive20210603 Pos on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'') , pu_ArrHead a + , (select cinvcode as cinvcode1,iId from inventory WITH (NOLOCK) ) inventory + , PO_Podetails C WITH (NOLOCK) + + Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') -- and ( isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')) And (1=1) and isnull(b.cbcloser,N'')=N'' And isnull(a.cverifier,'')<>'' and a.id=b.id and b.cinvcode=inventory.cinvcode1 and B.iPOsID = C.ID And a.iBillType =N'0' and isnull(b.bGsp,N'')=N'0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (b.igrouptype=2 and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(a.bStorageArrivalOrder,1)=1 and 1=1 + "; List where = new List(); diff --git a/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs b/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs index 2d47de9..1541c75 100644 --- a/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs +++ b/NX.ERP.WebAPi/Controllers/Pmc/FinanceController.cs @@ -20,6 +20,14 @@ namespace NX.ERP.WebAPi.Controllers } + [HttpPost] + [Route("api/Finance/Voucherror")] + public IEnumerable Voucherror(NX.ERP.Model.Request.VouchererrorRequest info) + { + var FinanceQuery = new NX.ERP.U8.Finance.FinanceQuery(); + return FinanceQuery.Voucherror(info); + } + } diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 5526d76..084c941 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -6,8 +6,8 @@ - - + + diff --git a/NX.ERP.Webapp/src/App.vue b/NX.ERP.Webapp/src/App.vue index 414767d..c513de7 100644 --- a/NX.ERP.Webapp/src/App.vue +++ b/NX.ERP.Webapp/src/App.vue @@ -25,6 +25,7 @@ 到货单 + 异常单据查询 diff --git a/NX.ERP.Webapp/src/api/Finance.js b/NX.ERP.Webapp/src/api/Finance.js index 9c81fd8..6521706 100644 --- a/NX.ERP.Webapp/src/api/Finance.js +++ b/NX.ERP.Webapp/src/api/Finance.js @@ -10,3 +10,8 @@ export const Userrole = (info) => { } + +export const Voucherror = (info) => { + return axios.post('/api/Finance/Voucherror', info) +} + diff --git a/NX.ERP.Webapp/src/bill/inventory-error.vue b/NX.ERP.Webapp/src/bill/inventory-error.vue new file mode 100644 index 0000000..9f790b6 --- /dev/null +++ b/NX.ERP.Webapp/src/bill/inventory-error.vue @@ -0,0 +1,283 @@ + + + 异常单据查询 + + + + 生产订单号 + + + + 异常类型: + + + {{ item.label }} + + + + + + 查询 + 导出 + + + + + + + + + + + + 超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量)) + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NX.ERP.Webapp/src/route/index.js b/NX.ERP.Webapp/src/route/index.js index 1facfa2..86e652f 100644 --- a/NX.ERP.Webapp/src/route/index.js +++ b/NX.ERP.Webapp/src/route/index.js @@ -9,6 +9,7 @@ import inventorypo from '@/views/inventory-po.vue' import inventorypoc from '@/views/inventory-poc.vue' import Purchasesum from '@/views/Purchasesum.vue' import inventoryrrival from '@/bill/inventory-arrival.vue' +import inventoryerror from '@/bill/inventory-error.vue' export default [ { @@ -27,4 +28,5 @@ export default [ { path: '/inventorypoc', component: inventorypoc }, { path: '/Purchasesum', component: Purchasesum }, { path: '/inventoryrrival', component: inventoryrrival }, + { path: '/inventoryerror', component: inventoryerror }, ]