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.

185 lines
5.8 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <style>
  7. /*.btn-primary {
  8. margin-right: 2px;
  9. }
  10. .topPanel .toolbar {
  11. float: left;
  12. }*/
  13. </style>
  14. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  15. <script>
  16. var mold = $.request("mold");
  17. $(document).ready(function () {
  18. $("input.cell").keyup(function (e) {
  19. switch (e.keyCode) {
  20. // up arrow
  21. case 40:
  22. $(this).parent()
  23. .parent()
  24. .next()
  25. .children("td")
  26. .children("input.cell[name="
  27. + $(this).attr("name") + "]")
  28. .focus();
  29. break;
  30. // down arrow
  31. case 38:
  32. $(this).parent()
  33. .parent()
  34. .prev()
  35. .children("td")
  36. .children("input.cell[name="
  37. + $(this).attr("name") + "]")
  38. .focus();
  39. break;
  40. }
  41. });
  42. });</script>
  43. <script>
  44. $(function () {
  45. gridList();
  46. })
  47. function gridList() {
  48. document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';//重置grid
  49. var $gridList = $("#gridList");
  50. var queryJson = {
  51. Code: $("#txt_Code").val(),
  52. }
  53. $gridList.dataGrid({
  54. url: "/KBSWMS/ICSUpdateMoPick/GetICSMOPickInfo" + "?" + Math.random(),
  55. postData: { queryJson: JSON.stringify(queryJson) },
  56. height: $(window).height() - 200,
  57. width: $(window).width() - 300,
  58. colModel: [
  59. { label: "主键", name: "ID", hidden: true, key: true },
  60. { label: '工单号', name: 'MOCode', width: 120, align: 'left' },
  61. { label: '子件行号', name: 'Sequence', width: 150, align: 'left' },
  62. { label: '子件料品', name: 'InvCode', width: 150, align: 'left' },
  63. { label: '料品名称', name: 'InvName', width: 200, align: 'left' },
  64. { label: '子件数量', name: 'Quantity', width: 150, align: 'left' },
  65. { label: '已发数量', name: 'IssueQuantity', width: 150, align: 'left' },
  66. ],
  67. shrinkToFit: false,//宽度自适应
  68. autoWidth:true,
  69. gridComplete: function () {
  70. },
  71. pager: "#gridPager",
  72. sortorder: "asc",
  73. sortname: 'Sequence',
  74. viewrecords: true,
  75. multiselect: true,
  76. });
  77. $("#btn_search").click(function () {
  78. var queryJson = {
  79. Code: $("#txt_Code").val(),
  80. }
  81. $gridList.jqGrid('setGridParam', {
  82. postData: { queryJson: JSON.stringify(queryJson) },
  83. }).trigger('reloadGrid');
  84. });
  85. }
  86. //工单更新
  87. function btnUpdateMo() {
  88. var Code = $("#txt_Code").val();
  89. $.submitForm({
  90. url: "/KBSWMS/ICSUpdateMoPick/UpdateMoInfoByCode?Code=" + Code + "&" + Math.random(),
  91. param: {
  92. // keyValue: JSON.stringify(ARR)
  93. },
  94. success: function () {
  95. gridList();
  96. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  97. }
  98. })
  99. }
  100. //子件更新
  101. function btnUpdate() {
  102. var Code = $("#txt_Code").val();
  103. $.submitForm({
  104. url: "/KBSWMS/ICSUpdateMoPick/UpdateMopickInfoByCode?Code=" + Code+ "&" + Math.random(),
  105. param: {
  106. // keyValue: JSON.stringify(ARR)
  107. },
  108. success: function () {
  109. gridList();
  110. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  111. }
  112. })
  113. }
  114. function CodeTrigger() {
  115. $("#txt_Code").keydown(function (e) {
  116. var curKey = e.which;
  117. debugger;
  118. if (curKey == 13) {
  119. var queryJson = {
  120. Code: $("#txt_Code").val(),
  121. }
  122. $gridList.jqGrid('setGridParam', {
  123. postData: { queryJson: JSON.stringify(queryJson) },
  124. }).trigger('reloadGrid');
  125. }
  126. });
  127. }
  128. </script>
  129. <div class="topPanel" style="height:45px">
  130. <div class="toolbar">
  131. <div class="btn-group">
  132. <a id="NF-UpdateMo" authorize="yes" class="btn btn-primary" onclick="btnUpdateMo()"><i class="fa fa-pencil-square-o"></i>工单更新</a>
  133. <a id="NF-Update" authorize="yes" class="btn btn-primary" onclick="btnUpdate()"><i class="fa fa-pencil-square-o"></i>子件更新</a>
  134. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  135. </div>
  136. <script>$('.toolbar').authorizeButton()</script>
  137. </div>
  138. <div class="search">
  139. <table>
  140. <tr>
  141. <td style="text-align:right;"><label class="lglabel" for="txt_Code">&nbsp;&nbsp;&nbsp;工单号</label>:</td>
  142. <td>
  143. <div class="input-group">
  144. <input id="txt_Code" type="text" class="form-control" style="width: 150px;" οnkeydοwn="CodeTrigger()" >
  145. </div>
  146. </td>
  147. <td>
  148. <span class="input-group-btn">
  149. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  150. </span>
  151. </td>
  152. </tr>
  153. </table>
  154. </div>
  155. </div>
  156. <div class="gridPanel" id="gridPanel">
  157. <table id="gridList"></table>
  158. <div id="gridPager"></div>
  159. </div>