line.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. <title>产线管理看板</title>
  7. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  8. <link href="/css/dashboard.css" rel="stylesheet" />
  9. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  10. <script type="text/javascript" src="/js/service.js"></script>
  11. <script type="text/javascript" src="/js/session.js"></script>
  12. <script type="text/javascript" src="/js/getService.js"></script>
  13. </head>
  14. <body id="container" class="container-fluid">
  15. <div class="row no-padding head-bar" style="height:81px">
  16. <div class="col-lg-1 col-md-1">
  17. </div>
  18. <div class="col-lg-4 col-md-4 page-title">
  19. 产线管理看板
  20. </div>
  21. <div class="col-lg-3 col-md-3 block-padding">
  22. <button type="button" class="btn btn-warning"
  23. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  24. <button type="button" class="btn btn-warning"
  25. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  26. <button type="button" class="btn btn-warning"
  27. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  28. </div>
  29. <div class="col-lg-4 col-md-4">
  30. </div>
  31. </div>
  32. <div class="my-container" id="div-main">
  33. <div class="row">
  34. <div class="col-lg-3 col-md-3">
  35. <!--人员信息-->
  36. <div class="row block-padding">
  37. <div class="col-lg-12 col-md-12 center block-title">班组装人员信息</div>
  38. </div>
  39. <div class="row" style="height: 150px;">
  40. <div class="person-div" v-for="user in userList">
  41. <div>
  42. <img v-bind:src="user.avatar" border="0" />
  43. </div>
  44. <div class="center">
  45. {{user.className}}
  46. </div>
  47. <div class="center">
  48. {{user.realName}}&nbsp;&nbsp;{{user.inTime}}
  49. </div>
  50. </div>
  51. </div>
  52. <div class="row block-padding">
  53. <div class="col-lg-12 col-md-12 center block-title">当日标准工时与实际工时对比</div>
  54. </div>
  55. <div class="row">
  56. <div class="col-lg-12 col-md-12" style="height:240px" id="charts_11"></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-2" style="height:240px" id="charts_12"></div>
  63. </div>
  64. <div class="row">
  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_13"></div>
  69. </div>
  70. </div>
  71. <div class="col-lg-6">
  72. <div class="row block-padding">
  73. <div style="height: 200px;" class="col-lg-4 col-md-4 padding-around" v-for="task in doingTaskList">
  74. <div class="task-block" :class="task.bgcss">
  75. <div class="row ">
  76. <div class="col-lg-12 col-md-12 center task-block-title">{{task.displayName}}</div>
  77. </div>
  78. <div class="row">
  79. <div class="col-lg-4 col-md-4" style="padding-left: 34px;padding-top: 27px;">
  80. <div class="task-block-title-small center">任务数量</div>
  81. <div class="task-block-title-big center">{{task.planSum}}</div>
  82. <div class="task-block-title-small center" style="padding-top:17px;">已完工总数</div>
  83. <div class="task-block-title-big center">{{task.completeSum}}</div>
  84. </div>
  85. <div class="col-lg-8 col-md-8" style="padding-left: 4px;padding-top: 10px;">
  86. <!-- <div class="task-block-text">预计开工日期:{{task.planStartDate}}</div> -->
  87. <div class="task-block-text">完工日期:{{task.planCompleteDate}}</div>
  88. <div class="task-block-text">料号:{{task.productId}}</div>
  89. <div class="task-block-text">存货:{{task.materialName}}</div>
  90. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  91. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  92. <div class="task-block-text">
  93. <div style="float:left">完成进度:</div>
  94. <div style="float:left;width:120px;padding-top:2px;">
  95. <div class="progress">
  96. <div class="progress-bar progress-bar-info" role="progressbar"
  97. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  98. :style="{width:task.completePercent}">
  99. {{task.completePercent}}
  100. </div>
  101. <div class="progress-bar progress-bar-warning" role="progressbar"
  102. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  103. :style="{width:task.incompletePercent}">
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!--月生产计划-->
  114. <div class="row block-padding">
  115. <div class="col-lg-12 col-md-12 center block-title">生产计划</div>
  116. </div>
  117. <div class="row block-padding">
  118. <div class="col-lg-2 col-md-2 center no-padding">项目号</div>
  119. <div class="col-lg-2 col-md-2 center no-padding">工单号</div>
  120. <div class="col-lg-2 col-md-2 center no-padding">料号</div>
  121. <!-- <div class="col-lg-2 col-md-2 center no-padding">型号规格</div> -->
  122. <div class="col-lg-2 col-md-2 center no-padding">名称</div>
  123. <div class="col-lg-2 col-md-2 center no-padding">计划数量</div>
  124. <div class="col-lg-2 col-md-2 center no-padding">工时</div>
  125. <!-- <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div> -->
  126. </div>
  127. <div class="row" v-for="product in dayProduceTaskList">
  128. <div class="col-lg-2 col-md-2 center no-padding">{{product.projectCode}}</div>
  129. <div class="col-lg-2 col-md-2 center no-padding">{{product.orderSheetCode}}</div>
  130. <div class="col-lg-2 col-md-2 center no-padding">{{product.materialCode}}</div>
  131. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  132. <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
  133. <div class="col-lg-2 col-md-2 center no-padding">{{product.planSum}}</div>
  134. <div class="col-lg-2 col-md-2 center no-padding">{{product.workHour}}</div>
  135. <!-- <div class="col-lg-2 col-md-2 center no-padding progress">
  136. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  137. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  138. {{product.completeSum}}
  139. </div>
  140. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  141. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  142. {{product.incompleteSum}}
  143. </div>
  144. </div> -->
  145. </div>
  146. </div>
  147. <div class="col-lg-3">
  148. <div class="row block-padding">
  149. <div class="col-lg-12 col-md-12 center block-title">当日生产效率</div>
  150. </div>
  151. <div class="row">
  152. <div class="col-lg-12 col-md-12" style="height:190px" id="charts_21"></div>
  153. </div>
  154. <div class="row block-padding">
  155. <div class="col-lg-12 col-md-12 center block-title">当日工时分布</div>
  156. </div>
  157. <div class="row">
  158. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_22"></div>
  159. </div>
  160. <div class="row block-padding">
  161. <div class="col-lg-12 col-md-12 center block-title">当日计划达成率</div>
  162. </div>
  163. <div class="row">
  164. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_23"></div>
  165. </div>
  166. <div class="row block-padding">
  167. <div class="col-lg-12 col-md-12 center block-title">当日人员出勤情况</div>
  168. </div>
  169. <div class="row">
  170. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_24"></div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <!-- jQuery -->
  176. <script src="/lib/jquery.min.js"></script>
  177. <script src="/lib/vue.min.js"></script>
  178. <script src="/lib/echarts/echarts.min.js"></script>
  179. <script src="/lib/echarts/theme/macarons.js"></script>
  180. <script src="/js/service/person.js?_v=1"></script>
  181. <script src="/js/service/material.js?_v=1"></script>
  182. <script src="/js/service/product.js?_v=1"></script>
  183. <script src="/js/service/workhour.js?_v=1"></script>
  184. <script src="/js/service/produce-task.js?_v=1"></script>
  185. <script src="/js/content/mycharts.js?_v=1"></script>
  186. <script type="text/javascript">
  187. var vm = new Vue({
  188. el: '#div-main',
  189. data: {
  190. userList: [],
  191. dayProduceTaskList: [],
  192. doingTaskList: [],
  193. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  194. timer_long: '', // 定时取服务器数据
  195. timer_short: '' // 数据超长定时轮播
  196. },
  197. methods: {
  198. // 从服务器加载数据并显示
  199. refreshData: function () {
  200. // 关闭定时器
  201. clearInterval(this.timer_short);
  202. // 刷新报表
  203. ChartsService.initBarAndLine("charts_11", ServiceWorkhour
  204. .getDayStandAndRealByMaterial(), ChartsService.getGridSpanSmall());
  205. ChartsService.initBarWithTwoNumberRate("charts_12", ServiceProduct.getDayGood(), ChartsService.getGridSpanSmall());
  206. ChartsService.initBarWithShade("charts_13", ServiceProduct.getDayExceptionByCategory(), ChartsService.getGridSpanSmall());
  207. ChartsService.initCommonPanel("charts_21", ServiceProduct.getDayProduceRate());
  208. ChartsService.initCommonPie("charts_22", ServiceWorkhour.getDayByMaterial());
  209. ChartsService.initCommonPie("charts_23", ServiceProduceTask.getDayCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  210. ChartsService.initCommonPie("charts_24", ServicePerson.getDayAttendance(), [ '#37a2da','#ff9f7f']);
  211. this.loadData();
  212. // 开启定时器
  213. this.timer_short = setInterval(this.scrollData, 5000);
  214. },
  215. // 轮播数据
  216. scrollData: function () {
  217. for (var key in this.cacheDataObject) {
  218. const dataList = this.cacheDataObject[key].data;
  219. const pagesize = this.cacheDataObject[key].pagesize;
  220. var pageindex = this.cacheDataObject[key].pageindex + 1;
  221. if (dataList.length > pagesize) {
  222. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  223. pagesize > 0 ? 1 : 0);
  224. if (pageindex >= pagesum)
  225. pageindex = 0;
  226. this.cacheDataObject[key].pageindex = pageindex;
  227. const startIndex = pageindex * pagesize;
  228. const remainSum = dataList.length - startIndex;
  229. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  230. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  231. }
  232. }
  233. },
  234. // 从服务器加载数据
  235. loadData: function () {
  236. this.cacheDataObject = {};
  237. const userList = ServicePerson.getWorkPersonList();
  238. this.cacheDataObject.userList = {
  239. data: userList,
  240. pagesize: 5,
  241. pageindex: 0
  242. }
  243. this.userList = userList.slice(0, this.cacheDataObject.userList.pagesize);
  244. // 生产计划
  245. const dayProduceTaskList = ServiceProduceTask.getDayList();
  246. this.cacheDataObject.dayProduceTaskList = {
  247. data: dayProduceTaskList,
  248. pagesize: 14,
  249. pageindex: 0
  250. }
  251. this.dayProduceTaskList = dayProduceTaskList.slice(0, this.cacheDataObject
  252. .dayProduceTaskList.pagesize);
  253. // 在生产图片
  254. const doingTaskList = ServiceProduceTask.getDoingListByOrder();
  255. this.cacheDataObject.doingTaskList = {
  256. data: doingTaskList,
  257. pagesize: 6,
  258. pageindex: 0
  259. }
  260. this.doingTaskList = doingTaskList.slice(0, this.cacheDataObject.doingTaskList
  261. .pagesize);
  262. }
  263. },
  264. mounted() {
  265. this.timer_long = setInterval(this.refreshData, 60000);
  266. this.refreshData();
  267. },
  268. beforeDestroy() {
  269. clearInterval(this.timer_long);
  270. clearInterval(this.timer_short);
  271. }
  272. });
  273. </script>
  274. </body>
  275. </html>