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

228 lines
7.5 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
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. });
  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. WHCode: $("#txt_WHCode").val(),
  90. }
  91. $gridList.dataGrid({
  92. url: "/WMS/BasicSettings/GetICSWarehouseInfo" + "?" + Math.random(),
  93. postData: { queryJson: JSON.stringify(queryJson) },
  94. height: $(window).height() - 200,
  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: 'WarehouseCode', width: 120, align: 'left' },
  100. { label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
  101. ],
  102. shrinkToFit: false,//宽度自适应
  103. autoWidth: true,
  104. gridComplete: function () {
  105. },
  106. pager: "#gridPager2",
  107. sortorder: "desc",
  108. sortname: 'WarehouseCode ',
  109. viewrecords: true,
  110. multiselect: true,
  111. rowNum: 10000,
  112. });
  113. $("#btn_search").click(function () {
  114. var warehouse = $("#warehouse a.active").attr('data-value');
  115. var queryJson = {
  116. WHCode: $("#txt_WHCode").val(),
  117. }
  118. $gridList.jqGrid('setGridParam', {
  119. postData: { queryJson: JSON.stringify(queryJson) },
  120. }).trigger('reloadGrid');
  121. });
  122. }
  123. function btn_Delete() {
  124. var objArr = '';
  125. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  126. for (var i = 0; i < objList.length; i++) {
  127. var rowId = objList[i];
  128. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  129. objArr += "'" + rowData.BRGCode + "',";
  130. }
  131. if (objArr == '') {
  132. $.modalAlertNew("WMS00001");
  133. return;
  134. }
  135. $.deleteForm({
  136. url: "/WMS/BasicSettings/DeleteICSBadReasonGroup" + "?" + Math.random(),
  137. param: { keyValue: JSON.stringify(objArr) },
  138. success: function () {
  139. $.currentWindow().$("#gridList").trigger("reloadGrid");
  140. }
  141. })
  142. }
  143. function submitForm() {
  144. var objArr = '';
  145. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  146. for (var i = 0; i < objList.length; i++) {
  147. var rowId = objList[i];
  148. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  149. objArr += "'" + rowData.InvCode + "',";
  150. }
  151. var objArr2 = '';
  152. var objList2 = $("#gridList2").jqGrid('getGridParam', 'selarrrow');
  153. for (var i = 0; i < objList2.length; i++) {
  154. var rowId2 = objList2[i];
  155. var rowData2 = $("#gridList2").jqGrid('getRowData', rowId2);
  156. objArr2 += "'" + rowData2.WarehouseCode + "',";
  157. }
  158. if (objArr == '') {
  159. $.modalAlertNew("WMS00040");
  160. return;
  161. }
  162. if (objArr2 == '') {
  163. $.modalAlertNew("WMS00041");
  164. return;
  165. }
  166. $.submitForm({
  167. url: "/WMS/BasicSettings/InsertICSInventoryBatchEnable" + "?" + Math.random(),
  168. param: { keyValue: JSON.stringify(objArr), keyValue2: JSON.stringify(objArr2) },
  169. success: function () {
  170. $.currentWindow().$("#gridList").trigger("reloadGrid");
  171. }
  172. })
  173. }
  174. </script>
  175. <div class="topPanel" style="height:70px;">
  176. <div class="search">
  177. <table>
  178. <tr>
  179. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">料品编码</label>:</td>
  180. <td>
  181. <div class="input-group">
  182. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  183. </div>
  184. </td>
  185. <td style="width:560px;"></td>
  186. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">仓库代码</label>:</td>
  187. <td>
  188. <div class="input-group">
  189. <input id="txt_WHCode" type="text" class="form-control" style="width: 100px;">
  190. </div>
  191. </td>
  192. <td style="width:450px;"></td>
  193. <td>
  194. <span class="input-group-btn">
  195. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  196. </span>
  197. </td>
  198. </tr>
  199. </table>
  200. </div>
  201. </div>
  202. <div>
  203. <div class="gridPanel">
  204. <table id="gridList"></table>
  205. @*<div id="gridPager"></div>*@
  206. </div>
  207. <div class="gridPane2">
  208. <table id="gridList2"></table>
  209. @*<div id="gridPager2"></div>*@
  210. </div>
  211. </div>