quality.html 22 KB

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