line.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <style>
  4. .marker { font-size: 12px;
  5. }
  6. </style>
  7. <head>
  8. <meta charset="utf-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=0.5">
  10. <!-- 一个小时刷新一下当前页 -->
  11. <!-- <meta http-equiv="refresh" content="3600"> -->
  12. <title>产线管理看板</title>
  13. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  14. <link href="/css/dashboard.css" rel="stylesheet" />
  15. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  16. <script type="text/javascript" src="/js/service.js"></script>
  17. <script type="text/javascript" src="/js/session.js"></script>
  18. <script type="text/javascript" src="/js/getService.js"></script>
  19. </head>
  20. <body id="container" class="container-fluid">
  21. <div class="row no-padding head-bar" style="height:81px">
  22. <div class="col-lg-1 col-md-1">
  23. </div>
  24. <div class="col-lg-4 col-md-4 page-title">
  25. 产线管理看板
  26. </div>
  27. <div class="col-lg-4 col-md-4 block-padding">
  28. <button type="button" class="btn btn-warning"
  29. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  30. <button type="button" class="btn btn-warning"
  31. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  32. <button type="button" class="btn btn-warning"
  33. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  34. <button type="button" class="btn btn-warning"
  35. onclick="window.location.replace('/pages/dashboard/esop.html');">E-SOP</button>
  36. <button type="button" class="btn btn-warning"
  37. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  38. </div>
  39. <div class="col-lg-4 col-md-4">
  40. </div>
  41. </div>
  42. <div class="my-container" id="div-main">
  43. <div class="row">
  44. <div class="col-lg-3 col-md-3">
  45. <!--人员信息-->
  46. <div class="row block-padding">
  47. <div class="col-lg-12 col-md-12 center block-title">产线人员信息</div>
  48. </div>
  49. <div class="row" style="height: 160px;">
  50. <div class="person-div" v-for="user in userList" style="text-align: center;margin-left:3%;">
  51. <div>
  52. <img height="140" width="100" v-bind:src="'/upPersonnel/Mechanice/'+user.fileName" border="0" />
  53. </div>
  54. <div style="width: 90px; overflow:hidden; word-break:break-all;white-space:nowrap">
  55. {{user.fileRealName}}
  56. </div>
  57. <!-- <div class="center">
  58. {{user.realName}}&nbsp;&nbsp;{{user.inTime}}
  59. </div> -->
  60. </div>
  61. </div>
  62. <div class="row block-padding">
  63. <div class="col-lg-12 col-md-12 center block-title">标准工时与实际工时对比</div>
  64. </div>
  65. <div class="row">
  66. <div class="col-lg-12 col-md-12" style="height:240px" id="charts_11"></div>
  67. </div>
  68. <div class="row block-padding">
  69. <div class="col-lg-12 col-md-12 center block-title">产品良率</div>
  70. </div>
  71. <div class="row">
  72. <div class="col-lg-12 col-md-2" style="height:240px" id="charts_12"></div>
  73. </div>
  74. <div class="row">
  75. <div class="col-lg-12 col-md-12 center block-title">质量异常分类</div>
  76. </div>
  77. <div class="row">
  78. <div class="col-lg-12 col-md-2" style="height:240px" id="charts_13"></div>
  79. </div>
  80. </div>
  81. <div class="col-lg-7" style="padding-left: 50px;">
  82. <div class="row block-padding" style="height: 350px;">
  83. <div style="height: 180px;padding: 0px 30px;" class="col-lg-4 col-md-4 " v-for="task in doingTaskList">
  84. <div class="task-block" :class="task.bgcss">
  85. <div class="row ">
  86. <div class="col-lg-12 col-md-12 center task-block-title">{{task.displayName}}</div>
  87. </div>
  88. <div class="row">
  89. <div class="col-lg-4 col-md-4" style="padding-left: 34px;padding-top: 27px;">
  90. <div class="task-block-title-small center">任务数量</div>
  91. <div class="task-block-title-big center">{{task.planSum}}</div>
  92. <div class="task-block-title-small center" style="padding-top:17px;">已完工总数</div>
  93. <div class="task-block-title-big center">{{task.completeSum}}</div>
  94. </div>
  95. <div class="col-lg-8 col-md-8" style="padding-left: 4px;padding-top: 10px;">
  96. <!-- <div class="task-block-text">预计开工日期:{{task.planStartDate}}</div> -->
  97. <div class="task-block-text">完工日期:{{task.planCompleteDate}}</div>
  98. <div class="task-block-text">物料编码:{{task.productId}}</div>
  99. <div class="task-block-text">物料名称:{{task.materialName}}</div>
  100. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  101. <!-- <div class="task-block-text">规格:{{task.specs}}</div> -->
  102. <div class="task-block-text">
  103. <div style="float:left">完成进度:</div>
  104. <div style="float:left;width:120px;padding-top:2px;">
  105. <div class="progress">
  106. <div class="progress-bar progress-bar-info" role="progressbar"
  107. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  108. :style="{width:task.completePercent}">
  109. {{task.completePercent}}
  110. </div>
  111. <div class="progress-bar progress-bar-warning" role="progressbar"
  112. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
  113. :style="{width:task.incompletePercent}">
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <!--月生产计划-->
  124. <div class="row block-padding">
  125. <div class="col-lg-12 col-md-12 center block-title">生产计划</div>
  126. </div>
  127. <div class="row block-padding">
  128. <!-- <div class="col-lg-1 col-md-1 center no-padding">项目名称</div> -->
  129. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">工单号</div>
  130. <div class="col-lg-1 col-md-1 center no-padding" style="width: 12%;">物料编码</div>
  131. <!-- <div class="col-lg-2 col-md-2 center no-padding">型号规格</div> -->
  132. <div class="col-lg-1 col-md-1 center no-padding" style="width: 14%;">物料名称</div>
  133. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">计划数量</div>
  134. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">派工数量</div>
  135. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">标准工时</div>
  136. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">完成数量</div>
  137. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">完成工时</div>
  138. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">作业人员</div>
  139. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">达成率</div>
  140. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">生产效率</div>
  141. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;text-align: left;">状态</div>
  142. <!-- <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div> -->
  143. </div>
  144. <div class="row" v-for="product in dayProduceTaskList" style="margin-top: 5px;">
  145. <!-- <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding">{{product.projectName}}</div> -->
  146. <div style="width: 8%;" class="col-lg-1 col-md-1 center no-padding">{{product.orderSheetCode}}</div>
  147. <div style="width: 12%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
  148. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  149. <div style="width: 14%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 left no-padding">{{product.materialName}}</div>
  150. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.planSum}}</div>
  151. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.numberOfTasks}}</div>
  152. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.workHour}}</div>
  153. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.latestCompletedQuantity}}</div>
  154. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.manHoursCompleted}}</div>
  155. <div style="width: 8%;" class="col-lg-1 col-md-1 center no-padding">{{product.name}}</div>
  156. <div style="width: 8%;" class="col-lg-1 col-md-1 center no-padding">{{product.achievementRate}}%</div>
  157. <div style="width: 8%;" class="col-lg-1 col-md-1 center no-padding">{{product.productionEfficiency}}%</div>
  158. <div style="width: 7%;text-align: left;" class="col-lg-1 col-md-1 center no-padding" >
  159. <strong style="font-size:10px;" :style="{color:product.color}">●</strong>{{product.stateName}}
  160. </div>
  161. <!-- <div class="col-lg-2 col-md-2 center no-padding progress">
  162. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  163. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  164. {{product.completeSum}}
  165. </div>
  166. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  167. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  168. {{product.incompleteSum}}
  169. </div>
  170. </div> -->
  171. </div>
  172. </div>
  173. <div class="col-lg-2">
  174. <div class="row block-padding">
  175. <div class="col-lg-12 col-md-12 center block-title">生产效率</div>
  176. </div>
  177. <div class="row">
  178. <div class="col-lg-12 col-md-12" style="height:190px" id="charts_21"></div>
  179. </div>
  180. <div class="row block-padding">
  181. <div class="col-lg-12 col-md-12 center block-title">工时分布</div>
  182. </div>
  183. <div class="row">
  184. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_22"></div>
  185. </div>
  186. <div class="row block-padding">
  187. <div class="col-lg-12 col-md-12 center block-title">计划达成率</div>
  188. </div>
  189. <div class="row">
  190. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_23"></div>
  191. </div>
  192. <div class="row block-padding">
  193. <div class="col-lg-12 col-md-12 center block-title">人员出勤情况</div>
  194. </div>
  195. <div class="row">
  196. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_24"></div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- jQuery -->
  202. <script src="/lib/jquery.min.js"></script>
  203. <script src="/lib/vue.min.js"></script>
  204. <script src="/lib/echarts/echarts.min.js"></script>
  205. <script src="/lib/echarts/theme/macarons.js"></script>
  206. <script src="/js/service/person.js?_v=2"></script>
  207. <script src="/js/service/material.js?_v=2"></script>
  208. <script src="/js/service/product.js?_v=2"></script>
  209. <script src="/js/service/workhour.js?_v=2"></script>
  210. <script src="/js/service/produce-task.js?_v=2"></script>
  211. <script src="/js/content/mycharts.js?_v=2"></script>
  212. <script type="text/javascript">
  213. //当日标准工时与实际工时对比
  214. const monthGoodList = ServiceProduct.getDayGood();
  215. setTimeout(beA,500);
  216. var initSize = 3;
  217. var pageSizeMonthGood = 3;
  218. var pageIndexMonthGood = 0;
  219. function beA(){
  220. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  221. pageIndexMonthGood = pageSizeMonthGood;
  222. pageSizeMonthGood = pageSizeMonthGood + initSize;
  223. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  224. ChartsService.getGridSpanSmall());
  225. if(monthGoodList.length <= pageIndexMonthGood){
  226. return;
  227. }
  228. setInterval(beginScrollA,10000);
  229. }
  230. function beginScrollA(){
  231. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  232. pageIndexMonthGood = pageSizeMonthGood;
  233. pageSizeMonthGood = pageSizeMonthGood + initSize;
  234. if(monthGoodList.length <= pageIndexMonthGood){
  235. pageIndexMonthGood = 0;
  236. pageSizeMonthGood = initSize;
  237. }
  238. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  239. ChartsService.getGridSpanSmall());
  240. }
  241. //当日良率
  242. const dayStandAndRealList = ServiceWorkhour.getDayStandAndRealByMaterial();
  243. setTimeout(beB,600);
  244. var pageSizeB = 3;
  245. var pageIndexB = 0;
  246. function beB(){
  247. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  248. pageIndexB = pageSizeB;
  249. pageSizeB = pageSizeB + initSize;
  250. ChartsService.initBarAndLine("charts_11", lsitDay,
  251. ChartsService.getGridSpanSmall());
  252. if(dayStandAndRealList.length <= pageIndexB){
  253. return;
  254. }
  255. setInterval(beginScrollA,10000);
  256. }
  257. function beginScrollA(){
  258. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  259. pageIndexB = pageSizeB;
  260. pageSizeB = pageSizeB + initSize;
  261. if(dayStandAndRealList.length <= pageIndexB){
  262. pageIndexB = 0;
  263. pageSizeB = initSize;
  264. }
  265. ChartsService.initBarAndLine("charts_11", lsitDay, ChartsService.getGridSpanSmall());
  266. }
  267. var vm = new Vue({
  268. el: '#div-main',
  269. data: {
  270. userList: [],
  271. dayProduceTaskList: [],
  272. doingTaskList: [],
  273. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  274. timer_long: '', // 定时取服务器数据
  275. timer_short: '' // 数据超长定时轮播
  276. },
  277. methods: {
  278. // 从服务器加载数据并显示
  279. refreshData: function () {
  280. // 关闭定时器
  281. clearInterval(this.timer_short);
  282. // 刷新报表
  283. // ChartsService.initBarAndLine("charts_11", ServiceWorkhour
  284. // .getDayStandAndRealByMaterial(), ChartsService.getGridSpanSmall());
  285. // ChartsService.initBarWithTwoNumberRate("charts_12", ServiceProduct.getDayGood(), ChartsService.getGridSpanSmall());
  286. ChartsService.initBarWithShade("charts_13", ServiceProduct.getDayExceptionByCategory(), ChartsService.getGridSpanSmall());
  287. ChartsService.initCommonPanel("charts_21", ServiceProduct.getDayProduceRate());
  288. ChartsService.initCommonPie("charts_22", ServiceWorkhour.getDayByMaterial());
  289. ChartsService.initCommonPie("charts_23", ServiceProduceTask.getDayCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  290. ChartsService.initCommonPie("charts_24", ServicePerson.getDayAttendance(), [ '#37a2da','#ff9f7f']);
  291. this.loadData();
  292. // 开启定时器
  293. this.timer_short = setInterval(this.scrollData, 30000);
  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. const userList = ServicePerson.getWorkPersonList();
  322. this.cacheDataObject.userList = {
  323. data: userList,
  324. pagesize: 4,
  325. pageindex: 0
  326. }
  327. this.userList = userList.slice(0, this.cacheDataObject.userList.pagesize);
  328. // 生产计划
  329. const dayProduceTaskList = ServiceProduceTask.getDayList();
  330. this.cacheDataObject.dayProduceTaskList = {
  331. data: dayProduceTaskList,
  332. pagesize: 22,
  333. pageindex: 0
  334. }
  335. this.dayProduceTaskList = dayProduceTaskList.slice(0, this.cacheDataObject
  336. .dayProduceTaskList.pagesize);
  337. // 在生产图片
  338. const doingTaskList = ServiceProduceTask.getDoingListByOrder();
  339. this.cacheDataObject.doingTaskList = {
  340. data: doingTaskList,
  341. pagesize: 6,
  342. pageindex: 0
  343. }
  344. this.doingTaskList = doingTaskList.slice(0, this.cacheDataObject.doingTaskList
  345. .pagesize);
  346. }
  347. },
  348. mounted() {
  349. this.timer_long = setInterval(this.refreshData, 60000);
  350. this.refreshData();
  351. },
  352. beforeDestroy() {
  353. clearInterval(this.timer_long);
  354. clearInterval(this.timer_short);
  355. }
  356. });
  357. </script>
  358. </body>
  359. </html>