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

90 lines
2.8 KiB

3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "SeachInventory";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" />
  8. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  9. <script src="~/Content/js/select2/select2.min.js"></script>
  10. <script>
  11. debugger;
  12. $(function(){
  13. Init();
  14. })
  15. function Init() {
  16. document.getElementById("gridPanel").innerHTML = '<table id="gridList"></table><div id="gridPager"></div> ';//重置grid
  17. var Invcode = $("#txt_Invcode").val();
  18. $("#gridList").dataGrid({
  19. url: "/WMS/ICSMTDOC/GetInvcode" + "?Invcode=" + Invcode + "&" + Math.random(),
  20. height: $(window).height() - 20,
  21. width: $(window).width() - 300,
  22. colModel: [
  23. { label: '主键', name: 'ID', hidden: true, key: true },
  24. { label: '料品编码', name: 'InvCode', width: 150, align: 'left' },
  25. { label: '料品名称', name: 'InvName', width: 150, align: 'left' },
  26. { label: '规格型号', name: 'InvStd', width: 150, align: 'left' },
  27. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  28. { label: '料品描述', name: 'InvDesc', width: 150, align: 'left' },
  29. ],
  30. pager: "#gridPager",
  31. sortorder: "desc",
  32. sortname: 'InvCode',
  33. viewrecords: true,
  34. multiselect: true,
  35. gridComplete: function () {
  36. }
  37. })
  38. };
  39. function submitForm() {
  40. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  41. if (rows.length != 1) {
  42. $.modalAlert("只能选择一条数据!");
  43. return;
  44. }
  45. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  46. var obj = {
  47. InvCode: rowdata.InvCode,
  48. }
  49. return obj;
  50. }
  51. function Close() {
  52. $.modalClose();
  53. }
  54. </script>
  55. <div class="topPanel" style="height:50px">
  56. <div class="search">
  57. <table>
  58. <tr>
  59. <td>
  60. <label>料品编码:</label>
  61. </td>
  62. <td>
  63. <div class="input-group">
  64. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  65. </div>
  66. </td>
  67. <td>
  68. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  69. </td>
  70. </tr>
  71. <tr></tr>
  72. </table>
  73. </div>
  74. </div>
  75. <div class="gridPanel" id="gridPanel">
  76. <table id="gridList"></table>
  77. <div id="gridPager"></div>
  78. </div>