line.html 25 KB

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