index2.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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 href="/Plugins/animate/animate.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../DashBoard.css?v3" />
  10. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  11. <script src="/Plugins/animate/xanimate.js"></script>
  12. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  13. <title>东科软件</title>
  14. </head>
  15. <body style="background-color:black;">
  16. <div class="box_1920_1080">
  17. <div class="box_title" style="display:flex;flex-direction:row;">
  18. <div style="width:30%;text-align:left;"></div>
  19. <div style="width: 40%; text-align: center; font-size: 38px; font-weight: 700">成检工序看板</div>
  20. <div style="width:30%;text-align:right;"><span class="box_title_loading" style="font-size:32px;" id="报表加载"></span></div>
  21. </div>
  22. <div class="box_body" style="display: flex; flex-direction: column;">
  23. <!--31天产量曲线图-->
  24. <div style="width:1840px;height:400px;display:flex;flex-direction:row;">
  25. <div style="width: 100%; height: 400px;">
  26. <div style="color:white;font-size:20px;font-weight:600; text-align:center">每日产量计划达成</div>
  27. <canvas id="canvasDayCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 350px; width: 100%"></canvas>
  28. </div>
  29. </div>
  30. <!--表格-->
  31. <div style="width:1840px;height:530px;display:flex;flex-direction:row;">
  32. <div style="width: 50%;height:530px;padding-right:20px;">
  33. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  34. <tr class="tr_title_warning">
  35. <td colspan="9" style="color:white;">每日型号达成情况</td>
  36. </tr>
  37. <tr class="tr_title_warning">
  38. <td style="font-size: 18px; width: 20%">产品型号</td>
  39. <td style="font-size: 18px; width: 20%">计划数量</td>
  40. <td style="font-size: 18px; width: 20%">达成数量</td>
  41. <td style="font-size: 18px; width: 20%">差异数量</td>
  42. <td style="font-size: 18px; width: 20%">达成率</td>
  43. </tr>
  44. </table>
  45. <div style="display:flex; height:460px;overflow:hidden;">
  46. <table id="dayTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  47. <tr class="tr_bg_light_warning" style="height:30px;">
  48. <td style="font-size: 18px; width: 20%" id="dg1">--</td>
  49. <td style="font-size: 18px; width: 20%" id="dp1">--</td>
  50. <td style="font-size: 18px; width: 20%" id="dc1">--</td>
  51. <td style="font-size: 18px; width: 20%" id="dcy1">--</td>
  52. <td style="font-size: 18px; width: 20%" id="dr1">--</td>
  53. </tr>
  54. <tr class="tr_bg_light_warning" style="height:30px;">
  55. <td style="font-size: 18px; width: 20%" id="dg2">--</td>
  56. <td style="font-size: 18px; width: 20%" id="dp2">--</td>
  57. <td style="font-size: 18px; width: 20%" id="dc2">--</td>
  58. <td style="font-size: 18px; width: 20%" id="dcy2">--</td>
  59. <td style="font-size: 18px; width: 20%" id="dr2">--</td>
  60. </tr>
  61. <tr class="tr_bg_light_warning" style="height:30px;">
  62. <td style="font-size: 18px; width: 20%" id="dg3">--</td>
  63. <td style="font-size: 18px; width: 20%" id="dp3">--</td>
  64. <td style="font-size: 18px; width: 20%" id="dc3">--</td>
  65. <td style="font-size: 18px; width: 20%" id="dcy3">--</td>
  66. <td style="font-size: 18px; width: 20%" id="dr3">--</td>
  67. </tr>
  68. <tr class="tr_bg_light_warning" style="height:30px;">
  69. <td style="font-size: 18px; width: 20%" id="dg4">--</td>
  70. <td style="font-size: 18px; width: 20%" id="dp4">--</td>
  71. <td style="font-size: 18px; width: 20%" id="dc4">--</td>
  72. <td style="font-size: 18px; width: 20%" id="dcy4">--</td>
  73. <td style="font-size: 18px; width: 20%" id="dr4">--</td>
  74. </tr>
  75. <tr class="tr_bg_light_warning" style="height:30px;">
  76. <td style="font-size: 18px; width: 20%" id="dg5">--</td>
  77. <td style="font-size: 18px; width: 20%" id="dp5">--</td>
  78. <td style="font-size: 18px; width: 20%" id="dc5">--</td>
  79. <td style="font-size: 18px; width: 20%" id="dcy5">--</td>
  80. <td style="font-size: 18px; width: 20%" id="dr5">--</td>
  81. </tr>
  82. <tr class="tr_bg_light_warning" style="height:30px;">
  83. <td style="font-size: 18px; width: 20%" id="dg6">--</td>
  84. <td style="font-size: 18px; width: 20%" id="dp6">--</td>
  85. <td style="font-size: 18px; width: 20%" id="dc6">--</td>
  86. <td style="font-size: 18px; width: 20%" id="dcy6">--</td>
  87. <td style="font-size: 18px; width: 20%" id="dr6">--</td>
  88. </tr>
  89. <tr class="tr_bg_light_warning" style="height:30px;">
  90. <td style="font-size: 18px; width: 20%" id="dg7">--</td>
  91. <td style="font-size: 18px; width: 20%" id="dp7">--</td>
  92. <td style="font-size: 18px; width: 20%" id="dc7">--</td>
  93. <td style="font-size: 18px; width: 20%" id="dcy7">--</td>
  94. <td style="font-size: 18px; width: 20%" id="dr7">--</td>
  95. </tr>
  96. <tr class="tr_bg_light_warning" style="height:30px;">
  97. <td style="font-size: 18px; width: 20%" id="dg8">--</td>
  98. <td style="font-size: 18px; width: 20%" id="dp8">--</td>
  99. <td style="font-size: 18px; width: 20%" id="dc8">--</td>
  100. <td style="font-size: 18px; width: 20%" id="dcy8">--</td>
  101. <td style="font-size: 18px; width: 20%" id="dr8">--</td>
  102. </tr>
  103. <tr class="tr_bg_light_warning" style="height:30px;">
  104. <td style="font-size: 18px; width: 20%" id="dg9">--</td>
  105. <td style="font-size: 18px; width: 20%" id="dp9">--</td>
  106. <td style="font-size: 18px; width: 20%" id="dc9">--</td>
  107. <td style="font-size: 18px; width: 20%" id="dcy9">--</td>
  108. <td style="font-size: 18px; width: 20%" id="dr9">--</td>
  109. </tr>
  110. </table>
  111. </div>
  112. </div>
  113. <div style="width: 50%;height:530px;padding-right:20px;">
  114. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  115. <tr class="tr_title_warning">
  116. <td colspan="9" style="color:white;">每月型号达成情况</td>
  117. </tr>
  118. <tr class="tr_title_warning">
  119. <td style="font-size: 18px; width: 20%">产品型号</td>
  120. <td style="font-size: 18px; width: 20%">计划数量</td>
  121. <td style="font-size: 18px; width: 20%">达成数量</td>
  122. <td style="font-size: 18px; width: 20%">差异数量</td>
  123. <td style="font-size: 18px; width: 20%">达成率</td>
  124. </tr>
  125. </table>
  126. <div style="display:flex; height:460px;overflow:hidden;">
  127. <table id="monthTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  128. <tr class="tr_bg_light_warning" style="height:30px;">
  129. <td style="font-size: 18px; width: 20%" id="mg1">--</td>
  130. <td style="font-size: 18px; width: 20%" id="mp1">--</td>
  131. <td style="font-size: 18px; width: 20%" id="mc1">--</td>
  132. <td style="font-size: 18px; width: 20%" id="mcy1">--</td>
  133. <td style="font-size: 18px; width: 20%" id="mr1">--</td>
  134. </tr>
  135. <tr class="tr_bg_light_warning" style="height:30px;">
  136. <td style="font-size: 18px; width: 20%" id="mg2">--</td>
  137. <td style="font-size: 18px; width: 20%" id="mp2">--</td>
  138. <td style="font-size: 18px; width: 20%" id="mc2">--</td>
  139. <td style="font-size: 18px; width: 20%" id="mcy2">--</td>
  140. <td style="font-size: 18px; width: 20%" id="mr2">--</td>
  141. </tr>
  142. <tr class="tr_bg_light_warning" style="height:30px;">
  143. <td style="font-size: 18px; width: 20%" id="mg3">--</td>
  144. <td style="font-size: 18px; width: 20%" id="mp3">--</td>
  145. <td style="font-size: 18px; width: 20%" id="mc3">--</td>
  146. <td style="font-size: 18px; width: 20%" id="mcy3">--</td>
  147. <td style="font-size: 18px; width: 20%" id="mr3">--</td>
  148. </tr>
  149. <tr class="tr_bg_light_warning" style="height:30px;">
  150. <td style="font-size: 18px; width: 20%" id="mg4">--</td>
  151. <td style="font-size: 18px; width: 20%" id="mp4">--</td>
  152. <td style="font-size: 18px; width: 20%" id="mc4">--</td>
  153. <td style="font-size: 18px; width: 20%" id="mcy4">--</td>
  154. <td style="font-size: 18px; width: 20%" id="mr4">--</td>
  155. </tr>
  156. <tr class="tr_bg_light_warning" style="height:30px;">
  157. <td style="font-size: 18px; width: 20%" id="mg5">--</td>
  158. <td style="font-size: 18px; width: 20%" id="mp5">--</td>
  159. <td style="font-size: 18px; width: 20%" id="mc5">--</td>
  160. <td style="font-size: 18px; width: 20%" id="mcy5">--</td>
  161. <td style="font-size: 18px; width: 20%" id="mr5">--</td>
  162. </tr>
  163. <tr class="tr_bg_light_warning" style="height:30px;">
  164. <td style="font-size: 18px; width: 20%" id="mg6">--</td>
  165. <td style="font-size: 18px; width: 20%" id="mp6">--</td>
  166. <td style="font-size: 18px; width: 20%" id="mc6">--</td>
  167. <td style="font-size: 18px; width: 20%" id="mcy6">--</td>
  168. <td style="font-size: 18px; width: 20%" id="mr6">--</td>
  169. </tr>
  170. <tr class="tr_bg_light_warning" style="height:30px;">
  171. <td style="font-size: 18px; width: 20%" id="mg7">--</td>
  172. <td style="font-size: 18px; width: 20%" id="mp7">--</td>
  173. <td style="font-size: 18px; width: 20%" id="mc7">--</td>
  174. <td style="font-size: 18px; width: 20%" id="mcy7">--</td>
  175. <td style="font-size: 18px; width: 20%" id="mr7">--</td>
  176. </tr>
  177. <tr class="tr_bg_light_warning" style="height:30px;">
  178. <td style="font-size: 18px; width: 20%" id="mg8">--</td>
  179. <td style="font-size: 18px; width: 20%" id="mp8">--</td>
  180. <td style="font-size: 18px; width: 20%" id="mc8">--</td>
  181. <td style="font-size: 18px; width: 20%" id="mcy8">--</td>
  182. <td style="font-size: 18px; width: 20%" id="mr8">--</td>
  183. </tr>
  184. <tr class="tr_bg_light_warning" style="height:30px;">
  185. <td style="font-size: 18px; width: 20%" id="mg9">--</td>
  186. <td style="font-size: 18px; width: 20%" id="mp9">--</td>
  187. <td style="font-size: 18px; width: 20%" id="mc9">--</td>
  188. <td style="font-size: 18px; width: 20%" id="mcy9">--</td>
  189. <td style="font-size: 18px; width: 20%" id="mr9">--</td>
  190. </tr>
  191. </table>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <script>
  198. var refreshTime1 = 80000;
  199. var currentTime1 = 0;
  200. var doGetData;
  201. var doGetTime;
  202. $(document).ready(function () {
  203. initData();
  204. clearData();
  205. doGetData = setInterval(function () { timeUpdate(); }, 1000);
  206. setInterval(tableScroll, 3000);
  207. });
  208. //滚动方法
  209. function tableScroll() {
  210. var scrollHeight = $("#dayTable").find("tr").outerHeight();
  211. $("#dayTable").animate({ marginTop: -scrollHeight, }, 500,
  212. function () {
  213. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  214. }
  215. );
  216. var scrollHeight = $("#monthTable").find("tr").outerHeight();
  217. $("#monthTable").animate({ marginTop: -scrollHeight, }, 500,
  218. function () {
  219. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  220. }
  221. );
  222. }
  223. function clearData() {
  224. //清除数据
  225. window.DayCL.data.labels = [];
  226. window.DayCL.data.datasets[0].data = [];
  227. window.DayCL.data.datasets[1].data = [];
  228. window.DayCL.update();
  229. }
  230. function timeUpdate() {
  231. if (currentTime1 <= 0) {
  232. //clearData();
  233. setTimeout(loadData(), 1000);
  234. //loadData();
  235. currentTime1 = refreshTime1;
  236. }
  237. else {
  238. if (currentTime1 > 0) {
  239. $('#报表加载').html('刷新:' + currentTime1 / 1000 + ' 秒');
  240. currentTime1 = currentTime1 - 1000;
  241. }
  242. }
  243. }
  244. function loadData() {
  245. $.get("rpt.ashx?m=table1", function (data) {
  246. var json = JSON.parse(data);
  247. if (json["success"] == true) {
  248. for (var i = 0; i < json["rows"].length; i++) {
  249. $('#dg' + (i + 1).toString()).text(json["rows"][i]["GOODSCODE"]);
  250. $('#dp' + (i + 1).toString()).text(json["rows"][i]["NUM1"]);
  251. $('#dc' + (i + 1).toString()).text(json["rows"][i]["NUM2"]);
  252. $('#dcy' + (i + 1).toString()).text(json["rows"][i]["NUM3"]);
  253. $('#dr' + (i + 1).toString()).text(json["rows"][i]["RATE"]);
  254. }
  255. }
  256. });
  257. $.get("rpt.ashx?m=table2", function (data) {
  258. var json = JSON.parse(data);
  259. if (json["success"] == true) {
  260. for (var i = 0; i < json["rows"].length; i++) {
  261. $('#mg' + (i + 1).toString()).text(json["rows"][i]["GOODSCODE"]);
  262. $('#mp' + (i + 1).toString()).text(json["rows"][i]["NUM1"]);
  263. $('#mc' + (i + 1).toString()).text(json["rows"][i]["NUM2"]);
  264. $('#mcy' + (i + 1).toString()).text(json["rows"][i]["NUM3"]);
  265. $('#mr' + (i + 1).toString()).text(json["rows"][i]["RATE"]);
  266. }
  267. }
  268. });
  269. $.get("rpt.ashx?m=rate", function (data) {
  270. clearData();
  271. var json = JSON.parse(data);
  272. if (json["success"] == true) {
  273. for (var n = 0; n < json["rows"].length; n++) {
  274. window.DayCL.data.labels.push(json["rows"][n]["SJ"]);
  275. window.DayCL.data.datasets[0].data[n] = (json["rows"][n]["NUM1"]);
  276. window.DayCL.data.datasets[1].data[n] = (json["rows"][n]["NUM2"]);
  277. }
  278. window.DayCL.update();
  279. }
  280. });
  281. }
  282. function initData() {
  283. window.chartColors = {
  284. red: 'rgb(255, 99, 132)',
  285. orange: 'rgb(255, 159, 64)',
  286. yellow: 'rgb(255, 250, 86)',
  287. green: 'rgb(75, 192, 192)',
  288. blue: 'rgb(54, 162, 250)',
  289. purple: 'rgb(153, 102, 255)',
  290. grey: 'rgb(231,233,237)'
  291. };
  292. var color = Chart.helpers.color;
  293. window.randomScalingFactor = function (num) {
  294. return Math.round(Math.random() * num);
  295. }
  296. Chart.defaults.global.defaultFontColor = 'white';
  297. Chart.defaults.global.defaultFontSize = 18;
  298. Chart.defaults.global.legend.display = false;
  299. //每小时产量=========================================
  300. window.configDayCL = {
  301. data: {
  302. labels: [],
  303. datasets: [{
  304. label: "日计划",
  305. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  306. borderColor: window.chartColors.orange,
  307. borderWidth: 2,
  308. pointRadius: 15,
  309. data: [],
  310. fill: false,
  311. }, {
  312. label: "日达成",
  313. fill: false,
  314. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  315. borderColor: window.chartColors.blue,
  316. borderWidth: 2,
  317. pointRadius: 15,
  318. data: []
  319. }]
  320. },
  321. type: 'line',
  322. options: {
  323. responsive: true,
  324. legend: {
  325. display: true
  326. },
  327. title: {
  328. display: false,
  329. text: '每小时产量'
  330. },
  331. tooltips: {
  332. mode: 'index',
  333. intersect: false,
  334. },
  335. hover: {
  336. mode: 'nearest',
  337. intersect: true
  338. },
  339. scales: {
  340. xAxes: [{
  341. display: true,
  342. scaleLabel: {
  343. display: false,
  344. labelString: ''
  345. }
  346. }],
  347. yAxes: [{
  348. display: true,
  349. scaleLabel: {
  350. display: false,
  351. labelString: 'Value'
  352. }
  353. }]
  354. }
  355. }
  356. };
  357. var ctxDayCL = document.getElementById("canvasDayCL").getContext("2d");
  358. window.DayCL = new Chart(ctxDayCL, configDayCL);
  359. //===================================================
  360. ////月饼图===========================================
  361. //window.configMonthCL = {
  362. // data: {
  363. // labels: ['待达成', '月达成'],
  364. // datasets: [{
  365. // label: '工序',
  366. // backgroundColor: [
  367. // color(window.chartColors.red).alpha(0.35).rgbString(),
  368. // color(window.chartColors.blue).alpha(0.35).rgbString(),
  369. // color(window.chartColors.green).alpha(0.35).rgbString(),
  370. // color(window.chartColors.orange).alpha(0.35).rgbString(),
  371. // color(window.chartColors.purple).alpha(0.35).rgbString()
  372. // ],
  373. // fill: false,
  374. // borderColor: [
  375. // window.chartColors.red,
  376. // window.chartColors.blue,
  377. // window.chartColors.green,
  378. // window.chartColors.orange,
  379. // window.chartColors.purple
  380. // ],
  381. // borderWidth: 2,
  382. // pointRadius: 30,
  383. // data: [0, 0]
  384. // }]
  385. // },
  386. // type: 'doughnut',
  387. // options: {
  388. // legend: {
  389. // display: true
  390. // },
  391. // title: {
  392. // display: false,
  393. // text: ""
  394. // },
  395. // tooltips: {
  396. // mode: 'point',
  397. // intersect: false
  398. // },
  399. // responsive: true
  400. // }
  401. //};
  402. //var ctxMonthCL = document.getElementById("canvasMonthCL").getContext("2d");
  403. //window.MonthCL = new Chart(ctxMonthCL, configMonthCL);
  404. ////===================================================
  405. }
  406. </script>
  407. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  408. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  409. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  410. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  411. </body>
  412. </html>