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