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.

264 lines
11 KiB

3 weeks ago
  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?v=20120420" 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. var MenuID = $.request("MenuID");
  18. $(function () {
  19. SetCols();
  20. Init();
  21. })
  22. function SetCols() {
  23. $.ajax({
  24. url: "/Print/SelectColumnName?" + Math.random(),
  25. dataType: "json",
  26. async: false,
  27. success: function (data) {
  28. var cols = new Array();
  29. var collast = { label: '主键', name: 'ID', hidden: true, key: true };
  30. cols.push(collast);
  31. var collast = { label: 'ID', name: 'ZJID', hidden: true };
  32. cols.push(collast);
  33. var collast = { label: '材料出库单号', name: 'IssueCode', width: 120, align: 'left' };
  34. cols.push(collast);
  35. var collast = { label: '材料出库单行号', name: 'MuHang', width: 60, align: 'left' };
  36. cols.push(collast);
  37. var collast = { label: '来源单据号', name: 'SourceCode', width: 120, align: 'left' };
  38. cols.push(collast);
  39. var collast = { label: '来源单据行号', name: 'SourceSequence', width: 60, align: 'left' };
  40. cols.push(collast);
  41. var collast = { label: '部门编码', name: 'DepCode', width: 60, align: 'left' };
  42. cols.push(collast);
  43. var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
  44. cols.push(collast);
  45. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  46. cols.push(collast);
  47. var collast = { label: '客户料号', name: 'EATTRIBUTE10', width: 100, align: 'left' };
  48. cols.push(collast);
  49. var collast = { label: '批号', name: 'BatchCode', width: 100, align: 'left' };
  50. cols.push(collast);
  51. var collast = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  52. cols.push(collast);
  53. var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
  54. cols.push(collast);
  55. var collast = { label: '数量', name: 'IssueNegQuantity', width: 100, align: 'left' };
  56. cols.push(collast);
  57. var collast = { label: '数量2', name: 'Quantity', hidden: true };
  58. cols.push(collast);
  59. var collast = { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' };
  60. cols.push(collast);
  61. var collast = { label: '单据时间', name: 'MTIME', width: 100, align: 'left' };
  62. cols.push(collast);
  63. var collast = { label: '自由项ID', name: 'ExtensionID', hidden: true };
  64. cols.push(collast);
  65. if (data != null && data.length > 0) {
  66. DateList = data;
  67. for (var i = 0; i < data.length; i++) {
  68. var ColName = data[i].ColName;
  69. var ColCode = data[i].ColCode;
  70. var obj = new Array();
  71. obj = {
  72. label: ColName,
  73. name: ColCode,
  74. width: 80,
  75. align: "left"
  76. }
  77. cols.push(obj);
  78. }
  79. }
  80. _Clos = cols;
  81. }
  82. });
  83. }
  84. function Init() {
  85. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  86. var invcode = $("#txt_Invcode").val();
  87. var SourceCode = $("#txt_SourceCode").val();
  88. var SourceSequence = $("#txt_SourceSequence").val();
  89. var EATTRIBUTE10 = $("#txt_EATTRIBUTE10").val();
  90. var BatchCode = $("#txt_BatchCode").val();
  91. var INVStd = $("#txt_INVStd").val();
  92. $("#gridList").dataGrid({
  93. url: "/JHWMS/MaterialsDeliveredRTM/GetINV?invcode=" + invcode + "&SourceCode=" + SourceCode + "&SourceSequence=" + SourceSequence + "&EATTRIBUTE10=" + EATTRIBUTE10 + "&BatchCode=" + BatchCode + "&INVSTD=" + INVStd+"&MenuID=" + MenuID +"&" + Math.random(),
  94. height: $(window).height() - 20,
  95. width: $(window).width() - 300,
  96. colModel: _Clos,
  97. //colModel: [
  98. // { label: '主键', name: 'ID', hidden: true, key: true },
  99. // { label: 'ID', name: 'ZJID', hidden: true },
  100. // { label: '来源单据号', name: 'IssueCode', width: 100, align: 'left' },
  101. // { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' },
  102. // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  103. // { label: '料品名称', name: 'INVNAME', width: 100, align: 'left' },
  104. // { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  105. // { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  106. // { label: '数量', name: 'IssueNegQuantity', width: 100, align: 'left' },
  107. // { label: '数量2', name: 'Quantity', hidden: true },
  108. // { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' },
  109. // { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' },
  110. //],
  111. pager: "#gridPager",
  112. sortorder: "desc",
  113. sortname: 'MTIME',
  114. rowNum: 10000,
  115. viewrecords: true,
  116. multiselect: true,
  117. gridComplete: function () {
  118. }
  119. })
  120. };
  121. function submitForm() {
  122. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  123. if (rows.length < 1) {
  124. $.modalAlertNew("WMS00079");
  125. return;
  126. }
  127. var objs = [];
  128. for (var i = 0; i < rows.length; i++) {
  129. var obj = {
  130. ID: guid(),
  131. TLZID: TLZID,
  132. ZJID: $("#gridList").jqGrid('getRowData', rows[i]).ZJID,
  133. InvCode: $("#gridList").jqGrid('getRowData', rows[i]).InvCode,
  134. InvName: $("#gridList").jqGrid('getRowData', rows[i]).InvName,
  135. InvStd: $("#gridList").jqGrid('getRowData', rows[i]).InvStd,
  136. InvUnit: $("#gridList").jqGrid('getRowData', rows[i]).InvUnit,
  137. Quantity: $("#gridList").jqGrid('getRowData', rows[i]).Quantity,
  138. Quantitys: $("#gridList").jqGrid('getRowData', rows[i]).Quantity,
  139. IssueNegQuantity: $("#gridList").jqGrid('getRowData', rows[i]).IssueNegQuantity,
  140. Amount: $("#gridList").jqGrid('getRowData', rows[i]).Amount,
  141. Amounts: $("#gridList").jqGrid('getRowData', rows[i]).Amount,
  142. ExtensionID: $("#gridList").jqGrid('getRowData', rows[i]).ExtensionID,
  143. ProjectCode: $("#gridList").jqGrid('getRowData', rows[i]).ProjectCode,
  144. BatchCode: $("#gridList").jqGrid('getRowData', rows[i]).BatchCode,
  145. Version: $("#gridList").jqGrid('getRowData', rows[i]).Version,
  146. Brand: $("#gridList").jqGrid('getRowData', rows[i]).Brand,
  147. cFree1: $("#gridList").jqGrid('getRowData', rows[i]).cFree1,
  148. cFree2: $("#gridList").jqGrid('getRowData', rows[i]).cFree2,
  149. cFree3: $("#gridList").jqGrid('getRowData', rows[i]).cFree3,
  150. cFree4: $("#gridList").jqGrid('getRowData', rows[i]).cFree4,
  151. cFree5: $("#gridList").jqGrid('getRowData', rows[i]).cFree5,
  152. cFree6: $("#gridList").jqGrid('getRowData', rows[i]).cFree6,
  153. cFree7: $("#gridList").jqGrid('getRowData', rows[i]).cFree7,
  154. cFree8: $("#gridList").jqGrid('getRowData', rows[i]).cFree8,
  155. cFree9: $("#gridList").jqGrid('getRowData', rows[i]).cFree9,
  156. cFree10: $("#gridList").jqGrid('getRowData', rows[i]).cFree10
  157. }
  158. objs.push(obj);
  159. }
  160. return objs;
  161. };
  162. function guid() {
  163. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  164. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  165. return v.toString(16);
  166. });
  167. }
  168. function Close() {
  169. $.modalClose();
  170. }
  171. function reloadData() {
  172. }
  173. </script>
  174. <div class="topPanel" style="height:120px">
  175. <div class="search">
  176. <table>
  177. <tr>
  178. <td>
  179. <label>料品编码:</label>
  180. </td>
  181. <td>
  182. <div class="input-group">
  183. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  184. </div>
  185. </td>
  186. <td>
  187. <label>来源单据号:</label>
  188. </td>
  189. <td>
  190. <div class="input-group">
  191. <input id="txt_SourceCode" type="text" class="form-control" placeholder="来源单据号" style="width: 120px;">
  192. </div>
  193. </td>
  194. <td>
  195. <label>来源单据行号:</label>
  196. </td>
  197. <td>
  198. <div class="input-group">
  199. <input id="txt_SourceSequence" type="text" class="form-control" placeholder="来源单据行号" style="width: 120px;">
  200. </div>
  201. </td>
  202. <td>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td>
  207. <label>客户料号:</label>
  208. </td>
  209. <td>
  210. <div class="input-group">
  211. <input id="txt_EATTRIBUTE10" type="text" class="form-control" placeholder="客户料号" style="width: 120px;">
  212. </div>
  213. </td>
  214. <td>
  215. <label>批号:</label>
  216. </td>
  217. <td>
  218. <div class="input-group">
  219. <input id="txt_BatchCode" type="text" class="form-control" placeholder="批号" style="width: 120px;">
  220. </div>
  221. </td>
  222. <td>
  223. <label>规格型号:</label>
  224. </td>
  225. <td>
  226. <div class="input-group">
  227. <input id="txt_INVStd" type="text" class="form-control" placeholder="规格型号" style="width: 120px;">
  228. </div>
  229. </td>
  230. <td>
  231. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  232. </td>
  233. </tr>
  234. <tr></tr>
  235. </table>
  236. </div>
  237. </div>
  238. <div class="gridPanel" id="gridPanel">
  239. <table id="gridList"></table>
  240. <div id="gridPager"></div>
  241. </div>