纽威
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.
 
 
 
 
 

228 lines
7.5 KiB

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
.gridPanel{
width:50%;
float:left;
}
.gridPane2{
width:50%;
float:left;
}
</style>
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
<script>
$(document).ready(function () {
$("input.cell").keyup(function (e) {
switch (e.keyCode) {
// up arrow
case 40:
$(this).parent()
.parent()
.next()
.children("td")
.children("input.cell[name="
+ $(this).attr("name") + "]")
.focus();
break;
// down arrow
case 38:
$(this).parent()
.parent()
.prev()
.children("td")
.children("input.cell[name="
+ $(this).attr("name") + "]")
.focus();
break;
}
});
});</script>
<script>
$(function () {
gridList();
gridList2();
})
function gridList() {
var $gridList = $("#gridList");
var queryJson = {
InvCode: $("#txt_InvCode").val(),
}
$gridList.dataGrid({
url: "/WMS/BasicSettings/GetICSInventoryInfo" + "?" + Math.random(),
postData: { queryJson: JSON.stringify(queryJson) },
height: $(window).height() - 200,
width: $(window).width() - 300,
colModel: [
{ label: "主键", name: "ID", hidden: true, key: true },
{ label: 'ID', name: 'ID', hidden: true },
{ label: '料品编码', name: 'InvCode', width: 120, align: 'left' },
{ label: '物料描述', name: 'InvName', width: 150, align: 'left' },
],
shrinkToFit: false,//宽度自适应
autoWidth:true,
gridComplete: function () {
},
pager: "#gridPager",
sortorder: "desc",
sortname: 'InvCode ',
viewrecords: true,
multiselect: true,
rowNum: 10000,
});
$("#btn_search").click(function () {
var warehouse = $("#warehouse a.active").attr('data-value');
var queryJson = {
InvCode: $("#txt_InvCode").val(),
}
$gridList.jqGrid('setGridParam', {
postData: { queryJson: JSON.stringify(queryJson) },
}).trigger('reloadGrid');
});
}
function gridList2() {
var $gridList = $("#gridList2");
var queryJson = {
WHCode: $("#txt_WHCode").val(),
}
$gridList.dataGrid({
url: "/WMS/BasicSettings/GetICSWarehouseInfo" + "?" + Math.random(),
postData: { queryJson: JSON.stringify(queryJson) },
height: $(window).height() - 200,
width: $(window).width() - 300,
colModel: [
{ label: "主键", name: "ID", hidden: true, key: true },
{ label: 'ID', name: 'ID', hidden: true },
{ label: '仓库代码', name: 'WarehouseCode', width: 120, align: 'left' },
{ label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
],
shrinkToFit: false,//宽度自适应
autoWidth: true,
gridComplete: function () {
},
pager: "#gridPager2",
sortorder: "desc",
sortname: 'WarehouseCode ',
viewrecords: true,
multiselect: true,
rowNum: 10000,
});
$("#btn_search").click(function () {
var warehouse = $("#warehouse a.active").attr('data-value');
var queryJson = {
WHCode: $("#txt_WHCode").val(),
}
$gridList.jqGrid('setGridParam', {
postData: { queryJson: JSON.stringify(queryJson) },
}).trigger('reloadGrid');
});
}
function btn_Delete() {
var objArr = '';
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
for (var i = 0; i < objList.length; i++) {
var rowId = objList[i];
var rowData = $("#gridList").jqGrid('getRowData', rowId);
objArr += "'" + rowData.BRGCode + "',";
}
if (objArr == '') {
$.modalAlertNew("WMS00001");
return;
}
$.deleteForm({
url: "/WMS/BasicSettings/DeleteICSBadReasonGroup" + "?" + Math.random(),
param: { keyValue: JSON.stringify(objArr) },
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
})
}
function submitForm() {
var objArr = '';
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
for (var i = 0; i < objList.length; i++) {
var rowId = objList[i];
var rowData = $("#gridList").jqGrid('getRowData', rowId);
objArr += "'" + rowData.InvCode + "',";
}
var objArr2 = '';
var objList2 = $("#gridList2").jqGrid('getGridParam', 'selarrrow');
for (var i = 0; i < objList2.length; i++) {
var rowId2 = objList2[i];
var rowData2 = $("#gridList2").jqGrid('getRowData', rowId2);
objArr2 += "'" + rowData2.WarehouseCode + "',";
}
if (objArr == '') {
$.modalAlertNew("WMS00040");
return;
}
if (objArr2 == '') {
$.modalAlertNew("WMS00041");
return;
}
$.submitForm({
url: "/WMS/BasicSettings/InsertICSInventoryBatchEnable" + "?" + Math.random(),
param: { keyValue: JSON.stringify(objArr), keyValue2: JSON.stringify(objArr2) },
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
})
}
</script>
<div class="topPanel" style="height:70px;">
<div class="search">
<table>
<tr>
<td style="text-align:right;"><label class="lglabel" for="txt_POCode">料品编码</label>:</td>
<td>
<div class="input-group">
<input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
</div>
</td>
<td style="width:560px;"></td>
<td style="text-align:right;"><label class="lglabel" for="txt_POCode">仓库代码</label>:</td>
<td>
<div class="input-group">
<input id="txt_WHCode" type="text" class="form-control" style="width: 100px;">
</div>
</td>
<td style="width:450px;"></td>
<td>
<span class="input-group-btn">
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
</span>
</td>
</tr>
</table>
</div>
</div>
<div>
<div class="gridPanel">
<table id="gridList"></table>
@*<div id="gridPager"></div>*@
</div>
<div class="gridPane2">
<table id="gridList2"></table>
@*<div id="gridPager2"></div>*@
</div>
</div>