This commit is contained in:
gongxh
2021-05-19 13:56:09 +08:00
11 changed files with 638 additions and 136 deletions

View File

@@ -66,6 +66,7 @@
<Compile Include="Request\Inventorybu.cs" />
<Compile Include="Request\Inventoryall.cs" />
<Compile Include="Request\MaterialAppProvide.cs" />
<Compile Include="Request\MomOrderRequest.cs" />
<Compile Include="Request\PoOrderRequest.cs" />
<Compile Include="Request\SnOrderRequest.cs" />
<Compile Include="Request\SaleOrderRequest.cs" />

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model.Request
{
public class MomOrderRequest : BaseModel
{
public List<string> moCodes { get; set; }
public IEnumerable<string> InvCodes { get; set; }
public bool byFinish { get; set; }
public bool byiss { get; set; }
}
}

View File

@@ -123,7 +123,7 @@ namespace NX.ERP.U8.Pmc
}
public IEnumerable<NX.ERP.Model.PmcInventorymomRes> Inventorymom(List<string> moCodes)
public IEnumerable<NX.ERP.Model.PmcInventorymomRes> Inventorymom(NX.ERP.Model.Request.MomOrderRequest info)
{
string sql = $@"
select *from (
@@ -134,7 +134,7 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
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,
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, md.Status
FROM mom_order m WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
@@ -145,13 +145,13 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
GROUP BY ma.InvCode) mas ON ma.InvCode = mas.InvCode LEFT JOIN
(SELECT mom.MoId, ma.invcode,SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) mdqty
(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
GROUP BY ma.InvCode,mom.MoId) mdsss ON ma.InvCode = mdsss.InvCode and m.MoId=mdsss.MoId LEFT JOIN
GROUP BY ma.InvCode) mdsss ON ma.InvCode = mdsss.InvCode LEFT JOIN
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
@@ -206,16 +206,116 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
(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 LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
where md.Status <> 4 AND ma.Qty - IsNull(ma.IssQty, 0) > 0 ) mmm
) mmm
";
List<string> where = new List<string>();
if (info.moCodes != null && info.moCodes.Count > 0)
{
sql = $@"
select *from (
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.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,
CASE WHEN md.Status = 2 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_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
INNER JOIN
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0
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 mom.mocode in @moCodes
GROUP BY ma.InvCode) mdsss ON ma.InvCode = mdsss.InvCode 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
WHERE md.Status <> 4
GROUP BY ma.InvCode) misss ON ma.InvCode = misss.InvCode LEFT JOIN
(SELECT cinvcode, SUM(iquantity) qty
FROM currentstock WITH (NOLOCK)
GROUP BY cInvCode) cs ON ma.InvCode = cs.cInvCode
LEFT JOIN
(SELECT cinvcode, SUM(iquantity) qty
FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001')
GROUP BY cInvCode) ds ON ma.InvCode = ds.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
(SELECT MD.INVCODE, SUM(MD.QTY - ISNULL(MD.QUALIFIEDINQTY, 0)) AS MQTY
FROM mom_orderdetail MD WITH (NOLOCK)
GROUP BY MD.INVCODE) MX ON MA.InvCode = MX.InvCode LEFT JOIN
(SELECT cinvcode, SUM(rqty) AS rqty
FROM (SELECT PDS.cInvCode, PDS.iQuantity - ISNULL(rds.qty, 0) AS Rqty
FROM PO_Pomain PM WITH (NOLOCK) INNER JOIN
PO_Podetails PDS WITH (NOLOCK) ON PM.POID = PDS.POID LEFT JOIN
(SELECT IPOSID, SUM(IQUANTITY) AS QTY
FROM rdrecords01 rds WITH (NOLOCK) INNER JOIN
RdRecord01 rd WITH (nolock) ON rds.ID = rd.ID
WHERE CBUSTYPE = '普通采购'
GROUP BY IPOSID) RDS ON PDS.ID = RDS.iPOsID
WHERE ISNULL(PM.CCLOSER, N'') = N'' AND ISNULL(PDS.CBCLOSER, N'') = N'' AND
pds.iQuantity - ISNULL(rds.qty, 0) > 0) x
GROUP BY cInvCode) prd ON ma.InvCode = prd.cInvCode LEFT JOIN
(SELECT CINVCODE, SUM(RQTY) AS RQTY1
FROM (SELECT ommds.cInvCode, ommds.iQuantity - ISNULL(rds.qty, 0) AS rqty
FROM OM_MOMain omm WITH (nolock) INNER JOIN
OM_MODetails ommds WITH (nolock) ON omm.MOID = ommds.MOID LEFT JOIN
(SELECT iomodid, sum(iquantity) AS qty
FROM rdrecords01 WITH (nolock)
GROUP BY iOMoDID) rds ON ommds.MODetailsID = rds.iOMoDID
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
ommds.iQuantity - ISNULL(rds.qty, 0) > 0) OM
GROUP BY cInvCode) OMM ON MA.INVCODE = OMM.CINVCODE LEFT JOIN
(SELECT CINVCODE, SUM(RQTY) AS RQTY3
FROM (SELECT ommds.cInvCode, ommds.fquantity - ISNULL(rds.qty, 0) AS rqty
FROM pu_AppHead omm WITH (nolock) INNER JOIN
pu_appbody ommds WITH (nolock) ON omm.id = ommds.id LEFT JOIN
(SELECT iAppIds, sum(iquantity) AS qty
FROM PO_Podetails WITH (nolock)
GROUP BY iAppIds) rds ON ommds.autoid = rds.iAppIds
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND
ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM
GROUP BY cInvCode) pu_App ON MA.INVCODE = pu_App.CINVCODE LEFT JOIN
(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 LL WITH (nolock) on c.cComUnitCode=LL.cComunitCode
) mmm
";
}
List<string> where = new List<string>();
///处理-
if (moCodes != null && moCodes.Count>0 )
if (info.moCodes != null && info.moCodes.Count > 0)
{
where.Add(" mmm.mocode in @moCodes");
}
if (info.InvCodes!= null )
{
where.Add(" mmm.invcode1 in @invcode1");
}
if (!info.byFinish)
{
where.Add(" mmm.Status <> 4");
}
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());
@@ -229,7 +329,7 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = moCodes });
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = info.moCodes, invcode1=info.InvCodes });
}
}
@@ -442,8 +542,8 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
public IEnumerable<object> InventoryPo(NX.ERP.Model.Request.PoOrderRequest info1)
{
string sql = $@"
Select cpoid,dpodate,zpurpoheader.cvenabbname,zpurpotail.cinvcode,zpurpotail.cinvname,zpurpotail.cinvstd,zpurpotail.cinvm_unit,zpurpotail.ireceivedqty,
iquantity,prd.rqty,zpurpotail.darrivedate,cupsocode,d.ddate,c.drequirdate
Select cpoid,CONVERT(varchar(100),dpodate, 23) as dpodate,zpurpoheader.cvenabbname,zpurpotail.cinvcode,zpurpotail.cinvname,zpurpotail.cinvstd,zpurpotail.cinvm_unit,zpurpotail.ireceivedqty,
iquantity,prd.rqty,CONVERT(varchar(100), zpurpotail.darrivedate, 23) as darrivedate,cupsocode, CONVERT(varchar(100), d.ddate, 23) as ddate, CONVERT(varchar(100), c.drequirdate, 23) as drequirdate
From zpurpoheader with(nolock) inner join zpurpotail with(nolock) on zpurpoheader.poid=zpurpotail.poid
left join pu_appbody c with(nolock) on zpurpotail.iAppIds =c.autoid
left join pu_apphead d with(nolock) on d.id =c.id

View File

@@ -21,10 +21,10 @@ namespace NX.ERP.WebAPi.Controllers
[HttpPost]
[Route("api/Pmc/Inventorymom")]
public IEnumerable<NX.ERP.Model.PmcInventorymomRes> Inventorymom([FromBody] List<string> moCodes)
public IEnumerable<NX.ERP.Model.PmcInventorymomRes> Inventorymom(NX.ERP.Model.Request.MomOrderRequest info)
{
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
return PmcQuery.Inventorymom(moCodes).OrderByDescending(m=> m.Mocode).ThenBy(m => m.SortSeq).ThenBy(m => m.Invcode1);
return PmcQuery.Inventorymom(info).OrderByDescending(m=> m.Mocode).ThenBy(m => m.SortSeq).ThenBy(m => m.Invcode1);
}
[HttpPost]

View File

@@ -4,73 +4,73 @@
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings>
<add key="server" value="192.168.1.14" />
<add key="AccId" value="002" />
<add key="UserId" value="0001" />
<add key="Password" value="123456" />
<add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<appSettings>
<add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx994" />
<add key="Password" value="1" />
<add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
</configuration>

View File

@@ -13,6 +13,7 @@
<MenuItem to="/InventorySo" name="3-5">销售订单表</MenuItem>
<MenuItem to="/inventory-SNDetail" name="3-6">序列号查询</MenuItem>
<MenuItem to="/inventorybu" name="3-7">补料量查询</MenuItem>
<MenuItem to="/inventorypo" name="3-8">采购订单列表</MenuItem>
</MenuGroup>
</Submenu>
</Menu>

View File

@@ -14,4 +14,6 @@ export const getInventorysocode=(info)=>{
export const getInventorybu=(info)=>{
return axios.post('/api/Pmc/Inventorybu',info)
}
export const getInventorypo=(info)=>{
return axios.post('/api/Pmc/InventoryPocode',info)
}

View File

@@ -88,6 +88,51 @@ export const sortByKey=(array,key)=> {
})
}
export const getMonth=(type, months) =>{//type为字符串类型,有两种选择,"s"代表开始,"e"代表结束,months为数字类型,不传或0代表本月,-1代表上月,1代表下月
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth() + 1;
if (Math.abs(months) > 12) {
months = months % 12;
};
if (months != 0) {
if (month + months > 12) {
year++;
month = (month + months) % 12;
} else if (month + months < 1) {
year--;
month = 12 + month + months;
} else {
month = month + months;
};
};
month = month < 10 ? "0" + month: month;
var date = d.getDate();
var firstday = year + "-" + month + "-" + "01";
var lastday = "";
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" || month == "12") {
lastday = year + "-" + month + "-" + 31;
} else if (month == "02") {
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
lastday = year + "-" + month + "-" + 29;
} else {
lastday = year + "-" + month + "-" + 28;
};
} else {
lastday = year + "-" + month + "-" + 30;
};
var day = "";
if (type == "s") {
day = firstday;
} else {
day = lastday;
};
return day;
}
export const pageingData = (data, pagesize, index) => {
if (!data) return []
let pageNo = 1

View File

@@ -5,6 +5,7 @@ import InventoryMonth from '@/views/inventory-month.vue'
import InventorySo from '@/views/inventory-so.vue'
import inventorySNDetail from '@/views/inventory-SNDetail.vue'
import inventorybu from '@/views/inventory-bu.vue'
import inventorypo from '@/views/inventory-po.vue'
export default [
{
path: '/',
@@ -17,5 +18,6 @@ export default [
{ path: '/InventoryMonth', component: InventoryMonth },
{ path: '/inventory-SNDetail', component: inventorySNDetail },
{ path: '/InventorySo', component: InventorySo },
{ path: '/inventorybu', component: inventorybu }
{ path: '/inventorybu', component: inventorybu },
{ path: '/inventorypo', component: inventorypo }
]

View File

@@ -3,12 +3,29 @@
<h4>跟单记录表</h4>
<div>
<Row :gutter="16">
<Col span="8">
<Col span="4">
<label>订单编号</label>
<Input autosize type="textarea" v-model="filter.mo_codes" />
</Col>
<Col span="4">
<label>子件编码</label>
<Input autosize type="textarea" v-model="filter.inv_codes" />
</Col>
<Col span="8">
<Button
<Col span="3">
<label>状态</label>
<div>
<Checkbox v-model="filter.by_finish">包含已关闭</Checkbox>
</div>
</Col>
<Col span="3">
<label>状态</label>
<div>
<Checkbox v-model="filter.byiss">仅已领</Checkbox>
</div>
</Col>
<Col span="4">
<Button
size="large"
type="primary"
icon="ios-search"
@@ -25,7 +42,7 @@
<Table
style="margin-top: 20px"
size="small"
:loading="loading"
:loading="loading"
border
:columns="columns"
:data="pagedData"
@@ -50,7 +67,12 @@
<script>
import { getInventorymom } from "@/api/pmc";
import { pageingData, export_col_to_excel,sortByKey,numberFormat } from "@/libs/tools";
import {
pageingData,
export_col_to_excel,
sortByKey,
numberFormat,
} from "@/libs/tools";
export default {
data() {
return {
@@ -63,16 +85,16 @@ export default {
datas: [],
filter: {
inv_codes: "",
inv_std: "",
so_code: "",
mo_codes: "",
by_finish: false,
byiss: false,
},
columns: [
{
title: "生产订单号",
align: "center",
key: "mocode",
fixed:"left",
fixed: "left",
width: 135,
className: "demo-table-info-new",
},
@@ -80,16 +102,15 @@ export default {
title: "行号",
align: "center",
key: "sort_seq",
fixed:"left",
fixed: "left",
width: 80,
},
{
title: "产品编码",
align: "center",
key: "inv_code",
width: 100,
fixed:"left",
fixed: "left",
className: "demo-table-info-new",
},
{
@@ -97,7 +118,7 @@ export default {
align: "center",
key: "c_inv_name",
width: 150,
fixed:"left",
fixed: "left",
className: "demo-table-info-new",
},
{
@@ -105,32 +126,42 @@ export default {
align: "center",
key: "c_inv_std",
width: 180,
fixed:"left",
fixed: "left",
},
{
title: "产品单位",
align: "center",
key: "c_com_unit_name",
fixed:"left",
fixed: "left",
width: 100,
},
{
title: "投产量",
align: "center",
key: "qty",
fixed:"left",
fixed: "left",
width: 80,
},
{
title: "未完成",
title: "完成量",
align: "center",
key: "qualified_in_qty",
fixed:"left",
fixed: "left",
width: 80,
},
{
title: "未完成量",
align: "center",
fixed: "left",
width: 100,
render: (h, params) => {
return (
<span>
{numberFormat(params.row.qty - params.row.qualified_in_qty)}
</span>
);
},
},
{
title: "子件编码",
@@ -138,7 +169,7 @@ export default {
width: 100,
key: "invcode1",
className: "demo-table-info-old",
fixed:"left",
fixed: "left",
},
{
title: "子件名称",
@@ -146,29 +177,26 @@ export default {
width: 150,
key: "cinvname1",
className: "demo-table-info-old",
fixed:"left",
fixed: "left",
},
{
title: "子件规格",
width: 200,
align: "center",
key: "cinvstd1",
fixed:"left",
fixed: "left",
},
{
title: "子件单位",
width: 100,
align: "center",
key: "c_com_unit_name1",
},
{
title: "子件属性",
align: "center",
key: "std",
width: 100,
width: 100,
},
{
title: "单行需求",
@@ -181,29 +209,24 @@ export default {
align: "center",
key: "issqty",
width: 110,
},
{
title: "单行未领",
align: "center",
width: 110,
render: (h, params) => {
return (
<span>
{numberFormat(
params.row.qty1 - params.row.issqty
)}
</span>
);
},
render: (h, params) => {
return (
<span>{numberFormat(params.row.qty1 - params.row.issqty)}</span>
);
},
},
{
title: "条件内未领",
align: "center",
width: 110,
key: "mdqty",
key: "mdqty",
},
{
title: "总未领量",
@@ -223,7 +246,7 @@ export default {
key: "cqty",
width: 100,
},
{
title: "现存无废品",
align: "center",
@@ -277,18 +300,22 @@ export default {
},
async loadData() {
try {
let _filetr =
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: [];
this.loading=true;
let resp = await getInventorymom(_filetr);
let _filert = {
inv_codes: this.filter.inv_codes !== '' ? this.filter.inv_codes.split(/[,\s\n,]/) : null,
mo_codes: this.filter.mo_codes !== '' ? this.filter.mo_codes.split(/[,\s\n,]/) : null,
by_finish: this.filter.by_finish,
byiss: this.filter.byiss,
}
this.loading = true;
let resp = await getInventorymom(_filert);
this.pageNo = 1;
this.datas = resp.data.data;
} catch (error) {}
finally{this.loading=false;}
} catch (error) {
} finally {
this.loading = false;
}
},
handlePagechange(page) {
this.pageNo = page;

View File

@@ -0,0 +1,304 @@
<template>
<div>
<h4>销售订单表</h4>
<div>
<Row :gutter="16">
<Col span="4">
<label>采购订单编号</label>
<Input autosize type="textarea" v-model="filter.po_codes" />
</Col>
<Col span="3">
<label>采购订单期间</label>
<div>
<DatePicker v-model="filter.dates" type="daterange"></DatePicker>
</div>
</Col>
<Col span="3">
<label>物料编号</label>
<Input autosize type="textarea" v-model="filter.inv_codes" />
</Col>
<Col span="3">
<label>规格</label>
<Input v-model="filter.inv_std" />
</Col>
<Col span="4">
<label>请购单号</label>
<Input autosize type="textarea" v-model="filter.app_codes" />
</Col>
<Col span="3">
<label>请购订单期间</label>
<div>
<DatePicker v-model="filter.dates2" type="daterange"></DatePicker>
</div>
</Col>
<Col span="4">
<Button
size="large"
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
</Col>
</Row>
</div>
<Table
style="margin-top: 20px"
size="small"
border
:loading="loading"
:columns="columns"
:data="pagedData"
>
</Table>
<Page
style="margin-top: 20px"
:current="pageNo"
:page-size="pageSize"
:total="total"
:page-size-opts="PageSizeOpts"
@on-change="handlePagechange"
@on-page-size-change="handlePageSize"
show-elevator
show-sizer
show-total
size="small"
/>
</div>
</template>
<script>
import { getInventorypo } from "@/api/pmc";
import {
pageingData,
export_col_to_excel,
dateFormatFull,
dateFormat,
sortByKey,
getMonth,
} from "@/libs/tools";
export default {
data() {
return {
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
loading: false,
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
filter: {
inv_codes: "",
inv_std: "",
po_codes: "",
app_codes: "",
dates: [getMonth("s", -1), getMonth("e", 0)],
dates2: [],
},
columns: [
{
title: "采购订单号",
align: "center",
key: "cpoid",
},
{
title: "订单日期",
align: "center",
key: "dpodate",
},
{
title: "供应商",
align: "center",
key: "cvenabbname",
},
{
title: "存货编码",
align: "center",
key: "cinvcode",
},
{
title: "存货名称",
align: "center",
key: "cinvname",
className: "demo-table-info-new",
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
},
{
title: "累计到货",
align: "center",
key: "ireceivedqty",
},
{
title: "订单数量",
align: "center",
key: "iquantity",
},
{
title: "合计在途",
align: "center",
key: "rqty",
},
{
title: "预计到货日期",
align: "center",
key: "darrivedate",
},
{
title: "请购单号",
align: "center",
key: "cupsocode",
},
{
title: "请购日期",
align: "center",
key: "ddate",
},
{
title: "需求日期",
align: "center",
key: "drequirdate",
},
],
};
},
computed: {
total() {
return this.datas.length;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
},
},
mounted() {
this.loadData();
},
methods: {
handelExport() {
export_col_to_excel(this.columns, this.datas);
},
handleClick() {
this.loadData();
},
async loadData() {
try {
let _beginDate = null;
let _endDate = null;
let _beginDate2 = null;
let _endDate2 = null;
if (
this.filter.dates.length == 2 &&
this.filter.dates[0] !== "" &&
this.filter.dates[0] !== ""
) {
_beginDate = this.filter.dates[0];
_endDate = this.filter.dates[1];
}
if (
this.filter.dates2.length == 2 &&
this.filter.dates2[0] !== "" &&
this.filter.dates2[0] !== ""
) {
_beginDate2 = this.filter.dates2[0];
_endDate2 = this.filter.dates2[1];
}
let _filert = {
inv_codes:
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: null,
inv_std: this.filter.inv_std,
po_codes:
this.filter.po_codes !== ""
? this.filter.po_codes.split(/[,\s\n,]/)
: null,
app_codes:
this.filter.app_codes !== ""
? this.filter.app_codes.split(/[,\s\n,]/)
: null,
begin_date: _beginDate,
end_date: _endDate,
begin_date2: _beginDate2,
end_date2: _endDate2,
};
this.loading = true;
let resp = await getInventorypo(_filert);
this.pageNo = 1;
this.datas = resp.data.data;
this.datas = sortByKey(resp.data.data, "cpoid");
} catch (error) {
} finally {
this.loading = false;
}
},
handlePagechange(page) {
this.pageNo = page;
},
handlePageSize(pageSize) {
this.pageSize = pageSize;
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.ivu-table .demo-table-info-row td {
background-color: #2db7f5;
color: #fff;
}
.ivu-table .demo-table-error-row td {
background-color: #ff6600;
color: #fff;
}
.ivu-table td.demo-table-info-old {
color: #2db7f5;
}
.ivu-table td.demo-table-info-new {
color: #ff6600;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
body {
padding: 10px 1;
}
</style>