|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } <style> .td { padding: 0 5px 0 5px; } </style> <script> var WorkPoints = $.request("WorkPoint"); $(function () { gridList(); })
function gridList() { var $gridList = $("#gridList"); var queryJson = { INVCODE: $("#txt_InvCode").val(), INVNAME: $("#txt_InvName").val(), } $gridList.dataGrid({ url: "/DHAY/ICSCustomerSuppliedReturn/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: 'INVCODE', width: 240, align: 'left' }, { label: '规格型号', name: 'InvStd', width: 240, align: 'left', hidden: true }, { label: '物料名称', name: 'INVNAME', width: 150, align: 'left', hidden: true }, ], 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(), } $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 rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
var obj = { INVCODE: rowdata.INVCODE, InvStd: rowdata.InvStd, INVNAME: rowdata.INVNAME, } 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_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>
|