diff --git a/src/api/kanban/equipment.js b/src/api/kanban/equipment.js index c8b69ce..72da110 100644 --- a/src/api/kanban/equipment.js +++ b/src/api/kanban/equipment.js @@ -61,4 +61,12 @@ export function getDeviceRefreshTime(data) { method: 'get', params: data }); +} +//字典表修改 +export function getdictlist(data) { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: data + }); } \ No newline at end of file diff --git a/src/views/kanban/equipment/index.vue b/src/views/kanban/equipment/index.vue index d892f78..065cc38 100644 --- a/src/views/kanban/equipment/index.vue +++ b/src/views/kanban/equipment/index.vue @@ -60,8 +60,8 @@ v-for="(n, index) in equipmentlist"> {{ index + 1 }} {{ n.equipmentName }} - {{ n.department }} - {{ n.equipmentStatus }} + {{ n.department || '无' }} + {{ n.dictLabel }} {{ n.failureRate != null ? n.failureRate + '%' : '--' }} {{ n.utilizationRatio != null ? n.utilizationRatio + '%' : '--' }} @@ -84,7 +84,7 @@ 故障原因 维修组 是否立即维修 - 维修时间 + 计划维修时间 @@ -98,7 +98,7 @@ {{ index + 1 }} {{ n.equipmentName }} {{ n.equipmentCode }} - {{ n.equipmentLocation }} + {{ n.equipmentLocation || '无' }} {{ n.workFaultDesc }} {{ n.teamName }} {{ n.workHandle }} @@ -183,7 +183,8 @@ 排名 - 设备名称 + 设备名称 + 设备编码 MTBF @@ -196,7 +197,8 @@ {{ index + 1 }} - {{ n.equipmentCode }} + {{ n.equipmentName }} + {{ n.equipmentCode }} {{ n.mtbf != null ? n.mtbf + 'h' : '--' }} @@ -213,6 +215,7 @@ 排名 设备名称 + 设备编码 设备OEE @@ -226,6 +229,7 @@ v-for="(n, index) in equipmentrepairlist"> {{ index + 1 }} {{ n.equipmentName }} + {{ n.equipmentCode }} {{ n.rapairQuantity != null ? n.rapairQuantity + '%' : '--' }} @@ -252,6 +256,7 @@ import { equipmentIntactRate, equipmentStability, getDeviceRefreshTime, + getdictlist, } from "@/api/kanban/equipment"; import * as echarts from "echarts"; import moment from "moment"; @@ -290,29 +295,14 @@ export default { colorlist: ["#005aff", "#f8b551"], datetime: null, time1: null, - getlist: [ - { - - }, - { - - }, - { - - }, - { - - }, - { - - }, - ], + getlist: [], repairlist: [], equipmentlist: [], equipmentrepairlist: [], equipmentstabilizelist: [], equipmentinfo: [], RefreshTime:null, + dictlist:[], }; }, created() { @@ -326,6 +316,7 @@ export default { //console.log('zhuanhuahou',this.dateRangeone) this.selectFactorylist(); + this.getdictlist() this.gettime(); }, methods: { @@ -338,6 +329,17 @@ export default { this.gettimedata = moment().format("YYYY-MM-DD HH:mm:ss "); }, 1000); }, + getdictlist(){ + getdictlist({ + pageNum: 1, + pageSize: 10, + dictType: 'equipment_status', + }).then((response) => { + if (response) { + this.dictlist = response.rows + } + }); + }, selectFactorylist() { const _this = this; getBoardFactory({ @@ -383,6 +385,11 @@ export default { if (response.data) { _this.equipmentlist = response.data _this.equipmentlist.forEach((item) => { + _this.dictlist.forEach((m) => { + if(item.equipmentStatus == m.dictValue){ + item.dictLabel = m.dictLabel + } + }); if (item.failureRate) { item.failureRate = item.failureRate.toFix(2) } diff --git a/src/views/kanban/quality/kanban1.vue b/src/views/kanban/quality/kanban1.vue index 7e0f81f..3758ed9 100644 --- a/src/views/kanban/quality/kanban1.vue +++ b/src/views/kanban/quality/kanban1.vue @@ -123,7 +123,7 @@
-
+
{{ n.projectName }}
@@ -448,80 +448,83 @@ export default { let dataoption = []; let totalArr = []; _this.optionDatalist3 = []; - response = [{ name: "1月", code: "100", value: '100', }] - if (response.length > 0) { - response.forEach((item) => { - let a = {}; - a.name = item.equName; - a.value = item.monthData; - a.code = item.equCode; - _this.optionDatalist3.push(a); - dataoption.push(a); - numberlist.push(item.monthData); - }); - dataoption.sort((a, b) => { - return a.value - b.value; - }); - let max = Math.max(...numberlist); - max = max + 100; - dataoption.forEach((item) => { - totalArr.push(max); - }); - option3 = { - yAxis: [ - { - data: dataoption, - }, - ], - series: [ - { - data: dataoption, - itemStyle: { - normal: { - color: function (params) { - var index_num = params.value; - - for (var i = 0; i < dataoption.length; i++) { - //判断数据是否大于1 - if (index_num > 1131) { - //var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0']; - //return colorList[params.dataIndex]; - return new echarts.graphic.LinearGradient( - 0, - 0, - 1, - 0, - [ - { offset: 0, color: "#FFB742" }, - { offset: 1, color: "#FFB742" }, - ] - ); - } else { - //var colorList = ['blue']; - //return colorList[params.dataIndex]; - return new echarts.graphic.LinearGradient( - 0, - 0, - 1, - 0, - [ - { offset: 0, color: "#005954" }, - { offset: 1, color: "#66E1DF" }, - ] - ); - } + console.log(response) + for (let index = 0; index < response.month.length; index++) { + let a = {}; + response.month[index] = moment(response.month[index]).format('MM') + a.name = response.month[index] + '月' + a.value = response.monthData[index] + a.code = response.monthData[index] + dataoption.push(a); + numberlist.push(response.monthData[index]); + } + // dataoption.sort((a, b) => { + // return a.value - b.value; + // }); + dataoption = dataoption.reverse() + let max = Math.max(...numberlist); + max = max + 100; + dataoption.forEach((item) => { + totalArr.push(max); + }); + console.log(dataoption, numberlist) + // response = [{ name: "1月", code: "100", value: '100', }] + // if (response.length > 0) { + option3 = { + yAxis: [ + { + data: dataoption, + }, + ], + series: [ + { + data: dataoption, + itemStyle: { + normal: { + color: function (params) { + var index_num = params.value; + + for (var i = 0; i < dataoption.length; i++) { + //判断数据是否大于1 + if (index_num > 1131) { + //var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0']; + //return colorList[params.dataIndex]; + return new echarts.graphic.LinearGradient( + 0, + 0, + 1, + 0, + [ + { offset: 0, color: "#FFB742" }, + { offset: 1, color: "#FFB742" }, + ] + ); + } else { + //var colorList = ['blue']; + //return colorList[params.dataIndex]; + return new echarts.graphic.LinearGradient( + 0, + 0, + 1, + 0, + [ + { offset: 0, color: "#005954" }, + { offset: 1, color: "#66E1DF" }, + ] + ); } - }, + } }, }, }, - { - data: totalArr, - }, - ], - }; - myChart3.setOption(option3); - } + }, + { + data: totalArr, + }, + ], + }; + myChart3.setOption(option3); + // } } }); var myChart5 = echarts.init(document.querySelector("#echart5")); @@ -581,7 +584,7 @@ export default { yAxis: [ { type: 'value', - name: '万元', + name: '', nameTextStyle: { color: '#D0DEEE' }, @@ -618,33 +621,38 @@ export default { }).then((response) => { if (response) { let seriesmyChart5 = [] + let legenddata = [] let dataoption = response.series; let xAxisdata = response.dayStr let yAxismax = [] let yAxismaxall = 0 dataoption.forEach((n) => { - if (e.data) { - console.log(Math.max(e.data), e.data) - yAxismax.push(Math.max(...e.datax)) + if (n.data) { + console.log(Math.max(...n.data), n.data) + yAxismax.push(Math.max(...n.data)) } var item = { - name: e.planktonname, - data: e.data, + name: n.machineName, + data: n.data, emphasis: { focus: 'series' }, type: "bar", - stack: e.planktonname, + stack: n.machineName, } + legenddata.push(n.machineName) seriesmyChart5.push(item); }); yAxismaxall = Math.max(...yAxismax) + 5 - myChart5 = { + option5 = { xAxis: [ { data: xAxisdata, }, ], + legend:{ + data:legenddata + }, yAxis: [ { max: yAxismaxall @@ -652,6 +660,7 @@ export default { ], series: seriesmyChart5 }; + console.log(seriesmyChart5,'111111111111111') myChart5.setOption(option5); } }); @@ -666,8 +675,13 @@ export default { containLabel: true }, tooltip: { - show: true, - trigger: 'item' + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } }, legend: { show: true, @@ -779,9 +793,28 @@ export default { yAxisIndex: 1, itemStyle: { normal: { - color: '#00d4c7', + color: '#5260CE', lineStyle: { - color: "#00d4c7", + color: "#5260CE", + width: 1 + }, + + } + }, + data: [] + }, + { + name: '不合格比例', + type: 'line', + stack: '总量', + symbol: 'circle', + symbolSize: 8, + yAxisIndex: 1, + itemStyle: { + normal: { + color: '#88E4E3', + lineStyle: { + color: "#88E4E3", width: 1 }, @@ -809,6 +842,27 @@ export default { ) } }, + }, + { + name: '不合格数量', + data: [], + type: 'bar', + showBackground: true, + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)' + }, + itemStyle: { + normal: { + barBorderRadius: 5, + color: new echarts.graphic.LinearGradient( + 0, 0, 0, 1, + [ + { offset: 0, color: "#66E1DF" }, + { offset: 1, color: "#005954" }, + ] + ) + } + }, } ] @@ -819,10 +873,27 @@ export default { factoryCode: 'ds_' + _this.selectxt, }).then((response) => { if (response) { - let seriesdata1 = response[0].data - let seriesdata2 = response[0].dataStr + let seriesdata1 = response[0].dataBarArrays + let seriesdata2 = response[0].dataLineArrays let xAxisdata = response[0].dayStr - let yAxismax = Math.max(...seriesdata1) + 5 + let seriesdata3 = response[1].dataBarArrays + let seriesdata4 = response[1].dataLineArrays + let max1 = Math.max(...seriesdata1) + 5 + let max2 = Math.max(...seriesdata3) + 5 + let max3 = Math.max(...seriesdata2) + 5 + let max4 = Math.max(...seriesdata4) + 5 + let yAxismax1 = 0 + let yAxismax2 = 0 + if (max1 > max2) { + yAxismax1 = max1 + } else { + yAxismax1 = max2 + } + if (max3 > max4) { + yAxismax2 = max3 + } else { + yAxismax2 = max4 + } option6 = { xAxis: [ { @@ -831,15 +902,24 @@ export default { ], yAxis: [ { - max: yAxismax + max: yAxismax1 + }, + { + max: yAxismax2 } ], series: [ { data: seriesdata2, }, + { + data: seriesdata4, + }, { data: seriesdata1, + }, + { + data: seriesdata3, } ] }; @@ -853,14 +933,14 @@ export default { let intactRate = 0 let numberAngle = 360 let intactRate1 = 0 - let numberAngle2 = 360 + let numberAngle1 = 360 if (_this.equipmentinfo.todayOkRate) { - intactRate = _this.equipmentinfo.todayOkRate - numberAngle = (100 - parseInt(_this.equipmentinfo.intactRate)) * 3.6 + intactRate = parseFloat(_this.equipmentinfo.todayOkRate) + numberAngle = (100 - parseInt(_this.equipmentinfo.todayOkRate)) * 3.6 } if (_this.equipmentinfo.monthOkRate) { - intactRate1 = _this.equipmentinfo.monthOkRate - numberAngle2 = (100 - parseInt(_this.equipmentinfo.monthOkRate)) * 3.6 + intactRate1 = parseFloat(_this.equipmentinfo.monthOkRate) + numberAngle1 = (100 - parseInt(_this.equipmentinfo.monthOkRate)) * 3.6 } var myChart1 = echarts.init(document.querySelector("#echart1")); var option1 = { @@ -1159,7 +1239,7 @@ export default { //起始角度。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。 startAngle: 360, //结束角度。 - endAngle: numberAngle, + endAngle: numberAngle1, center: ["50%", "50%"], //仪表盘轴线相关配置。 name: "内层盘", @@ -1285,7 +1365,7 @@ export default { }, data: [ { - value: intactRate, + value: intactRate1, }, ], @@ -1740,6 +1820,7 @@ export default { }, }; +