Browse Source

调整生产领料页面及接口

master
lilili 2 years ago
parent
commit
9869d6d8a0
  1. 111
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  2. 146
      WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml

111
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -149,6 +149,24 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
{
sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Order"].ToString()))
{
sqlString.Append($@" and a.OrderNumber like '%{queryParam["Order"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ");
}
if (!string.IsNullOrWhiteSpace(queryParam["CreateDate"].ToString()))
{
sqlString.Append($@" and a.CreateDateTime >='{queryParam["CreateDate"].ToDate()}' and a.CreateDateTime <'{queryParam["CreateDate"].ToDate().AddDays(+1)}' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["NeedDate"].ToString()))
{
sqlString.Append($@" and a.NeedDate like '%{queryParam["NeedDate"]}%' ");
}
}
sqlString.Append(@" group by a.ApplyCode, a.WorkPoint,a.IssueQuantity,a.CreateDateTime,a.createperson,
@ -169,7 +187,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
var queryParam = queryJson.ToJObject();
List<DbParameter> parameter = new List<DbParameter>();
string sql = @"SELECT * FROM (select row_number() over(partition by a.ApplyCode,a.InvCode,a.Sequence ORDER BY a.ApplyCode) as row,
a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode,
a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode,a.OrderNumber,
a.EATTRIBUTE,a.Sets,a.OrderInvCode,a.OrderInvDescribe,a.BillType,a.Remarks,a.Desks,a.DispatchNumber,a.DispatcherName,
a.ReceiverNumber,a.ReceiverName,a.Urgency,a.NeedDate,a.NeedTime,a.RemarksTerm,a.TextNumber,a.InvDescribe,a.Unit,a.StockIndicator,
d.InvName,d.InvDesc,d.InvStd,d.InvUnit,detail.LocationCode AS Area,
@ -197,6 +215,24 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Order"].ToString()))
{
sql += $@" and a.OrderNumber like '%{queryParam["Order"]}%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ";
}
if (!string.IsNullOrWhiteSpace(queryParam["CreateDate"].ToString()))
{
sql += $@" and a.CreateDateTime like '%{queryParam["CreateDate"]}%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["NeedDate"].ToString()))
{
sql += $@" and a.NeedDate like '%{queryParam["NeedDate"]}%' ";
}
}
sql += " ) c WHERE c.row=1 ";
sql = string.Format(sql, Code, WorkPoint);
@ -387,6 +423,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ");
}
}
sqlString.Append(@"group by a.ApplyCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
@ -431,6 +473,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ";
}
}
sql += " ) c WHERE c.row=1 ";
sql = string.Format(sql, Code, WorkPoint);
@ -546,6 +594,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
LEFT JOIN ICSMOPickMerge e ON a.ID = e.SourceID AND a.WorkPoint = e.WorkPoint
LEFT JOIN ICSExtension f ON a.ExtensionID = f.ID AND a.WorkPoint = f.WorkPoint
LEFT JOIN ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint
WHERE a.WorkPoint = '{WorkPoint}' ");
if (!string.IsNullOrWhiteSpace(queryJson))
{
@ -565,6 +614,20 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["CusCode"].ToString()))
{
sqlString.Append($@" and a.CusCode like '%{queryParam["CusCode"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["CusName"].ToString()))
{
sqlString.Append($@" and a.CusName like '%{queryParam["CusName"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ");
}
}
sqlString.Append(@"GROUP BY a.SDNCode, a.CreateDateTime, a.CreatePerson, f.Colspan, f.ProjectCode, f.BatchCode, f.Version, f.Brand,
@ -609,6 +672,20 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["CusCode"].ToString()))
{
sql += $@" and a.CusCode like '%{queryParam["CusCode"]}%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["CusName"].ToString()))
{
sql += $@" and a.CusName like '%{queryParam["CusName"]}%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ";
}
}
sql += " ) c WHERE c.row=1 ";
sql = string.Format(sql, Code, WorkPoint);
@ -667,6 +744,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sqlString.Append($@" (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ");
}
}
sqlString.Append(@" group by a.OutCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,f.BatchCode,
@ -712,6 +795,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ";
}
}
sql += " ) c WHERE c.row=1 ";
sql = string.Format(sql, Code, WorkPoint);
@ -840,7 +929,13 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.FromWarehouseCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ");
}
}
sqlString.Append(@"group by a.TransferNO,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4,
@ -887,6 +982,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
}
if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2")
{
sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=a.FromWarehouseCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') ";
}
}
sql += " ) as t where t.row=1";
sql = string.Format(sql, Code, WorkPoint);
@ -1494,9 +1595,9 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
from ICSWareHouseLotInfo d ,ICSInventoryLot m
where d.LotNo=m.LotNo and d.WorkPoint=m.WorkPoint
and d.WorkPoint='{WorkPoint}' AND d.Quantity>0
AND SUBSTRING( SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)),0,CHARINDEX('-', SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)))) Not IN(SELECT F_Define2 FROM Sys_SRM_ItemsDetail
WHERE
F_Define3='HGAreaConfig' AND F_Define1=d.WarehouseCode AND F_Define4=d.WorkPoint)) d
--AND SUBSTRING( SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)),0,CHARINDEX('-', SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)))) Not IN(SELECT F_Define2 FROM Sys_SRM_ItemsDetail
--WHERE F_Define3='HGAreaConfig' AND F_Define1=d.WarehouseCode AND F_Define4=d.WorkPoint)
) d
on c.InvCode=d.INVCode AND c.WhCode=d.WarehouseCode and d.ExtensionID=c.ExtensionID
LEFT JOIN (SELECT INVCode,WarehouseCode,SUM(Quantity) AS QTYTotal FROM ICSWareHouseLotInfo WHERE WorkPoint='{WorkPoint}' GROUP BY INVCode,WarehouseCode) f ON c.InvCode=f.INVCode AND c.WhCode=f.WarehouseCode
order by c.Code,c.InvCode,d.MTIME ";

146
WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml

@ -2,6 +2,7 @@
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index.cshtml";
}
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
<script>
debugger;
var _Clos = new Array();
@ -85,8 +86,21 @@
function SetCols() {
var Type = $("#selShow").val();
var ct = document.getElementsByClassName("type7");
var ct = document.getElementById("type7");
var ct1 = document.getElementById("type8");
var ct2 = document.getElementById("type9");
var ct3 = document.getElementById("type10");
var ct4 = document.getElementById("status1")
var ct5 = document.getElementById("status2")
var ct6 = document.getElementById("order1")
var ct7 = document.getElementById("order2")
var ct8 = document.getElementById("date1");
var ct9 = document.getElementById("date2");
var ct10 = document.getElementById("date3");
var ct11 = document.getElementById("date4");
var cols = new Array();
var collast = { label: "主键", name: "ID", hidden: true, key: true };
@ -131,10 +145,10 @@
cols.push(collast);
var collast = { label: '销售凭证项号', name: 'Brand', width: 100, align: 'left' };
cols.push(collast);
/* ct.style.display = "none";*/
//ct1.style.display = "none";
//ct2.style.display = "none";
//ct3.style.display = "none";
ct.style.display = "none";
ct1.style.display = "none";
ct2.style.display = "none";
ct3.style.display = "none";
}
else
@ -144,11 +158,33 @@
cols.push(collast);
var collast = { label: '客户名称', name: 'CusName', width: 150, align: 'left' };
cols.push(collast);
ct.style.display = "";
ct1.style.display = "";
ct2.style.display = "";
ct3.style.display = "";
}
if (Type = 2)
{
if (Type == 2) {
var collast = { label: '状态', name: 'Status', width: 150, align: 'left' };
cols.push(collast);
ct4.style.display = "";
ct5.style.display = "";
ct6.style.display = "";
ct7.style.display = "";
ct8.style.display = "";
ct9.style.display = "";
ct10.style.display = "";
ct11.style.display = "";
}
else
{
ct4.style.display = "none";
ct5.style.display = "none";
ct6.style.display = "none";
ct7.style.display = "none";
ct8.style.display = "none";
ct9.style.display = "none";
ct10.style.display = "none";
ct11.style.display = "none";
}
@ -184,6 +220,7 @@
function gridList() {
document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
var Type = $("#selShow").val();
var $gridList = $("#gridList");
var queryJson = {
POCode: $("#txt_POCode").val(),
@ -191,7 +228,11 @@
Area: $("#txt_Area").val(),
WHCode: $("#txt_WHCode").val(),
CusCode: $("#txt_CusCode").val(),
CusName: $("#txt_CusName").val()
CusName: $("#txt_CusName").val(),
Order: $("#txt_Order").val(),
Container: $('input[name="container"]:checked').val(),
CreateDate: $("#txt_CreateDate").val(),
NeedDate: $("#txt_NeedDate").val()
}
$gridList.dataGrid({
@ -237,6 +278,12 @@
InvCode: $("#txt_InvCode").val(),
Area: $("#txt_Area").val(),
WHCode: $("#txt_WHCode").val(),
CusCode: $("#txt_CusCode").val(),
CusName: $("#txt_CusName").val(),
Order: $("#txt_Order").val(),
Container: $("#txt_Container :checked").val(),
CreateDate: $("#txt_CreateDate").val(),
NeedDate: $("#txt_NeedDate").val()
}
var subgrid_pager_id;
@ -266,6 +313,8 @@
{ label: '仓库名称', name: 'WarehouseName', width: 120, align: 'left' },
];
if (Type == '2') {
var collast = { label: "生产订单", name: "OrderNumber", width: 120, align: 'left' };
cols.push(collast);
var collast = { label: "单据类型", name: "EATTRIBUTE", width: 120, align: 'left' };
cols.push(collast);
var collast = { label: '套数', name: 'Sets', width: 50, align: 'left' };
@ -419,7 +468,13 @@
Area: $("#txt_Area").val(),
WHCode: $("#txt_WHCode").val(),
CusCode: $("#txt_CusCode").val(),
CusName: $("#txt_CusName").val()
CusName: $("#txt_CusName").val(),
AreaType: $("#selShow1").val(),
Status: $("#selShow2").val(),
Order: $("#txt_Order").val(),
Container: $("#txt_Container :checked").val(),
CreateDate: $("#txt_CreateDate").val(),
NeedDate: $("#txt_NeedDate").val()
}
$gridList.jqGrid('setGridParam', {
postData: { queryJson: JSON.stringify(queryJson) },
@ -707,7 +762,7 @@
</script>
<div class="topPanel" style="height:150px;">
<div class="topPanel" style="height:150px;" >
<div class="toolbar">
<div class="btn-group">
<a id="NF-Material" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnMaterial()"><i class="fa fa-pencil-square-o"></i>拣料</a>
@ -742,17 +797,40 @@
</select>
</div>
</td>
<td id="status1">
<label>&nbsp;&nbsp;&nbsp;状态:</label>
</td>
<td id="status2">
<div class="input-group">
<select id="selShow2" name="F_Target" class="form-control" style="width: 100px;">
<option value="1" selected="selected">未配料</option>
<option value="2" selected="selected">已配料</option>
<option value="3" selected="selected">已过账</option>
<option value="4" selected="selected">已取消</option>
<option value="5" selected="selected">全部</option>
</select>
</div>
</td>
<td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;单据号</label>:</td>
<td>
<div class="input-group">
<input id="txt_POCode" type="text" class="form-control" style="width: 150px;">
<input id="txt_POCode" type="text" class="form-control" style="width: 120px;">
</div>
</td>
<td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;区域</label>:</td>
<td>
<div class="input-group">
<input id="txt_Area" type="text" class="form-control" style="width: 150px;">
<input id="txt_Area" type="text" class="form-control" style="width: 120px;">
</div>
</td>
<td style="text-align:right;" id="order1"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;生产订单</label>:</td>
<td id="order2">
<div class="input-group">
<input id="txt_Order" type="text" class="form-control" style="width: 120px;">
</div>
</td>
</tr>
@ -760,28 +838,52 @@
<td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;仓库</label>:</td>
<td>
<div class="input-group">
<input id="txt_WHCode" type="text" class="form-control" style="width: 150px;">
<input id="txt_WHCode" type="text" class="form-control" style="width: 120px;">
</div>
</td>
<td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
<td>
<div class="input-group">
<input id="txt_InvCode" type="text" class="form-control" style="width: 150px;">
<input id="txt_InvCode" type="text" class="form-control" style="width: 120px;">
</div>
</td>
<td style="text-align:left;" class="type7" ><label class="lglabel" for="txt_POCode" >&nbsp;&nbsp;&nbsp;客户编码</label>:</td>
<td class="type7" >
<td style="text-align:left; " id="type7"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;客户编码</label>:</td>
<td id="type8">
<div class="input-group">
<input id="txt_CusCode" type="text" class="form-control" style="width: 150px; ">
</div>
</td>
<td style="text-align: right; " class="type7" ><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;客户名称</label>:</td>
<td class="type7" >
<td style="text-align: right; " id="type9"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;客户名称</label>:</td>
<td id="type10">
<div class="input-group">
<input id="txt_CusName" type="text" class="form-control" style="width: 120px;">
</div>
</td>
<td style="text-align: right; " id="date1"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;创建日期</label>:</td>
<td id="date2">
<div class="input-group">
<input type="text" name="PRODUCTDATE" id="txt_CreateDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
</div>
</td>
<td style="text-align: right; " id="date3"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;需求日期</label>:</td>
<td id="date4">
<div class="input-group">
<input id="txt_CusName" type="text" class="form-control" style="width: 150px;">
<input type="text" name="PRODUCTDATE" id="txt_NeedDate" class="form-control " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 120px;" />
</div>
</td>
<td>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否显示货柜单据:</label>
</td>
<td>
<div class="input-group" id="txt_Container">
<input type="radio" name="container" value="1" />&nbsp;是
<input type="radio" name="container" checked="checked" value="2" />&nbsp;否
</div>
</td>
@ -790,7 +892,11 @@
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
</span>
</td>
</tr>
@*<tr>
</tr>*@
</table>
</div>

Loading…
Cancel
Save