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.

130 lines
5.0 KiB

3 weeks 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. var WHCode = $.request("WHCode");
  13. var _Clos = new Array();
  14. $(function () {
  15. SetCols();
  16. Init();
  17. })
  18. function SetCols() {
  19. $.ajax({
  20. url: "/Print/SelectColumnName?" + Math.random(),
  21. dataType: "json",
  22. async: false,
  23. success: function (data) {
  24. var cols = new Array();
  25. var collast = { label: '主键', name: 'ID', hidden: true, key: true };
  26. cols.push(collast);
  27. //var collast = { label: '来源单据号', name: 'PoCode', width: 100, align: 'left' };
  28. //cols.push(collast);
  29. //var collast = { label: '来源单据行号', name: 'Sequence', width: 100, align: 'left' };
  30. //cols.push(collast);
  31. var collast = { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' };
  32. cols.push(collast);
  33. var collast = { label: '仓库名称', name: 'WarehouseName', width: 100, align: 'left' };
  34. cols.push(collast);
  35. var collast = { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' };
  36. cols.push(collast);
  37. var collast = { label: '库位名称', name: 'LocationName', width: 100, align: 'left' };
  38. cols.push(collast);
  39. _Clos = cols;
  40. }
  41. });
  42. }
  43. function Init() {
  44. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  45. $("#gridList").dataGrid({
  46. url: "/PNWMS/Blitem/GetLocation" + "?WHCode=" + WHCode + "&" + Math.random(),
  47. height: $(window).height() - 20,
  48. width: $(window).width() - 300,
  49. colModel: _Clos,
  50. //colModel: [
  51. // { label: '主键', name: 'ID', hidden: true, key: true },
  52. // { label: '工单子件ID', name: 'ZJID', hidden: true },
  53. // { label: '来源单据号', name: 'MOCode', width: 100, align: 'left' },
  54. // { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' },
  55. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  56. // { label: '料品名称', name: 'INVNAME', width: 100, align: 'left' },
  57. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  58. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  59. // { label: '数量', name: 'IssueQuantity', width: 100, align: 'left' },
  60. // { label: '数量2', name: 'Quantity', hidden: true },
  61. // { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' },
  62. // ],
  63. pager: "#gridPager",
  64. sortorder: "desc",
  65. sortname: 'LocationCode',
  66. rowNum: 10000,
  67. viewrecords: true,
  68. multiselect: true,
  69. gridComplete: function () {
  70. }
  71. })
  72. };
  73. function submitForm() {
  74. debugger;
  75. var objs = [];
  76. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  77. if (rows.length > 1) {
  78. $.modalAlert("只能选择一个库位!");
  79. return;
  80. }
  81. if (rows.length == 0) {
  82. $.modalAlert("请选择库位!");
  83. return;
  84. }
  85. // var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  86. for (var i = 0; i < rows.length; i++) {
  87. var obj = {
  88. ID: $("#gridList").jqGrid('getRowData', rows[i]).ID,
  89. //PoCode: $("#gridList").jqGrid('getRowData', rows[i]).PoCode,
  90. WarehouseCode: $("#gridList").jqGrid('getRowData', rows[i]).WarehouseCode,
  91. WarehouseName: $("#gridList").jqGrid('getRowData', rows[i]).WarehouseName,
  92. LocationCode: $("#gridList").jqGrid('getRowData', rows[i]).LocationCode,
  93. LocationName: $("#gridList").jqGrid('getRowData', rows[i]).LocationName,
  94. }
  95. objs.push(obj);
  96. }
  97. return objs;
  98. };
  99. function guid() {
  100. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  101. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  102. return v.toString(16);
  103. });
  104. }
  105. function Close() {
  106. $.modalClose();
  107. }
  108. function reloadData() {
  109. }
  110. </script>
  111. <div class="topPanel" style="height:50px">
  112. </div>
  113. <div class="gridPanel" id="gridPanel">
  114. <table id="gridList"></table>
  115. <div id="gridPager"></div>
  116. </div>