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.
278 lines
12 KiB
278 lines
12 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
debugger;
|
|
|
|
|
|
var myDate = new Date;
|
|
var year = myDate.getFullYear(); //获取当前年
|
|
var mon = myDate.getMonth() + 1 < 10 ? "0" + (myDate.getMonth() + 1) : myDate.getMonth() + 1; //获取当前月
|
|
var date = myDate.getDate() + 1 < 10 ? "0" + myDate.getDate() : myDate.getDate(); //获取当前日
|
|
var MtimeFrom = year + "-" + mon + "-" + date;
|
|
var MtimeArrive = year + "-" + mon + "-" + date;
|
|
|
|
var _Clos = new Array();
|
|
var _Closs = new Array();
|
|
|
|
$(function () {
|
|
|
|
|
|
SetCols();
|
|
gridList();
|
|
|
|
});
|
|
|
|
function Selchange() {
|
|
document.getElementById("gridPanel").innerHTML = '<table id="gridList"></table> <div id="gridPager"></div>';//重置grid
|
|
gridList();
|
|
|
|
}
|
|
|
|
|
|
|
|
//动态加载列
|
|
function SetCols() {
|
|
$.ajax({
|
|
url: "/Print/SelectColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var cols = new Array();
|
|
//var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
//cols.push(collast);
|
|
var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品名称', name: 'InvName', width: 200, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '规格型号', name: 'InvStd', width: 200, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '仓库编码', name: 'WHCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '仓库名称', name: 'WHName', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '库位代码', name: 'LocationCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '杂发/杂收单号', name: 'TransCode', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '时间', name: 'MTIME', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
|
|
_Clos = cols;
|
|
}
|
|
});
|
|
}
|
|
|
|
function gridList() {
|
|
|
|
var Type = $("#selShow").val();
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
StartDate: $("#txt_StartDate").val(),
|
|
EndDate: $("#txt_EndDate").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
WHCode: $("#txt_WHCode").val(),
|
|
LocationCode: $("#txt_LocationCode").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/DHAY/ICSOtherInOut/GetList? " + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson), Type: Type },
|
|
height: $(window).height() - 150,
|
|
width: $(window).width() - 500,
|
|
colModel: [
|
|
/* { label: "主键", name: "ID", hidden: true, key: true },*/
|
|
{ label: "主键", name: "InvID", hidden: true},
|
|
{ label: '物料编码', name: 'InvCode', width: 120, align: 'left' },
|
|
{ label: '物料名称', name: "InvName", width: 200, align: "left"},
|
|
{ label: '仓库编码', name: 'WHCode', width: 150, align: 'left' },
|
|
{ label: '仓库名称', name: 'WHName', width: 200, align: 'left' },
|
|
{ label: '库位代码', name: 'LocationCode', width: 100, align: 'left' },
|
|
{ label: '批次号', name: 'BatchCode', width: 150, align: 'left' },
|
|
],
|
|
shrinkToFit: false,//宽度自适应
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
autoScroll: true,
|
|
sortname: 'InvCode',
|
|
sortorder: "desc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
subGrid: true,
|
|
// (1)开启子表格支持
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
debugger;
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
bindSubGrid(subgrid_id, rowid)
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
$("#btn_search").click(function () {
|
|
|
|
var queryJson = {
|
|
StartDate: $("#txt_StartDate").val(),
|
|
EndDate: $("#txt_EndDate").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
WHCode: $("#txt_WHCode").val(),
|
|
LocationCode: $("#txt_LocationCode").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
|
|
}
|
|
|
|
//子表
|
|
function bindSubGrid(subgrid_id, rowid) {
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var ID = $("#gridList").jqGrid('getRowData', rowid).InvID;
|
|
var WHCode = $("#gridList").jqGrid('getRowData', rowid).WHCode;
|
|
var BatchCode = $("#gridList").jqGrid('getRowData', rowid).BatchCode;
|
|
var LocationCode = $("#gridList").jqGrid('getRowData', rowid).LocationCode;
|
|
debugger;
|
|
var queryJson = {
|
|
StartDate: $("#txt_StartDate").val(),
|
|
EndDate: $("#txt_EndDate").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
WHCode: WHCode,
|
|
BatchCode: BatchCode,
|
|
LocationCode:LocationCode,
|
|
ID: ID
|
|
}
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var IssueCode = $("#gridList").jqGrid('getRowData', rowid).IssueCode;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/DHAY/ICSOtherInOut/GetDetails?ID=" + ID + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
colModel: _Clos,
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
sortname: 'InvCode',
|
|
shrinkToFit: true,//宽度自适应
|
|
//multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
});
|
|
}
|
|
|
|
function btn_ExportAll() {
|
|
debugger;
|
|
|
|
var queryData = "&StartDate=" + $("#txt_StartDate").val() +
|
|
"&EndDate=" + $("#txt_EndDate").val() +
|
|
"&InvCode=" + $("#txt_InvCode").val() +
|
|
"&WHCode=" + $("#txt_WHCode").val() +
|
|
"&LocationCode=" + $("#txt_LocationCode").val()
|
|
+ "&BatchCode=" + $("#txt_BatchCode").val();
|
|
$.download("/DHAY/ICSOtherInOut/StatementExportAll" + "?" + Math.random(), queryData, 'post');
|
|
}
|
|
|
|
|
|
|
|
|
|
function fullscreen() {
|
|
var docElm = document.documentElement;
|
|
if (docElm.requestFullscreen) {
|
|
docElm.requestFullscreen();
|
|
} else if (docElm.mozRequestFullScreen) {
|
|
docElm.mozRequestFullScreen();
|
|
} else if (docElm.webkitRequestFullScreen) {
|
|
docElm.webkitRequestFullScreen();
|
|
} else if (docElm.msRequestFullscreen) {
|
|
docElm.msRequestFullscreen();
|
|
}
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridWidth($(window).width());
|
|
}).trigger('resize');
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridHeight($(window).height());
|
|
}).trigger('resize');
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<div class="topPanel" style="height:60px;">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
<a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>
|
|
<a id="NF-ExportAll" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_ExportAll()"><i class="fa fa-download"></i>全部导出</a>
|
|
|
|
</div>
|
|
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_InvCode"> 料品编码</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_WHCode"> 仓库编码</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_WHCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_BatchCode"> 批次号</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_LocationCode"> 库位代码</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_LocationCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<th class="formTitle"> 开始时间:</th>
|
|
<td class="formValue">
|
|
<input type="text" name="txt_StartDate" id="txt_StartDate" class="form-control" style="width: 100px; height:22px" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="开始日期" />
|
|
</td>
|
|
<th class="formTitle"> 结束时间:</th>
|
|
<td class="formValue">
|
|
<input type="text" name="txt_EndDate" id="txt_EndDate" class="form-control" style="width: 100px; height: 22px " onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: txt_StartDate.value })" placeholder="结束日期" />
|
|
</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 class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|