7车间数据

This commit is contained in:
shijing 2024-01-22 17:54:35 +08:00
parent 410a55b411
commit c2d09a0fe1
1 changed files with 231 additions and 247 deletions

View File

@ -2,7 +2,7 @@
<el-container class="dashboard">
<el-header class="header">
<div style="font-weight: bold; font-family:'myfont';font-size:32px">7车间生产数据大看板</div>
<div style="font-size: 14px;margin-top:18px">{{currentDay}}{{ currentTime }}</div>
<div style="font-size: 14px;margin-top:18px">{{ currentDay }}{{ currentTime }}</div>
</el-header>
<el-main>
<el-row style="height: 60%" :gutter="10">
@ -13,13 +13,13 @@
</div>
<div style="height: 4px;"></div>
<div class="boxmain bigdata border" style="overflow:scroll">
<div v-for="item in todayMtask" :key="item.id" style="width:50%;display:inline-block; height: 40px;">
<span style="font-size:12px">{{item.material_out_name}}</span>
<div v-for="item in todayMtask" :key="item.id"
style="width:50%;display:inline-block; height: 40px;">
<span style="font-size:12px">{{ item.material_out_name }}</span>
<span style="color: #fef000;margin-left: 10px;font-weight:bold;font-family:electronicFont">
{{item.count}}
{{ item.count }}
</span>
</div>
</div>
</div>
<div style="height: 1%;"></div>
@ -45,8 +45,8 @@
</div>
<div style="height: 4px;"></div>
<div class="boxmain" id="scrollContainer2">
<scScrollTavle v-if="table2Visible" :tableHeight="containerHeight2"
:rowData="lineData" :titleData="liData2" :refValue="refValue2"></scScrollTavle>
<scScrollTavle v-if="table2Visible" :tableHeight="containerHeight2" :rowData="lineData"
:titleData="liData2" :refValue="refValue2"></scScrollTavle>
</div>
</div>
</el-col>
@ -92,7 +92,7 @@ function deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
}
export default {
components: {scScrollTavle},
components: { scScrollTavle },
data() {
return {
basicOption: {
@ -139,7 +139,7 @@ export default {
xAxis: {
type: 'category',
boundaryGap: true,
data: ['1号炉','2号炉', '3号炉', '4号炉', '5号炉', '6号炉', '7号炉', '8号炉'],
data: ['1号炉', '2号炉', '3号炉', '4号炉', '5号炉', '6号炉', '7号炉', '8号炉'],
nameTextStyle: {
color: '#ffffff'
},
@ -169,7 +169,7 @@ export default {
lineStyle: {
width: 1, color: 'rgb(1,235,239)'
},
barWidth:30,
barWidth: 30,
showSymbol: false,
areaStyle: {
opacity: 0.8,
@ -190,7 +190,7 @@ export default {
label: {
show: true,
position: 'top',
color:'#fff'
color: '#fff'
},
itemStyle: {
borderRadius: [2, 2, 0, 0],
@ -205,16 +205,16 @@ export default {
}
])
},
data: [140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250, 340, 250]
data: [140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 340, 250]
}]
},
chart3Option:{
chart3Option: {
backgroundColor: '',
tooltip: {
trigger: 'item'
},
legend: {
top:'bottom',
top: 'bottom',
},
series: {
name: '完成率',
@ -241,27 +241,27 @@ export default {
}
}
},
containerHeight1:100,
containerHeight2:100,
table1Visible:false,
table2Visible:false,
refValue1:'moocBox1',
refValue2:'moocBox2',
containerHeight1: 100,
containerHeight2: 100,
table1Visible: false,
table2Visible: false,
refValue1: 'moocBox1',
refValue2: 'moocBox2',
liData1: ['序号', '型号', '完成进度', '产量', '状态'],
processData:[],
liData2: ['序号', '炉号','产品名称', '型号', '规格', '最近产量','锅数','设备状态'],
lineData:[],
todayMtask:[],
processData: [],
liData2: ['序号', '炉号', '产品名称', '型号', '规格', '最近产量', '锅数', '设备状态'],
lineData: [],
todayMtask: [],
time: null,
delay: 20,
dayInterval:null,
days:30,
today:'',
start_date:'',
end_date:'',
currentTime:'',
currentDay:'',
yesterday:'',
dayInterval: null,
days: 30,
today: '',
start_date: '',
end_date: '',
currentTime: '',
currentDay: '',
yesterday: '',
chartInterval1: null,
chartInterval2: null,
chartInterval3: null,
@ -276,30 +276,30 @@ export default {
this.table2Visible = true;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth()+1;
let month = date.getMonth() + 1;
let day = date.getDate();
let days = new Date(year, month, 0).getDate();
this.days = days;
let start_date = year+'-'+month+'-01';
let start_date = year + '-' + month + '-01';
let lastDay = new Date(year, month, 0).getDate();
let end_date = year+'-'+month+'-'+lastDay;
let end_date = year + '-' + month + '-' + lastDay;
this.start_date = start_date;
this.end_date = end_date;
this.today = year+'-'+month+'-'+day;
let yesterday = new Date(date.getTime()-24*60*60*1000);
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
this.today = year + '-' + month + '-' + day;
let yesterday = new Date(date.getTime() - 24 * 60 * 60 * 1000);
this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate();
this.getProductLine();
this.getUtask();
this.getTodayMtask();
this.getLineData();
//
this.showTime()
this.dayInterval = setInterval(()=>{
this.dayInterval = setInterval(() => {
this.showTime()
},1000)
}, 1000)
},
methods: {
showTime(){
showTime() {
this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
this.currentDay = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
},
@ -319,22 +319,22 @@ export default {
}, 500)
},
//
getUtask(){
getUtask() {
let that = this;
let obj ={};
let obj = {};
obj.start_date__gte = this.start_date;
obj.end_date__lte = this.end_date;
obj.belong_dept__name='7车间';
obj.page=0;
obj.belong_dept__name = '7车间';
obj.page = 0;
that.$API.pm.utask.list.req(obj).then((res) => {
console.log('任务进度:',res);
console.log('任务进度:', res);
let processData = [];
res.forEach(item => {
let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {};
let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {};
obj1.elType = 'primary';
obj1.value = item.material_.specification;
obj2.elType = 'progress';
let process = Math.round((item.count_ok/item.count)*100)
let process = Math.round((item.count_ok / item.count) * 100)
obj2.value = process;
obj3.elType = 'primary';
obj3.value = item.count_ok;
@ -350,17 +350,17 @@ export default {
});
},
//7
getLineData(){
getLineData() {
let that = this;
that.$API.bi.dataset.exec.req('linedept7', {}).then((res) => {
console.log('7车间生产线:',res);
console.log('7车间生产线:', res);
let list = res.data2.ds0;
if(list.length>0){
if (list.length > 0) {
let lineData = [];
list.forEach(item => {
let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {},obj6 = {},obj7 = {};
let arr = [], obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}, obj5 = {}, obj6 = {}, obj7 = {};
obj1.elType = 'primary';
obj1.value = item.equip_name;//
obj1.value = item.equip_name + '|' + item.equip_number;//
obj2.elType = 'primary';
obj2.value = item.material_name;
obj3.elType = 'primary';
@ -388,62 +388,50 @@ export default {
});
},
//线
getProductLine(){
getProductLine() {
let that = this;
//
let obj1 ={
query: {start_date:that.start_date,end_date:that.end_date},
let obj1 = {
query: { start_date: that.start_date, end_date: that.end_date },
};
that.$API.bi.dataset.exec.req('stoveStatics', obj1).then((res1) => {
console.log('本月生产统计:',res1);
console.log('本月生产统计:', res1);
let list1 = res1.data2.ds0;
let seriesData1 = [],xAxisData1=[];
if(list1.length>0){
list1.forEach(item1=>{
xAxisData1.push(item1.equip_name);
let seriesData1 = [], xAxisData1 = [];
if (list1.length > 0) {
list1.forEach(item1 => {
xAxisData1.push(item1.equip_number);
seriesData1.push(item1.count_real);
})
}
let chart1Option = deepCopy(this.basicOption)
chart1Option.xAxis.data = xAxisData1;
chart1Option.series[0].data = seriesData1;
// chart1Option.yAxis.name='';
let chart1 = that.setChart("chart1", chart1Option);
// let index1 = 0
// this.chartInterval1 = setInterval(function () {
// if (index1 < seriesData1.length) {
// chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 });
// chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 });
// chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 });
// index1++;
// } else {
// index1 = 0;
// }
// }, 3000);
});
//
let obj2 ={
query: {start_date:that.start_date,end_date:that.end_date,dept_name: "7车间"},
let obj2 = {
query: { start_date: that.start_date, end_date: that.end_date, dept_name: "7车间" },
};
that.$API.bi.dataset.exec.req('lineDay', obj2).then((res2) => {
console.log('本月合格率统计:',res2);
console.log('本月合格率统计:', res2);
let list2 = res2.data2.ds0;
let seriesData2 = [],xAxisData2=[];
let seriesData2 = [], xAxisData2 = [];
for (let i = 0; i < that.days; i++) {
let day = i+1;
let text = day+'日';
xAxisData2[i]=text;
seriesData2[i]=0;
let day = i + 1;
let text = day + '日';
xAxisData2[i] = text;
seriesData2[i] = 0;
}
if(list2.length>0){
list2.forEach(item2=>{
let index2 = item2.-1;
seriesData2[index2] =Math.round(item2.合格率);
if (list2.length > 0) {
list2.forEach(item2 => {
let index2 = item2. - 1;
seriesData2[index2] = Math.round(item2.合格率);
})
}
let chart2Option = deepCopy(this.basicOption);
chart2Option.xAxis.data = xAxisData2;
chart2Option.yAxis.name='合格率';
chart2Option.yAxis.name = '合格率';
chart2Option.legend = {
icon: "stack",
right: 0,
@ -467,7 +455,7 @@ export default {
}
}],
};
let series2=[{
let series2 = [{
name: '合格率',
type: 'line',
smooth: true,
@ -494,7 +482,7 @@ export default {
label: {
show: true,
position: 'top',
color:'#fff'
color: '#fff'
},
itemStyle: {
borderRadius: [2, 2, 0, 0],
@ -511,27 +499,16 @@ export default {
},
data: seriesData2
}];
chart2Option.series=series2;
chart2Option.series = series2;
let chart2 = that.setChart("chart2", chart2Option);
// let index2 = 0
// this.chartInterval2 = setInterval(function () {
// if (index2 < seriesData2.length) {
// chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 });
// chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 });
// chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 });
// index2++;
// } else {
// index2 = 0;
// }
// }, 3000);
});
// 121
let obj3 ={
query: {start_date:that.yesterday,end_date:that.yesterday,dept_name: "7车间"},
let obj3 = {
query: { start_date: that.yesterday, end_date: that.yesterday, dept_name: "7车间" },
};
that.$API.bi.dataset.exec.req('lineDay', obj3).then((res3) => {
console.log('车间生产昨日统计:',res3);
console.log('车间生产昨日统计:', res3);
let seriesData3 = [
{ value: 0, name: '炸纹' },
{ value: 0, name: '条纹' },
@ -540,42 +517,31 @@ export default {
{ value: 0, name: '其他' },
{ value: 0, name: '合格' },
]
if(res3.data2.ds0.length>0){
if (res3.data2.ds0.length > 0) {
let item3 = res3.data2.ds0[0];
that.yesterdayObjet = item3;
seriesData3[0].value=item3.炸纹;
seriesData3[1].value=item3.条纹;
seriesData3[2].value=item3.气泡;
seriesData3[3].value=item3.弯曲;
seriesData3[4].value=item3.其他;
seriesData3[5].value=item3.合格数;
seriesData3[0].value = item3.炸纹;
seriesData3[1].value = item3.条纹;
seriesData3[2].value = item3.气泡;
seriesData3[3].value = item3.弯曲;
seriesData3[4].value = item3.其他;
seriesData3[5].value = item3.合格数;
}
that.chart3Option.series.data = seriesData3;
let chart3 = that.setChart("chart3", that.chart3Option);
// let index3 = 0
// this.chartInterval3 = setInterval(function () {
// if (index3 < seriesData3.length) {
// chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 });
// chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 });
// chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 });
// index3++;
// } else {
// index3 = 0;
// }
// }, 3000);
});
},
//
getTodayMtask(){
getTodayMtask() {
let that = this;
let obj ={};
let obj = {};
obj.start_date = this.today;
obj.end_date = this.today;
obj.belong_dept__name='7车间';
obj.page=0;
obj.belong_dept__name = '7车间';
obj.page = 0;
that.$API.pm.mtask.list.req(obj).then((res) => {
that.todayMtask=res;
console.log('今日任务:',res);
that.todayMtask = res;
console.log('今日任务:', res);
});
},
},
@ -583,17 +549,21 @@ export default {
}
</script>
<style scoped>
@font-face {
font-family: 'myfont'; /* 字体名称 */
src: url('../../utils/youShe.ttf'); /* 字体文件相对路径 */
}
.dashboard {
@font-face {
font-family: 'myfont';
/* 字体名称 */
src: url('../../utils/youShe.ttf');
/* 字体文件相对路径 */
}
.dashboard {
background-image: url("/public/img/photon_bg.png");
color: #fff;
font-family: "Microsoft Yahei" !important;
background-size: cover;
}
.header {
}
.header {
background: url("/public/img/photon_header.png");
border-bottom: none;
background-size: 100% 100%;
@ -604,73 +574,87 @@ export default {
font-family: 'Microsoft Yahei';
text-align: center;
padding: 12px 0px;
}.box {
}
.box {
background: rgba(10, 63, 68, 0.5);
height: 100%;
}
.boxtitle {
}
.boxtitle {
color: #fff;
font-size: 16px;
display: flex;
height: 36px;
background: linear-gradient(40deg, rgba(11, 101, 140, 0.451), rgba(0, 34, 48, 0.335), rgba(11, 101, 140, 0.451));
}
.bgimg {
}
.bgimg {
background-image: url('https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png');
background-size: 140% 100%;
}
.boxmain {
}
.boxmain {
height: calc(100% - 40px);
}
@media screen and (max-width: 800px) {
}
@media screen and (max-width: 800px) {
.boxmain {
height: 200px;
}
}
.flex_center {
}
.flex_center {
display: flex;
align-items: center;
justify-content: center
}
}
.border {
.border {
border: 1px dashed #49bcf7;
}
}
.bigdata {
.bigdata {
font-size: 24px;
}
.boxlabel {
}
.boxlabel {
margin-left: 6px;
font-size: 18px;
margin-top: 6px
}
.wrapper{
}
.wrapper {
overflow: hidden;
height: 220px;
}
.wrapper2{
}
.wrapper2 {
height: 180px;
overflow: hidden;
}
}
.title{
.title {
height: 40px;
line-height: 40px;
text-align: center;
}
.marquee_top{
}
.marquee_top {
transition: all 0.5s ease-in-out;
margin-top: -26px;
}
.totall{
}
.totall {
color: #fff;
background-color: rgb(10, 63, 68);
}
.rollData{
}
.rollData {
background-color: rgb(10, 39, 50);
}
.rollData:nth-of-type(2n+1){
}
.rollData:nth-of-type(2n+1) {
background-color: rgb(0, 59, 81);
}
}
</style>