This commit is contained in:
caoqianming 2023-12-21 15:11:32 +08:00
commit b1eef89d87
2 changed files with 121 additions and 93 deletions

View File

@ -20,27 +20,57 @@
<div class="countItem"> <div class="countItem">
<div class="countname">预制棒合格数</div> <div class="countname">预制棒合格数</div>
<p class="countnum">{{dayPassNum7}}</p> <p class="countnum">{{dayPassNum7}}</p>
<p class="countrate">同比前天<span class="redColor"> 8.63%</span></p> <p class="countrate">同比前天
<span :class="bindClass(tongbi7)">
{{tongbi7}}%
<span v-if="tongbi7<0"> </span>
<span v-else> </span>
</span>
</p>
</div> </div>
<div class="countItem"> <div class="countItem">
<div class="countname">预制管合格数</div> <div class="countname">预制管合格数</div>
<p class="countnum">{{dayPassNum10}}</p> <p class="countnum">{{dayPassNum10}}</p>
<p class="countrate">同比前天<span class="redColor"> 8.63%</span></p> <p class="countrate">同比前天
<span :class="bindClass(tongbi10)">
{{tongbi10}}%
<span v-if="tongbi10<0"> </span>
<span v-else> </span>
</span>
</p>
</div> </div>
<div class="countItem"> <div class="countItem">
<div class="countname">AVG合格数</div> <div class="countname">AVG合格数</div>
<p class="countnum">{{dayAVGcountOk}}</p> <p class="countnum">{{dayAVGcountOk}}</p>
<p class="countrate">同比前天<span class="greenColor"> 8.63%</span></p> <p class="countrate">同比前天
<span :class="bindClass(AVGOktongbi)">
{{AVGOktongbi}}%
<span v-if="AVGOktongbi<0"> </span>
<span v-else> </span>
</span>
</p>
</div> </div>
<div class="countItem"> <div class="countItem">
<div class="countname">预制棒管交付数</div> <div class="countname">预制棒管交付数</div>
<p class="countnum">{{ dayPayNum6 }}</p> <p class="countnum">{{ dayPayNum6 }}</p>
<p class="countrate">同比前天<span class="redColor"> 8.63%</span></p> <p class="countrate">同比前天
<span :class="bindClass(tongbi06)">
{{tongbi06}}%
<span v-if="tongbi06<0"> </span>
<span v-else> </span>
</span>
</p>
</div> </div>
<div class="countItem"> <div class="countItem">
<div class="countname">AVG交付数</div> <div class="countname">AVG交付数</div>
<p class="countnum">{{dayAVGcountDelivered}}</p> <p class="countnum">{{dayAVGcountDelivered}}</p>
<p class="countrate">同比前天<span class="redColor"> 8.63%</span></p> <p class="countrate">同比前天
<span :class="bindClass(AVGDelivertongbi)">
{{AVGDelivertongbi}}%
<span v-if="AVGDelivertongbi<0"> </span>
<span v-else> </span>
</span>
</p>
</div> </div>
</div> </div>
</div> </div>
@ -232,6 +262,7 @@ export default {
month_s: '', month_s: '',
deptName:'7车间', deptName:'7车间',
yesterday:'', yesterday:'',
yesterdayBefore:'',
yearData: [], yearData: [],
monthData: [], monthData: [],
warningNum: 0, warningNum: 0,
@ -247,17 +278,24 @@ export default {
40: '禁用', 40: '禁用',
}, },
dayPassNum7:0, dayPassNum7:0,
tongbi7:0,
dayPassNum10:0, dayPassNum10:0,
tongbi10:0,
dayPayNum6:0,// dayPayNum6:0,//
tongbi06:0,
monthPayNum6:0, monthPayNum6:0,
monthPassRate7:0, monthPassRate7:0,
monthPassRate10:0, monthPassRate10:0,
monthRateAVG:0,
dayAVGcountOk:0, dayAVGcountOk:0,
AVGOktongbi:0,
dayAVGcountDelivered:0, dayAVGcountDelivered:0,
AVGDelivertongbi:0,
monthRateAVG:0,
monthPayNumAVG:0, monthPayNumAVG:0,
option:{ option:{
grid: { // px grid: { // px
top: '5%', top: '5%',
@ -303,16 +341,29 @@ export default {
let yesterday = new Date(myDate.getTime()-24*60*60*1000); let yesterday = new Date(myDate.getTime()-24*60*60*1000);
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
let yesterdayBefore = new Date(yesterday.getTime()-24*60*60*1000);
this.yesterdayBefore = yesterdayBefore.getFullYear()+"-" + (yesterdayBefore.getMonth()+1) + "-" + yesterdayBefore.getDate();
that.getdayData(); that.getdayData();
that.getMonthData(); that.getMonthData();
this.getAVGDayData(); this.getAVGDayData();
// that.initChart();
this.calendarValue = new Date(); this.calendarValue = new Date();
this.getEquipList(); this.getEquipList();
this.getMaterialList(); this.getMaterialList();
this.getProductStatistic(); this.getProductStatistic();
}, },
methods: { methods: {
// Class
bindClass(rate) {
let classInfo = {
socketDom: true, redColor: false,greenColor: true
}
if (rate>0) {
classInfo.greenColor = true
}else if(rate<0){
classInfo.redColor = true
}
return classInfo
},
getEquipList() { getEquipList() {
this.$API.em.equipment.list.req({ page: 0, type: 10 }).then(res => { this.$API.em.equipment.list.req({ page: 0, type: 10 }).then(res => {
this.equipList = res this.equipList = res
@ -326,74 +377,15 @@ export default {
console.log('getMaterialList',res) console.log('getMaterialList',res)
}) })
}, },
// Class
bindClass(type) {
let classInfo = {
socketDom: true, redColor: false,
orangeColor: false, yellowColor: false, blueColor: true
}
if (type == '') {
classInfo.redColor = true
}
return classInfo
},
getMessage(msg) {
console.log(msg);
},
close() {
if (this.ws) {
this.ws.close();
this.ws = null;
console.log("socket已经关闭");
}
},
showTime() { showTime() {
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss') this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日') this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
}, },
interEvent() {
this.$router.replace({ path: '/events' })
},
interEquipment() { interEquipment() {
this.$router.replace({ path: '/em/equipmentc' }) this.$router.replace({ path: '/em/equipment' })
}, },
// initChart() { //
// //
// var dom = document.getElementById("barCharts");
// var myChart = echarts.init(dom);
// let option = {
// grid: { // px
// top: '5%',
// left: '1%',
// right: '1%',
// bottom: '5%',
// containLabel: true
// },
// xAxis: {
// type: 'category',
// axisLabel: {
// // show: false, // X
// },
// data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
// },
// yAxis: {
// type: 'value',
// axisLabel: {
// show: false, // X
// },
// },
// series: [{
// data: [10, 9, 8, 11, 12, 10, 9, 10, 8, 9, 10],
// type: 'bar',
// barMaxWidth: 50,
// itemStyle: {
// normal: { color: 'rgb(20, 141, 255)' }
// }
// }]
// };
// myChart.setOption(option, true);
// },
//&
getdayData(){ getdayData(){
let that = this; let that = this;
let date = that.yesterday; let date = that.yesterday;
@ -406,47 +398,58 @@ export default {
let obj10 ={ let obj10 ={
query: {start_date:date,end_date:date,dept_name: "10车间"}, query: {start_date:date,end_date:date,dept_name: "10车间"},
}; };
let date0 = that.yesterdayBefore;
let obj06 ={
query: {start_date:date0,end_date:date0},
};
let obj07 ={
query: {start_date:date0,end_date:date0,dept_name: "7车间"},
};
let obj010 ={
query: {start_date:date0,end_date:date0,dept_name: "10车间"},
};
//7 //7
that.$API.bi.dataset.exec.req('lineDay', obj7).then((res7) => { that.$API.bi.dataset.exec.req('lineDay', obj7).then((res7) => {
// console.log('7:',res7);
let list7 = res7.data2.ds0; let list7 = res7.data2.ds0;
let sum = 0;
if(list7.length>0){ if(list7.length>0){
list7.forEach(item => { this.dayPassNum7 = list7[0].合格数;
sum = sum+item.合格数;
});
} }
this.dayPassNum7 = sum; //7
// console.log('10:',this.dayPassNum7); that.$API.bi.dataset.exec.req('lineDay', obj07).then((res07) => {
// debugger; let list07 = res07.data2.ds0;
if(list07.length>0){
this.tongbi7 =Math.floor((this.dayPassNum7- list07[0].合格数)/list07[0].合格数*100);
}
});
}); });
//10 //10
that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => { that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => {
console.log('10车间昨日合格数:',res10);
let list10 = res10.data2.ds0; let list10 = res10.data2.ds0;
let sum = 0;
if(list10.length>0){ if(list10.length>0){
list10.forEach(item => { this.dayPassNum10 = list10[0].合格数;
sum = sum+item.合格数; //10
that.$API.bi.dataset.exec.req('lineDay', obj010).then((res010) => {
let list010 = res010.data2.ds0;
if(list010.length>0){
this.tongbi10 =Math.floor((this.dayPassNum10- list010[0].合格数)/list010[0].合格数*100);
}
}); });
} }
this.dayPassNum10 = sum;
// console.log('10:',this.dayPassNum10);
// debugger;
}); });
//6 //6
that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => { that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => {
// console.log('6:',res6);
let list6 = res6.data2.ds0; let list6 = res6.data2.ds0;
let sum = 0;
if(list6.length>0){ if(list6.length>0){
list6.forEach(item => { this.dayPayNum6 = list6[0].交付数;
sum = sum+item.交付数; //6
that.$API.bi.dataset.exec.req('saleOutDay', obj06).then((res06) => {
let list06 = res06.data2.ds0;
if(list06.length>0){
this.tongbi06 = Math.floor((this.dayPayNum6- list06[0].交付数)/list06[0].交付数*100);
}
}); });
} }
this.dayPayNum6 = sum;
// console.log('6:',this.dayPayNum6);
// debugger;
}); });
}, },
//& //&
@ -512,6 +515,7 @@ export default {
getAVGDayData(){ getAVGDayData(){
let that = this; let that = this;
let date = that.yesterday; let date = that.yesterday;
let date0 = that.yesterdayBefore;
this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date,handle_date__lte:date}).then(res=>{ this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date,handle_date__lte:date}).then(res=>{
let list = res; let list = res;
let count_ok = 0,count_delivered = 0; let count_ok = 0,count_delivered = 0;
@ -522,6 +526,18 @@ export default {
}) })
that.dayAVGcountOk = count_ok; that.dayAVGcountOk = count_ok;
that.dayAVGcountDelivered = count_delivered; that.dayAVGcountDelivered = count_delivered;
this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date0,handle_date__lte:date0}).then(res0=>{
let list0 = res0;
let count_ok0 = 0,count_delivered0 = 0;
if(list0.length>0){
list0.forEach(item0=>{
count_ok0=count_ok0+item0.count_ok;
count_delivered0 = count_delivered0+item0.count_delivered;
})
that.AVGOktongbi = Math.floor((count_ok-count_ok0)/count_ok0*100);
that.AVGDelivertongbi = Math.floor((count_delivered-count_delivered0)/count_delivered0*100);
}
})
} }
}) })
}, },

View File

@ -18,7 +18,7 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div style="height: 90%; padding: 8px"> <div style="height: 90%; padding: 8px">
<el-steps direction="vertical" active="20"> <el-steps direction="vertical" active="20" id="elSteps">
<el-step v-for="item in currentRoute" v-bind:key="item.id" :title="item.process_name" /> <el-step v-for="item in currentRoute" v-bind:key="item.id" :title="item.process_name" />
</el-steps> </el-steps>
</div> </div>
@ -236,3 +236,15 @@ export default {
} }
} }
</script> </script>
<style scope>
#elSteps .el-step.is-vertical .el-step__title{
width:40px!important;
}
#elSteps .el-step.is-vertical .el-step__main{
/* width:60px!important; */
flex-grow: unset!important;
}
#elSteps .el-step.is-vertical{
margin:auto!important;
}
</style>