Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
8fa81f1f76
|
|
@ -0,0 +1,714 @@
|
|||
<template>
|
||||
<el-container class="dashboard">
|
||||
<el-header class="header">
|
||||
<div class="title">倒角车间生产数据看板</div>
|
||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<!-- 倒角 -->
|
||||
<el-row style="height: 60%" :gutter="10">
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<!-- 设备状态 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
设备状态
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon yxicon"></span>
|
||||
<span>运行中</span>
|
||||
<span class="eqNum">{{hh.yx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon wyxIcon"></span>
|
||||
<span>未运行</span>
|
||||
<span class="eqNum">{{hh.wyx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon gzIcon"></span>
|
||||
<span>故障</span>
|
||||
<span class="eqNum">{{hh.gz}}台</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 库存 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
倒角车间库存
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">生产数统计</div>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem">日投产量</span>
|
||||
<span class="totalStaticItem">日加工数</span>
|
||||
<span class="totalStaticItem">日加工前不良</span>
|
||||
<span class="totalStaticItem">日合格数</span>
|
||||
<span class="totalStaticItem">日不合格数</span>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||
</div>
|
||||
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 0.3%"></div>
|
||||
<!-- 生产统计 分析 -->
|
||||
<div style="height: 0.3%"></div>
|
||||
<el-row style="height: 39%" :gutter="10">
|
||||
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">合格数统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 饼状图 各不合格品 原因占比 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">不合格占比统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
barOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "2%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: true,
|
||||
data: [],
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "",
|
||||
type: "value",
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
type: "dashed", //y轴分割线类型
|
||||
color: "rgba(102,102,102,0.9)",
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "加工数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格率",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
pieOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
orient: 'vertical',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
series: {
|
||||
name: '不合格占比',
|
||||
type: 'pie',
|
||||
radius: ['1%', '60%'],
|
||||
center: ['35%', '50%'],
|
||||
label: false,
|
||||
data: []
|
||||
}
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
hh:{
|
||||
yx:0,
|
||||
wyx:0,
|
||||
gz:0,
|
||||
},
|
||||
sctj:{
|
||||
rtcs:0,
|
||||
rjgs:0,
|
||||
rjgqbls:0,
|
||||
rhgs:0,
|
||||
rbhgs:0,
|
||||
},
|
||||
dayInterval: null,
|
||||
chartInterval1: null,
|
||||
chartInterval2: null,
|
||||
//库存
|
||||
configDataInm:{
|
||||
header:['物料名称','批次号','数量','生产中'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
//设备
|
||||
configDataEq:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//生产统计
|
||||
configDatas :{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['日期','加工数','合格数','不合格数'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
page:1,
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
mgroups:[],
|
||||
daysList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.page = 1;
|
||||
that.configDataInm.data = [];
|
||||
//表格table的高度
|
||||
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
//近七天的日期数组
|
||||
let daysArr = this.getMondayOfCurrentWeek();
|
||||
this.daysArr = daysArr;
|
||||
let xAxisData = [];
|
||||
daysArr.forEach((item)=>{
|
||||
let dates = item.split('-');
|
||||
let obj = dates[1]+'-'+dates[2];
|
||||
xAxisData.push(obj);
|
||||
let dayitem = Number(dates[2]);
|
||||
that.daysList.push(dayitem);
|
||||
})
|
||||
that.today = new Date().toISOString().split('T')[0]
|
||||
this.xAxisData = xAxisData;
|
||||
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
|
||||
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||
this.start_time = start_time;
|
||||
this.end_time = end_time;
|
||||
this.$nextTick(() => {
|
||||
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'倒角车间'}).then((res) => {
|
||||
that.mgroups = res;
|
||||
that.configDataEq.data = [];
|
||||
res.forEach((item)=>{
|
||||
//设备数据
|
||||
that.getEqState(item.id);
|
||||
})
|
||||
})
|
||||
this.getMaterials(that.page);
|
||||
//投产/生产分析
|
||||
this.getProductLine();
|
||||
this.getCountnotok();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMondayOfCurrentWeek() {
|
||||
let today = new Date();
|
||||
let days = [];
|
||||
for (let i = 6; i >= 0; i--) {
|
||||
let date = new Date(today);
|
||||
date.setDate(today.getDate() - i);
|
||||
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||
}
|
||||
return days;
|
||||
},
|
||||
//时间
|
||||
showTime() {
|
||||
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||
this.currentDay = this.$TOOL.dateFormat(
|
||||
new Date(),
|
||||
"yyyy年MM月dd日"
|
||||
);
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||
if (myChart == undefined) {
|
||||
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||
renderer: "svg",
|
||||
});
|
||||
}
|
||||
if (option == null) {
|
||||
option = Object.assign({}, this.barOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
//生产统计
|
||||
getProductLine() {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'倒角车间'},
|
||||
};
|
||||
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||
}
|
||||
if (list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
let dateNow = new Date().getDate();
|
||||
if(item.日 == dateNow){
|
||||
that.sctj.rtcs = item.总重量;
|
||||
that.sctj.rjgs = item.生产数;
|
||||
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||
that.sctj.rhgs = item.合格数;
|
||||
that.sctj.rbhgs = item.不合格数;
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||
arr[1] = item.生产数;
|
||||
arr[2] = item.合格数;
|
||||
arr[3] = item.不合格数;
|
||||
that.configDatas.data.push(arr);
|
||||
|
||||
let indexs = that.daysList.indexOf(item.日);
|
||||
seriesData0[indexs] = item.生产数;
|
||||
seriesData1[indexs] = item.合格数;
|
||||
seriesData2[indexs] = item.合格率;
|
||||
});
|
||||
}
|
||||
that.barOption.xAxis.data = that.xAxisData;
|
||||
that.barOption.series[0].data = seriesData0;
|
||||
that.barOption.series[1].data = seriesData1;
|
||||
that.barOption.series[2].data = seriesData2;
|
||||
let chart1 = this.setChart("chart1", that.barOption);
|
||||
let index1 = 0;
|
||||
this.chartInterval1 = setInterval(function () {
|
||||
if (index1 < that.barOption.series[0].data.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);
|
||||
});
|
||||
},
|
||||
//不合格分布
|
||||
getCountnotok(){
|
||||
let that = this;
|
||||
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||
let seriesData = [];
|
||||
if(res.data2.ds0){
|
||||
res.data2.ds0.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.name = item.不合格项;
|
||||
obj.value = item.数量;
|
||||
seriesData.push(obj);
|
||||
})
|
||||
}
|
||||
that.pieOption.series.data = seriesData;
|
||||
let index2 = 0;
|
||||
let chart2 = this.setChart("chart2", that.pieOption);
|
||||
this.chartInterval2 = setInterval(function () {
|
||||
if (index2 < that.barOption.series[0].data.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);
|
||||
})
|
||||
},
|
||||
//设备状态
|
||||
getEqState(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||
that.hh.bw = res.保温;
|
||||
that.hh.lq = res.冷却;
|
||||
that.hh.yx = res.运行;
|
||||
that.hh.wyx = res.未运行;
|
||||
that.hh.gz = res.故障;
|
||||
let nowTime = new Date(res.now).getTime();
|
||||
if(res.rows.length>0){
|
||||
res.rows.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
if(item.mstate=='冷却'){
|
||||
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||
}else if(item.mstate=='未运行'){
|
||||
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||
}else if(item.mstate=='故障'){
|
||||
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||
}
|
||||
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||
item.reminder_interval_list.forEach(item=>{
|
||||
sumTime += item;
|
||||
})
|
||||
let startTime = new Date(item.work_start_time).getTime();
|
||||
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||
process = Math.round((workTime/sumTime)*100);
|
||||
process = process>100?'100%':process+'%';
|
||||
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||
if(bwSaveTime>0){
|
||||
saveTime = bwSaveTime;
|
||||
}else{
|
||||
saveTime = 0;
|
||||
}
|
||||
}else{
|
||||
process = '';
|
||||
saveTime = '';
|
||||
}
|
||||
arr[3] = process;
|
||||
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||
that.configDataEq.data.push(arr);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getMaterials(page) {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'倒角A,倒角B' }).then((res) => {
|
||||
if(res.results.length>0){
|
||||
res.results.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.batch;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_working;
|
||||
that.configDataInm.data.push(arr);
|
||||
})
|
||||
if(res.count>that.configDataInm.data.length){
|
||||
that.page++;
|
||||
that.getMaterials(that.page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@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 {
|
||||
background: url("/public/img/photon_header.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
font-size: 26px;
|
||||
display: block;
|
||||
height: 80px;
|
||||
color: rgb(149, 255, 255);
|
||||
font-family: "Microsoft Yahei";
|
||||
text-align: center;
|
||||
padding: 12px 0px;
|
||||
}
|
||||
.header > .title {
|
||||
font-weight: bold;
|
||||
font-family: "myfont";
|
||||
font-size: 32px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.box {
|
||||
background: rgba(10, 63, 68, 0.5);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.boxtitle {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
line-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 {
|
||||
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||
background-size: 140% 100%;
|
||||
}
|
||||
|
||||
.boxlabel {
|
||||
margin-left: 6px;
|
||||
font-size: 18px;
|
||||
/* margin-top: 6px; */
|
||||
}
|
||||
.stateIcon{
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin: 0 5px;
|
||||
border-radius: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
.bwIcon{
|
||||
background-color: rgb(245, 196, 0);
|
||||
}
|
||||
.lqIcon,.yxicon{
|
||||
background-color: rgb(0,163,245);
|
||||
}
|
||||
.wyxIcon{
|
||||
background-color: rgb(69,176,118);
|
||||
}
|
||||
.gzIcon{
|
||||
background-color: rgb(222,60,54);
|
||||
}
|
||||
.eqNum{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.boxmain {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.boxmain.boxmainbottom{
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
.boxmain.boxmainTopRight{
|
||||
height: calc(100% - 120px);
|
||||
}
|
||||
.lineDiv {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.boxmainItemNumber {
|
||||
color: rgb(42,234,200);
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
font-face:24px;
|
||||
font-family: electronicFont;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.boxmain {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex_center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px dashed #49bcf7;
|
||||
}
|
||||
|
||||
.bigdata {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.marquee_top {
|
||||
transition: all 0.5s ease-in-out;
|
||||
margin-top: -26px;
|
||||
}
|
||||
|
||||
.totall {
|
||||
color: #fff;
|
||||
background-color: rgb(10, 63, 68);
|
||||
}
|
||||
|
||||
.rollData {
|
||||
background-color: rgb(10, 39, 50);
|
||||
}
|
||||
|
||||
.rollData:nth-of-type(2n + 1) {
|
||||
background-color: rgb(0, 59, 81);
|
||||
}
|
||||
.halfBox {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.totalStatic{
|
||||
display: flex;
|
||||
}
|
||||
.totalStaticItem{
|
||||
flex: 1;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.totalStaticItemNum{
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-family: "myfont";
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
color: rgb(149, 255, 255);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,715 @@
|
|||
<template>
|
||||
<el-container class="dashboard">
|
||||
<el-header class="header">
|
||||
<div class="title">多线切车间生产数据看板</div>
|
||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<!-- 多线切 -->
|
||||
<el-row style="height: 60%" :gutter="10">
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<!-- 设备状态 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
设备状态
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon yxicon"></span>
|
||||
<span>运行中</span>
|
||||
<span class="eqNum">{{hh.yx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon wyxIcon"></span>
|
||||
<span>未运行</span>
|
||||
<span class="eqNum">{{hh.wyx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon gzIcon"></span>
|
||||
<span>故障</span>
|
||||
<span class="eqNum">{{hh.gz}}台</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 库存 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
多线切车间库存
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">生产数统计</div>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem">日投产量</span>
|
||||
<span class="totalStaticItem">日加工数</span>
|
||||
<span class="totalStaticItem">日加工前不良</span>
|
||||
<span class="totalStaticItem">日合格数</span>
|
||||
<span class="totalStaticItem">日不合格数</span>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||
</div>
|
||||
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 0.3%"></div>
|
||||
<!-- 生产统计 分析 -->
|
||||
<div style="height: 0.3%"></div>
|
||||
<el-row style="height: 39%" :gutter="10">
|
||||
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">合格数统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 饼状图 各不合格品 原因占比 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">不合格占比统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
barOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "2%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: true,
|
||||
data: [],
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "",
|
||||
type: "value",
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
type: "dashed", //y轴分割线类型
|
||||
color: "rgba(102,102,102,0.9)",
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "加工数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格率",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
pieOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
orient: 'vertical',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
series: {
|
||||
name: '不合格占比',
|
||||
type: 'pie',
|
||||
radius: ['1%', '60%'],
|
||||
center: ['35%', '50%'],
|
||||
label: false,
|
||||
data: []
|
||||
}
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
hh:{
|
||||
yx:0,
|
||||
wyx:0,
|
||||
gz:0,
|
||||
},
|
||||
sctj:{
|
||||
rtcs:0,
|
||||
rjgs:0,
|
||||
rjgqbls:0,
|
||||
rhgs:0,
|
||||
rbhgs:0,
|
||||
},
|
||||
dayInterval: null,
|
||||
chartInterval1: null,
|
||||
chartInterval2: null,
|
||||
//库存
|
||||
configDataInm:{
|
||||
header:['物料名称','批次号','数量','生产中'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
//设备
|
||||
configDataEq:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//生产统计
|
||||
configDatas :{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['日期','加工数','合格数','不合格数'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
page:1,
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
mgroups:[],
|
||||
daysList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.page = 1;
|
||||
that.configDataInm.data = [];
|
||||
//表格table的高度
|
||||
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
//近七天的日期数组
|
||||
let daysArr = this.getMondayOfCurrentWeek();
|
||||
this.daysArr = daysArr;
|
||||
let xAxisData = [];
|
||||
daysArr.forEach((item)=>{
|
||||
let dates = item.split('-');
|
||||
let obj = dates[1]+'-'+dates[2];
|
||||
xAxisData.push(obj);
|
||||
let dayitem = Number(dates[2]);
|
||||
that.daysList.push(dayitem);
|
||||
})
|
||||
that.today = new Date().toISOString().split('T')[0]
|
||||
// console.log('new Date', new Date().toISOString().split('T'))
|
||||
this.xAxisData = xAxisData;
|
||||
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
|
||||
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||
this.start_time = start_time;
|
||||
this.end_time = end_time;
|
||||
this.$nextTick(() => {
|
||||
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'多线切车间'}).then((res) => {
|
||||
that.mgroups = res;
|
||||
that.configDataEq.data = [];
|
||||
res.forEach((item)=>{
|
||||
//设备数据
|
||||
that.getEqState(item.id);
|
||||
})
|
||||
})
|
||||
this.getMaterials(that.page);
|
||||
//投产/生产分析
|
||||
this.getProductLine();
|
||||
this.getCountnotok();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMondayOfCurrentWeek() {
|
||||
let today = new Date();
|
||||
let days = [];
|
||||
for (let i = 6; i >= 0; i--) {
|
||||
let date = new Date(today);
|
||||
date.setDate(today.getDate() - i);
|
||||
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||
}
|
||||
return days;
|
||||
},
|
||||
//时间
|
||||
showTime() {
|
||||
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||
this.currentDay = this.$TOOL.dateFormat(
|
||||
new Date(),
|
||||
"yyyy年MM月dd日"
|
||||
);
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||
if (myChart == undefined) {
|
||||
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||
renderer: "svg",
|
||||
});
|
||||
}
|
||||
if (option == null) {
|
||||
option = Object.assign({}, this.barOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
//生产统计
|
||||
getProductLine() {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'多线切车间'},
|
||||
};
|
||||
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||
}
|
||||
if (list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
let dateNow = new Date().getDate();
|
||||
if(item.日 == dateNow){
|
||||
that.sctj.rtcs = item.总重量;
|
||||
that.sctj.rjgs = item.生产数;
|
||||
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||
that.sctj.rhgs = item.合格数;
|
||||
that.sctj.rbhgs = item.不合格数;
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||
arr[1] = item.生产数;
|
||||
arr[2] = item.合格数;
|
||||
arr[3] = item.不合格数;
|
||||
that.configDatas.data.push(arr);
|
||||
|
||||
let indexs = that.daysList.indexOf(item.日);
|
||||
seriesData0[indexs] = item.生产数;
|
||||
seriesData1[indexs] = item.合格数;
|
||||
seriesData2[indexs] = item.合格率;
|
||||
});
|
||||
}
|
||||
that.barOption.xAxis.data = that.xAxisData;
|
||||
that.barOption.series[0].data = seriesData0;
|
||||
that.barOption.series[1].data = seriesData1;
|
||||
that.barOption.series[2].data = seriesData2;
|
||||
let chart1 = this.setChart("chart1", that.barOption);
|
||||
let index1 = 0;
|
||||
this.chartInterval1 = setInterval(function () {
|
||||
if (index1 < that.barOption.series[0].data.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);
|
||||
});
|
||||
},
|
||||
//不合格分布
|
||||
getCountnotok(){
|
||||
let that = this;
|
||||
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||
let seriesData = [];
|
||||
if(res.data2.ds0){
|
||||
res.data2.ds0.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.name = item.不合格项;
|
||||
obj.value = item.数量;
|
||||
seriesData.push(obj);
|
||||
})
|
||||
}
|
||||
that.pieOption.series.data = seriesData;
|
||||
let index2 = 0;
|
||||
let chart2 = this.setChart("chart2", that.pieOption);
|
||||
this.chartInterval2 = setInterval(function () {
|
||||
if (index2 < that.barOption.series[0].data.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);
|
||||
})
|
||||
},
|
||||
//设备状态
|
||||
getEqState(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||
that.hh.bw = res.保温;
|
||||
that.hh.lq = res.冷却;
|
||||
that.hh.yx = res.运行;
|
||||
that.hh.wyx = res.未运行;
|
||||
that.hh.gz = res.故障;
|
||||
let nowTime = new Date(res.now).getTime();
|
||||
if(res.rows.length>0){
|
||||
res.rows.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
if(item.mstate=='冷却'){
|
||||
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||
}else if(item.mstate=='未运行'){
|
||||
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||
}else if(item.mstate=='故障'){
|
||||
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||
}
|
||||
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||
item.reminder_interval_list.forEach(item=>{
|
||||
sumTime += item;
|
||||
})
|
||||
let startTime = new Date(item.work_start_time).getTime();
|
||||
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||
process = Math.round((workTime/sumTime)*100);
|
||||
process = process>100?'100%':process+'%';
|
||||
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||
if(bwSaveTime>0){
|
||||
saveTime = bwSaveTime;
|
||||
}else{
|
||||
saveTime = 0;
|
||||
}
|
||||
}else{
|
||||
process = '';
|
||||
saveTime = '';
|
||||
}
|
||||
arr[3] = process;
|
||||
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||
that.configDataEq.data.push(arr);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getMaterials(page) {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'减薄A,减薄B' }).then((res) => {
|
||||
if(res.results.length>0){
|
||||
res.results.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.batch;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_working;
|
||||
that.configDataInm.data.push(arr);
|
||||
})
|
||||
if(res.count>that.configDataInm.data.length){
|
||||
that.page++;
|
||||
that.getMaterials(that.page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@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 {
|
||||
background: url("/public/img/photon_header.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
font-size: 26px;
|
||||
display: block;
|
||||
height: 80px;
|
||||
color: rgb(149, 255, 255);
|
||||
font-family: "Microsoft Yahei";
|
||||
text-align: center;
|
||||
padding: 12px 0px;
|
||||
}
|
||||
.header > .title {
|
||||
font-weight: bold;
|
||||
font-family: "myfont";
|
||||
font-size: 32px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.box {
|
||||
background: rgba(10, 63, 68, 0.5);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.boxtitle {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
line-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 {
|
||||
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||
background-size: 140% 100%;
|
||||
}
|
||||
|
||||
.boxlabel {
|
||||
margin-left: 6px;
|
||||
font-size: 18px;
|
||||
/* margin-top: 6px; */
|
||||
}
|
||||
.stateIcon{
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin: 0 5px;
|
||||
border-radius: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
.bwIcon{
|
||||
background-color: rgb(245, 196, 0);
|
||||
}
|
||||
.lqIcon,.yxicon{
|
||||
background-color: rgb(0,163,245);
|
||||
}
|
||||
.wyxIcon{
|
||||
background-color: rgb(69,176,118);
|
||||
}
|
||||
.gzIcon{
|
||||
background-color: rgb(222,60,54);
|
||||
}
|
||||
.eqNum{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.boxmain {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.boxmain.boxmainbottom{
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
.boxmain.boxmainTopRight{
|
||||
height: calc(100% - 120px);
|
||||
}
|
||||
.lineDiv {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.boxmainItemNumber {
|
||||
color: rgb(42,234,200);
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
font-face:24px;
|
||||
font-family: electronicFont;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.boxmain {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex_center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px dashed #49bcf7;
|
||||
}
|
||||
|
||||
.bigdata {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.marquee_top {
|
||||
transition: all 0.5s ease-in-out;
|
||||
margin-top: -26px;
|
||||
}
|
||||
|
||||
.totall {
|
||||
color: #fff;
|
||||
background-color: rgb(10, 63, 68);
|
||||
}
|
||||
|
||||
.rollData {
|
||||
background-color: rgb(10, 39, 50);
|
||||
}
|
||||
|
||||
.rollData:nth-of-type(2n + 1) {
|
||||
background-color: rgb(0, 59, 81);
|
||||
}
|
||||
.halfBox {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.totalStatic{
|
||||
display: flex;
|
||||
}
|
||||
.totalStaticItem{
|
||||
flex: 1;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.totalStaticItemNum{
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-family: "myfont";
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
color: rgb(149, 255, 255);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,714 @@
|
|||
<template>
|
||||
<el-container class="dashboard">
|
||||
<el-header class="header">
|
||||
<div class="title">精雕车间生产数据看板</div>
|
||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<!-- 精雕 -->
|
||||
<el-row style="height: 60%" :gutter="10">
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<!-- 设备状态 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
设备状态
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon yxicon"></span>
|
||||
<span>运行中</span>
|
||||
<span class="eqNum">{{hh.yx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon wyxIcon"></span>
|
||||
<span>未运行</span>
|
||||
<span class="eqNum">{{hh.wyx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon gzIcon"></span>
|
||||
<span>故障</span>
|
||||
<span class="eqNum">{{hh.gz}}台</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 库存 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
精雕车间库存
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">生产数统计</div>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem">日投产量</span>
|
||||
<span class="totalStaticItem">日加工数</span>
|
||||
<span class="totalStaticItem">日加工前不良</span>
|
||||
<span class="totalStaticItem">日合格数</span>
|
||||
<span class="totalStaticItem">日不合格数</span>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||
</div>
|
||||
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 0.3%"></div>
|
||||
<!-- 生产统计 分析 -->
|
||||
<div style="height: 0.3%"></div>
|
||||
<el-row style="height: 39%" :gutter="10">
|
||||
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">合格数统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 饼状图 各不合格品 原因占比 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">不合格占比统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
barOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "2%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: true,
|
||||
data: [],
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "",
|
||||
type: "value",
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
type: "dashed", //y轴分割线类型
|
||||
color: "rgba(102,102,102,0.9)",
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "加工数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格率",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
pieOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
orient: 'vertical',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
series: {
|
||||
name: '不合格占比',
|
||||
type: 'pie',
|
||||
radius: ['1%', '60%'],
|
||||
center: ['35%', '50%'],
|
||||
label: false,
|
||||
data: []
|
||||
}
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
hh:{
|
||||
yx:0,
|
||||
wyx:0,
|
||||
gz:0,
|
||||
},
|
||||
sctj:{
|
||||
rtcs:0,
|
||||
rjgs:0,
|
||||
rjgqbls:0,
|
||||
rhgs:0,
|
||||
rbhgs:0,
|
||||
},
|
||||
dayInterval: null,
|
||||
chartInterval1: null,
|
||||
chartInterval2: null,
|
||||
//库存
|
||||
configDataInm:{
|
||||
header:['物料名称','批次号','数量','生产中'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
//设备
|
||||
configDataEq:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//生产统计
|
||||
configDatas :{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['日期','加工数','合格数','不合格数'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
page:1,
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
mgroups:[],
|
||||
daysList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.page = 1;
|
||||
that.configDataInm.data = [];
|
||||
//表格table的高度
|
||||
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
//近七天的日期数组
|
||||
let daysArr = this.getMondayOfCurrentWeek();
|
||||
this.daysArr = daysArr;
|
||||
let xAxisData = [];
|
||||
daysArr.forEach((item)=>{
|
||||
let dates = item.split('-');
|
||||
let obj = dates[1]+'-'+dates[2];
|
||||
xAxisData.push(obj);
|
||||
let dayitem = Number(dates[2]);
|
||||
that.daysList.push(dayitem);
|
||||
})
|
||||
that.today = new Date().toISOString().split('T')[0]
|
||||
this.xAxisData = xAxisData;
|
||||
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
|
||||
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||
this.start_time = start_time;
|
||||
this.end_time = end_time;
|
||||
this.$nextTick(() => {
|
||||
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'精雕车间'}).then((res) => {
|
||||
that.mgroups = res;
|
||||
that.configDataEq.data = [];
|
||||
res.forEach((item)=>{
|
||||
//设备数据
|
||||
that.getEqState(item.id);
|
||||
})
|
||||
})
|
||||
this.getMaterials(that.page);
|
||||
//投产/生产分析
|
||||
this.getProductLine();
|
||||
this.getCountnotok();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMondayOfCurrentWeek() {
|
||||
let today = new Date();
|
||||
let days = [];
|
||||
for (let i = 6; i >= 0; i--) {
|
||||
let date = new Date(today);
|
||||
date.setDate(today.getDate() - i);
|
||||
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||
}
|
||||
return days;
|
||||
},
|
||||
//时间
|
||||
showTime() {
|
||||
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||
this.currentDay = this.$TOOL.dateFormat(
|
||||
new Date(),
|
||||
"yyyy年MM月dd日"
|
||||
);
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||
if (myChart == undefined) {
|
||||
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||
renderer: "svg",
|
||||
});
|
||||
}
|
||||
if (option == null) {
|
||||
option = Object.assign({}, this.barOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
//生产统计
|
||||
getProductLine() {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'精雕车间'},
|
||||
};
|
||||
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||
}
|
||||
if (list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
let dateNow = new Date().getDate();
|
||||
if(item.日 == dateNow){
|
||||
that.sctj.rtcs = item.总重量;
|
||||
that.sctj.rjgs = item.生产数;
|
||||
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||
that.sctj.rhgs = item.合格数;
|
||||
that.sctj.rbhgs = item.不合格数;
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||
arr[1] = item.生产数;
|
||||
arr[2] = item.合格数;
|
||||
arr[3] = item.不合格数;
|
||||
that.configDatas.data.push(arr);
|
||||
|
||||
let indexs = that.daysList.indexOf(item.日);
|
||||
seriesData0[indexs] = item.生产数;
|
||||
seriesData1[indexs] = item.合格数;
|
||||
seriesData2[indexs] = item.合格率;
|
||||
});
|
||||
}
|
||||
that.barOption.xAxis.data = that.xAxisData;
|
||||
that.barOption.series[0].data = seriesData0;
|
||||
that.barOption.series[1].data = seriesData1;
|
||||
that.barOption.series[2].data = seriesData2;
|
||||
let chart1 = this.setChart("chart1", that.barOption);
|
||||
let index1 = 0;
|
||||
this.chartInterval1 = setInterval(function () {
|
||||
if (index1 < that.barOption.series[0].data.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);
|
||||
});
|
||||
},
|
||||
//不合格分布
|
||||
getCountnotok(){
|
||||
let that = this;
|
||||
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||
let seriesData = [];
|
||||
if(res.data2.ds0){
|
||||
res.data2.ds0.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.name = item.不合格项;
|
||||
obj.value = item.数量;
|
||||
seriesData.push(obj);
|
||||
})
|
||||
}
|
||||
that.pieOption.series.data = seriesData;
|
||||
let index2 = 0;
|
||||
let chart2 = this.setChart("chart2", that.pieOption);
|
||||
this.chartInterval2 = setInterval(function () {
|
||||
if (index2 < that.barOption.series[0].data.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);
|
||||
})
|
||||
},
|
||||
//设备状态
|
||||
getEqState(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||
that.hh.bw = res.保温;
|
||||
that.hh.lq = res.冷却;
|
||||
that.hh.yx = res.运行;
|
||||
that.hh.wyx = res.未运行;
|
||||
that.hh.gz = res.故障;
|
||||
let nowTime = new Date(res.now).getTime();
|
||||
if(res.rows.length>0){
|
||||
res.rows.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
if(item.mstate=='冷却'){
|
||||
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||
}else if(item.mstate=='未运行'){
|
||||
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||
}else if(item.mstate=='故障'){
|
||||
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||
}
|
||||
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||
item.reminder_interval_list.forEach(item=>{
|
||||
sumTime += item;
|
||||
})
|
||||
let startTime = new Date(item.work_start_time).getTime();
|
||||
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||
process = Math.round((workTime/sumTime)*100);
|
||||
process = process>100?'100%':process+'%';
|
||||
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||
if(bwSaveTime>0){
|
||||
saveTime = bwSaveTime;
|
||||
}else{
|
||||
saveTime = 0;
|
||||
}
|
||||
}else{
|
||||
process = '';
|
||||
saveTime = '';
|
||||
}
|
||||
arr[3] = process;
|
||||
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||
that.configDataEq.data.push(arr);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getMaterials(page) {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'减薄A,减薄B' }).then((res) => {
|
||||
if(res.results.length>0){
|
||||
res.results.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.batch;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_working;
|
||||
that.configDataInm.data.push(arr);
|
||||
})
|
||||
if(res.count>that.configDataInm.data.length){
|
||||
that.page++;
|
||||
that.getMaterials(that.page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@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 {
|
||||
background: url("/public/img/photon_header.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
font-size: 26px;
|
||||
display: block;
|
||||
height: 80px;
|
||||
color: rgb(149, 255, 255);
|
||||
font-family: "Microsoft Yahei";
|
||||
text-align: center;
|
||||
padding: 12px 0px;
|
||||
}
|
||||
.header > .title {
|
||||
font-weight: bold;
|
||||
font-family: "myfont";
|
||||
font-size: 32px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.box {
|
||||
background: rgba(10, 63, 68, 0.5);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.boxtitle {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
line-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 {
|
||||
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||
background-size: 140% 100%;
|
||||
}
|
||||
|
||||
.boxlabel {
|
||||
margin-left: 6px;
|
||||
font-size: 18px;
|
||||
/* margin-top: 6px; */
|
||||
}
|
||||
.stateIcon{
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin: 0 5px;
|
||||
border-radius: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
.bwIcon{
|
||||
background-color: rgb(245, 196, 0);
|
||||
}
|
||||
.lqIcon,.yxicon{
|
||||
background-color: rgb(0,163,245);
|
||||
}
|
||||
.wyxIcon{
|
||||
background-color: rgb(69,176,118);
|
||||
}
|
||||
.gzIcon{
|
||||
background-color: rgb(222,60,54);
|
||||
}
|
||||
.eqNum{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.boxmain {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.boxmain.boxmainbottom{
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
.boxmain.boxmainTopRight{
|
||||
height: calc(100% - 120px);
|
||||
}
|
||||
.lineDiv {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.boxmainItemNumber {
|
||||
color: rgb(42,234,200);
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
font-face:24px;
|
||||
font-family: electronicFont;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.boxmain {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex_center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px dashed #49bcf7;
|
||||
}
|
||||
|
||||
.bigdata {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.marquee_top {
|
||||
transition: all 0.5s ease-in-out;
|
||||
margin-top: -26px;
|
||||
}
|
||||
|
||||
.totall {
|
||||
color: #fff;
|
||||
background-color: rgb(10, 63, 68);
|
||||
}
|
||||
|
||||
.rollData {
|
||||
background-color: rgb(10, 39, 50);
|
||||
}
|
||||
|
||||
.rollData:nth-of-type(2n + 1) {
|
||||
background-color: rgb(0, 59, 81);
|
||||
}
|
||||
.halfBox {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.totalStatic{
|
||||
display: flex;
|
||||
}
|
||||
.totalStaticItem{
|
||||
flex: 1;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.totalStaticItemNum{
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-family: "myfont";
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
color: rgb(149, 255, 255);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,714 @@
|
|||
<template>
|
||||
<el-container class="dashboard">
|
||||
<el-header class="header">
|
||||
<div class="title">磨抛车间生产数据看板</div>
|
||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<!-- 磨抛 -->
|
||||
<el-row style="height: 60%" :gutter="10">
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<!-- 设备状态 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
设备状态
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon yxicon"></span>
|
||||
<span>运行中</span>
|
||||
<span class="eqNum">{{hh.yx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon wyxIcon"></span>
|
||||
<span>未运行</span>
|
||||
<span class="eqNum">{{hh.wyx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon gzIcon"></span>
|
||||
<span>故障</span>
|
||||
<span class="eqNum">{{hh.gz}}台</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 库存 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
磨抛车间库存
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">生产数统计</div>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem">日投产量</span>
|
||||
<span class="totalStaticItem">日加工数</span>
|
||||
<span class="totalStaticItem">日加工前不良</span>
|
||||
<span class="totalStaticItem">日合格数</span>
|
||||
<span class="totalStaticItem">日不合格数</span>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||
</div>
|
||||
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 0.3%"></div>
|
||||
<!-- 生产统计 分析 -->
|
||||
<div style="height: 0.3%"></div>
|
||||
<el-row style="height: 39%" :gutter="10">
|
||||
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">合格数统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 饼状图 各不合格品 原因占比 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">不合格占比统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
barOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "2%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: true,
|
||||
data: [],
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "",
|
||||
type: "value",
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
type: "dashed", //y轴分割线类型
|
||||
color: "rgba(102,102,102,0.9)",
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "加工数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格率",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
pieOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
orient: 'vertical',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
series: {
|
||||
name: '不合格占比',
|
||||
type: 'pie',
|
||||
radius: ['1%', '60%'],
|
||||
center: ['35%', '50%'],
|
||||
label: false,
|
||||
data: []
|
||||
}
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
hh:{
|
||||
yx:0,
|
||||
wyx:0,
|
||||
gz:0,
|
||||
},
|
||||
sctj:{
|
||||
rtcs:0,
|
||||
rjgs:0,
|
||||
rjgqbls:0,
|
||||
rhgs:0,
|
||||
rbhgs:0,
|
||||
},
|
||||
dayInterval: null,
|
||||
chartInterval1: null,
|
||||
chartInterval2: null,
|
||||
//库存
|
||||
configDataInm:{
|
||||
header:['物料名称','批次号','数量','生产中'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
//设备
|
||||
configDataEq:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//生产统计
|
||||
configDatas :{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['日期','加工数','合格数','不合格数'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
page:1,
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
mgroups:[],
|
||||
daysList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.page = 1;
|
||||
that.configDataInm.data = [];
|
||||
//表格table的高度
|
||||
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
//近七天的日期数组
|
||||
let daysArr = this.getMondayOfCurrentWeek();
|
||||
this.daysArr = daysArr;
|
||||
let xAxisData = [];
|
||||
daysArr.forEach((item)=>{
|
||||
let dates = item.split('-');
|
||||
let obj = dates[1]+'-'+dates[2];
|
||||
xAxisData.push(obj);
|
||||
let dayitem = Number(dates[2]);
|
||||
that.daysList.push(dayitem);
|
||||
})
|
||||
that.today = new Date().toISOString().split('T')[0]
|
||||
this.xAxisData = xAxisData;
|
||||
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
|
||||
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||
this.start_time = start_time;
|
||||
this.end_time = end_time;
|
||||
this.$nextTick(() => {
|
||||
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'磨抛车间'}).then((res) => {
|
||||
that.mgroups = res;
|
||||
that.configDataEq.data = [];
|
||||
res.forEach((item)=>{
|
||||
//设备数据
|
||||
that.getEqState(item.id);
|
||||
})
|
||||
})
|
||||
this.getMaterials(that.page);
|
||||
//投产/生产分析
|
||||
this.getProductLine();
|
||||
this.getCountnotok();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMondayOfCurrentWeek() {
|
||||
let today = new Date();
|
||||
let days = [];
|
||||
for (let i = 6; i >= 0; i--) {
|
||||
let date = new Date(today);
|
||||
date.setDate(today.getDate() - i);
|
||||
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||
}
|
||||
return days;
|
||||
},
|
||||
//时间
|
||||
showTime() {
|
||||
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||
this.currentDay = this.$TOOL.dateFormat(
|
||||
new Date(),
|
||||
"yyyy年MM月dd日"
|
||||
);
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||
if (myChart == undefined) {
|
||||
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||
renderer: "svg",
|
||||
});
|
||||
}
|
||||
if (option == null) {
|
||||
option = Object.assign({}, this.barOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
//生产统计
|
||||
getProductLine() {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'磨抛车间'},
|
||||
};
|
||||
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||
}
|
||||
if (list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
let dateNow = new Date().getDate();
|
||||
if(item.日 == dateNow){
|
||||
that.sctj.rtcs = item.总重量;
|
||||
that.sctj.rjgs = item.生产数;
|
||||
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||
that.sctj.rhgs = item.合格数;
|
||||
that.sctj.rbhgs = item.不合格数;
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||
arr[1] = item.生产数;
|
||||
arr[2] = item.合格数;
|
||||
arr[3] = item.不合格数;
|
||||
that.configDatas.data.push(arr);
|
||||
|
||||
let indexs = that.daysList.indexOf(item.日);
|
||||
seriesData0[indexs] = item.生产数;
|
||||
seriesData1[indexs] = item.合格数;
|
||||
seriesData2[indexs] = item.合格率;
|
||||
});
|
||||
}
|
||||
that.barOption.xAxis.data = that.xAxisData;
|
||||
that.barOption.series[0].data = seriesData0;
|
||||
that.barOption.series[1].data = seriesData1;
|
||||
that.barOption.series[2].data = seriesData2;
|
||||
let chart1 = this.setChart("chart1", that.barOption);
|
||||
let index1 = 0;
|
||||
this.chartInterval1 = setInterval(function () {
|
||||
if (index1 < that.barOption.series[0].data.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);
|
||||
});
|
||||
},
|
||||
//不合格分布
|
||||
getCountnotok(){
|
||||
let that = this;
|
||||
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||
let seriesData = [];
|
||||
if(res.data2.ds0){
|
||||
res.data2.ds0.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.name = item.不合格项;
|
||||
obj.value = item.数量;
|
||||
seriesData.push(obj);
|
||||
})
|
||||
}
|
||||
that.pieOption.series.data = seriesData;
|
||||
let index2 = 0;
|
||||
let chart2 = this.setChart("chart2", that.pieOption);
|
||||
this.chartInterval2 = setInterval(function () {
|
||||
if (index2 < that.barOption.series[0].data.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);
|
||||
})
|
||||
},
|
||||
//设备状态
|
||||
getEqState(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||
that.hh.bw = res.保温;
|
||||
that.hh.lq = res.冷却;
|
||||
that.hh.yx = res.运行;
|
||||
that.hh.wyx = res.未运行;
|
||||
that.hh.gz = res.故障;
|
||||
let nowTime = new Date(res.now).getTime();
|
||||
if(res.rows.length>0){
|
||||
res.rows.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
if(item.mstate=='冷却'){
|
||||
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||
}else if(item.mstate=='未运行'){
|
||||
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||
}else if(item.mstate=='故障'){
|
||||
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||
}
|
||||
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||
item.reminder_interval_list.forEach(item=>{
|
||||
sumTime += item;
|
||||
})
|
||||
let startTime = new Date(item.work_start_time).getTime();
|
||||
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||
process = Math.round((workTime/sumTime)*100);
|
||||
process = process>100?'100%':process+'%';
|
||||
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||
if(bwSaveTime>0){
|
||||
saveTime = bwSaveTime;
|
||||
}else{
|
||||
saveTime = 0;
|
||||
}
|
||||
}else{
|
||||
process = '';
|
||||
saveTime = '';
|
||||
}
|
||||
arr[3] = process;
|
||||
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||
that.configDataEq.data.push(arr);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getMaterials(page) {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'减薄A,减薄B' }).then((res) => {
|
||||
if(res.results.length>0){
|
||||
res.results.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.batch;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_working;
|
||||
that.configDataInm.data.push(arr);
|
||||
})
|
||||
if(res.count>that.configDataInm.data.length){
|
||||
that.page++;
|
||||
that.getMaterials(that.page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@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 {
|
||||
background: url("/public/img/photon_header.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
font-size: 26px;
|
||||
display: block;
|
||||
height: 80px;
|
||||
color: rgb(149, 255, 255);
|
||||
font-family: "Microsoft Yahei";
|
||||
text-align: center;
|
||||
padding: 12px 0px;
|
||||
}
|
||||
.header > .title {
|
||||
font-weight: bold;
|
||||
font-family: "myfont";
|
||||
font-size: 32px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.box {
|
||||
background: rgba(10, 63, 68, 0.5);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.boxtitle {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
line-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 {
|
||||
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||
background-size: 140% 100%;
|
||||
}
|
||||
|
||||
.boxlabel {
|
||||
margin-left: 6px;
|
||||
font-size: 18px;
|
||||
/* margin-top: 6px; */
|
||||
}
|
||||
.stateIcon{
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin: 0 5px;
|
||||
border-radius: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
.bwIcon{
|
||||
background-color: rgb(245, 196, 0);
|
||||
}
|
||||
.lqIcon,.yxicon{
|
||||
background-color: rgb(0,163,245);
|
||||
}
|
||||
.wyxIcon{
|
||||
background-color: rgb(69,176,118);
|
||||
}
|
||||
.gzIcon{
|
||||
background-color: rgb(222,60,54);
|
||||
}
|
||||
.eqNum{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.boxmain {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.boxmain.boxmainbottom{
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
.boxmain.boxmainTopRight{
|
||||
height: calc(100% - 120px);
|
||||
}
|
||||
.lineDiv {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.boxmainItemNumber {
|
||||
color: rgb(42,234,200);
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
font-face:24px;
|
||||
font-family: electronicFont;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.boxmain {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex_center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px dashed #49bcf7;
|
||||
}
|
||||
|
||||
.bigdata {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.marquee_top {
|
||||
transition: all 0.5s ease-in-out;
|
||||
margin-top: -26px;
|
||||
}
|
||||
|
||||
.totall {
|
||||
color: #fff;
|
||||
background-color: rgb(10, 63, 68);
|
||||
}
|
||||
|
||||
.rollData {
|
||||
background-color: rgb(10, 39, 50);
|
||||
}
|
||||
|
||||
.rollData:nth-of-type(2n + 1) {
|
||||
background-color: rgb(0, 59, 81);
|
||||
}
|
||||
.halfBox {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.totalStatic{
|
||||
display: flex;
|
||||
}
|
||||
.totalStaticItem{
|
||||
flex: 1;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.totalStaticItemNum{
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-family: "myfont";
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
color: rgb(149, 255, 255);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,758 @@
|
|||
<!-- 扫边车间 -->
|
||||
<template>
|
||||
<el-container class="dashboard">
|
||||
<el-header class="header">
|
||||
<div class="title">扫边车间生产数据看板</div>
|
||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-row style="height: 60%" :gutter="10">
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<!-- 设备状态 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
设备状态
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon yxicon"></span>
|
||||
<span>运行中</span>
|
||||
<span class="eqNum">{{hh.yx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon wyxIcon"></span>
|
||||
<span>未运行</span>
|
||||
<span class="eqNum">{{hh.wyx}}台</span>
|
||||
</div>
|
||||
<div class="boxlabel">
|
||||
<span class="stateIcon gzIcon"></span>
|
||||
<span>故障</span>
|
||||
<span class="eqNum">{{hh.gz}}台</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 库存 -->
|
||||
<el-col style="height: 50%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">
|
||||
扫边车间库存
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 2px"></div>
|
||||
<div class="boxmain" id="scrollContainer">
|
||||
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12" style="height: 100%">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">生产数统计</div>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem">日投产量</span>
|
||||
<span class="totalStaticItem">日加工数</span>
|
||||
<span class="totalStaticItem">日加工前不良</span>
|
||||
<span class="totalStaticItem">日合格数</span>
|
||||
<span class="totalStaticItem">日不合格数</span>
|
||||
</div>
|
||||
<div class="totalStatic">
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||
</div>
|
||||
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 0.3%"></div>
|
||||
<!-- 生产统计 分析 -->
|
||||
<div style="height: 0.3%"></div>
|
||||
<el-row style="height: 39%" :gutter="10">
|
||||
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">合格数统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 饼状图 各不合格品 原因占比 -->
|
||||
<el-col :span="12" style="height: 100%;">
|
||||
<div class="box">
|
||||
<div class="boxtitle">
|
||||
<div class="boxlabel">不合格占比统计</div>
|
||||
</div>
|
||||
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
barOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "2%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: true,
|
||||
data: [],
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: "",
|
||||
type: "value",
|
||||
nameTextStyle: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#ffffff",
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
type: "dashed", //y轴分割线类型
|
||||
color: "rgba(102,102,102,0.9)",
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "加工数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "合格率",
|
||||
type: "bar",
|
||||
barWidth: 10,
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
pieOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
icon: "stack",
|
||||
right: 0,
|
||||
orient: 'vertical',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
series: {
|
||||
name: '不合格占比',
|
||||
type: 'pie',
|
||||
radius: ['1%', '60%'],
|
||||
center: ['35%', '50%'],
|
||||
label: false,
|
||||
data: []
|
||||
}
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
hh:{
|
||||
yx:0,
|
||||
wyx:0,
|
||||
gz:0,
|
||||
},
|
||||
sctj:{
|
||||
rtcs:0,
|
||||
rjgs:0,
|
||||
rjgqbls:0,
|
||||
rhgs:0,
|
||||
rbhgs:0,
|
||||
},
|
||||
dayInterval: null,
|
||||
chartInterval1: null,
|
||||
chartInterval2: null,
|
||||
//库存
|
||||
configDataInm:{
|
||||
header:['物料名称','批次号','数量','生产中'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
//交接记录
|
||||
configDataHandover:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['物料','数量','交接类型','交接类别','交接日期'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//设备
|
||||
configDataEq:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
//生产统计
|
||||
configDatas :{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['日期','加工数','合格数','不合格数'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
page:1,
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
mgroups:[],
|
||||
daysList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.page = 1;
|
||||
that.configDataInm.data = [];
|
||||
//表格table的高度
|
||||
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
//近七天的日期数组
|
||||
let daysArr = this.getMondayOfCurrentWeek();
|
||||
this.daysArr = daysArr;
|
||||
let xAxisData = [];
|
||||
daysArr.forEach((item)=>{
|
||||
let dates = item.split('-');
|
||||
let obj = dates[1]+'-'+dates[2];
|
||||
xAxisData.push(obj);
|
||||
let dayitem = Number(dates[2]);
|
||||
that.daysList.push(dayitem);
|
||||
})
|
||||
that.today = new Date().toISOString().split('T')[0]
|
||||
// console.log('new Date', new Date().toISOString().split('T'))
|
||||
this.xAxisData = xAxisData;
|
||||
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
|
||||
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||
this.start_time = start_time;
|
||||
this.end_time = end_time;
|
||||
this.$nextTick(() => {
|
||||
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'扫边车间'}).then((res) => {
|
||||
that.mgroups = res;
|
||||
that.configDataEq.data = [];
|
||||
that.configDataHandover.data = [];
|
||||
res.forEach((item)=>{
|
||||
//设备数据
|
||||
that.getEqState(item.id);
|
||||
//库存统计
|
||||
// this.getMaterials(item.id);
|
||||
//交接列表
|
||||
// this.getHandover(item.id);
|
||||
})
|
||||
})
|
||||
this.getMaterials(that.page);
|
||||
//任务进度
|
||||
// this.getMtask();
|
||||
//投产/生产分析
|
||||
this.getProductLine();
|
||||
this.getCountnotok();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMondayOfCurrentWeek() {
|
||||
let today = new Date();
|
||||
let days = [];
|
||||
for (let i = 6; i >= 0; i--) {
|
||||
let date = new Date(today);
|
||||
date.setDate(today.getDate() - i);
|
||||
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||
}
|
||||
return days;
|
||||
},
|
||||
//时间
|
||||
showTime() {
|
||||
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||
this.currentDay = this.$TOOL.dateFormat(
|
||||
new Date(),
|
||||
"yyyy年MM月dd日"
|
||||
);
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||
if (myChart == undefined) {
|
||||
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||
renderer: "svg",
|
||||
});
|
||||
}
|
||||
if (option == null) {
|
||||
option = Object.assign({}, this.barOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
//生产统计
|
||||
getProductLine() {
|
||||
let that = this;
|
||||
let obj = {
|
||||
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'扫边车间'},
|
||||
};
|
||||
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||
}
|
||||
if (list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
let dateNow = new Date().getDate();
|
||||
if(item.日 == dateNow){
|
||||
that.sctj.rtcs = item.总重量;
|
||||
that.sctj.rjgs = item.生产数;
|
||||
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||
that.sctj.rhgs = item.合格数;
|
||||
that.sctj.rbhgs = item.不合格数;
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||
arr[1] = item.生产数;
|
||||
arr[2] = item.合格数;
|
||||
arr[3] = item.不合格数;
|
||||
that.configDatas.data.push(arr);
|
||||
|
||||
let indexs = that.daysList.indexOf(item.日);
|
||||
seriesData0[indexs] = item.生产数;
|
||||
seriesData1[indexs] = item.合格数;
|
||||
seriesData2[indexs] = item.合格率;
|
||||
});
|
||||
}
|
||||
that.barOption.xAxis.data = that.xAxisData;
|
||||
that.barOption.series[0].data = seriesData0;
|
||||
that.barOption.series[1].data = seriesData1;
|
||||
that.barOption.series[2].data = seriesData2;
|
||||
let chart1 = this.setChart("chart1", that.barOption);
|
||||
let index1 = 0;
|
||||
this.chartInterval1 = setInterval(function () {
|
||||
if (index1 < that.barOption.series[0].data.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);
|
||||
});
|
||||
},
|
||||
//不合格分布
|
||||
getCountnotok(){
|
||||
let that = this;
|
||||
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||
let seriesData = [];
|
||||
if(res.data2.ds0){
|
||||
res.data2.ds0.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.name = item.不合格项;
|
||||
obj.value = item.数量;
|
||||
seriesData.push(obj);
|
||||
})
|
||||
}
|
||||
that.pieOption.series.data = seriesData;
|
||||
let index2 = 0;
|
||||
let chart2 = this.setChart("chart2", that.pieOption);
|
||||
this.chartInterval2 = setInterval(function () {
|
||||
if (index2 < that.barOption.series[0].data.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);
|
||||
})
|
||||
},
|
||||
//设备状态
|
||||
getEqState(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||
that.hh.bw = res.保温;
|
||||
that.hh.lq = res.冷却;
|
||||
that.hh.yx = res.运行;
|
||||
that.hh.wyx = res.未运行;
|
||||
that.hh.gz = res.故障;
|
||||
let nowTime = new Date(res.now).getTime();
|
||||
if(res.rows.length>0){
|
||||
res.rows.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
if(item.mstate=='冷却'){
|
||||
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||
}else if(item.mstate=='未运行'){
|
||||
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||
}else if(item.mstate=='故障'){
|
||||
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||
}
|
||||
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||
item.reminder_interval_list.forEach(item=>{
|
||||
sumTime += item;
|
||||
})
|
||||
let startTime = new Date(item.work_start_time).getTime();
|
||||
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||
process = Math.round((workTime/sumTime)*100);
|
||||
process = process>100?'100%':process+'%';
|
||||
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||
if(bwSaveTime>0){
|
||||
saveTime = bwSaveTime;
|
||||
}else{
|
||||
saveTime = 0;
|
||||
}
|
||||
}else{
|
||||
process = '';
|
||||
saveTime = '';
|
||||
}
|
||||
arr[3] = process;
|
||||
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||
that.configDataEq.data.push(arr);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//交接列表
|
||||
getHandover(id) {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.mgroup = id;
|
||||
obj.page = 0;
|
||||
obj.send_date =
|
||||
that.$API.wpm.handover.list.req(obj).then((res) => {
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.count;
|
||||
arr[2] = item.material_out_.model;
|
||||
if(item.state==10){
|
||||
arr[3]='<span style="color:rgb(0,163,245);displaydisplay:inline-block;padding:2px 6px;background:rgb(226,241,245);border:1px solid rgb(0,163,245);border-radius:3px">正常</span>';
|
||||
}else if(item.state==20){
|
||||
arr[3]='<span style="color:rgb(222,60,54);displaydisplay:inline-block;padding:2px 6px;background:rgb(247,231,231);border:1px solid rgb(222,60,54);border-radius:3px">返工</span>';
|
||||
}else if(item.state==30){
|
||||
arr[3]='<span style="color:rgb(69,176,118);displaydisplay:inline-block;padding:2px 6px;background:rgb(231,247,232);border:1px solid rgb(69,176,118);border-radius:3px">检验</span>';
|
||||
}else if(item.state==40){
|
||||
arr[3]='<span style="color:rgb(69,176,118);displaydisplay:inline-block;padding:2px 6px;background:rgb(231,247,232);border:1px solid rgb(69,176,118);border-radius:3px">报废</span>';
|
||||
}
|
||||
arr[4] = item.send_user_name;
|
||||
arr[5] = item.recive_user_name;
|
||||
arr[6] = item.send_date;
|
||||
that.configDataHandover.data.push(arr);
|
||||
});
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getMaterials(page) {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'扫边A,扫边B' }).then((res) => {
|
||||
if(res.results.length>0){
|
||||
res.results.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.material_name;
|
||||
arr[1] = item.batch;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_working;
|
||||
that.configDataInm.data.push(arr);
|
||||
})
|
||||
if(res.count>that.configDataInm.data.length){
|
||||
that.page++;
|
||||
that.getMaterials(that.page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@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 {
|
||||
background: url("/public/img/photon_header.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
font-size: 26px;
|
||||
display: block;
|
||||
height: 80px;
|
||||
color: rgb(149, 255, 255);
|
||||
font-family: "Microsoft Yahei";
|
||||
text-align: center;
|
||||
padding: 12px 0px;
|
||||
}
|
||||
.header > .title {
|
||||
font-weight: bold;
|
||||
font-family: "myfont";
|
||||
font-size: 32px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.box {
|
||||
background: rgba(10, 63, 68, 0.5);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.boxtitle {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
line-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 {
|
||||
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||
background-size: 140% 100%;
|
||||
}
|
||||
|
||||
.boxlabel {
|
||||
margin-left: 6px;
|
||||
font-size: 18px;
|
||||
/* margin-top: 6px; */
|
||||
}
|
||||
.stateIcon{
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin: 0 5px;
|
||||
border-radius: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
.bwIcon{
|
||||
background-color: rgb(245, 196, 0);
|
||||
}
|
||||
.lqIcon,.yxicon{
|
||||
background-color: rgb(0,163,245);
|
||||
}
|
||||
.wyxIcon{
|
||||
background-color: rgb(69,176,118);
|
||||
}
|
||||
.gzIcon{
|
||||
background-color: rgb(222,60,54);
|
||||
}
|
||||
.eqNum{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.boxmain {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.boxmain.boxmainbottom{
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
.boxmain.boxmainTopRight{
|
||||
height: calc(100% - 120px);
|
||||
}
|
||||
.lineDiv {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.boxmainItemNumber {
|
||||
color: rgb(42,234,200);
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
font-face:24px;
|
||||
font-family: electronicFont;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.boxmain {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex_center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px dashed #49bcf7;
|
||||
}
|
||||
|
||||
.bigdata {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.marquee_top {
|
||||
transition: all 0.5s ease-in-out;
|
||||
margin-top: -26px;
|
||||
}
|
||||
|
||||
.totall {
|
||||
color: #fff;
|
||||
background-color: rgb(10, 63, 68);
|
||||
}
|
||||
|
||||
.rollData {
|
||||
background-color: rgb(10, 39, 50);
|
||||
}
|
||||
|
||||
.rollData:nth-of-type(2n + 1) {
|
||||
background-color: rgb(0, 59, 81);
|
||||
}
|
||||
.halfBox {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.totalStatic{
|
||||
display: flex;
|
||||
}
|
||||
.totalStaticItem{
|
||||
flex: 1;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.totalStaticItemNum{
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-family: "myfont";
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
color: rgb(149, 255, 255);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -85,7 +85,10 @@
|
|||
v-model="selectBatch"
|
||||
value-key="id"
|
||||
clearable
|
||||
filterable
|
||||
remote = "true"
|
||||
style="width: 100%"
|
||||
:remote-method="inputChange"
|
||||
@change="selectBatchChange"
|
||||
@clear="selectBatchClear"
|
||||
>
|
||||
|
|
@ -357,6 +360,33 @@ export default {
|
|||
this.wbatchOptions = res;
|
||||
});
|
||||
},
|
||||
inputChange(e){
|
||||
console.log('e',e);
|
||||
if(e!==''&&e!==null&&e!==undefined){
|
||||
let codeId = e.split('#')[1];
|
||||
this.$API.cm.labelmat.item.req(codeId).then((res) => {
|
||||
if(res){
|
||||
arr = that.batchOptions.filter((item) => {
|
||||
return item.batch == res.batch&&item.state==res.state;
|
||||
})
|
||||
if (arr.length > 0) {
|
||||
that.selectBatch = arr[0].batch;
|
||||
that.form.batch = arr[0].batch;
|
||||
that.form.mb = arr[0].id;
|
||||
that.batchcount = Number(arr[0].count_canmio);
|
||||
that.form.count = Number(arr[0].count_canmio);
|
||||
that.form.warehouse = arr[0].warehouse;
|
||||
that.inputBatchDisable = true;
|
||||
}else{
|
||||
that.selectBatch = '';
|
||||
that.$message.error("批次号不存在");
|
||||
}
|
||||
}else{
|
||||
that.selectBatch = '';
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getMaterialOptions() {
|
||||
var type = this.form.type;
|
||||
var cate = this.cate;
|
||||
|
|
|
|||
|
|
@ -245,6 +245,10 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
tag: {
|
||||
type: String,
|
||||
default: "done",
|
||||
},
|
||||
},
|
||||
components: {
|
||||
scanDialog
|
||||
|
|
@ -256,15 +260,15 @@ export default {
|
|||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add10: "新增交接记录",
|
||||
add20: "新增返工记录",
|
||||
add40: "新增废品入库",
|
||||
add50: "新增改版记录",
|
||||
edit10: "编辑交接记录",
|
||||
edit20: "编辑返工记录",
|
||||
edit40: "编辑废品入库",
|
||||
edit50: "编辑改版记录",
|
||||
show: "查看交接记录",
|
||||
add10: "新增",
|
||||
add20: "新增",
|
||||
add40: "新增",
|
||||
add50: "新增",
|
||||
edit10: "编辑",
|
||||
edit20: "编辑",
|
||||
edit40: "编辑",
|
||||
edit50: "编辑",
|
||||
show: "查看",
|
||||
},
|
||||
lists:[],//交接数组
|
||||
handle_user: [],
|
||||
|
|
@ -444,7 +448,7 @@ export default {
|
|||
let that = this;
|
||||
var req = {
|
||||
page: 0,
|
||||
tag:'done',
|
||||
tag:that.tag,
|
||||
mgroupx:that.mgroupId
|
||||
};
|
||||
if(that.type!==50){
|
||||
|
|
|
|||
|
|
@ -81,6 +81,13 @@
|
|||
:mgroup_code="mgroup_code"
|
||||
:mgroupMtype = "mgroupMtype"
|
||||
></inmOut>
|
||||
<record v-else-if="values == '出入库记录'"
|
||||
:mgroupId="mgroupId"
|
||||
:deptId = "mgroupDept"
|
||||
:mgroupName="mgroupName"
|
||||
:processId="processId"
|
||||
:mgroupcode="mgroup_code"
|
||||
></record>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
|
@ -89,10 +96,11 @@ import inmIn from "./inmIn.vue";
|
|||
import inmOut from "./inmOut.vue";
|
||||
import mlogs from "./mlogs.vue";
|
||||
import mtask from "./mtask.vue";
|
||||
import record from "./../wpm_gx/inmrecord.vue";
|
||||
import handover from "./handover.vue";
|
||||
export default {
|
||||
name: "bx",
|
||||
components: { inmIn, mlogs, mtask, handover,inmOut },
|
||||
components: { inmIn, mlogs, mtask, handover,inmOut,record },
|
||||
data() {
|
||||
return {
|
||||
mgroups:[],
|
||||
|
|
@ -118,6 +126,12 @@ export default {
|
|||
let paths = this.$route.path;
|
||||
let arr = paths.split("/");
|
||||
this.mgroup_code = arr[2];
|
||||
if(this.mgroup_code=='chengpingneiwaichujian'||this.mgroup_code=='guangzhuichengpjianc'||
|
||||
this.mgroup_code=='chengpneizhifujian'||this.mgroup_code=='chengpingxinengjiance'||
|
||||
this.mgroup_code=='chenpjianchicunjiance'||this.mgroup_code=='chengpwaiguanfujianyi'||
|
||||
this.mgroup_code=='chengpwaiguanfujianer'){
|
||||
this.options.push('出入库记录');
|
||||
}
|
||||
console.log('this.mgroup_code',this.mgroup_code);
|
||||
that.getMgroups(this.mgroup_code);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@
|
|||
v-if="dialog.scrap"
|
||||
ref="scrapDialog"
|
||||
:type="type"
|
||||
:tag="tag"
|
||||
:mgroupName="mgroup_name"
|
||||
:mgroupId="mgroupId"
|
||||
@success="handleScrapSuccess"
|
||||
|
|
@ -380,6 +381,7 @@ export default {
|
|||
page:0,
|
||||
wm: ""
|
||||
},
|
||||
tag:"",
|
||||
wmId:"",
|
||||
route_code:"",
|
||||
showBatch: "",
|
||||
|
|
@ -501,6 +503,7 @@ export default {
|
|||
})
|
||||
}
|
||||
this.type = 10;
|
||||
this.tag = 'todo';
|
||||
this.dialog.scrap = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.scrapDialog.open("add",handoverb,30);
|
||||
|
|
|
|||
|
|
@ -157,22 +157,28 @@
|
|||
hideDo
|
||||
stripe
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="物料"
|
||||
prop="material"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="scope"
|
||||
>{{ scope.row.material_name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch">
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="物料"
|
||||
prop="material"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="scope">{{ scope.row.material_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch">
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
|
@ -514,6 +520,18 @@ export default {
|
|||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
table_del(row){
|
||||
let that = this;
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
that.$API.inm.mioitem.delete.req(row.id).then((res) => {
|
||||
that.$message.success("删除成功");
|
||||
that.$refs.tables.refresh();
|
||||
return res;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
table_submit() {
|
||||
let that = this;
|
||||
that.$API.inm.mio.submit.req(that.mioId).then((res) => {
|
||||
|
|
|
|||
|
|
@ -3,20 +3,17 @@
|
|||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
|
||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
|
||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'&&project_code=='gxerp'"
|
||||
>领料</el-button>
|
||||
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'">入库</el-button>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
@click="tomio('borrow_out')"
|
||||
v-auth="'mio.do'"
|
||||
>领用出库</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="tomio('return_in')"
|
||||
v-auth="'mio.do'"
|
||||
v-if="project_code=='gxerp'"
|
||||
>退还入库</el-button>
|
||||
<el-select
|
||||
v-if="project_code=='gxerp'"
|
||||
v-model="query.type"
|
||||
clearable
|
||||
style="width: 120px; margin-left: 2px"
|
||||
|
|
@ -236,6 +233,7 @@ export default {
|
|||
let that = this;
|
||||
that.params.mgroup = that.mgroupId;
|
||||
that.apiObj = that.$API.inm.mio.list;
|
||||
that.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||
},
|
||||
methods: {
|
||||
tomio(type) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue