index.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <link rel="shortcut icon" href="/img/logo.png" />
  7. <link rel="bookmark" href="/img/logo.png" />
  8. <link rel="stylesheet" href="../DashBoard.css?v3" />
  9. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  10. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  11. <script src="/Plugins/xcountto/xcountTo.min.js"></script>
  12. <title>东科软件</title>
  13. </head>
  14. <body style="background-color:black;">
  15. <div class="box_1920_1080">
  16. <div class="box_title" onclick="showHelp()" style="cursor:pointer">
  17. 月交接数据&nbsp;&nbsp;<span class="box_title_arrow">>>></span><span class="box_title_loading" id="报表加载"></span>
  18. </div>
  19. <div class="box_body" style="display: flex; flex-direction: column;">
  20. <div style="width:1840px;height:440px;display:flex;flex-direction:row;">
  21. <div style="width: 50%;height:440px;padding-right:20px;">
  22. <!--成品交接产品型号-->
  23. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  24. <tr class="tr_title_warning">
  25. <td colspan="5" style="color:white;">本月生产前10型号(大件)</td>
  26. </tr>
  27. <tr class="tr_title_warning">
  28. <td id="g01"></td>
  29. <td id="g02"></td>
  30. <td id="g03"></td>
  31. <td id="g04"></td>
  32. <td id="g05"></td>
  33. </tr>
  34. <tr class="tr_bg_light_warning" style="height:100px;">
  35. <td id="goods01" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  36. <td id="goods02" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  37. <td id="goods03" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  38. <td id="goods04" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  39. <td id="goods05" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  40. </tr>
  41. </table>
  42. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;padding-top:20px;">
  43. <tr class="tr_title_warning">
  44. <td id="g06"></td>
  45. <td id="g07"></td>
  46. <td id="g08"></td>
  47. <td id="g09"></td>
  48. <td id="g10"></td>
  49. </tr>
  50. <tr class="tr_bg_light_warning" style="height:100px;">
  51. <td id="goods06" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  52. <td id="goods07" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  53. <td id="goods08" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  54. <td id="goods09" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  55. <td id="goods10" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  56. </tr>
  57. </table>
  58. </div>
  59. <div style="width: 50%;height:440px;padding-left:20px;">
  60. <!--成品交接产品型号-->
  61. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  62. <tr class="tr_title_warning">
  63. <td colspan="5" style="color:white;">本月生产前10型号(小件)</td>
  64. </tr>
  65. <tr class="tr_title_warning">
  66. <td id="g11"></td>
  67. <td id="g12"></td>
  68. <td id="g13"></td>
  69. <td id="g14"></td>
  70. <td id="g15"></td>
  71. </tr>
  72. <tr class="tr_bg_light_warning" style="height:100px;">
  73. <td id="goods11" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  74. <td id="goods12" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  75. <td id="goods13" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  76. <td id="goods14" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  77. <td id="goods15" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  78. </tr>
  79. </table>
  80. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;padding-top:20px;">
  81. <tr class="tr_title_warning">
  82. <td id="g16"></td>
  83. <td id="g17"></td>
  84. <td id="g18"></td>
  85. <td id="g19"></td>
  86. <td id="g20"></td>
  87. </tr>
  88. <tr class="tr_bg_light_warning" style="height:100px;">
  89. <td id="goods16" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  90. <td id="goods17" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  91. <td id="goods18" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  92. <td id="goods19" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  93. <td id="goods20" data-speed="2000" style="font-size: 40px; width: 20%"></td>
  94. </tr>
  95. </table>
  96. </div>
  97. </div>
  98. <div style="width:1840px;height:520px;display:flex;flex-direction:row;">
  99. <div style="width: 100%;height:520px;">
  100. <!--成品交接数据柱图-->
  101. <canvas id="canvasProduct" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:520px;width:100%"></canvas>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <script>
  107. //缺陷统计刷新时间
  108. var refreshTime1 = 240000;
  109. var currentTime1 = 0;
  110. var doGetData;
  111. var doGetTime;
  112. var frameHeight;
  113. var tableHeight;
  114. var offsetHeight = 20;
  115. $(document).ready(function () {
  116. initData();
  117. doGetData = setInterval(function () { timeUpdate(); }, 1000);
  118. });
  119. //帮助说明
  120. function showHelp() {
  121. var message = "统计说明:" + "\n";
  122. message += "生产前8型号大件: 大件产成品交接TOP8" + "\n";
  123. message += "生产前8型号小件: 小件产成品交接TOP8" + "\n";
  124. message += "产成品交接数据计划: web端看板配置-看板工序产量计划 计划数/30" + "\n";
  125. message += "产成品交接数据实际: 大件产成品交接每日合计" + "\n";
  126. alert(message);
  127. }
  128. function timeUpdate() {
  129. if (currentTime1 <= 0) {
  130. //clearData();
  131. setTimeout(loadData(), 15000);
  132. //loadData();
  133. currentTime1 = refreshTime1;
  134. }
  135. else {
  136. if (currentTime1 > 0) {
  137. $('#报表加载').html('刷新:' + currentTime1 / 1000 + ' 秒');
  138. currentTime1 = currentTime1 - 1000;
  139. }
  140. }
  141. }
  142. function clearData() {
  143. //清除数据
  144. //工序产量===================================
  145. window.Product.data.datasets[0].data = [];
  146. window.Product.data.datasets[1].data = [];
  147. window.Product.update();
  148. }
  149. function loadData() {
  150. //产品交接数据===================================
  151. //window.Product.data.datasets[0].data = [
  152. // 300,
  153. // 300,
  154. // 300,
  155. // 300,
  156. // 300,
  157. // 300,
  158. // 300,
  159. // 300,
  160. // 300,
  161. // 300,
  162. // 300,
  163. // 300,
  164. // 300,
  165. // 300,
  166. // 300,
  167. // 300,
  168. // 300,
  169. // 300,
  170. // 300,
  171. // 300,
  172. // 300,
  173. // 300,
  174. // 300,
  175. // 300,
  176. // 300,
  177. // 300,
  178. // 300,
  179. // 300,
  180. // 300,
  181. // 300,
  182. // 300,
  183. // 300
  184. //];
  185. //window.Product.data.datasets[1].data = [
  186. // randomScalingFactor(100) + 200,
  187. // randomScalingFactor(100) + 200,
  188. // randomScalingFactor(100) + 200,
  189. // randomScalingFactor(100) + 200,
  190. // randomScalingFactor(100) + 200,
  191. // randomScalingFactor(100) + 200,
  192. // randomScalingFactor(100) + 200,
  193. // randomScalingFactor(100) + 200,
  194. // randomScalingFactor(100) + 200,
  195. // randomScalingFactor(100) + 200,
  196. // randomScalingFactor(100) + 200,
  197. // randomScalingFactor(100) + 200,
  198. // randomScalingFactor(100) + 200,
  199. // randomScalingFactor(100) + 200,
  200. // randomScalingFactor(100) + 200,
  201. // randomScalingFactor(100) + 200,
  202. // randomScalingFactor(100) + 200,
  203. // randomScalingFactor(100) + 200,
  204. // randomScalingFactor(100) + 200,
  205. // randomScalingFactor(100) + 200,
  206. // randomScalingFactor(100) + 200,
  207. // randomScalingFactor(100) + 200,
  208. // randomScalingFactor(100) + 200,
  209. // randomScalingFactor(100) + 200,
  210. // randomScalingFactor(100) + 200,
  211. // randomScalingFactor(100) + 200,
  212. // randomScalingFactor(100) + 200,
  213. // randomScalingFactor(100) + 200,
  214. // randomScalingFactor(100) + 200,
  215. // randomScalingFactor(100) + 200,
  216. // randomScalingFactor(100) + 200,
  217. // randomScalingFactor(100) + 200
  218. //];
  219. //window.Product.update();
  220. //===================================================
  221. $.get("rpt.ashx?m=BIG", function (data) {
  222. var jsondata = JSON.parse(data);
  223. if (jsondata["success"] == true) {
  224. for (var i = 1; i < jsondata["total"] + 1; i++) {
  225. $("#g" + i.toString().padStart(2, '0')).text(jsondata["rows"][i - 1]["GOODSCODE"]);
  226. $("#goods" + i.toString().padStart(2, '0')).attr('data-to', jsondata["rows"][i - 1]["NUM"]);
  227. $("#goods" + i.toString().padStart(2, '0')).countTo();
  228. }
  229. }
  230. });
  231. $.get("rpt.ashx?m=SMALL", function (data) {
  232. var jsondata = JSON.parse(data);
  233. if (jsondata["success"] == true) {
  234. for (var i = 1; i < jsondata["total"] + 1; i++) {
  235. $("#g" + (10 + i).toString()).text(jsondata["rows"][i - 1]["GOODSCODE"]);
  236. $("#goods" + (10 + i).toString()).attr('data-to', jsondata["rows"][i - 1]["NUM"]);
  237. $("#goods" + (10 + i).toString()).countTo();
  238. }
  239. }
  240. });
  241. $.get("rpt.ashx?m=TOTAL", function (data) {
  242. var jsondata = JSON.parse(data);
  243. if (jsondata["success"] == true) {
  244. for (var i = 0; i < jsondata["total"]; i++) {
  245. window.Product.data.labels[i] = jsondata["rows"][i]["TIME"];
  246. window.Product.data.datasets[0].data[i] = jsondata["rows"][0]["PLAN"];
  247. window.Product.data.datasets[1].data[i] = jsondata["rows"][i]["NUM"];
  248. }
  249. window.Product.update();
  250. }
  251. });
  252. }
  253. function initData() {
  254. window.chartColors = {
  255. red: 'rgb(255, 99, 132)',
  256. orange: 'rgb(255, 159, 64)',
  257. yellow: 'rgb(255, 250, 86)',
  258. green: 'rgb(75, 192, 192)',
  259. blue: 'rgb(54, 162, 250)',
  260. purple: 'rgb(153, 102, 255)',
  261. grey: 'rgb(231,233,237)'
  262. };
  263. var color = Chart.helpers.color;
  264. window.randomScalingFactor = function (num) {
  265. return Math.round(Math.random() * num);
  266. }
  267. Chart.defaults.global.defaultFontColor = 'white';
  268. Chart.defaults.global.defaultFontSize = 24;
  269. Chart.defaults.global.legend.display = false;
  270. //月交接数据=======================================
  271. window.configProduct = {
  272. data: {
  273. labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'],
  274. datasets: [{
  275. type: 'line',
  276. label: '计划入库数',
  277. backgroundColor: color(window.chartColors.orange).alpha(0.35).rgbString(),
  278. fill: false,
  279. borderColor: window.chartColors.orange,
  280. borderWidth: 2,
  281. pointRadius: 20,
  282. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  283. }, {
  284. label: '实际交接数量',
  285. backgroundColor: color(window.chartColors.blue).alpha(0.35).rgbString(),
  286. borderColor: window.chartColors.blue,
  287. borderWidth: 1,
  288. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  289. }]
  290. },
  291. type: 'bar',
  292. options: {
  293. legend: {
  294. display: true
  295. },
  296. title: {
  297. display: true,
  298. text: "产成品交接数据(月)"
  299. },
  300. tooltips: {
  301. mode: 'point',
  302. intersect: false
  303. },
  304. responsive: true,
  305. scales: {
  306. xAxes: [{
  307. stacked: false
  308. }],
  309. yAxes: [{
  310. display: true,
  311. stacked: false,
  312. ticks: {
  313. min: 0,
  314. stepSize: 1500,
  315. max: 6000
  316. }
  317. }]
  318. }
  319. }
  320. };
  321. var ctxProduct = document.getElementById("canvasProduct").getContext("2d");
  322. window.Product = new Chart(ctxProduct, configProduct);
  323. //===================================================
  324. }
  325. </script>
  326. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  327. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  328. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  329. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  330. </body>
  331. </html>