produce.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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.js"></script>
  10. <script type="text/javascript" src="/js/session.js"></script>
  11. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  12. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  13. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  14. </head>
  15. <body id="container" class="container-fluid">
  16. <div class="row no-padding head-bar" style="height:81px">
  17. <div class="col-lg-1 col-md-1">
  18. </div>
  19. <div class="col-lg-4 col-md-4 page-title">
  20. 制造管理看板
  21. </div>
  22. <div class="col-lg-3 col-md-3 block-padding">
  23. <button type="button" class="btn btn-warning"
  24. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  25. <button type="button" class="btn btn-warning"
  26. onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
  27. <button type="button" class="btn btn-warning"
  28. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  29. </div>
  30. <div class="col-lg-4 col-md-4">
  31. </div>
  32. </div>
  33. <div class="my-container" id="div-main">
  34. <div class="row">
  35. <div class="col-lg-3 col-md-3">
  36. <!--生产计划达成率-->
  37. <div class="row block-padding">
  38. <div class="col-lg-12 col-md-12 center block-title">生产计划达成率</div>
  39. </div>
  40. <div class="row block-padding">
  41. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_11"></div>
  42. </div>
  43. <!--月工时分布情况-->
  44. <div class="row block-padding">
  45. <div class="col-lg-12 col-md-12 center block-title">月工时分布情况</div>
  46. </div>
  47. <div class="row block-padding">
  48. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_12"></div>
  49. </div>
  50. <!--月质量异常分类 -->
  51. <div class="row block-padding">
  52. <div class="col-lg-12 col-md-12 center block-title">月生产异常分类</div>
  53. </div>
  54. <div class="row">
  55. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_13"></div>
  56. </div>
  57. </div>
  58. <div class="col-lg-6 col-md-6">
  59. <!--月生产计划-->
  60. <div class="row block-padding">
  61. <div class="col-lg-12 col-md-12 center block-title">月生产计划</div>
  62. </div>
  63. <div class="row block-padding">
  64. <div class="col-lg-1 col-md-1 center no-padding">工单号</div>
  65. <div class="col-lg-2 col-md-2 center no-padding">项目名</div>
  66. <div class="col-lg-1 col-md-1 center no-padding">料号</div>
  67. <div class="col-lg-2 col-md-2 center no-padding">型号规格</div>
  68. <div class="col-lg-2 col-md-2 center no-padding">名称</div>
  69. <div class="col-lg-1 col-md-1 center no-padding">计划数量</div>
  70. <div class="col-lg-1 col-md-1 center no-padding">工时</div>
  71. <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div>
  72. </div>
  73. <div class="row">
  74. <div class="col-lg-12 col-md-12" style="height: 380px;">
  75. <div class="row" v-for="product in mouthProduceTaskList">
  76. <div class="col-lg-1 col-md-1 center no-padding">{{product.orderSheetCode}}</div>
  77. <div class="col-lg-2 col-md-2 center no-padding">{{product.projectName}}</div>
  78. <div class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
  79. <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div>
  80. <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
  81. <div class="col-lg-1 col-md-1 center no-padding">{{product.planSum}}</div>
  82. <div class="col-lg-1 col-md-1 center no-padding">{{product.workHour}}</div>
  83. <div class="col-lg-2 col-md-2 center no-padding progress">
  84. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  85. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  86. {{product.completeSum}}
  87. </div>
  88. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  89. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  90. {{product.incompleteSum}}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="row block-padding">
  97. <div class="col-lg-6 col-md-6">
  98. <div class="row">
  99. <div class="col-lg-12 col-md-12 center block-title">人员出勤率</div>
  100. </div>
  101. <div class="row">
  102. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_21"></div>
  103. </div>
  104. <div class="row">
  105. <div class="col-lg-12 col-md-12 center block-title">当月产品良率</div>
  106. </div>
  107. <div class="row">
  108. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_22"></div>
  109. </div>
  110. </div>
  111. <div class="col-lg-6 col-md-6">
  112. <div class="row">
  113. <div class="col-lg-12 col-md-12 center block-title">月制程质量异常</div>
  114. </div>
  115. <div class="row">
  116. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_23"></div>
  117. </div>
  118. <div class="row">
  119. <div class="col-lg-12 col-md-12 center block-title">周成品入库数量</div>
  120. </div>
  121. <div class="row">
  122. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_24"></div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="col-lg-3">
  128. <div class="row block-padding">
  129. <div class="col-lg-12 col-md-12 center block-title">生产效率</div>
  130. </div>
  131. <div class="row block-padding">
  132. <div class="col-lg-12 col-md-12" style="height:260px" id="charts_31"></div>
  133. </div>
  134. <div class="row block-padding">
  135. <div class="col-lg-12 col-md-12 center block-title">标准工时与实际工时对比</div>
  136. </div>
  137. <div class="row block-padding">
  138. <div class="col-lg-12 col-md-12" style="height:280px" id="charts_32"></div>
  139. </div>
  140. <div class="row block-padding">
  141. <div class="col-lg-12 col-md-12 center block-title">月度项目发货统计</div>
  142. </div>
  143. <div class="row">
  144. <div class="col-lg-12 col-md-12" style="height:280px" id="charts_33"></div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <!-- jQuery -->
  150. <script src="/lib/jquery.min.js"></script>
  151. <script src="/lib/vue.min.js"></script>
  152. <script src="/lib/echarts/echarts.min.js"></script>
  153. <script src="/lib/echarts/theme/macarons.js"></script>
  154. <script src="/js/service/material.js?_v=1"></script>
  155. <script src="/js/service/product.js?_v=1"></script>
  156. <script src="/js/service/person.js?_v=1"></script>
  157. <script src="/js/service/produce-task.js?_v=1"></script>
  158. <script src="/js/service/workhour.js?_v=1"></script>
  159. <script src="/js/content/mycharts.js?_v=1"></script>
  160. <script type="text/javascript">
  161. var vm = new Vue({
  162. el: '#div-main',
  163. data: {
  164. mouthProduceTaskList: [],
  165. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  166. timer_long: '', // 定时取服务器数据
  167. timer_short: '' // 数据超长定时轮播
  168. },
  169. methods: {
  170. // 从服务器加载数据并显示
  171. refreshData: function () {
  172. // 关闭定时器
  173. clearInterval(this.timer_short);
  174. // 刷新报表
  175. ChartsService.initCommonPie("charts_11", ServiceProduceTask.getCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  176. ChartsService.initCommonPie("charts_12", ServiceWorkhour.getByMaterial());
  177. ChartsService.initBarWithShade("charts_13", ServiceProduct
  178. .getQualityExceptionByCategory(), ChartsService.getGridSpanSmall());
  179. ChartsService.initBarWithTwoNumberRate("charts_21", ServicePerson.getMonthAttendance(),
  180. ChartsService.getGridSpanSmall());
  181. ChartsService.initBarWithTwoNumberRate("charts_22", ServiceProduct.getMonthGood(),
  182. ChartsService.getGridSpanSmall());
  183. ChartsService.initBarWithShade("charts_23", ServiceProduct
  184. .getMonthExceptionByCategory(), ChartsService.getGridSpanSmall());
  185. ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  186. ChartsService.getGridSpanSmall());
  187. ChartsService.initCommonPanel("charts_31", ServiceProduct.getProduceRate());
  188. ChartsService.initBarAndLine("charts_32", ServiceWorkhour.getStandAndRealByMaterial());
  189. ChartsService.initBarWithShade("charts_33", ServiceProduct.getMonthSendByProject());
  190. this.loadData();
  191. // 开启定时器
  192. this.timer_short = setInterval(this.scrollData, 5000);
  193. },
  194. // 轮播数据
  195. scrollData: function () {
  196. for (var key in this.cacheDataObject) {
  197. const dataList = this.cacheDataObject[key].data;
  198. const pagesize = this.cacheDataObject[key].pagesize;
  199. var pageindex = this.cacheDataObject[key].pageindex + 1;
  200. if (dataList.length > pagesize) {
  201. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  202. pagesize > 0 ? 1 : 0);
  203. if (pageindex >= pagesum)
  204. pageindex = 0;
  205. this.cacheDataObject[key].pageindex = pageindex;
  206. const startIndex = pageindex * pagesize;
  207. const remainSum = dataList.length - startIndex;
  208. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  209. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  210. }
  211. }
  212. },
  213. // 从服务器加载数据
  214. loadData: function () {
  215. this.cacheDataObject = {};
  216. // 月度生产计划
  217. const mouthProduceTaskList = ServiceProduceTask.getMonthList();
  218. this.cacheDataObject.mouthProduceTaskList = {
  219. data: mouthProduceTaskList,
  220. pagesize: 10,
  221. pageindex: 0
  222. }
  223. this.mouthProduceTaskList = mouthProduceTaskList.slice(0, this.cacheDataObject
  224. .mouthProduceTaskList.pagesize);
  225. }
  226. },
  227. mounted() {
  228. this.timer_long = setInterval(this.refreshData, 60000);
  229. this.refreshData();
  230. },
  231. beforeDestroy() {
  232. clearInterval(this.timer_long);
  233. clearInterval(this.timer_short);
  234. }
  235. });
  236. </script>
  237. </body>
  238. </html>