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

238 lines
8.2 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() - 200,
  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. subGrid: false, // (1)开启子表格支持
  76. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  77. debugger;
  78. $("#gridList").jqGrid("setSelection", rowid, false);
  79. bindSubGrid(subgrid_id, rowid)
  80. }
  81. });
  82. $("#btn_search").click(function () {
  83. var warehouse = $("#warehouse a.active").attr('data-value');
  84. var queryJson = {
  85. InvCode: $("#txt_InvCode").val(),
  86. }
  87. $gridList.jqGrid('setGridParam', {
  88. postData: { queryJson: JSON.stringify(queryJson) },
  89. }).trigger('reloadGrid');
  90. });
  91. }
  92. function gridList2() {
  93. var $gridList = $("#gridList2");
  94. var queryJson = {
  95. WHCode: $("#txt_WHCode").val(),
  96. }
  97. $gridList.dataGrid({
  98. url: "/WMS/BasicSettings/GetICSWarehouseInfo" + "?" + Math.random(),
  99. postData: { queryJson: JSON.stringify(queryJson) },
  100. height: $(window).height() - 200,
  101. width: $(window).width() - 300,
  102. colModel: [
  103. { label: "主键", name: "ID", hidden: true, key: true },
  104. { label: 'ID', name: 'ID', hidden: true },
  105. { label: '仓库代码', name: 'WarehouseCode', width: 120, align: 'left' },
  106. { label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
  107. ],
  108. shrinkToFit: false,//宽度自适应
  109. autoWidth: true,
  110. gridComplete: function () {
  111. },
  112. pager: "#gridPager2",
  113. sortorder: "desc",
  114. sortname: 'WarehouseCode ',
  115. viewrecords: true,
  116. multiselect: true,
  117. rowNum: 10000,
  118. subGrid: false, // (1)开启子表格支持
  119. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  120. debugger;
  121. $("#gridList").jqGrid("setSelection", rowid, false);
  122. bindSubGrid(subgrid_id, rowid)
  123. }
  124. });
  125. $("#btn_search").click(function () {
  126. var warehouse = $("#warehouse a.active").attr('data-value');
  127. var queryJson = {
  128. WHCode: $("#txt_WHCode").val(),
  129. }
  130. $gridList.jqGrid('setGridParam', {
  131. postData: { queryJson: JSON.stringify(queryJson) },
  132. }).trigger('reloadGrid');
  133. });
  134. }
  135. function btn_Delete() {
  136. var objArr = '';
  137. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  138. for (var i = 0; i < objList.length; i++) {
  139. var rowId = objList[i];
  140. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  141. objArr += "'" + rowData.BRGCode + "',";
  142. }
  143. if (objArr == '') {
  144. $.modalAlert("请选择一项进行删除!");
  145. return;
  146. }
  147. $.deleteForm({
  148. url: "/WMS/BasicSettings/DeleteICSBadReasonGroup" + "?" + Math.random(),
  149. param: { keyValue: JSON.stringify(objArr) },
  150. success: function () {
  151. $.currentWindow().$("#gridList").trigger("reloadGrid");
  152. }
  153. })
  154. }
  155. function submitForm() {
  156. var objArr = '';
  157. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  158. for (var i = 0; i < objList.length; i++) {
  159. var rowId = objList[i];
  160. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  161. objArr += "'" + rowData.InvCode + "',";
  162. }
  163. var objArr2 = '';
  164. var objList2 = $("#gridList2").jqGrid('getGridParam', 'selarrrow');
  165. for (var i = 0; i < objList2.length; i++) {
  166. var rowId2 = objList2[i];
  167. var rowData2 = $("#gridList2").jqGrid('getRowData', rowId2);
  168. objArr2 += "'" + rowData2.WarehouseCode + "',";
  169. }
  170. if (objArr == '') {
  171. $.modalAlert("请选择料品!");
  172. return;
  173. }
  174. if (objArr2 == '') {
  175. $.modalAlert("请选择仓库!");
  176. return;
  177. }
  178. $.submitForm({
  179. url: "/WMS/BasicSettings/InsertICSInventoryBatchEnable" + "?" + Math.random(),
  180. param: { keyValue: JSON.stringify(objArr), keyValue2: JSON.stringify(objArr2) },
  181. success: function () {
  182. $.currentWindow().$("#gridList").trigger("reloadGrid");
  183. }
  184. })
  185. }
  186. </script>
  187. <div class="topPanel" style="height:70px;">
  188. <div class="search">
  189. <table>
  190. <tr>
  191. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">料品编码</label>:</td>
  192. <td>
  193. <div class="input-group">
  194. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  195. </div>
  196. </td>
  197. <td style="width:560px;"></td>
  198. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">仓库代码</label>:</td>
  199. <td>
  200. <div class="input-group">
  201. <input id="txt_WHCode" type="text" class="form-control" style="width: 100px;">
  202. </div>
  203. </td>
  204. <td style="width:450px;"></td>
  205. <td>
  206. <span class="input-group-btn">
  207. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  208. </span>
  209. </td>
  210. </tr>
  211. </table>
  212. </div>
  213. </div>
  214. <div>
  215. <div class="gridPanel">
  216. <table id="gridList"></table>
  217. @*<div id="gridPager"></div>*@
  218. </div>
  219. <div class="gridPane2">
  220. <table id="gridList2"></table>
  221. @*<div id="gridPager2"></div>*@
  222. </div>
  223. </div>