#113&6车间合格率小数位问题
This commit is contained in:
parent
10376bbbdf
commit
6c73fda22e
|
@ -83,7 +83,7 @@
|
|||
<div class="blockTitle">
|
||||
<div class="blockTitleIcon"></div>
|
||||
<div>本周不合格占比</div>
|
||||
<el-radio-group v-model="deptName" @change="deptNameChange">
|
||||
<el-radio-group v-model="deptName">
|
||||
<el-radio label="7车间">7车间</el-radio>
|
||||
<el-radio label="10车间">10车间</el-radio>
|
||||
</el-radio-group>
|
||||
|
@ -355,7 +355,18 @@ export default {
|
|||
} else {
|
||||
that.deptName = '10车间'
|
||||
}
|
||||
that.deptNameChange(that.deptName);
|
||||
let deptData = [];
|
||||
if (that.deptName == '7车间') {
|
||||
deptData = that.dept7Data;
|
||||
} else {
|
||||
deptData = that.dept10Data;
|
||||
}
|
||||
that.pieoption.series.data = deptData;
|
||||
let pieoption = that.pieoption;
|
||||
let pieDom = document.getElementById('pie');
|
||||
let pieChart = echarts.init(pieDom);
|
||||
pieChart.clear();
|
||||
pieChart.setOption(pieoption, true);
|
||||
}, 5000);
|
||||
|
||||
that.initChart();
|
||||
|
@ -363,24 +374,23 @@ export default {
|
|||
//一天的毫秒数
|
||||
const ondDayTime = 86400000
|
||||
let cDate = new Date();
|
||||
|
||||
let week = cDate.getDay();//当前时间的week数
|
||||
let yesterday = new Date(cDate.getTime()-ondDayTime);
|
||||
let week = yesterday.getDay();//当前时间的week数
|
||||
// let time = ' 星期' + '日一二三四五六'.charAt(week);//当前时间周几
|
||||
let weekFirst = week - 1;//第一天对应的天数
|
||||
let weekLast = 7 - week;//最后一天对应的天数
|
||||
let first = new Date(new Date(cDate.getTime() - (weekFirst * ondDayTime)));//本周周一
|
||||
let last = new Date(new Date(cDate.getTime() + (weekLast * ondDayTime)));//本周周日
|
||||
let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//本周周一
|
||||
let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//本周周日
|
||||
let dateArr = [];
|
||||
for(let i=0;i<7;i++){
|
||||
let itemDate = new Date(first.getTime()+i*ondDayTime);
|
||||
let item = itemDate.getDate();
|
||||
dateArr.push(item);
|
||||
}
|
||||
console.log('weekDateList',dateArr)
|
||||
this.weekDateList = dateArr;
|
||||
this.start_date = first.getFullYear() + '-' + (first.getMonth() + 1) + '-' + first.getDate();
|
||||
this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate();
|
||||
let yesterday = new Date(cDate.getTime()-ondDayTime);
|
||||
// let yesterday = new Date(cDate.getTime()-ondDayTime);
|
||||
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
|
||||
this.getsaleOut();
|
||||
this.getPlanRate();
|
||||
|
@ -785,51 +795,50 @@ export default {
|
|||
line3Chart.setOption(line3option);
|
||||
})
|
||||
},
|
||||
deptNameChange(deptName) {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: { start_date: that.start_date, end_date: that.end_date, dept_name: deptName },
|
||||
};
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let deptData = [];
|
||||
if (list.length > 0) {
|
||||
list.forEach(item => {
|
||||
if (that.deptName == '7车间') {
|
||||
that.dept7Data[0].value = that.dept7Data[0].value + item.炸纹;
|
||||
that.dept7Data[1].value = that.dept7Data[1].value + item.条纹;
|
||||
that.dept7Data[2].value = that.dept7Data[2].value + item.气泡;
|
||||
that.dept7Data[3].value = that.dept7Data[3].value + item.弯曲;
|
||||
that.dept7Data[4].value = that.dept7Data[4].value + item.其他;
|
||||
that.dept7Data[5].value = that.dept7Data[5].value + item.合格数;
|
||||
deptData = that.dept7Data;
|
||||
} else {
|
||||
that.dept10Data[0].value = that.dept10Data[0].value + item.弯曲;
|
||||
that.dept10Data[1].value = that.dept10Data[1].value + item.大小头;
|
||||
that.dept10Data[2].value = that.dept10Data[2].value + item.偏壁;
|
||||
that.dept10Data[3].value = that.dept10Data[3].value + item.结石;
|
||||
that.dept10Data[4].value = that.dept10Data[4].value + item.气线;
|
||||
that.dept10Data[5].value = that.dept10Data[5].value + item.合格数;
|
||||
deptData = that.dept10Data;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (that.deptName == '7车间') {
|
||||
deptData = that.dept7Data;
|
||||
} else {
|
||||
deptData = that.dept10Data;
|
||||
}
|
||||
}
|
||||
console.log(deptData)
|
||||
that.deptData = deptData;
|
||||
that.pieoption.series.data = deptData;
|
||||
let pieoption = that.pieoption;
|
||||
let pieDom = document.getElementById('pie');
|
||||
let pieChart = echarts.init(pieDom);
|
||||
pieChart.clear();
|
||||
pieChart.setOption(pieoption, true);
|
||||
});
|
||||
},
|
||||
// deptNameChange(deptName) {
|
||||
// let that = this;
|
||||
// let obj = {
|
||||
// query: { start_date: that.start_date, end_date: that.end_date, dept_name: deptName },
|
||||
// };
|
||||
// that.$API.bi.dataset.exec.req('lineDay', obj).then((res) => {
|
||||
// let list = res.data2.ds0;
|
||||
// let deptData = [];
|
||||
// if (list.length > 0) {
|
||||
// list.forEach(item => {
|
||||
// if (that.deptName == '7车间') {
|
||||
// that.dept7Data[0].value = that.dept7Data[0].value + item.炸纹;
|
||||
// that.dept7Data[1].value = that.dept7Data[1].value + item.条纹;
|
||||
// that.dept7Data[2].value = that.dept7Data[2].value + item.气泡;
|
||||
// that.dept7Data[3].value = that.dept7Data[3].value + item.弯曲;
|
||||
// that.dept7Data[4].value = that.dept7Data[4].value + item.其他;
|
||||
// that.dept7Data[5].value = that.dept7Data[5].value + item.合格数;
|
||||
// deptData = that.dept7Data;
|
||||
// } else {
|
||||
// that.dept10Data[0].value = that.dept10Data[0].value + item.弯曲;
|
||||
// that.dept10Data[1].value = that.dept10Data[1].value + item.大小头;
|
||||
// that.dept10Data[2].value = that.dept10Data[2].value + item.偏壁;
|
||||
// that.dept10Data[3].value = that.dept10Data[3].value + item.结石;
|
||||
// that.dept10Data[4].value = that.dept10Data[4].value + item.气线;
|
||||
// that.dept10Data[5].value = that.dept10Data[5].value + item.合格数;
|
||||
// deptData = that.dept10Data;
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// if (that.deptName == '7车间') {
|
||||
// deptData = that.dept7Data;
|
||||
// } else {
|
||||
// deptData = that.dept10Data;
|
||||
// }
|
||||
// }
|
||||
// that.deptData = deptData;
|
||||
// that.pieoption.series.data = deptData;
|
||||
// let pieoption = that.pieoption;
|
||||
// let pieDom = document.getElementById('pie');
|
||||
// let pieChart = echarts.init(pieDom);
|
||||
// pieChart.clear();
|
||||
// pieChart.setOption(pieoption, true);
|
||||
// });
|
||||
// },
|
||||
//库存情况
|
||||
getMaterialList() {
|
||||
let that = this;
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
|
||||
<el-table-column label="完成率" prop="count">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.count != 0">{{ (scope.row.count_ok / scope.row.count) * 100 }}</span>
|
||||
<span v-if="scope.row.count != 0&&scope.row.count_ok!= 0">{{ Math.round((scope.row.count_ok / scope.row.count) * 100) }}%</span>
|
||||
<span v-else>0</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
|
|
|
@ -122,8 +122,8 @@
|
|||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option label="是" value="true"/>
|
||||
<el-option label="否" value="false"/>
|
||||
<el-option label="是" :value="true"/>
|
||||
<el-option label="否" :value="false"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -225,7 +225,7 @@ export default {
|
|||
this.$API.mtm.process.list.req({page:0}).then(res=>{
|
||||
let arr = [];
|
||||
res.forEach(item => {
|
||||
if(item.name.indexOf('磨')>-1){
|
||||
if(item.name=='粗中细磨'){
|
||||
arr.push(item);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
<el-drawer
|
||||
title="成品检验"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
size="80%"
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
|
@ -114,7 +114,7 @@
|
|||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
|
Loading…
Reference in New Issue