diff --git a/NX.ERP.Model/NX.ERP.Model.csproj b/NX.ERP.Model/NX.ERP.Model.csproj index 60cca87..481734a 100644 --- a/NX.ERP.Model/NX.ERP.Model.csproj +++ b/NX.ERP.Model/NX.ERP.Model.csproj @@ -79,6 +79,7 @@ + diff --git a/NX.ERP.Model/Request/SaleinvRequest.cs b/NX.ERP.Model/Request/SaleinvRequest.cs new file mode 100644 index 0000000..0aa5e2c --- /dev/null +++ b/NX.ERP.Model/Request/SaleinvRequest.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Request +{ + public class SaleinvRequest + { + + public string cCusAbbName { get; set; } + + public string dDate { get; set; } + public string cSOCode { get; set; } + public string cInvCode { get; set; } + public string cInvName { get; set; } + public string cInvStd { get; set; } + + public string wfiQuantity { get; set; } + public string kcyl { get; set; } + public string dPreDate { get; set; } + public string cMemo { get; set; } + + public string datewaring { get; set; } + + public string jandate { get; set; } + + public string kcyl2 { get; set; } + + + + public IEnumerable SoCodes { get; set; } + public string InvStd { get; set; } + + public IEnumerable InvCodes { get; set; } + + + + public DateTime? BeginDate { get; set; } + public DateTime? EndDate { get; set; } + + + public bool byFinish { get; set; } + + public IEnumerable flag { get; set; } + + + } +} diff --git a/NX.ERP.U8/Pmc/PmcQuery.cs b/NX.ERP.U8/Pmc/PmcQuery.cs index 3f826e9..3e605a1 100644 --- a/NX.ERP.U8/Pmc/PmcQuery.cs +++ b/NX.ERP.U8/Pmc/PmcQuery.cs @@ -852,13 +852,14 @@ select *from tempdb..tablepzck20210526 } - public IEnumerable InventorySale(NX.ERP.Model.Request.SaleOrderRequest info1) + public IEnumerable InventorySale(NX.ERP.Model.Request.SaleinvRequest info1) { string sql = $@" - + select *from ( select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, a.iQuantity - isnull(d.cqty,0) as wfiQuantity , - isnull(cs.qty,0) as xcl + isnull(cs.qty,0) as xcl, + b.cVerifier , isnull( (SELECT isnull(SUM(iquantity),0) qty @@ -892,7 +893,7 @@ select *from tempdb..tablepzck20210526 GROUP BY cInvCode) cs ON a.cInvCode = cs.cInvCode left join Customer f WITH (nolock) on b.cCusCode=f.cCusCode - left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode + left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode ) mm @@ -901,26 +902,112 @@ select *from tempdb..tablepzck20210526 List where = new List(); - where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null "); + // where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null "); + + where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null "); + + if (!string.IsNullOrEmpty(info1.cCusAbbName)) + { + where.Add(" mm.cCusAbbName like @cCusAbbName "); + } + + if (!string.IsNullOrEmpty(info1.dDate)) + { + where.Add(" mm.dDate = @dDate "); + } + + if (!string.IsNullOrEmpty(info1.cSOCode)) + { + where.Add(" mm.cSOCode = @cSOCode "); + } + + if (!string.IsNullOrEmpty(info1.cInvCode)) + { + where.Add(" mm.cInvCode like @cInvCode "); + } + + if (!string.IsNullOrEmpty(info1.cInvName)) + { + where.Add(" mm.cInvName like @cInvName "); + } + + if (!string.IsNullOrEmpty(info1.cInvStd)) + { + where.Add(" mm.cInvStd like @cInvStd "); + } + + if (!string.IsNullOrEmpty(info1.cMemo)) + { + where.Add(" mm.cMemo like @cMemo "); + } + + if (!string.IsNullOrEmpty(info1.dPreDate)) + { + where.Add(" mm.dPreDate = @dPreDate "); + } + + if (!string.IsNullOrEmpty(info1.wfiQuantity)) + { + where.Add(" mm.wfiQuantity = @wfiQuantity "); + } + + if (!string.IsNullOrEmpty(info1.kcyl)) + { + where.Add(" mm.kcyl = @kcyl "); + } + + if (!string.IsNullOrEmpty(info1.jandate)) + { + where.Add(" mm.jandate = @jandate "); + } + + if (!string.IsNullOrEmpty(info1.kcyl2)) + { + if (info1.kcyl2 == "1") + { + where.Add(" mm.kcyl <= 0 "); + } + else if (info1.kcyl2 == "2") + { + where.Add(" mm.kcyl > 0 "); + } + + } + + if (!string.IsNullOrEmpty(info1.datewaring)) + { + if (info1.datewaring == "1") + { + where.Add(" (mm.jandate > -15 AND mm.jandate < 0) "); + } + else if (info1.datewaring == "2") + { + where.Add("(mm.jandate <= -15) "); + } + else if (info1.datewaring == "3") + { + where.Add("(mm.jandate >= 0) "); + } + + } + + /* if (info1.InvCodes != null) { - where.Add(" a.cinvcode in @cinvcode"); + where.Add(" mm.cinvcode in @cinvcode"); } + if (!string.IsNullOrEmpty(info1.InvStd)) { - where.Add(" g.cInvStd like @cInvStd "); + where.Add(" mm.cInvStd like @cInvStd "); } if (info1.SoCodes != null) { - where.Add(" b.cSOCode in @cSOCode "); + where.Add(" mm.cSOCode in @SoCodes "); } - if (info1.BeginDate != null && info1.EndDate != null) - { - where.Add(" b.dDate between @beginDate and @endDate "); - - } + */ if (info1.flag != null && info1.flag.ToList().Count>0) { @@ -931,15 +1018,15 @@ select *from tempdb..tablepzck20210526 { if (item == "1") { - str.Add(" (DATEDIFF(day,a.dPreDate,GETDATE()) > -15 AND DATEDIFF(day,a.dPreDate,GETDATE()) < 0) "); + str.Add(" (mm.jandate > -15 AND mm.jandate < 0) "); } else if (item == "2") { - str.Add(" (DATEDIFF(day,a.dPreDate,GETDATE()) <= -15) "); + str.Add(" (mm.jandate <= -15) "); } else { - str.Add(" (DATEDIFF(day, a.dPreDate, GETDATE()) >= 0) "); + str.Add(" (mm.jandate >= 0) "); } } @@ -962,7 +1049,7 @@ select *from tempdb..tablepzck20210526 using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) { - return conn.Query(sql, new { cinvcode = info1.InvCodes, cInvStd = $"%{info1.InvStd}%", cSOCode = info1.SoCodes, info1.BeginDate, info1.EndDate }); + return conn.Query(sql, new { cCusAbbName = $"%{info1.cCusAbbName}%", dDate = info1.dDate, dPreDate = info1.dPreDate, cSOCode = info1.cSOCode, cInvCode = $"%{info1.cInvCode}%" , cInvName = $"%{info1.cInvName}%" , cInvStd = $"%{info1.cInvStd}%" , cMemo = $"%{info1.cMemo}%", SoCodes = info1.SoCodes, info1.jandate, info1.wfiQuantity, info1.kcyl, }); } } diff --git a/NX.ERP.WebAPi/Controllers/Pmc/PmcController.cs b/NX.ERP.WebAPi/Controllers/Pmc/PmcController.cs index 44e1563..4e85b97 100644 --- a/NX.ERP.WebAPi/Controllers/Pmc/PmcController.cs +++ b/NX.ERP.WebAPi/Controllers/Pmc/PmcController.cs @@ -47,7 +47,7 @@ namespace NX.ERP.WebAPi.Controllers [HttpPost] [Route("api/Pmc/InventorySale")] - public IEnumerable InventorySale(NX.ERP.Model.Request.SaleOrderRequest info1) + public IEnumerable InventorySale(NX.ERP.Model.Request.SaleinvRequest info1) { var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery(); return PmcQuery.InventorySale(info1); diff --git a/NX.ERP.Webapp/src/App.vue b/NX.ERP.Webapp/src/App.vue index c6bb6f4..0f77a9d 100644 --- a/NX.ERP.Webapp/src/App.vue +++ b/NX.ERP.Webapp/src/App.vue @@ -12,13 +12,14 @@ 材料出库数据与品种 销售订单表 --> 销售未发明细表 - 序列号查询 + + 采购订单列表(PMC) 采购跟进表(采购部) - 采购查询汇总 + 采购查询汇总--> +
diff --git a/NX.ERP.Webapp/src/views/FilterTable.vue b/NX.ERP.Webapp/src/views/FilterTable.vue new file mode 100644 index 0000000..adcd92b --- /dev/null +++ b/NX.ERP.Webapp/src/views/FilterTable.vue @@ -0,0 +1,165 @@ + + + + + \ No newline at end of file diff --git a/NX.ERP.Webapp/src/views/inventory-sale.vue b/NX.ERP.Webapp/src/views/inventory-sale.vue index c39aa7d..c25f760 100644 --- a/NX.ERP.Webapp/src/views/inventory-sale.vue +++ b/NX.ERP.Webapp/src/views/inventory-sale.vue @@ -1,8 +1,9 @@