produce.html 20 KB

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