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.

382 lines
13 KiB

12 months ago
  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <style>
  6. .ui-jqgrid tr.jqgrow td {
  7. overflow:hidden;
  8. }
  9. .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
  10. overflow:hidden !important;
  11. }
  12. .btn-primary {
  13. margin-right: 2px;
  14. }
  15. html {
  16. height: 100%;
  17. }
  18. .formdiv {
  19. height: 100% !important;
  20. margin-bottom:2px;
  21. margin-top: 10px; margin-left: 10px; margin-right: 10px;
  22. }
  23. .form {
  24. margin-bottom:6px;
  25. }
  26. html ,body {
  27. height: 100% !important;
  28. }
  29. form {
  30. height: 98% !important;
  31. }
  32. .bootstrap-select .dropdown-toggle .filter-option-inner-inner {
  33. height:20px !important;
  34. }
  35. .gridPanel {
  36. padding-left:2px;
  37. padding-right:2px;
  38. padding-bottom:4px;
  39. }
  40. /*表标题颜色*/
  41. .table > thead:first-child > tr:first-child > th {
  42. background-color: #229594 ;
  43. color:white;
  44. }
  45. /*表标题位置*/
  46. .ui-jqgrid .ui-jqgrid-caption {
  47. text-align:center;
  48. }
  49. .ui-jqgrid .ui-jqgrid-title {
  50. font-size:20px;
  51. }
  52. </style>
  53. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  54. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  55. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  56. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  57. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  58. <script>
  59. var HeightToDel = 80;
  60. var timer;
  61. var timer2;//刷新数据时间
  62. var GunDongRate = 20*1000;//单位毫秒 //滚动间隔时间
  63. var GunDongRow = 0;
  64. var DataF = 70;//单位s
  65. // var CurrentscrollTop = 0;
  66. var IsFirstShow = false;
  67. var TopdivMO = 129;
  68. $(function () {
  69. changeShow();
  70. $(window).resize(function () {
  71. $("#gridList1").setGridWidth($("#form1").width() * 0.49);
  72. $("#gridList1").setGridHeight($("#form1").height() * 0.50 - HeightToDel);
  73. $("#gridList2").setGridWidth($("#form1").width() * 0.49);
  74. $("#gridList2").setGridHeight($("#form1").height() * 0.50 - HeightToDel);
  75. $("#gridList3").setGridWidth($("#form1").width() * 0.49);
  76. $("#gridList3").setGridHeight($("#form1").height() * 0.50 - HeightToDel);
  77. $("#gridList4").setGridWidth($("#form1").width() * 0.49);
  78. $("#gridList4").setGridHeight($("#form1").height() * 0.50 - HeightToDel);
  79. GunDongRow = 0;
  80. });
  81. scrollBody("gridList1");
  82. scrollBody("gridList2");
  83. scrollBody("gridList3");
  84. scrollBody("gridList4");
  85. //刷新数据
  86. timer2 = setInterval(function () {
  87. gridList1();
  88. gridList2();
  89. gridList3();
  90. gridList4();
  91. }, DataF * 1000);
  92. });
  93. //自动滚动
  94. function scrollBody(gridList) {
  95. timer = setInterval(function () {
  96. var ob3 = $('#' + gridList).getGridParam("records");
  97. var div = $('#' + gridList).closest('.ui-jqgrid-bdiv')[0];
  98. var offsetHeight = div.offsetHeight;
  99. var scrollHeight = div.scrollHeight - offsetHeight;
  100. if (GunDongRow == 0) {
  101. var hh = offsetHeight;
  102. GunDongRow = Math.floor(hh / 30.3);
  103. }
  104. // div.scrollTop = div.scrollTop + 1;
  105. if (div.scrollTop >= scrollHeight) {//循环滚动
  106. scrollHeight = div.scrollHeight - offsetHeight;//如果在滚动过程中添加过数据,需要重新结算scrollHeight
  107. if (div.scrollTop >= scrollHeight) {
  108. div.scrollTop = 0; //循环滚动,重置滚动头即可
  109. IsFirstShow = true;
  110. }
  111. if (div.scrollTop >= ob3 * 30.4) {
  112. div.scrollTop = 0; //循环滚动,重置滚动头即可
  113. IsFirstShow = true;
  114. }
  115. }
  116. if (!IsFirstShow) {
  117. div.scrollTop = div.scrollTop + (GunDongRow * 30.3);
  118. }
  119. else { IsFirstShow = false; }
  120. }, GunDongRate);
  121. }
  122. //end 自动滚动
  123. function GetAllCols1() {
  124. var _cols = new Array();
  125. //_cols.push({ label: '序号', name: '序号', width: 90, align: 'left', });
  126. _cols.push({ label: '到货单号', name: '到货单', width: 80, align: 'left', });
  127. _cols.push({ label: '订单号', name: '订单号', width: 80, align: 'left', });
  128. _cols.push({ label: '料号', name: '料号', width: 70, align: 'left', });
  129. _cols.push({ label: '物料名称', name: '物料名称', width: 130, align: 'left', });
  130. _cols.push({ label: '收货数量', name: '收货数量', width: 60, align: 'left', });
  131. _cols.push({ label: '已检数量', name: '已检数量', width: 60, align: 'left', });
  132. _cols.push({ label: '待检数量', name: '待检数量', width: 60, align: 'left', });
  133. _cols.push({ label: '已检待入', name: '已检待入', width: 60, align: 'left', });
  134. _cols.push({ label: '已入库数量', name: '已入库数量', width: 75, align: 'left', });//hidden: true,
  135. _cols.push({ label: '状态', name: '状态', width: 50, align: 'left', });
  136. return _cols;
  137. }
  138. function GetAllCols2() {
  139. var _cols = new Array();
  140. //到货单 料号 条码 物料名称 采购订单号 型号 不合格数量 不良原因
  141. _cols.push({ label: '到货单', name: '到货单', width: 70, align: 'left', });
  142. _cols.push({ label: '料号', name: '料号', width: 70, align: 'left', });
  143. _cols.push({ label: '条码', name: '条码', width: 80, align: 'left', });
  144. _cols.push({ label: '物料名称', name: '物料名称', width: 130, align: 'left', });
  145. _cols.push({ label: '采购订单号', name: '采购订单号', width: 80, align: 'left', });
  146. _cols.push({ label: '型号', name: '型号', width: 60, align: 'left', });
  147. _cols.push({ label: '不合格数量', name: '不合格数量', width: 80, align: 'left', });
  148. _cols.push({ label: '不良原因', name: '不良原因', width: 80, align: 'left', });//hidden: true,
  149. return _cols;
  150. }
  151. function GetAllCols3() {
  152. var _cols = new Array();
  153. //出库单号 产品编号 业务类型 需求部门 所属仓库 生产工单号 项目号 制单人
  154. //制单日期 审核人 完成日期 状态
  155. _cols.push({ label: '出库单号', name: '出库单号', width: 80, align: 'left', });
  156. _cols.push({ label: '产品编号', name: '产品编号', width: 80, align: 'left', });
  157. _cols.push({ label: '业务类型', name: '业务类型', width: 80, align: 'left', });
  158. _cols.push({ label: '需求部门', name: '需求部门', width: 80, align: 'left', });
  159. _cols.push({ label: '所属仓库', name: '所属仓库', width: 80, align: 'left', });
  160. _cols.push({ label: '生产工单号', name: '生产工单号', width: 80, align: 'left', });
  161. _cols.push({ label: '项目号', name: '项目号', width: 65, align: 'left', });
  162. _cols.push({ label: '制单人', name: '制单人', width: 65, align: 'left', });
  163. _cols.push({ label: '制单日期', name: '制单日期', width: 90, align: 'left', });//hidden: true,
  164. _cols.push({ label: '审核人', name: '审核人', width: 65, align: 'left', });
  165. _cols.push({ label: '完成日期', name: '完成日期', width: 90, align: 'left', });
  166. _cols.push({ label: '状态', name: '状态', width: 50, align: 'left', });
  167. return _cols;
  168. }
  169. function GetAllCols4() {
  170. var _cols = new Array();
  171. //到货单 料号 条码 物料名称 采购订单号 型号 入库数量 库位
  172. _cols.push({ label: '到货单', name: '到货单', width: 80, align: 'left', });
  173. _cols.push({ label: '料号', name: '料号', width: 80, align: 'left', });
  174. _cols.push({ label: '条码', name: '条码', width: 70, align: 'left', });
  175. _cols.push({ label: '物料名称', name: '物料名称', width: 130, align: 'left', });
  176. _cols.push({ label: '采购订单号', name: '采购订单号', width: 70, align: 'left', });
  177. _cols.push({ label: '型号', name: '型号', width: 70, align: 'left', });
  178. _cols.push({ label: '入库数量', name: '入库数量', width: 70, align: 'left', });
  179. _cols.push({ label: '库位', name: '库位', width: 70, align: 'left', });//hidden: true,
  180. return _cols;
  181. }
  182. function gridList1() {
  183. document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid
  184. var _cols = GetAllCols1();
  185. var $gridList = $("#gridList1" );
  186. var queryJson = {
  187. }
  188. $gridList.dataGrid({
  189. url: "/SRM/WatchPanel/GetGridJson1?" + Math.random(),
  190. postData: { queryJson: JSON.stringify(queryJson) },
  191. height: $(window).height() * 0.50 - HeightToDel,
  192. colModel: _cols,
  193. caption: '到货明细',
  194. sortname: " 状态,到货单号,订单号, 料号 ",
  195. rowNum: 5000,
  196. viewrecords: true,
  197. rownumbers: true,
  198. multiselect: false,
  199. gridComplete: function () {
  200. $("#gridList1" ).jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  201. }
  202. });
  203. }
  204. function gridList2() {
  205. document.getElementById("gridPanel2").innerHTML = ' <table id="gridList2"></table> ';//重置grid
  206. var _cols = GetAllCols2();
  207. var $gridList = $("#gridList2");
  208. var queryJson = {
  209. }
  210. $gridList.dataGrid({
  211. url: "/SRM/WatchPanel/GetGridJson2?" + Math.random(),
  212. postData: { queryJson: JSON.stringify(queryJson) },
  213. height: $(window).height() * 0.50 - HeightToDel,
  214. colModel: _cols,
  215. caption:"来料不合格明细",
  216. sortname: " 到货单, 采购订单号, 料号 ",
  217. rowNum: 5000,
  218. viewrecords: true,
  219. rownumbers: true,
  220. multiselect: false,
  221. gridComplete: function () {
  222. $("#gridList2").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  223. }
  224. });
  225. }
  226. function gridList3() {
  227. document.getElementById("gridPanel3").innerHTML = ' <table id="gridList3"></table> ';//重置grid
  228. var _cols = GetAllCols3();
  229. var $gridList = $("#gridList3");
  230. var queryJson = {
  231. }
  232. $gridList.dataGrid({
  233. url: "/SRM/WatchPanel/GetGridJson3?" + Math.random(),
  234. postData: { queryJson: JSON.stringify(queryJson) },
  235. height: $(window).height() * 0.50 - HeightToDel,
  236. colModel: _cols,
  237. caption:"配料信息表",
  238. sortname: " 状态,制单日期,出库单号,产品编号 ",
  239. rowNum: 5000,
  240. viewrecords: true,
  241. rownumbers: true,
  242. multiselect: false,
  243. gridComplete: function () {
  244. $("#gridList3").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  245. }
  246. });
  247. }
  248. function gridList4() {
  249. document.getElementById("gridPanel4").innerHTML = ' <table id="gridList4"></table> ';//重置grid
  250. var _cols = GetAllCols4();
  251. var $gridList = $("#gridList4");
  252. var queryJson = {
  253. }
  254. $gridList.dataGrid({
  255. url: "/SRM/WatchPanel/GetGridJson4?" + Math.random(),
  256. postData: { queryJson: JSON.stringify(queryJson) },
  257. height: $(window).height() * 0.50 - HeightToDel,
  258. colModel: _cols,
  259. caption:"入库明细",
  260. sortname: " 到货单, 采购订单号, 料号 ",
  261. rowNum: 5000,
  262. viewrecords: true,
  263. rownumbers: true,
  264. multiselect: false,
  265. gridComplete: function () {
  266. $("#gridList4").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  267. }
  268. });
  269. }
  270. function changeShow()
  271. {
  272. gridList1();
  273. gridList2();
  274. gridList3();
  275. gridList4();
  276. }
  277. </script>
  278. <form id="form1">
  279. <div class="formdiv">
  280. <table class="form">
  281. <tr style="width:100%;height:50%;">
  282. <td >
  283. <div class="gridPanel" id="gridPanel1">
  284. <table id="gridList1"></table>
  285. </div>
  286. </td>
  287. <td >
  288. <div class="gridPanel" id="gridPanel2">
  289. <table id="gridList2"></table>
  290. </div>
  291. </td>
  292. </tr>
  293. <tr style="width:100%;height:50%;">
  294. <td >
  295. <div class="gridPanel" id="gridPanel3">
  296. <table id="gridList3"></table>
  297. </div>
  298. </td>
  299. <td >
  300. <div class="gridPanel" id="gridPanel4">
  301. <table id="gridList4"></table>
  302. </div>
  303. </td>
  304. </tr>
  305. </table>
  306. </div>
  307. </form>