fix: 大屏getDeptDetail错误
This commit is contained in:
parent
417a583c7a
commit
0e06b13501
|
@ -51,7 +51,7 @@
|
||||||
<div class="totalNumWrap totalNum_orange">
|
<div class="totalNumWrap totalNum_orange">
|
||||||
<img class="" src="img/number_bg_orange.png">
|
<img class="" src="img/number_bg_orange.png">
|
||||||
<span class="totalNumText">AVG合格数</span>
|
<span class="totalNumText">AVG合格数</span>
|
||||||
<div class="totalNumber">{{countOk_AVG}}</div>
|
<div class="totalNumber">{{ countOk_AVG }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="totalNumWrap totalNumWrap_green">
|
<div class="totalNumWrap totalNumWrap_green">
|
||||||
<img src="img/number_bg_green.png">
|
<img src="img/number_bg_green.png">
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<div class="totalNumWrap totalNum_blue">
|
<div class="totalNumWrap totalNum_blue">
|
||||||
<img src="img/number_bg_blue.png">
|
<img src="img/number_bg_blue.png">
|
||||||
<span class="totalNumText">预制管合格数</span>
|
<span class="totalNumText">预制管合格数</span>
|
||||||
<div class="totalNumber">{{countOk_dept10}}</div>
|
<div class="totalNumber">{{ countOk_dept10 }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,9 +84,9 @@
|
||||||
<div class="blockTitleIcon"></div>
|
<div class="blockTitleIcon"></div>
|
||||||
<div>本周不合格占比</div>
|
<div>本周不合格占比</div>
|
||||||
<el-radio-group v-model="deptName" @change="deptNameChange">
|
<el-radio-group v-model="deptName" @change="deptNameChange">
|
||||||
<el-radio label="7车间">7车间</el-radio>
|
<el-radio label="7车间">7车间</el-radio>
|
||||||
<el-radio label="10车间">10车间</el-radio>
|
<el-radio label="10车间">10车间</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div id="pie"
|
<div id="pie"
|
||||||
style="width:100%;height:92%;background:rgba(9,31,43,.5);border-radius: 20px;margin-top: 5px;">
|
style="width:100%;height:92%;background:rgba(9,31,43,.5);border-radius: 20px;margin-top: 5px;">
|
||||||
|
@ -135,11 +135,11 @@
|
||||||
<p> <span class="numberFont">390</span><span class="numberUnit">件</span></p>
|
<p> <span class="numberFont">390</span><span class="numberUnit">件</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="countWrap">
|
<div class="countWrap">
|
||||||
<div v-if="currentObj.deptName=='10车间'||currentObj.deptName=='6车间'">
|
<div v-if="currentObj.deptName == '10车间' || currentObj.deptName == '6车间'">
|
||||||
<p>光纤预制管</p>
|
<p>光纤预制管</p>
|
||||||
<p> <span class="numberFont">390{{ currentObj.生产数 }}</span><span class="numberUnit">件</span></p>
|
<p> <span class="numberFont">390{{ currentObj.生产数 }}</span><span class="numberUnit">件</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="currentObj.deptName=='7车间'||currentObj.deptName=='6车间'">
|
<div v-if="currentObj.deptName == '7车间' || currentObj.deptName == '6车间'">
|
||||||
<p>光纤预制棒</p>
|
<p>光纤预制棒</p>
|
||||||
<p> <span class="numberFont">390{{ currentObj.生产数 }}</span><span class="numberUnit">件</span></p>
|
<p> <span class="numberFont">390{{ currentObj.生产数 }}</span><span class="numberUnit">件</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -197,7 +197,7 @@ import 'animate.css';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dept7Data:[
|
dept7Data: [
|
||||||
{ value: 0, name: '炸纹' },
|
{ value: 0, name: '炸纹' },
|
||||||
{ value: 0, name: '条纹' },
|
{ value: 0, name: '条纹' },
|
||||||
{ value: 0, name: '气泡' },
|
{ value: 0, name: '气泡' },
|
||||||
|
@ -205,7 +205,7 @@ export default {
|
||||||
{ value: 0, name: '其他' },
|
{ value: 0, name: '其他' },
|
||||||
{ value: 0, name: '合格' },
|
{ value: 0, name: '合格' },
|
||||||
],
|
],
|
||||||
dept10Data:[
|
dept10Data: [
|
||||||
{ value: 0, name: '椭圆弯曲' },
|
{ value: 0, name: '椭圆弯曲' },
|
||||||
{ value: 0, name: '大小头' },
|
{ value: 0, name: '大小头' },
|
||||||
{ value: 0, name: '偏壁' },
|
{ value: 0, name: '偏壁' },
|
||||||
|
@ -260,24 +260,24 @@ export default {
|
||||||
currentObj: {
|
currentObj: {
|
||||||
deptName: ''
|
deptName: ''
|
||||||
},
|
},
|
||||||
deptName:'10车间',
|
deptName: '10车间',
|
||||||
heightTimer: null,
|
heightTimer: null,
|
||||||
countOk_AVG:0,
|
countOk_AVG: 0,
|
||||||
countOk_dept7:0,
|
countOk_dept7: 0,
|
||||||
countOk_dept10:0,
|
countOk_dept10: 0,
|
||||||
blockTableHeight:0,
|
blockTableHeight: 0,
|
||||||
weekDateList:[],
|
weekDateList: [],
|
||||||
//表一数据
|
//表一数据
|
||||||
saleOutdept6:[0,0,0,0,0,0,0],
|
saleOutdept6: [0, 0, 0, 0, 0, 0, 0],
|
||||||
saleOutAVG:[0,0,0,0,0,0,0],
|
saleOutAVG: [0, 0, 0, 0, 0, 0, 0],
|
||||||
//表二数据
|
//表二数据
|
||||||
countOkAVG:[0,0,0,0,0,0,0],
|
countOkAVG: [0, 0, 0, 0, 0, 0, 0],
|
||||||
countOkDept7:[0,0,0,0,0,0,0],
|
countOkDept7: [0, 0, 0, 0, 0, 0, 0],
|
||||||
countOkDept10:[0,0,0,0,0,0,0],
|
countOkDept10: [0, 0, 0, 0, 0, 0, 0],
|
||||||
//表三数据
|
//表三数据
|
||||||
countRateDept7:[0,0,0,0,0,0,0],
|
countRateDept7: [0, 0, 0, 0, 0, 0, 0],
|
||||||
countRateDept10:[0,0,0,0,0,0,0],
|
countRateDept10: [0, 0, 0, 0, 0, 0, 0],
|
||||||
pieoption : {
|
pieoption: {
|
||||||
color: ['rgb(3,195,198)', 'rgb(155,248,249)', 'rgb(110,181,249)', 'rgb(205,248,248)', 'rgb(248,189,118)'],
|
color: ['rgb(3,195,198)', 'rgb(155,248,249)', 'rgb(110,181,249)', 'rgb(205,248,248)', 'rgb(248,189,118)'],
|
||||||
legend: {
|
legend: {
|
||||||
bottom: 1,
|
bottom: 1,
|
||||||
|
@ -295,37 +295,37 @@ export default {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
name: '不合格占比',
|
name: '不合格占比',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: [30, 60],
|
radius: [30, 60],
|
||||||
center: ['50%', '45%'],
|
center: ['50%', '45%'],
|
||||||
// roseType: 'area',
|
// roseType: 'area',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: 2
|
borderRadius: 2
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
minMargin: 10,
|
||||||
|
edgeDistance: 10,
|
||||||
|
fontSize: '12px'
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
lineStyle: {
|
||||||
},
|
},
|
||||||
label: {
|
length: 2,
|
||||||
minMargin: 10,
|
length2: 5
|
||||||
edgeDistance: 10,
|
},
|
||||||
fontSize: '12px'
|
labelLayout: function (params) {
|
||||||
},
|
var isLeft = params.labelRect.x < myChart.getWidth() / 2
|
||||||
labelLine: {
|
var points = params.labelLinePoints;
|
||||||
lineStyle: {
|
points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
|
||||||
},
|
return {
|
||||||
length: 2,
|
labelLinePoints: points,
|
||||||
length2: 5
|
dy: -10,
|
||||||
},
|
dx: 0
|
||||||
labelLayout: function (params) {
|
}
|
||||||
var isLeft = params.labelRect.x < myChart.getWidth() / 2
|
},
|
||||||
var points = params.labelLinePoints;
|
data: []
|
||||||
points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
|
}
|
||||||
return {
|
|
||||||
labelLinePoints: points,
|
|
||||||
dy: -10,
|
|
||||||
dx: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data:[]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -346,14 +346,14 @@ export default {
|
||||||
that.showTime();
|
that.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
that.notokTimer = setInterval(() => {
|
that.notokTimer = setInterval(() => {
|
||||||
if(that.deptName=='10车间'){
|
if (that.deptName == '10车间') {
|
||||||
that.deptName='7车间'
|
that.deptName = '7车间'
|
||||||
}else{
|
} else {
|
||||||
that.deptName='10车间'
|
that.deptName = '10车间'
|
||||||
}
|
}
|
||||||
that.deptNameChange(that.deptName);
|
that.deptNameChange(that.deptName);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
that.initChart();
|
that.initChart();
|
||||||
})
|
})
|
||||||
//一天的毫秒数
|
//一天的毫秒数
|
||||||
|
@ -367,8 +367,8 @@ export default {
|
||||||
let first = new Date(new Date(cDate.getTime() - (weekFirst * ondDayTime)));//本周周一
|
let first = new Date(new Date(cDate.getTime() - (weekFirst * ondDayTime)));//本周周一
|
||||||
let last = new Date(new Date(cDate.getTime() + (weekLast * ondDayTime)));//本周周日
|
let last = new Date(new Date(cDate.getTime() + (weekLast * ondDayTime)));//本周周日
|
||||||
let dateArr = [];
|
let dateArr = [];
|
||||||
for(let i=0;i<7;i++){
|
for (let i = 0; i < 7; i++) {
|
||||||
let itemDate = new Date(first.getTime()-i*ondDayTime);
|
let itemDate = new Date(first.getTime() - i * ondDayTime);
|
||||||
let item = itemDate.getFullYear() + '-' + (itemDate.getMonth() + 1) + '-' + itemDate.getDate();
|
let item = itemDate.getFullYear() + '-' + (itemDate.getMonth() + 1) + '-' + itemDate.getDate();
|
||||||
dateArr.push(item);
|
dateArr.push(item);
|
||||||
}
|
}
|
||||||
|
@ -385,41 +385,41 @@ export default {
|
||||||
getsaleOut() {
|
getsaleOut() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: that.start_date, end_date: that.end_date},
|
query: { start_date: that.start_date, end_date: that.end_date },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('saleOutDay', obj).then((res6) => {
|
that.$API.bi.dataset.exec.req('saleOutDay', obj).then((res6) => {
|
||||||
let list = res6.data2.ds0;
|
let list = res6.data2.ds0;
|
||||||
let saleOutdept6 = [0,0,0,0,0,0,0];//棒管交付数
|
let saleOutdept6 = [0, 0, 0, 0, 0, 0, 0];//棒管交付数
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
let date = item.年+'-'+item.月+'-'+item.日;
|
let date = item.年 + '-' + item.月 + '-' + item.日;
|
||||||
let index = this.weekDateList.indexOf(date);
|
let index = this.weekDateList.indexOf(date);
|
||||||
saleOutdept6[index] = item.交付数;
|
saleOutdept6[index] = item.交付数;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
that.saleOutdept6 = saleOutdept6;
|
that.saleOutdept6 = saleOutdept6;
|
||||||
that.getAVGDayData();
|
that.getAVGDayData();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取AVG的交付数$合格数
|
//获取AVG的交付数$合格数
|
||||||
getAVGDayData(){
|
getAVGDayData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte: that.start_date,handle_date__lte: that.end_date}).then(res=>{
|
this.$API.wpm.otherlog.list.req({ product: 'AVG', page: 0, handle_date__gte: that.start_date, handle_date__lte: that.end_date }).then(res => {
|
||||||
let list = res;
|
let list = res;
|
||||||
let count_ok = 0,saleOutAVG = [0,0,0,0,0,0,0],countOkAVG= [0,0,0,0,0,0,0];
|
let count_ok = 0, saleOutAVG = [0, 0, 0, 0, 0, 0, 0], countOkAVG = [0, 0, 0, 0, 0, 0, 0];
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item=>{
|
list.forEach(item => {
|
||||||
count_ok=count_ok+item.count_ok;
|
count_ok = count_ok + item.count_ok;
|
||||||
let index = this.weekDateList.indexOf(item.handle_date);
|
let index = this.weekDateList.indexOf(item.handle_date);
|
||||||
saleOutAVG[index] = item.count_delivered;
|
saleOutAVG[index] = item.count_delivered;
|
||||||
countOkAVG[index] = item.count_ok;
|
countOkAVG[index] = item.count_ok;
|
||||||
})
|
})
|
||||||
that.saleOutAVG = saleOutAVG;
|
that.saleOutAVG = saleOutAVG;
|
||||||
that.countOkAVG = countOkAVG;
|
that.countOkAVG = countOkAVG;
|
||||||
that.countOk_AVG = count_ok;
|
that.countOk_AVG = count_ok;
|
||||||
}
|
}
|
||||||
that.getCountDept7();
|
that.getCountDept7();
|
||||||
//左1---本周交付数
|
//左1---本周交付数
|
||||||
let chartDom = document.getElementById('line1');
|
let chartDom = document.getElementById('line1');
|
||||||
chartDom.style.height = this.blockHeight;
|
chartDom.style.height = this.blockHeight;
|
||||||
let myChart = echarts.init(chartDom);
|
let myChart = echarts.init(chartDom);
|
||||||
|
@ -482,7 +482,7 @@ export default {
|
||||||
bottom: '5%',
|
bottom: '5%',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
xAxis:{
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
|
@ -492,7 +492,7 @@ export default {
|
||||||
color: '#ffffff'
|
color: '#ffffff'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
yAxis:{
|
yAxis: {
|
||||||
name: "",
|
name: "",
|
||||||
type: 'value',
|
type: 'value',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
|
@ -572,59 +572,59 @@ export default {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//7车间合格数&&合格率
|
//7车间合格数&&合格率
|
||||||
getCountDept7(){
|
getCountDept7() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: that.start_date, end_date: that.end_date,dept_name: "7车间"},
|
query: { start_date: that.start_date, end_date: that.end_date, dept_name: "7车间" },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
||||||
let list = res.data2.ds0;
|
let list = res.data2.ds0;
|
||||||
let countOkDept7 = [0,0,0,0,0,0,0],countRateDept7 = [0,0,0,0,0,0,0];
|
let countOkDept7 = [0, 0, 0, 0, 0, 0, 0], countRateDept7 = [0, 0, 0, 0, 0, 0, 0];
|
||||||
let value0=0,value1=0,value2=0,value3=0,value4=0,value5=0,countOk_dept7=0;
|
let value0 = 0, value1 = 0, value2 = 0, value3 = 0, value4 = 0, value5 = 0, countOk_dept7 = 0;
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
let date = item.年+'-'+item.月+'-'+item.日;
|
let date = item.年 + '-' + item.月 + '-' + item.日;
|
||||||
let index = this.weekDateList.indexOf(date);
|
let index = this.weekDateList.indexOf(date);
|
||||||
countOkDept7[index] = item.合格数;
|
countOkDept7[index] = item.合格数;
|
||||||
countRateDept7[index] = Math.round(item.合格率);
|
countRateDept7[index] = Math.round(item.合格率);
|
||||||
countOk_dept7 = countOk_dept7+item.合格数;
|
countOk_dept7 = countOk_dept7 + item.合格数;
|
||||||
that.dept7Data[0].value= that.dept7Data[0].value+item.炸纹;
|
that.dept7Data[0].value = that.dept7Data[0].value + item.炸纹;
|
||||||
that.dept7Data[1].value= that.dept7Data[1].value+item.条纹;
|
that.dept7Data[1].value = that.dept7Data[1].value + item.条纹;
|
||||||
that.dept7Data[2].value= that.dept7Data[2].value+item.气泡;
|
that.dept7Data[2].value = that.dept7Data[2].value + item.气泡;
|
||||||
that.dept7Data[3].value= that.dept7Data[3].value+item.弯曲;
|
that.dept7Data[3].value = that.dept7Data[3].value + item.弯曲;
|
||||||
that.dept7Data[4].value= that.dept7Data[4].value+item.其他;
|
that.dept7Data[4].value = that.dept7Data[4].value + item.其他;
|
||||||
that.dept7Data[5].value= that.dept7Data[5].value+item.合格数;
|
that.dept7Data[5].value = that.dept7Data[5].value + item.合格数;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
that.countOkDept7 = countOkDept7;
|
that.countOkDept7 = countOkDept7;
|
||||||
that.deptData =that.dept7Data;
|
that.deptData = that.dept7Data;
|
||||||
that.countRateDept7 = countRateDept7;
|
that.countRateDept7 = countRateDept7;
|
||||||
that.countOk_dept7 = countOk_dept7;
|
that.countOk_dept7 = countOk_dept7;
|
||||||
that.getCountDept10();
|
that.getCountDept10();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//10车间合格数&&合格率
|
//10车间合格数&&合格率
|
||||||
getCountDept10(){
|
getCountDept10() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: that.start_date, end_date: that.end_date,dept_name: "10车间"},
|
query: { start_date: that.start_date, end_date: that.end_date, dept_name: "10车间" },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
||||||
let list = res.data2.ds0;
|
let list = res.data2.ds0;
|
||||||
let countOkDept10 = [0,0,0,0,0,0,0],countRateDept10 = [0,0,0,0,0,0,0];
|
let countOkDept10 = [0, 0, 0, 0, 0, 0, 0], countRateDept10 = [0, 0, 0, 0, 0, 0, 0];
|
||||||
let value0=0,value1=0,value2=0,value3=0,value4=0,value5=0,countOk_dept10=0;
|
let value0 = 0, value1 = 0, value2 = 0, value3 = 0, value4 = 0, value5 = 0, countOk_dept10 = 0;
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
let date = item.年+'-'+item.月+'-'+item.日;
|
let date = item.年 + '-' + item.月 + '-' + item.日;
|
||||||
let index = this.weekDateList.indexOf(date);
|
let index = this.weekDateList.indexOf(date);
|
||||||
countOkDept10[index] = item.合格数;
|
countOkDept10[index] = item.合格数;
|
||||||
countRateDept10[index] = Math.round(item.合格率);
|
countRateDept10[index] = Math.round(item.合格率);
|
||||||
countOk_dept10 = countOk_dept10+item.合格数;
|
countOk_dept10 = countOk_dept10 + item.合格数;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
that.countOkDept10 = countOkDept10;
|
that.countOkDept10 = countOkDept10;
|
||||||
that.countRateDept10 = countRateDept10;
|
that.countRateDept10 = countRateDept10;
|
||||||
that.countOk_dept10 = countOk_dept10;
|
that.countOk_dept10 = countOk_dept10;
|
||||||
|
@ -632,19 +632,19 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//本周计划完成度
|
//本周计划完成度
|
||||||
getPlanRate(){
|
getPlanRate() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: that.start_date, end_date: that.end_date,dept_name: that.deptName},
|
query: { start_date: that.start_date, end_date: that.end_date, dept_name: that.deptName },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('productStatistic', obj).then((res) => {
|
that.$API.bi.dataset.exec.req('productStatistic', obj).then((res) => {
|
||||||
let list = res.data2.ds0;
|
let list = res.data2.ds0;
|
||||||
let PlanRate = [0,0,0,0,0,0,0];
|
let PlanRate = [0, 0, 0, 0, 0, 0, 0];
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
let date = item.年+'-'+item.月+'-'+item.日;
|
let date = item.年 + '-' + item.月 + '-' + item.日;
|
||||||
let index = this.weekDateList.indexOf(date);
|
let index = this.weekDateList.indexOf(date);
|
||||||
PlanRate[index] = Math.round((item.合格数/item.任务数)*100) ;
|
PlanRate[index] = Math.round((item.合格数 / item.任务数) * 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//柱状图折线
|
//柱状图折线
|
||||||
|
@ -734,7 +734,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
barWidth: 15,
|
barWidth: 15,
|
||||||
data:PlanRate,
|
data: PlanRate,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: [5, 5, 0, 0],
|
borderRadius: [5, 5, 0, 0],
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
@ -774,45 +774,45 @@ export default {
|
||||||
line3Chart.setOption(line3option);
|
line3Chart.setOption(line3option);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deptNameChange(deptName){
|
deptNameChange(deptName) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: that.start_date, end_date: that.end_date,dept_name: deptName},
|
query: { start_date: that.start_date, end_date: that.end_date, dept_name: deptName },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
||||||
let list = res.data2.ds0;
|
let list = res.data2.ds0;
|
||||||
let deptData = [];
|
let deptData = [];
|
||||||
if(list.length>0){
|
if (list.length > 0) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
if(that.deptName == '7车间'){
|
if (that.deptName == '7车间') {
|
||||||
that.dept7Data[0].value= that.dept7Data[0].value+item.炸纹;
|
that.dept7Data[0].value = that.dept7Data[0].value + item.炸纹;
|
||||||
that.dept7Data[1].value= that.dept7Data[1].value+item.条纹;
|
that.dept7Data[1].value = that.dept7Data[1].value + item.条纹;
|
||||||
that.dept7Data[2].value= that.dept7Data[2].value+item.气泡;
|
that.dept7Data[2].value = that.dept7Data[2].value + item.气泡;
|
||||||
that.dept7Data[3].value= that.dept7Data[3].value+item.弯曲;
|
that.dept7Data[3].value = that.dept7Data[3].value + item.弯曲;
|
||||||
that.dept7Data[4].value= that.dept7Data[4].value+item.其他;
|
that.dept7Data[4].value = that.dept7Data[4].value + item.其他;
|
||||||
that.dept7Data[5].value= that.dept7Data[5].value+item.合格数;
|
that.dept7Data[5].value = that.dept7Data[5].value + item.合格数;
|
||||||
deptData = that.dept7Data;
|
deptData = that.dept7Data;
|
||||||
}else{
|
} else {
|
||||||
that.dept10Data[0].value= that.dept10Data[0].value+item.弯曲;
|
that.dept10Data[0].value = that.dept10Data[0].value + item.弯曲;
|
||||||
that.dept10Data[1].value= that.dept10Data[1].value+item.大小头;
|
that.dept10Data[1].value = that.dept10Data[1].value + item.大小头;
|
||||||
that.dept10Data[2].value= that.dept10Data[2].value+item.偏壁;
|
that.dept10Data[2].value = that.dept10Data[2].value + item.偏壁;
|
||||||
that.dept10Data[3].value= that.dept10Data[3].value+item.结石;
|
that.dept10Data[3].value = that.dept10Data[3].value + item.结石;
|
||||||
that.dept10Data[4].value= that.dept10Data[4].value+item.气线;
|
that.dept10Data[4].value = that.dept10Data[4].value + item.气线;
|
||||||
that.dept10Data[5].value= that.dept10Data[5].value+item.合格数;
|
that.dept10Data[5].value = that.dept10Data[5].value + item.合格数;
|
||||||
deptData = that.dept10Data;
|
deptData = that.dept10Data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
if(that.deptName == '7车间'){
|
if (that.deptName == '7车间') {
|
||||||
deptData = that.dept7Data;
|
deptData = that.dept7Data;
|
||||||
}else{
|
} else {
|
||||||
deptData = that.dept10Data;
|
deptData = that.dept10Data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(deptData)
|
console.log(deptData)
|
||||||
that.deptData = deptData;
|
that.deptData = deptData;
|
||||||
that.pieoption.series.data = deptData;
|
that.pieoption.series.data = deptData;
|
||||||
let pieoption = that.pieoption;
|
let pieoption = that.pieoption;
|
||||||
let pieDom = document.getElementById('pie');
|
let pieDom = document.getElementById('pie');
|
||||||
let pieChart = echarts.init(pieDom);
|
let pieChart = echarts.init(pieDom);
|
||||||
pieChart.clear();
|
pieChart.clear();
|
||||||
|
@ -822,16 +822,16 @@ export default {
|
||||||
//库存情况
|
//库存情况
|
||||||
getMaterialList() {
|
getMaterialList() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.mtm.material.list.req({ page: 0, type: 10 }).then(res => {
|
this.$API.mtm.material.list.req({ page: 0, type: 10 }).then(res => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if(res.length>0){
|
if (res.length > 0) {
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let colorText='';
|
let colorText = '';
|
||||||
if(item.count_safe!==null&&item.count_safe<item.count){
|
if (item.count_safe !== null && item.count_safe < item.count) {
|
||||||
colorText='<span style="color:red;">'+item.count+'</span>'
|
colorText = '<span style="color:red;">' + item.count + '</span>'
|
||||||
}else{
|
} else {
|
||||||
colorText='<span style="color:green;">'+item.count+'</span>'
|
colorText = '<span style="color:green;">' + item.count + '</span>'
|
||||||
}
|
}
|
||||||
arr[0] = item.full_name;
|
arr[0] = item.full_name;
|
||||||
arr[1] = item.specification;//规格
|
arr[1] = item.specification;//规格
|
||||||
|
@ -841,9 +841,9 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
that.taskBoard.data = data;
|
that.taskBoard.data = data;
|
||||||
console.log('getMaterialList',data)
|
console.log('getMaterialList', data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showTime() {
|
showTime() {
|
||||||
this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss');
|
this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss');
|
||||||
this.currentWeek = this.$TOOL.dateFormat(new Date(), 'week');
|
this.currentWeek = this.$TOOL.dateFormat(new Date(), 'week');
|
||||||
|
@ -1142,28 +1142,29 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDeptDetail(name) {
|
getDeptDetail(name) {
|
||||||
|
let that = this;
|
||||||
if (this.currentObj.deptName == name && this.clickVisible) {
|
if (this.currentObj.deptName == name && this.clickVisible) {
|
||||||
this.dialogData.deptName = name;
|
this.dialogData.deptName = name;
|
||||||
} else {
|
} else {
|
||||||
this.infoVisibel = true;
|
this.infoVisibel = true;
|
||||||
this.dialogData.deptName = name;
|
this.dialogData.deptName = name;
|
||||||
}
|
}
|
||||||
let obj ={
|
let obj = {
|
||||||
query: {start_date:this.start_date,end_date:this.end_date,dept_name: name},
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: name },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req('lineDay', obj).then((res1) => {
|
that.$API.bi.dataset.exec.req('lineDay', obj).then((res1) => {
|
||||||
console.log('生产车间按日统计:',res1);
|
console.log('生产车间按日统计:', res1);
|
||||||
let list1 = res1.data2.ds0;
|
let list1 = res1.data2.ds0;
|
||||||
if(name=='6车间'){
|
if (name == '6车间') {
|
||||||
that.currentObj = list1[0];
|
that.currentObj = list1[0];
|
||||||
that.currentObj.rate = list1[0]
|
that.currentObj.rate = list1[0]
|
||||||
}else if(name=='7车间'||name=='10车间'){
|
} else if (name == '7车间' || name == '10车间') {
|
||||||
that.currentObj = list1[0];
|
that.currentObj = list1[0];
|
||||||
}else if(name=='8车间'){
|
} else if (name == '8车间') {
|
||||||
|
|
||||||
}
|
}
|
||||||
let seriesData1 = [],xAxisData1=[];
|
let seriesData1 = [], xAxisData1 = [];
|
||||||
|
|
||||||
debugger;
|
debugger;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1247,7 +1248,7 @@ export default {
|
||||||
bottom: '5%',
|
bottom: '5%',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
xAxis:{
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
|
@ -1257,19 +1258,19 @@ export default {
|
||||||
color: '#ffffff'
|
color: '#ffffff'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: "",
|
name: "",
|
||||||
type: 'value',
|
type: 'value',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: '#ffffff'
|
color: '#ffffff'
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: '#ffffff'
|
|
||||||
},
|
|
||||||
splitLine: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: '#ffffff'
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '预制棒',
|
name: '预制棒',
|
||||||
|
@ -1335,7 +1336,7 @@ export default {
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
data:that.countOkAVG
|
data: that.countOkAVG
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -1394,7 +1395,7 @@ export default {
|
||||||
bottom: '5%',
|
bottom: '5%',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
xAxis:{
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
|
@ -1432,14 +1433,14 @@ export default {
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
// 设置symbol的颜色
|
// 设置symbol的颜色
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: 'orange'
|
color: 'orange'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: 'yellow'
|
color: 'yellow'
|
||||||
}])
|
}])
|
||||||
},
|
},
|
||||||
smooth: 0.5, // 设置折线弧度
|
smooth: 0.5, // 设置折线弧度
|
||||||
data: that.countRateDept7,
|
data: that.countRateDept7,
|
||||||
|
@ -1468,14 +1469,14 @@ export default {
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
// 设置symbol的颜色
|
// 设置symbol的颜色
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: 'rgb(1,235,239)'
|
color: 'rgb(1,235,239)'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: 'rgb(5, 158, 163)'
|
color: 'rgb(5, 158, 163)'
|
||||||
}])
|
}])
|
||||||
},
|
},
|
||||||
smooth: 0.5, // 设置折线弧度
|
smooth: 0.5, // 设置折线弧度
|
||||||
data: that.countRateDept10,
|
data: that.countRateDept10,
|
||||||
|
@ -1520,60 +1521,60 @@ export default {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
name: '不合格占比',
|
name: '不合格占比',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: [30, 60],
|
radius: [30, 60],
|
||||||
center: ['50%', '45%'],
|
center: ['50%', '45%'],
|
||||||
// roseType: 'area',
|
// roseType: 'area',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: 2
|
borderRadius: 2
|
||||||
},
|
},
|
||||||
// label: {
|
// label: {
|
||||||
// fontSize: 12,
|
// fontSize: 12,
|
||||||
// alignTo: 'edge',
|
// alignTo: 'edge',
|
||||||
// formatter: '{b}\n',
|
// formatter: '{b}\n',
|
||||||
// edgeDistance: 10,
|
// edgeDistance: 10,
|
||||||
// lineHeight: 20,
|
// lineHeight: 20,
|
||||||
// rich: {
|
// rich: {
|
||||||
// title: {
|
// title: {
|
||||||
// fontSize: 12,
|
// fontSize: 12,
|
||||||
// color: '#999',
|
// color: '#999',
|
||||||
// lineHeight: 50,
|
// lineHeight: 50,
|
||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// labelLayout: function (params) {
|
// labelLayout: function (params) {
|
||||||
// var isLeft = params.labelRect.x < myChart.getWidth() / 2;
|
// var isLeft = params.labelRect.x < myChart.getWidth() / 2;
|
||||||
// var points = params.labelLinePoints;
|
// var points = params.labelLinePoints;
|
||||||
// points[2][0] = isLeft? params.labelRect.x: params.labelRect.x + params.labelRect.width;
|
// points[2][0] = isLeft? params.labelRect.x: params.labelRect.x + params.labelRect.width;
|
||||||
// return {
|
// return {
|
||||||
// labelLinePoints: points
|
// labelLinePoints: points
|
||||||
// };
|
// };
|
||||||
// },
|
// },
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
minMargin: 10,
|
minMargin: 10,
|
||||||
edgeDistance: 10,
|
edgeDistance: 10,
|
||||||
fontSize: '12px'
|
fontSize: '12px'
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
lineStyle: {
|
||||||
},
|
},
|
||||||
labelLine: {
|
length: 2,
|
||||||
lineStyle: {
|
length2: 5
|
||||||
},
|
},
|
||||||
length: 2,
|
labelLayout: function (params) {
|
||||||
length2: 5
|
var isLeft = params.labelRect.x < pieChart.getWidth() / 2
|
||||||
},
|
var points = params.labelLinePoints;
|
||||||
labelLayout: function (params) {
|
points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
|
||||||
var isLeft = params.labelRect.x < pieChart.getWidth() / 2
|
return {
|
||||||
var points = params.labelLinePoints;
|
labelLinePoints: points,
|
||||||
points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
|
dy: -10,
|
||||||
return {
|
dx: 0
|
||||||
labelLinePoints: points,
|
}
|
||||||
dy: -10,
|
},
|
||||||
dx: 0
|
data: that.deptData
|
||||||
}
|
}
|
||||||
},
|
|
||||||
data:that.deptData
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
that.pieoption = pieoption;
|
that.pieoption = pieoption;
|
||||||
pieChart.setOption(pieoption);
|
pieChart.setOption(pieoption);
|
||||||
|
|
Loading…
Reference in New Issue