diff --git a/src/views/quality/qcTableCheckDevelop/index.vue b/src/views/quality/qcTableCheckDevelop/index.vue index 24ce30e..52dfb39 100644 --- a/src/views/quality/qcTableCheckDevelop/index.vue +++ b/src/views/quality/qcTableCheckDevelop/index.vue @@ -47,88 +47,56 @@
-
-
巡检数据统计
- - - - - - - - - - - - -
时间抽样数缺陷不良不良率
{{item}}
-
- - - - - - - - - - - - -
{{item.timeCol}}{{item.sampleQuality}}{{items}}{{item.noOkRate}}%
-
-
-
-
巡检
- - - - - - - - -
缺陷类别不良数占比
-
- - - - - - - - - - -
{{items.dataType}}{{items.noOkQuality}}{{items.noOkNumRate}}%
+ + +
+
巡检不良率
+
-
- -
-
-
-
巡检不良率
-
-
-
-
不良排列图
-
-
- +
+
巡检数据统计
+ + + + + + + + + + +
+ + +
+
不良排列图
+
+
+
+
+
巡检
+ + + + + + + +
+
+
不良比例
+
+
+
+
+
- -
@@ -160,6 +128,7 @@ export default { title: "", // 是否显示弹出层 open: false, + activeName:'', // 新增-物料选中listtag selectMaterielListtag:[], dateRange:[], @@ -203,63 +172,74 @@ export default { ], tableThead:[], tableTbody:[], + tableTheadTh:[], tableBlfx:[], echartsData:[], dateNode:'dd', }; }, mounted(){ - this.getDictData() - this.getThead() - this.getTbody() - this.getBlfx() + this.$nextTick(()=>{ + this.getDictData() + this.getThead() + this.getTbody() + this.getBlfx() + }) + + // this.getEchartsTh() }, created() { - + this.activeName='first' }, methods: { + handleClick(){ + }, async getThead(){ let res=await getTableHzTitleTh({checkType:'checkTypeSCXJ'}) console.log('resTh',res) this.tableThead=res.columns1 + }, async getTbody(){ + this.loading=true + // this.tableTheadTh=[] let res=await getTableHzData(this.queryParams) console.log('resData',res) + let xData=[] let yData=[] + this.tableTbody=res res.map((item,index)=>{ - let ddTab=[] xData.push(item.timeCol), yData.push(item.noOkRate) - Object.keys(item).map((itemT,indexT)=>{ - if((itemT!='timeCol')&&(itemT!='sampleQuality')&&(itemT!='noOkRate')){ - ddTab.push(item[itemT]) - } - }) - item.ddTab=ddTab + }) - console.log('resData处理后',res) - this.tableTbody=res - + console.log('tableTbody',this.tableTbody) + this.loading=false this.getEcharts(xData,yData) }, async getBlfx(){ let xdata=[] let ydata=[] + let peiData=[] let res=await getTableHzNoOkData(this.queryParams) console.log('res不良分析',res) res.map((item,index)=>{ + var pDat={} + pDat.name=item.dataType + pDat.value=item.noOkQuality xdata.push(item.dataType) ydata.push(item.noOkQuality) + peiData.push(pDat) }) this.tableBlfx=res console.log('table',this.tableBlfx) this.getEchartsT(xdata,ydata) + this.getEchartsTh(peiData) }, change(e){ @@ -287,29 +267,14 @@ export default { var myChart = echarts.init(chartDom); var option; option = { - // title:{ - // text:'不\n良\n率\n%', - // left:'1%', - // top:'30%' - // }, grid: { - y: '10%', + y: '5%', x:'1%', y2: '6%', x2: '1%', - width:'95%', + width:'96%', containLabel: true }, - // legend: { - // top:0, - // right:120, - // icon: "roundRect", - // data:["成品包装不良率%"], - // textStyle:{ - // color:'#000', - // fontSize:12 - // } - // }, xAxis: { type: 'category', name:_this.dateNode=='dd'?'时':_this.dateNode=='mm'?'日':'月', @@ -337,14 +302,6 @@ export default { axisLabel:{ formatter:'{value}%' } - // splitLine: { - // show: true - // }, - // axisTick:{ - // show:true, - // inside:true, - // alignWithLabel:true, - // }, }, series: [ { @@ -382,11 +339,6 @@ export default { var myChart2 = echarts.init(chartDom); var option2; option2 = { - // title:{ - // text:'不\n良\n率\n%', - // left:'1%', - // top:'30%' - // }, grid: { y: '10%', x:'1%', @@ -395,21 +347,8 @@ export default { width:'95%', containLabel: true }, - // legend: { - // top:0, - // right:120, - // icon: "roundRect", - // data:["成品包装不良率%"], - // textStyle:{ - // color:'#000', - // fontSize:12 - // } - // }, xAxis: { type: 'category', - // splitLine: { - // show: true //分隔线,默认数值轴显示,类目轴不显示 - // }, axisTick:{ show:false, inside:true, @@ -420,26 +359,14 @@ export default { yAxis: { type: 'value', show:true, - // boundaryGap:true, axisLine:{ - // show:true, }, - // splitLine: { - // show: true - // }, - // axisTick:{ - // show:true, - // inside:true, - // alignWithLabel:true, - // }, }, series: [ { name:'成品包装不良率%', data: ydata, type: 'bar', - // symbol: "circle", - // symbolSize: 5, label:{ show:true, position: "top", @@ -465,6 +392,54 @@ export default { option2 && myChart2.setOption(option2); }, + getEchartsTh(peiData){ + console.log('peiData',peiData) + var chartDomT = document.getElementById('echartsTh'); + var myChart3 = echarts.init(chartDomT); + var option3; + option3 = { + // title: { + // text: 'Referer of a Website', + // left: 'center' + // }, + tooltip: { + trigger: 'item' + }, + legend: { + orient: 'vertical', + left: 'left' + }, + series: [ + { + name: '不良数', + type: 'pie', + radius: '50%', + minAngle: 30, + data: peiData, + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: { + normal: { + position: 'inside', + formatter: '{d}%', + + textStyle: { + color: '#fff', + fontWeight: 'bold', + fontSize: 10 + } + } + }, + } + ] + } + option3 && myChart3.setOption(option3); + }, // 表单重置 reset() { this.form = { @@ -516,85 +491,52 @@ export default {