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

91 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 BatchCode = $("#txt_BatchCode").val();
  18. $("#gridList").dataGrid({
  19. url: "/WMS/ICSMTDOC/GetCode" + "?BatchCode=" + BatchCode + "&" + Math.random(),
  20. height: $(window).height() - 20,
  21. width: $(window).width() - 300,
  22. colModel: [
  23. { label: '主键', name: 'ID', hidden: true, key: true },
  24. { label: '自由项ID', name: 'ZYID', hidden: true },
  25. { label: '项目号', name: 'ProjectCode', width: 150, align: 'left' },
  26. { label: '批次', name: 'BatchCode', width: 150, align: 'left' },
  27. { label: '版本', name: 'Version', width: 100, align: 'left' },
  28. { label: '厂牌', name: 'Brand', width: 150, align: 'left' },
  29. ],
  30. pager: "#gridPager",
  31. sortorder: "desc",
  32. sortname: 'ZYID',
  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. BatchCode: rowdata.BatchCode,
  48. ZYID: rowdata.ZYID,
  49. }
  50. return obj;
  51. }
  52. function Close() {
  53. $.modalClose();
  54. }
  55. </script>
  56. <div class="topPanel" style="height:50px">
  57. <div class="search">
  58. <table>
  59. <tr>
  60. <td>
  61. <label>批次号:</label>
  62. </td>
  63. <td>
  64. <div class="input-group">
  65. <input id="txt_BatchCode" type="text" class="form-control" placeholder="批次号" style="width: 120px;">
  66. </div>
  67. </td>
  68. <td>
  69. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  70. </td>
  71. </tr>
  72. <tr></tr>
  73. </table>
  74. </div>
  75. </div>
  76. <div class="gridPanel" id="gridPanel">
  77. <table id="gridList"></table>
  78. <div id="gridPager"></div>
  79. </div>