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

212 lines
6.9 KiB

3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <style>
  7. .gridPanel {
  8. width: 50%;
  9. float: left;
  10. }
  11. .gridPane2 {
  12. width: 50%;
  13. float: left;
  14. }
  15. </style>
  16. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  17. <script>
  18. $(document).ready(function () {
  19. $("input.cell").keyup(function (e) {
  20. switch (e.keyCode) {
  21. // up arrow
  22. case 40:
  23. $(this).parent()
  24. .parent()
  25. .next()
  26. .children("td")
  27. .children("input.cell[name="
  28. + $(this).attr("name") + "]")
  29. .focus();
  30. break;
  31. // down arrow
  32. case 38:
  33. $(this).parent()
  34. .parent()
  35. .prev()
  36. .children("td")
  37. .children("input.cell[name="
  38. + $(this).attr("name") + "]")
  39. .focus();
  40. break;
  41. }
  42. });
  43. });</script>
  44. <script>
  45. $(function () {
  46. gridList();
  47. gridList2();
  48. })
  49. function gridList() {
  50. var $gridList = $("#gridList");
  51. var queryJson = {
  52. InvCode: $("#txt_InvCode").val(),
  53. }
  54. $gridList.dataGrid({
  55. url: "/WMS/BasicSettings/GetICSInventoryInfo" + "?" + Math.random(),
  56. postData: { queryJson: JSON.stringify(queryJson) },
  57. height: $(window).height() - 130,
  58. width: $(window).width() - 300,
  59. colModel: [
  60. { label: "主键", name: "ID", hidden: true, key: true },
  61. { label: 'ID', name: 'ID', hidden: true },
  62. { label: '料品编码', name: 'InvCode', width: 120, align: 'left' },
  63. { label: '料品名称', name: 'InvName', width: 150, align: 'left' },
  64. ],
  65. shrinkToFit: false,//宽度自适应
  66. autoWidth:true,
  67. gridComplete: function () {
  68. },
  69. pager: "#gridPager",
  70. sortorder: "desc",
  71. sortname: 'InvCode ',
  72. viewrecords: true,
  73. multiselect: true,
  74. rowNum: 10000,
  75. });
  76. $("#btn_search").click(function () {
  77. var warehouse = $("#warehouse a.active").attr('data-value');
  78. var queryJson = {
  79. InvCode: $("#txt_InvCode").val(),
  80. }
  81. $gridList.jqGrid('setGridParam', {
  82. postData: { queryJson: JSON.stringify(queryJson) },
  83. }).trigger('reloadGrid');
  84. });
  85. }
  86. function gridList2() {
  87. var $gridList = $("#gridList2");
  88. var queryJson = {
  89. LocationCode: $("#txt_LocationCode").val(),
  90. }
  91. $gridList.dataGrid({
  92. url: "/WMS/BasicSettings/GetICSLocation" + "?" + Math.random(),
  93. postData: { queryJson: JSON.stringify(queryJson) },
  94. height: $(window).height() - 130,
  95. width: $(window).width() - 300,
  96. colModel: [
  97. { label: "主键", name: "ID", hidden: true, key: true },
  98. { label: 'ID', name: 'ID', hidden: true },
  99. { label: '库位代码', name: 'LocationCode', width: 120, align: 'left' },
  100. { label: '库位名称', name: 'LocationName', width: 150, align: 'left' },
  101. { label: '仓库唯一标识', name: 'WHID', width: 150, align: 'left' },
  102. ],
  103. shrinkToFit: false,//宽度自适应
  104. autoWidth: true,
  105. gridComplete: function () {
  106. },
  107. pager: "#gridPager2",
  108. sortorder: "desc",
  109. sortname: 'LocationCode ',
  110. viewrecords: true,
  111. multiselect: true,
  112. rowNum: 10000,
  113. });
  114. $("#btn_search").click(function () {
  115. var warehouse = $("#warehouse a.active").attr('data-value');
  116. var queryJson = {
  117. LocationCode: $("#txt_LocationCode").val(),
  118. }
  119. $gridList.jqGrid('setGridParam', {
  120. postData: { queryJson: JSON.stringify(queryJson) },
  121. }).trigger('reloadGrid');
  122. });
  123. }
  124. function submitForm() {
  125. var objArr = '';
  126. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  127. for (var i = 0; i < objList.length; i++) {
  128. var rowId = objList[i];
  129. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  130. objArr += "'" + rowData.InvCode + "',";
  131. }
  132. var objArr2 = '';
  133. var objList2 = $("#gridList2").jqGrid('getGridParam', 'selarrrow');
  134. for (var i = 0; i < objList2.length; i++) {
  135. var rowId2 = objList2[i];
  136. var rowData2 = $("#gridList2").jqGrid('getRowData', rowId2);
  137. objArr2 += "'" + rowData2.LocationCode + "',";
  138. }
  139. if (objArr == '') {
  140. $.modalAlert("请选择料品!");
  141. return;
  142. }
  143. if (objArr2 == '') {
  144. $.modalAlert("请选择库位!");
  145. return;
  146. }
  147. $.submitForm({
  148. url: "/WMS/BasicSettings/InsertICSInventoryLocation" + "?" + Math.random(),
  149. param: { keyValue: JSON.stringify(objArr), keyValue2: JSON.stringify(objArr2) },
  150. success: function () {
  151. $.currentWindow().$("#gridList").trigger("reloadGrid");
  152. }
  153. })
  154. }
  155. </script>
  156. <div class="topPanel" style="height:70px;">
  157. <div class="search">
  158. <table >
  159. <tr>
  160. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">料品编码</label>:</td>
  161. <td>
  162. <div class="input-group">
  163. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  164. </div>
  165. </td>
  166. <td style="width:560px;"></td>
  167. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">库位代码</label>:</td>
  168. <td>
  169. <div class="input-group">
  170. <input id="txt_LocationCode" type="text" class="form-control" style="width: 100px;">
  171. </div>
  172. </td>
  173. <td style="width:450px;"></td>
  174. <td>
  175. <span class="input-group-btn">
  176. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  177. </span>
  178. </td>
  179. </tr>
  180. </table>
  181. </div>
  182. </div>
  183. <div>
  184. <div class="gridPanel">
  185. <table id="gridList"></table>
  186. @*<div id="gridPager"></div>*@
  187. </div>
  188. <div class="gridPane2">
  189. <table id="gridList2"></table>
  190. @*<div id="gridPager2"></div>*@
  191. </div>
  192. </div>