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.

107 lines
3.6 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. WarehouseCode: $("#txt_WarehouseCode").val(),
  19. WarehouseName: $("#txt_WarehouseName").val(),
  20. }
  21. $gridList.dataGrid({
  22. url: "/DHAY/ICSCustomerSuppliedReturn/GetWHCodeList" + "?" + 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: 'WarehouseCode', width: 240, align: 'left' },
  29. { label: '仓库名称', name: 'WarehouseName', width: 240, align: 'left', hidden: true },
  30. ],
  31. sortname: 'WarehouseCode',
  32. shrinkToFit: true,//宽度自适应
  33. pager: "#gridPager",
  34. //sortname: 'ID',
  35. viewrecords: true,
  36. multiselect: true,
  37. rowNum: 200
  38. });
  39. $("#btn_search").click(function () {
  40. var queryJson = {
  41. WarehouseCode: $("#txt_WarehouseCode").val(),
  42. WarehouseName: $("#txt_WarehouseName").val(),
  43. }
  44. $gridList.jqGrid('setGridParam', {
  45. postData: { queryJson: JSON.stringify(queryJson) },
  46. }).trigger('reloadGrid');
  47. });
  48. }
  49. //提交
  50. function submitForm() {
  51. debugger;
  52. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  53. if (rows.length != 1) {
  54. $.modalAlertNew("WMS00079");
  55. return;
  56. }
  57. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  58. var obj = {
  59. WarehouseCode: rowdata.WarehouseCode,
  60. WarehouseName: rowdata.WarehouseName,
  61. }
  62. return obj;
  63. }
  64. function Close() {
  65. $.modalClose();
  66. }
  67. </script>
  68. <form id="form1">
  69. <div class="topPanel" style="height:50px">
  70. <div class="search">
  71. <table>
  72. <tr>
  73. <td style="text-align:right;padding: 0 5px 0 5px;">
  74. <label>仓库编码:</label>
  75. </td>
  76. <td>
  77. <div class="input-group">
  78. <input id="txt_WarehouseCode" type="text" class="form-control" placeholder="仓库编码" style="width: 100px;">
  79. </div>
  80. </td>
  81. <td style="text-align:right;padding: 0 5px 0 5px;">
  82. <label>仓库名称:</label>
  83. </td>
  84. <td>
  85. <div class="input-group">
  86. <input id="txt_WarehouseName" type="text" class="form-control" placeholder="仓库名称" style="width: 100px;">
  87. </div>
  88. </td>
  89. <td>
  90. <span class="input-group-btn" style="padding-left:10px;">
  91. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  92. </span>
  93. </td>
  94. </tr>
  95. </table>
  96. </div>
  97. </div>
  98. <div class="gridPanel">
  99. <table id="gridList"></table>
  100. <div id="gridPager"></div>
  101. </div>
  102. </form>