produce.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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.js"></script>
  12. <script type="text/javascript" src="/js/session.js"></script>
  13. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  14. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  15. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  16. </head>
  17. <body id="container" class="container-fluid">
  18. <div class="row no-padding head-bar" style="height:81px">
  19. <div class="col-lg-1 col-md-1">
  20. </div>
  21. <div class="col-lg-4 col-md-4 page-title">
  22. 制造管理看板
  23. </div>
  24. <div class="col-lg-4 col-md-4 block-padding">
  25. <button type="button" class="btn btn-warning"
  26. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  27. <button type="button" class="btn btn-warning"
  28. onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
  29. <button type="button" class="btn btn-warning"
  30. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  31. <button type="button" class="btn btn-warning"
  32. onclick="window.location.replace('/pages/dashboard/esop.html');">E-SOP</button>
  33. <button type="button" class="btn btn-warning"
  34. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  35. </div>
  36. <div class="col-lg-4 col-md-4">
  37. </div>
  38. </div>
  39. <div class="my-container" id="div-main">
  40. <div class="row">
  41. <div class="col-lg-3 col-md-3">
  42. <!--生产计划达成率-->
  43. <div class="row block-padding">
  44. <div class="col-lg-12 col-md-12 center block-title">生产计划达成率</div>
  45. </div>
  46. <div class="row block-padding">
  47. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_11"></div>
  48. </div>
  49. <!--月工时分布情况-->
  50. <div class="row block-padding">
  51. <div class="col-lg-12 col-md-12 center block-title">月工时分布情况</div>
  52. </div>
  53. <div class="row block-padding">
  54. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_12"></div>
  55. </div>
  56. <!--月质量异常分类 -->
  57. <div class="row block-padding">
  58. <div class="col-lg-12 col-md-12 center block-title">月生产异常分类</div>
  59. </div>
  60. <div class="row">
  61. <div class="col-lg-12 col-md-12" style="height:290px" id="charts_13"></div>
  62. </div>
  63. </div>
  64. <div class="col-lg-6 col-md-6">
  65. <!--月生产计划-->
  66. <div class="row block-padding">
  67. <div class="col-lg-12 col-md-12 center block-title">月生产计划</div>
  68. </div>
  69. <div class="row block-padding">
  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 class="col-lg-2 col-md-2 center no-padding">物料编码</div>
  73. <!-- <div class="col-lg-2 col-md-2 center no-padding">型号规格</div> -->
  74. <div class="col-lg-2 col-md-2 center no-padding">物料名称</div>
  75. <div class="col-lg-1 col-md-1 center no-padding">计划数量</div>
  76. <div class="col-lg-1 col-md-1 center no-padding">标准工时</div>
  77. <div class="col-lg-1 col-md-1 center no-padding">实际工时</div>
  78. <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div>
  79. <!-- <span style="background-color:#5bc0de">&nbsp;&nbsp;&nbsp;</span> -->
  80. </div>
  81. <div class="row">
  82. <div class="col-lg-12 col-md-12" style="height: 350px;">
  83. <div class="row" v-for="product in mouthProduceTaskList">
  84. <div class="col-lg-1 col-md-1 center no-padding">{{product.orderSheetCode}}</div>
  85. <div class="col-lg-2 col-md-2 center no-padding">{{product.define12}}</div>
  86. <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 center no-padding">{{product.materialCode}}</div>
  87. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  88. <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 left no-padding">{{product.materialName}}</div>
  89. <div class="col-lg-1 col-md-1 center no-padding">{{product.planSum}}</div>
  90. <div class="col-lg-1 col-md-1 center no-padding">{{product.workHour}}</div>
  91. <div class="col-lg-1 col-md-1 center no-padding">{{product.manHoursInvested}}</div>
  92. <div class="col-lg-2 col-md-2 center no-padding progress">
  93. <span style="z-index:999;position:absolute;">{{product.completePercent}}</span>
  94. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  95. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  96. <!-- {{product.completePercent}} -->
  97. </div>
  98. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  99. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  100. <!-- {{product.incompletePercent}} -->
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="row block-padding">
  107. <div class="col-lg-6 col-md-6">
  108. <div class="row">
  109. <div class="col-lg-12 col-md-12 center block-title">人员出勤率</div>
  110. </div>
  111. <div class="row">
  112. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_21"></div>
  113. </div>
  114. <div class="row">
  115. <div class="col-lg-12 col-md-12 center block-title">当月产品良率</div>
  116. </div>
  117. <div class="row">
  118. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_22"></div>
  119. </div>
  120. </div>
  121. <div class="col-lg-6 col-md-6">
  122. <div class="row">
  123. <div class="col-lg-12 col-md-12 center block-title">月制程质量异常</div>
  124. </div>
  125. <div class="row">
  126. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_23"></div>
  127. </div>
  128. <div class="row">
  129. <div class="col-lg-12 col-md-12 center block-title">周成品入库数量</div>
  130. </div>
  131. <div class="row">
  132. <div class="col-lg-12 col-md-2" style="height:250px" id="charts_24"></div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="col-lg-3" style="height: 100%;">
  138. <div class="row block-padding" style="min-height: 70px;">
  139. <div class="col-lg-12 col-md-12 center block-title" style="margin-top: 10px;">当月生产效率</div>
  140. </div>
  141. <div class="row block-padding" style="height: 33%;min-height: 290px;">
  142. <div class="col-lg-12 col-md-12" style="height:260px" id="charts_31"></div>
  143. </div>
  144. <div class="row block-padding">
  145. <div class="col-lg-12 col-md-12 center block-title">项目完工进度</div>
  146. </div>
  147. <div class="row block-padding" style="height: 33%;min-height: 250px;">
  148. <!-- <div class="col-lg-12 col-md-12" style="height:280px" id="charts_32"></div> -->
  149. <!--月生产计划-->
  150. <div class="col-lg-12 col-md-12">
  151. <!-- <div class="col-lg-3 col-md-3 center no-padding">工单号</div> -->
  152. <div class="col-lg-3 col-md-3 center no-padding">项目名</div>
  153. <div class="col-lg-2 col-md-2 center no-padding">计划数量</div>
  154. <div class="col-lg-2 col-md-2 center no-padding">标准工时</div>
  155. <div class="col-lg-2 col-md-2 center no-padding">实际工时</div>
  156. <div class="col-lg-3 col-md-3 center no-padding">完工百分比</div>
  157. </div>
  158. <div class="col-lg-12 col-md-12">
  159. <div class="col-lg-12 col-md-12" >
  160. <div class="row" v-for="product in projectScheduleCompletionList">
  161. <!-- <div class="col-lg-3 col-md-3 center no-padding">{{product.productionOrderNumberName}}</div> -->
  162. <div class="col-lg-3 col-md-3 center no-padding">{{product.define12}}</div>
  163. <div class="col-lg-2 col-md-2 center no-padding">{{product.planSum}}</div>
  164. <div class="col-lg-2 col-md-2 center no-padding">{{product.workHour}}</div>
  165. <div class="col-lg-2 col-md-2 center no-padding">{{product.manHoursInvested}}</div>
  166. <div class="col-lg-3 col-md-3 center no-padding progress">
  167. <span style="z-index:999;position:absolute;">{{product.completePercent}}</span>
  168. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  169. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  170. <!-- {{product.completePercent}} -->
  171. </div>
  172. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  173. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  174. <!-- {{product.incompleteSum}} -->
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="row block-padding">
  182. <div class="col-lg-12 col-md-12 center block-title">月度项目发货统计</div>
  183. </div>
  184. <div class="row" style="height: 33%;">
  185. <div class="col-lg-12 col-md-12" style="height:250px" id="charts_33"></div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. <!-- jQuery -->
  191. <script src="/lib/jquery.min.js"></script>
  192. <script src="/lib/vue.min.js"></script>
  193. <script src="/lib/echarts/echarts.min.js"></script>
  194. <script src="/lib/echarts/theme/macarons.js"></script>
  195. <script src="/js/service/material.js?_v=2"></script>
  196. <script src="/js/service/product.js?_v=2"></script>
  197. <script src="/js/service/person.js?_v=2"></script>
  198. <script src="/js/service/produce-task.js?_v=2"></script>
  199. <script src="/js/service/workhour.js?_v=2"></script>
  200. <script src="/js/content/mycharts.js?_v=2"></script>
  201. <script type="text/javascript">
  202. // 参数说明:beginFun("图表ID","list形式数据","翻页时间(毫秒)","本页面唯一id(不可重复)")
  203. // ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  204. // ChartsService.getGridSpanSmall());
  205. var initSize = 3;
  206. var pageSize = 3;
  207. var pageIndex = 0;
  208. var pageSizeA = 3;
  209. var pageIndexA = 0;
  210. const weekInBycategoryList = ServiceProduct.getWeekInByCategory();
  211. setTimeout(beginFun("charts_24",weekInBycategoryList,10000,"charts_24"),500);
  212. const monthExceptionByCategory = ServiceProduct.getMonthExceptionByCategory();
  213. setTimeout(beginFunA("charts_23",monthExceptionByCategory,10000,"charts_23"),500);
  214. const monthGoodList = ServiceProduct.getMonthGood();
  215. setTimeout(beA,500);
  216. var pageSizeMonthGood = 3;
  217. var pageIndexMonthGood = 0;
  218. function beA(){
  219. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  220. pageIndexMonthGood = pageSizeMonthGood;
  221. pageSizeMonthGood = pageSizeMonthGood + initSize;
  222. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  223. ChartsService.getGridSpanSmall());
  224. if(monthGoodList.length <= pageIndexMonthGood){
  225. return;
  226. }
  227. setInterval(beginScrollA,10000);
  228. }
  229. function beginScrollA(){
  230. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  231. pageIndexMonthGood = pageSizeMonthGood;
  232. pageSizeMonthGood = pageSizeMonthGood + initSize;
  233. if(monthGoodList.length <= pageIndexMonthGood){
  234. pageIndexMonthGood = 0;
  235. pageSizeMonthGood = initSize;
  236. }
  237. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  238. ChartsService.getGridSpanSmall());
  239. }
  240. var vm = new Vue({
  241. el: '#div-main',
  242. data: {
  243. mouthProduceTaskList: [],
  244. projectScheduleCompletionList:[],
  245. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  246. timer_long: '', // 定时取服务器数据
  247. timer_short: '' // 数据超长定时轮播
  248. },
  249. methods: {
  250. // 从服务器加载数据并显示
  251. refreshData: function () {
  252. // 关闭定时器
  253. clearInterval(this.timer_short);
  254. // 刷新报表
  255. ChartsService.initCommonPie("charts_11", ServiceProduceTask.getCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  256. ChartsService.initCommonPie("charts_12", ServiceWorkhour.getByMaterial());
  257. ChartsService.initBarWithShade("charts_13", ServiceProduct
  258. .getQualityExceptionByCategory(), ChartsService.getGridSpanSmall());
  259. ChartsService.initBarWithTwoNumberRate("charts_21", ServicePerson.getMonthAttendance(),
  260. ChartsService.getGridSpanSmall());
  261. // ChartsService.initBarWithTwoNumberRate("charts_22", ServiceProduct.getMonthGood(),
  262. // ChartsService.getGridSpanSmall());
  263. // ChartsService.initBarWithShade("charts_23", ServiceProduct
  264. // .getMonthExceptionByCategory(), ChartsService.getGridSpanSmall());
  265. // ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  266. // ChartsService.getGridSpanSmall());
  267. ChartsService.initCommonPanel("charts_31", ServiceProduct.getProduceRate());
  268. // ChartsService.initBarAndLine("charts_32", ServiceWorkhour.getStandAndRealByMaterial());
  269. ChartsService.initBarWithShade("charts_33", ServiceProduct.getMonthSendByProject());
  270. this.loadData();
  271. // 开启定时器
  272. this.timer_short = setInterval(this.scrollData, 5000);
  273. },
  274. // 轮播数据
  275. scrollData: function () {
  276. for (var key in this.cacheDataObject) {
  277. const dataList = this.cacheDataObject[key].data;
  278. const pagesize = this.cacheDataObject[key].pagesize;
  279. var pageindex = this.cacheDataObject[key].pageindex + 1;
  280. if (dataList.length > pagesize) {
  281. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  282. pagesize > 0 ? 1 : 0);
  283. if (pageindex >= pagesum)
  284. pageindex = 0;
  285. this.cacheDataObject[key].pageindex = pageindex;
  286. const startIndex = pageindex * pagesize;
  287. const remainSum = dataList.length - startIndex;
  288. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  289. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  290. if(keyPar.length < 1){
  291. continue;
  292. }
  293. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  294. }
  295. }
  296. },
  297. // 从服务器加载数据
  298. loadData: function () {
  299. this.cacheDataObject = {};
  300. // 月度生产计划
  301. const mouthProduceTaskList = ServiceProduceTask.getMonthList();
  302. this.cacheDataObject.mouthProduceTaskList = {
  303. data: mouthProduceTaskList,
  304. pagesize: 9,
  305. pageindex: 0
  306. }
  307. this.mouthProduceTaskList = mouthProduceTaskList.slice(0, this.cacheDataObject
  308. .mouthProduceTaskList.pagesize);
  309. //项目进度完工百分比
  310. const projectScheduleCompletionList = ServiceProduceTask.getProjectScheduleCompletion();
  311. this.cacheDataObject.projectScheduleCompletionList = {
  312. data: projectScheduleCompletionList,
  313. pagesize: 5,
  314. pageindex: 0
  315. }
  316. this.projectScheduleCompletionList = projectScheduleCompletionList.slice(0, this.cacheDataObject
  317. .projectScheduleCompletionList.pagesize);
  318. }
  319. },
  320. mounted() {
  321. this.timer_long = setInterval(this.refreshData, 100000);
  322. this.refreshData();
  323. },
  324. beforeDestroy() {
  325. clearInterval(this.timer_long);
  326. clearInterval(this.timer_short);
  327. }
  328. });
  329. </script>
  330. </body>
  331. </html>