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.

155 lines
6.7 KiB

1 month ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <style>
  6. .td {
  7. padding: 0 5px 0 5px;
  8. }
  9. </style>
  10. <script>
  11. var WorkPoints = $.request("WorkPoint");
  12. $(function () {
  13. gridList();
  14. })
  15. function gridList() {
  16. var $gridList = $("#gridList");
  17. var queryJson = {
  18. cCode: $("#txt_cCode").val(),
  19. BegiondDate: $("#txt_BegiondDate").val(),
  20. EnddDate: $("#txt_EnddDate").val(),
  21. InvCode: $("#txt_InvCode").val(),
  22. InvName: $("#txt_InvName").val(),
  23. }
  24. $gridList.dataGrid({
  25. url: "/SRM/BicDoc_Publish/GetBicDocByPU" + "?" + Math.random(),
  26. postData: { queryJson: JSON.stringify(queryJson), WorkPoint: JSON.stringify(WorkPoints) },
  27. height: $(window).height() - 120,
  28. width: $(window).width() - 180,
  29. colModel: [
  30. { label: "主键", name: "ID", hidden: true, key: true },
  31. { label: '单据号', name: 'cCode', width: 240, align: 'left' },
  32. { label: '单据行', name: 'ivouchrowno', width: 240, align: 'left' },
  33. { label: '单据日期', name: 'dDate', width: 150, align: 'left' },
  34. { label: "物料编码", name: "cInvCode", width: 150, align: 'left' },
  35. { label: '物料名称', name: 'cInvName', width: 220, align: 'left' },
  36. { label: '规格型号', name: 'cInvStd', width: 240, align: 'left' },
  37. { label: '单位', name: 'INVUOM', width: 240, align: 'left' },
  38. { label: '需求日期', name: 'dRequirDate', width: 150, align: 'left' },
  39. { label: "计划到货日期", name: "dArriveDate", width: 150, align: 'left' },
  40. { label: '请购数量', name: 'fQuantity', width: 220, align: 'left' },
  41. { label: '来源', name: 'Source', width: 220, align: 'left',hidden:true},
  42. ],
  43. sortname: 'cCode',
  44. shrinkToFit: true,//宽度自适应
  45. pager: "#gridPager",
  46. //sortname: 'ID',
  47. viewrecords: true,
  48. multiselect: true,
  49. rowNum: 200
  50. });
  51. $("#btn_search").click(function () {
  52. var queryJson = {
  53. cCode: $("#txt_cCode").val(),
  54. BegiondDate: $("#txt_BegiondDate").val(),
  55. EnddDate: $("#txt_EnddDate").val(),
  56. InvCode: $("#txt_InvCode").val(),
  57. InvName: $("#txt_InvName").val(),
  58. }
  59. $gridList.jqGrid('setGridParam', {
  60. postData: { queryJson: JSON.stringify(queryJson) },
  61. page: 1
  62. }).trigger('reloadGrid');
  63. });
  64. }
  65. //提交
  66. function submitForm() {
  67. //提交
  68. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  69. var objs = [];
  70. for (var i = 0; i < ids.length; i++) {
  71. var obj = {
  72. ID: GUID(),
  73. INVCODE: $("#gridList").jqGrid('getRowData', ids[i]).cInvCode,
  74. INVNAME: $("#gridList").jqGrid('getRowData', ids[i]).cInvName,
  75. Quantity: $("#gridList").jqGrid('getRowData', ids[i]).fQuantity,
  76. INVUOM: $("#gridList").jqGrid('getRowData', ids[i]).INVUOM,
  77. DeliveryTime: $("#gridList").jqGrid('getRowData', ids[i]).dArriveDate,
  78. Source: $("#gridList").jqGrid('getRowData', ids[i]).Source,
  79. InvStd: $("#gridList").jqGrid('getRowData', ids[i]).cInvStd,
  80. cCode: $("#gridList").jqGrid('getRowData', ids[i]).cCode
  81. };
  82. objs.push(obj);
  83. }
  84. return objs;
  85. }
  86. function GUID() {
  87. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  88. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  89. return v.toString(16);
  90. });
  91. }
  92. </script>
  93. <form id="form1">
  94. <div class="topPanel" style="height:50px">
  95. <div class="search">
  96. <table>
  97. <tr>
  98. <td style="text-align:right;padding: 0 5px 0 5px;">
  99. <label>请购单号:</label>
  100. </td>
  101. <td>
  102. <div class="input-group">
  103. <input id="txt_cCode" type="text" class="form-control" placeholder="请购单号" style="width: 100px;">
  104. </div>
  105. </td>
  106. <td style="text-align:right;padding: 0 5px 0 5px;">
  107. <label>请购单日期(起):</label>
  108. </td>
  109. <td>
  110. <div class="input-group">
  111. <input id="txt_BegiondDate" type="text" class="form-control" placeholder="请购单日期(起)" style="width: 100px;" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })">
  112. </div>
  113. </td>
  114. <td style="text-align:right;padding: 0 5px 0 5px;">
  115. <label>请购单日期(止):</label>
  116. </td>
  117. <td>
  118. <div class="input-group">
  119. <input id="txt_EnddDate" type="text" class="form-control" placeholder="请购单日期(止)" style="width: 100px;" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: txt_BegiondDate.value })">
  120. </div>
  121. </td>
  122. <td style="text-align:right;padding: 0 5px 0 5px;">
  123. <label>物料编码:</label>
  124. </td>
  125. <td>
  126. <div class="input-group">
  127. <input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 100px;">
  128. </div>
  129. </td>
  130. <td style="text-align:right;padding: 0 5px 0 5px;">
  131. <label>物料名称:</label>
  132. </td>
  133. <td>
  134. <div class="input-group">
  135. <input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 100px;">
  136. </div>
  137. </td>
  138. <td>
  139. <span class="input-group-btn" style="padding-left:10px;">
  140. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  141. </span>
  142. </td>
  143. </tr>
  144. </table>
  145. </div>
  146. </div>
  147. <div class="gridPanel">
  148. <table id="gridList"></table>
  149. <div id="gridPager"></div>
  150. </div>
  151. </form>