SecondaryCheck.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  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="/plugins/bootstrap-4.3.1/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
  10. <link href="/Plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
  11. <link rel="stylesheet" href="../DashBoard.css?v3" />
  12. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  13. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  14. <title>东科软件</title>
  15. </head>
  16. <body class="bg-white p-0 dk-report">
  17. <!--实时缺陷记录-->
  18. <div class="container-fluid pt-1 p-0 box_1920_1080">
  19. <div class="position-absolute">
  20. <span id="实时缺陷加载" class="dk-report-loading" style="padding-left: 290px; font-size: 15px; color: #38dcff; font-weight: 700; float: left; padding-top: 40px;"></span>
  21. <!--<span id="页面跳转" class="dk-report-loading" style="padding-left: 1080px; font-size: 15px; color: #38dcff; font-weight: 700; float: left; margin-top: 40px; ">页面跳转倒计时</span>-->
  22. </div>
  23. <h4 class="text-center pb-2 dk-report-title" style="font-size: 60px; font-weight: bolder;color: #f8f9fa;">二检看板</h4>
  24. <table id="二检" class="table-hover table-striped" style="font-size: 14px; width: 1866px; margin-left: 27px; margin-top: -10px;">
  25. <thead style="border: 1px solid #38dcff ">
  26. <tr style="height: 47px; width: 1866px;">
  27. <!--<td scope="col" class="text-center" style="width: 130px; font-size: 40px; color: #f8f9fa;"><div id="wendu" name="wendu"></div></td>
  28. <td id="shidu" name="shidu" scope="col" class="text-center" style="width: 130px; font-size: 40px; color: #f8f9fa;"><div id="shidu" name="shidu"></div></td>-->
  29. <td scope="col" class="text-center" style="text-align: right;width: 130px; font-size: 30px; color: #f8f9fa; ">
  30. <div id="dqsj" name="dqsj" style="float: right"></div>
  31. </td>
  32. </tr>
  33. </thead>
  34. </table>
  35. <div>
  36. <table class="table-hover table-striped" style="font-size: 14px; width: 1866px; margin-left: 27px; margin-top: -15px;">
  37. <tr style="height: 47px; width: 1866px;">
  38. <td scope="col" class="text-center" id="sumjs" style="width: 918px; font-size: 75px; color: #f8f9fa; ">--</td>
  39. <td scope="col" class="text-center" id="sumhgl" style="width: 918px; font-size: 75px; color: #f8f9fa; ">总合格率:100%</td>
  40. </tr>
  41. </table>
  42. <div id="1" class="box_body" style="display: flex; flex-direction: column; display:block;">
  43. <!-- #region 横板 -->
  44. <table id="二检一期上" class="table-hover table-striped" style="font-size: 14px; width: 919px; margin-left: -10px; margin-top: -10px;">
  45. <thead style="border: 1px solid #38dcff ">
  46. <tr style="height: 47px; width: 1866px;">
  47. <td scope="col" class="text-center" style="width: 130px; height: 65px; font-size: 37px; color: #f8f9fa; font-weight: bolder; " colspan="3"><div id="JS2" name="JS2">一线产量:0</div></td>
  48. </tr>
  49. <!--<tr style="height: 47px; width: 1866px;">
  50. <td scope="col" class="text-center" style="width: 130px; height: 65px; font-size: 37px; color: #f8f9fa; font-weight: bolder; " colspan="5"><div id="JS2" name="JS2"></div></td>
  51. </tr>-->
  52. <tr style="height: 47px; width: 1866px;">
  53. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">缺陷类别</td>
  54. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">上水</td>
  55. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">规整度</td>
  56. </tr>
  57. <tr style="height: 47px;">
  58. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">数量</td>
  59. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="sl11">-</td>
  60. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="sl12">-</td>
  61. </tr>
  62. <tr style="height: 47px;">
  63. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">缺陷率</td>
  64. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="qxl11">-</td>
  65. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="qxl12">-</td>
  66. </tr>
  67. <tr style="height: 71px;">
  68. <td scope="col" class="text-center" style="width: 130px; font-size: 25px;">前三部位</td>
  69. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" id="qsbw11">-</td>
  70. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" id="qsbw12">-</td>
  71. </tr>
  72. <tr style="height: 47px;">
  73. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">合格率</td>
  74. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " colspan="2" id="sumhgl1">-</td>
  75. </tr>
  76. <tr style="height: 47px;">
  77. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">废品率</td>
  78. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " colspan="2" id="gxfpll4">-</td>
  79. </tr>
  80. </table>
  81. <table id="二检二期上" class="table-hover table-striped" style="font-size: 14px; width: 919px; margin-left: -10px; margin-top: -10px; ">
  82. <thead style="border: 1px solid #38dcff ">
  83. <tr style="height: 47px; width: 1866px;">
  84. <td scope="col" class="text-center" style="width: 130px; height: 66px; font-size: 37px; color: #f8f9fa; font-weight: bolder; " colspan="5"><div id="JS5" name="JS5">二线产量:0</div></td>
  85. </tr>
  86. <!--<tr style="height: 47px; width: 1866px;">
  87. <td scope="col" class="text-center" style="width: 130px; height: 65px; font-size: 37px; color: #f8f9fa; font-weight: bolder; " colspan="5"><div id="JS5" name="JS5"></div></td>
  88. </tr>-->
  89. <tr style="height: 48px; width: 1866px;">
  90. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">缺陷类别</td>
  91. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">上水</td>
  92. <td scope="col" class="text-center" style="width: 130px; font-size: 37px;">规整度</td>
  93. </tr>
  94. <tr style="height: 49px;">
  95. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">数量</td>
  96. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="sl1">-</td>
  97. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="sl2">-</td>
  98. </tr>
  99. <tr style="height: 49px;">
  100. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">缺陷率</td>
  101. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="qxl1">-</td>
  102. <td scope="col" class="text-center" style="width: 130px; font-size: 23px; " id="qxl2">-</td>
  103. </tr>
  104. <tr style="height: 73px;">
  105. <td scope="col" class="text-center" style="width: 130px; font-size: 25px;">前三部位</td>
  106. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" id="qsbw1">-</td>
  107. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" id="qsbw2">-</td>
  108. </tr>
  109. <tr style="height: 50px;">
  110. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">合格率</td>
  111. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" colspan="2" id="sumhgl2">-</td>
  112. </tr>
  113. <tr style="height: 50px;">
  114. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;">废品率</td>
  115. <td scope="col" class="text-center" style="width: 130px; font-size: 23px;" colspan="2" id="fpl1">-</td>
  116. </tr>
  117. </table>
  118. <div style="width: 960px; height: 550px; padding-left: 24px; margin-top: -100px; ">
  119. <table id="一线产量明细" class="table-hover table-striped" style="font-size: 14px; width: 480px; position: absolute; right: 28px; absolute; top: 156px; width: 459px; margin-right: 458px; margin-top: 90px; ">
  120. <thead style="border: 1px solid #38dcff ">
  121. <tr style="height: 65px;">
  122. <td scope="col" class="text-center" style="width: 92px; font-size: 40px;" colspan="2">一线</td>
  123. </tr>
  124. <tr style="height: 64px;">
  125. <td scope="col" class="text-center" style="width: 92px; font-size: 35px; ">工号</td>
  126. <td scope="col" class="text-center" style="width: 92px; font-size: 35px; ">产量</td>
  127. </tr>
  128. </thead>
  129. </table>
  130. <div style="font-size: 14px; width: 920px; height: 706px; overflow: hidden; position: absolute; right: 28px; absolute; top: -122px; width: 459px; margin-right: 458px; margin-top: 504px; ">
  131. <table id="二检一线产量明细" style="display: none; border: 1px solid #38dcff ">
  132. <tr style="height:64px;">
  133. <td style="font-size: 35px; width: 92px;">{工号1}</td>
  134. <td style="font-size: 35px; width: 92px;" id="二检一线产量">{产量1}</td>
  135. </tr>
  136. </table>
  137. <table id="DD1" cellspacing="0" cellpadding="0" border="0" style="margin-top: 10px; width: 100%; font-size: 35px; margin-top: 0px ">
  138. </table>
  139. </div>
  140. </div>
  141. <div>
  142. <table id="二线产量明细" class="table-hover table-striped" style="font-size: 14px; width: 460px; position: absolute; right: 28px; absolute; top: 156px; width: 459px; margin-left: 0px; margin-top: 90px; ">
  143. <thead style="border: 1px solid #38dcff ">
  144. <tr style="height: 65px;">
  145. <td scope="col" class="text-center" style="width: 92px; font-size: 40px;" colspan="2">二线</td>
  146. </tr>
  147. <tr style="height: 64px; ">
  148. <td scope="col" class="text-center" style="width: 92px; font-size: 35px; ">工号</td>
  149. <td scope="col" class="text-center" style="width: 92px; font-size: 35px; ">产量</td>
  150. </tr>
  151. </thead>
  152. </table>
  153. <div style="font-size: 14px; width: 920px; height: 706px; overflow: hidden; position: absolute; right: 28px; absolute; top: -122px; width: 459px; margin-right: 0px; margin-top: 504px; ">
  154. <table id="二检二线产量明细" style="display: none; border: 1px solid #38dcff ">
  155. <tr style="height:64px;">
  156. <td style="font-size: 35px; width: 92px;">{工号2}</td>
  157. <td style="font-size: 35px; width: 92px;"id="二检二线产量">{产量2}</td>
  158. </tr>
  159. </table>
  160. <table id="DD2" cellspacing="0" cellpadding="0" border="0" style="margin-top: 10px; width: 100%; font-size: 35px; margin-top: 0px ">
  161. </table>
  162. </div>
  163. </div>
  164. <div style="width: 960px; height: 530px; padding-right: 10px; padding-left: 24px; margin-top: -100px; ">
  165. <table id="二检二期下" class="table-hover table-striped" style="font-size: 14px; width: 920px; position: absolute; right: 28px; absolute; top: 156px; width: 918px; margin-left: 27px; margin-top: 489px; ">
  166. <thead style="border: 1px solid #38dcff ">
  167. <tr style="height: 65px; width: 1866px;">
  168. <td scope="col" class="text-center" style="width: 153px; font-size: 20px; ">责任工号</td>
  169. <td scope="col" class="text-center" style="width: 182px; font-size: 20px; ">责任人</td>
  170. <td scope="col" class="text-center" style="width: 209px; font-size: 20px; ">条码</td>
  171. <td scope="col" class="text-center" style="width: 181px; font-size: 20px; ">缺陷名称</td>
  172. <td scope="col" class="text-center" style="width: 184px; font-size: 20px; ">缺陷位置</td>
  173. <td scope="col" class="text-center" style="width: 182px; font-size: 20px; ">产品分级</td>
  174. </tr>
  175. </thead>
  176. </table>
  177. <div style="font-size: 14px; width: 920px; height: 706px; overflow: hidden; position: absolute; right: 28px; absolute; top: 210px; width: 918px; margin-left: 27px; margin-top: 503px; ">
  178. <table id="二检二期下明细" style="display: none; border: 1px solid #38dcff ">
  179. <tr style="height:47px;">
  180. <td style="font-size: 35px; width: 150px; font-size: 20px; ">{责任工号2}</td>
  181. <td style="font-size: 35px; width: 185px; font-size: 20px; " id="zrr">{责任人2}</td>
  182. <td style="font-size: 35px; width: 185px; font-size: 20px; ">{条码2}</td>
  183. <td style="font-size: 35px; width: 185px; font-size: 20px; ">{缺陷名称2}</td>
  184. <td style="font-size: 35px; width: 185px; font-size: 20px; ">{缺陷位置2}</td>
  185. <td style="font-size: 35px; width: 185px; font-size: 20px; ">{产品分级2}</td>
  186. <td style="font-size: 35px; width: 185px; font-size: 20px; display:none ">{出现次数}</td>
  187. </tr>
  188. </table>
  189. <table id="ejeqmx" cellspacing="0" cellpadding="0" border="0" style="margin-top: 10px; width: 100%; font-size: 35px; margin-top: 0px ">
  190. </table>
  191. </div>
  192. </div>
  193. </div>
  194. <!--<table class="table-hover table-striped" style="font-size: 14px; width: 1866px; margin-left: 27px; margin-top: -15px;">
  195. <tr style="height: 27px; width: 1866px;">
  196. <td scope="col" class="text-center" id="CrackSum" style="width: 918px; font-size: 55px; color: #f8f9fa; " colspan="10">--</td>
  197. </tr>
  198. </table>-->
  199. </div>
  200. <!-- #region 横板 -->
  201. <!--<div class="box_body" style="display: flex; flex-direction: column; margin-top:-1%;margin-left:27px;">-->
  202. <!--表格-->
  203. <!--<div style="width: 1866px; height: 830px; display: flex; flex-direction: row; ">-->
  204. <!--<div style="width: 60%; height: 930px; padding-right: 2px;">
  205. <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; font-size: 35px;">
  206. <tr class="tr_title_warning" style=" font-size: 45px;">
  207. <td colspan="9" style="color:white;" id="lieone">裂(一线):</td>
  208. </tr>
  209. <tr class="tr_title_warning" style=" font-size: 35px;">
  210. <td style="font-size: 30px; color: white; width: 30%;">责任工号</td>
  211. <td style="font-size: 30px; color: white; width: 30%">位置</td>
  212. <td style="font-size: 30px; color: white; width: 30%">数量</td>
  213. </tr>
  214. </table>
  215. <div style="display: flex; height: 600px; overflow: hidden;;margin-top:-13px">
  216. <table id="firstTable_template" style="display:none;">
  217. <tr class="tr_title_warning" style="height: 30px; font-size: 35px; ">
  218. <td style="font-size: 30px; color: white; width: 30%">{dg}</td>
  219. <td style="font-size: 25px; color: white; width: 30% ">{dp}</td>
  220. <td style="font-size: 30px; color: white; width: 30%">{dc}</td>
  221. </tr>
  222. </table>
  223. <table id="firstTable" cellspacing="0" cellpadding="0" border="0" style="width: 100%; ">
  224. </table>
  225. </div>
  226. </div>-->
  227. <!--<div style="width: 60%;height:930px;">
  228. <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
  229. <tr class="tr_title_warning" style=" font-size: 45px;">
  230. <td colspan="9" style="color:white;" id="lietwo">裂(二线):</td>
  231. </tr>
  232. <tr class="tr_title_warning" style=" font-size: 35px;">
  233. <td style="font-size: 30px; color: white; width: 30%">责任工号</td>
  234. <td style="font-size: 30px; color: white; width: 30%">位置</td>
  235. <td style="font-size: 30px; color: white; width: 30%">数量</td>
  236. </tr>
  237. </table>
  238. <div style="display: flex; height: 600px; overflow: hidden;; margin-top: -13px ">
  239. <table id="SecondTable_template" style="display: none; ">
  240. <tr class="tr_bg_light_orange" style="height:30px;">
  241. <td style="font-size: 30px; color: white; width: 30% ">{mg}</td>
  242. <td style="font-size: 25px; color: white; width: 30%">{mp}</td>
  243. <td style="font-size: 30px; color: white; width: 30% ">{mc}</td>
  244. </tr>
  245. </table>
  246. <table id="SecondTable" cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
  247. </table>
  248. </div>
  249. </div>-->
  250. <!--</div>
  251. </div>-->
  252. </div>
  253. <!-- #endregion -->
  254. <!--版权信息-->
  255. <script src="/Plugins/bootstrap-4.3.1/js/bootstrap.bundle.min.js"></script>
  256. <script src="/Plugins/bootstrap-table/bootstrap-table.min.js"></script>
  257. <script src="/Plugins/bootstrap-table/bootstrap-table-locale-all.min.js"></script>
  258. <script src="/Plugins/sweetalert/sweetalert.min.js"></script>
  259. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  260. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  261. <script type="text/javascript">
  262. var jumptime = 120000;
  263. var jumptimes = 0;
  264. var lodpage = 1;
  265. $(document).ready(function () {
  266. jumptimes = jumptime;
  267. doGetData = setInterval(function () { SecondLode(); }, 1000);
  268. });
  269. function SecondLode() {
  270. //if (jumptimes == 0) {
  271. // ++lodpage;
  272. // if ((lodpage % 2) == 0) {
  273. // jumptime = 60000
  274. // } else {
  275. // jumptime = 120000;
  276. // }
  277. // jumptimes = jumptime;
  278. // timeUpdate();
  279. //}
  280. //else {
  281. // $("#页面跳转").html('页面跳转倒计时(秒):' + jumptimes / 1000);
  282. // jumptimes = jumptimes - 1000;
  283. //}
  284. }
  285. function timeUpdate() {
  286. $("#1").toggle("d-none");
  287. $("#2").toggle("d-none");
  288. }
  289. </script>
  290. <script>
  291. //实时缺陷刷新时间
  292. //获取当前时间
  293. var firstInterval;
  294. var firstTableRowCount = 0;
  295. var SecondInterval;
  296. var SecondTableRowCount = 0;
  297. var refreshTime2 = 30000;
  298. var currentTime2 = 0;
  299. var tableScroll = true;
  300. var tableScroll2 = true;
  301. var doGetData;
  302. var doGetTime;
  303. var doGetPage;
  304. //缺陷明细定时翻页
  305. var showpage = 7; //显示条数
  306. var pages = 1; //当前页数
  307. var excesspage; //剩余条数
  308. var countpage; //总条数
  309. //一线产量明细定时翻页
  310. var showpage1 = 4; //显示条数
  311. var pages1 = 1; //当前页数
  312. var excesspage1; //剩余条数
  313. var countpage1; //总条数
  314. //二线产量明细定时翻页
  315. var showpage2 = 4; //显示条数
  316. var pages2 = 1; //当前页数
  317. var excesspage2; //剩余条数
  318. var countpage2; //总条数
  319. $(document).ready(function () {
  320. //总合格率
  321. HGL();
  322. loadData();
  323. //右侧
  324. tableLoad();
  325. //第二样式 加载
  326. firstDayTable();
  327. SecondDayTable();
  328. TableLoad();
  329. doGetData = setInterval(function () { tableLoad(); }, 15000);
  330. doGetData = setInterval(function () { loadData(); }, 1000);
  331. //刷新时间
  332. loadServerTime();
  333. doGetTime = setInterval(function () { loadServerTime(); }, 60000);
  334. doGetTime = setInterval(function () { TableLoad(); }, 15000);
  335. //刷新时间
  336. loadServerTime();
  337. doGetTime = setInterval(function () { FastTable(); }, 15000);
  338. doGetTime = setInterval(function () { TimeStar(); }, 2000);
  339. });
  340. //取服务器时间
  341. function loadServerTime() {
  342. $.get('SecondaryCheck.ashx?m=fwq', function (data) {
  343. var json = JSON.parse(data);
  344. if (json["success"] == true) {
  345. $('#dqsj').html(json["sj"]);
  346. }
  347. });
  348. }
  349. function TimeStar() {
  350. DefectDetailsColor();
  351. firstTableColor();
  352. SecondTableColor();
  353. var time = new Date()
  354. var hour = time.getHours();
  355. if (hour >= 17) {
  356. Table1Color();
  357. Table2Color();
  358. }
  359. }
  360. function Table1Color() {
  361. $(function () {
  362. $("#DD1 tr td:nth-child(2)").each(function () {
  363. if (parseFloat($(this).text()) < 95) {
  364. $(this).css("color", "red");
  365. } else if (parseFloat($(this).text()) <= 100 && parseFloat($(this).text()) >= 95) {
  366. $(this).css("color", "yellow");
  367. } else if (parseFloat($(this).text()) > 100) {
  368. $(this).css("color", "white");
  369. }
  370. });
  371. });
  372. }
  373. function DefectDetailsColor() {
  374. var count = 0;
  375. $(function () {
  376. $("#ejeqmx tr td:nth-child(7)").each(function () {
  377. if (parseFloat($(this).text()) >= 2) {
  378. document.getElementById("ejeqmx").rows[count].cells[1].style.color ="red";
  379. } else if ((parseFloat($(this).text()) < 2) ){
  380. document.getElementById("ejeqmx").rows[count].cells[1].style.color = "white";
  381. }
  382. count++;
  383. });
  384. });
  385. }
  386. function firstTableColor() {
  387. var count = 0;
  388. $(function () {
  389. $("#firstTable tr td:nth-child(3)").each(function () {
  390. if (parseFloat($(this).text()) >= 2) {
  391. document.getElementById("firstTable").rows[count].cells[0].style.color = "red";
  392. } else if ((parseFloat($(this).text()) < 2)) {
  393. document.getElementById("firstTable").rows[count].cells[0].style.color = "white";
  394. }
  395. count++;
  396. });
  397. });
  398. }
  399. function SecondTableColor() {
  400. var count = 0;
  401. $(function () {
  402. $("#SecondTable tr td:nth-child(3)").each(function () {
  403. if (parseFloat($(this).text()) >= 2) {
  404. document.getElementById("SecondTable").rows[count].cells[0].style.color = "red";
  405. } else if ((parseFloat($(this).text()) < 2)) {
  406. document.getElementById("SecondTable").rows[count].cells[0].style.color = "white";
  407. }
  408. count++;
  409. });
  410. });
  411. }
  412. function Table2Color() {
  413. $(function () {
  414. $("#DD2 tr td:nth-child(2)").each(function () {
  415. if (parseFloat($(this).text()) < 95) {
  416. $(this).css("color", "red");
  417. } else if (parseFloat($(this).text()) <= 100 && parseFloat($(this).text()) >=95 ) {
  418. $(this).css("color", "yellow");
  419. } else if (parseFloat($(this).text()) > 100) {
  420. $(this).css("color", "white");
  421. }
  422. });
  423. });
  424. }
  425. //定时翻页
  426. function getPage() {
  427. $.get('SecondaryCheck.ashx?m=count', function (data) {
  428. var json = JSON.parse(data);
  429. if (json["success"] == true) {
  430. countpage = parseInt(json["counts"]);
  431. }
  432. });
  433. excesspage = countpage - (showpage * pages)
  434. if (excesspage > 0) {
  435. pages++;
  436. }
  437. else {
  438. pages = 1;
  439. }
  440. $.get('SecondaryCheck.ashx?m=TK1smallTableTitle&&page=' + pages, function (data) {
  441. var json = JSON.parse(data);
  442. if (json['success'] == true) {
  443. $('#ejeqmx').html('');
  444. for (var i = 0; i < json['rows'].length; i++) {
  445. var template = $('#二检二期下明细').html();
  446. template = template.replace("<tbody>", "").replace("</tbody>", "");
  447. template = template.replace('{责任工号2}', json["rows"][i]['责任工号']);
  448. template = template.replace('{责任人2}', json["rows"][i]['责任人']);
  449. template = template.replace('{条码2}', json["rows"][i]['条码']);
  450. template = template.replace('{缺陷名称2}', json["rows"][i]['缺陷名称']);
  451. template = template.replace('{缺陷位置2}', json["rows"][i]['缺陷位置']);
  452. template = template.replace('{产品分级2}', json["rows"][i]['产品分级']);
  453. template = template.replace('{出现次数}', json["rows"][i]['出现次数']);
  454. $('#ejeqmx').append(template);
  455. }
  456. }
  457. });
  458. }
  459. //加载数据
  460. function loadData() {
  461. if (currentTime2 == 0) {
  462. currentTime2 = refreshTime2;
  463. loadTable('#二检一期上', 'SecondaryCheck.ashx', function (jsonData) {
  464. $('#实时缺陷加载').bootstrapTable('refreshOptions', { data: jsonData });
  465. });
  466. //总合格率
  467. HGL();
  468. //汇总产量
  469. NumberStatistics();
  470. //一线合格率
  471. HGL1();
  472. //二线合格率
  473. HGL2();
  474. }
  475. else {
  476. $("#实时缺陷加载").html('刷新倒计时(秒):' + currentTime2 / 1000);
  477. currentTime2 = currentTime2 - 1000;
  478. }
  479. }
  480. function tableLoad() {
  481. getPage();
  482. Dsum();
  483. //二线产量明细
  484. Dsum2();
  485. }
  486. //一线产量明细
  487. function Dsum() {
  488. $.get('SecondaryCheck.ashx?m=count1', function (data) {
  489. var json = JSON.parse(data);
  490. if (json["success"] == true) {
  491. countpage1 = parseInt(json["counts"]);
  492. }
  493. });
  494. excesspage1 = countpage1 - (showpage1 * pages1)
  495. if (excesspage1 > 0) {
  496. pages1++;
  497. }
  498. else {
  499. pages1 = 1;
  500. }
  501. $.get('SecondaryCheck.ashx?m=DD1&&page=' + pages1, function (data) {
  502. var json = JSON.parse(data);
  503. if (json['success'] == true) {
  504. $('#DD1').html('');
  505. for (var i = 0; i < json['rows'].length; i++) {
  506. var template = $('#二检一线产量明细').html();
  507. template = template.replace("<tbody>", "").replace("</tbody>", "");
  508. template = template.replace('{工号1}', json["rows"][i]['工号']);
  509. template = template.replace('{产量1}', json["rows"][i]['产量']);
  510. $('#DD1').append(template);
  511. }
  512. }
  513. });
  514. }
  515. //二线产量明细
  516. function Dsum2() {
  517. $.get('SecondaryCheck.ashx?m=count2', function (data) {
  518. var json = JSON.parse(data);
  519. if (json["success"] == true) {
  520. countpage2 = parseInt(json["counts"]);
  521. }
  522. });
  523. excesspage2 = countpage2 - (showpage2 * pages2)
  524. if (excesspage2 > 0) {
  525. pages2++;
  526. }
  527. else {
  528. pages2 = 1;
  529. }
  530. $.get('SecondaryCheck.ashx?m=DD2&&page=' + pages2, function (data) {
  531. var json = JSON.parse(data);
  532. if (json['success'] == true) {
  533. $('#DD2').html('');
  534. for (var i = 0; i < json['rows'].length; i++) {
  535. var template = $('#二检二线产量明细').html();
  536. template = template.replace("<tbody>", "").replace("</tbody>", "");
  537. template = template.replace('{工号2}', json["rows"][i]['工号']);
  538. template = template.replace('{产量2}', json["rows"][i]['产量']);
  539. $('#DD2').append(template);
  540. }
  541. }
  542. });
  543. }
  544. function NumberStatistics() {
  545. $.get('SecondaryCheck.ashx?m=NumberStatistics', function (data) {
  546. var json = JSON.parse(data);
  547. if (json['success'] == true) {
  548. $('#JS2').html("一线产量:" + json["rows"][0]["一线"]);
  549. $('#JS5').html("二线产量:" + json["rows"][0]["二线"]);
  550. $('#sumjs').html("总产量:" + json["rows"][0]["总产量"]);
  551. }
  552. });
  553. }
  554. function HGL() {
  555. $.get('SecondaryCheck.ashx?m=HGL', function (data) {
  556. var json = JSON.parse(data);
  557. if (json["success"] == true) {
  558. var tst = Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/))
  559. $('#sumhgl').html("总合格率:" + (Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/)) + "%"));
  560. if (json["sumhgl"] >= 98.5 && json["sumhgl"] < 99) {
  561. document.getElementById('sumhgl').style.color='yellow'
  562. }
  563. if ( json["sumhgl"] < 98.5) {
  564. document.getElementById('sumhgl').style.color = 'red'
  565. }
  566. if (json["sumhgl"] >=99) {
  567. document.getElementById('sumhgl').style.color = 'white'
  568. }
  569. }
  570. });
  571. }
  572. function HGL1() {
  573. $.get('SecondaryCheck.ashx?m=HGL1', function (data) {
  574. var json = JSON.parse(data);
  575. if (json["success"] == true) {
  576. var tst = Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/))
  577. $('#sumhgl1').html((Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/)) + "%"));
  578. if (json["sumhgl"] >= 98.5 && json["sumhgl"] < 99) {
  579. document.getElementById('sumhgl1').style.color = 'yellow'
  580. }
  581. if (json["sumhgl"] < 98.5) {
  582. document.getElementById('sumhgl1').style.color = 'red'
  583. }
  584. if (json["sumhgl"] >= 99) {
  585. document.getElementById('sumhgl1').style.color = 'white'
  586. }
  587. }
  588. });
  589. }
  590. function HGL2() {
  591. $.get('SecondaryCheck.ashx?m=HGL2', function (data) {
  592. var json = JSON.parse(data);
  593. if (json["success"] == true) {
  594. var tst = Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/))
  595. $('#sumhgl2').html((Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/)) + "%"));
  596. if (json["sumhgl"] >= 98.5 && json["sumhgl"] < 99) {
  597. document.getElementById('sumhgl2').style.color = 'yellow'
  598. }
  599. if (json["sumhgl"] < 98.5) {
  600. document.getElementById('sumhgl2').style.color = 'red'
  601. }
  602. if (json["sumhgl"] >= 99) {
  603. document.getElementById('sumhgl2').style.color = 'white'
  604. }
  605. }
  606. });
  607. }
  608. //加载数据到表格控件
  609. function loadTable(id, url, callback) {
  610. $(id + '加载').html('<i class="fa fa-spinner fa-pulse fa-fw"></i>');
  611. //TK1本烧
  612. $.get(url + '?m=TK1Big', function (data) {
  613. var json = JSON.parse(data);
  614. if (json['success'] == true) {
  615. $('#sl11').text(json["rows"][0]["上水"]);
  616. $('#sl12').text(json["rows"][0]["吹风"]);
  617. $('#qxl11').text(json["rows"][1]["上水"]);
  618. $('#qxl12').text(json["rows"][1]["吹风"]);
  619. $('#qsbw11').text(json["rows"][2]["上水"]);
  620. $('#qsbw12').text(json["rows"][2]["吹风"]);
  621. $('#gxfpll4').text(json["rows"][3]["吹风"]);
  622. //$('#gxfpll4').text(json["rows"][4]["吹风"]);
  623. //var bll = json["rows"][3]["吹风"].replace("%", "");
  624. //var fpl = json["rows"][4]["吹风"].replace("%", "")
  625. //$('#gxhgl4').text(Number((100 - bll - fpl).toString().match(/^\d+(?:\.\d{0,2})?/)) + "%");
  626. }
  627. });
  628. $.get(url + '?m=TK1QualifiedRate', function (data) {
  629. var json = JSON.parse(data);
  630. if (json['success'] == true) {
  631. $('#sl1').text(json["rows"][0]["上水"]);
  632. $('#sl2').text(json["rows"][0]["吹风"]);
  633. $('#qxl1').text(json["rows"][1]["上水"]);
  634. $('#qxl2').text(json["rows"][1]["吹风"]);
  635. $('#qsbw1').text(json["rows"][2]["上水"]);
  636. $('#qsbw2').text(json["rows"][2]["吹风"]);
  637. $('#fpl1').text(json["rows"][3]["吹风"]);
  638. //$('#fpl1').text(json["rows"][4]["吹风"]);
  639. //var bll = json["rows"][3]["吹风"].replace("%", "");
  640. //var fpl = json["rows"][4]["吹风"].replace("%", "")
  641. //$('#gxhgl4').text(Number((100 - bll - fpl).toString().match(/^\d+(?:\.\d{0,2})?/)) + "%");
  642. }
  643. });
  644. }
  645. function FastTable() {
  646. CrackSum();
  647. }
  648. function TableLoad() {
  649. if (firstTableRowCount <= 10) {
  650. //doGetTime = setInterval(function () { firstDayTable(); }, 25000);
  651. firstDayTable();
  652. }
  653. if (SecondTableRowCount <= 10) {
  654. //doGetTime = setInterval(function () { SecondDayTable(); }, 25000);
  655. SecondDayTable();
  656. }
  657. }
  658. function CrackSum() {
  659. //$.get('SecondaryCheck.ashx?m=SumCrack', function (data) {
  660. // var json = JSON.parse(data);
  661. // if (json["success"] == true) {
  662. // $('#lieone').text("裂(一线):" + json["rows"][0]["一线"]);
  663. // $('#lietwo').text("裂(二线):" + json["rows"][1]["一线"]);
  664. // $('#CrackSum').text("裂总量:" + json["rows"][2]["一线"]);
  665. // if (json["rows"][2]["一线"] > 20) {
  666. // document.getElementById('CrackSum').style.color = 'red'
  667. // } else {
  668. // document.getElementById('CrackSum').style.color = 'white'
  669. // }
  670. // }
  671. //});
  672. }
  673. function firstTableScroll() {
  674. var scrollHeight = $("#firstTable_template").find("tr").outerHeight();
  675. $("#firstTable").animate({ marginTop: -scrollHeight, }, 500,
  676. function () {
  677. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  678. if (firstTableRowCount > -1) {
  679. firstTableRowCount--;
  680. } else {
  681. clearInterval(firstInterval);
  682. firstDayTable();
  683. }
  684. }
  685. );
  686. }
  687. //明细表
  688. function firstDayTable() {
  689. //$.get("SecondaryCheckTwo.ashx?m=firstTable", function (data) {
  690. // var json = JSON.parse(data);
  691. // if (json["success"] == true) {
  692. // $("#firstTable").html("");
  693. // for (var i = 0; i < json["rows"].length; i++) {
  694. // var temp = $("#firstTable_template").html();
  695. // temp = temp.replace("<tbody>", "").replace("</tbody>", "");
  696. // temp = temp.replace('{dg}', json["rows"][i]['CODE']);
  697. // temp = temp.replace('{dp}', json["rows"][i]['位置统计']);
  698. // temp = temp.replace('{dc}', json["rows"][i]['一线产量']);
  699. // $("#firstTable").append(temp);
  700. // }
  701. // firstTableRowCount = json["rows"].length;
  702. // if (firstInterval > 10) {
  703. // firstInterval = setInterval(firstTableScroll, 2000);
  704. // }
  705. // }
  706. //});
  707. }
  708. function SecondTableScroll() {
  709. var scrollHeight = $("#SecondTable_template").find("tr").outerHeight();
  710. $("#SecondTable").animate({ marginTop: -scrollHeight, }, 500,
  711. function () {
  712. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  713. if (firstTableRowCount > -1) {
  714. firstTableRowCount--;
  715. } else {
  716. clearInterval(SecondInterval);
  717. SecondDayTable();
  718. }
  719. }
  720. );
  721. }
  722. //明细表
  723. function SecondDayTable() {
  724. //$.get("SecondaryCheckTwo.ashx?m=SecondTable", function (data) {
  725. // var json = JSON.parse(data);
  726. // if (json["success"] == true) {
  727. // $("#SecondTable").html("");
  728. // for (var i = 0; i < json["rows"].length; i++) {
  729. // var temp = $("#SecondTable_template").html();
  730. // temp = temp.replace("<tbody>", "").replace("</tbody>", "");
  731. // temp = temp.replace('{mg}', json["rows"][i]['CODE']);
  732. // temp = temp.replace('{mp}', json["rows"][i]['位置统计']);
  733. // temp = temp.replace('{mc}', json["rows"][i]['二线产量']);
  734. // $("#SecondTable").append(temp);
  735. // }
  736. // SecondTableRowCount = json["rows"].length;
  737. // if (SecondTableRowCount > 10) {
  738. // SecondInterval = setInterval(SecondTableScroll, 2000);
  739. // }
  740. // }
  741. //});
  742. }
  743. </script>
  744. <style>
  745. table {
  746. height: 40px;
  747. color: #f8f9fa !important;
  748. font-size: 20px;
  749. font-weight: 700;
  750. background: rgba(25, 52, 90,.5);
  751. border: 1px solid #38dcff;
  752. margin-bottom: 1rem;
  753. }
  754. td {
  755. padding: 2px !important;
  756. text-align: center !important;
  757. border-bottom: 1px solid #38dcff !important;
  758. border-right: 1px dashed #38dcff !important;
  759. border: white;
  760. }
  761. </style>
  762. </body>
  763. </html>