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.

178 lines
6.3 KiB

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