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.

109 lines
3.7 KiB

  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <style>
  6. .td {
  7. padding: 0 5px 0 5px;
  8. }
  9. </style>
  10. <script>
  11. var WorkPoints = $.request("WorkPoint");
  12. $(function () {
  13. gridList();
  14. })
  15. function gridList() {
  16. var $gridList = $("#gridList");
  17. var queryJson = {
  18. INVCODE: $("#txt_InvCode").val(),
  19. INVNAME: $("#txt_InvName").val(),
  20. }
  21. $gridList.dataGrid({
  22. url: "/DHAY/ICSCustomerSuppliedReturn/GetItemList" + "?" + Math.random(),
  23. postData: { queryJson: JSON.stringify(queryJson), WorkPoint: JSON.stringify(WorkPoints) },
  24. height: $(window).height() - 120,
  25. width: $(window).width() - 180,
  26. colModel: [
  27. { label: "主键", name: "ID", hidden: true, key: true },
  28. { label: '物料编码', name: 'INVCODE', width: 240, align: 'left' },
  29. { label: '规格型号', name: 'InvStd', width: 240, align: 'left', hidden: true },
  30. { label: '物料名称', name: 'INVNAME', width: 150, align: 'left', hidden: true },
  31. ],
  32. sortname: 'INVCODE,INVNAME',
  33. shrinkToFit: true,//宽度自适应
  34. pager: "#gridPager",
  35. //sortname: 'ID',
  36. viewrecords: true,
  37. multiselect: true,
  38. rowNum: 200
  39. });
  40. $("#btn_search").click(function () {
  41. var queryJson = {
  42. INVCODE: $("#txt_InvCode").val(),
  43. INVNAME: $("#txt_InvName").val(),
  44. }
  45. $gridList.jqGrid('setGridParam', {
  46. postData: { queryJson: JSON.stringify(queryJson) },
  47. }).trigger('reloadGrid');
  48. });
  49. }
  50. //提交
  51. function submitForm() {
  52. debugger;
  53. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  54. if (rows.length != 1) {
  55. $.modalAlertNew("WMS00079");
  56. return;
  57. }
  58. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  59. var obj = {
  60. INVCODE: rowdata.INVCODE,
  61. InvStd: rowdata.InvStd,
  62. INVNAME: rowdata.INVNAME,
  63. }
  64. return obj;
  65. }
  66. function Close() {
  67. $.modalClose();
  68. }
  69. </script>
  70. <form id="form1">
  71. <div class="topPanel" style="height:50px">
  72. <div class="search">
  73. <table>
  74. <tr>
  75. <td style="text-align:right;padding: 0 5px 0 5px;">
  76. <label>物料编码:</label>
  77. </td>
  78. <td>
  79. <div class="input-group">
  80. <input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 100px;">
  81. </div>
  82. </td>
  83. <td style="text-align:right;padding: 0 5px 0 5px;">
  84. <label>物料名称:</label>
  85. </td>
  86. <td>
  87. <div class="input-group">
  88. <input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 100px;">
  89. </div>
  90. </td>
  91. <td>
  92. <span class="input-group-btn" style="padding-left:10px;">
  93. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  94. </span>
  95. </td>
  96. </tr>
  97. </table>
  98. </div>
  99. </div>
  100. <div class="gridPanel">
  101. <table id="gridList"></table>
  102. <div id="gridPager"></div>
  103. </div>
  104. </form>