Compare commits
No commits in common. "ff424ca1b683518fa0bd88a53f3f0656ebfa91af" and "fc0a97a9c63758a22b5b8b3037fcff9cc73fac33" have entirely different histories.
ff424ca1b6
...
fc0a97a9c6
4
.env.dev
4
.env.dev
@ -14,10 +14,6 @@ VUE_APP_TITLE = 发电玻璃智能管控平台
|
|||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.70:30307'
|
# VUE_APP_BASE_API = 'http://192.168.1.70:30307'
|
||||||
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
|
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'
|
# VUE_APP_BASE_API = 'http://192.168.1.61:48080'
|
||||||
# sara
|
# sara
|
||||||
|
@ -1,59 +1,6 @@
|
|||||||
// 对标报表的接口
|
// 对标报表的接口
|
||||||
import request from '@/utils/request'
|
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) {
|
export function utilzationComparePage(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -89,39 +36,3 @@ export function chipoeeCompareExport(data) {
|
|||||||
data: data
|
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" />
|
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||||
</div>
|
</div>
|
||||||
<div class="containerBottom">
|
<div class="containerBottom">
|
||||||
<div class="smallTitle">芯片产量</div>
|
<div class="smallTitle">4月芯片产量</div>
|
||||||
<bm-line-bar
|
<bm-line-bar
|
||||||
:chartHeight="chartHeight"
|
:chartHeight="chartHeight"
|
||||||
:legendList="legendList"
|
:legendList="legendList"
|
||||||
@ -26,61 +26,101 @@
|
|||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||||
import BmLineBar from "../components/bmLineBar.vue";
|
import BmLineBar from "../components/bmLineBar.vue";
|
||||||
import {
|
const tableProps = [
|
||||||
cPReportByDateRangePage,
|
{
|
||||||
cPReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipOutputBM",
|
name: "ChipOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
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" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
chartHeight: this.tableHeight(269) / 2,
|
||||||
tableH: this.tableHeight(269) / 2,
|
tableH: this.tableHeight(269) / 2,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// data: [9500, 7200, 9901],
|
||||||
|
// data: [14666, 15000, 17888],
|
||||||
|
data: [550000, 456666, 590000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
position: [-10, -16],
|
// position: [-10, -16],
|
||||||
// position: [-17, -16],
|
position: [-17, -16],
|
||||||
color: "#68C483",
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -142,13 +188,6 @@ export default {
|
|||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(269) / 2;
|
||||||
window.addEventListener("resize", this._setTableHeight);
|
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() {
|
destroyed() {
|
||||||
window.removeEventListener("resize", this._setTableHeight);
|
window.removeEventListener("resize", this._setTableHeight);
|
||||||
},
|
},
|
||||||
@ -167,156 +206,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factorys = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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" />
|
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||||
</div>
|
</div>
|
||||||
<div class="containerBottom">
|
<div class="containerBottom">
|
||||||
<div class="smallTitle">芯片人均产量</div>
|
<div class="smallTitle">4月芯片人均产量</div>
|
||||||
<bm-line-bar
|
<bm-line-bar
|
||||||
:chartHeight="chartHeight"
|
:chartHeight="chartHeight"
|
||||||
:legendList="legendList"
|
:legendList="legendList"
|
||||||
@ -26,61 +26,101 @@
|
|||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||||
import BmLineBar from "../components/bmLineBar.vue";
|
import BmLineBar from "../components/bmLineBar.vue";
|
||||||
import {
|
const tableProps = [
|
||||||
chipAnnualAverageProductionPage,
|
{
|
||||||
chipAnnualAverageProductionExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipPerCapitaBM",
|
name: "ChipPerCapitaBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
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" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
chartHeight: this.tableHeight(269) / 2,
|
||||||
tableH: this.tableHeight(269) / 2,
|
tableH: this.tableHeight(269) / 2,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// data: [9500, 7200, 9901],
|
||||||
|
// data: [14666, 15000, 17888],
|
||||||
|
data: [550000, 456666, 590000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
position: [-10, -16],
|
// position: [-10, -16],
|
||||||
// position: [-17, -16],
|
position: [-17, -16],
|
||||||
color: "#68C483",
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -142,13 +188,6 @@ export default {
|
|||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(269) / 2;
|
||||||
window.addEventListener("resize", this._setTableHeight);
|
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() {
|
destroyed() {
|
||||||
window.removeEventListener("resize", this._setTableHeight);
|
window.removeEventListener("resize", this._setTableHeight);
|
||||||
},
|
},
|
||||||
@ -167,143 +206,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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(() => {});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,157 +0,0 @@
|
|||||||
<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,23 +33,84 @@
|
|||||||
{{ item.name }}</span
|
{{ item.name }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
:id="chartId"
|
||||||
|
:style="{ width: '100%', height: chartHeight + 'px' }"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 图 -->
|
|
||||||
<base-chart
|
|
||||||
:chartHeight="chartHeight"
|
|
||||||
:legendList="legendList"
|
|
||||||
:chartMsg="chartMsg"
|
|
||||||
:chartId="chartId"
|
|
||||||
:chartNum="chartNum"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import baseChart from "./baseChart.vue";
|
import * as echarts from "echarts";
|
||||||
|
import { debounce } from "@/utils/debounce";
|
||||||
export default {
|
export default {
|
||||||
name: "bmBarComplete",
|
name: "bmBarComplete",
|
||||||
data() {
|
data() {
|
||||||
return;
|
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: {
|
props: {
|
||||||
chartHeight: {
|
chartHeight: {
|
||||||
@ -73,7 +134,61 @@ export default {
|
|||||||
default: 1,
|
default: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: { baseChart },
|
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>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||||
</div>
|
</div>
|
||||||
<div class="containerBottom">
|
<div class="containerBottom">
|
||||||
<div class="smallTitle">FTO/基片投入</div>
|
<div class="smallTitle">4月FTO/基片投入</div>
|
||||||
<bm-line-bar
|
<bm-line-bar
|
||||||
:chartHeight="chartHeight"
|
:chartHeight="chartHeight"
|
||||||
:legendList="legendList"
|
:legendList="legendList"
|
||||||
@ -26,61 +26,101 @@
|
|||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||||
import BmLineBar from "../components/bmLineBar.vue";
|
import BmLineBar from "../components/bmLineBar.vue";
|
||||||
import {
|
const tableProps = [
|
||||||
fTOReportByDateRangePage,
|
{
|
||||||
fTOReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "FtoOutputBM",
|
name: "FtoOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
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" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
chartHeight: this.tableHeight(269) / 2,
|
||||||
tableH: this.tableHeight(269) / 2,
|
tableH: this.tableHeight(269) / 2,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// data: [9500, 7200, 9901],
|
||||||
|
// data: [14666, 15000, 17888],
|
||||||
|
data: [550000, 456666, 590000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
position: [-10, -16],
|
// position: [-10, -16],
|
||||||
// position: [-17, -16],
|
position: [-17, -16],
|
||||||
color: "#68C483",
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -142,13 +188,6 @@ export default {
|
|||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(269) / 2;
|
||||||
window.addEventListener("resize", this._setTableHeight);
|
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() {
|
destroyed() {
|
||||||
window.removeEventListener("resize", this._setTableHeight);
|
window.removeEventListener("resize", this._setTableHeight);
|
||||||
},
|
},
|
||||||
@ -167,156 +206,59 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("==========下面是测试代码,需删除");
|
||||||
this.listQuery.factorys = val.factory;
|
this.chartMsg.series = [];
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出=====下面是测试代码,需删除");
|
||||||
fTOReportByDateRangePage({ ...this.listQuery }).then((res) => {
|
this.chartMsg.series = [
|
||||||
if (res.data && res.data.length > 0) {
|
{
|
||||||
// 设置表头
|
name: "2024年4月目标值1",
|
||||||
let msg = res.data[0];
|
// data: [3000, 2000, 3000],
|
||||||
let arr = [
|
// data: [6800, 5000, 8900],
|
||||||
{
|
// data: [12000, 17000, 19000],
|
||||||
prop: "lastone",
|
data: [560000, 540000, 600000],
|
||||||
label: msg.lastone.reportTime,
|
type: "line",
|
||||||
minWidth: 150,
|
symbol: "circle",
|
||||||
},
|
symbolSize: 6,
|
||||||
{
|
label: {
|
||||||
prop: "currentone",
|
show: true,
|
||||||
label: msg.currentone.reportTime,
|
color: "#FFAE17",
|
||||||
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: [],
|
name: "2023年4月",
|
||||||
type: "bar",
|
// data: [2100, 800, 1500],
|
||||||
barWidth: 20,
|
// data: [9500, 7200, 9901],
|
||||||
label: {
|
// data: [14666, 15000, 17888],
|
||||||
show: true,
|
data: [550000, 456666, 590000],
|
||||||
// position: [-5, -16],
|
type: "bar",
|
||||||
// position: [-5, -16],
|
barWidth: 20,
|
||||||
position: [-10, -16],
|
label: {
|
||||||
// position: [-17, -16],
|
show: true,
|
||||||
color: "#68C483",
|
// position: [-5, -16],
|
||||||
},
|
// position: [-5, -16],
|
||||||
|
// position: [-10, -16],
|
||||||
|
position: [-17, -16],
|
||||||
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
name: "3",
|
{
|
||||||
data: [],
|
name: "2024年4月",
|
||||||
type: "bar",
|
// data: [2100, 900, 1300],
|
||||||
barWidth: 20,
|
// data: [9100, 7300, 9700],
|
||||||
label: {
|
// data: [14666, 15300, 18000],
|
||||||
show: true,
|
data: [556666, 456666, 650000],
|
||||||
position: [0, -16],
|
type: "bar",
|
||||||
color: "#288AFF",
|
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" />
|
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||||
</div>
|
</div>
|
||||||
<div class="containerBottom">
|
<div class="containerBottom">
|
||||||
<div class="smallTitle">封装OEE</div>
|
<div class="smallTitle">4月封装OEE</div>
|
||||||
<bm-line-bar
|
<bm-line-bar
|
||||||
:chartHeight="chartHeight"
|
:chartHeight="chartHeight"
|
||||||
:legendList="legendList"
|
:legendList="legendList"
|
||||||
@ -26,61 +26,102 @@
|
|||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||||
import BmLineBar from "../components/bmLineBar.vue";
|
import BmLineBar from "../components/bmLineBar.vue";
|
||||||
import {
|
const tableProps = [
|
||||||
componentOEEPage,
|
{
|
||||||
componentOEEExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "PackageOEEBM",
|
name: "PackageOEEBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
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" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
chartHeight: this.tableHeight(269) / 2,
|
||||||
tableH: this.tableHeight(269) / 2,
|
tableH: this.tableHeight(269) / 2,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -148,13 +197,6 @@ export default {
|
|||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(269) / 2;
|
||||||
window.addEventListener("resize", this._setTableHeight);
|
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() {
|
destroyed() {
|
||||||
window.removeEventListener("resize", this._setTableHeight);
|
window.removeEventListener("resize", this._setTableHeight);
|
||||||
},
|
},
|
||||||
@ -173,141 +215,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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" />
|
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
|
||||||
</div>
|
</div>
|
||||||
<div class="containerBottom">
|
<div class="containerBottom">
|
||||||
<div class="smallTitle">标准组件产量</div>
|
<div class="smallTitle">4月标准组件产量</div>
|
||||||
<bm-line-bar
|
<bm-line-bar
|
||||||
:chartHeight="chartHeight"
|
:chartHeight="chartHeight"
|
||||||
:legendList="legendList"
|
:legendList="legendList"
|
||||||
@ -26,61 +26,101 @@
|
|||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "../components/bmSearchBar.vue";
|
import bmSearchBar from "../components/bmSearchBar.vue";
|
||||||
import BmLineBar from "../components/bmLineBar.vue";
|
import BmLineBar from "../components/bmLineBar.vue";
|
||||||
import {
|
const tableProps = [
|
||||||
sCPReportByDateRangePage,
|
{
|
||||||
sCPReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "SCOutputBM",
|
name: "SCOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
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" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
chartHeight: this.tableHeight(269) / 2,
|
||||||
tableH: this.tableHeight(269) / 2,
|
tableH: this.tableHeight(269) / 2,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// data: [9500, 7200, 9901],
|
||||||
|
// data: [14666, 15000, 17888],
|
||||||
|
data: [550000, 456666, 590000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
// position: [-5, -16],
|
// position: [-5, -16],
|
||||||
position: [-10, -16],
|
// position: [-10, -16],
|
||||||
// position: [-17, -16],
|
position: [-17, -16],
|
||||||
color: "#68C483",
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -142,13 +188,6 @@ export default {
|
|||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(269) / 2;
|
||||||
window.addEventListener("resize", this._setTableHeight);
|
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() {
|
destroyed() {
|
||||||
window.removeEventListener("resize", this._setTableHeight);
|
window.removeEventListener("resize", this._setTableHeight);
|
||||||
},
|
},
|
||||||
@ -167,156 +206,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factorys = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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