Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
05ecdf7623
|
@ -3019,6 +3019,17 @@ const routes = [
|
||||||
perms: ["bigScreenP_dept"],
|
perms: ["bigScreenP_dept"],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
{
|
||||||
|
path: "/bigScreenP_heihua",
|
||||||
|
name: "bigScreenP_heihua",
|
||||||
|
meta: {
|
||||||
|
title: "黑化车间",
|
||||||
|
icon: "el-icon-trend-charts",
|
||||||
|
perms: ["bigScreenP_dept10"],
|
||||||
|
fullpage: true,
|
||||||
|
},
|
||||||
|
component: "bigScreen/index_heihuadept.vue",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/bigScreenP_10",
|
path: "/bigScreenP_10",
|
||||||
name: "bigScreenP_10",
|
name: "bigScreenP_10",
|
||||||
|
@ -3234,6 +3245,72 @@ const routes = [
|
||||||
},
|
},
|
||||||
component: "statistics/stock_statistics.vue",
|
component: "statistics/stock_statistics.vue",
|
||||||
},
|
},
|
||||||
|
//合格数统计——光芯
|
||||||
|
{
|
||||||
|
name: "pass_num_gx",
|
||||||
|
path: "/statistic/pass_num_gx",
|
||||||
|
meta: {
|
||||||
|
title: "合格数统计",
|
||||||
|
icon: "el-icon-DataAnalysis",
|
||||||
|
perms: ["pass_num_gx"],
|
||||||
|
},
|
||||||
|
component: "statistics/pass_num_gx.vue",
|
||||||
|
},
|
||||||
|
//任务进度统计——光芯
|
||||||
|
{
|
||||||
|
name: "task_rate_gx",
|
||||||
|
path: "/statistic/task_rate_gx",
|
||||||
|
meta: {
|
||||||
|
title: "任务进度",
|
||||||
|
icon: "el-icon-DataAnalysis",
|
||||||
|
perms: ["task_rate_gx"],
|
||||||
|
},
|
||||||
|
component: "statistics/task_rate_gx.vue",
|
||||||
|
},
|
||||||
|
//库存统计——光芯
|
||||||
|
{
|
||||||
|
path: "/statistic_inm",
|
||||||
|
name: "statistic_inm",
|
||||||
|
meta: {
|
||||||
|
title: "库存统计",
|
||||||
|
icon: "el-icon-trend-charts",
|
||||||
|
perms: ["statistic_inm_gx"],
|
||||||
|
},
|
||||||
|
component: "statistics/statistics_inm.vue",
|
||||||
|
},
|
||||||
|
//过程检验统计——光芯
|
||||||
|
{
|
||||||
|
path: "/process_check_gx",
|
||||||
|
name: "process_check_gx",
|
||||||
|
meta: {
|
||||||
|
title: "过程检验统计",
|
||||||
|
icon: "el-icon-trend-charts",
|
||||||
|
perms: ["process_check_gx"],
|
||||||
|
},
|
||||||
|
component: "statistics/process_check_gx.vue",
|
||||||
|
},
|
||||||
|
//成品检验统计——光芯
|
||||||
|
{
|
||||||
|
path: "/good_check_gx",
|
||||||
|
name: "good_check_gx",
|
||||||
|
meta: {
|
||||||
|
title: "成品检验统计",
|
||||||
|
icon: "el-icon-trend-charts",
|
||||||
|
perms: ["good_check_gx"],
|
||||||
|
},
|
||||||
|
component: "statistics/good_check_gx.vue",
|
||||||
|
},
|
||||||
|
//扫边车间数据汇总——光芯
|
||||||
|
// {
|
||||||
|
// path: "/statistics_saobian",
|
||||||
|
// name: "statistics_saobian",
|
||||||
|
// meta: {
|
||||||
|
// title: "扫边车间统计",
|
||||||
|
// icon: "el-icon-trend-charts",
|
||||||
|
// perms: ["statistic_inm"],
|
||||||
|
// },
|
||||||
|
// component: "statistics/statistics_saobian.vue",
|
||||||
|
// },
|
||||||
//综合查询
|
//综合查询
|
||||||
{
|
{
|
||||||
name: "total_statistics",
|
name: "total_statistics",
|
||||||
|
|
|
@ -0,0 +1,992 @@
|
||||||
|
<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: 30%" :gutter="10">
|
||||||
|
<el-col :xs="7" :md="7" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle bgimg">
|
||||||
|
<div class="boxlabel">昨日黑化合格统计</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 4px"></div>
|
||||||
|
<div class="boxmain bigdata border">
|
||||||
|
<div v-for="item in yesHeihuaData" :key="item.物料名" class="lineDiv">
|
||||||
|
<span>{{ item.物料名 }}</span>
|
||||||
|
<span class="boxmainItemNumber">{{item.合格数}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="7" :md="7">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
昨日黑化不合格统计
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain" id="pieChart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="10" :md="10" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">黑化任务进度</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<scScrollTavle
|
||||||
|
v-if="table1Visible"
|
||||||
|
:tableHeight="tableHeight"
|
||||||
|
:rowData="processData1"
|
||||||
|
:titleData="liData"
|
||||||
|
:refValue="refValue1"
|
||||||
|
></scScrollTavle>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 退火 -->
|
||||||
|
<el-row style="height: 30%" :gutter="10">
|
||||||
|
<el-col :xs="7" :md="7" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle bgimg">
|
||||||
|
<div class="boxlabel">昨日退火合格统计</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 4px"></div>
|
||||||
|
<div class="boxmain bigdata border">
|
||||||
|
<!-- flex_center -->
|
||||||
|
<div v-for="item in yesTuihuoData" :key="item.物料名" class="lineDiv">
|
||||||
|
<span>{{ item.物料名 }}</span>
|
||||||
|
<span class="boxmainItemNumber">{{item.合格数}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="7" :md="7">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
昨日退火不合格统计
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain" id="pieChart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="10" :md="10" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">退火任务进度</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<scScrollTavle
|
||||||
|
v-if="table2Visible"
|
||||||
|
:tableHeight="tableHeight"
|
||||||
|
:rowData="processData2"
|
||||||
|
:titleData="liData"
|
||||||
|
:refValue="refValue2"
|
||||||
|
></scScrollTavle>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 合格数/合格率 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<el-col :xs="24" :md="12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">黑化车间本月合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :md="12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">黑化车间本月合格率统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain" 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 {
|
||||||
|
basicOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
backgroundColor: "rgb(1,235,239)",
|
||||||
|
name: "黑化",
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(250,205,0)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(254,129,0)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
backgroundColor: "rgb(250,205,0)",
|
||||||
|
name: "退火",
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(1,235,239)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(5, 158, 163)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
feature: {
|
||||||
|
// saveAsImage: {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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",
|
||||||
|
// stack: "Ad",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
borderRadius: [5, 5, 0, 0],
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(250,205,0)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(254,129,0)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
opacity: 0.8,
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(250,205,0)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(254,129,0)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
smooth: true,
|
||||||
|
// lineStyle: {
|
||||||
|
// width: 1,
|
||||||
|
// color: "rgb(1,235,239)",
|
||||||
|
// },
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "退火",
|
||||||
|
type: "bar",
|
||||||
|
// stack: "Ad",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
borderRadius: [5, 5, 0, 0],
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(1,235,239)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(5, 158, 163)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
opacity: 0.8,
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgb(1,235,239)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgb(5, 158, 163)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
},
|
||||||
|
smooth: true,
|
||||||
|
// lineStyle: {
|
||||||
|
// width: 1,
|
||||||
|
// color: "rgb(1,235,239)",
|
||||||
|
// },
|
||||||
|
data: [10,50,80,60,65,58,70,80,90,100,110,120],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
top: "bottom",
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: "不合格统计",
|
||||||
|
type: "pie",
|
||||||
|
radius: "50%",
|
||||||
|
itemStyle: {
|
||||||
|
borderRadius: 2,
|
||||||
|
},
|
||||||
|
center: ["50%", "45%"],
|
||||||
|
data: [
|
||||||
|
{ value: 0, name: "划伤" },
|
||||||
|
{ value: 0, name: "气泡" },
|
||||||
|
{ value: 0, name: "水纹" },
|
||||||
|
{ value: 0, name: "崩边" },
|
||||||
|
{ value: 0, name: "雾面" },
|
||||||
|
{ value: 0, name: "麻点" },
|
||||||
|
{ value: 0, name: "线痕" },
|
||||||
|
{ value: 0, name: "破损" },
|
||||||
|
{ value: 0, name: "其他" },
|
||||||
|
],
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: "rgba(0, 0, 0, 0.5)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
table1Visible: false,
|
||||||
|
table2Visible: false,
|
||||||
|
refValue1: "moocBox1",
|
||||||
|
refValue2: "moocBox2",
|
||||||
|
liData: ["序号","产出名称","规格","型号","开始时间","结束时间","完成进度","产量","状态"],
|
||||||
|
processData1: [],
|
||||||
|
processData2: [],
|
||||||
|
todayMtask: [],
|
||||||
|
speed: 2000,
|
||||||
|
myScroll: null,
|
||||||
|
iliHeight: 30,
|
||||||
|
time: null,
|
||||||
|
delay: 20,
|
||||||
|
start_date: "",
|
||||||
|
end_date: "",
|
||||||
|
yesterday: "",
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
chartInterval3: null,
|
||||||
|
stateOption: {
|
||||||
|
30: "生产中",
|
||||||
|
40: "已完成",
|
||||||
|
},
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
yesterdayObjet: {},
|
||||||
|
yesHeihuaData:[
|
||||||
|
{年: 2024, 月: 7, 日: 5, 物料名: "CNC_黑化", 生产数: 260, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0},
|
||||||
|
],
|
||||||
|
yesTuihuoData:[
|
||||||
|
{年: 2024, 月: 7, 日: 5, 物料名: "CNC_退火", 生产数: 250, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.table1Visible = true;
|
||||||
|
this.table2Visible = true;
|
||||||
|
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
this.days = days;
|
||||||
|
this.currentYear = year;
|
||||||
|
this.currentMonth = month;
|
||||||
|
this.currentDay = day;
|
||||||
|
month = month < 10 ? "0" + month : month;
|
||||||
|
this.start_date = year + "-" + month + "-01";
|
||||||
|
this.end_date =
|
||||||
|
year + "-" + month + "-" + new Date(year, month, 0).getDate();
|
||||||
|
this.today = year + "-" + month + "-" + day;
|
||||||
|
let yesterday = new Date(date.getTime() - 24 * 60 * 60 * 1000);
|
||||||
|
this.yesterday =
|
||||||
|
yesterday.getFullYear() +
|
||||||
|
"-" +
|
||||||
|
(yesterday.getMonth() + 1) +
|
||||||
|
"-" +
|
||||||
|
yesterday.getDate();
|
||||||
|
this.getProductLine1();
|
||||||
|
// this.getProductLine2();
|
||||||
|
this.getMtask1();
|
||||||
|
this.getMtask2();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//时间
|
||||||
|
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) {
|
||||||
|
// 根据name 渲染数据, option需填写,否则option为模拟数据
|
||||||
|
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.basicOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//黑化合格数统计
|
||||||
|
getProductLine1() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {
|
||||||
|
start_date: that.start_date,
|
||||||
|
end_date: that.end_date,
|
||||||
|
mgroup_name: "黑化",
|
||||||
|
"group_bys_material": "",
|
||||||
|
"order_bys_material": "",
|
||||||
|
"select_cols_material": "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => {
|
||||||
|
console.log("本月黑化生产统计:", res);
|
||||||
|
let list2 = res.data2.ds0;
|
||||||
|
let seriesData1 = [],
|
||||||
|
seriesData2 = [],
|
||||||
|
seriesData3 = [];
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
seriesData1[i] = 0;
|
||||||
|
seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list2.length > 0) {
|
||||||
|
list2.forEach((item2) => {
|
||||||
|
let index2 = item2.日 - 1;
|
||||||
|
//合格率=当天的合格数/当天的总生产数
|
||||||
|
seriesData1[index2] += item2.合格数;
|
||||||
|
seriesData2[index2] += item2.生产数;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
if(seriesData2[i]>0&&seriesData1[i] >=0){
|
||||||
|
seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ;
|
||||||
|
}else{
|
||||||
|
seriesData3[i]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let chart1Option = deepCopy(this.basicOption);
|
||||||
|
let chart2Option = deepCopy(this.basicOption);
|
||||||
|
|
||||||
|
|
||||||
|
chart1Option.series[0].data = seriesData1;
|
||||||
|
chart2Option.series[0].type = 'line';
|
||||||
|
chart2Option.series[0].data = seriesData3;
|
||||||
|
that.getProductLine2(chart1Option,chart2Option);
|
||||||
|
});
|
||||||
|
|
||||||
|
//黑化生产昨日统计
|
||||||
|
let obj2 = {
|
||||||
|
query: {
|
||||||
|
start_date: that.yesterday,
|
||||||
|
end_date: that.yesterday,
|
||||||
|
mgroup_name: "黑化",
|
||||||
|
"group_bys_material": "",
|
||||||
|
"order_bys_material": "",
|
||||||
|
"select_cols_material": "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => {
|
||||||
|
// console.log("黑化生产昨日统计:", res2);
|
||||||
|
that.yesHeihuaData = res2.data2.ds0;
|
||||||
|
let pieOption = deepCopy(that.pieOption);
|
||||||
|
if (res2.data2.ds0.length > 0) {
|
||||||
|
res2.data2.ds0.forEach((item) => {
|
||||||
|
pieOption.series.data[0].value += item.划伤;
|
||||||
|
pieOption.series.data[1].value += item.气泡;
|
||||||
|
pieOption.series.data[2].value = item.水纹;
|
||||||
|
pieOption.series.data[3].value = item.崩边;
|
||||||
|
pieOption.series.data[4].value = item.雾面;
|
||||||
|
pieOption.series.data[5].value = item.麻点;
|
||||||
|
pieOption.series.data[5].value = item.线痕;
|
||||||
|
pieOption.series.data[5].value = item.破损;
|
||||||
|
pieOption.series.data[5].value = item.其他;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let pieChart1 = this.setChart("pieChart1", pieOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval3 = setInterval(function () {
|
||||||
|
if (index1 < that.pieOption.series.data.length) {
|
||||||
|
pieChart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
pieChart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
pieChart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
debugger;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//退火合格数统计
|
||||||
|
getProductLine2(chart1Option,chart2Option) {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {
|
||||||
|
start_date: that.start_date,
|
||||||
|
end_date: that.end_date,
|
||||||
|
mgroup_name: "退火",
|
||||||
|
"group_bys_material": "",
|
||||||
|
"order_bys_material": "",
|
||||||
|
"select_cols_material": "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => {
|
||||||
|
// console.log("本月退火生产统计:", res);
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData1 = [],
|
||||||
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
xAxisData = [];
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
let day = i + 1;
|
||||||
|
let text = day + "日";
|
||||||
|
xAxisData[i] = text;
|
||||||
|
seriesData1[i] = 0;
|
||||||
|
seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item2) => {
|
||||||
|
let index2 = item2.日 - 1;
|
||||||
|
seriesData1[index2] += item2.合格数;
|
||||||
|
seriesData2[index2] += item2.生产数;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
if(seriesData2[i]>0&&seriesData1[i] >=0){
|
||||||
|
seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ;
|
||||||
|
}else{
|
||||||
|
seriesData3[i]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chart1Option.xAxis.data = xAxisData;
|
||||||
|
chart2Option.xAxis.data = xAxisData;
|
||||||
|
|
||||||
|
|
||||||
|
chart1Option.series[1].data = seriesData1;
|
||||||
|
chart2Option.series[1].type = 'line';
|
||||||
|
chart2Option.series[1].data = seriesData3;
|
||||||
|
|
||||||
|
let chart1 = this.setChart("chart1", chart1Option);
|
||||||
|
let chart2 = this.setChart("chart2", chart2Option);
|
||||||
|
|
||||||
|
let index2 = 0;
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < chart1Option.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,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
|
||||||
|
//车间生产昨日统计
|
||||||
|
let obj2 = {
|
||||||
|
query: {
|
||||||
|
start_date: that.yesterday,
|
||||||
|
end_date: that.yesterday,
|
||||||
|
mgroup_name: "退火",
|
||||||
|
"group_bys_material": "",
|
||||||
|
"order_bys_material": "",
|
||||||
|
"select_cols_material": "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => {
|
||||||
|
// console.log("车间生产昨日统计:", res2);
|
||||||
|
that.yesTuihuoData = res2.data2.ds0;
|
||||||
|
let pieOption = deepCopy(that.pieOption);
|
||||||
|
if (res2.data2.ds0.length > 0) {
|
||||||
|
res2.data2.ds0.forEach((item) => {
|
||||||
|
pieOption.series.data[0].value += item.划伤;
|
||||||
|
pieOption.series.data[1].value += item.气泡;
|
||||||
|
pieOption.series.data[2].value = item.水纹;
|
||||||
|
pieOption.series.data[3].value = item.崩边;
|
||||||
|
pieOption.series.data[4].value = item.雾面;
|
||||||
|
pieOption.series.data[5].value = item.麻点;
|
||||||
|
pieOption.series.data[5].value = item.线痕;
|
||||||
|
pieOption.series.data[5].value = item.破损;
|
||||||
|
pieOption.series.data[5].value = item.其他;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let pieChart2 = this.setChart("pieChart2", pieOption);
|
||||||
|
let index2 = 0;
|
||||||
|
this.chartInterval3 = setInterval(function () {
|
||||||
|
if (index2 < pieOption.series.data.length) {
|
||||||
|
pieChart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
pieChart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
pieChart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
debugger;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//黑化任务进度
|
||||||
|
getMtask1() {
|
||||||
|
let that = this;
|
||||||
|
that.$API.mtm.mgroup.list.req({ page: 0, search: '黑化'})
|
||||||
|
.then((res) => {
|
||||||
|
if(res.length != 1){
|
||||||
|
that.$message.error("获取工段错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let mgroup = res[0].id;
|
||||||
|
let obj = {};
|
||||||
|
// obj.start_date__gte = this.start_date;
|
||||||
|
// obj.end_date__lte = this.end_date;
|
||||||
|
obj.mgroup = mgroup;
|
||||||
|
obj.page = 0;
|
||||||
|
that.$API.pm.mtask.list.req(obj).then((res) => {
|
||||||
|
let processData = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
let arr = [],
|
||||||
|
obj1 = {},
|
||||||
|
obj2 = {},
|
||||||
|
obj3 = {},
|
||||||
|
obj4 = {},
|
||||||
|
obj5 = {},
|
||||||
|
obj6 = {},
|
||||||
|
obj7 = {},
|
||||||
|
obj8 = {};
|
||||||
|
obj1.elType = "primary";
|
||||||
|
obj1.value = item.material_out_.name;
|
||||||
|
obj2.elType = "primary";
|
||||||
|
obj2.value = item.material_out_.specification;
|
||||||
|
obj8.elType = "primary";
|
||||||
|
obj8.value = item.material_out_.model;
|
||||||
|
obj3.elType = "primary";
|
||||||
|
obj3.value = item.start_date;
|
||||||
|
obj4.elType = "primary";
|
||||||
|
obj4.value = item.end_date;
|
||||||
|
obj5.elType = "progress";
|
||||||
|
let process = Math.round(
|
||||||
|
(item.count_ok / item.count) * 100
|
||||||
|
);
|
||||||
|
obj5.value = process;
|
||||||
|
obj6.elType = "primary";
|
||||||
|
obj6.value = item.count_ok;
|
||||||
|
obj7.elType = "tag";
|
||||||
|
obj7.value = item.state;
|
||||||
|
arr.push(obj1);
|
||||||
|
arr.push(obj2);
|
||||||
|
arr.push(obj8);
|
||||||
|
arr.push(obj3);
|
||||||
|
arr.push(obj4);
|
||||||
|
arr.push(obj5);
|
||||||
|
arr.push(obj6);
|
||||||
|
arr.push(obj7);
|
||||||
|
processData.push(arr);
|
||||||
|
});
|
||||||
|
this.processData1 = processData;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//退火任务进度
|
||||||
|
getMtask2() {
|
||||||
|
let that = this;
|
||||||
|
that.$API.mtm.mgroup.list.req({ page: 0, search: '退火'})
|
||||||
|
.then((res) => {
|
||||||
|
if(res.length != 1){
|
||||||
|
that.$message.error("获取工段错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let mgroup = res[0].id;
|
||||||
|
let obj = {};
|
||||||
|
// obj.start_date__gte = this.start_date;
|
||||||
|
// obj.end_date__lte = this.end_date;
|
||||||
|
obj.mgroup = mgroup;
|
||||||
|
obj.page = 0;
|
||||||
|
that.$API.pm.mtask.list.req(obj).then((res) => {
|
||||||
|
let processData = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
let arr = [],
|
||||||
|
obj1 = {},
|
||||||
|
obj2 = {},
|
||||||
|
obj3 = {},
|
||||||
|
obj4 = {},
|
||||||
|
obj5 = {},
|
||||||
|
obj6 = {},
|
||||||
|
obj7 = {},
|
||||||
|
obj8 = {};
|
||||||
|
obj1.elType = "primary";
|
||||||
|
obj1.value = item.material_out_.name;
|
||||||
|
obj2.elType = "primary";
|
||||||
|
obj2.value = item.material_out_.specification;
|
||||||
|
obj8.elType = "primary";
|
||||||
|
obj8.value = item.material_out_.model;
|
||||||
|
obj3.elType = "primary";
|
||||||
|
obj3.value = item.start_date;
|
||||||
|
obj4.elType = "primary";
|
||||||
|
obj4.value = item.end_date;
|
||||||
|
obj5.elType = "progress";
|
||||||
|
let process = Math.round(
|
||||||
|
(item.count_ok / item.count) * 100
|
||||||
|
);
|
||||||
|
obj5.value = process;
|
||||||
|
obj6.elType = "primary";
|
||||||
|
obj6.value = item.count_ok;
|
||||||
|
obj7.elType = "tag";
|
||||||
|
obj7.value = item.state;
|
||||||
|
arr.push(obj1);
|
||||||
|
arr.push(obj2);
|
||||||
|
arr.push(obj8);
|
||||||
|
arr.push(obj3);
|
||||||
|
arr.push(obj4);
|
||||||
|
arr.push(obj5);
|
||||||
|
arr.push(obj6);
|
||||||
|
arr.push(obj7);
|
||||||
|
processData.push(arr);
|
||||||
|
});
|
||||||
|
this.processData2 = processData;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</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;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 40px);
|
||||||
|
}
|
||||||
|
.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%;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -171,6 +171,14 @@ export default {
|
||||||
}
|
}
|
||||||
return classInfo;
|
return classInfo;
|
||||||
},
|
},
|
||||||
|
precen(a, b) {
|
||||||
|
if (b !== 0 && b !== null && a !== null) {
|
||||||
|
let precen = (a / b)* 100;
|
||||||
|
return precen.toFixed(2) + "%";
|
||||||
|
} else {
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
|
@ -255,11 +263,11 @@ export default {
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate = 0;
|
let lastRate = 0;
|
||||||
if (
|
if (
|
||||||
lastDiff == "/" &&
|
lastDiff !== "/" &&
|
||||||
lastNum !== "/" &&
|
lastNum !== "/" &&
|
||||||
lastNum !== 0
|
lastNum !== 0
|
||||||
) {
|
) {
|
||||||
lastRate = (lastDiff / lastNum) * 100;
|
lastRate = this.precen(lastDiff, lastNum);
|
||||||
} else {
|
} else {
|
||||||
lastRate = "/";
|
lastRate = "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,11 +136,11 @@ export default {
|
||||||
params.year = that.query.year_s;
|
params.year = that.query.year_s;
|
||||||
params.mgroup = that.query.mgroup;
|
params.mgroup = that.query.mgroup;
|
||||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
let data = [];
|
// let data = [];
|
||||||
if (res.length > 0) {
|
// if (res.length > 0) {
|
||||||
data = res[0];
|
// this.data = res;
|
||||||
}
|
// }
|
||||||
that.getData(data);
|
that.getData(res);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData(goalData) {
|
getData(goalData) {
|
||||||
|
@ -215,46 +215,81 @@ export default {
|
||||||
? item.入窑生料_Fe2O3_rate_pass
|
? item.入窑生料_Fe2O3_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
arr[8] =
|
arr[8] =
|
||||||
item.入窑生料_细度_rate_pass != null
|
item.出磨煤粉_细度_rate_pass != null
|
||||||
? item.入窑生料_细度_rate_pass
|
? item.出磨煤粉_细度_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
arr[9] =
|
arr[9] =
|
||||||
item.入窑生料_水分_rate_pass != null
|
item.出磨煤粉_水分_rate_pass != null
|
||||||
? item.入窑生料_水分_rate_pass
|
? item.出磨煤粉_水分_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
arr[10] =
|
arr[10] =
|
||||||
item.熟料_立升重_rate_pass != null
|
item.出窑熟料_立升重_rate_pass != null
|
||||||
? item.熟料_立升重_rate_pass
|
? item.出窑熟料_立升重_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
arr[11] =
|
arr[11] =
|
||||||
item.熟料_fCaO_rate_pass != null
|
item.出窑熟料_fCaO_rate_pass != null
|
||||||
? item.熟料_fCaO_rate_pass
|
? item.出窑熟料_fCaO_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
|
|
||||||
//煤耗
|
//煤耗
|
||||||
arr[12] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[12] = item.coal_consume_unit; //当期值(KW·h/t)
|
||||||
let keyVale = "goal_val_" + n;
|
let keyValue = "goal_val_" + n;
|
||||||
arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
if (goalData.length > 0){
|
||||||
arr[6] = arr[4] - item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
goalData.forEach((item) => {
|
||||||
|
if (item.id == "3638341891940192256") {
|
||||||
|
arr[13] = item[keyValue]; //目标值(KW·h/t)//需要接口获取
|
||||||
|
}else if (item.id == "3637651365016526848"){
|
||||||
|
arr[25] = item[keyValue]; //目标值(KW·h/t)//需要接口获取
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
let dq = 0
|
||||||
|
if (arr[13] !== null && arr[13] !== undefined){
|
||||||
|
dq = arr[12] - arr[13]; //当期与目标差值(KW·h/t)
|
||||||
|
}else{
|
||||||
|
dq == "/"
|
||||||
|
};
|
||||||
|
arr[14] = dq; //当期与目标差值
|
||||||
let ind_pre = 0,
|
let ind_pre = 0,
|
||||||
huanbi = 0;
|
huanbi = 0;
|
||||||
if (item.month_s == 1) {
|
if (item.month_s == 1) {
|
||||||
ind_pre = 12;
|
ind_pre = 12;
|
||||||
huanbi = wrapArr0[ind_pre]
|
huanbi = wrapArr0[ind_pre]
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].coal_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = ind - 1;
|
ind_pre = ind - 1;
|
||||||
huanbi = wrapArr[ind_pre]
|
huanbi = wrapArr[ind_pre]
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
? wrapArr[ind_pre].coal_consume_unit
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
? wrapArr[ind_pre].coal_consume_unit
|
||||||
: "/"
|
: "/"
|
||||||
: "/";
|
: "/";
|
||||||
}
|
}
|
||||||
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
arr[16] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
if(huanbi !=="/"){
|
||||||
arr[17] = item.celec_consume_unit; //环比增长率(%)
|
arr[16] = arr[12] - huanbi; //当期与环期差值(KW·h/t)
|
||||||
arr[18] = item.celec_consume_unit; //同比增长率(%)
|
}else{
|
||||||
|
arr[16] = "/"
|
||||||
|
};
|
||||||
|
if (arr[15] !== "/"&& arr[15]!== 0 && arr[16]!=="/") {
|
||||||
|
arr[17] = (arr[16] / arr[15]) * 100; //环比增长率(%)
|
||||||
|
} else{
|
||||||
|
arr[17] = "/"
|
||||||
|
};
|
||||||
|
let sameRate = 0;
|
||||||
|
if (
|
||||||
|
wrapArr0[ind] &&
|
||||||
|
wrapArr0[ind].coal_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[ind].coal_consume_unit) /
|
||||||
|
wrapArr0[ind].coal_consume_unit) *
|
||||||
|
100;
|
||||||
|
} else {
|
||||||
|
sameRate = "/";
|
||||||
|
}
|
||||||
|
arr[18] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
//电耗
|
//电耗
|
||||||
//设备
|
//设备
|
||||||
arr[19] =
|
arr[19] =
|
||||||
|
@ -278,8 +313,10 @@ export default {
|
||||||
? item.窑头排风机_consume_unit
|
? item.窑头排风机_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
arr[24] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[24] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
// arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[26] = item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
if (item.elec_consume_unit != null &&item.elec_consume_unit !== "/"){
|
||||||
|
arr[26] = arr[24]-arr[25] //当期与目标差值(KW·h/t)
|
||||||
|
}
|
||||||
let ind_pre1 = 0,
|
let ind_pre1 = 0,
|
||||||
huanbi1 = 0;
|
huanbi1 = 0;
|
||||||
if (item.month_s == 1) {
|
if (item.month_s == 1) {
|
||||||
|
@ -296,13 +333,18 @@ export default {
|
||||||
: "/";
|
: "/";
|
||||||
}
|
}
|
||||||
arr[27] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[27] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
arr[28] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
if(arr[27]!=="/" && huanbi1!=="/"){
|
||||||
arr[29] = item.celec_consume_unit; //环比增长率(%)
|
arr[28] = arr[24] - huanbi1; //当期与环期差值(KW·h/t)
|
||||||
|
}else{
|
||||||
|
arr[28] = "/"
|
||||||
|
}
|
||||||
|
if(arr[28]!=="/" && huanbi1!=="/"){
|
||||||
|
arr[29] = (arr[28] / huanbi1) * 100; //环比增长率(%)
|
||||||
|
}else{
|
||||||
|
arr[29] = "/"}; //环比增长率(%)
|
||||||
arr[30] = item.celec_consume_unit; //同比增长率(%)
|
arr[30] = item.celec_consume_unit; //同比增长率(%)
|
||||||
arr[31] = item.celec_consume_unit; //同比增长率(%)
|
|
||||||
wrapArr[ind] = arr;
|
wrapArr[ind] = arr;
|
||||||
});
|
});
|
||||||
console.log(wrapArr);
|
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,9 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas" :key="item">
|
<tr v-for="(item, index) in tableDatas" :key="item">
|
||||||
<td class="numCell">{{ item[0] }}</td>
|
<td rowspan="8" v-if="index == 0" class="numCell">{{ item[0] }}</td>
|
||||||
|
<td v-else-if="index==8||index==9" class="numCell">{{ item[0] }}</td>
|
||||||
<td class="numCell">{{ item[1] }}</td>
|
<td class="numCell">{{ item[1] }}</td>
|
||||||
<td
|
<td
|
||||||
class="numCell hoursItem"
|
class="numCell hoursItem"
|
||||||
|
@ -59,9 +60,9 @@
|
||||||
>
|
>
|
||||||
{{ item[4] }}
|
{{ item[4] }}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell">{{ item[5].toFixed(2) }}</td>
|
<td class="numCell">{{ item[5] }}</td>
|
||||||
<td class="numCell">{{ item[6] }}</td>
|
<td class="numCell">{{ item[6] }}</td>
|
||||||
<td class="numCell">{{ item[7].toFixed(2) }}</td>
|
<td class="numCell">{{ item[7] }}</td>
|
||||||
<td class="numCell">{{ item[8] }}</td>
|
<td class="numCell">{{ item[8] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -326,8 +327,18 @@ export default {
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
["出厂水泥", "P.O42.5R 散装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
["能耗", "单位产品分布电耗(KW·h/t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
["出厂水泥", "P.O42.5R 袋装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "P.O42.5 袋装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "P.O42.5 散装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "P.C42.5 袋装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "P.C42.5 散装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "P.O52.5 散装(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["出厂水泥", "出厂水泥合计(t)", 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
|
||||||
|
["出厂熟料", "熟料(t)", 0, 0, 0, "/", "/", "/","/"],
|
||||||
|
["能耗", "单位产品分布电耗(KW·h/t)", 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
|
||||||
],
|
],
|
||||||
tableName: "生产报告",
|
tableName: "生产报告",
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
|
@ -360,6 +371,54 @@ export default {
|
||||||
yAxisIndex: 0,
|
yAxisIndex: 0,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5R 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5R 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.C42.5 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.C42.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O52.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "熟料",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "分布电耗",
|
name: "分布电耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
|
@ -384,12 +443,60 @@ export default {
|
||||||
},
|
},
|
||||||
yAxis: yAxis,
|
yAxis: yAxis,
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "总产量",
|
name: "总产量",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
yAxisIndex: 0,
|
yAxisIndex: 0,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5R 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5R 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O42.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.C42.5 袋装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.C42.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "P.O52.5 散装",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "熟料",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "分布电耗",
|
name: "分布电耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
|
@ -440,43 +547,69 @@ export default {
|
||||||
params1.year_s = year;
|
params1.year_s = year;
|
||||||
params1.type = "year_s";
|
params1.type = "year_s";
|
||||||
params1.mgroup = that.query.mgroup;
|
params1.mgroup = that.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params1).then((res1) => {
|
this.$API.enm.mpointstat.list.req(params1).then((res1) => {
|
||||||
if (res1.length > 0) {
|
if (res1.length > 0) {
|
||||||
let data1 = res1[0];
|
res1.forEach((item) => {
|
||||||
that.tableDatas[0][4] = data1.total_production;
|
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
|
||||||
that.tableDatas[1][4] = data1.elec_consume_unit;
|
that.tableDatas[0][4] = item.val;
|
||||||
}
|
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
|
||||||
});
|
that.tableDatas[1][4] = item.val;
|
||||||
//月
|
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
|
||||||
|
that.tableDatas[2][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
|
||||||
|
that.tableDatas[3][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 袋装") {
|
||||||
|
that.tableDatas[4][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
|
||||||
|
that.tableDatas[5][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
|
||||||
|
that.tableDatas[6][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂批次水泥合计") {
|
||||||
|
that.tableDatas[7][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂熟料"){
|
||||||
|
that.tableDatas[8][4] = item.val;
|
||||||
|
}else if (item.mpoint_name == "包装进线") {
|
||||||
|
that.tableDatas[9][4] = item.val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
}).then(()=>{
|
||||||
|
//月
|
||||||
let params2 = {};
|
let params2 = {};
|
||||||
params2.page = 0;
|
params2.page = 0;
|
||||||
params2.year_s = year;
|
params2.year_s = year;
|
||||||
params2.month_s = month;
|
params2.month_s = month;
|
||||||
params2.type = "month_s";
|
params2.type = "month_s";
|
||||||
params2.mgroup = that.query.mgroup;
|
params2.mgroup = that.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params2).then((res2) => {
|
this.$API.enm.mpointstat.list.req(params2).then((res2) => {
|
||||||
if (res2.length > 0) {
|
if (res2.length > 0) {
|
||||||
let data2 = res2[0];
|
res2.forEach((item) => {
|
||||||
that.tableDatas[0][3] = data2.total_production;
|
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
|
||||||
that.tableDatas[1][3] = data2.elec_consume_unit;
|
that.tableDatas[0][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
|
||||||
|
that.tableDatas[1][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
|
||||||
|
that.tableDatas[2][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
|
||||||
|
that.tableDatas[3][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 袋装") {
|
||||||
|
that.tableDatas[4][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
|
||||||
|
that.tableDatas[5][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
|
||||||
|
that.tableDatas[6][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂批次水泥合计") {
|
||||||
|
that.tableDatas[7][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂熟料"){
|
||||||
|
that.tableDatas[8][3] = item.val;
|
||||||
|
}else if (item.mpoint_name == "包装进线") {
|
||||||
|
that.tableDatas[9][3] = item.val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
});
|
}).then(() => {
|
||||||
//昨日
|
//月年目标
|
||||||
let params3 = {};
|
|
||||||
params3.page = 0;
|
|
||||||
params3.year_s = year_d;
|
|
||||||
params3.month_s = month_d;
|
|
||||||
params3.day_s = days_d;
|
|
||||||
params3.type = "day_s";
|
|
||||||
params3.mgroup = that.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
|
||||||
if (res3.length > 0) {
|
|
||||||
let data3 = res3[0];
|
|
||||||
that.tableDatas[0][2] = data3.total_production;
|
|
||||||
that.tableDatas[1][2] = data3.elec_consume_unit;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//月目标
|
|
||||||
let params5 = {};
|
let params5 = {};
|
||||||
params5.page = 0;
|
params5.page = 0;
|
||||||
params5.mgroup = that.query.mgroup;
|
params5.mgroup = that.query.mgroup;
|
||||||
|
@ -488,63 +621,121 @@ export default {
|
||||||
data5.forEach((item5) => {
|
data5.forEach((item5) => {
|
||||||
let str = "goal_val_" + that.month;
|
let str = "goal_val_" + that.month;
|
||||||
if (item5.goal_cate_name == "总产量(t)") {
|
if (item5.goal_cate_name == "总产量(t)") {
|
||||||
that.tableDatas[0][5] = item5[str];
|
that.tableDatas[7][5] = item5[str];
|
||||||
that.tableDatas[0][7] = item5.goal_val;
|
that.tableDatas[7][7] = item5.goal_val;
|
||||||
|
that.tableDatas[7][8] = precen(
|
||||||
|
that.tableDatas[7][4],
|
||||||
|
that.tableDatas[7][7]
|
||||||
|
);//计算年完成度
|
||||||
|
that.tableDatas[7][6] = precen(
|
||||||
|
that.tableDatas[7][3],
|
||||||
|
that.tableDatas[7][5]
|
||||||
|
);// 计算月完成度
|
||||||
|
|
||||||
} else if (
|
} else if (
|
||||||
item5.goal_cate_name ==
|
item5.goal_cate_name ==
|
||||||
"单位产品分布电耗(KW·h/t)"
|
"单位产品分布电耗(KW·h/t)"
|
||||||
) {
|
) {
|
||||||
that.tableDatas[1][5] = item5[str];
|
that.tableDatas[9][5] = item5[str];
|
||||||
that.tableDatas[1][7] = item5.goal_val;
|
that.tableDatas[9][7] = item5.goal_val;
|
||||||
|
//计算月目标值
|
||||||
|
that.tableDatas[9][8] = precen(
|
||||||
|
that.tableDatas[9][4],
|
||||||
|
that.tableDatas[9][7]
|
||||||
|
);//计算年完成度
|
||||||
|
that.tableDatas[9][6] = precen(
|
||||||
|
that.tableDatas[9][3],
|
||||||
|
that.tableDatas[9][5]
|
||||||
|
);// 计算月完成度
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
//年
|
|
||||||
let params1 = {};
|
|
||||||
params1.page = 0;
|
|
||||||
params1.year_s = year;
|
|
||||||
params1.type = "year_s";
|
|
||||||
params1.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params1).then((res1) => {
|
|
||||||
if (res1.length > 0) {
|
|
||||||
let data1 = res1[0];
|
|
||||||
that.tableDatas[0][4] = data1.total_production;
|
|
||||||
that.tableDatas[0][8] = precen(
|
|
||||||
that.tableDatas[0][4],
|
|
||||||
that.tableDatas[0][7]
|
|
||||||
);
|
|
||||||
that.tableDatas[1][4] = data1.elec_consume_unit;
|
|
||||||
that.tableDatas[1][8] = precen(
|
|
||||||
that.tableDatas[1][4],
|
|
||||||
that.tableDatas[1][7]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//月
|
|
||||||
let params2 = {};
|
|
||||||
params2.page = 0;
|
|
||||||
params2.year_s = year;
|
|
||||||
params2.month_s = month;
|
|
||||||
params2.type = "month_s";
|
|
||||||
params2.mgroup = this.query.mgroup;
|
|
||||||
this.$API.enm.enstat.req(params2).then((res2) => {
|
|
||||||
if (res2.length > 0) {
|
|
||||||
let data2 = res2[0];
|
|
||||||
that.tableDatas[0][3] = data2.total_production;
|
|
||||||
that.tableDatas[0][6] = precen(
|
|
||||||
that.tableDatas[0][3],
|
|
||||||
that.tableDatas[0][5]
|
|
||||||
);
|
|
||||||
that.tableDatas[1][3] = data2.elec_consume_unit;
|
|
||||||
that.tableDatas[1][6] = precen(
|
|
||||||
that.tableDatas[1][3],
|
|
||||||
that.tableDatas[1][5]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
});
|
||||||
|
//昨日
|
||||||
|
let params3 = {};
|
||||||
|
params3.page = 0;
|
||||||
|
params3.year_s = year_d;
|
||||||
|
params3.month_s = month_d;
|
||||||
|
params3.day_s = days_d;
|
||||||
|
params3.type = "day_s";
|
||||||
|
params3.mgroup = that.query.mgroup;
|
||||||
|
this.$API.enm.mpointstat.list.req(params3).then((res3) => {
|
||||||
|
if (res3.length > 0) {
|
||||||
|
res3.forEach((item) => {
|
||||||
|
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
|
||||||
|
that.tableDatas[0][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
|
||||||
|
that.tableDatas[1][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
|
||||||
|
that.tableDatas[2][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
|
||||||
|
that.tableDatas[3][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 袋装") {
|
||||||
|
that.tableDatas[4][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
|
||||||
|
that.tableDatas[5][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
|
||||||
|
that.tableDatas[6][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂批次水泥合计") {
|
||||||
|
that.tableDatas[7][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂熟料"){
|
||||||
|
that.tableDatas[8][2] = item.val;
|
||||||
|
}else if (item.mpoint_name == "包装进线") {
|
||||||
|
that.tableDatas[9][2] = item.val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// this.$API.mtm.goal.list
|
||||||
|
// .then((res) => {
|
||||||
|
// //月年完成度
|
||||||
|
// let params1 = {};
|
||||||
|
// params1.page = 0;
|
||||||
|
// params1.year_s = year;
|
||||||
|
// params1.type = "year_s";
|
||||||
|
// params1.mgroup = this.query.mgroup;
|
||||||
|
// this.$API.enm.enstat.req(params1).then((res1) => {
|
||||||
|
// if (res1.length > 0) {
|
||||||
|
// let data1 = res1[0];
|
||||||
|
// that.tableDatas[0][4] = data1.total_production;
|
||||||
|
// that.tableDatas[0][8] = precen(
|
||||||
|
// that.tableDatas[0][4],
|
||||||
|
// that.tableDatas[0][7]
|
||||||
|
// );
|
||||||
|
// that.tableDatas[1][4] = data1.elec_consume_unit;
|
||||||
|
// that.tableDatas[1][8] = precen(
|
||||||
|
// that.tableDatas[1][4],
|
||||||
|
// that.tableDatas[1][7]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// //月
|
||||||
|
// let params2 = {};
|
||||||
|
// params2.page = 0;
|
||||||
|
// params2.year_s = year;
|
||||||
|
// params2.month_s = month;
|
||||||
|
// params2.type = "month_s";
|
||||||
|
// params2.mgroup = this.query.mgroup;
|
||||||
|
// this.$API.enm.enstat.req(params2).then((res2) => {
|
||||||
|
// if (res2.length > 0) {
|
||||||
|
// let data2 = res2[0];
|
||||||
|
// that.tableDatas[0][3] = data2.total_production;
|
||||||
|
// that.tableDatas[0][6] = precen(
|
||||||
|
// that.tableDatas[0][3],
|
||||||
|
// that.tableDatas[0][5]
|
||||||
|
// );
|
||||||
|
// that.tableDatas[1][3] = data2.elec_consume_unit;
|
||||||
|
// that.tableDatas[1][6] = precen(
|
||||||
|
// that.tableDatas[1][3],
|
||||||
|
// that.tableDatas[1][5]
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
that.getDayData(year, month);
|
that.getDayData(year, month);
|
||||||
that.getMonthData(year);
|
that.getMonthData(year);
|
||||||
});
|
});
|
||||||
|
@ -572,7 +763,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据-图表
|
||||||
getDayData(year, month) {
|
getDayData(year, month) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query1 = {};
|
let query1 = {};
|
||||||
|
@ -581,19 +772,53 @@ export default {
|
||||||
query1.month_s = month;
|
query1.month_s = month;
|
||||||
query1.type = "day_s";
|
query1.type = "day_s";
|
||||||
query1.mgroup = this.query.mgroup;
|
query1.mgroup = this.query.mgroup;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
this.$API.enm.mpointstat.list.req(query1).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [];
|
seriesData1 = [],
|
||||||
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
seriesData4 = [],
|
||||||
|
seriesData5 = [],
|
||||||
|
seriesData6 = [],
|
||||||
|
seriesData7 = [],
|
||||||
|
seriesData8 = [],
|
||||||
|
seriesData9 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.day_s - 1;
|
let ind = item.day_s - 1;
|
||||||
seriesData0[ind] = item.total_production;
|
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
|
||||||
seriesData1[ind] = item.elec_consume_unit;
|
seriesData1[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
|
||||||
|
seriesData2[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
|
||||||
|
seriesData3[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
|
||||||
|
seriesData4[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 袋装") {
|
||||||
|
seriesData5[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
|
||||||
|
seriesData6[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
|
||||||
|
seriesData7[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂批次水泥合计") {
|
||||||
|
seriesData0[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂熟料"){
|
||||||
|
seriesData8[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "包装进线") {
|
||||||
|
seriesData9[ind] = item.val;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
|
options.series[2].data = seriesData2;
|
||||||
|
options.series[3].data = seriesData3;
|
||||||
|
options.series[4].data = seriesData4;
|
||||||
|
options.series[5].data = seriesData5;
|
||||||
|
options.series[6].data = seriesData6;
|
||||||
|
options.series[7].data = seriesData7;
|
||||||
|
options.series[8].data = seriesData8;
|
||||||
|
options.series[9].data = seriesData9;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
for (let i = 1; i <= that.days; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
|
@ -603,7 +828,7 @@ export default {
|
||||||
that.optionDay = options;
|
that.optionDay = options;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据-图表
|
||||||
getMonthData(year) {
|
getMonthData(year) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query2 = {};
|
let query2 = {};
|
||||||
|
@ -611,18 +836,53 @@ export default {
|
||||||
query2.year_s = year;
|
query2.year_s = year;
|
||||||
query2.type = "month_s";
|
query2.type = "month_s";
|
||||||
query2.mgroup = that.query.mgroup;
|
query2.mgroup = that.query.mgroup;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
this.$API.enm.mpointstat.list.req(query2).then((response) => {
|
||||||
let seriesData0 = [],
|
let seriesData0 = [],
|
||||||
seriesData1 = [];
|
seriesData1 = [],
|
||||||
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
seriesData4 = [],
|
||||||
|
seriesData5 = [],
|
||||||
|
seriesData6 = [],
|
||||||
|
seriesData7 = [],
|
||||||
|
seriesData8 = [],
|
||||||
|
seriesData9 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s - 1;
|
let ind = item.month_s - 1;
|
||||||
seriesData0[ind] = item.total_production;
|
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
|
||||||
seriesData1[ind] = item.elec_consume_unit;
|
seriesData1[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
|
||||||
|
seriesData2[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
|
||||||
|
seriesData3[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
|
||||||
|
seriesData4[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 袋装") {
|
||||||
|
seriesData5[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
|
||||||
|
seriesData6[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
|
||||||
|
seriesData7[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂批次水泥合计") {
|
||||||
|
seriesData0[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "出厂熟料"){
|
||||||
|
seriesData8[ind] = item.val;
|
||||||
|
}else if (item.mpoint_name == "包装进线") {
|
||||||
|
seriesData9[ind] = item.val;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
|
options.series[2].data = seriesData2;
|
||||||
|
options.series[3].data = seriesData3;
|
||||||
|
options.series[4].data = seriesData4;
|
||||||
|
options.series[5].data = seriesData5;
|
||||||
|
options.series[6].data = seriesData6;
|
||||||
|
options.series[7].data = seriesData7;
|
||||||
|
options.series[8].data = seriesData8;
|
||||||
|
options.series[9].data = seriesData9;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
|
|
|
@ -182,7 +182,7 @@ export default {
|
||||||
: "/"
|
: "/"
|
||||||
: "/";
|
: "/";
|
||||||
}
|
}
|
||||||
arr[6] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[6] = huanbi; //环期值(KW·h/t)上个月的值\
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (arr[6] == "/"){
|
if (arr[6] == "/"){
|
||||||
diff == "/";
|
diff == "/";
|
||||||
|
@ -191,7 +191,7 @@ export default {
|
||||||
}
|
}
|
||||||
arr[7] = diff;
|
arr[7] = diff;
|
||||||
if (arr[7]=="/" || arr[6]=="/" || arr[6]==0){
|
if (arr[7]=="/" || arr[6]=="/" || arr[6]==0){
|
||||||
arr[8] = "/";
|
arr[8] == "/";
|
||||||
}else{
|
}else{
|
||||||
arr[8] = (arr[7]/arr[6])*100 //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
arr[8] = (arr[7]/arr[6])*100 //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@ export default {
|
||||||
//当期与目标差值(KW·h/t)
|
//当期与目标差值(KW·h/t)
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (item[2] !== "/") {
|
if (item[2] !== "/") {
|
||||||
diff = item[1] - item[2];
|
diff = (item[1] - item[2]).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
diff = "/";
|
diff = "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.start_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="查询日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 160px"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
<el-button @click="handleExport" type="primary">导出</el-button>
|
||||||
|
</el-header>
|
||||||
|
<el-main style="background: #ffffff">
|
||||||
|
<scTable :data="tableData" id="exportDiv">
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="物料名称" prop="物料名"></el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格"> </el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号"> </el-table-column>
|
||||||
|
<el-table-column label="工序" prop="工序"> </el-table-column>
|
||||||
|
<el-table-column label="检验时间">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检验数" prop="检验数"></el-table-column>
|
||||||
|
<el-table-column label="合格数" prop="合格数量"></el-table-column>
|
||||||
|
<el-table-column label="不合格数" prop="不合格数"></el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "chart",
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query:{
|
||||||
|
start_date:'',
|
||||||
|
end_date:'',
|
||||||
|
fw_type:'prod'
|
||||||
|
},
|
||||||
|
currentDate: "",
|
||||||
|
tableData: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
month = month < 10 ? "0" + month : month;
|
||||||
|
day = day < 10 ? "0" + day : day;
|
||||||
|
let queryDate = year + "-" + month + "-" + day;
|
||||||
|
that.query.start_date = that.query.end_date = that.currentDate = queryDate;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.query = that.query;
|
||||||
|
|
||||||
|
that.$API.bi.dataset.exec.req('ftestDay', obj).then((res) => {
|
||||||
|
that.tableData = res.data2.ds0;
|
||||||
|
console.log(that.tableData);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
if(this.query.start_date){
|
||||||
|
this.query.end_date = this.query.start_date;
|
||||||
|
}else{
|
||||||
|
this.query.start_date = this.query.end_date = this.currentDate;
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
this.exportLoading = true;
|
||||||
|
this.$XLSX("#exportDiv", "成品检验统计");
|
||||||
|
this.exportLoading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tables {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 6px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,260 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-select v-model="query.mgroup_name"
|
||||||
|
placeholder="请选择工段">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.start_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="查询日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 160px"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-card shadow="never" style="margin-bottom: 8px">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div id="bachart1"></div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-card shadow="never" style="position: relative">
|
||||||
|
<el-button
|
||||||
|
@click="handleExport()"
|
||||||
|
class="tables"
|
||||||
|
type="primary"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
id="exportDiv"
|
||||||
|
:height="300"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column
|
||||||
|
label="物料名"
|
||||||
|
prop="物料名"
|
||||||
|
min-width="100"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="月份"
|
||||||
|
prop="月"
|
||||||
|
width="50"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="任务数" prop="任务数">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="生产数" prop="生产数">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合格数" prop="合格数">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="不合格数"
|
||||||
|
prop="不合格数"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合格率" prop="合格率">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ Math.round(scope.row.合格率) }}%
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import T from "@/components/scEcharts/echarts-theme-T.js";
|
||||||
|
echarts.registerTheme("T", T);
|
||||||
|
import scEcharts from "@/components/scEcharts";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: "chart",
|
||||||
|
components: {
|
||||||
|
scEcharts,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
mgroup_name:'',
|
||||||
|
start_date:'',
|
||||||
|
end_date:'',
|
||||||
|
group_bys_material: "",
|
||||||
|
order_bys_material: "",
|
||||||
|
select_cols_material: ""
|
||||||
|
},
|
||||||
|
currentYear: "",
|
||||||
|
currentMonth: "",
|
||||||
|
xAxisData: [],
|
||||||
|
basicOption: {
|
||||||
|
backgroundColor: "transparent",
|
||||||
|
title: {
|
||||||
|
text: "",
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: "80px",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
lenged: [],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: [],
|
||||||
|
stack: "Ad",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: "15px",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
options:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
that.currentYear = year;
|
||||||
|
that.currentMonth = month;
|
||||||
|
month = month < 10 ? "0" + month : month;
|
||||||
|
day = day < 10 ? "0" + day : day;
|
||||||
|
that.query.start_date = that.query.end_date = year + "-" + month + "-" + day;
|
||||||
|
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
for (let i = 0; i < that.days; i++) {
|
||||||
|
let day = i + 1;
|
||||||
|
let text = day + "日";
|
||||||
|
}
|
||||||
|
that.getMgroup();
|
||||||
|
// that.getData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setChart(name, option = null) {
|
||||||
|
// 根据name 渲染数据, option需填写,否则option为模拟数据
|
||||||
|
var myChart = echarts.getInstanceByDom(
|
||||||
|
document.getElementById(name)
|
||||||
|
);
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "T");
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.basicOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
getMgroup(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||||
|
let arr = [];
|
||||||
|
res.forEach(item=>{
|
||||||
|
arr.push(item.name)
|
||||||
|
})
|
||||||
|
that.query.mgroup_name = arr[0];
|
||||||
|
that.options = arr;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData() {
|
||||||
|
let that = this;
|
||||||
|
let option = deepCopy(that.basicOption);
|
||||||
|
let obj = {};
|
||||||
|
obj.query = that.query;
|
||||||
|
that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => {
|
||||||
|
let tableData = res.data2.ds0 ? res.data2.ds0 : [];
|
||||||
|
that.tableData = tableData;
|
||||||
|
if (tableData.length > 0) {
|
||||||
|
let seriesData = [],
|
||||||
|
nameList = [];
|
||||||
|
tableData.forEach((ite) => {
|
||||||
|
if (nameList.indexOf(ite.物料名) > -1) {
|
||||||
|
} else {
|
||||||
|
nameList.push(ite.物料名);
|
||||||
|
seriesData.push(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tableData.forEach((item) => {
|
||||||
|
let indexX = nameList.indexOf(item.物料名);
|
||||||
|
seriesData[indexX] += item.合格数;
|
||||||
|
});
|
||||||
|
ption.xAxis.data = nameList;
|
||||||
|
ption.series[0].data = serisData;
|
||||||
|
that.setChart("bachart1", option);
|
||||||
|
} else {
|
||||||
|
that.setChart("bachart1", option);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
let that = this;
|
||||||
|
that.query.end_date = that.query.start_date ;
|
||||||
|
that.getData();
|
||||||
|
},
|
||||||
|
handleExport(val) {
|
||||||
|
this.exportLoading = true;
|
||||||
|
let id = "#exportDiv" + val;
|
||||||
|
let name =
|
||||||
|
val == "AVG" ? val + "合格数统计" : val + "车间合格数统计";
|
||||||
|
this.$XLSX(id, name);
|
||||||
|
this.exportLoading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
#bachart1,
|
||||||
|
#bachart2,
|
||||||
|
#bachart3,
|
||||||
|
#bachart4 {
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
.tables {
|
||||||
|
position: absolute;
|
||||||
|
top: 6px;
|
||||||
|
left: 4px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,103 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.start_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="查询日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 160px"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
<el-button @click="handleExport" type="primary">导出</el-button>
|
||||||
|
</el-header>
|
||||||
|
<el-main style="background: #ffffff">
|
||||||
|
<scTable :data="tableData" id="exportDiv">
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="物料名称" prop="物料名"></el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格"> </el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号"> </el-table-column>
|
||||||
|
<el-table-column label="工序" prop="工序"> </el-table-column>
|
||||||
|
<el-table-column label="检验时间">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检验数" prop="检验数"></el-table-column>
|
||||||
|
<el-table-column label="合格数" prop="合格数量"></el-table-column>
|
||||||
|
<el-table-column label="不合格数" prop="不合格数"></el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "chart",
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query:{
|
||||||
|
start_date:'',
|
||||||
|
end_date:'',
|
||||||
|
fw_type:'process'
|
||||||
|
},
|
||||||
|
currentDate: "",
|
||||||
|
tableData: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
month = month < 10 ? "0" + month : month;
|
||||||
|
day = day < 10 ? "0" + day : day;
|
||||||
|
let queryDate = year + "-" + month + "-" + day;
|
||||||
|
that.query.start_date = that.query.end_date = that.currentDate = queryDate;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {};
|
||||||
|
obj.query = that.query;
|
||||||
|
|
||||||
|
that.$API.bi.dataset.exec.req('ftestDay', obj).then((res) => {
|
||||||
|
that.tableData = res.data2.ds0;
|
||||||
|
console.log(that.tableData);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
if(this.query.start_date){
|
||||||
|
this.query.end_date = this.query.start_date;
|
||||||
|
}else{
|
||||||
|
this.query.start_date = this.query.end_date = this.currentDate;
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
this.exportLoading = true;
|
||||||
|
this.$XLSX("#exportDiv", "过程检验统计");
|
||||||
|
this.exportLoading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tables {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 6px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,218 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-select v-model="mgroupId"
|
||||||
|
placeholder="请选择工段"
|
||||||
|
@change="mgroupChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="searchDate"
|
||||||
|
type="month"
|
||||||
|
placeholder="查询日期"
|
||||||
|
value-format="YYYY-MM"
|
||||||
|
style="width: 160px"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main id="elMain">
|
||||||
|
<el-row :gutter="10" id="elCol">
|
||||||
|
<el-col :lg="8">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<scEcharts height="500px" :option="option"></scEcharts>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="16">
|
||||||
|
<el-card shadow="never" style="position: relative">
|
||||||
|
<el-button
|
||||||
|
@click="handleExport('7')"
|
||||||
|
class="tables"
|
||||||
|
type="primary"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
:data="tableData1"
|
||||||
|
id="exportDiv7"
|
||||||
|
:height="tableHeight"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column
|
||||||
|
label="任务编号"
|
||||||
|
prop="number"
|
||||||
|
min-width="100px"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="计划数" prop="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="完成数" prop="count_ok">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="完成率" prop="rate">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import scEcharts from "@/components/scEcharts";
|
||||||
|
export default {
|
||||||
|
name: "chart",
|
||||||
|
components: {
|
||||||
|
scEcharts,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
querys:[
|
||||||
|
[{field:'start_date',compare:'gte',value:''},{field:'mgroup',compare:'',value:''}],
|
||||||
|
[{field:'end_date',compare:'lte',value:''},{field:'mgroup',compare:'',value:''}]
|
||||||
|
],
|
||||||
|
page:0
|
||||||
|
},
|
||||||
|
mgroupId:'',
|
||||||
|
start_date:'',
|
||||||
|
end_date:'',
|
||||||
|
currentDate: "",
|
||||||
|
searchDate:'',
|
||||||
|
options:[],
|
||||||
|
tableData1: [],
|
||||||
|
option: {
|
||||||
|
title: {
|
||||||
|
text: "",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
top: "3",
|
||||||
|
right: "3%",
|
||||||
|
},
|
||||||
|
color: ["rgb(64,158,255)", "orange"],
|
||||||
|
series: {
|
||||||
|
name: "7车间完成率",
|
||||||
|
type: "pie",
|
||||||
|
radius: ["40%", "70%"],
|
||||||
|
center: ["50%", "60%"],
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "outside",
|
||||||
|
formatter: "{b} : {c} ({d}%)",
|
||||||
|
},
|
||||||
|
data: [
|
||||||
|
{ value: 0, name: "已完成" },
|
||||||
|
{ value: 0, name: "未完成" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
month = month < 10 ? "0" + month : month;
|
||||||
|
that.currentDate = that.searchDate = year + "-" + month;
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
let start_date = year + "-" + month + "-01";
|
||||||
|
let end_date = year + "-" + month + "-"+days;
|
||||||
|
that.start_date = that.query.querys[0][0].value = start_date;
|
||||||
|
that.end_date = that.query.querys[1][0].value = end_date;
|
||||||
|
let height = document.getElementById("elCol").clientHeight;
|
||||||
|
let chartheight = height+'px';
|
||||||
|
that.tableHeight = height-20;
|
||||||
|
that.getMgroup();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMgroup(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||||
|
that.options = res;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData7() {
|
||||||
|
let that = this;
|
||||||
|
that.tableData1 = [];
|
||||||
|
that.option.series.data[0].value = 0;
|
||||||
|
that.option.series.data[1].value = 0;
|
||||||
|
that.$API.pm.mtask.cquery.req(that.query).then((res) => {
|
||||||
|
let data = [];
|
||||||
|
let count_ok1 = 0;
|
||||||
|
let count_notok1 = 0;
|
||||||
|
if (res.length > 0) {
|
||||||
|
res.forEach((item) => {
|
||||||
|
let obj = item;
|
||||||
|
obj.rate = Math.round((item.count_ok / item.count) * 100).toFixed(2) + "%";
|
||||||
|
if (item.count_ok >= item.count) {
|
||||||
|
count_ok1++;
|
||||||
|
} else {
|
||||||
|
count_notok1++;
|
||||||
|
}
|
||||||
|
data.push(obj);
|
||||||
|
});
|
||||||
|
that.tableData1 = data;
|
||||||
|
// that.option.series.data[0].value = count_ok1;
|
||||||
|
}
|
||||||
|
that.option.series.data[0].value = count_ok1;
|
||||||
|
that.option.series.data[1].value = count_notok1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
mgroupChange(){
|
||||||
|
let that = this;
|
||||||
|
that.query.querys[0][1].value = that.mgroupId;
|
||||||
|
that.query.querys[1][1].value = that.mgroupId;
|
||||||
|
},
|
||||||
|
handleQuery(){
|
||||||
|
let that = this;
|
||||||
|
if(this.searchDate!==''&&this.searchDate!==null){
|
||||||
|
let dates = this.searchDate.split('-');
|
||||||
|
let year = dates[0];
|
||||||
|
let month = dates[1];
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
let start_date = year + "-" + month + "-01";
|
||||||
|
let end_date = year + "-" + month + "-"+days;
|
||||||
|
that.query.querys[0][0].value = start_date;
|
||||||
|
that.query.querys[1][0].value = end_date;
|
||||||
|
}else{
|
||||||
|
that.query.querys[0][0].value = that.start_date;
|
||||||
|
that.query.querys[1][0].value = that.end_date;
|
||||||
|
}
|
||||||
|
that.getData7();
|
||||||
|
},
|
||||||
|
handleExport(val) {
|
||||||
|
this.exportLoading = true;
|
||||||
|
let id = "#exportDiv" + val;
|
||||||
|
let name = val + "车间完成率";
|
||||||
|
this.$XLSX(id, name);
|
||||||
|
this.exportLoading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
#elCol{
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
.tables {
|
||||||
|
position: absolute;
|
||||||
|
top: 6px;
|
||||||
|
left: 4px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue