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.

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