123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=0.5">
- <title>品质管理看板</title>
- <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
- <link href="/css/dashboard.css" rel="stylesheet" />
- <script src="/lib/layui/layui.all.js" charset="utf-8"></script>
- <script type="text/javascript" src="/js/service.js"></script>
- <script type="text/javascript" src="/js/session.js"></script>
- <script type="text/javascript" src="/js/getService.js"></script>
- <script type="text/javascript" src="/js/service/method-get-service.js"></script>
- <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
- <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
- </head>
- <script>
-
- // $(function () {
- // ServiceLoginOperation.Login();
- // })
- </script>
- <body id="container" class="container-fluid">
- <div class="row no-padding head-bar" style="height:81px">
- <div class="col-lg-1 col-md-1">
- </div>
- <div class="col-lg-4 col-md-4 page-title">
- 品质管理看板
- </div>
- <div class="col-lg-3 col-md-3 block-padding">
- <button type="button" class="btn btn-warning"
- onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
- <button type="button" class="btn btn-warning"
- onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
- <button type="button" class="btn btn-warning"
- onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
- </div>
- <div class="col-lg-4 col-md-4">
- </div>
- </div>
- <div class="my-container" id="div-main">
- <div class="row">
- <div class="col-lg-4 col-md-4">
- <div class="row block-padding">
- <div class="col-lg-12 col-md-12 center block-title">未来3天的到货计划</div>
- </div>
- <div class="row block-padding">
- <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">计划到货日期</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
- <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
- <div class="col-lg-1 col-md-1 center no-padding">到货<br />数量</div>
- <div class="col-lg-1 col-md-1 center no-padding padding-line">备注</div>
- </div>
- <div class="row">
- <div class="col-lg-12 col-md-12" style="height: 200px;">
- <div class="row" v-for="product in willArriveMeterialList">
- <div class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.vendorName}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.memo}}</div>
- </div>
- </div>
- </div>
- <div class="row block-padding">
- <div class="col-lg-12 col-md-12 center block-title">近六个月的月度合格率</div>
- </div>
- <div class="row">
- <div class="col-lg-12 col-md-12" style="height:300px" id="charts_11"></div>
- </div>
- </div>
- <div class="col-lg-4 col-md-4">
- <div class="row" style="padding-top:40px;">
- <div class="col-lg-6 col-md-6">
- <div class="quality-block-1 center">当天到货批数</div>
- <div class="quality-block-2 center">{{todayArriveSum}}</div>
- </div>
- <div class="col-lg-6 col-md-6 quality-block">
- <div class="quality-block-1 center">未来3天的到货总批数</div>
- <div class="quality-block-2 center">{{willArriveSum}}</div>
- </div>
- <div class="col-lg-6 col-md-6 quality-block">
- <div class="quality-block-1 center">当月到货总批数</div>
- <div class="quality-block-2 center">{{thisMonthArriveSum}}</div>
- </div>
- <div class="col-lg-6 col-md-6 quality-block">
- <div class="quality-block-1 center">未入库批数</div>
- <div class="quality-block-2 center">{{notInSum}}</div>
- </div>
- </div>
- <div class="row" style="margin-top: 30px;">
- <div class="col-lg-12 col-md-12 center block-title">当月供检验合格率</div>
- </div>
- <div class="row">
- <div class="col-lg-12 col-md-12" style="height:380px" id="charts_21"></div>
- </div>
- </div>
- <div class="col-lg-4 col-md-4">
- <div class="row block-padding">
- <div class="col-lg-12 col-md-12 center block-title">当前已到货未入库情况</div>
- </div>
- <div class="row block-padding">
- <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">计划到货日期</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
- <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
- <div class="col-lg-1 col-md-1 center no-padding">到货<br />数量</div>
- <div class="col-lg-1 col-md-1 center no-padding padding-line">备注</div>
- </div>
- <div class="row">
- <div class="col-lg-12 col-md-12" style="height: 200px;">
- <div class="row" v-for="product in waitingInList">
- <div class="col-lg-1 col-md-1 center no-padding">{{product.index}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.arriveDate}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.vendorName}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.materialCode}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.materialName}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{product.specs}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.arriveSum}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{product.memo}}</div>
- </div>
- </div>
- </div>
- <div class="row block-padding">
- <div class="col-lg-12 col-md-12 center block-title">当月供应商合格率实时展示</div>
- </div>
- <div class="row">
- <div class="col-lg-12 col-md-12" style="height:300px" id="charts_31"></div>
- </div>
- </div>
- </div>
- <div class="row block-padding">
- <div class="col-md-1 col-lg-1 center block-title" style="padding-top: 80px">
- 质<br />量<br />异<br />常<br />信<br />息
- </div>
- <d class="col-md-7 col-lg-7">
- <div class="row">
- <div class="col-lg-1 col-md-1 center no-padding padding-line">序号</div>
- <div class="col-lg-1 col-md-2 center no-padding padding-line">检验日期</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">供应商</div>
- <div class="col-lg-1 col-md-1 center no-padding padding-line">物料号</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">名称</div>
- <div class="col-lg-2 col-md-2 center no-padding padding-line">型号规格</div>
- <div class="col-lg-3 col-md-3 center no-padding">
- <div class="row">
- <div class="col-lg-3 col-md-3 center no-padding">到货<br />数量</div>
- <div class="col-lg-3 col-md-3 center no-padding">抽检<br />数量</div>
- <div class="col-lg-3 col-md-3 center no-padding">不良<br />数量</div>
- <div class="col-lg-3 col-md-3 center no-padding">抽检<br />合格率</div>
- </div>
- </div>
- </div>
- <div class="row" v-for="material in unpassList" :class="material.bg">
- <div class="col-lg-1 col-md-1 center no-padding">{{material.index}}</div>
- <div class="col-lg-1 col-md-2 center no-padding">{{material.checkDate}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{material.vendorName}}</div>
- <div class="col-lg-1 col-md-1 center no-padding">{{material.materialCode}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{material.materialName}}</div>
- <div class="col-lg-2 col-md-2 center no-padding">{{material.specs}}</div>
- <div class="col-lg-3 col-md-3 center no-padding">
- <div class="row">
- <div class="col-lg-3 col-md-3 center no-padding">{{material.arriveSum}}</div>
- <div class="col-lg-3 col-md-3 center no-padding">{{material.checkSum}}</div>
- <div class="col-lg-3 col-md-3 center no-padding">{{material.unpassSum}}</div>
- <div class="col-lg-3 col-md-3 center no-padding">{{material.passRate}}</div>
- </div>
- </div>
- </div>
- </d>
- <div class="col-md-4 col-lg-4 center">
- <div class="row">
- <div class="col-md-4 col-lg-4 center " style="padding-bottom: 5px;"
- v-for="showimage in showImageList">
- <img :src="showimage" border="0" style="width:150px;height:130px;" />
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- jQuery -->
- <script src="/lib/jquery.min.js"></script>
- <script src="/lib/vue.min.js"></script>
- <script src="/lib/echarts/echarts.min.js"></script>
- <script src="/lib/echarts/theme/macarons.js"></script>
- <script src="/js/service/person.js?_v=2"></script>
- <script src="/js/service/material.js?_v=2"></script>
- <script src="/js/service/product.js?_v=2"></script>
- <script src="/js/content/mycharts.js?_v=2"></script>
- <script type="text/javascript">
- var vm = new Vue({
- el: '#div-main',
- data: {
- willArriveMeterialList: [],
- waitingInList: [],
- todayArriveSum: 0,
- willArriveSum: 0,
- thisMonthArriveSum: 0,
- notInSum: 0,
- unpassList: [],
- showImageList: [],
- timer_quality: '',
- cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
- timer_long: '', // 定时取服务器数据
- timer_short: '' // 数据超长定时轮播
- },
- methods: {
- // 质量异常滚动
- scrollQuality: function () {
- var i = 0
- for (; i < this.unpassList.length; i++) {
- if (this.unpassList[i].bg == "selectrow")
- break;
- }
- // 未找到,找第一条
- if (i >= this.unpassList.length) {
- i = 0;
- } else {
- this.unpassList[i].bg = "";
- if (i == this.unpassList.length - 1)
- i = 0;
- else
- i++;
- }
- this.unpassList[i].bg = "selectrow";
- this.showImageList = this.unpassList[i].images;
- },
- // 从服务器加载数据并显示
- refreshData: function () {
- // 关闭定时器
- clearInterval(this.timer_short);
- // 关闭质量异常定时器
- clearInterval(this.timer_quality);
- // 刷新报表
- ChartsService.initBarAndLine("charts_11", ServiceMaterial
- .getLastSixMonthQualityTargetCompare(), ChartsService.getGridSpanSmall());
- ChartsService.initBarWithShade("charts_31", ServiceMaterial.getPassRateByVendor(),
- ChartsService.getGridSpanSmall());
- ChartsService.initBarWithShade("charts_21", ServiceMaterial.getCheckRateByBatchno(),
- ChartsService.getGridSpanSmall());
- this.loadData();
- // 开启定时器
- this.timer_short = setInterval(this.scrollData, 30000);
- this.scrollQuality();
- this.timer_quality = setInterval(this.scrollQuality, 4000);
- },
- // 轮播数据
- scrollData: function () {
-
- for (var key in this.cacheDataObject) {
- const dataList = this.cacheDataObject[key].data;
- const pagesize = this.cacheDataObject[key].pagesize;
- var pageindex = this.cacheDataObject[key].pageindex + 1;
- if (dataList.length > pagesize) {
- const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
- pagesize > 0 ? 1 : 0);
- if (pageindex >= pagesum)
- pageindex = 0;
- this.cacheDataObject[key].pageindex = pageindex;
- const startIndex = pageindex * pagesize;
- const remainSum = dataList.length - startIndex;
- const recordSum = remainSum >= pagesize ? pagesize : remainSum;
- this[key] = dataList.slice(startIndex, startIndex + pagesize);
- }
- }
-
- },
- // 从服务器加载数据
- loadData: function () {
- this.cacheDataObject = {};
- // 未来3天到货
- const willArriveMeterialList = ServiceMaterial.getWillArriveList(3);
- this.cacheDataObject.willArriveMeterialList = {
- data: willArriveMeterialList,
- pagesize: 3,
- pageindex: 0
- }
- this.willArriveMeterialList = willArriveMeterialList.slice(0, this.cacheDataObject
- .willArriveMeterialList.pagesize);
- // 未入库
- const waitingInList = ServiceMaterial.getWatingInList();
- this.cacheDataObject.waitingInList = {
- data: waitingInList,
- pagesize: 10,
- pageindex: 0
- }
- this.waitingInList = waitingInList.slice(0, this.cacheDataObject
- .waitingInList.pagesize);
- // 当天到货批数
- this.todayArriveSum = ServiceMaterial.getTodayArriveSum();
- // 未来3天到货
- this.willArriveSum = ServiceMaterial.getWillArriveSum(3);
- // 当月到货批数
- this.thisMonthArriveSum = ServiceMaterial.getThisMonthArriveSum();
- // 为入库总批数
- this.notInSum = ServiceMaterial.getNotInSum();
- // 质量异常
- const unpassList = ServiceMaterial.getQualityUnpassList();
- this.cacheDataObject.unpassList = {
- data: unpassList,
- pagesize: 15,
- pageindex: 0
- }
- this.unpassList = unpassList.slice(0, this.cacheDataObject
- .unpassList.pagesize);
- }
- },
- mounted() {
- this.timer_long = setInterval(this.refreshData, 600000);
- this.refreshData();
- },
- beforeDestroy() {
- clearInterval(this.timer_quality);
- clearInterval(this.timer_long);
- clearInterval(this.timer_short);
- }
- });
- </script>
- </body>
- </html>
|