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.

235 lines
9.0 KiB

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