quality.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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-3 col-md-3 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. </div>
  37. <div class="col-lg-4 col-md-4">
  38. </div>
  39. </div>
  40. <div class="my-container" id="div-main">
  41. <div class="row">
  42. <div class="col-lg-4 col-md-4">
  43. <div class="row block-padding">
  44. <div class="col-lg-12 col-md-12 center block-title">未来3天的到货计划</div>
  45. </div>
  46. <div class="row block-padding">
  47. <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  48. <div class="col-lg-2 col-md-2 center no-padding padding-line">计划到货日期</div>
  49. <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
  50. <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
  51. <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
  52. <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
  53. <div class="col-lg-1 col-md-1 center no-padding">到货<br />数量</div>
  54. <div class="col-lg-1 col-md-1 center no-padding padding-line">备注</div>
  55. </div>
  56. <div class="row">
  57. <div class="col-lg-12 col-md-12" style="height: 200px;">
  58. <div class="row" v-for="product in willArriveMeterialList">
  59. <div class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
  60. <div class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
  61. <div class="col-lg-2 col-md-2 center no-padding">{{product.vendorName}}</div>
  62. <div class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
  63. <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
  64. <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div>
  65. <div class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
  66. <div class="col-lg-1 col-md-1 center no-padding">{{product.memo}}</div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="row block-padding">
  71. <div class="col-lg-12 col-md-12 center block-title">近六个月的月度合格率</div>
  72. </div>
  73. <div class="row">
  74. <div class="col-lg-12 col-md-12" style="height:300px" id="charts_11"></div>
  75. </div>
  76. </div>
  77. <div class="col-lg-4 col-md-4">
  78. <div class="row" style="padding-top:40px;">
  79. <div class="col-lg-6 col-md-6">
  80. <div class="quality-block-1 center">当天到货批数</div>
  81. <div class="quality-block-2 center">{{todayArriveSum}}</div>
  82. </div>
  83. <div class="col-lg-6 col-md-6 quality-block">
  84. <div class="quality-block-1 center">未来3天的到货总批数</div>
  85. <div class="quality-block-2 center">{{willArriveSum}}</div>
  86. </div>
  87. <div class="col-lg-6 col-md-6 quality-block">
  88. <div class="quality-block-1 center">当月到货总批数</div>
  89. <div class="quality-block-2 center">{{thisMonthArriveSum}}</div>
  90. </div>
  91. <div class="col-lg-6 col-md-6 quality-block">
  92. <div class="quality-block-1 center">未入库批数</div>
  93. <div class="quality-block-2 center">{{notInSum}}</div>
  94. </div>
  95. </div>
  96. <div class="row" style="margin-top: 30px;">
  97. <div class="col-lg-12 col-md-12 center block-title">当月供检验合格率</div>
  98. </div>
  99. <div class="row">
  100. <div class="col-lg-12 col-md-12" style="height:380px" id="charts_21"></div>
  101. </div>
  102. </div>
  103. <div class="col-lg-4 col-md-4">
  104. <div class="row block-padding">
  105. <div class="col-lg-12 col-md-12 center block-title">当前已到货未入库情况</div>
  106. </div>
  107. <div class="row block-padding">
  108. <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  109. <div class="col-lg-2 col-md-2 center no-padding padding-line">计划到货日期</div>
  110. <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
  111. <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
  112. <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
  113. <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
  114. <div class="col-lg-1 col-md-1 center no-padding">到货<br />数量</div>
  115. <div class="col-lg-1 col-md-1 center no-padding padding-line">备注</div>
  116. </div>
  117. <div class="row">
  118. <div class="col-lg-12 col-md-12" style="height: 200px;">
  119. <div class="row" v-for="product in waitingInList">
  120. <div class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
  121. <div class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
  122. <div class="col-lg-2 col-md-2 center no-padding">{{product.vendorName}}</div>
  123. <div class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
  124. <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
  125. <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div>
  126. <div class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
  127. <div class="col-lg-1 col-md-1 center no-padding">{{product.memo}}</div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="row block-padding">
  132. <div class="col-lg-12 col-md-12 center block-title">当月供应商合格率实时展示</div>
  133. </div>
  134. <div class="row">
  135. <div class="col-lg-12 col-md-12" style="height:300px" id="charts_31"></div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="row block-padding">
  140. <div class="col-md-1 col-lg-1 center block-title" style="padding-top: 80px">
  141. 质<br />量<br />异<br />常<br />信<br />息
  142. </div>
  143. <d class="col-md-7 col-lg-7">
  144. <div class="row">
  145. <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
  146. <div class="col-lg-1 col-md-2 center no-padding padding-line">检验日期</div>
  147. <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
  148. <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
  149. <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
  150. <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
  151. <div class="col-lg-3 col-md-3 center no-padding">
  152. <div class="row">
  153. <div class="col-lg-3 col-md-3 center no-padding">到货<br />数量</div>
  154. <div class="col-lg-3 col-md-3 center no-padding">抽检<br />数量</div>
  155. <div class="col-lg-3 col-md-3 center no-padding">不良<br />数量</div>
  156. <div class="col-lg-3 col-md-3 center no-padding">抽检<br />合格率</div>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="row" v-for="material in unpassList" :class="material.bg">
  161. <div class="col-lg-1 col-md-1 center no-padding">{{material.index}}</div>
  162. <div class="col-lg-1 col-md-2 center no-padding">{{material.checkDate}}</div>
  163. <div class="col-lg-2 col-md-2 center no-padding">{{material.vendorName}}</div>
  164. <div class="col-lg-1 col-md-1 center no-padding">{{material.materialCode}}</div>
  165. <div class="col-lg-2 col-md-2 center no-padding">{{material.materialName}}</div>
  166. <div class="col-lg-2 col-md-2 center no-padding">{{material.specs}}</div>
  167. <div class="col-lg-3 col-md-3 center no-padding">
  168. <div class="row">
  169. <div class="col-lg-3 col-md-3 center no-padding">{{material.arriveSum}}</div>
  170. <div class="col-lg-3 col-md-3 center no-padding">{{material.checkSum}}</div>
  171. <div class="col-lg-3 col-md-3 center no-padding">{{material.unpassSum}}</div>
  172. <div class="col-lg-3 col-md-3 center no-padding">{{material.passRate}}</div>
  173. </div>
  174. </div>
  175. </div>
  176. </d>
  177. <div class="col-md-4 col-lg-4 center">
  178. <div class="row">
  179. <div class="col-md-4 col-lg-4 center " style="padding-bottom: 5px;"
  180. v-for="showimage in showImageList">
  181. <img :src="showimage" border="0" style="width:150px;height:130px;" />
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <!-- jQuery -->
  188. <script src="/lib/jquery.min.js"></script>
  189. <script src="/lib/vue.min.js"></script>
  190. <script src="/lib/echarts/echarts.min.js"></script>
  191. <script src="/lib/echarts/theme/macarons.js"></script>
  192. <script src="/js/service/person.js?_v=2"></script>
  193. <script src="/js/service/material.js?_v=2"></script>
  194. <script src="/js/service/product.js?_v=2"></script>
  195. <script src="/js/content/mycharts.js?_v=2"></script>
  196. <script type="text/javascript">
  197. var vm = new Vue({
  198. el: '#div-main',
  199. data: {
  200. willArriveMeterialList: [],
  201. waitingInList: [],
  202. todayArriveSum: 0,
  203. willArriveSum: 0,
  204. thisMonthArriveSum: 0,
  205. notInSum: 0,
  206. unpassList: [],
  207. showImageList: [],
  208. timer_quality: '',
  209. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  210. timer_long: '', // 定时取服务器数据
  211. timer_short: '' // 数据超长定时轮播
  212. },
  213. methods: {
  214. // 质量异常滚动
  215. scrollQuality: function () {
  216. var i = 0
  217. for (; i < this.unpassList.length; i++) {
  218. if (this.unpassList[i].bg == "selectrow")
  219. break;
  220. }
  221. // 未找到,找第一条
  222. if (i >= this.unpassList.length) {
  223. i = 0;
  224. } else {
  225. this.unpassList[i].bg = "";
  226. if (i == this.unpassList.length - 1)
  227. i = 0;
  228. else
  229. i++;
  230. }
  231. this.unpassList[i].bg = "selectrow";
  232. this.showImageList = this.unpassList[i].images;
  233. },
  234. // 从服务器加载数据并显示
  235. refreshData: function () {
  236. // 关闭定时器
  237. clearInterval(this.timer_short);
  238. // 关闭质量异常定时器
  239. clearInterval(this.timer_quality);
  240. // 刷新报表
  241. ChartsService.initBarAndLine("charts_11", ServiceMaterial
  242. .getLastSixMonthQualityTargetCompare(), ChartsService.getGridSpanSmall());
  243. ChartsService.initBarWithShade("charts_31", ServiceMaterial.getPassRateByVendor(),
  244. ChartsService.getGridSpanSmall());
  245. ChartsService.initBarWithShade("charts_21", ServiceMaterial.getCheckRateByBatchno(),
  246. ChartsService.getGridSpanSmall());
  247. this.loadData();
  248. // 开启定时器
  249. this.timer_short = setInterval(this.scrollData, 30000);
  250. this.scrollQuality();
  251. this.timer_quality = setInterval(this.scrollQuality, 4000);
  252. },
  253. // 轮播数据
  254. scrollData: function () {
  255. for (var key in this.cacheDataObject) {
  256. const dataList = this.cacheDataObject[key].data;
  257. const pagesize = this.cacheDataObject[key].pagesize;
  258. var pageindex = this.cacheDataObject[key].pageindex + 1;
  259. if (dataList.length > pagesize) {
  260. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  261. pagesize > 0 ? 1 : 0);
  262. if (pageindex >= pagesum)
  263. pageindex = 0;
  264. this.cacheDataObject[key].pageindex = pageindex;
  265. const startIndex = pageindex * pagesize;
  266. const remainSum = dataList.length - startIndex;
  267. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  268. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  269. }
  270. }
  271. },
  272. // 从服务器加载数据
  273. loadData: function () {
  274. this.cacheDataObject = {};
  275. // 未来3天到货
  276. const willArriveMeterialList = ServiceMaterial.getWillArriveList(3);
  277. this.cacheDataObject.willArriveMeterialList = {
  278. data: willArriveMeterialList,
  279. pagesize: 3,
  280. pageindex: 0
  281. }
  282. this.willArriveMeterialList = willArriveMeterialList.slice(0, this.cacheDataObject
  283. .willArriveMeterialList.pagesize);
  284. // 未入库
  285. const waitingInList = ServiceMaterial.getWatingInList();
  286. this.cacheDataObject.waitingInList = {
  287. data: waitingInList,
  288. pagesize: 10,
  289. pageindex: 0
  290. }
  291. this.waitingInList = waitingInList.slice(0, this.cacheDataObject
  292. .waitingInList.pagesize);
  293. // 当天到货批数
  294. this.todayArriveSum = ServiceMaterial.getTodayArriveSum();
  295. // 未来3天到货
  296. this.willArriveSum = ServiceMaterial.getWillArriveSum(3);
  297. // 当月到货批数
  298. this.thisMonthArriveSum = ServiceMaterial.getThisMonthArriveSum();
  299. // 为入库总批数
  300. this.notInSum = ServiceMaterial.getNotInSum();
  301. // 质量异常
  302. const unpassList = ServiceMaterial.getQualityUnpassList();
  303. this.cacheDataObject.unpassList = {
  304. data: unpassList,
  305. pagesize: 15,
  306. pageindex: 0
  307. }
  308. this.unpassList = unpassList.slice(0, this.cacheDataObject
  309. .unpassList.pagesize);
  310. }
  311. },
  312. mounted() {
  313. this.timer_long = setInterval(this.refreshData, 600000);
  314. this.refreshData();
  315. },
  316. beforeDestroy() {
  317. clearInterval(this.timer_quality);
  318. clearInterval(this.timer_long);
  319. clearInterval(this.timer_short);
  320. }
  321. });
  322. </script>
  323. </body>
  324. </html>