quality.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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. <!-- 一个小时刷新一下当前页 -->
  7. <meta http-equiv="refresh" content="3600">
  8. <title>品质管理看板</title>
  9. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  10. <link href="/css/dashboard.css" rel="stylesheet" />
  11. <script src="/lib/layui/layui.all.js" charset="utf-8"></script>
  12. <script type="text/javascript" src="/js/service.js"></script>
  13. <script type="text/javascript" src="/js/session.js"></script>
  14. <script type="text/javascript" src="/js/getService.js"></script>
  15. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  16. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  17. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  18. </head>
  19. <script>
  20. // $(function () {
  21. // ServiceLoginOperation.Login();
  22. // })
  23. </script>
  24. <body id="container" class="container-fluid">
  25. <div class="row no-padding head-bar" style="height:81px">
  26. <div class="col-lg-1 col-md-1">
  27. </div>
  28. <div class="col-lg-4 col-md-4 page-title">
  29. 品质管理看板
  30. </div>
  31. <div class="col-lg-4 col-md-4 block-padding">
  32. <button type="button" class="btn btn-warning"
  33. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  34. <button type="button" class="btn btn-warning"
  35. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  36. <button type="button" class="btn btn-warning"
  37. onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
  38. <button type="button" class="btn btn-warning"
  39. onclick="window.location.replace('/pages/dashboard/esop.html');">E-SOP</button>
  40. <button type="button" class="btn btn-warning"
  41. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  42. </div>
  43. <div class="col-lg-4 col-md-4">
  44. </div>
  45. </div>
  46. <div class="my-container" id="div-main">
  47. <div class="row" style="font-size:18px;">
  48. <div class="col-lg-4 col-md-4" style="width: 34%;">
  49. <div class="row block-padding">
  50. <div class="col-lg-12 col-md-12 center block-title-important">未来3天的到货计划</div>
  51. </div>
  52. <div class="row block-padding">
  53. <div style="width: 6%;" class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  54. <div style="width: 16%;" class="col-lg-2 col-md-2 center no-padding padding-line">计划<br/>到货日期</div>
  55. <div style="width: 16%;" class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
  56. <div style="width: 18%;" class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
  57. <div style="width: 16%;" class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
  58. <!-- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div> -->
  59. <div style="width: 10%;" class="col-lg-1 col-md-1 center no-padding padding-line">到货<br />数量</div>
  60. <div style="width: 14%;" class="col-lg-2 col-md-2 center no-padding padding-line">备注</div>
  61. </div>
  62. <div class="row">
  63. <div class="col-lg-12 col-md-12" >
  64. <div class="row" v-for="product in willArriveMeterialList" style="overflow:hidden;word-wrap: break-word;">
  65. <div style="width: 6%;" class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
  66. <div style="width: 16%;" class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
  67. <div style="width: 16%;" class="col-lg-2 col-md-2 center no-padding">{{product.cvenCode}}</div>
  68. <div style="overflow:hidden; word-break:break-all;white-space:nowrap;width: 18%;" class="col-lg-1 col-md-1 left no-padding">{{product.materialCode}}</div>
  69. <div style="overflow:hidden; word-break:break-all;white-space:nowrap;width: 16%;" class="col-lg-2 col-md-1 left no-padding">{{product.materialName}}</div>
  70. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  71. <div style="width: 10%;" class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
  72. <div style="width: 14%;overflow:hidden; word-break:break-all;white-space:nowrap;text-align: left;" class="col-lg-2 col-md-3 center no-padding">{{product.citemname}}</div>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- <div class="row block-padding">
  77. <div class="col-lg-12 col-md-12 center block-title">近六个月的月度合格率</div>
  78. </div>
  79. <div class="row">
  80. <div class="col-lg-12 col-md-12" style="height:300px" id="charts_11"></div>
  81. </div> -->
  82. </div>
  83. <div class="col-lg-4 col-md-4" style="width: 30%;margin-left: 15px;" >
  84. <div class="row" style="padding-top:50px;padding-bottom: 50px;">
  85. <div class="col-lg-6 col-md-6">
  86. <div class="quality-block-1 center">当天到货批数</div>
  87. <div class="quality-block-2 center">{{todayArriveSum}}</div>
  88. </div>
  89. <div class="col-lg-6 col-md-6 quality-block">
  90. <div class="quality-block-1 center">未来3天的到货总批数</div>
  91. <div class="quality-block-2 center">{{willArriveSum}}</div>
  92. </div>
  93. <div class="col-lg-6 col-md-6 quality-block" style="padding-top:20px;">
  94. <div class="quality-block-1 center">当月到货总批数</div>
  95. <div class="quality-block-2 center">{{thisMonthArriveSum}}</div>
  96. </div>
  97. <div class="col-lg-6 col-md-6 quality-block" style="padding-top:20px;">
  98. <div class="quality-block-1 center">未入库批数</div>
  99. <div class="quality-block-2 center">{{notInSum}}</div>
  100. </div>
  101. </div>
  102. <div class="row" style="margin-top: 10px;">
  103. <div class="col-lg-12 col-md-12 center block-title-important">当月供应商检验质量合格率</div>
  104. </div>
  105. <div class="row" style="width: 150%;">
  106. <div class="col-lg-12 col-md-12" style="height:380px;margin-left: -20%;" id="charts_21"></div>
  107. </div>
  108. </div>
  109. <div class="col-lg-4 col-md-4" style="width: 35%;">
  110. <div class="row block-padding">
  111. <div class="col-lg-12 col-md-12 center block-title-important">当前已到货未入库情况</div>
  112. </div>
  113. <div class="row block-padding">
  114. <div style="width: 5%;" class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  115. <div style="width: 15%;" class="col-lg-2 col-md-2 center no-padding padding-line">到货日期</div>
  116. <div style="width: 15%;" class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
  117. <div style="width: 17%;" class="col-lg-2 col-md-2 center no-padding padding-line">物料号</div>
  118. <div style="width: 20%;" class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
  119. <!-- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div> -->
  120. <div style="width: 10%;" class="col-lg-1 col-md-1 center no-padding padding-line">未入库<br />数量</div>
  121. <div style="width: 13%;" class="col-lg-1 col-md-1 center no-padding padding-line">项目名</div>
  122. </div>
  123. <div class="row">
  124. <div class="col-lg-12 col-md-12" >
  125. <div class="row" v-for="product in waitingInList">
  126. <div style="width: 5%;" class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
  127. <div style="width: 15%;" class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
  128. <div style="width: 15%;" class="col-lg-2 col-md-2 center no-padding">{{product.cVenCode}}</div>
  129. <div style="width: 17%;overflow:hidden; word-break:break-all;white-space:nowrap;" class="col-lg-2 col-md-2 left no-padding">{{product.materialCode}}</div>
  130. <div style="width: 20%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 left no-padding">{{product.materialName}}</div>
  131. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div> -->
  132. <div style="width: 10%;" class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
  133. <div style="width: 13%;overflow:hidden; word-break:break-all;white-space:nowrap;text-align: left;" class="col-lg-1 col-md-1 center no-padding">{{product.cItemName}}</div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="row block-padding">
  138. <div class="col-lg-12 col-md-12 center block-title-important">年度质量合格率</div>
  139. </div>
  140. <div class="row">
  141. <div class="col-lg-12 col-md-12" style="height:380px" id="charts_11"></div>
  142. </div>
  143. <!-- <div class="row block-padding">
  144. <div class="col-lg-12 col-md-12 center block-title">当月供应商合格率实时展示</div>
  145. </div>
  146. <div class="row">
  147. <div class="col-lg-12 col-md-12" style="height:300px" id="charts_31"></div>
  148. </div> -->
  149. </div>
  150. </div>
  151. <div class="row block-padding" style="font-size:18px;">
  152. <!-- <div class="col-md-1 col-lg-1 center block-title" style="padding-top: 80px">
  153. 质<br />量<br />异<br />常<br />信<br />息
  154. </div> -->
  155. <d class="col-md-6 col-lg-6" style="margin-top:-40px ;">
  156. <div class="row block-padding">
  157. <div class="col-lg-12 col-md-12 center block-title-important">质量异常信息</div>
  158. </div>
  159. <div class="row">
  160. <div style="width:5%" class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  161. <div style="width:15%" class="col-lg-2 col-md-2 center no-padding padding-line">检验日期</div>
  162. <div style="width:10%" class="col-lg-1 col-md-2 center no-padding padding-line">供应商</div>
  163. <div style="width:13%" class="col-lg-2 col-md-2 center no-padding padding-line">物料号</div>
  164. <div style="width:25%" class="col-lg-3 col-md-3 center no-padding padding-line">物料名称</div>
  165. <!-- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div> -->
  166. <div style="width:30%;margin-left: 7px;" class="col-lg-3 col-md-3 center no-padding">
  167. <div class="row">
  168. <div class="col-lg-3 col-md-3 center no-padding">到货<br />数量</div>
  169. <div class="col-lg-3 col-md-3 center no-padding">抽检<br />数量</div>
  170. <div class="col-lg-3 col-md-3 center no-padding">不良<br />数量</div>
  171. <div class="col-lg-3 col-md-3 center no-padding">抽检<br />合格率</div>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="row" v-for="material in unpassList" :class="material.bg">
  176. <div style="width:5%" class="col-lg-1 col-md-1 center no-padding">{{material.index}}</div>
  177. <div style="width:15%" class="col-lg-2 col-md-2 center no-padding">{{material.checkDate}}</div>
  178. <div style="width:10%" class="col-lg-1 col-md-2 center no-padding">{{material.vendorName}} </div>
  179. <div style="width:13%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 center no-padding">{{material.materialCode}}</div>
  180. <div style="width:25%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-3 col-md-3 left no-padding">{{material.materialName}}</div>
  181. <!-- <div class="col-lg-2 col-md-2 center no-padding">{{material.specs}}</div> -->
  182. <div style="width:30%;margin-left: 7px;" class="col-lg-3 col-md-3 center no-padding">
  183. <div class="row">
  184. <div class="col-lg-3 col-md-3 center no-padding">{{material.arriveSum}}</div>
  185. <div class="col-lg-3 col-md-3 center no-padding">{{material.checkSum}}</div>
  186. <div class="col-lg-3 col-md-3 center no-padding">{{material.unpassSum}}</div>
  187. <div class="col-lg-3 col-md-3 center no-padding">{{material.passRate}}</div>
  188. </div>
  189. </div>
  190. </div>
  191. </d>
  192. <div class="col-md-5 col-lg-5 center" style="margin-left: 50px;">
  193. <div class="row">
  194. <div class="col-md-6 col-lg-6 center " style="padding-bottom: 5px;margin-top:-10px;"
  195. v-for="showimage in showImageList">
  196. {{showimage }}
  197. <img :src="'/upAnomalous/'+showimage" border="0" style="width:350px;height:290px;"/>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <!-- jQuery -->
  204. <script src="/lib/jquery.min.js"></script>
  205. <script src="/lib/vue.min.js"></script>
  206. <script src="/lib/echarts/echarts.min.js"></script>
  207. <script src="/lib/echarts/theme/macarons.js"></script>
  208. <script src="/js/service/person.js?_v=2"></script>
  209. <script src="/js/service/material.js?_v=2"></script>
  210. <script src="/js/service/product.js?_v=2"></script>
  211. <script src="/js/content/mycharts.js?_v=2"></script>
  212. <script type="text/javascript">
  213. var initSize = 7;
  214. var pageSize = 7;
  215. var pageIndex = 0;
  216. const checkRateByBatchnoList = ServiceMaterial.getCheckRateByBatchno();
  217. setTimeout(beginFun3("charts_21",checkRateByBatchnoList,10000,"charts_21"),500);
  218. //年度合格率
  219. const monthGoodList = ServiceMaterial.getLastSixMonthQualityTargetCompare()
  220. setTimeout(beA,500);
  221. var pageSizeMonthGood = 6;
  222. var pageIndexMonthGood = 0;
  223. function beA(){
  224. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  225. pageIndexMonthGood = pageSizeMonthGood;
  226. pageSizeMonthGood = pageSizeMonthGood + 6;
  227. ChartsService.initBarAndLine2("charts_11", lsitMonth,
  228. ChartsService.getGridSpanSmall());
  229. if(monthGoodList.length <= pageIndexMonthGood){
  230. return;
  231. }
  232. setInterval(beginScrollA,10000);
  233. }
  234. function beginScrollA(){
  235. var lsitMonth = monthGoodList.slice(pageIndexMonthGood,pageSizeMonthGood);
  236. pageIndexMonthGood = pageSizeMonthGood;
  237. pageSizeMonthGood = pageSizeMonthGood + 6;
  238. if(monthGoodList.length <= pageIndexMonthGood){
  239. pageIndexMonthGood = 0;
  240. pageSizeMonthGood = 6;
  241. }
  242. ChartsService.initBarAndLine2("charts_11", lsitMonth,
  243. ChartsService.getGridSpanSmall());
  244. }
  245. var vm = new Vue({
  246. el: '#div-main',
  247. data: {
  248. willArriveMeterialList: [],
  249. waitingInList: [],
  250. todayArriveSum: 0,
  251. willArriveSum: 0,
  252. thisMonthArriveSum: 0,
  253. notInSum: 0,
  254. unpassList: [],
  255. showImageList: [],
  256. timer_quality: '',
  257. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  258. timer_long: '', // 定时取服务器数据
  259. timer_short: '' // 数据超长定时轮播
  260. },
  261. methods: {
  262. // 质量异常滚动
  263. scrollQuality: function () {
  264. var i = 0
  265. for (; i < this.unpassList.length; i++) {
  266. if (this.unpassList[i].bg == "selectrow")
  267. break;
  268. }
  269. // 未找到,找第一条
  270. if (i >= this.unpassList.length) {
  271. i = 0;
  272. } else {
  273. this.unpassList[i].bg = "";
  274. if (i == this.unpassList.length - 1)
  275. i = 0;
  276. else
  277. i++;
  278. }
  279. this.unpassList[i].bg = "selectrow";
  280. this.showImageList = this.unpassList[i].images;
  281. },
  282. // 从服务器加载数据并显示
  283. refreshData: function () {
  284. // 关闭定时器
  285. clearInterval(this.timer_short);
  286. // 关闭质量异常定时器
  287. clearInterval(this.timer_quality);
  288. // 刷新报表
  289. // ChartsService.initBarAndLine("charts_11", ServiceMaterial
  290. // .getLastSixMonthQualityTargetCompare(), ChartsService.getGridSpanSmall());
  291. // ChartsService.initBarWithShade("charts_31", ServiceMaterial.getPassRateByVendor(),
  292. // ChartsService.getGridSpanSmall());
  293. // ChartsService.initBarWithShade("charts_21", ServiceMaterial.getCheckRateByBatchno(),
  294. // ChartsService.getGridSpanSmall());
  295. this.loadData();
  296. // 开启定时器
  297. this.timer_short = setInterval(this.scrollData, 30000);
  298. this.scrollQuality();
  299. this.timer_quality = setInterval(this.scrollQuality, 4000);
  300. },
  301. // 轮播数据
  302. scrollData: function () {
  303. for (var key in this.cacheDataObject) {
  304. const dataList = this.cacheDataObject[key].data;
  305. const pagesize = this.cacheDataObject[key].pagesize;
  306. var pageindex = this.cacheDataObject[key].pageindex + 1;
  307. if (dataList.length > pagesize) {
  308. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  309. pagesize > 0 ? 1 : 0);
  310. if (pageindex >= pagesum)
  311. pageindex = 0;
  312. this.cacheDataObject[key].pageindex = pageindex;
  313. const startIndex = pageindex * pagesize;
  314. const remainSum = dataList.length - startIndex;
  315. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  316. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  317. if(keyPar.length < 1){
  318. continue;
  319. }
  320. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  321. }
  322. }
  323. },
  324. // 从服务器加载数据
  325. loadData: function () {
  326. this.cacheDataObject = {};
  327. // 未来3天到货
  328. const willArriveMeterialList = ServiceMaterial.getWillArriveList(3);
  329. this.cacheDataObject.willArriveMeterialList = {
  330. data: willArriveMeterialList,
  331. pagesize: 20,
  332. pageindex: 0
  333. }
  334. this.willArriveMeterialList = willArriveMeterialList.slice(0, this.cacheDataObject
  335. .willArriveMeterialList.pagesize);
  336. // 未入库
  337. const waitingInList = ServiceMaterial.getWatingInList();
  338. this.cacheDataObject.waitingInList = {
  339. data: waitingInList,
  340. pagesize: 7,
  341. pageindex: 0
  342. }
  343. this.waitingInList = waitingInList.slice(0, this.cacheDataObject
  344. .waitingInList.pagesize);
  345. //
  346. // 当天到货批数
  347. this.todayArriveSum = ServiceMaterial.getTodayArriveSum();
  348. // 未来3天到货
  349. this.willArriveSum = ServiceMaterial.getWillArriveSum(3);
  350. // 当月到货批数
  351. this.thisMonthArriveSum = ServiceMaterial.getThisMonthArriveSum();
  352. // 为入库总批数
  353. this.notInSum = ServiceMaterial.getNotInSum();
  354. // 质量异常
  355. const unpassList = ServiceMaterial.getQualityUnpassList();
  356. this.cacheDataObject.unpassList = {
  357. data: unpassList,
  358. pagesize: 10,
  359. pageindex: 0
  360. }
  361. this.unpassList = unpassList.slice(0, this.cacheDataObject
  362. .unpassList.pagesize);
  363. }
  364. },
  365. mounted() {
  366. this.timer_long = setInterval(this.refreshData, 600000);
  367. this.refreshData();
  368. },
  369. beforeDestroy() {
  370. clearInterval(this.timer_quality);
  371. clearInterval(this.timer_long);
  372. clearInterval(this.timer_short);
  373. }
  374. });
  375. </script>
  376. </body>
  377. </html>