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.

98 lines
3.1 KiB

1 year ago
1 year 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?v=20120420" 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: 'EATTRIBUTE1', width: 150, align: 'left' },
  29. { label: '是否开启辅计量', name: 'AmountEnable', hidden: true, },
  30. ],
  31. pager: "#gridPager",
  32. sortorder: "desc",
  33. sortname: 'InvCode',
  34. viewrecords: true,
  35. multiselect: true,
  36. gridComplete: function () {
  37. },
  38. beforeSelectRow: function (rowid, e) {
  39. $("#gridList").jqGrid('resetSelection');
  40. return (true);
  41. },
  42. })
  43. };
  44. function submitForm() {
  45. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  46. if (rows.length != 1) {
  47. $.modalAlertNew("WMS00079");
  48. return;
  49. }
  50. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  51. var obj = {
  52. InvCode: rowdata.InvCode,
  53. EATTRIBUTE1: rowdata.EATTRIBUTE1,
  54. AmountEnable: rowdata.AmountEnable,
  55. }
  56. return obj;
  57. }
  58. function Close() {
  59. $.modalClose();
  60. }
  61. </script>
  62. <div class="topPanel" style="height:50px">
  63. <div class="search">
  64. <table>
  65. <tr>
  66. <td>
  67. <label>料品编码:</label>
  68. </td>
  69. <td>
  70. <div class="input-group">
  71. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  72. </div>
  73. </td>
  74. <td>
  75. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  76. </td>
  77. </tr>
  78. <tr></tr>
  79. </table>
  80. </div>
  81. </div>
  82. <div class="gridPanel" id="gridPanel">
  83. <table id="gridList"></table>
  84. <div id="gridPager"></div>
  85. </div>