dapingmu.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <html style="height: 100%">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  5. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  6. <title>流水线管理页-度彼科技</title>
  7. <!-- Favicon-->
  8. <link rel="icon" href="favicon.ico" type="image/x-icon">
  9. <!-- Bootstrap Core Css -->
  10. <link rel="stylesheet" href="css/third/bootstrap.min.css" >
  11. <!-- Waves Effect Css -->
  12. <link href="plugins/node-waves/waves.css" rel="stylesheet" />
  13. <!-- Animation Css -->
  14. <link href="plugins/animate-css/animate.css" rel="stylesheet" />
  15. <!-- Morris Chart Css-->
  16. <link href="plugins/morrisjs/morris.css" rel="stylesheet" />
  17. <!-- Custom Css -->
  18. <!--<link href="css/style-frontend.css" rel="stylesheet">-->
  19. <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
  20. <link href="css/themes/all-themes.css" rel="stylesheet" />
  21. <script src="css/third/jq.3.2.1.min.js"></script>
  22. <script src="css/third/popper.1.12.9.js" ></script>
  23. <script src="css/third/boot.min.js" ></script>
  24. <meta name="viewport" content="width=device-width, initial-scale=1">
  25. <style>
  26. /* css 代码 */
  27. th, td{
  28. color:white;
  29. font-size: 1.2em;
  30. }
  31. .big-letter{
  32. font-size: 1.2em;
  33. }
  34. .middle-font{
  35. font-size: 1.02em;
  36. }
  37. </style>
  38. <script src="css/third/hchart.js"></script>
  39. <script src="css/third/exporting.js"></script>
  40. <script src="css/third/cn.js"></script>
  41. <script src="css/third/dark.js"></script>
  42. <script src="js/timeService.js"></script>
  43. <script src="js/vue.js"></script>
  44. </head>
  45. <body class="theme-black" style="background-color: #2d2d2d !important;" onload="startTime()">
  46. <nav class="navbar clearfix navbar-expand-lg navbar-dark" role="navigation" style="background-color: #732020;">
  47. <a class="navbar-brand" href="#">
  48. <img src="images/logo.jpg" width="42" height="30" class="d-inline-block align-top" alt="">
  49. 工厂产能监控系统
  50. </a>
  51. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  52. <span class="navbar-toggler-icon"></span>
  53. </button>
  54. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  55. <ul class="navbar-nav mr-auto">
  56. <li class="nav-item">
  57. <a class="nav-link" href="denglu.html"> 主页 <span class="sr-only">(current)</span></a>
  58. </li>
  59. <li class="nav-item active">
  60. <a class="nav-link" href="#">全厂大屏</a>
  61. </li>
  62. <li class="nav-item dropdown">
  63. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  64. 前往
  65. </a>
  66. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  67. <a class="dropdown-item" href="#" onclick="history.go(0)">刷新</a>
  68. <div class="dropdown-divider"></div>
  69. <a class="dropdown-item" href="/server">后台入口</a>
  70. </div>
  71. </li>
  72. <li class="nav-item">
  73. <a class="nav-link bg-red text-white" href="javascript:void">深圳市度彼电子有限公司</a>
  74. </li>
  75. </ul>
  76. <form class="form-inline my-2 my-lg-0 text-white" >
  77. <button class="btn btn-outline-dark my-2 my-sm-0 text-white" id="nowDateTimeSpan"></button>
  78. <button class="btn btn-success my-2 my-sm-0" type="submit">重新加载</button>
  79. </form>
  80. </div>
  81. <!--<div class="container-fluid">
  82. <div class="navbar-header">
  83. <a class="navbar-brand" href="index.html">工厂产能监控系统</a>
  84. </div>
  85. <div style="color:#fff" class="text-center"><img src="images/logo.jpg" style="width: 10%;"> 深圳市度彼电子有限公司</div>
  86. <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
  87. </div>-->
  88. </nav>
  89. <div class="container" style="max-width:none; !important;">
  90. <div class="alert alert-warning" id="mpAlert" style="display:none">
  91. </div>
  92. <div class="text-white row middle-font">
  93. <div class="col-md-3">
  94. <div class="text-center big-letter">全厂产能统计</div>
  95. <table class="table table-bordered text-center">
  96. <thead>
  97. <tr>
  98. <th scope="col">时间</th>
  99. <th scope="col">良品数</th>
  100. <th scope="col">不良品数</th>
  101. <th scope="col">堆积数</th>
  102. <th scope="col">不良率</th>
  103. </tr>
  104. </thead>
  105. <tbody id="rank-one">
  106. </tbody>
  107. </table>
  108. </div>
  109. <div class="col-md-9 text-white" style="height: 30vh" id="redrank">
  110. <div class="text-center text-lg big-letter" @click="clicktitle">{{title}}</div>
  111. <div class="row">
  112. <div class="col-md-4" v-for="parto in parting">
  113. <table class="table table-bordered text-center table-striped">
  114. <thead>
  115. <tr>
  116. <th>名次</th>
  117. <th @click="useId">人员</th>
  118. <th @click="usePass">良品</th>
  119. <th @click="useFail">坏品</th>
  120. <th @click="useTotal">总量</th>
  121. <th @click="useRate">不良率</th>
  122. </tr>
  123. </thead>
  124. <tbody class="table-rank-0">
  125. <tr v-for="one in parto" v-bind:class="{'red-bar' : one.isRed, 'green-bar': one.isGreen}">
  126. <td>{{one.seq+1}}</td>
  127. <td>{{one.workerName}}</td>
  128. <td>{{one.passNum}}</td>
  129. <td>{{one.failNum}}</td>
  130. <td>{{one.totalNum}}</td>
  131. <td>{{one.failRate}} %</td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="row" style-height="50">
  140. <div class="row col-md-12 ">
  141. <div id="graph-1" class="chartsize col-md-12" style-height="30"></div>
  142. </div>
  143. <div class="row col-md-12 ">
  144. <div id="graph-2" class="chartsize col-md-12" style-height="30"></div>
  145. </div>
  146. </div>
  147. </div>
  148. <!-- Modal -->
  149. <div id="modalContainer"></div>
  150. <!-- Common Js Files -->
  151. <script src="js/basic.js"></script>
  152. <script src="js/getparam.js"></script>
  153. <script src="js/resize.js"></script>
  154. <script src="js/common.js"></script>
  155. <!--- Unique -->
  156. <script src="js/dapingmu.js"></script>
  157. <script src="js/dapingmu-display.js"></script>
  158. <script src="js/newCommon.js"></script>
  159. <script src="js/newRedrankvue.js"></script>
  160. <script>
  161. var FlowRealTime = new (function () {
  162. this.pgName = "flowDashBoard";
  163. this.page = new SinglePage(this.pgName);
  164. this.scheduleId = utils_get_param("scheduleId");
  165. this.flowId = utils_get_param("flowId");
  166. if(scheduleId == null || flowId == null)
  167. {
  168. send_alert(`清重新进入本页面!<a href='denglu.html'> 返回主页 </a>`);
  169. return;
  170. }
  171. this.flowPlace = " % flowPlace %";
  172. this.flowName = " % flowPlace %";
  173. this.scheduleLoadDataService = new DataObjectService("fcWorkScheduleLoad", ONDEMAND /*AUTO & FAST*/, "?scheduleId=" + scheduleId);
  174. this.oaStaffService = new DataObjectService("fcWorkScheduleLoad", ONDEMAND, "");
  175. this.sectorService = new DataObjectService("fcWorkScheduleLoad", ONDEMAND, "");
  176. this.flowService = new DataObjectService("fcFlow", ONDEMAND, "");
  177. this.MeduimData = new (function () {
  178. this.initializeUsers = function(list){
  179. list.forEach(function (val, it, arr) {
  180. var isExist = false;
  181. userIDs.forEach(function (vals) {
  182. if (vals == val.userId) {
  183. isExist = true;
  184. }
  185. });
  186. if (!isExist) userIDs.push(val.userId);
  187. });
  188. };
  189. })();
  190. this.initPage = function() {
  191. setInterval(RedRankTablePlugin.tick, 1000);
  192. };
  193. this.Action = new (function (parent) {
  194. this.parent = parent;
  195. this.doStopSchedule = function () {
  196. get_data("fcWorkSchedule/stopSchedule?userId=" + userId + "&scheduleId=" + scheduleId, this.parent.UI.showStopSuccess, this.parent);
  197. };
  198. this.confirmStopSchedule = function () {
  199. var out = confirm("真的要下班吗?");
  200. if (out == true) {
  201. this.doStopSchedule();
  202. } else {
  203. }
  204. };
  205. })(this);
  206. this.UI = new (function (parent) {
  207. this.p = parent;
  208. this.showClearPanel = function () {
  209. $("#clearModal").modal('show');
  210. };
  211. this.showStopSuccess = function (obj, sta, scope) {
  212. send_alert("下班操作成功! <a href='denglu.html'> 点击这里返回控制主页 </a>");
  213. };
  214. this.bind = function () {
  215. $(".confirm-clear-data").click(function(){
  216. FlowRealTime.ClearDataControl.clearDataOfDeviceId($('#handInput').val());
  217. });
  218. $(".open-clear-panel").click(function () {
  219. FlowRealTime.UI.showClearPanel();
  220. })
  221. $(".close-schedule").click(function () {
  222. FlowRealTime.Action.confirmStopSchedule();
  223. })
  224. }
  225. })(this);
  226. var ClearDataControl = new (function (parent) {
  227. this.p = parent;
  228. this.finished = true;
  229. this.executed = false;
  230. this.directCount = -1;
  231. this.clearDataOfDeviceId = function (handId) {
  232. this.executed = false;
  233. this.directCount = -1;
  234. this.finished = true;
  235. var hand = handId;
  236. var hd = 0;
  237. if (hand.length > 0) {
  238. hd = parseInt(hand);
  239. }
  240. get_data("endpoint/clearBoard?flowId=" + flowId + "&handheldId=" + hd, this.clearSuccess);
  241. };
  242. this.clearSuccess = function (obj, sta) {
  243. console.warn("------- 手持设备清空 ----------");
  244. console.warn(obj);
  245. send_alert("发送清空请求成功, 正在等待采集端进行处理...");
  246. this.finished = false;
  247. setTimeout(this.resultVerifyTimeout, 8000, this);
  248. setTimeout(this.getVerify, 300, this);
  249. }
  250. this.getVerify = function (obj) {
  251. if (obj.finished) return;
  252. get_data("endpoint/heartbeat?flowId=" + flowId, obj.onVerifyResult);
  253. setTimeout(obj.getVerify, 100, obj);
  254. };
  255. this.onVerifyResult = function (obj, sta) {
  256. var parsed = {};
  257. if (typeof(obj) === "string") {
  258. parsed = JSON.parse(obj);
  259. } else {
  260. parsed = obj;
  261. }
  262. if (typeof(parsed) === "object") {
  263. if (parsed.ret === "10000") {
  264. //ok
  265. if (parsed.model == null || parsed.model === undefined) {
  266. executed = true;
  267. finished = true;
  268. } else if (typeof(obj.model) === "object") {
  269. // 没有拿到,继续
  270. if (obj.model.list != null && obj.model.list.length > 0) {
  271. var direct = obj.model.list[0];
  272. if (direct.eventType + "" !== "500") {
  273. // OK
  274. executed = true;
  275. finished = true;
  276. } else if (direct.arg2 + "" !== "" + $("#handInput").val()) {
  277. // OK
  278. executed = true;
  279. finished = true;
  280. } else {
  281. directCount = direct.counter;
  282. }
  283. }
  284. }
  285. }
  286. }
  287. }
  288. this.resultVerifyTimeout = function (obj) {
  289. finished = true;
  290. if (executed) {
  291. // 执行成功
  292. } else {
  293. if (directCount >= 0) {
  294. get_data("endpoint/ack?counter=" + directCount, function () {
  295. console.log("撤销操作成功");
  296. console.log(this);
  297. });
  298. directCount = -1;
  299. send_alert("请求已经超时!请注意,采集端可能没有执行成功。即将撤销您的请求。");
  300. } else {
  301. send_alert("请求已经超时!请注意,采集端可能没有执行成功。");
  302. }
  303. }
  304. }
  305. })(this);
  306. })();
  307. $(document).ready(function(){
  308. FlowRealTime.initPage();
  309. FlowRealTime.UI.bind();
  310. });
  311. </script>
  312. </body>
  313. </html>