|
|
@{ ViewBag.Title = "SeachInventory"; Layout = "~/Views/Shared/_Index.cshtml"; } <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" /> <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" /> <script src="~/Content/js/datepicker/WdatePicker.js"></script> <script src="~/Content/js/select2/select2.min.js"></script> <script> debugger; var ID = $.request("ID"); var Type = $.request("Type"); var TLZID = $.request("TLZID"); $(function(){ Init(); }) function Init() { document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid var invcode = $("#txt_Invcode").val(); $("#gridList").dataGrid({ url: "/WMS/WWProductionRAFMR/GetINV" + "?invcode=" + invcode + "&" + Math.random(), height: $(window).height() - 20, width: $(window).width() - 300, colModel: [ { label: '主键', name: 'ID', hidden: true, key: true }, { label: '子件ID', name: 'ZJID', hidden: true }, { label: '来源单据号', name: 'ApplyCode', width: 100, align: 'left' }, { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' }, { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, { label: '料品名称', name: 'INVNAME', width: 100, align: 'left' }, { label: '规格型号', name: 'InvStd', width: 100, align: 'left' }, { label: '单位', name: 'InvUnit', width: 100, align: 'left' }, { label: '数量', name: 'Quantity', hidden: true }, { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' }, { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' }, { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' }, { label: '已退数量', name: 'tuinum', width: 100, align: 'left' }, ], pager: "#gridPager", sortorder: "desc", sortname: 'InvCode', viewrecords: true, multiselect: true, gridComplete: function () { } }) };
function submitForm() { var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow'); if (rows.length != 1) { $.modalAlert("只能选择一条数据!"); return; } var rowdata = $("#gridList").jqGrid("getRowData", rows[0]); var obj = { ID: ID, TLZID:TLZID, ZJID: rowdata.ZJID, InvCode: rowdata.InvCode, INVNAME: rowdata.INVNAME, InvStd: rowdata.InvStd, InvUnit: rowdata.InvUnit, Quantity: rowdata.Quantity, Amount: rowdata.Amount, IssueNegQuantity: rowdata.IssueQuantity, ExtensionID: rowdata.ExtensionID, tuinum: rowdata.tuinum, } var obj1 = JSON.stringify(obj);
if (Type=='1') {
$.ajax({ url: "/WMS/WWProductionRAFMR/UpdateMOApplyNegTemp?json=" + obj1 + "&" + Math.random(), async: false, success: function (data) { $.currentWindow().$("#gridList").trigger("reloadGrid"); layer.msg(data.message); $.modalClose(); },
}); } else { $.ajax({ url: "/WMS/WWProductionRAFMR/AddMOApplyNegTemp?json=" + obj1 + "&" + Math.random(), async: false, success: function (data) { $.currentWindow().$("#gridList").trigger("reloadGrid"); layer.msg(data.message); $.modalClose(); },
}); }
};
function Close() { $.modalClose(); } function reloadData() {
}
</script> <div class="topPanel" style="height:50px"> <div class="search"> <table> <tr> <td> <label>料品编码:</label> </td> <td> <div class="input-group"> <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;"> </div> </td> <td> <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a> </td> </tr> <tr></tr> </table> </div> </div> <div class="gridPanel" id="gridPanel"> <table id="gridList"></table> <div id="gridPager"></div> </div>
|