You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
5.4 KiB
149 lines
5.4 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<style>
|
|
.td {
|
|
padding: 0 5px 0 5px;
|
|
}
|
|
</style>
|
|
<script>
|
|
var WorkPoints = $.request("WorkPoint");
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
|
|
function guid() {
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
return v.toString(16);
|
|
});
|
|
}
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
INVCODE: $("#txt_InvCode").val(),
|
|
INVNAME: $("#txt_InvName").val(),
|
|
MOCode: $("#txt_MOCode").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/DHAY/ICSMOIssue/GetItemList" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson), WorkPoint: JSON.stringify(WorkPoints) },
|
|
height: $(window).height() - 120,
|
|
width: $(window).width() - 180,
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '生产订单号', name: 'MOCode', width: 150, align: 'left' },
|
|
{ label: '物料编码', name: 'INVCODE', width: 150, align: 'left' },
|
|
{ label: '规格型号', name: 'InvStd', width: 200, align: 'left'},
|
|
{ label: '物料名称', name: 'INVNAME', width: 100, align: 'left' },
|
|
//{ label: '可用数量', name: 'Quantity', width: 100, align: 'left' },
|
|
|
|
],
|
|
sortname: 'INVCODE,INVNAME',
|
|
shrinkToFit: true,//宽度自适应
|
|
pager: "#gridPager",
|
|
//sortname: 'ID',
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
rowNum: 200
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var queryJson = {
|
|
INVCODE: $("#txt_InvCode").val(),
|
|
INVNAME: $("#txt_InvName").val(),
|
|
MOCode: $("#txt_MOCode").val(),
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
//提交
|
|
function submitForm() {
|
|
debugger;
|
|
var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
if (rows.length < 1) {
|
|
$.modalAlertNew("WMS00079");
|
|
return;
|
|
}
|
|
var objs = [];
|
|
for (var i = 0; i < rows.length; i++) {
|
|
|
|
var obj = {
|
|
ID: guid(),
|
|
InvCode: $("#gridList").jqGrid('getRowData', rows[i]).INVCODE,
|
|
MOCode: $("#gridList").jqGrid('getRowData', rows[i]).MOCode,
|
|
InvStd: $("#gridList").jqGrid('getRowData', rows[i]).InvStd,
|
|
INVNAME: $("#gridList").jqGrid('getRowData', rows[i]).INVNAME,
|
|
Quantity: $("#gridList").jqGrid('getRowData', rows[i]).Quantity
|
|
}
|
|
objs.push(obj);
|
|
}
|
|
return objs;
|
|
//var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
//if (rows.length != 1) {
|
|
// $.modalAlertNew("WMS00079");
|
|
// return;
|
|
//}
|
|
//var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
|
|
|
|
//var obj = {
|
|
// MOCode: rowdata.MOCode,
|
|
// INVCODE: rowdata.INVCODE,
|
|
// InvStd: rowdata.InvStd,
|
|
// INVNAME: rowdata.INVNAME,
|
|
// Quantity: rowdata.Quantity,
|
|
//}
|
|
//return obj;
|
|
}
|
|
|
|
function Close() {
|
|
$.modalClose();
|
|
}
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div class="topPanel" style="height:50px">
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>生产订单号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_MOCode" type="text" class="form-control" placeholder="生产订单号" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>物料编码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>物料名称:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="input-group-btn" style="padding-left:10px;">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|
|
</form>
|