line.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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;">
  51. <div style="margin-left:5px">
  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" >
  82. <div class="row block-padding" style="height: 350px;">
  83. <div style="height: 200px;padding-left: 0px;" class="col-lg-4 col-md-4 " v-for="task in doingTaskList">
  84. <div class="task-block" :class="task.bgcss" style="height: 190px;width: 350px;">
  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-3 col-md-3" style="text-align: center;padding: 19px 0px 0px 34px;margin-right: 7px;">
  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" style="overflow:hidden; word-break:break-all;white-space:nowrap">物料名称:{{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 class="row" style="padding-top: 8px;" >
  121. <div class="col-lg-3 col-md-3" style="text-align: center;padding: 4px 0px 0px 34px;margin-right: 7px;">
  122. <div class="task-block-title-small center">工艺流程</div>
  123. </div>
  124. <div class="col-lg-8 col-md-8" style="padding-left: 4px;padding-top: 3px;">
  125. <span style="color: aliceblue;" v-for="(t,index) in task.fbsTechnologicalProcessItemList" >
  126. <!-- <span v-if="index==0&&t.isTechnological=='1'" style="font-size:15px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;padding: 2px;background-color:#1ABDE6;"></span>
  127. <span v-if="index==0&&t.isTechnological=='2'" style="font-size:15px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;padding: 2px;background-color:orange;"></span> -->
  128. <span v-if="t.isTechnological=='1'" style="border-radius:5px;background-color:#1ABDE6;padding: 2px;" >{{t.name}}</span>
  129. <span v-if="t.isTechnological=='2'" style="border-radius:5px;background-color:orange;padding: 2px;">{{t.name}}</span>
  130. <!-- <span v-if="index==(task.fbsTechnologicalProcessItemList.length-1)&&t.isTechnological=='1'" style="font-size:15px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;padding: 2px;background-color:#1ABDE6;"></span>
  131. <span v-if="index==(task.fbsTechnologicalProcessItemList.length-1)&&t.isTechnological=='2'" style="font-size:15px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;padding: 2px;background-color:orange;"></span> -->
  132. </span>
  133. </div>
  134. <!-- <div class="col-lg-12 col-md-12 " style="padding-left: 40px;overflow:hidden; word-break:break-all;white-space:nowrap">
  135. <span class="task-block-text" ><span class="task-block-title-small center" style="margin-right: 10%;">工艺流程</span>
  136. <span style="color: aliceblue;" v-for="(t,index) in task.fbsTechnologicalProcessItemList" >
  137. <span v-if="t.isTechnological=='1'" style="border-radius:5px;background-color:#1ABDE6;padding: 2px;" >{{t.name}}</span>
  138. <span v-if="t.isTechnological=='2'" style="border-radius:5px;background-color:orange;padding: 2px;">{{t.name}}</span>
  139. </span>
  140. </span>
  141. </div> -->
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <!--月生产计划-->
  147. <div class="row block-padding">
  148. <div class="col-lg-12 col-md-12 center block-title">生产派工单</div>
  149. </div>
  150. <div class="row block-padding">
  151. <!-- <div class="col-lg-1 col-md-1 center no-padding">项目名称</div> -->
  152. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">工单号</div>
  153. <div class="col-lg-1 col-md-1 center no-padding" style="width: 9%;">物料编码</div>
  154. <!-- <div class="col-lg-2 col-md-2 center no-padding">型号规格</div> -->
  155. <div class="col-lg-1 col-md-1 center no-padding" style="width: 14%;">物料名称</div>
  156. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">计划数量</div>
  157. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">派工数量</div>
  158. <!-- <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">标准工时</div> -->
  159. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">完成数量</div>
  160. <!-- <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;">完成工时</div> -->
  161. <div class="col-lg-1 col-md-1 center no-padding" style="width: 8%;">作业人员</div>
  162. <div class="col-lg-1 col-md-1 center no-padding" style="width: 6%;">达成率</div>
  163. <div class="col-lg-1 col-md-1 center no-padding" style="width: 6%;">生产效率</div>
  164. <div class="col-lg-1 col-md-1 center no-padding" style="width: 21%;">工艺流程</div>
  165. <div class="col-lg-1 col-md-1 center no-padding" style="width: 7%;text-align: left;">状态</div>
  166. <!-- <div class="col-lg-2 col-md-2 center no-padding">完成进度(已/未)</div> -->
  167. </div>
  168. <div class="row" v-for="product in dayProduceTaskList" style="margin-top: 5px;">
  169. <!-- <div style="overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding">{{product.projectName}}</div> -->
  170. <div style="width: 8%;" class="col-lg-1 col-md-1 center no-padding">{{product.orderSheetCode}}</div>
  171. <div style="width: 9%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
  172. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  173. <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>
  174. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.planSum}}</div>
  175. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.numberOfTasks}}</div>
  176. <!-- <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.workHour}}</div> -->
  177. <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.latestCompletedQuantity}}</div>
  178. <!-- <div style="width: 7%;" class="col-lg-1 col-md-1 center no-padding">{{product.manHoursCompleted}}</div> -->
  179. <div style="width: 8%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding">{{product.name}}</div>
  180. <div style="width: 6%;" class="col-lg-1 col-md-1 center no-padding">{{product.achievementRate}}%</div>
  181. <div style="width: 6%;" class="col-lg-1 col-md-1 center no-padding">{{product.productionEfficiency}}%</div>
  182. <div style="width: 21%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-1 col-md-1 center no-padding" >
  183. <!-- <span style="font-size: 10px;"> -->
  184. <span style="color: aliceblue;" v-for="(t,index) in product.fbsTechnologicalProcessItemList">
  185. <!-- <span v-if="index==0&&t.isTechnological=='1'" style="font-size:15px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;padding: 2px;background-color:#1ABDE6;"></span>
  186. <span v-if="index==0&&t.isTechnological=='2'" style="font-size:15px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;padding: 2px;background-color:orange;"></span> -->
  187. <span v-if="t.isTechnological=='1'" style="border-radius:5px;background-color:#1ABDE6;padding: 2px;" >{{t.name}}</span>
  188. <span v-if="t.isTechnological=='2'" style="border-radius:5px;background-color:orange;padding: 2px;">{{t.name}}</span>
  189. <!-- <span v-if="index==(task.fbsTechnologicalProcessItemList.length-1)&&t.isTechnological=='1'" style="font-size:15px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;padding: 2px;background-color:#1ABDE6;"></span>
  190. <span v-if="index==(task.fbsTechnologicalProcessItemList.length-1)&&t.isTechnological=='2'" style="font-size:15px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;padding: 2px;background-color:orange;"></span> -->
  191. </span>
  192. <!-- </span> -->
  193. </div>
  194. <div style="width: 7%;text-align: left;" class="col-lg-1 col-md-1 center no-padding" >
  195. <strong style="font-size:10px;" :style="{color:product.color}">●</strong>{{product.stateName}}
  196. </div>
  197. <!-- <div class="col-lg-2 col-md-2 center no-padding progress">
  198. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
  199. aria-valuemin="0" aria-valuemax="100" :style="{width:product.completePercent}">
  200. {{product.completeSum}}
  201. </div>
  202. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
  203. aria-valuemin="0" aria-valuemax="100" :style="{width:product.incompletePercent}">
  204. {{product.incompleteSum}}
  205. </div>
  206. </div> -->
  207. </div>
  208. </div>
  209. <div class="col-lg-2">
  210. <div class="row block-padding">
  211. <div class="col-lg-12 col-md-12 center block-title">生产效率</div>
  212. </div>
  213. <div class="row">
  214. <div class="col-lg-12 col-md-12" style="height:190px" id="charts_21"></div>
  215. </div>
  216. <div class="row block-padding">
  217. <div class="col-lg-12 col-md-12 center block-title">工时分布</div>
  218. </div>
  219. <div class="row">
  220. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_22"></div>
  221. </div>
  222. <div class="row block-padding">
  223. <div class="col-lg-12 col-md-12 center block-title">计划达成率</div>
  224. </div>
  225. <div class="row">
  226. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_23"></div>
  227. </div>
  228. <div class="row block-padding">
  229. <div class="col-lg-12 col-md-12 center block-title">人员出勤情况</div>
  230. </div>
  231. <div class="row">
  232. <div class="col-lg-12 col-md-12" style="height:210px" id="charts_24"></div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <!-- jQuery -->
  238. <script src="/lib/jquery.min.js"></script>
  239. <script src="/lib/vue.min.js"></script>
  240. <script src="/lib/echarts/echarts.min.js"></script>
  241. <script src="/lib/echarts/theme/macarons.js"></script>
  242. <script src="/js/service/person.js?_v=2"></script>
  243. <script src="/js/service/material.js?_v=2"></script>
  244. <script src="/js/service/product.js?_v=2"></script>
  245. <script src="/js/service/workhour.js?_v=2"></script>
  246. <script src="/js/service/produce-task.js?_v=2"></script>
  247. <script src="/js/content/mycharts.js?_v=2"></script>
  248. <script type="text/javascript">
  249. //当日标准工时与实际工时对比
  250. const monthGoodList = ServiceProduct.getDayGood();
  251. setTimeout(beA,500);
  252. var initSize = 3;
  253. var pageSizeMonthGood = 3;
  254. var pageIndexMonthGood = 0;
  255. function beA(){
  256. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  257. pageIndexMonthGood = pageSizeMonthGood;
  258. pageSizeMonthGood = pageSizeMonthGood + initSize;
  259. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  260. ChartsService.getGridSpanSmall());
  261. if(monthGoodList.length <= pageIndexMonthGood){
  262. return;
  263. }
  264. setInterval(beginScrollA,10000);
  265. }
  266. function beginScrollA(){
  267. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  268. pageIndexMonthGood = pageSizeMonthGood;
  269. pageSizeMonthGood = pageSizeMonthGood + initSize;
  270. if(monthGoodList.length <= pageIndexMonthGood){
  271. pageIndexMonthGood = 0;
  272. pageSizeMonthGood = initSize;
  273. }
  274. ChartsService.initBarWithTwoNumberRate("charts_12", lsitMonth,
  275. ChartsService.getGridSpanSmall());
  276. }
  277. //当日良率
  278. const dayStandAndRealList = ServiceWorkhour.getDayStandAndRealByMaterial();
  279. setTimeout(beB,600);
  280. var pageSizeB = 3;
  281. var pageIndexB = 0;
  282. function beB(){
  283. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  284. pageIndexB = pageSizeB;
  285. pageSizeB = pageSizeB + initSize;
  286. ChartsService.initBarAndLine("charts_11", lsitDay,
  287. ChartsService.getGridSpanSmall());
  288. if(dayStandAndRealList.length <= pageIndexB){
  289. return;
  290. }
  291. setInterval(beginScrollA,10000);
  292. }
  293. function beginScrollA(){
  294. var lsitDay = dayStandAndRealList.slice(pageIndexB,pageSizeB);
  295. pageIndexB = pageSizeB;
  296. pageSizeB = pageSizeB + initSize;
  297. if(dayStandAndRealList.length <= pageIndexB){
  298. pageIndexB = 0;
  299. pageSizeB = initSize;
  300. }
  301. ChartsService.initBarAndLine("charts_11", lsitDay, ChartsService.getGridSpanSmall());
  302. }
  303. var vm = new Vue({
  304. el: '#div-main',
  305. data: {
  306. userList: [],
  307. dayProduceTaskList: [],
  308. doingTaskList: [],
  309. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  310. timer_long: '', // 定时取服务器数据
  311. timer_short: '' // 数据超长定时轮播
  312. },
  313. methods: {
  314. // 从服务器加载数据并显示
  315. refreshData: function () {
  316. // 关闭定时器
  317. clearInterval(this.timer_short);
  318. // 刷新报表
  319. // ChartsService.initBarAndLine("charts_11", ServiceWorkhour
  320. // .getDayStandAndRealByMaterial(), ChartsService.getGridSpanSmall());
  321. // ChartsService.initBarWithTwoNumberRate("charts_12", ServiceProduct.getDayGood(), ChartsService.getGridSpanSmall());
  322. ChartsService.initBarWithShade("charts_13", ServiceProduct.getDayExceptionByCategory(), ChartsService.getGridSpanSmall());
  323. ChartsService.initCommonPanel("charts_21", ServiceProduct.getDayProduceRate());
  324. ChartsService.initCommonPie("charts_22", ServiceWorkhour.getDayByMaterial());
  325. ChartsService.initCommonPie("charts_23", ServiceProduceTask.getDayCompleteInfo(), [ '#ff9f7f', '#37a2da']);
  326. ChartsService.initCommonPie("charts_24", ServicePerson.getDayAttendance(), [ '#37a2da','#ff9f7f']);
  327. this.loadData();
  328. // 开启定时器
  329. this.timer_short = setInterval(this.scrollData, 30000);
  330. },
  331. // 轮播数据
  332. scrollData: function () {
  333. for (var key in this.cacheDataObject) {
  334. const dataList = this.cacheDataObject[key].data;
  335. const pagesize = this.cacheDataObject[key].pagesize;
  336. var pageindex = this.cacheDataObject[key].pageindex + 1;
  337. if (dataList.length > pagesize) {
  338. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  339. pagesize > 0 ? 1 : 0);
  340. if (pageindex >= pagesum)
  341. pageindex = 0;
  342. this.cacheDataObject[key].pageindex = pageindex;
  343. const startIndex = pageindex * pagesize;
  344. const remainSum = dataList.length - startIndex;
  345. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  346. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  347. if(keyPar.length < 1){
  348. continue;
  349. }
  350. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  351. }
  352. }
  353. },
  354. // 从服务器加载数据
  355. loadData: function () {
  356. this.cacheDataObject = {};
  357. const userList = ServicePerson.getWorkPersonList();
  358. this.cacheDataObject.userList = {
  359. data: userList,
  360. pagesize: 4,
  361. pageindex: 0
  362. }
  363. this.userList = userList.slice(0, this.cacheDataObject.userList.pagesize);
  364. // 生产计划
  365. const dayProduceTaskList = ServiceProduceTask.getDayList();
  366. this.cacheDataObject.dayProduceTaskList = {
  367. data: dayProduceTaskList,
  368. pagesize: 18,
  369. pageindex: 0
  370. }
  371. this.dayProduceTaskList = dayProduceTaskList.slice(0, this.cacheDataObject
  372. .dayProduceTaskList.pagesize);
  373. // 在生产图片
  374. const doingTaskList = ServiceProduceTask.getDoingListByOrder();
  375. this.cacheDataObject.doingTaskList = {
  376. data: doingTaskList,
  377. pagesize: 6,
  378. pageindex: 0
  379. }
  380. this.doingTaskList = doingTaskList.slice(0, this.cacheDataObject.doingTaskList
  381. .pagesize);
  382. }
  383. },
  384. mounted() {
  385. this.timer_long = setInterval(this.refreshData, 120000);
  386. this.refreshData();
  387. },
  388. beforeDestroy() {
  389. clearInterval(this.timer_long);
  390. clearInterval(this.timer_short);
  391. }
  392. });
  393. </script>
  394. </body>
  395. </html>