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

195 lines
7.2 KiB

  1. 
  2. @{
  3. /**/
  4. ViewBag.Title = "SeachInventory";
  5. Layout = "~/Views/Shared/_Index.cshtml";
  6. }
  7. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  8. <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" />
  9. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  10. <script src="~/Content/js/select2/select2.min.js"></script>
  11. <script>
  12. debugger;
  13. var _Clos = new Array();
  14. var ID = $.request("ID");
  15. var Type = $.request("Type");
  16. var TLZID = $.request("TLZID");
  17. $(function () {
  18. SetCols();
  19. Init();
  20. })
  21. function SetCols() {
  22. $.ajax({
  23. url: "/Print/SelectColumnName?" + Math.random(),
  24. dataType: "json",
  25. async: false,
  26. success: function (data) {
  27. var cols = new Array();
  28. var collast = { label: '主键', name: 'ID', hidden: true, key: true };
  29. cols.push(collast);
  30. var collast = { label: 'ID', name: 'ZJID', hidden: true };
  31. cols.push(collast);
  32. var collast = { label: '来源单据号', name: 'IssueCode', width: 100, align: 'left' };
  33. cols.push(collast);
  34. var collast = { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' };
  35. cols.push(collast);
  36. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  37. cols.push(collast);
  38. var collast = { label: '物料描述', name: 'INVNAME', width: 100, align: 'left' };
  39. cols.push(collast);
  40. var collast = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  41. cols.push(collast);
  42. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  43. cols.push(collast);
  44. var collast = { label: '数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  45. cols.push(collast);
  46. var collast = { label: '数量2', name: 'Quantity', hidden: true };
  47. cols.push(collast);
  48. var collast = { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' };
  49. cols.push(collast);
  50. var collast = { label: '自由项ID', name: 'ExtensionID', hidden: true };
  51. cols.push(collast);
  52. if (data != null && data.length > 0) {
  53. DateList = data;
  54. for (var i = 0; i < data.length; i++) {
  55. var ColName = data[i].ColName;
  56. var ColCode = data[i].ColCode;
  57. var obj = new Array();
  58. obj = {
  59. label: ColName,
  60. name: ColCode,
  61. width: 80,
  62. align: "left"
  63. }
  64. cols.push(obj);
  65. }
  66. }
  67. _Clos = cols;
  68. }
  69. });
  70. }
  71. function Init() {
  72. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  73. var invcode = $("#txt_Invcode").val();
  74. $("#gridList").dataGrid({
  75. url: "/WMS/MaterialsDeliveredRTM/GetINV" + "?invcode=" + invcode + "&" + Math.random(),
  76. height: $(window).height() - 20,
  77. width: $(window).width() - 300,
  78. colModel: _Clos,
  79. //colModel: [
  80. // { label: '主键', name: 'ID', hidden: true, key: true },
  81. // { label: 'ID', name: 'ZJID', hidden: true },
  82. // { label: '来源单据号', name: 'IssueCode', width: 100, align: 'left' },
  83. // { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' },
  84. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  85. // { label: '物料描述', name: 'INVNAME', width: 100, align: 'left' },
  86. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  87. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  88. // { label: '数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  89. // { label: '数量2', name: 'Quantity', hidden: true },
  90. // { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' },
  91. // { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' },
  92. //],
  93. pager: "#gridPager",
  94. sortorder: "desc",
  95. sortname: 'InvCode',
  96. viewrecords: true,
  97. multiselect: true,
  98. gridComplete: function () {
  99. }
  100. })
  101. };
  102. function submitForm() {
  103. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  104. if (rows.length != 1) {
  105. $.modalAlertNew("WMS00079");
  106. return;
  107. }
  108. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  109. var obj = {
  110. ID: ID,
  111. TLZID: TLZID,
  112. ZJID: rowdata.ZJID,
  113. InvCode: rowdata.InvCode,
  114. INVNAME: rowdata.INVNAME,
  115. InvStd: rowdata.InvStd,
  116. InvUnit: rowdata.InvUnit,
  117. Quantity: rowdata.Quantity,
  118. IssueNegQuantity: rowdata.IssueNegQuantity,
  119. Amount: rowdata.Amount,
  120. ExtensionID: rowdata.ExtensionID,
  121. }
  122. var obj1 = JSON.stringify(obj);
  123. if (Type == '1') {
  124. $.ajax({
  125. url: "/WMS/MaterialsDeliveredRTM/UpdateMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  126. async: false,
  127. success: function (data) {
  128. $.currentWindow().$("#gridList").trigger("reloadGrid");
  129. layer.msg(data.message);
  130. $.modalClose();
  131. },
  132. });
  133. }
  134. else {
  135. $.ajax({
  136. url: "/WMS/MaterialsDeliveredRTM/AddMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  137. async: false,
  138. success: function (data) {
  139. $.currentWindow().$("#gridList").trigger("reloadGrid");
  140. layer.msg(data.message);
  141. $.modalClose();
  142. },
  143. });
  144. }
  145. };
  146. function Close() {
  147. $.modalClose();
  148. }
  149. function reloadData() {
  150. }
  151. </script>
  152. <div class="topPanel" style="height:50px">
  153. <div class="search">
  154. <table>
  155. <tr>
  156. <td>
  157. <label>料品编码:</label>
  158. </td>
  159. <td>
  160. <div class="input-group">
  161. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  162. </div>
  163. </td>
  164. <td>
  165. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  166. </td>
  167. </tr>
  168. <tr></tr>
  169. </table>
  170. </div>
  171. </div>
  172. <div class="gridPanel" id="gridPanel">
  173. <table id="gridList"></table>
  174. <div id="gridPager"></div>
  175. </div>