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.

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