produce.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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:290px" 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:290px" 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:290px" 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-2 col-md-2 center no-padding">项目名</div>
  70. <div class="col-lg-2 col-md-2 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 class="col-lg-2 col-md-2 center no-padding">{{product.define12}}</div>
  84. <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 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:250px" 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:250px" id="charts_24"></div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="col-lg-3" style="height: 100%;">
  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" style="height: 33%;min-height: 290px;">
  140. <div class="col-lg-12 col-md-12" style="height:260px" 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="row block-padding" style="height: 33%;min-height: 290px;">
  146. <!-- <div class="col-lg-12 col-md-12" style="height:280px" id="charts_32"></div> -->
  147. <!--月生产计划-->
  148. <div class="col-lg-12 col-md-12">
  149. <!-- <div class="col-lg-3 col-md-3 center no-padding">工单号</div> -->
  150. <div class="col-lg-3 col-md-3 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-2 col-md-2 center no-padding">实际工时</div>
  154. <div class="col-lg-3 col-md-3 center no-padding">完工百分比</div>
  155. </div>
  156. <div class="col-lg-12 col-md-12">
  157. <div class="col-lg-12 col-md-12" >
  158. <div class="row" v-for="product in projectScheduleCompletionList">
  159. <!-- <div class="col-lg-3 col-md-3 center no-padding">{{product.productionOrderNumberName}}</div> -->
  160. <div class="col-lg-3 col-md-3 center no-padding" style="overflow:hidden; word-break:break-all;white-space:nowrap">{{product.define12}}</div>
  161. <div class="col-lg-2 col-md-2 center no-padding">{{product.planSum}}</div>
  162. <div class="col-lg-2 col-md-2 center no-padding">{{product.workHour}}</div>
  163. <div class="col-lg-2 col-md-2 center no-padding">{{product.manHoursInvested}}</div>
  164. <div class="col-lg-3 col-md-3 center no-padding progress">
  165. <span style="z-index:999;position:absolute;">{{product.completePercent}}</span>
  166. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  167. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  168. <!-- {{product.completePercent}} -->
  169. </div>
  170. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  171. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  172. <!-- {{product.incompleteSum}} -->
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="row block-padding">
  180. <div class="col-lg-12 col-md-12 center block-title">月度项目发货统计</div>
  181. </div>
  182. <div class="row" style="height: 33%;">
  183. <div class="col-lg-12 col-md-12" style="height:250px" id="charts_33"></div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <!-- jQuery -->
  189. <script src="/lib/jquery.min.js"></script>
  190. <script src="/lib/vue.min.js"></script>
  191. <script src="/lib/echarts/echarts.min.js"></script>
  192. <script src="/lib/echarts/theme/macarons.js"></script>
  193. <script src="/js/service/material.js?_v=2"></script>
  194. <script src="/js/service/product.js?_v=2"></script>
  195. <script src="/js/service/person.js?_v=2"></script>
  196. <script src="/js/service/produce-task.js?_v=2"></script>
  197. <script src="/js/service/workhour.js?_v=2"></script>
  198. <script src="/js/content/mycharts.js?_v=2"></script>
  199. <script type="text/javascript">
  200. // 参数说明:beginFun("图表ID","list形式数据","翻页时间(毫秒)","本页面唯一id(不可重复)")
  201. // ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  202. // ChartsService.getGridSpanSmall());
  203. var initSize = 3;
  204. var pageSize = 3;
  205. var pageIndex = 0;
  206. var pageSizeA = 3;
  207. var pageIndexA = 0;
  208. const weekInBycategoryList = ServiceProduct.getWeekInByCategory();
  209. setTimeout(beginFun("charts_24",weekInBycategoryList,10000,"charts_24"),500);
  210. var pageSizeMonthGoodB = 3;
  211. var pageIndexMonthGoodB = 0;
  212. const monthExceptionByCategory = ServiceProduct.getMonthExceptionByCategory();
  213. // setTimeout(beginFunA("charts_23",monthExceptionByCategory,10000,"charts_23"),500);
  214. setTimeout(beB,500);
  215. function beB(){
  216. var lsitMonth = monthExceptionByCategory.slice(pageIndexMonthGoodB,pageSizeMonthGoodB);
  217. pageIndexMonthGoodB = pageSizeMonthGoodB;
  218. pageSizeMonthGoodB = pageSizeMonthGoodB + initSize;
  219. ChartsService.initBarWithTwoNumberRate("charts_23", lsitMonth,
  220. ChartsService.getGridSpanSmall());
  221. if(monthExceptionByCategory.length <= pageIndexMonthGoodB){
  222. return;
  223. }
  224. setInterval(beginScrollB,10000);
  225. }
  226. function beginScrollB(){
  227. var lsitMonth = monthExceptionByCategory.slice(pageIndexMonthGoodB,pageSizeMonthGoodB);
  228. pageIndexMonthGoodB = pageSizeMonthGoodB;
  229. pageSizeMonthGoodB = pageSizeMonthGoodB + initSize;
  230. if(monthExceptionByCategory.length <= pageIndexMonthGoodB){
  231. pageIndexMonthGoodB = 0;
  232. pageSizeMonthGoodB = initSize;
  233. }
  234. ChartsService.initBarWithTwoNumberRate("charts_23", lsitMonth,
  235. ChartsService.getGridSpanSmall());
  236. }
  237. const monthGoodList = ServiceProduct.getMonthGood();
  238. setTimeout(beA,500);
  239. var pageSizeMonthGood = 3;
  240. var pageIndexMonthGood = 0;
  241. function beA(){
  242. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  243. pageIndexMonthGood = pageSizeMonthGood;
  244. pageSizeMonthGood = pageSizeMonthGood + initSize;
  245. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  246. ChartsService.getGridSpanSmall());
  247. if(monthGoodList.length <= pageIndexMonthGood){
  248. return;
  249. }
  250. setInterval(beginScrollA,10000);
  251. }
  252. function beginScrollA(){
  253. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  254. pageIndexMonthGood = pageSizeMonthGood;
  255. pageSizeMonthGood = pageSizeMonthGood + initSize;
  256. if(monthGoodList.length <= pageIndexMonthGood){
  257. pageIndexMonthGood = 0;
  258. pageSizeMonthGood = initSize;
  259. }
  260. ChartsService.initBarWithTwoNumberRate("charts_22", lsitMonth,
  261. ChartsService.getGridSpanSmall());
  262. }
  263. var vm = new Vue({
  264. el: '#div-main',
  265. data: {
  266. mouthProduceTaskList: [],
  267. projectScheduleCompletionList:[],
  268. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  269. timer_long: '', // 定时取服务器数据
  270. timer_short: '' // 数据超长定时轮播
  271. },
  272. methods: {
  273. // 从服务器加载数据并显示
  274. refreshData: function () {
  275. // 关闭定时器
  276. clearInterval(this.timer_short);
  277. // 刷新报表
  278. ChartsService.initCommonPie("charts_11", ServiceProduceTask.getCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  279. ChartsService.initCommonPie("charts_12", ServiceWorkhour.getByMaterial());
  280. ChartsService.initBarWithShade("charts_13", ServiceProduct
  281. .getQualityExceptionByCategory(), ChartsService.getGridSpanSmall());
  282. ChartsService.initBarWithTwoNumberRate("charts_21", ServicePerson.getMonthAttendance(),
  283. ChartsService.getGridSpanSmall());
  284. // ChartsService.initBarWithTwoNumberRate("charts_22", ServiceProduct.getMonthGood(),
  285. // ChartsService.getGridSpanSmall());
  286. // ChartsService.initBarWithShade("charts_23", ServiceProduct
  287. // .getMonthExceptionByCategory(), ChartsService.getGridSpanSmall());
  288. // ChartsService.initBarWithShade("charts_24", ServiceProduct.getWeekInByCategory(),
  289. // ChartsService.getGridSpanSmall());
  290. ChartsService.initCommonPanel("charts_31", ServiceProduct.getProduceRate());
  291. // ChartsService.initBarAndLine("charts_32", ServiceWorkhour.getStandAndRealByMaterial());
  292. ChartsService.initBarWithShade("charts_33", ServiceProduct.getMonthSendByProject());
  293. this.loadData();
  294. // 开启定时器
  295. this.timer_short = setInterval(this.scrollData, 5000);
  296. },
  297. // 轮播数据
  298. scrollData: function () {
  299. for (var key in this.cacheDataObject) {
  300. const dataList = this.cacheDataObject[key].data;
  301. const pagesize = this.cacheDataObject[key].pagesize;
  302. var pageindex = this.cacheDataObject[key].pageindex + 1;
  303. if (dataList.length > pagesize) {
  304. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  305. pagesize > 0 ? 1 : 0);
  306. if (pageindex >= pagesum)
  307. pageindex = 0;
  308. this.cacheDataObject[key].pageindex = pageindex;
  309. const startIndex = pageindex * pagesize;
  310. const remainSum = dataList.length - startIndex;
  311. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  312. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  313. if(keyPar.length < 1){
  314. continue;
  315. }
  316. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  317. }
  318. }
  319. },
  320. // 从服务器加载数据
  321. loadData: function () {
  322. this.cacheDataObject = {};
  323. // 月度生产计划
  324. const mouthProduceTaskList = ServiceProduceTask.getMonthList();
  325. this.cacheDataObject.mouthProduceTaskList = {
  326. data: mouthProduceTaskList,
  327. pagesize: 9,
  328. pageindex: 0
  329. }
  330. this.mouthProduceTaskList = mouthProduceTaskList.slice(0, this.cacheDataObject
  331. .mouthProduceTaskList.pagesize);
  332. //项目进度完工百分比
  333. const projectScheduleCompletionList = ServiceProduceTask.getProjectScheduleCompletion();
  334. this.cacheDataObject.projectScheduleCompletionList = {
  335. data: projectScheduleCompletionList,
  336. pagesize: 8,
  337. pageindex: 0
  338. }
  339. this.projectScheduleCompletionList = projectScheduleCompletionList.slice(0, this.cacheDataObject
  340. .projectScheduleCompletionList.pagesize);
  341. }
  342. },
  343. mounted() {
  344. this.timer_long = setInterval(this.refreshData, 100000);
  345. this.refreshData();
  346. },
  347. beforeDestroy() {
  348. clearInterval(this.timer_long);
  349. clearInterval(this.timer_short);
  350. }
  351. });
  352. </script>
  353. </body>
  354. </html>