From ed0b74e3b8b41da1518a5c4c30b20fed067ff650 Mon Sep 17 00:00:00 2001 From: "1005539536@qq.com" <58543wxm> Date: Wed, 27 Apr 2022 15:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E7=BB=B4=E6=8A=A4=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=80=E8=B4=A7=E6=95=B0=E9=87=8F=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WMS/WeiWaiProductionIssueApp.cs | 43 ++++++++++++++++--- .../ICSOApplyNegAdd.cshtml | 7 +++ .../ICSOApplyNegUpdate.cshtml | 10 ++++- .../SeachMaterial.cshtml | 3 +- 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/WeiWaiProductionIssueApp.cs b/WMS-BS/NFine.Application/WMS/WeiWaiProductionIssueApp.cs index 833620f..c04ef29 100644 --- a/WMS-BS/NFine.Application/WMS/WeiWaiProductionIssueApp.cs +++ b/WMS-BS/NFine.Application/WMS/WeiWaiProductionIssueApp.cs @@ -67,7 +67,8 @@ namespace NFine.Application.WMS b.InvStd, b.InvUnit, a.IssueNegQuantity, -a.ExtensionID +a.ExtensionID, +'' as tuinum FROM ICSOApplyNegDetail a LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfqno + "'"; @@ -111,7 +112,29 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq { wherestr += " and a.InvCode like '%" + invcode + "'%"; } - string sql = "SELECT DISTINCT a.PickID as ZJID,a.Sequence,c.OOCode,c.Sequence as MuHang,a.InvCode,a.Quantity,a.Amount,b.InvName,b.InvStd,b.InvUnit,a.IssueQuantity,a.ExtensionID from ICSOOPick a left JOIN ICSInventory b ON a.InvCode = b.InvCode and a.WorkPoint=b.WorkPoint left join ICSOutsourcingOrder c on a.OODetailID=c.OODetailID and a.WorkPoint=c.WorkPoint where a.IssueQuantity>0 and a.WorkPoint = '" + WorkPoint + "'" + wherestr; + string sql = @"SELECT DISTINCT + a.PickID AS ZJID, + a.Sequence, + c.OOCode, + c.Sequence AS MuHang, + a.InvCode, + a.Quantity, + a.Amount, + b.InvName, + b.InvStd, + b.InvUnit, + a.IssueQuantity, + a.ExtensionID, + isnull(d.Quantity, 0) as tuinum +FROM ICSOOPick a +LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode AND a.WorkPoint = b.WorkPoint +LEFT JOIN ICSOutsourcingOrder c ON a.OODetailID = c.OODetailID AND a.WorkPoint = c.WorkPoint +LEFT JOIN (select SourceDetailID, WorkPoint, sum(Quantity) as Quantity FROM ICSOApplyNegDetail GROUP BY SourceDetailID, WorkPoint) d ON a.PickID = d.SourceDetailID AND a.WorkPoint = d.WorkPoint +WHERE + + a.IssueQuantity > 0 and a.WorkPoint = '{0}' "; + sql = string.Format(sql, WorkPoint); + sql = sql + wherestr; return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam); } @@ -131,6 +154,7 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq info[0]["Amount"] = data["Amount"]; info[0]["IssueNegQuantity"] = data["IssueNegQuantity"]; info[0]["ExtensionID"] = data["ExtensionID"]; + info[0]["tuinum"] = data["tuinum"]; info[0]["Quantity"] = 0; } else @@ -144,6 +168,7 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq newrow["Amount"] = data["Amount"]; newrow["IssueNegQuantity"] = data["IssueNegQuantity"]; newrow["ExtensionID"] = data["ExtensionID"]; + newrow["tuinum"] = data["tuinum"]; newrow["Quantity"] = 0; newrow["ID"] = data["ID"]; newrow["TLZID"] = data["TLZID"]; @@ -167,6 +192,8 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq Invmes.Columns.Add("ExtensionID", typeof(string)); Invmes.Columns.Add("ID", typeof(string)); Invmes.Columns.Add("TLZID", typeof(string)); + Invmes.Columns.Add("tuinum", typeof(string)); + } string usercode = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode; DataRow newrow = Invmes.NewRow(); @@ -181,13 +208,14 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq newrow["Quantity"] = 0; newrow["ID"] = data["ID"]; newrow["TLZID"] = data["TLZID"]; + newrow["tuinum"] = data["tuinum"]; Invmes.Rows.Add(newrow); } public DataTable GetICSMOApplyNegDetailTemp(string OApplyNegCode) { - string sql = @"SELECT + string sql = @" SELECT a.ID, a.ID as TLZID, a.OApplyNegCode, @@ -199,10 +227,13 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + rfq b.InvStd, b.InvUnit, a.IssueNegQuantity, -a.ExtensionID +a.ExtensionID, +isnull(d.Quantity,0) as tuinum FROM ICSOApplyNegDetail a -LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + OApplyNegCode + "'"; +LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode +LEFT JOIN (select OApplyNegCode,WorkPoint,sum(Quantity) as Quantity FROM ICSOApplyNegDetail GROUP BY OApplyNegCode,WorkPoint) d ON a.OApplyNegCode = d.OApplyNegCode AND a.WorkPoint = d.WorkPoint +where a.OApplyNegCode='" + OApplyNegCode + "'"; DataTable table = Repository().FindDataSetBySql(sql).Tables[0]; if (Invmes == null || Invmes.Columns.Count <= 0) Invmes = table.Clone(); @@ -239,6 +270,7 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + OAp info[0]["Quantity"] = 0; info[0]["IssueNegQuantity"] = data["IssueNegQuantity"]; info[0]["ExtensionID"] = data["ExtensionID"]; + info[0]["tuinum"] = data["tuinum"]; } else { @@ -254,6 +286,7 @@ LEFT JOIN ICSInventory b ON a.InvCode = b.InvCode where a.OApplyNegCode='" + OAp newrow["TLZID"] = data["TLZID"]; newrow["IssueNegQuantity"] = data["IssueNegQuantity"]; newrow["ExtensionID"] = data["ExtensionID"]; + newrow["tuinum"] = data["tuinum"]; dtCloned.Rows.Add(newrow); } } diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegAdd.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegAdd.cshtml index 1dd387f..fff8f8c 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegAdd.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegAdd.cshtml @@ -63,6 +63,7 @@ { label: '自由项ID', name: 'ExtensionID', hidden: true }, { label: '单位', name: 'InvUnit', width: 100, align: 'left' }, { label: '来源单据ID', name: 'ZJID', width: 100, align: 'left' }, + { label: '已退数量', name: 'tuinum', width: 100, align: 'left' }, ], cellsubmit: "clientArray", width: "100%", @@ -168,12 +169,18 @@ $.modalAlert("请输入退货数量!"); return; } + var Code = vendorRowData.InvCode; var Quantity = Number(vendorRowData.Quantity); var IssueNegQuantity = Number(vendorRowData.IssueNegQuantity); + var tuinum = Number(vendorRowData.tuinum); if (Quantity > IssueNegQuantity) { $.modalAlert("数量不能大于已发数量!"); return; } + if (IssueNegQuantity - tuinum <= 0) { + $.modalAlert("料品:'" + Code + "'已发数:'" + IssueNegQuantity + "'已全部退货!"); + return; + } var obj = { Sequence: i + 1, InvCode: vendorRowData.InvCode, diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegUpdate.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegUpdate.cshtml index bcc6d2a..394963b 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegUpdate.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/ICSOApplyNegUpdate.cshtml @@ -59,7 +59,7 @@ { label: '自由项ID', name: 'ExtensionID', hidden: true }, { label: '单位', name: 'InvUnit', width: 100, align: 'left' }, { label: '已发数量', name: 'IssueNegQuantity', width: 100, align: 'left' }, - + { label: '已退数量', name: 'tuinum', width: 100, align: 'left' }, { label: '子件ID', name: 'ZJID', width: 100, align: 'left' }, ], cellsubmit: "clientArray", @@ -169,6 +169,14 @@ $.modalAlert("请输入数量!"); return; } + var Code = vendorRowData.InvCode; + var Quantity = Number(vendorRowData.Quantity); + var IssueNegQuantity = Number(vendorRowData.IssueNegQuantity); + var tuinum = Number(vendorRowData.tuinum); + if (IssueNegQuantity - tuinum <= 0) { + $.modalAlert("料品:'" + Code + "',已发数'" + IssueNegQuantity + "',已全部退货!"); + return; + } var obj = { Sequence: i + 1, DetailID:vendorRowData.TLZID, diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/SeachMaterial.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/SeachMaterial.cshtml index a9d7f0f..51f8741 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/SeachMaterial.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/WeiWaiProductionIssue/SeachMaterial.cshtml @@ -36,6 +36,7 @@ { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' }, { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' }, { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' }, + { label: '已退数量', name: 'tuinum', width: 100, align: 'left' }, ], pager: "#gridPager", sortorder: "desc", @@ -68,7 +69,7 @@ Amount: rowdata.Amount, IssueNegQuantity: rowdata.IssueQuantity, ExtensionID: rowdata.ExtensionID, - + tuinum: rowdata.tuinum, } var obj1 = JSON.stringify(obj);