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

200 lines
7.7 KiB

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