BurnIntoKanban.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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. <link rel="stylesheet" href="/plugins/bootstrap-4.3.1/css/bootstrap.min.css">
  14. <link rel="stylesheet" href="/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
  15. <link href="/Plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
  16. <title>东科软件</title>
  17. </head>
  18. <body>
  19. <div class="box_1920_1080">
  20. <div class="box_title" style="display:flex;flex-direction:row;">
  21. <div style="width:25%;text-align:left;"></div>
  22. <div style="width:50%;text-align:center; font-size:40px">烧成看板</div>
  23. <div style="width:25%;text-align:right;"></div>
  24. </div>
  25. <div class="box_body" style="display: flex; flex-direction: column;">
  26. <!--31天产量曲线图-->
  27. <div style="width:1840px;height:40%;display:flex;flex-direction:row;">
  28. <div style="width: 75%; height: 150px;">
  29. <canvas id="canvasDayCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 170px; width: 100% "></canvas>
  30. </div>
  31. </div>
  32. <div style="width:1840px;height:40%;display:flex;flex-direction:row; margin-top:-10%">
  33. <div style="width: 75%; height: 150px;">
  34. <canvas id="canvasMonthCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 170px; width: 100%;"></canvas>
  35. </div>
  36. </div>
  37. <div style=" margin-top: -121px">
  38. <table rules="none" align="right" style="width: 20%; height: 270px; margin-left:80%;margin-top:-471px ">
  39. <tr class="tr_title_warning">
  40. <td style="width: 8%; height: 60px; font-size: 30px; text-align: left" colspan="2"><strong><span id="sj" style="color:white;">2023-4-30 00:00</span></strong></td>
  41. </tr>
  42. <tr class="tr_title_warning">
  43. <td style="width: 8%; height: 95px; font-size: 35px; text-align: left ">月装窑量:&nbsp;&nbsp;&nbsp;<span id="ydm" style="color:white;"> 加载中...</span></td>
  44. </tr>
  45. <tr class="tr_title_warning">
  46. <td style="width: 8%; height: 95px; font-size: 35px; text-align: left ">月白坯入库:<span id="ycx" style="color:white;">加载中...</span></td>
  47. </tr>
  48. <tr class="tr_title_warning">
  49. <td style="width: 8%; height: 95px; font-size: 35px; text-align: left ">白坏库存:&nbsp;&nbsp;&nbsp;<span id="ygx" style="color:white;"> 加载中...</span></td>
  50. </tr>
  51. </table>
  52. </div>
  53. <!--表格-->
  54. <div style="width: 100%; height: 530px; display: flex; flex-direction: row; margin-top: -4%">
  55. <div style="width: 100%; height: 530px; ">
  56. <table cellspacing="0" cellpadding="0" border="0" style="width:50%;">
  57. <tr class="tr_title_warning">
  58. <td colspan="7" style="font-size: 30px; color: white;">烧成工序装窑、出窑个人数据</td>
  59. </tr>
  60. <tr class="tr_title_warning" style="height: 30px; font-size:27px">
  61. <td style="width: 15%;">工号</td>
  62. <td style="width: 15%;">数量</td>
  63. <td style="width: 15%;">工号</td>
  64. <td style="width: 15%;">数量</td>
  65. <td style="width: 15%;">工号</td>
  66. <td style="width: 15%;">数量</td>
  67. </tr>
  68. </table>
  69. <div style=" height:198px;overflow:hidden;">
  70. <table style="width: 50%; display:none;" id="StaffTable_template">
  71. <!--style=""-->
  72. <tr class="tr_title_warning" style="height: 30px; font-size: 20px">
  73. <td style="font-size: 18px; color: white; height: 30px; width: 16%; text-align: center ">{工号}</td>
  74. <td style="font-size: 20px; color: white; height: 30px; width: 16%; text-align: center">{数量}</td>
  75. <td style="font-size: 18px; color: white; height: 30px; width: 16%; text-align: center ">{工号1}</td>
  76. <td style="font-size: 20px; color: white; height: 30px; width: 16%; text-align: center">{数量1}</td>
  77. <td style="font-size: 18px; color: white; height: 30px; width: 16%; text-align: center ">{工号2}</td>
  78. <td style="font-size: 20px; color: white; height: 30px; width: 16%; text-align: center">{数量2}</td>
  79. </tr>
  80. </table>
  81. <table id="StaffTable" style="width: 50%;">
  82. </table>
  83. </div>
  84. <table cellspacing="0" cellpadding="0" border="0" style="width: 50%;">
  85. <tr class="tr_title_warning" style="height: 60px; font-size: 30px">
  86. <td colspan="3" style="width:50%">烧成缺陷率:<span id="dmqxl" style="color:white">——</span></td>
  87. <td colspan="3" style="width:50%">一烧产量:<span id="cxqxl" style="color:white">——</span></td>
  88. </tr>
  89. <tr class="tr_bg_light_warning" style="height: 50px; font-size: 25px">
  90. <td>缺陷</td>
  91. <td id="qxname1">缺陷1</td>
  92. <td id="qxname2">缺陷2</td>
  93. <td id="qxname3">缺陷3</td>
  94. <td id="qxname4">缺陷4</td>
  95. <td>其他</td>
  96. </tr>
  97. <tr class="tr_bg_light_warning" style="height: 60px; font-size: 25px ">
  98. <td>数量</td>
  99. <td id="sl1">1</td>
  100. <td id="sl2">2</td>
  101. <td id="sl3">3</td>
  102. <td id="sl4">4</td>
  103. <td id="sl5">5</td>
  104. </tr>
  105. <tr class="tr_bg_light_warning" style="height: 60px; font-size: 25px ">
  106. <td>缺陷率</td>
  107. <td id="qxl1">0%</td>
  108. <td id="qxl2">0%</td>
  109. <td id="qxl3">0%</td>
  110. <td id="qxl4">0%</td>
  111. <td id="qxl5">0%</td>
  112. </tr>
  113. </table>
  114. </div>
  115. </div>
  116. <div style="width: 52%; height: 530px; padding-right: 20px; margin-top: -530px; margin-left: 50% ">
  117. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  118. <tr class="tr_title_warning">
  119. <td colspan="4" style="color: white; font-size: 30px">成检实时数据(烧成缺陷数据)</td>
  120. </tr>
  121. <tr class="tr_title_warning">
  122. <td style="font-size: 27px; width: 25%; height: 30px; ">责任工号</td>
  123. <td style="font-size: 27px; width: 25%; height: 30px; ">产品编码</td>
  124. <td style="font-size: 27px; width: 25%; height: 30px; ">缺陷名称</td>
  125. <td style="font-size: 27px; width: 25%; height: 30px; ">产品分级</td>
  126. </tr>
  127. </table>
  128. <div style=" height: 448px; overflow: hidden;">
  129. <table id="dayTable_template" style="display:none;">
  130. <tr class="tr_bg_light_warning" style="height:30px;">
  131. <td style="font-size: 18px; width: 25%; height: 30px; ">{责任工号}</td>
  132. <td style="font-size: 18px; width: 25%; height: 30px; ">{生产线号}</td>
  133. <td style="font-size: 18px; width: 25%; height: 30px; ">{缺陷名称}</td>
  134. <td style="font-size: 18px; width: 25%; height: 30px; ">{产品分级}</td>
  135. </tr>
  136. </table>
  137. <table id="dayTable" style="width: 100%; ">
  138. </table>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <script>
  144. var refreshTime1 = 80000;
  145. var currentTime1 = 0;
  146. var doGetData;
  147. var doGetTime;
  148. var StaffInterval;
  149. var StaffTableRowCount = 0;
  150. var dayInterval;
  151. var dayTableRowCount = 0;
  152. //页面加载
  153. $(document).ready(function () {
  154. timeUp();
  155. initData();
  156. initData2();
  157. doGetData = setInterval(function () { loadServerTime(); }, 3000);
  158. doGetData = setInterval(function () { timeUp(); }, 40000);
  159. loadDayTable();
  160. });
  161. function timeUp() {
  162. loadData();
  163. StaffTable();
  164. DefectDetails();
  165. Alltotal();
  166. MonthSum();
  167. }
  168. function Alltotal() {
  169. $.get('BurnIntoKanban.ashx?m=Alltotal', function (data) {
  170. var json = JSON.parse(data);
  171. if (json["success"] == true) {
  172. $('#cxqxl').text(json["rows"][0]["一烧产量"] + "");
  173. $('#dmqxl').text( json["rows"][0]["缺陷率"]);
  174. }
  175. });
  176. }
  177. function MonthSum() {
  178. $.get('BurnIntoKanban.ashx?m=MonthSum', function (data) {
  179. var json = JSON.parse(data);
  180. if (json["success"] == true) {
  181. $('#ydm').text( json["rows"][0]["装窑"]);
  182. $('#ycx').text(json["rows"][1]["装窑"]);
  183. $('#ygx').text(json["rows"][2]["装窑"]);
  184. }
  185. });
  186. }
  187. function StaffTableScroll() {
  188. var scrollHeight = $("#StaffTable_template").find("tr").outerHeight();
  189. $("#StaffTable").animate({ marginTop: -scrollHeight, }, 500,
  190. function () {
  191. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  192. if (--StaffTableRowCount > -1) {
  193. } else {
  194. clearInterval(StaffInterval);
  195. StaffTable();
  196. }
  197. }
  198. );
  199. }
  200. function StaffTable() {
  201. clearInterval(StaffInterval);
  202. $.get("BurnIntoKanban.ashx?m=StaffTable", function (data) {
  203. var json = JSON.parse(data);
  204. if (json["success"] == true) {
  205. $("#StaffTable").html("");
  206. for (var i = 0; i < json["rows"].length; i++) {
  207. var temp = $("#StaffTable_template").html();
  208. temp = temp.replace("<tbody>", "").replace("</tbody>", "");
  209. temp = temp.replace('{工号}', json["rows"][i]['STAFFCODE']);
  210. temp = temp.replace('{数量}', json["rows"][i]['COUNTS']);
  211. temp = temp.replace('{工号1}', json["rows"][i]['STAFFCODE1']);
  212. temp = temp.replace('{数量1}', json["rows"][i]['COUNTS1']);
  213. temp = temp.replace('{工号2}', json["rows"][i]['STAFFCODE2']);
  214. temp = temp.replace('{数量2}', json["rows"][i]['COUNTS2']);
  215. $("#StaffTable").append(temp);
  216. }
  217. StaffTableRowCount = json["rows"].length;
  218. StaffInterval = setInterval(StaffTableScroll, 3000);
  219. }
  220. });
  221. }
  222. //表格滚动
  223. function dayTableScroll() {
  224. var scrollHeight = $("#dayTable_template").find("tr").outerHeight();
  225. $("#dayTable").animate({ marginTop: -scrollHeight, }, 500,
  226. function () {
  227. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  228. if (dayTableRowCount > -1) {
  229. dayTableRowCount--;
  230. console.log(dayTableRowCount);
  231. } else {
  232. clearInterval(dayInterval);
  233. loadDayTable();
  234. }
  235. }
  236. );
  237. }
  238. //明细表
  239. function loadDayTable() {
  240. $.get("BurnIntoKanban.ashx?m=MonthTable", function (data) {
  241. var json = JSON.parse(data);
  242. if (json["success"] == true) {
  243. $("#dayTable").html("");
  244. for (var i = 0; i < json["rows"].length; i++) {
  245. var temp = $("#dayTable_template").html();
  246. temp = temp.replace("<tbody>", "").replace("</tbody>", "");
  247. temp = temp.replace('{责任工号}', json["rows"][i]['责任工号']);
  248. temp = temp.replace('{生产线号}', json["rows"][i]['生产线号']);
  249. temp = temp.replace('{缺陷名称}', json["rows"][i]['缺陷名称']);
  250. temp = temp.replace('{产品分级}', json["rows"][i]['产品分级']);
  251. $("#dayTable").append(temp);
  252. }
  253. dayTableRowCount = json["rows"].length;
  254. dayInterval = setInterval(dayTableScroll, 6000);
  255. }
  256. });
  257. }
  258. function loadServerTime() {
  259. $.get('BurnIntoKanban.ashx?m=fwq', function (data) {
  260. var json = JSON.parse(data);
  261. if (json["success"] == true) {
  262. $('#sj').html(json["sj"]);
  263. }
  264. });
  265. }
  266. function DefectDetails() {
  267. $.get('BurnIntoKanban.ashx?m=DefectDetail', function (data) {
  268. var json = JSON.parse(data);
  269. if (json["success"] == true) {
  270. $('#sl5').text(json["rows"][0]["其他缺陷数量"]);
  271. $('#qxl5').text(json["rows"][0]["其他缺陷率"]);
  272. for (var i = 0; i < json["rows"].length; i++) {
  273. var qx = '#qxname' + (i + 1);
  274. var sl = '#sl' + (i + 1);
  275. var qxl = '#qxl' + (i + 1);
  276. $(qx).text(json["rows"][i]["缺陷名称"]);
  277. $(sl).text(json["rows"][i]["缺陷数量"]);
  278. $(qxl).text(json["rows"][i]["缺陷率"]);
  279. }
  280. }
  281. });
  282. }
  283. function loadData() {
  284. $.get("BurnIntoKanban.ashx?m=rate", function (data) {
  285. clearData();
  286. var json = JSON.parse(data);
  287. if (json["success"] == true) {
  288. for (var n = 0; n < json["rows"].length; n++) {
  289. window.DayCL.data.labels.push(json["rows"][n]["SJ"]);
  290. window.DayCL.data.datasets[0].data[n] = (json["rows"][n]["入库"]);
  291. }
  292. }
  293. window.DayCL.update();
  294. });
  295. $.get("BurnIntoKanban.ashx?m=rate", function (data) {
  296. clearData2();
  297. var json = JSON.parse(data);
  298. if (json["success"] == true) {
  299. for (var n = 0; n < json["rows"].length; n++) {
  300. window.MonthCL.data.labels.push(json["rows"][n]["SJ"]);
  301. window.MonthCL.data.datasets[0].data[n] = (json["rows"][n]["装窑"]);
  302. }
  303. }
  304. window.MonthCL.update();
  305. });
  306. }
  307. function clearData() {
  308. //清除数据
  309. window.DayCL.data.labels = [];
  310. window.DayCL.data.datasets[0].data = [];
  311. window.DayCL.update();
  312. }
  313. function clearData2() {
  314. //清除数据
  315. window.MonthCL.data.labels = [];
  316. window.MonthCL.data.datasets[0].data = [];
  317. window.MonthCL.update();
  318. }
  319. function initData() {
  320. window.chartColors = {
  321. red: 'rgb(255, 99, 132)',
  322. orange: 'rgb(255, 159, 64)',
  323. yellow: 'rgb(255, 250, 86)',
  324. green: 'rgb(75, 192, 192)',
  325. blue: 'rgb(54, 162, 250)',
  326. purple: 'rgb(153, 102, 255)',
  327. grey: 'rgb(231,233,237)'
  328. };
  329. var color = Chart.helpers.color;
  330. window.randomScalingFactor = function (num) {
  331. return Math.round(Math.random() * num);
  332. }
  333. Chart.defaults.global.defaultFontColor = 'white';
  334. Chart.defaults.global.defaultFontSize = 15;
  335. Chart.defaults.global.legend.display = false;
  336. //每小时产量=========================================
  337. window.configDayCL = {
  338. data: {
  339. labels: [],
  340. datasets: [
  341. {
  342. //label: "近七日本烧合格率",
  343. label: "白坯入库量",
  344. fill: false,
  345. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  346. borderColor: window.chartColors.red,
  347. borderWidth: 2,
  348. pointRadius: 15,
  349. data: []
  350. }
  351. ]
  352. },
  353. type: 'line',
  354. options: {
  355. responsive: true,
  356. legend: {
  357. display: true
  358. },
  359. title: {
  360. display: false,
  361. text: '每小时产量'
  362. },
  363. tooltips: {
  364. mode: 'index',
  365. intersect: false,
  366. },
  367. hover: {
  368. mode: 'nearest',
  369. intersect: true
  370. },
  371. scales: {
  372. xAxes: [{
  373. display: true,
  374. scaleLabel: {
  375. display: false,
  376. labelString: ''
  377. }
  378. }],
  379. yAxes: [{
  380. display: true,
  381. scaleLabel: {
  382. display: false,
  383. labelString: 'Value' }
  384. }]
  385. }
  386. }
  387. };
  388. var ctxDayCL = document.getElementById("canvasDayCL").getContext("2d");
  389. window.DayCL = new Chart(ctxDayCL, configDayCL);
  390. }
  391. function initData2() {
  392. window.chartColors = {
  393. red: 'rgb(255, 99, 132)',
  394. orange: 'rgb(255, 159, 64)',
  395. yellow: 'rgb(255, 250, 86)',
  396. green: 'rgb(75, 192, 192)',
  397. blue: 'rgb(54, 162, 250)',
  398. purple: 'rgb(153, 102, 255)',
  399. grey: 'rgb(231,233,237)'
  400. };
  401. var color = Chart.helpers.color;
  402. window.randomScalingFactor = function (num) {
  403. return Math.round(Math.random() * num);
  404. }
  405. Chart.defaults.global.defaultFontColor = 'white';
  406. Chart.defaults.global.defaultFontSize = 13;
  407. Chart.defaults.global.legend.display = false;
  408. //甲班缺陷===========================================
  409. window.configMonthCL = {
  410. data: {
  411. labels: [],
  412. datasets: [
  413. {
  414. //label: "近七日整体合格率",
  415. label: "日装窑量",
  416. fill: false,
  417. backgroundColor: color(window.chartColors.purple).alpha(0.6).rgbString(),
  418. borderColor: window.chartColors.purple,
  419. borderWidth: 2,
  420. pointRadius: 15,
  421. data: []
  422. }
  423. ]
  424. },
  425. type: 'line',
  426. options: {
  427. responsive: true,
  428. legend: {
  429. display: true
  430. },
  431. title: {
  432. display: false,
  433. text: '每小时产量'
  434. },
  435. tooltips: {
  436. mode: 'index',
  437. intersect: false,
  438. },
  439. hover: {
  440. mode: 'nearest',
  441. intersect: true
  442. },
  443. scales: {
  444. xAxes: [{
  445. display: true,
  446. scaleLabel: {
  447. display: false,
  448. labelString: ''
  449. }
  450. }],
  451. yAxes: [{
  452. display: true,
  453. scaleLabel: {
  454. display: false,
  455. labelString: 'Value'
  456. }
  457. }]
  458. }
  459. }
  460. };
  461. var ctxMonthCL = document.getElementById("canvasMonthCL").getContext("2d");
  462. window.MonthCL = new Chart(ctxMonthCL, configMonthCL);
  463. //===================================================
  464. }
  465. </script>
  466. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  467. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  468. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  469. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  470. </body>
  471. </html>