7 changed files with 714 additions and 6 deletions
-
182WMS-BS/NFine.Application/WMS/BasicSettingsApp.cs
-
119WMS-BS/NFine.Web/Areas/WMS/Controllers/BasicSettingsController.cs
-
15WMS-BS/NFine.Web/Areas/WMS/Views/BasicSettings/ICSContainer.cshtml
-
192WMS-BS/NFine.Web/Areas/WMS/Views/BasicSettings/ICSContainerBinding.cshtml
-
19WMS-BS/NFine.Web/Areas/WMS/Views/BasicSettings/ICSContainerLot.cshtml
-
191WMS-BS/NFine.Web/Areas/WMS/Views/BasicSettings/ICSContainerLotBinding.cshtml
-
2WMS-BS/NFine.Web/NFine.Web.csproj
@ -0,0 +1,192 @@ |
|||
|
|||
@{ |
|||
ViewBag.Title = "Index"; |
|||
Layout = "~/Views/Shared/_Index.cshtml"; |
|||
} |
|||
|
|||
|
|||
<script> |
|||
|
|||
|
|||
$(function () { |
|||
|
|||
gridList(); |
|||
SireCodeBinding(); |
|||
CodeBinding(); |
|||
}); |
|||
|
|||
|
|||
function gridList() { |
|||
|
|||
var $gridList = $("#gridList"); |
|||
$gridList.dataGrid({ |
|||
url: "/WMS/BasicSettings/GetSendContainer?" + Math.random(), |
|||
height: $(window).height() -50, |
|||
width: $(window).width() - 400, |
|||
cellEdit: true, |
|||
cellsubmit: "clientArray", |
|||
colModel: [ |
|||
{ label: "主键", name: "ID", hidden: true, key: true }, |
|||
{ |
|||
label: '删除', width: 100, align: 'left', |
|||
formatter: btnLook |
|||
}, |
|||
{ label: '父容器唯一标识', name: 'ContainerID', width: 120, align: 'left' }, |
|||
{ label: '容器代码', name: 'ContainerCode', width: 150, align: 'left' }, |
|||
{ label: '容器名称', name: 'ContainerName', width: 100, align: 'left' }, |
|||
{ label: '备注', name: 'Memo', width: 200, align: 'left' }, |
|||
{ label: '操作人', name: 'MUSER', width: 200, align: 'left' }, |
|||
{ label: '操作人姓名', name: 'MUSERName', width: 200, align: 'left' }, |
|||
{ label: '操作时间', name: 'MTIME', width: 200, align: 'left' }, |
|||
{ label: '站点', name: 'WorkPoint', width: 200, align: 'left' }, |
|||
], |
|||
afterSaveCell: function (rowid, cellname, value) { |
|||
if (cellname === 'ProjectCN') { |
|||
$gridList.jqGrid("setCell", rowid, 'ProjectID', value); |
|||
} |
|||
}, |
|||
width: "100%", |
|||
|
|||
autowidth: true, |
|||
rownumbers: true, |
|||
viewrecords: true, |
|||
}); |
|||
} |
|||
|
|||
function btnLook(cellvalue, options, rowObject) { |
|||
return cellvalue = "<a class=\"btn btn-primary dropdown-text\" onclick=\"UpLoadClick('" + rowObject.ID + "')\">删除</a>"; |
|||
} |
|||
|
|||
function UpLoadClick(ID) { |
|||
$("#gridList").delRowData(ID); |
|||
} |
|||
|
|||
function SireCodeBinding() { |
|||
$("#SireCode").keydown(function (e) { |
|||
var curKey = e.which; |
|||
debugger; |
|||
if (curKey == 13) { |
|||
var SireCode = $("#SireCode").val();//需绑定容器 |
|||
$.ajax({ |
|||
url: "/WMS/BasicSettings/GetBindContainerID?SireCode=" + SireCode, |
|||
dataType: "json", |
|||
async: false, |
|||
success: function (data) { |
|||
debugger; |
|||
if (data == "" || data == null) { |
|||
$.modalAlert("未查询到该容器信息!"); |
|||
return; |
|||
} |
|||
$("#SireID").val(data.rows[0].ID); |
|||
$("#Code").focus(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
function CodeBinding() { |
|||
$("#Code").keydown(function (e) { |
|||
var curKey = e.which; |
|||
debugger; |
|||
if (curKey == 13) { |
|||
var Code = $("#Code").val();//需绑定容器 |
|||
$.ajax({ |
|||
url: "/WMS/BasicSettings/GetContainerInfo?Code=" + Code, |
|||
dataType: "json", |
|||
async: false, |
|||
success: function (data) { |
|||
debugger; |
|||
if (data == "" || data == null) { |
|||
$.modalAlert("未查询到该容器信息!"); |
|||
return; |
|||
} |
|||
//最后一行新增数据 |
|||
var obj = { |
|||
ID: data.rows[0].ID, |
|||
ContainerID: data.rows[0].ContainerID, |
|||
ContainerCode: data.rows[0].ContainerCode, |
|||
ContainerName: data.rows[0].ContainerName, |
|||
Memo: data.rows[0].Memo, |
|||
MUSER: data.rows[0].MUSER, |
|||
MUSERName: data.rows[0].MUSERName, |
|||
MTIME: data.rows[0].MTIME, |
|||
WorkPoint: data.rows[0].WorkPoint, |
|||
}; |
|||
$("#gridList").jqGrid('addRowData', obj.ID, obj, 'first'); |
|||
$(".unwritten").hide(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
|
|||
function submitForm() { |
|||
debugger; |
|||
var SireID = $("#SireID").val(); |
|||
var ICSMTDOC = []; |
|||
var obj_Item1 = $("#gridList"); |
|||
var rowIds_Item1 = obj_Item1.getDataIDs(); |
|||
if (rowIds_Item1.length > 0) { |
|||
for (var i = 0; i < rowIds_Item1.length; i++) { |
|||
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]); |
|||
var obj = { |
|||
ID: RowData_Item1.ID, |
|||
ContainerCode: RowData_Item1.ContainerCode, |
|||
}; |
|||
ICSMTDOC.push(obj); |
|||
} |
|||
|
|||
} |
|||
debugger; |
|||
$.modalConfirm("确定绑定吗?", function (r) { |
|||
if (r) { |
|||
$.submitForm({ |
|||
url: "/WMS/BasicSettings/BindingContainerID?SireID=" + SireID + "&" + Math.random(), |
|||
param: { ICSMTDOC: JSON.stringify(ICSMTDOC) }, |
|||
success: function () { |
|||
$.currentWindow().$("#gridList").trigger("reloadGrid"); |
|||
} |
|||
}) |
|||
} |
|||
}); |
|||
|
|||
|
|||
} |
|||
|
|||
</script> |
|||
|
|||
<form id="form1"> |
|||
|
|||
<div style="padding-top: 20px; margin-right: 20px;"> |
|||
<table class="form"> |
|||
<tr> |
|||
<th class="formTitle">父容器:</th> |
|||
<td class="formValue"> |
|||
<input id="SireCode" type="text" class="form-control" style="width: 300px;" οnkeydοwn="SireCodeBinding()"/> |
|||
<input id="SireID" type="text" class="form-control" style="display:none" οnkeydοwn="SireCodeBinding()" /> |
|||
</td> |
|||
<th class="formTitle">需绑定容器:</th> |
|||
<td class="formValue"> |
|||
<input id="Code" type="text" class="form-control" style="width: 300px;" οnkeydοwn="CodeBinding()" /> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</form> |
|||
<!--色牢度--> |
|||
<div class="gridPanel" style="width: 100% "> |
|||
<div class="ibox-title"> |
|||
子表 |
|||
</div> |
|||
<div class="gridPanel"> |
|||
<table id="gridList"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,191 @@ |
|||
|
|||
@{ |
|||
ViewBag.Title = "Index"; |
|||
Layout = "~/Views/Shared/_Index.cshtml"; |
|||
} |
|||
|
|||
|
|||
<script> |
|||
|
|||
|
|||
$(function () { |
|||
|
|||
gridList(); |
|||
SireCodeBinding(); |
|||
LotNoBinding(); |
|||
}); |
|||
|
|||
|
|||
function gridList() { |
|||
|
|||
var $gridList = $("#gridList"); |
|||
$gridList.dataGrid({ |
|||
url: "/WMS/BasicSettings/GetSendContainerLot?" + Math.random(), |
|||
height: $(window).height() -50, |
|||
width: $(window).width() - 400, |
|||
cellEdit: true, |
|||
cellsubmit: "clientArray", |
|||
colModel: [ |
|||
{ label: "主键", name: "ID", hidden: true, key: true }, |
|||
{ |
|||
label: '删除', width: 100, align: 'left', |
|||
formatter: btnLook |
|||
}, |
|||
{ label: '条码', name: 'LotNo', width: 120, align: 'left' }, |
|||
{ label: '料品编码', name: 'InvCode', width: 150, align: 'left' }, |
|||
{ label: '料品名称', name: 'InvName', width: 100, align: 'left' }, |
|||
{ label: '规格型号', name: 'InvStd', width: 200, align: 'left' }, |
|||
{ label: '单位', name: 'InvUnit', width: 200, align: 'left' }, |
|||
{ label: '生产日期', name: 'ProductDate', width: 200, align: 'left' }, |
|||
{ label: '数量', name: 'Quantity', width: 200, align: 'left' }, |
|||
], |
|||
afterSaveCell: function (rowid, cellname, value) { |
|||
if (cellname === 'ProjectCN') { |
|||
$gridList.jqGrid("setCell", rowid, 'ProjectID', value); |
|||
} |
|||
}, |
|||
width: "100%", |
|||
|
|||
autowidth: true, |
|||
rownumbers: true, |
|||
viewrecords: true, |
|||
}); |
|||
} |
|||
|
|||
function btnLook(cellvalue, options, rowObject) { |
|||
return cellvalue = "<a class=\"btn btn-primary dropdown-text\" onclick=\"UpLoadClick('" + rowObject.ID + "')\">删除</a>"; |
|||
} |
|||
|
|||
function UpLoadClick(ID) { |
|||
$("#gridList").delRowData(ID); |
|||
} |
|||
|
|||
function SireCodeBinding() { |
|||
$("#SireCode").keydown(function (e) { |
|||
var curKey = e.which; |
|||
debugger; |
|||
if (curKey == 13) { |
|||
var SireCode = $("#SireCode").val();//需绑定容器 |
|||
$.ajax({ |
|||
url: "/WMS/BasicSettings/GetBindContainerID?SireCode=" + SireCode, |
|||
dataType: "json", |
|||
async: false, |
|||
success: function (data) { |
|||
debugger; |
|||
if (data == "" || data == null) { |
|||
$.modalAlert("未查询到该容器信息!"); |
|||
return; |
|||
} |
|||
$("#SireID").val(data.rows[0].ID); |
|||
$("#LotNo").focus(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
function LotNoBinding() { |
|||
$("#LotNo").keydown(function (e) { |
|||
var curKey = e.which; |
|||
debugger; |
|||
if (curKey == 13) { |
|||
var LotNo = $("#LotNo").val();//需绑定容器 |
|||
$.ajax({ |
|||
url: "/WMS/BasicSettings/GetContainerLotInfo?LotNo=" + LotNo, |
|||
dataType: "json", |
|||
async: false, |
|||
success: function (data) { |
|||
debugger; |
|||
if (data == "" || data == null) { |
|||
$.modalAlert("未查询到该容器信息!"); |
|||
return; |
|||
} |
|||
//最后一行新增数据 |
|||
var obj = { |
|||
ID: data.rows[0].ID, |
|||
LotNo: data.rows[0].LotNo, |
|||
InvCode: data.rows[0].InvCode, |
|||
InvName: data.rows[0].InvName, |
|||
InvStd: data.rows[0].InvStd, |
|||
InvUnit: data.rows[0].InvUnit, |
|||
ProductDate: data.rows[0].ProductDate, |
|||
Quantity: data.rows[0].Quantity, |
|||
}; |
|||
$("#gridList").jqGrid('addRowData', obj.ID, obj, 'first'); |
|||
$(".unwritten").hide(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
|
|||
function submitForm() { |
|||
debugger; |
|||
var SireID = $("#SireID").val(); |
|||
var SireCode = $("#SireCode").val(); |
|||
var ICSMTDOC = []; |
|||
var obj_Item1 = $("#gridList"); |
|||
var rowIds_Item1 = obj_Item1.getDataIDs(); |
|||
if (rowIds_Item1.length > 0) { |
|||
for (var i = 0; i < rowIds_Item1.length; i++) { |
|||
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]); |
|||
var obj = { |
|||
LotNo: RowData_Item1.LotNo, |
|||
}; |
|||
ICSMTDOC.push(obj); |
|||
} |
|||
|
|||
} |
|||
debugger; |
|||
$.modalConfirm("确定绑定吗?", function (r) { |
|||
if (r) { |
|||
$.submitForm({ |
|||
url: "/WMS/BasicSettings/BindingContainerLotID?SireID=" + SireID + "&SireCode=" + SireCode + "&" + Math.random(), |
|||
param: { ICSMTDOC: JSON.stringify(ICSMTDOC) }, |
|||
success: function () { |
|||
$.currentWindow().$("#gridList").trigger("reloadGrid"); |
|||
} |
|||
}) |
|||
} |
|||
}); |
|||
|
|||
|
|||
} |
|||
|
|||
</script> |
|||
|
|||
<form id="form1"> |
|||
|
|||
<div style="padding-top: 20px; margin-right: 20px;"> |
|||
<table class="form"> |
|||
<tr> |
|||
<th class="formTitle">容器:</th> |
|||
<td class="formValue"> |
|||
<input id="SireCode" type="text" class="form-control" style="width: 300px;" οnkeydοwn="SireCodeBinding()" /> |
|||
<input id="SireID" type="text" class="form-control" /> |
|||
</td> |
|||
<th class="formTitle">条码:</th> |
|||
<td class="formValue"> |
|||
<input id="LotNo" type="text" class="form-control" style="width: 300px;" οnkeydοwn="LotNoBinding()" /> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</form> |
|||
<!--色牢度--> |
|||
<div class="gridPanel" style="width: 100% "> |
|||
<div class="ibox-title"> |
|||
子表 |
|||
</div> |
|||
<div class="gridPanel"> |
|||
<table id="gridList"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
|
|||
|
Reference in new issue
xxxxxxxxxx