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

199 lines
7.9 KiB

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