报表
This commit is contained in:
parent
41d554f897
commit
c8bc54e04b
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-06-17 09:41:03
|
* @Date: 2024-06-17 09:41:03
|
||||||
* @LastEditTime: 2024-06-18 13:47:36
|
* @LastEditTime: 2024-06-19 13:30:14
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -21,3 +21,20 @@ export function getProduceTransData(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getProduceSituationData(data) {
|
||||||
|
return request({
|
||||||
|
url: 'ip/production/situation/get/production/situation',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProductionSituationMWData(data) {
|
||||||
|
return request({
|
||||||
|
url: 'ip/production/situation/power/get/production/situation',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
220
src/views/report/components/produceLineBar.vue
Normal file
220
src/views/report/components/produceLineBar.vue
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2024-06-19 15:28:34
|
||||||
|
* @LastEditTime: 2024-06-19 15:28:34
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 暂无数据 -->
|
||||||
|
<div
|
||||||
|
class="no-data-bg"
|
||||||
|
style="position: relative; left: 50%; transform: translateX(-50%)"
|
||||||
|
v-show="this.chartMsg.series.length === 0"
|
||||||
|
></div>
|
||||||
|
<!-- 图例 -->
|
||||||
|
<div v-show="this.chartMsg.series.length > 0">
|
||||||
|
<div class="legend">
|
||||||
|
<span class="item" v-for="item in legendList" :key="item.id">
|
||||||
|
<span
|
||||||
|
v-if="item.type === 1"
|
||||||
|
class="block"
|
||||||
|
:style="{ backgroundColor: item.color }"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
v-if="item.type === 2"
|
||||||
|
class="line"
|
||||||
|
:style="{ backgroundColor: item.color }"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="line-block"
|
||||||
|
:style="{ backgroundColor: item.color }"
|
||||||
|
></span>
|
||||||
|
</span>
|
||||||
|
{{ item.name }}</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:id="chartId"
|
||||||
|
:style="{ width: '100%', height: chartHeight + 'px' }"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import { debounce } from "@/utils/debounce";
|
||||||
|
export default {
|
||||||
|
name: "bmLineBar",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
myChart: "",
|
||||||
|
option: {
|
||||||
|
color: [],
|
||||||
|
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
||||||
|
grid: {
|
||||||
|
left: 100,
|
||||||
|
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/>" +
|
||||||
|
`<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
|
||||||
|
`<span style='display:inline-block;width:150px;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.0) +
|
||||||
|
params[i].name
|
||||||
|
: params[i].value
|
||||||
|
}</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>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.legend {
|
||||||
|
text-align: right;
|
||||||
|
.item {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #8c8c8c;
|
||||||
|
.block {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
.line {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 4px;
|
||||||
|
position: relative;
|
||||||
|
.line-block {
|
||||||
|
position: absolute;
|
||||||
|
width: 20px;
|
||||||
|
height: 2px;
|
||||||
|
left: -5px;
|
||||||
|
top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-15 10:49:13
|
* @Date: 2024-04-15 10:49:13
|
||||||
* @LastEditTime: 2024-06-18 13:41:03
|
* @LastEditTime: 2024-06-19 09:35:25
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -21,7 +21,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
||||||
@ -34,9 +34,8 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
|
||||||
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
|
||||||
@change="changeTime">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
||||||
@ -100,9 +99,11 @@ export default {
|
|||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 999,
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: null,
|
factory: undefined,
|
||||||
// total: 0,
|
// total: 0,
|
||||||
type: 2,
|
type: 2,
|
||||||
startDate: undefined,
|
startDate: undefined,
|
||||||
@ -236,7 +237,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -294,8 +295,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
|
@ -7,17 +7,17 @@
|
|||||||
<div class="containerTop">
|
<div class="containerTop">
|
||||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||||
<el-form-item label="时间维度" prop="date">
|
<el-form-item label="时间维度" prop="date">
|
||||||
<el-select size="small" clearable v-model="listQuery.date" placeholder="请选择">
|
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择">
|
||||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
|
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.date === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
||||||
style="width: 180px" @change="onValueChange">
|
style="width: 180px" @change="onValueChange">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
@ -29,13 +29,12 @@
|
|||||||
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
||||||
</span> -->
|
</span> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.date === 2" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
|
||||||
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
|
||||||
@change="changeTime">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
|
||||||
placeholder="开始时间">
|
placeholder="开始时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
@ -79,65 +78,28 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getProduceSituationData } from '@/api/report';
|
||||||
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 ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { getProduceTransData } from '@/api/report';
|
|
||||||
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,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableProps,
|
otherProps: [],
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 999,
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factorys: null,
|
factory: null,
|
||||||
// total: 0,
|
// total: 0,
|
||||||
date: 2,
|
type: 2,
|
||||||
beginTime: undefined,
|
startDate: undefined,
|
||||||
endTime: undefined,
|
endDate: undefined,
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
timeList: [
|
timeList: [
|
||||||
@ -158,35 +120,7 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
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(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
@ -265,6 +199,31 @@ export default {
|
|||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "工厂名称",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "item",
|
||||||
|
label: "科目",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...this.otherProps
|
||||||
|
]
|
||||||
|
},
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
@ -297,7 +256,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -320,13 +279,13 @@ export default {
|
|||||||
this.start = undefined
|
this.start = undefined
|
||||||
this.end = undefined
|
this.end = undefined
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = Number(this.start)
|
this.listQuery.startDate = Number(this.start)
|
||||||
this.listQuery.endTime = Number(this.end)
|
this.listQuery.endDate = Number(this.end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.start && !this.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.beginTime = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endTime = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
@ -345,18 +304,18 @@ export default {
|
|||||||
});
|
});
|
||||||
this.listQuery.reportTime = [];
|
this.listQuery.reportTime = [];
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endTime = this.listQuery.reportTime[1]
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endTime = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -365,15 +324,15 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = this.date1
|
this.listQuery.startDate = this.date1
|
||||||
this.listQuery.endTime = this.date2
|
this.listQuery.endDate = this.date2
|
||||||
// this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW'))
|
// this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW'))
|
||||||
// this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
|
// this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.start && !this.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.beginTime = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endTime = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeDayTime() {
|
changeDayTime() {
|
||||||
@ -386,12 +345,12 @@ export default {
|
|||||||
});
|
});
|
||||||
this.listQuery.reportTime = [];
|
this.listQuery.reportTime = [];
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endTime = this.listQuery.reportTime[1]
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.beginTime = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endTime = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getOverView() {
|
getOverView() {
|
||||||
@ -408,21 +367,89 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
|
this.otherProps = []
|
||||||
|
this.xData = []
|
||||||
console.log(this.listQuery);
|
console.log(this.listQuery);
|
||||||
if (this.listQuery.date == 3) {
|
if (this.listQuery.type == 3) {
|
||||||
this.listQuery.beginTime = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endTime = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
let arr = []
|
let arr = []
|
||||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
||||||
this.listQuery.factorys = arr
|
this.listQuery.factory = arr
|
||||||
const res = await getProduceTransData(this.listQuery)
|
const res = await getProduceSituationData(this.listQuery)
|
||||||
this.tableData = res.data.list
|
let dataArr = [{
|
||||||
|
factory: null,
|
||||||
|
item: 'FTO投入',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '芯片产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '标准组件产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '综合良率',
|
||||||
|
unit: '%'
|
||||||
|
},]
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
ele.titleValue
|
||||||
|
this.xData.push(ele.titleValue)
|
||||||
|
this.otherProps.push({
|
||||||
|
label: ele.titleValue,
|
||||||
|
props: 'value' + i
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(this.otherProps)
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
let m = 'value' + i
|
||||||
|
ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
dataArr[0]['' + m + ''] = item.ftoInput
|
||||||
|
dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1]['' + m + ''] = item.chipYield
|
||||||
|
dataArr[2]['' + m + ''] = item.componentYield
|
||||||
|
dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
|
||||||
|
})
|
||||||
|
// ele.titleValue
|
||||||
|
// .push({
|
||||||
|
// label: ele.titleValue,
|
||||||
|
// props: 'value' + index + 1,
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// this.tableProps = otherProps
|
||||||
|
// res.data.list.forEach((ele) => {
|
||||||
|
// console.log(ele);
|
||||||
|
// ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
// let obj = {
|
||||||
|
// bipvProductOutput: item.bipvProductOutput,
|
||||||
|
// chipYield: item.chipYield,
|
||||||
|
// componentYield: item.componentYield,
|
||||||
|
// factory: item.factory,
|
||||||
|
// ftoInput: item.ftoInput,
|
||||||
|
// titleValue:ele.titleValue
|
||||||
|
// }
|
||||||
|
// dataArr.push(obj)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
console.log(dataArr)
|
||||||
|
this.tableData = dataArr
|
||||||
|
// this.tableProps.push()
|
||||||
this.listQuery.total = res.data.total
|
this.listQuery.total = res.data.total
|
||||||
if (this.listQuery.total > 0) {
|
if (this.listQuery.total > 0) {
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
item.startTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
|
item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--'
|
||||||
item.endTime = item.endTime ? item.endTime[0] + '-' + item.endTime[1] + '-' + item.endTime[2] : '--'
|
item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -452,7 +479,8 @@ export default {
|
|||||||
padding: 16px 16px 0 16px;
|
padding: 16px 16px 0 16px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.containerTop{
|
|
||||||
|
.containerTop {
|
||||||
height: calc((100vh - 170px));
|
height: calc((100vh - 170px));
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@ -469,6 +497,7 @@ export default {
|
|||||||
margin-right: 8PX;
|
margin-right: 8PX;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containerTop {
|
.containerTop {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
||||||
@ -30,9 +30,8 @@
|
|||||||
</span> -->
|
</span> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
|
||||||
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
|
||||||
@change="changeTime">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
||||||
@ -79,57 +78,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getProductionSituationMWData } from '@/api/report';
|
||||||
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 ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
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,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableProps,
|
otherProps: [],
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 999,
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: null,
|
factory: null,
|
||||||
@ -157,35 +120,7 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
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(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
@ -264,6 +199,31 @@ export default {
|
|||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "工厂名称",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "item",
|
||||||
|
label: "科目",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...this.otherProps
|
||||||
|
]
|
||||||
|
},
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
@ -296,7 +256,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -354,8 +314,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -407,14 +367,67 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
|
this.otherProps = []
|
||||||
console.log(this.listQuery);
|
console.log(this.listQuery);
|
||||||
if (this.listQuery.type == 3) {
|
if (this.listQuery.type == 3) {
|
||||||
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
|
let arr = []
|
||||||
const res = await getComprehensiveDataPage(this.listQuery)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
||||||
this.tableData = res.data.list
|
this.listQuery.factory = arr
|
||||||
|
const res = await getProductionSituationMWData(this.listQuery)
|
||||||
|
let dataArr = [{
|
||||||
|
factory: null,
|
||||||
|
item: '芯片总功率',
|
||||||
|
unit: 'MW'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '标准组件总功率',
|
||||||
|
unit: 'MW'
|
||||||
|
}]
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
this.otherProps.push({
|
||||||
|
label: ele.titleValue,
|
||||||
|
props: 'value' + i
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(this.otherProps)
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
let m = 'value' + i
|
||||||
|
ele.productionSituationPowerDataVOList.forEach((item) => {
|
||||||
|
dataArr[0]['' + m + ''] = item.chipTotalPower
|
||||||
|
dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1]['' + m + ''] = item.componentTotalPower
|
||||||
|
})
|
||||||
|
// ele.titleValue
|
||||||
|
// .push({
|
||||||
|
// label: ele.titleValue,
|
||||||
|
// props: 'value' + index + 1,
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// this.tableProps = otherProps
|
||||||
|
// res.data.list.forEach((ele) => {
|
||||||
|
// console.log(ele);
|
||||||
|
// ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
// let obj = {
|
||||||
|
// bipvProductOutput: item.bipvProductOutput,
|
||||||
|
// chipYield: item.chipYield,
|
||||||
|
// componentYield: item.componentYield,
|
||||||
|
// factory: item.factory,
|
||||||
|
// ftoInput: item.ftoInput,
|
||||||
|
// titleValue:ele.titleValue
|
||||||
|
// }
|
||||||
|
// dataArr.push(obj)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
console.log(dataArr)
|
||||||
|
this.tableData = dataArr
|
||||||
|
// this.tableProps.push()
|
||||||
this.listQuery.total = res.data.total
|
this.listQuery.total = res.data.total
|
||||||
if (this.listQuery.total > 0) {
|
if (this.listQuery.total > 0) {
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
||||||
@ -31,7 +31,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
||||||
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
value-format="yyyy-MM-DD" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
||||||
@change="changeTime">
|
@change="changeTime">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -79,57 +79,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getProduceSituationData } from '@/api/report';
|
||||||
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 ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
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,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableProps,
|
otherProps:[],
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize:999,
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: null,
|
factory: null,
|
||||||
@ -157,35 +121,7 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
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(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
@ -264,6 +200,31 @@ export default {
|
|||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "工厂名称",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "item",
|
||||||
|
label: "科目",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...this.otherProps
|
||||||
|
]
|
||||||
|
},
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
@ -296,7 +257,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -354,8 +315,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -407,14 +368,81 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
|
this.otherProps = []
|
||||||
console.log(this.listQuery);
|
console.log(this.listQuery);
|
||||||
if (this.listQuery.type == 3) {
|
if (this.listQuery.type == 3) {
|
||||||
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
|
let arr = []
|
||||||
const res = await getComprehensiveDataPage(this.listQuery)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
||||||
this.tableData = res.data.list
|
this.listQuery.factory = arr
|
||||||
|
const res = await getProduceSituationData(this.listQuery)
|
||||||
|
let dataArr = [{
|
||||||
|
factory: null,
|
||||||
|
item: 'FTO投入',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '芯片产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '标准组件产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: 'BIPV产量',
|
||||||
|
unit: 'm2'
|
||||||
|
},]
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index +1
|
||||||
|
this.otherProps.push({
|
||||||
|
label: ele.titleValue,
|
||||||
|
props: 'value' + i
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(this.otherProps)
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
let m = 'value' + i
|
||||||
|
ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
dataArr[0]['' + m + ''] = item.ftoInput
|
||||||
|
dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1]['' + m + ''] = item.chipYield
|
||||||
|
dataArr[2]['' + m + ''] = item.componentYield
|
||||||
|
dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||||
|
})
|
||||||
|
// ele.titleValue
|
||||||
|
// .push({
|
||||||
|
// label: ele.titleValue,
|
||||||
|
// props: 'value' + index + 1,
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// this.tableProps = otherProps
|
||||||
|
// res.data.list.forEach((ele) => {
|
||||||
|
// console.log(ele);
|
||||||
|
// ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
// let obj = {
|
||||||
|
// bipvProductOutput: item.bipvProductOutput,
|
||||||
|
// chipYield: item.chipYield,
|
||||||
|
// componentYield: item.componentYield,
|
||||||
|
// factory: item.factory,
|
||||||
|
// ftoInput: item.ftoInput,
|
||||||
|
// titleValue:ele.titleValue
|
||||||
|
// }
|
||||||
|
// dataArr.push(obj)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
console.log(dataArr)
|
||||||
|
this.tableData = dataArr
|
||||||
|
// this.tableProps.push()
|
||||||
this.listQuery.total = res.data.total
|
this.listQuery.total = res.data.total
|
||||||
if (this.listQuery.total > 0) {
|
if (this.listQuery.total > 0) {
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
|
||||||
@ -30,9 +30,8 @@
|
|||||||
</span> -->
|
</span> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
|
||||||
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
|
range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
|
||||||
@change="changeTime">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
|
||||||
@ -67,8 +66,14 @@
|
|||||||
<!-- <div class="smallTitle">产量转化效率</div> -->
|
<!-- <div class="smallTitle">产量转化效率</div> -->
|
||||||
|
|
||||||
<!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
|
<!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
|
||||||
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
<el-col :span="16">
|
||||||
:chartNum="chartNum" />
|
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
||||||
|
:chartNum="chartNum" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId=" 'yearChart' "
|
||||||
|
:chartNum="chartNum" />
|
||||||
|
</el-col>
|
||||||
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
||||||
:max-height="tableH" />
|
:max-height="tableH" />
|
||||||
</div>
|
</div>
|
||||||
@ -79,57 +84,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import bmSearchBar from "./components/bmSearchBar.vue";
|
import { getProduceSituationData } from '@/api/report';
|
||||||
|
import bmSearchBar from "./components/produceLineBar.vue";
|
||||||
import BmLineBar from "./components/bmLineBar.vue";
|
import BmLineBar from "./components/bmLineBar.vue";
|
||||||
import ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
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,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableProps,
|
otherProps: [],
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 999,
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: null,
|
factory: null,
|
||||||
@ -157,89 +126,63 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
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(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
{
|
||||||
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
id: 1, name: "综合良率", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
{ id: 2, name: "标准组件产量", type: 1, color: "#8EF0AB" },
|
||||||
|
{ id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
|
||||||
|
{ id: 3, name: "fto投入", type: 1, color: "#64BDFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ['#64BDFF', "#8EF0AB", "#288AFF", "#FFCE6A",],
|
||||||
xData: ["成都", "邯郸", "瑞昌"],
|
xData: [],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "2024年4月目标值",
|
name: "",
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 85 },
|
// { name: "%", value: 57.5 },
|
||||||
{ name: "%", value: 85 },
|
// { name: "%", value: 21.66 },
|
||||||
{ name: "%", value: 85 },
|
// { name: "%", value: 18.4 },
|
||||||
],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2023年4月",
|
|
||||||
data: [
|
|
||||||
{ name: "%", value: 57.5 },
|
|
||||||
{ name: "%", value: 21.66 },
|
|
||||||
{ name: "%", value: 18.4 },
|
|
||||||
],
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: [-18, -16],
|
position: [-18, -16],
|
||||||
color: "#68C483",
|
color: "#64BDFF",
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
return params.value.toFixed(2) + "%";
|
return params.value.toFixed(2) + "%";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2024年4月",
|
name: "",
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 23.33 },
|
// { name: "%", value: 23.33 },
|
||||||
{ name: "%", value: 7.02 },
|
// { name: "%", value: 7.02 },
|
||||||
{ name: "%", value: 80.2 },
|
// { name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 20,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: [0, -16],
|
||||||
|
color: "#8EF0AB",
|
||||||
|
formatter: function (params) {
|
||||||
|
return params.value.toFixed(2) + "%";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "",
|
||||||
|
data: [
|
||||||
|
// { name: "%", value: 23.33 },
|
||||||
|
// { name: "%", value: 7.02 },
|
||||||
|
// { name: "%", value: 80.2 },
|
||||||
],
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
@ -252,6 +195,24 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "",
|
||||||
|
data: [
|
||||||
|
// { name: "%", value: 85 },
|
||||||
|
// { name: "%", value: 85 },
|
||||||
|
// { name: "%", value: 85 },
|
||||||
|
],
|
||||||
|
type: "line",
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
color: "#FFAE17",
|
||||||
|
formatter: function (params) {
|
||||||
|
return params.value.toFixed(2) + "%";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
chartId: "chipYieldBMChart",
|
chartId: "chipYieldBMChart",
|
||||||
@ -264,6 +225,31 @@ export default {
|
|||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "工厂名称",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "item",
|
||||||
|
label: "科目",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...this.otherProps
|
||||||
|
]
|
||||||
|
},
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
@ -296,7 +282,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -354,8 +340,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -407,14 +393,132 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
|
this.otherProps = []
|
||||||
|
this.chartMsg.xData = []
|
||||||
console.log(this.listQuery);
|
console.log(this.listQuery);
|
||||||
if (this.listQuery.type == 3) {
|
if (this.listQuery.type == 3) {
|
||||||
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
|
let arr = []
|
||||||
const res = await getComprehensiveDataPage(this.listQuery)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
||||||
this.tableData = res.data.list
|
this.listQuery.factory = arr
|
||||||
|
const res = await getProduceSituationData(this.listQuery)
|
||||||
|
let dataArr = [{
|
||||||
|
factory: null,
|
||||||
|
item: 'FTO投入',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '芯片产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '标准组件产量',
|
||||||
|
unit: '片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
factory: null,
|
||||||
|
item: '综合良率',
|
||||||
|
unit: '%'
|
||||||
|
},]
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
this.chartMsg.xData.push(ele.titleValue)
|
||||||
|
this.otherProps.push({
|
||||||
|
label: ele.titleValue,
|
||||||
|
props: 'value' + i
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(this.otherProps)
|
||||||
|
res.data.list.forEach((ele, index) => {
|
||||||
|
let i = index + 1
|
||||||
|
let m = 'value' + i
|
||||||
|
ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
dataArr[0]['' + m + ''] = item.ftoInput
|
||||||
|
dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
||||||
|
dataArr[1]['' + m + ''] = item.chipYield
|
||||||
|
dataArr[2]['' + m + ''] = item.componentYield
|
||||||
|
dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
|
||||||
|
})
|
||||||
|
// ele.titleValue
|
||||||
|
// .push({
|
||||||
|
// label: ele.titleValue,
|
||||||
|
// props: 'value' + index + 1,
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// this.tableProps = otherProps
|
||||||
|
// res.data.list.forEach((ele) => {
|
||||||
|
// console.log(ele);
|
||||||
|
// ele.productionSituationDataVOList.forEach((item) => {
|
||||||
|
// let obj = {
|
||||||
|
// bipvProductOutput: item.bipvProductOutput,
|
||||||
|
// chipYield: item.chipYield,
|
||||||
|
// componentYield: item.componentYield,
|
||||||
|
// factory: item.factory,
|
||||||
|
// ftoInput: item.ftoInput,
|
||||||
|
// titleValue:ele.titleValue
|
||||||
|
// }
|
||||||
|
// dataArr.push(obj)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
for (let i in dataArr[0]) {
|
||||||
|
// console.log(i.search('value'))
|
||||||
|
// dataArr.forEach((ele) => {
|
||||||
|
this.chartMsg.series[0].name = dataArr[0]['item']
|
||||||
|
if (i.search('value') === 0) {
|
||||||
|
this.chartMsg.series[0].data.push({
|
||||||
|
name: dataArr[0]['item'],
|
||||||
|
value: dataArr[0][i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
for (let i in dataArr[1]) {
|
||||||
|
// console.log(i.search('value'))
|
||||||
|
// dataArr.forEach((ele) => {
|
||||||
|
this.chartMsg.series[1].name = dataArr[1]['item']
|
||||||
|
if (i.search('value') === 0) {
|
||||||
|
this.chartMsg.series[1].data.push({
|
||||||
|
name: dataArr[1]['item'],
|
||||||
|
value: dataArr[1][i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
for (let i in dataArr[2]) {
|
||||||
|
// console.log(i.search('value'))
|
||||||
|
// dataArr.forEach((ele) => {
|
||||||
|
this.chartMsg.series[2].name = dataArr[2]['item']
|
||||||
|
if (i.search('value') === 0) {
|
||||||
|
this.chartMsg.series[2].data.push({
|
||||||
|
name: dataArr[2]['item'],
|
||||||
|
value: dataArr[2][i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
for (let i in dataArr[3]) {
|
||||||
|
// console.log(i.search('value'))
|
||||||
|
// dataArr.forEach((ele) => {
|
||||||
|
this.chartMsg.series[3].name = dataArr[3]['item']
|
||||||
|
if (i.search('value') === 0) {
|
||||||
|
this.chartMsg.series[3].data.push({
|
||||||
|
name: dataArr[3]['item'],
|
||||||
|
value: dataArr[3][i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
console.log(this.chartMsg.series)
|
||||||
|
console.log(dataArr)
|
||||||
|
this.tableData = dataArr
|
||||||
|
// this.tableProps.push()
|
||||||
this.listQuery.total = res.data.total
|
this.listQuery.total = res.data.total
|
||||||
if (this.listQuery.total > 0) {
|
if (this.listQuery.total > 0) {
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
|
Loading…
Reference in New Issue
Block a user