produce.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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" >
  139. <div class="col-lg-12 col-md-12 center block-title" >当月生产效率</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: 290px;">
  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" style="overflow:hidden; word-break:break-all;white-space:nowrap">{{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. var pageSizeMonthGoodB = 3;
  213. var pageIndexMonthGoodB = 0;
  214. const monthExceptionByCategory = ServiceProduct.getMonthExceptionByCategory();
  215. // setTimeout(beginFunA("charts_23",monthExceptionByCategory,10000,"charts_23"),500);
  216. setTimeout(beB,500);
  217. function beB(){
  218. var lsitMonth = monthExceptionByCategory.slice(pageIndexMonthGoodB,pageSizeMonthGoodB);
  219. pageIndexMonthGoodB = pageSizeMonthGoodB;
  220. pageSizeMonthGoodB = pageSizeMonthGoodB + initSize;
  221. ChartsService.initBarWithTwoNumberRate("charts_23", lsitMonth,
  222. ChartsService.getGridSpanSmall());
  223. if(monthExceptionByCategory.length <= pageIndexMonthGoodB){
  224. return;
  225. }
  226. setInterval(beginScrollB,10000);
  227. }
  228. function beginScrollB(){
  229. var lsitMonth = monthExceptionByCategory.slice(pageIndexMonthGoodB,pageSizeMonthGoodB);
  230. pageIndexMonthGoodB = pageSizeMonthGoodB;
  231. pageSizeMonthGoodB = pageSizeMonthGoodB + initSize;
  232. if(monthExceptionByCategory.length <= pageIndexMonthGoodB){
  233. pageIndexMonthGoodB = 0;
  234. pageSizeMonthGoodB = initSize;
  235. }
  236. ChartsService.initBarWithTwoNumberRate("charts_23", lsitMonth,
  237. ChartsService.getGridSpanSmall());
  238. }
  239. const monthGoodList = ServiceProduct.getMonthGood();
  240. setTimeout(beA,500);
  241. var pageSizeMonthGood = 3;
  242. var pageIndexMonthGood = 0;
  243. function beA(){
  244. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  245. pageIndexMonthGood = pageSizeMonthGood;
  246. pageSizeMonthGood = pageSizeMonthGood + initSize;
  247. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  248. ChartsService.getGridSpanSmall());
  249. if(monthGoodList.length <= pageIndexMonthGood){
  250. return;
  251. }
  252. setInterval(beginScrollA,10000);
  253. }
  254. function beginScrollA(){
  255. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  256. pageIndexMonthGood = pageSizeMonthGood;
  257. pageSizeMonthGood = pageSizeMonthGood + initSize;
  258. if(monthGoodList.length <= pageIndexMonthGood){
  259. pageIndexMonthGood = 0;
  260. pageSizeMonthGood = initSize;
  261. }
  262. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  263. ChartsService.getGridSpanSmall());
  264. }
  265. var vm = new Vue({
  266. el: '#div-main',
  267. data: {
  268. mouthProduceTaskList: [],
  269. projectScheduleCompletionList:[],
  270. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  271. timer_long: '', // 定时取服务器数据
  272. timer_short: '' // 数据超长定时轮播
  273. },
  274. methods: {
  275. // 从服务器加载数据并显示
  276. refreshData: function () {
  277. // 关闭定时器
  278. clearInterval(this.timer_short);
  279. // 刷新报表
  280. ChartsService.initCommonPie("charts_11", ServiceProduceTask.getCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  281. ChartsService.initCommonPie("charts_12", ServiceWorkhour.getByMaterial());
  282. ChartsService.initBarWithShade("charts_13", ServiceProduct
  283. .getQualityExceptionByCategory(), ChartsService.getGridSpanSmall());
  284. ChartsService.initBarWithTwoNumberRate("charts_21", ServicePerson.getMonthAttendance(),
  285. ChartsService.getGridSpanSmall());
  286. // ChartsService.initBarWithTwoNumberRate("charts_22", ServiceProduct.getMonthGood(),
  287. // ChartsService.getGridSpanSmall());
  288. // ChartsService.initBarWithShade("charts_23", ServiceProduct
  289. // .getMonthExceptionByCategory(), ChartsService.getGridSpanSmall());
  290. // ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  291. // ChartsService.getGridSpanSmall());
  292. ChartsService.initCommonPanel("charts_31", ServiceProduct.getProduceRate());
  293. // ChartsService.initBarAndLine("charts_32", ServiceWorkhour.getStandAndRealByMaterial());
  294. ChartsService.initBarWithShade("charts_33", ServiceProduct.getMonthSendByProject());
  295. this.loadData();
  296. // 开启定时器
  297. this.timer_short = setInterval(this.scrollData, 5000);
  298. },
  299. // 轮播数据
  300. scrollData: function () {
  301. for (var key in this.cacheDataObject) {
  302. const dataList = this.cacheDataObject[key].data;
  303. const pagesize = this.cacheDataObject[key].pagesize;
  304. var pageindex = this.cacheDataObject[key].pageindex + 1;
  305. if (dataList.length > pagesize) {
  306. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  307. pagesize > 0 ? 1 : 0);
  308. if (pageindex >= pagesum)
  309. pageindex = 0;
  310. this.cacheDataObject[key].pageindex = pageindex;
  311. const startIndex = pageindex * pagesize;
  312. const remainSum = dataList.length - startIndex;
  313. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  314. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  315. if(keyPar.length < 1){
  316. continue;
  317. }
  318. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  319. }
  320. }
  321. },
  322. // 从服务器加载数据
  323. loadData: function () {
  324. this.cacheDataObject = {};
  325. // 月度生产计划
  326. const mouthProduceTaskList = ServiceProduceTask.getMonthList();
  327. this.cacheDataObject.mouthProduceTaskList = {
  328. data: mouthProduceTaskList,
  329. pagesize: 9,
  330. pageindex: 0
  331. }
  332. this.mouthProduceTaskList = mouthProduceTaskList.slice(0, this.cacheDataObject
  333. .mouthProduceTaskList.pagesize);
  334. //项目进度完工百分比
  335. const projectScheduleCompletionList = ServiceProduceTask.getProjectScheduleCompletion();
  336. this.cacheDataObject.projectScheduleCompletionList = {
  337. data: projectScheduleCompletionList,
  338. pagesize: 8,
  339. pageindex: 0
  340. }
  341. this.projectScheduleCompletionList = projectScheduleCompletionList.slice(0, this.cacheDataObject
  342. .projectScheduleCompletionList.pagesize);
  343. }
  344. },
  345. mounted() {
  346. this.timer_long = setInterval(this.refreshData, 100000);
  347. this.refreshData();
  348. },
  349. beforeDestroy() {
  350. clearInterval(this.timer_long);
  351. clearInterval(this.timer_short);
  352. }
  353. });
  354. </script>
  355. </body>
  356. </html>