对接报表 #49
4
.env.dev
4
.env.dev
@ -14,6 +14,10 @@ VUE_APP_TITLE = 发电玻璃智能管控平台
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.70:30307'
|
||||
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
|
||||
# 闫阳
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.81:48080'
|
||||
# 徐
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||
# 郭
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.61:48080'
|
||||
# sara
|
||||
|
@ -1,6 +1,59 @@
|
||||
// 对标报表的接口
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 产量对标FTO
|
||||
export function fTOReportByDateRangePage(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/queryOBFTOReportByDateRange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 产量对标FTO导出
|
||||
export function fTOReportByDateRangeExport(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/queryOBFTOReportByDateRangeExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 芯片产量对标
|
||||
export function cPReportByDateRangePage(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/queryCPReportByDateRange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 芯片产量对标导出
|
||||
export function cPReportByDateRangeExport(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/queryCPReportByDateRangeExport',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 标准组件产量对标
|
||||
export function sCPReportByDateRangePage(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/querySCPReportByDateRange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 标准组件产量对标导出
|
||||
export function sCPReportByDateRangeExport(data) {
|
||||
return request({
|
||||
url: '/ip/prod-output/querySCPReportByDateRangeExport',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 稼动率对标
|
||||
export function utilzationComparePage(data) {
|
||||
return request({
|
||||
@ -35,4 +88,40 @@ export function chipoeeCompareExport(data) {
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 封装OEE对标
|
||||
export function componentOEEPage(data) {
|
||||
return request({
|
||||
url: '/ip/component-oee/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 封装OEE对标导出
|
||||
export function componentOEEExport(data) {
|
||||
return request({
|
||||
url: '/ip/component-oee/export',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 芯片人均产量
|
||||
export function chipAnnualAverageProductionPage(data) {
|
||||
return request({
|
||||
url: '/ip/chip-annual-average-production/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 芯片人均产量导出
|
||||
export function chipAnnualAverageProductionExport(data) {
|
||||
return request({
|
||||
url: '/ip/chip-annual-average-production/export',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||
</div>
|
||||
<div class="containerBottom">
|
||||
<div class="smallTitle">4月芯片产量</div>
|
||||
<div class="smallTitle">芯片产量</div>
|
||||
<bm-line-bar
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
@ -26,101 +26,61 @@
|
||||
<script>
|
||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||
import BmLineBar from "../components/bmLineBar.vue";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time1",
|
||||
label: "时间1",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time2",
|
||||
label: "时间2",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "mubiao",
|
||||
label: "目标值",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import {
|
||||
cPReportByDateRangePage,
|
||||
cPReportByDateRangeExport,
|
||||
} from "@/api/report/benchmarking.js";
|
||||
import moment from "moment";
|
||||
export default {
|
||||
name: "ChipOutputBM",
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
factoryList: [
|
||||
{ id: 0, name: "瑞昌" },
|
||||
{ id: 1, name: "邯郸" },
|
||||
],
|
||||
tableProps: [],
|
||||
tableProps1: [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
filter: (val) => this.factoryList[val].name,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 1000,
|
||||
size: 100,
|
||||
},
|
||||
tableData: [
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
],
|
||||
tableData: [],
|
||||
chartHeight: this.tableHeight(269) / 2,
|
||||
tableH: this.tableHeight(269) / 2,
|
||||
legendList: [
|
||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
||||
],
|
||||
chartMsg: {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: ["成都", "邯郸", "瑞昌"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "2024年4月目标值",
|
||||
// data: [3000, 2000, 3000],
|
||||
// data: [6800, 5000, 8900],
|
||||
// data: [12000, 17000, 19000],
|
||||
data: [560000, 540000, 600000],
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
@ -130,28 +90,22 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
// data: [2100, 800, 1500],
|
||||
// data: [9500, 7200, 9901],
|
||||
// data: [14666, 15000, 17888],
|
||||
data: [550000, 456666, 590000],
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
// position: [-10, -16],
|
||||
position: [-17, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
// data: [2100, 900, 1300],
|
||||
// data: [9100, 7300, 9700],
|
||||
// data: [14666, 15300, 18000],
|
||||
data: [556666, 456666, 650000],
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -188,6 +142,13 @@ export default {
|
||||
this.chartHeight = this.tableHeight(269) / 2;
|
||||
window.addEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
this.listQuery.date = 2;
|
||||
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
|
||||
this.listQuery.factorys = [];
|
||||
this.getList();
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
@ -206,11 +167,156 @@ export default {
|
||||
}
|
||||
},
|
||||
getSearch(val) {
|
||||
console.log(val);
|
||||
console.log("=========================");
|
||||
this.listQuery.date = val.type;
|
||||
this.listQuery.queryTime = val.startDate;
|
||||
this.listQuery.factorys = val.factory;
|
||||
this.getList();
|
||||
},
|
||||
handleExport() {
|
||||
console.log("导出");
|
||||
getList() {
|
||||
this.tableProps = [];
|
||||
cPReportByDateRangePage({ ...this.listQuery }).then((res) => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
// 设置表头
|
||||
let msg = res.data[0];
|
||||
let arr = [
|
||||
{
|
||||
prop: "lastone",
|
||||
label: msg.lastone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "currentone",
|
||||
label: msg.currentone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "targetone",
|
||||
label: msg.targetone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
];
|
||||
this.tableProps = this.tableProps1.concat(arr);
|
||||
// 整理表格数据
|
||||
let tableArr = [];
|
||||
res.data.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.factory = item.factory;
|
||||
obj.item = "FTO投入";
|
||||
obj.unit = "片";
|
||||
obj.lastone = item.lastone.total;
|
||||
obj.currentone = item.currentone.total;
|
||||
obj.targetone = item.targetone.total;
|
||||
tableArr.push(obj);
|
||||
});
|
||||
this.tableData = tableArr;
|
||||
// 设置图例
|
||||
this.legendList[0].name = msg.targetone.reportTime;
|
||||
this.legendList[1].name = msg.lastone.reportTime;
|
||||
this.legendList[2].name = msg.currentone.reportTime;
|
||||
this.chartMsg.series[0].name = msg.targetone.reportTime;
|
||||
this.chartMsg.series[1].name = msg.lastone.reportTime;
|
||||
this.chartMsg.series[2].name = msg.currentone.reportTime;
|
||||
// 设置偏移量
|
||||
switch (this.listQuery.type) {
|
||||
case 0:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 1:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 2:
|
||||
this.chartMsg.series[1].label.position = [-10, -16];
|
||||
break;
|
||||
default:
|
||||
this.chartMsg.series[1].label.position = [-17, -16];
|
||||
}
|
||||
// 设置chartMsg的series的数据
|
||||
this.setChartMsg(res.data);
|
||||
} else {
|
||||
// 重置
|
||||
this.resetMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChartMsg(val) {
|
||||
let xData = [];
|
||||
let lineData = [];
|
||||
let barData1 = [];
|
||||
let barData2 = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.factoryList.map((item) => {
|
||||
if (item.id === val[i].factory) {
|
||||
xData.push(item.name);
|
||||
}
|
||||
});
|
||||
lineData.push(val[i].targetone.total || 0);
|
||||
barData1.push(val[i].lastone.total || 0);
|
||||
barData2.push(val[i].currentone.total || 0);
|
||||
}
|
||||
this.chartMsg.xData = xData;
|
||||
this.chartMsg.series[0].data = lineData;
|
||||
this.chartMsg.series[1].data = barData1;
|
||||
this.chartMsg.series[2].data = barData2;
|
||||
this.chartMsg.xData = xData;
|
||||
},
|
||||
resetMsg() {
|
||||
this.tableProps = this.tableProps1;
|
||||
this.tableData = [];
|
||||
this.chartMsg = {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
handleExport(val) {
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
let fileName = "芯片产量.xls";
|
||||
cPReportByDateRangeExport({ ...this.listQuery })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, fileName);
|
||||
this.$message.success("导出成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||
</div>
|
||||
<div class="containerBottom">
|
||||
<div class="smallTitle">4月芯片人均产量</div>
|
||||
<div class="smallTitle">芯片人均产量</div>
|
||||
<bm-line-bar
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
@ -26,101 +26,61 @@
|
||||
<script>
|
||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||
import BmLineBar from "../components/bmLineBar.vue";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time1",
|
||||
label: "时间1",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time2",
|
||||
label: "时间2",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "mubiao",
|
||||
label: "目标值",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import {
|
||||
chipAnnualAverageProductionPage,
|
||||
chipAnnualAverageProductionExport,
|
||||
} from "@/api/report/benchmarking.js";
|
||||
import moment from "moment";
|
||||
export default {
|
||||
name: "ChipPerCapitaBM",
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
factoryList: [
|
||||
{ id: 0, name: "瑞昌" },
|
||||
{ id: 1, name: "邯郸" },
|
||||
],
|
||||
tableProps: [],
|
||||
tableProps1: [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
filter: (val) => this.factoryList[val].name,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 1000,
|
||||
size: 100,
|
||||
},
|
||||
tableData: [
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
],
|
||||
tableData: [],
|
||||
chartHeight: this.tableHeight(269) / 2,
|
||||
tableH: this.tableHeight(269) / 2,
|
||||
legendList: [
|
||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
||||
],
|
||||
chartMsg: {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: ["成都", "邯郸", "瑞昌"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "2024年4月目标值",
|
||||
// data: [3000, 2000, 3000],
|
||||
// data: [6800, 5000, 8900],
|
||||
// data: [12000, 17000, 19000],
|
||||
data: [560000, 540000, 600000],
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
@ -130,28 +90,22 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
// data: [2100, 800, 1500],
|
||||
// data: [9500, 7200, 9901],
|
||||
// data: [14666, 15000, 17888],
|
||||
data: [550000, 456666, 590000],
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
// position: [-10, -16],
|
||||
position: [-17, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
// data: [2100, 900, 1300],
|
||||
// data: [9100, 7300, 9700],
|
||||
// data: [14666, 15300, 18000],
|
||||
data: [556666, 456666, 650000],
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -188,6 +142,13 @@ export default {
|
||||
this.chartHeight = this.tableHeight(269) / 2;
|
||||
window.addEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
this.listQuery.type = 2;
|
||||
this.listQuery.startDate = moment().format("yyyy-MM-DD");
|
||||
this.listQuery.factory = [];
|
||||
this.getList();
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
@ -206,11 +167,143 @@ export default {
|
||||
}
|
||||
},
|
||||
getSearch(val) {
|
||||
console.log(val);
|
||||
console.log("=========================");
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
this.getList();
|
||||
},
|
||||
handleExport() {
|
||||
console.log("导出");
|
||||
getList() {
|
||||
this.tableProps = [];
|
||||
chipAnnualAverageProductionPage({ ...this.listQuery }).then((res) => {
|
||||
if (res.data && res.data.records.length > 0) {
|
||||
let msg = res.data.records[0];
|
||||
let arr = [
|
||||
{
|
||||
prop: "yoy",
|
||||
label: msg.yoyColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "queryValue",
|
||||
label: msg.queryColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "target",
|
||||
label: msg.targetColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
];
|
||||
this.tableProps = this.tableProps1.concat(arr);
|
||||
this.tableData = res.data.records;
|
||||
// 设置图例
|
||||
this.legendList[0].name = msg.targetColumn;
|
||||
this.legendList[1].name = msg.yoyColumn;
|
||||
this.legendList[2].name = msg.queryColumn;
|
||||
this.chartMsg.series[0].name = msg.targetColumn;
|
||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
||||
this.chartMsg.series[2].name = msg.queryColumn;
|
||||
// 设置偏移量
|
||||
switch (this.listQuery.type) {
|
||||
case 0:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 1:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 2:
|
||||
this.chartMsg.series[1].label.position = [-10, -16];
|
||||
break;
|
||||
default:
|
||||
this.chartMsg.series[1].label.position = [-17, -16];
|
||||
}
|
||||
// 设置chartMsg的series的数据
|
||||
this.setChartMsg(res.data.records);
|
||||
} else {
|
||||
// 重置
|
||||
this.resetMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChartMsg(val) {
|
||||
let xData = [];
|
||||
let lineData = [];
|
||||
let barData1 = [];
|
||||
let barData2 = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.factoryList.map((item) => {
|
||||
if (item.id === val[i].factory) {
|
||||
xData.push(item.name);
|
||||
}
|
||||
});
|
||||
lineData.push(val[i].target || 0);
|
||||
barData1.push(val[i].yoy || 0);
|
||||
barData2.push(val[i].queryValue || 0);
|
||||
}
|
||||
this.chartMsg.xData = xData;
|
||||
this.chartMsg.series[0].data = lineData;
|
||||
this.chartMsg.series[1].data = barData1;
|
||||
this.chartMsg.series[2].data = barData2;
|
||||
this.chartMsg.xData = xData;
|
||||
},
|
||||
resetMsg() {
|
||||
this.tableProps = this.tableProps1;
|
||||
this.tableData = [];
|
||||
this.chartMsg = {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
handleExport(val) {
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
let fileName = "芯片人均产量对标.xls";
|
||||
chipAnnualAverageProductionExport({ ...this.listQuery })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, fileName);
|
||||
this.$message.success("导出成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
157
src/views/report/completionStatusIntrBM/components/baseChart.vue
Normal file
157
src/views/report/completionStatusIntrBM/components/baseChart.vue
Normal file
@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div
|
||||
:id="chartId"
|
||||
:style="{ width: '100%', height: chartHeight + 'px' }"
|
||||
></div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { debounce } from "@/utils/debounce";
|
||||
export default {
|
||||
name: "BaseChart",
|
||||
data() {
|
||||
return {
|
||||
myChart: "",
|
||||
option: {
|
||||
color: [],
|
||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
||||
grid: {
|
||||
left: 70,
|
||||
right: 10,
|
||||
bottom: 30,
|
||||
top: 30,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// type: "cross",
|
||||
crossStyle: {
|
||||
color: "rgba(237,237,237,0.5)",
|
||||
},
|
||||
},
|
||||
formatter: function (params) {
|
||||
var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
|
||||
for (var i = 0, l = params.length; i < l; i++) {
|
||||
res +=
|
||||
"<br/>" +
|
||||
`${
|
||||
params[i].seriesType === "line"
|
||||
? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />'
|
||||
: `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>`
|
||||
}` +
|
||||
`<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
|
||||
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
|
||||
params[i].name === "%"
|
||||
? (params[i].value ? params[i].value.toFixed(2) : "0.00") +
|
||||
params[i].name
|
||||
: String(params[i].value).replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
","
|
||||
)
|
||||
}</span>`;
|
||||
}
|
||||
return res;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
name: "",
|
||||
nameTextStyle: {
|
||||
fontSize: 12,
|
||||
align: "right",
|
||||
},
|
||||
axisLabel: {},
|
||||
},
|
||||
series: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
chartHeight: {
|
||||
type: Number,
|
||||
default: 300,
|
||||
},
|
||||
legendList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
chartMsg: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
chartId: {
|
||||
type: String,
|
||||
default: "bmChart",
|
||||
},
|
||||
chartNum: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
chartHeight: {
|
||||
handler(newVal) {
|
||||
this.chartHeight = newVal;
|
||||
},
|
||||
},
|
||||
chartNum(val) {
|
||||
this.canvasReset();
|
||||
},
|
||||
chartMsg: {
|
||||
handler(newVal) {
|
||||
this.canvasReset();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.canvasReset();
|
||||
},
|
||||
methods: {
|
||||
canvasReset() {
|
||||
debounce(() => {
|
||||
this.getMes();
|
||||
}, 500)();
|
||||
},
|
||||
getMes() {
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose();
|
||||
}
|
||||
var chartDom = document.getElementById(this.chartId);
|
||||
this.myChart = echarts.init(chartDom);
|
||||
this.option.color = this.chartMsg.color;
|
||||
this.option.xAxis.data = this.chartMsg.xData;
|
||||
this.option.yAxis.name = this.chartMsg.yName;
|
||||
if (
|
||||
this.chartMsg.series.length > 0 &&
|
||||
this.chartMsg.series[0].data[0].name === "%"
|
||||
) {
|
||||
this.option.yAxis.axisLabel = {
|
||||
formatter: function (value) {
|
||||
return value + ".00%";
|
||||
},
|
||||
};
|
||||
} else {
|
||||
this.option.yAxis.axisLabel = {
|
||||
formatter: function (value) {
|
||||
return value;
|
||||
},
|
||||
};
|
||||
}
|
||||
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
|
||||
this.option.series = this.chartMsg.series;
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -33,84 +33,23 @@
|
||||
{{ item.name }}</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
:id="chartId"
|
||||
:style="{ width: '100%', height: chartHeight + 'px' }"
|
||||
></div>
|
||||
</div>
|
||||
<!-- 图 -->
|
||||
<base-chart
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
:chartMsg="chartMsg"
|
||||
:chartId="chartId"
|
||||
:chartNum="chartNum"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { debounce } from "@/utils/debounce";
|
||||
import baseChart from "./baseChart.vue";
|
||||
export default {
|
||||
name: "bmBarComplete",
|
||||
data() {
|
||||
return {
|
||||
myChart: "",
|
||||
option: {
|
||||
color: [],
|
||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
||||
grid: {
|
||||
left: 70,
|
||||
right: 10,
|
||||
bottom: 30,
|
||||
top: 30,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// type: "cross",
|
||||
crossStyle: {
|
||||
color: "rgba(237,237,237,0.5)",
|
||||
},
|
||||
},
|
||||
formatter: function (params) {
|
||||
var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
|
||||
for (var i = 0, l = params.length; i < l; i++) {
|
||||
res +=
|
||||
"<br/>" +
|
||||
`${
|
||||
params[i].seriesType === "line"
|
||||
? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />'
|
||||
: `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>`
|
||||
}` +
|
||||
`<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
|
||||
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
|
||||
params[i].name === "%"
|
||||
? (params[i].value ? params[i].value.toFixed(2) : "0.00") +
|
||||
params[i].name
|
||||
: String(params[i].value).replace(
|
||||
/\B(?=(\d{3})+(?!\d))/g,
|
||||
","
|
||||
)
|
||||
}</span>`;
|
||||
}
|
||||
return res;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
name: "",
|
||||
nameTextStyle: {
|
||||
fontSize: 12,
|
||||
align: "right",
|
||||
},
|
||||
axisLabel: {},
|
||||
},
|
||||
series: [],
|
||||
},
|
||||
};
|
||||
return;
|
||||
},
|
||||
props: {
|
||||
chartHeight: {
|
||||
@ -134,61 +73,7 @@ export default {
|
||||
default: 1,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
chartHeight: {
|
||||
handler(newVal) {
|
||||
this.chartHeight = newVal;
|
||||
},
|
||||
},
|
||||
chartNum(val) {
|
||||
this.canvasReset();
|
||||
},
|
||||
chartMsg: {
|
||||
handler(newVal) {
|
||||
this.canvasReset();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.canvasReset();
|
||||
},
|
||||
methods: {
|
||||
canvasReset() {
|
||||
debounce(() => {
|
||||
this.getMes();
|
||||
}, 500)();
|
||||
},
|
||||
getMes() {
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose();
|
||||
}
|
||||
var chartDom = document.getElementById(this.chartId);
|
||||
this.myChart = echarts.init(chartDom);
|
||||
this.option.color = this.chartMsg.color;
|
||||
this.option.xAxis.data = this.chartMsg.xData;
|
||||
this.option.yAxis.name = this.chartMsg.yName;
|
||||
if (
|
||||
this.chartMsg.series.length > 0 &&
|
||||
this.chartMsg.series[0].data[0].name === "%"
|
||||
) {
|
||||
this.option.yAxis.axisLabel = {
|
||||
formatter: function (value) {
|
||||
return value + ".00%";
|
||||
},
|
||||
};
|
||||
} else {
|
||||
this.option.yAxis.axisLabel = {
|
||||
formatter: function (value) {
|
||||
return value;
|
||||
},
|
||||
};
|
||||
}
|
||||
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
|
||||
this.option.series = this.chartMsg.series;
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
},
|
||||
components: { baseChart },
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||
</div>
|
||||
<div class="containerBottom">
|
||||
<div class="smallTitle">4月FTO/基片投入</div>
|
||||
<div class="smallTitle">FTO/基片投入</div>
|
||||
<bm-line-bar
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
@ -26,101 +26,61 @@
|
||||
<script>
|
||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||
import BmLineBar from "../components/bmLineBar.vue";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time1",
|
||||
label: "时间1",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time2",
|
||||
label: "时间2",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "mubiao",
|
||||
label: "目标值",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import {
|
||||
fTOReportByDateRangePage,
|
||||
fTOReportByDateRangeExport,
|
||||
} from "@/api/report/benchmarking.js";
|
||||
import moment from "moment";
|
||||
export default {
|
||||
name: "FtoOutputBM",
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
factoryList: [
|
||||
{ id: 0, name: "瑞昌" },
|
||||
{ id: 1, name: "邯郸" },
|
||||
],
|
||||
tableProps: [],
|
||||
tableProps1: [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
filter: (val) => this.factoryList[val].name,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 1000,
|
||||
size: 100,
|
||||
},
|
||||
tableData: [
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
],
|
||||
tableData: [],
|
||||
chartHeight: this.tableHeight(269) / 2,
|
||||
tableH: this.tableHeight(269) / 2,
|
||||
legendList: [
|
||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
||||
],
|
||||
chartMsg: {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: ["成都", "邯郸", "瑞昌"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "2024年4月目标值",
|
||||
// data: [3000, 2000, 3000],
|
||||
// data: [6800, 5000, 8900],
|
||||
// data: [12000, 17000, 19000],
|
||||
data: [560000, 540000, 600000],
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
@ -130,28 +90,22 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
// data: [2100, 800, 1500],
|
||||
// data: [9500, 7200, 9901],
|
||||
// data: [14666, 15000, 17888],
|
||||
data: [550000, 456666, 590000],
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
// position: [-10, -16],
|
||||
position: [-17, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
// data: [2100, 900, 1300],
|
||||
// data: [9100, 7300, 9700],
|
||||
// data: [14666, 15300, 18000],
|
||||
data: [556666, 456666, 650000],
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -188,6 +142,13 @@ export default {
|
||||
this.chartHeight = this.tableHeight(269) / 2;
|
||||
window.addEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
this.listQuery.date = 2;
|
||||
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
|
||||
this.listQuery.factorys = [];
|
||||
this.getList();
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
@ -206,59 +167,156 @@ export default {
|
||||
}
|
||||
},
|
||||
getSearch(val) {
|
||||
console.log(val);
|
||||
console.log("==========下面是测试代码,需删除");
|
||||
this.chartMsg.series = [];
|
||||
this.listQuery.date = val.type;
|
||||
this.listQuery.queryTime = val.startDate;
|
||||
this.listQuery.factorys = val.factory;
|
||||
this.getList();
|
||||
},
|
||||
handleExport() {
|
||||
console.log("导出=====下面是测试代码,需删除");
|
||||
this.chartMsg.series = [
|
||||
{
|
||||
name: "2024年4月目标值1",
|
||||
// data: [3000, 2000, 3000],
|
||||
// data: [6800, 5000, 8900],
|
||||
// data: [12000, 17000, 19000],
|
||||
data: [560000, 540000, 600000],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
getList() {
|
||||
this.tableProps = [];
|
||||
fTOReportByDateRangePage({ ...this.listQuery }).then((res) => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
// 设置表头
|
||||
let msg = res.data[0];
|
||||
let arr = [
|
||||
{
|
||||
prop: "lastone",
|
||||
label: msg.lastone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "currentone",
|
||||
label: msg.currentone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "targetone",
|
||||
label: msg.targetone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
];
|
||||
this.tableProps = this.tableProps1.concat(arr);
|
||||
// 整理表格数据
|
||||
let tableArr = [];
|
||||
res.data.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.factory = item.factory;
|
||||
obj.item = "FTO投入";
|
||||
obj.unit = "片";
|
||||
obj.lastone = item.lastone.total;
|
||||
obj.currentone = item.currentone.total;
|
||||
obj.targetone = item.targetone.total;
|
||||
tableArr.push(obj);
|
||||
});
|
||||
this.tableData = tableArr;
|
||||
// 设置图例
|
||||
this.legendList[0].name = msg.targetone.reportTime;
|
||||
this.legendList[1].name = msg.lastone.reportTime;
|
||||
this.legendList[2].name = msg.currentone.reportTime;
|
||||
this.chartMsg.series[0].name = msg.targetone.reportTime;
|
||||
this.chartMsg.series[1].name = msg.lastone.reportTime;
|
||||
this.chartMsg.series[2].name = msg.currentone.reportTime;
|
||||
// 设置偏移量
|
||||
switch (this.listQuery.type) {
|
||||
case 0:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 1:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 2:
|
||||
this.chartMsg.series[1].label.position = [-10, -16];
|
||||
break;
|
||||
default:
|
||||
this.chartMsg.series[1].label.position = [-17, -16];
|
||||
}
|
||||
// 设置chartMsg的series的数据
|
||||
this.setChartMsg(res.data);
|
||||
} else {
|
||||
// 重置
|
||||
this.resetMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChartMsg(val) {
|
||||
let xData = [];
|
||||
let lineData = [];
|
||||
let barData1 = [];
|
||||
let barData2 = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.factoryList.map((item) => {
|
||||
if (item.id === val[i].factory) {
|
||||
xData.push(item.name);
|
||||
}
|
||||
});
|
||||
lineData.push(val[i].targetone.total || 0);
|
||||
barData1.push(val[i].lastone.total || 0);
|
||||
barData2.push(val[i].currentone.total || 0);
|
||||
}
|
||||
this.chartMsg.xData = xData;
|
||||
this.chartMsg.series[0].data = lineData;
|
||||
this.chartMsg.series[1].data = barData1;
|
||||
this.chartMsg.series[2].data = barData2;
|
||||
this.chartMsg.xData = xData;
|
||||
},
|
||||
resetMsg() {
|
||||
this.tableProps = this.tableProps1;
|
||||
this.tableData = [];
|
||||
this.chartMsg = {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
// data: [2100, 800, 1500],
|
||||
// data: [9500, 7200, 9901],
|
||||
// data: [14666, 15000, 17888],
|
||||
data: [550000, 456666, 590000],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
// position: [-10, -16],
|
||||
position: [-17, -16],
|
||||
color: "#68C483",
|
||||
{
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
// data: [2100, 900, 1300],
|
||||
// data: [9100, 7300, 9700],
|
||||
// data: [14666, 15300, 18000],
|
||||
data: [556666, 456666, 650000],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
{
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
],
|
||||
};
|
||||
},
|
||||
handleExport(val) {
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
let fileName = "产量对标FTO.xls";
|
||||
fTOReportByDateRangeExport({ ...this.listQuery })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, fileName);
|
||||
this.$message.success("导出成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||
</div>
|
||||
<div class="containerBottom">
|
||||
<div class="smallTitle">4月封装OEE</div>
|
||||
<div class="smallTitle">封装OEE</div>
|
||||
<bm-line-bar
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
@ -26,102 +26,61 @@
|
||||
<script>
|
||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||
import BmLineBar from "../components/bmLineBar.vue";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time1",
|
||||
label: "时间1",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time2",
|
||||
label: "时间2",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "mubiao",
|
||||
label: "目标值",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import {
|
||||
componentOEEPage,
|
||||
componentOEEExport,
|
||||
} from "@/api/report/benchmarking.js";
|
||||
import moment from "moment";
|
||||
export default {
|
||||
name: "PackageOEEBM",
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
factoryList: [
|
||||
{ id: 0, name: "瑞昌" },
|
||||
{ id: 1, name: "邯郸" },
|
||||
],
|
||||
tableProps: [],
|
||||
tableProps1: [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
filter: (val) => this.factoryList[val].name,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 1000,
|
||||
size: 100,
|
||||
},
|
||||
tableData: [
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
],
|
||||
tableData: [],
|
||||
chartHeight: this.tableHeight(269) / 2,
|
||||
tableH: this.tableHeight(269) / 2,
|
||||
legendList: [
|
||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
||||
],
|
||||
chartMsg: {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: ["成都", "邯郸", "瑞昌"],
|
||||
xData: [],
|
||||
yName: "单位/%",
|
||||
series: [
|
||||
{
|
||||
name: "2024年4月目标值",
|
||||
data: [
|
||||
{ name: "%", value: 85 },
|
||||
{ name: "%", value: 85 },
|
||||
{ name: "%", value: 85 },
|
||||
],
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
@ -134,12 +93,8 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
data: [
|
||||
{ name: "%", value: 57.5 },
|
||||
{ name: "%", value: 21.66 },
|
||||
{ name: "%", value: 18.4 },
|
||||
],
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -152,12 +107,8 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
data: [
|
||||
{ name: "%", value: 23.33 },
|
||||
{ name: "%", value: 7.02 },
|
||||
{ name: "%", value: 80.2 },
|
||||
],
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -197,6 +148,13 @@ export default {
|
||||
this.chartHeight = this.tableHeight(269) / 2;
|
||||
window.addEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
this.listQuery.type = 2;
|
||||
this.listQuery.startDate = moment().format("yyyy-MM-DD");
|
||||
this.listQuery.factory = [];
|
||||
this.getList();
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
@ -215,11 +173,141 @@ export default {
|
||||
}
|
||||
},
|
||||
getSearch(val) {
|
||||
console.log(val);
|
||||
console.log("=========================");
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
this.getList();
|
||||
},
|
||||
handleExport() {
|
||||
console.log("导出");
|
||||
getList() {
|
||||
this.tableProps = [];
|
||||
componentOEEPage({ ...this.listQuery }).then((res) => {
|
||||
if (res.data && res.data.records.length > 0) {
|
||||
let msg = res.data.records[0];
|
||||
let arr = [
|
||||
{
|
||||
prop: "yoy",
|
||||
label: msg.yoyColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "queryValue",
|
||||
label: msg.queryColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "target",
|
||||
label: msg.targetColumn,
|
||||
minWidth: 150,
|
||||
},
|
||||
];
|
||||
this.tableProps = this.tableProps1.concat(arr);
|
||||
this.tableData = res.data.records;
|
||||
// 设置图例
|
||||
this.legendList[0].name = msg.targetColumn;
|
||||
this.legendList[1].name = msg.yoyColumn;
|
||||
this.legendList[2].name = msg.queryColumn;
|
||||
this.chartMsg.series[0].name = msg.targetColumn;
|
||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
||||
this.chartMsg.series[2].name = msg.queryColumn;
|
||||
// 设置chartMsg的series的数据
|
||||
this.setChartMsg(res.data.records);
|
||||
} else {
|
||||
// 重置
|
||||
this.resetMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChartMsg(val) {
|
||||
let xData = [];
|
||||
let lineData = [];
|
||||
let barData1 = [];
|
||||
let barData2 = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.factoryList.map((item) => {
|
||||
if (item.id === val[i].factory) {
|
||||
xData.push(item.name);
|
||||
}
|
||||
});
|
||||
lineData.push({
|
||||
name: "%",
|
||||
value: val[i].target || 0,
|
||||
});
|
||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
||||
barData2.push({
|
||||
name: "%",
|
||||
value: val[i].queryValue || 0,
|
||||
});
|
||||
}
|
||||
this.chartMsg.xData = xData;
|
||||
this.chartMsg.series[0].data = lineData;
|
||||
this.chartMsg.series[1].data = barData1;
|
||||
this.chartMsg.series[2].data = barData2;
|
||||
this.chartMsg.xData = xData;
|
||||
},
|
||||
resetMsg() {
|
||||
this.tableProps = this.tableProps1;
|
||||
this.tableData = [];
|
||||
this.chartMsg = {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: [],
|
||||
yName: "单位/%",
|
||||
series: [
|
||||
{
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
formatter: function (params) {
|
||||
return params.value.toFixed(2) + "%";
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [-18, -16],
|
||||
color: "#68C483",
|
||||
formatter: function (params) {
|
||||
return params.value.toFixed(2) + "%";
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
formatter: function (params) {
|
||||
return params.value.toFixed(2) + "%";
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
handleExport(val) {
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
let fileName = "封装OEE对标.xls";
|
||||
componentOEEExport({ ...this.listQuery })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, fileName);
|
||||
this.$message.success("导出成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||
</div>
|
||||
<div class="containerBottom">
|
||||
<div class="smallTitle">4月标准组件产量</div>
|
||||
<div class="smallTitle">标准组件产量</div>
|
||||
<bm-line-bar
|
||||
:chartHeight="chartHeight"
|
||||
:legendList="legendList"
|
||||
@ -26,101 +26,61 @@
|
||||
<script>
|
||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||
import BmLineBar from "../components/bmLineBar.vue";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time1",
|
||||
label: "时间1",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "time2",
|
||||
label: "时间2",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "mubiao",
|
||||
label: "目标值",
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import {
|
||||
sCPReportByDateRangePage,
|
||||
sCPReportByDateRangeExport,
|
||||
} from "@/api/report/benchmarking.js";
|
||||
import moment from "moment";
|
||||
export default {
|
||||
name: "SCOutputBM",
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
factoryList: [
|
||||
{ id: 0, name: "瑞昌" },
|
||||
{ id: 1, name: "邯郸" },
|
||||
],
|
||||
tableProps: [],
|
||||
tableProps1: [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
filter: (val) => this.factoryList[val].name,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
minWidth: 80,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 1000,
|
||||
size: 100,
|
||||
},
|
||||
tableData: [
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
{ factory: "工厂1" },
|
||||
],
|
||||
tableData: [],
|
||||
chartHeight: this.tableHeight(269) / 2,
|
||||
tableH: this.tableHeight(269) / 2,
|
||||
legendList: [
|
||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
||||
],
|
||||
chartMsg: {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: ["成都", "邯郸", "瑞昌"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "2024年4月目标值",
|
||||
// data: [3000, 2000, 3000],
|
||||
// data: [6800, 5000, 8900],
|
||||
// data: [12000, 17000, 19000],
|
||||
data: [560000, 540000, 600000],
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
@ -130,28 +90,22 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2023年4月",
|
||||
// data: [2100, 800, 1500],
|
||||
// data: [9500, 7200, 9901],
|
||||
// data: [14666, 15000, 17888],
|
||||
data: [550000, 456666, 590000],
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
// position: [-10, -16],
|
||||
position: [-17, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2024年4月",
|
||||
// data: [2100, 900, 1300],
|
||||
// data: [9100, 7300, 9700],
|
||||
// data: [14666, 15300, 18000],
|
||||
data: [556666, 456666, 650000],
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
@ -188,6 +142,13 @@ export default {
|
||||
this.chartHeight = this.tableHeight(269) / 2;
|
||||
window.addEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
this.listQuery.date = 2;
|
||||
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
|
||||
this.listQuery.factorys = [];
|
||||
this.getList();
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this._setTableHeight);
|
||||
},
|
||||
@ -206,11 +167,156 @@ export default {
|
||||
}
|
||||
},
|
||||
getSearch(val) {
|
||||
console.log(val);
|
||||
console.log("=========================");
|
||||
this.listQuery.date = val.type;
|
||||
this.listQuery.queryTime = val.startDate;
|
||||
this.listQuery.factorys = val.factory;
|
||||
this.getList();
|
||||
},
|
||||
handleExport() {
|
||||
console.log("导出");
|
||||
getList() {
|
||||
this.tableProps = [];
|
||||
sCPReportByDateRangePage({ ...this.listQuery }).then((res) => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
// 设置表头
|
||||
let msg = res.data[0];
|
||||
let arr = [
|
||||
{
|
||||
prop: "lastone",
|
||||
label: msg.lastone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "currentone",
|
||||
label: msg.currentone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: "targetone",
|
||||
label: msg.targetone.reportTime,
|
||||
minWidth: 150,
|
||||
},
|
||||
];
|
||||
this.tableProps = this.tableProps1.concat(arr);
|
||||
// 整理表格数据
|
||||
let tableArr = [];
|
||||
res.data.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.factory = item.factory;
|
||||
obj.item = "FTO投入";
|
||||
obj.unit = "片";
|
||||
obj.lastone = item.lastone.total;
|
||||
obj.currentone = item.currentone.total;
|
||||
obj.targetone = item.targetone.total;
|
||||
tableArr.push(obj);
|
||||
});
|
||||
this.tableData = tableArr;
|
||||
// 设置图例
|
||||
this.legendList[0].name = msg.targetone.reportTime;
|
||||
this.legendList[1].name = msg.lastone.reportTime;
|
||||
this.legendList[2].name = msg.currentone.reportTime;
|
||||
this.chartMsg.series[0].name = msg.targetone.reportTime;
|
||||
this.chartMsg.series[1].name = msg.lastone.reportTime;
|
||||
this.chartMsg.series[2].name = msg.currentone.reportTime;
|
||||
// 设置偏移量
|
||||
switch (this.listQuery.type) {
|
||||
case 0:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 1:
|
||||
this.chartMsg.series[1].label.position = [-5, -16];
|
||||
break;
|
||||
case 2:
|
||||
this.chartMsg.series[1].label.position = [-10, -16];
|
||||
break;
|
||||
default:
|
||||
this.chartMsg.series[1].label.position = [-17, -16];
|
||||
}
|
||||
// 设置chartMsg的series的数据
|
||||
this.setChartMsg(res.data);
|
||||
} else {
|
||||
// 重置
|
||||
this.resetMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChartMsg(val) {
|
||||
let xData = [];
|
||||
let lineData = [];
|
||||
let barData1 = [];
|
||||
let barData2 = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.factoryList.map((item) => {
|
||||
if (item.id === val[i].factory) {
|
||||
xData.push(item.name);
|
||||
}
|
||||
});
|
||||
lineData.push(val[i].targetone.total || 0);
|
||||
barData1.push(val[i].lastone.total || 0);
|
||||
barData2.push(val[i].currentone.total || 0);
|
||||
}
|
||||
this.chartMsg.xData = xData;
|
||||
this.chartMsg.series[0].data = lineData;
|
||||
this.chartMsg.series[1].data = barData1;
|
||||
this.chartMsg.series[2].data = barData2;
|
||||
this.chartMsg.xData = xData;
|
||||
},
|
||||
resetMsg() {
|
||||
this.tableProps = this.tableProps1;
|
||||
this.tableData = [];
|
||||
this.chartMsg = {
|
||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
series: [
|
||||
{
|
||||
name: "1",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 6,
|
||||
label: {
|
||||
show: true,
|
||||
color: "#FFAE17",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
// position: [-5, -16],
|
||||
// position: [-5, -16],
|
||||
position: [-10, -16],
|
||||
// position: [-17, -16],
|
||||
color: "#68C483",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
data: [],
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, -16],
|
||||
color: "#288AFF",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
handleExport(val) {
|
||||
this.listQuery.type = val.type;
|
||||
this.listQuery.startDate = val.startDate;
|
||||
this.listQuery.factory = val.factory;
|
||||
let fileName = "标准组件产量.xls";
|
||||
sCPReportByDateRangeExport({ ...this.listQuery })
|
||||
.then((response) => {
|
||||
this.$download.excel(response, fileName);
|
||||
this.$message.success("导出成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user