line.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=0.5">
  6. <!-- 一个小时刷新一下当前页 -->
  7. <meta http-equiv="refresh" content="3600">
  8. <title>产线管理看板</title>
  9. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  10. <link href="/css/dashboard.css" rel="stylesheet" />
  11. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  12. <script type="text/javascript" src="/js/service.js"></script>
  13. <script type="text/javascript" src="/js/session.js"></script>
  14. <script type="text/javascript" src="/js/getService.js"></script>
  15. </head>
  16. <body id="container" class="container-fluid">
  17. <div class="row no-padding head-bar" style="height:81px">
  18. <div class="col-lg-1 col-md-1">
  19. </div>
  20. <div class="col-lg-4 col-md-4 page-title">
  21. 产线管理看板
  22. </div>
  23. <div class="col-lg-4 col-md-4 block-padding">
  24. <button type="button" class="btn btn-warning"
  25. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  26. <button type="button" class="btn btn-warning"
  27. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  28. <button type="button" class="btn btn-warning"
  29. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  30. <button type="button" class="btn btn-warning"
  31. onclick="window.location.replace('/pages/dashboard/esop.html');">E-SOP</button>
  32. <button type="button" class="btn btn-warning"
  33. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  34. </div>
  35. <div class="col-lg-4 col-md-4">
  36. </div>
  37. </div>
  38. <div class="my-container" id="div-main">
  39. <div class="row">
  40. <div class="col-lg-3 col-md-3">
  41. <!--人员信息-->
  42. <div class="row block-padding">
  43. <div class="col-lg-12 col-md-12 center block-title">产线人员信息</div>
  44. </div>
  45. <div class="row" style="height: 160px;">
  46. <div class="person-div" v-for="user in userList" style="text-align: center;margin-left:3%;">
  47. <div>
  48. <img height="140" width="100" v-bind:src="'/upPersonnel/Mechanice/'+user.fileName" border="0" />
  49. </div>
  50. <div style="width: 90px; overflow:hidden; word-break:break-all;white-space:nowrap">
  51. {{user.fileRealName}}
  52. </div>
  53. <!-- <div class="center">
  54. {{user.realName}}&nbsp;&nbsp;{{user.inTime}}
  55. </div> -->
  56. </div>
  57. </div>
  58. <div class="row block-padding">
  59. <div class="col-lg-12 col-md-12 center block-title">标准工时与实际工时对比</div>
  60. </div>
  61. <div class="row">
  62. <div class="col-lg-12 col-md-12" style="height:240px" id="charts_11"></div>
  63. </div>
  64. <div class="row block-padding">
  65. <div class="col-lg-12 col-md-12 center block-title">良率</div>
  66. </div>
  67. <div class="row">
  68. <div class="col-lg-12 col-md-2" style="height:240px" id="charts_12"></div>
  69. </div>
  70. <div class="row">
  71. <div class="col-lg-12 col-md-12 center block-title">质量异常分类</div>
  72. </div>
  73. <div class="row">
  74. <div class="col-lg-12 col-md-2" style="height:240px" id="charts_13"></div>
  75. </div>
  76. </div>
  77. <div class="col-lg-6" >
  78. <div class="row block-padding" style="height: 350px;">
  79. <div class="col-lg-4 col-md-4 padding-around" v-for="task in doingTaskList">
  80. <div class="task-block" :class="task.bgcss">
  81. <div class="row ">
  82. <div class="col-lg-12 col-md-12 center task-block-title">{{task.displayName}}</div>
  83. </div>
  84. <div class="row">
  85. <div class="col-lg-4 col-md-4" style="padding-left: 34px;padding-top: 27px;">
  86. <div class="task-block-title-small center">任务数量</div>
  87. <div class="task-block-title-big center">{{task.planSum}}</div>
  88. <div class="task-block-title-small center" style="padding-top:17px;">已完工总数</div>
  89. <div class="task-block-title-big center">{{task.completeSum}}</div>
  90. </div>
  91. <div class="col-lg-8 col-md-8" style="padding-left: 4px;padding-top: 10px;">
  92. <!-- <div class="task-block-text">预计开工日期:{{task.planStartDate}}</div> -->
  93. <div class="task-block-text">完工日期:{{task.planCompleteDate}}</div>
  94. <div class="task-block-text">物料编码:{{task.productId}}</div>
  95. <div class="task-block-text">物料名称:{{task.materialName}}</div>
  96. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  97. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  98. <div class="task-block-text">
  99. <div style="float:left">完成进度:</div>
  100. <div style="float:left;width:120px;padding-top:2px;">
  101. <div class="progress">
  102. <div class="progress-bar progress-bar-info" role="progressbar"
  103. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  104. :style="{width:task.completePercent}">
  105. {{task.completePercent}}
  106. </div>
  107. <div class="progress-bar progress-bar-warning" role="progressbar"
  108. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  109. :style="{width:task.incompletePercent}">
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!--月生产计划-->
  120. <div class="row block-padding">
  121. <div class="col-lg-12 col-md-12 center block-title">生产计划</div>
  122. </div>
  123. <div class="row block-padding">
  124. <div class="col-lg-1 col-md-1 center no-padding">项目名称</div>
  125. <div class="col-lg-1 col-md-1 center no-padding">工单号</div>
  126. <div class="col-lg-2 col-md-2 center no-padding">物料编码</div>
  127. <!-- <div class="col-lg-2 col-md-2 center no-padding">型号规格</div> -->
  128. <div class="col-lg-1 col-md-1 center no-padding">物料名称</div>
  129. <div class="col-lg-1 col-md-1 center no-padding">计划数量</div>
  130. <div class="col-lg-1 col-md-1 center no-padding">标准工时</div>
  131. <div class="col-lg-1 col-md-1 center no-padding">完成数量</div>
  132. <div class="col-lg-1 col-md-1 center no-padding">完成工时</div>
  133. <div class="col-lg-1 col-md-1 center no-padding">作业人员</div>
  134. <div class="col-lg-1 col-md-1 center no-padding">达成率</div>
  135. <div class="col-lg-1 col-md-1 center no-padding">生产效率</div>
  136. <!-- <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div> -->
  137. </div>
  138. <div class="row" v-for="product in dayProduceTaskList">
  139. <div class="col-lg-1 col-md-1 center no-padding">{{product.projectName}}</div>
  140. <div class="col-lg-1 col-md-1 center no-padding">{{product.orderSheetCode}}</div>
  141. <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 center no-padding">{{product.materialCode}}</div>
  142. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  143. <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 left no-padding">{{product.materialName}}</div>
  144. <div class="col-lg-1 col-md-1 center no-padding">{{product.planSum}}</div>
  145. <div class="col-lg-1 col-md-1 center no-padding">{{product.workHour}}</div>
  146. <div class="col-lg-1 col-md-1 center no-padding">{{product.latestCompletedQuantity}}</div>
  147. <div class="col-lg-1 col-md-1 center no-padding">{{product.manHoursCompleted}}</div>
  148. <div class="col-lg-1 col-md-1 center no-padding">{{product.name}}</div>
  149. <div class="col-lg-1 col-md-1 center no-padding">{{product.productionEfficiency}}%</div>
  150. <div class="col-lg-1 col-md-1 center no-padding">{{product.productionEfficiency}}%</div>
  151. <!-- <div class="col-lg-2 col-md-2 center no-padding progress">
  152. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  153. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  154. {{product.completeSum}}
  155. </div>
  156. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  157. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  158. {{product.incompleteSum}}
  159. </div>
  160. </div> -->
  161. </div>
  162. </div>
  163. <div class="col-lg-3">
  164. <div class="row block-padding">
  165. <div class="col-lg-12 col-md-12 center block-title">生产效率</div>
  166. </div>
  167. <div class="row">
  168. <div class="col-lg-12 col-md-12" style="height:190px" id="charts_21"></div>
  169. </div>
  170. <div class="row block-padding">
  171. <div class="col-lg-12 col-md-12 center block-title">工时分布</div>
  172. </div>
  173. <div class="row">
  174. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_22"></div>
  175. </div>
  176. <div class="row block-padding">
  177. <div class="col-lg-12 col-md-12 center block-title">计划达成率</div>
  178. </div>
  179. <div class="row">
  180. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_23"></div>
  181. </div>
  182. <div class="row block-padding">
  183. <div class="col-lg-12 col-md-12 center block-title">人员出勤情况</div>
  184. </div>
  185. <div class="row">
  186. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_24"></div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <!-- jQuery -->
  192. <script src="/lib/jquery.min.js"></script>
  193. <script src="/lib/vue.min.js"></script>
  194. <script src="/lib/echarts/echarts.min.js"></script>
  195. <script src="/lib/echarts/theme/macarons.js"></script>
  196. <script src="/js/service/person.js?_v=2"></script>
  197. <script src="/js/service/material.js?_v=2"></script>
  198. <script src="/js/service/product.js?_v=2"></script>
  199. <script src="/js/service/workhour.js?_v=2"></script>
  200. <script src="/js/service/produce-task.js?_v=2"></script>
  201. <script src="/js/content/mycharts.js?_v=2"></script>
  202. <script type="text/javascript">
  203. //当日标准工时与实际工时对比
  204. const monthGoodList = ServiceProduct.getDayGood();
  205. setTimeout(beA,500);
  206. var initSize = 3;
  207. var pageSizeMonthGood = 3;
  208. var pageIndexMonthGood = 0;
  209. function beA(){
  210. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  211. pageIndexMonthGood = pageSizeMonthGood;
  212. pageSizeMonthGood = pageSizeMonthGood + initSize;
  213. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  214. ChartsService.getGridSpanSmall());
  215. if(monthGoodList.length <= pageIndexMonthGood){
  216. return;
  217. }
  218. setInterval(beginScrollA,10000);
  219. }
  220. function beginScrollA(){
  221. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  222. pageIndexMonthGood = pageSizeMonthGood;
  223. pageSizeMonthGood = pageSizeMonthGood + initSize;
  224. if(monthGoodList.length <= pageIndexMonthGood){
  225. pageIndexMonthGood = 0;
  226. pageSizeMonthGood = initSize;
  227. }
  228. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  229. ChartsService.getGridSpanSmall());
  230. }
  231. //当日良率
  232. const dayStandAndRealList = ServiceWorkhour.getDayStandAndRealByMaterial();
  233. setTimeout(beB,600);
  234. var pageSizeB = 3;
  235. var pageIndexB = 0;
  236. function beB(){
  237. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  238. pageIndexB = pageSizeB;
  239. pageSizeB = pageSizeB + initSize;
  240. ChartsService.initBarAndLine("charts_11", lsitDay,
  241. ChartsService.getGridSpanSmall());
  242. if(dayStandAndRealList.length <= pageIndexB){
  243. return;
  244. }
  245. setInterval(beginScrollA,10000);
  246. }
  247. function beginScrollA(){
  248. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  249. pageIndexB = pageSizeB;
  250. pageSizeB = pageSizeB + initSize;
  251. if(dayStandAndRealList.length <= pageIndexB){
  252. pageIndexB = 0;
  253. pageSizeB = initSize;
  254. }
  255. ChartsService.initBarAndLine("charts_11", lsitDay, ChartsService.getGridSpanSmall());
  256. }
  257. var vm = new Vue({
  258. el: '#div-main',
  259. data: {
  260. userList: [],
  261. dayProduceTaskList: [],
  262. doingTaskList: [],
  263. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  264. timer_long: '', // 定时取服务器数据
  265. timer_short: '' // 数据超长定时轮播
  266. },
  267. methods: {
  268. // 从服务器加载数据并显示
  269. refreshData: function () {
  270. // 关闭定时器
  271. clearInterval(this.timer_short);
  272. // 刷新报表
  273. // ChartsService.initBarAndLine("charts_11", ServiceWorkhour
  274. // .getDayStandAndRealByMaterial(), ChartsService.getGridSpanSmall());
  275. // ChartsService.initBarWithTwoNumberRate("charts_12", ServiceProduct.getDayGood(), ChartsService.getGridSpanSmall());
  276. ChartsService.initBarWithShade("charts_13", ServiceProduct.getDayExceptionByCategory(), ChartsService.getGridSpanSmall());
  277. ChartsService.initCommonPanel("charts_21", ServiceProduct.getDayProduceRate());
  278. ChartsService.initCommonPie("charts_22", ServiceWorkhour.getDayByMaterial());
  279. ChartsService.initCommonPie("charts_23", ServiceProduceTask.getDayCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  280. ChartsService.initCommonPie("charts_24", ServicePerson.getDayAttendance(), [ '#37a2da','#ff9f7f']);
  281. this.loadData();
  282. // 开启定时器
  283. this.timer_short = setInterval(this.scrollData, 5000);
  284. },
  285. // 轮播数据
  286. scrollData: function () {
  287. for (var key in this.cacheDataObject) {
  288. const dataList = this.cacheDataObject[key].data;
  289. const pagesize = this.cacheDataObject[key].pagesize;
  290. var pageindex = this.cacheDataObject[key].pageindex + 1;
  291. if (dataList.length > pagesize) {
  292. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  293. pagesize > 0 ? 1 : 0);
  294. if (pageindex >= pagesum)
  295. pageindex = 0;
  296. this.cacheDataObject[key].pageindex = pageindex;
  297. const startIndex = pageindex * pagesize;
  298. const remainSum = dataList.length - startIndex;
  299. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  300. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  301. if(keyPar.length < 1){
  302. continue;
  303. }
  304. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  305. }
  306. }
  307. },
  308. // 从服务器加载数据
  309. loadData: function () {
  310. this.cacheDataObject = {};
  311. const userList = ServicePerson.getWorkPersonList();
  312. this.cacheDataObject.userList = {
  313. data: userList,
  314. pagesize: 4,
  315. pageindex: 0
  316. }
  317. this.userList = userList.slice(0, this.cacheDataObject.userList.pagesize);
  318. // 生产计划
  319. const dayProduceTaskList = ServiceProduceTask.getDayList();
  320. this.cacheDataObject.dayProduceTaskList = {
  321. data: dayProduceTaskList,
  322. pagesize: 25,
  323. pageindex: 0
  324. }
  325. this.dayProduceTaskList = dayProduceTaskList.slice(0, this.cacheDataObject
  326. .dayProduceTaskList.pagesize);
  327. // 在生产图片
  328. const doingTaskList = ServiceProduceTask.getDoingListByOrder();
  329. this.cacheDataObject.doingTaskList = {
  330. data: doingTaskList,
  331. pagesize: 6,
  332. pageindex: 0
  333. }
  334. this.doingTaskList = doingTaskList.slice(0, this.cacheDataObject.doingTaskList
  335. .pagesize);
  336. }
  337. },
  338. mounted() {
  339. this.timer_long = setInterval(this.refreshData, 60000);
  340. this.refreshData();
  341. },
  342. beforeDestroy() {
  343. clearInterval(this.timer_long);
  344. clearInterval(this.timer_short);
  345. }
  346. });
  347. </script>
  348. </body>
  349. </html>